summaryrefslogtreecommitdiffstats
path: root/third_party/python/PyYAML/examples/yaml-highlight/yaml_hl.cfg
blob: 69bb8477648179b1011df44e90fd71a09f398b85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
%YAML 1.1
---

ascii:

    header: "\e[0;1;30;40m"

    footer: "\e[0m"

    tokens:
        stream-start:
        stream-end:
        directive:              { start: "\e[35m", end: "\e[0;1;30;40m" }
        document-start:         { start: "\e[35m", end: "\e[0;1;30;40m" }
        document-end:           { start: "\e[35m", end: "\e[0;1;30;40m" }
        block-sequence-start:
        block-mapping-start:
        block-end:
        flow-sequence-start:    { start: "\e[33m", end: "\e[0;1;30;40m" }
        flow-mapping-start:     { start: "\e[33m", end: "\e[0;1;30;40m" }
        flow-sequence-end:      { start: "\e[33m", end: "\e[0;1;30;40m" }
        flow-mapping-end:       { start: "\e[33m", end: "\e[0;1;30;40m" }
        key:                    { start: "\e[33m", end: "\e[0;1;30;40m" }
        value:                  { start: "\e[33m", end: "\e[0;1;30;40m" }
        block-entry:            { start: "\e[33m", end: "\e[0;1;30;40m" }
        flow-entry:             { start: "\e[33m", end: "\e[0;1;30;40m" }
        alias:                  { start: "\e[32m", end: "\e[0;1;30;40m" }
        anchor:                 { start: "\e[32m", end: "\e[0;1;30;40m" }
        tag:                    { start: "\e[32m", end: "\e[0;1;30;40m" }
        scalar:                 { start: "\e[36m", end: "\e[0;1;30;40m" }

    replaces:
        - "\r\n":   "\n"
        - "\r":     "\n"
        - "\n":     "\n"
        - "\x85":   "\n"
        - "\u2028": "\n"
        - "\u2029": "\n"

html: &html

    tokens:
        stream-start:
        stream-end:
        directive:              { start: <code class="directive_token">, end: </code> }
        document-start:         { start: <code class="document_start_token">, end: </code> }
        document-end:           { start: <code class="document_end_token">, end: </code> }
        block-sequence-start:
        block-mapping-start:
        block-end:
        flow-sequence-start:    { start: <code class="delimiter_token">, end: </code> }
        flow-mapping-start:     { start: <code class="delimiter_token">, end: </code> }
        flow-sequence-end:      { start: <code class="delimiter_token">, end: </code> }
        flow-mapping-end:       { start: <code class="delimiter_token">, end: </code> }
        key:                    { start: <code class="delimiter_token">, end: </code> }
        value:                  { start: <code class="delimiter_token">, end: </code> }
        block-entry:            { start: <code class="delimiter_token">, end: </code> }
        flow-entry:             { start: <code class="delimiter_token">, end: </code> }
        alias:                  { start: <code class="anchor_token">, end: </code> }
        anchor:                 { start: <code class="anchor_token">, end: </code> }
        tag:                    { start: <code class="tag_token">, end: </code> }
        scalar:                 { start: <code class="scalar_token">, end: </code> }

    events:
        stream-start:   { start: <pre class="yaml_stream"> }
        stream-end:     { end: </pre> }
        document-start: { start: <span class="document"> }
        document-end:   { end: </span> }
        sequence-start: { start: <span class="sequence"> }
        sequence-end:   { end: </span> }
        mapping-start:  { start: <span class="mapping"> }
        mapping-end:    { end: </span> }
        scalar:         { start: <span class="scalar">, end: </span> }

    replaces:
        - "\r\n":   "\n"
        - "\r":     "\n"
        - "\n":     "\n"
        - "\x85":   "\n"
        - "\u2028": "\n"
        - "\u2029": "\n"
        - "&":      "&amp;"
        - "<":      "&lt;"
        - ">":      "&gt;"

html-page:

    header: |
        <html>
        <head>
        <title>A YAML stream</title>
        <style type="text/css">
            .document { background: #FFF }
            .sequence { background: #EEF }
            .mapping { background: #EFE }
            .scalar { background: #FEE }
            .directive_token { color: #C0C }
            .document_start_token { color: #C0C; font-weight: bold }
            .document_end_token { color: #C0C; font-weight: bold }
            .delimiter_token { color: #600; font-weight: bold }
            .anchor_token { color: #090 }
            .tag_token { color: #090 }
            .scalar_token { color: #000 }
            .yaml_stream { color: #999 }
        </style>
        <body>

    footer: |
        </body>
        </html>

    <<: *html


# vim: ft=yaml