Show More
@@ -1,138 +1,137 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 | """ |
|
2 | """ | |
3 | rhodecode.lib.markup_renderer |
|
3 | rhodecode.lib.markup_renderer | |
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
5 |
|
5 | |||
6 |
|
6 | |||
7 | Renderer for markup languages with ability to parse using rst or markdown |
|
7 | Renderer for markup languages with ability to parse using rst or markdown | |
8 |
|
8 | |||
9 | :created_on: Oct 27, 2011 |
|
9 | :created_on: Oct 27, 2011 | |
10 | :author: marcink |
|
10 | :author: marcink | |
11 | :copyright: (C) 2011-2012 Marcin Kuzminski <marcin@python-works.com> |
|
11 | :copyright: (C) 2011-2012 Marcin Kuzminski <marcin@python-works.com> | |
12 | :license: GPLv3, see COPYING for more details. |
|
12 | :license: GPLv3, see COPYING for more details. | |
13 | """ |
|
13 | """ | |
14 | # This program is free software: you can redistribute it and/or modify |
|
14 | # This program is free software: you can redistribute it and/or modify | |
15 | # it under the terms of the GNU General Public License as published by |
|
15 | # it under the terms of the GNU General Public License as published by | |
16 | # the Free Software Foundation, either version 3 of the License, or |
|
16 | # the Free Software Foundation, either version 3 of the License, or | |
17 | # (at your option) any later version. |
|
17 | # (at your option) any later version. | |
18 | # |
|
18 | # | |
19 | # This program is distributed in the hope that it will be useful, |
|
19 | # This program is distributed in the hope that it will be useful, | |
20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
22 | # GNU General Public License for more details. |
|
22 | # GNU General Public License for more details. | |
23 | # |
|
23 | # | |
24 | # You should have received a copy of the GNU General Public License |
|
24 | # You should have received a copy of the GNU General Public License | |
25 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
25 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
26 |
|
26 | |||
27 | import re |
|
27 | import re | |
28 | import logging |
|
28 | import logging | |
29 |
|
29 | |||
30 | from rhodecode.lib import safe_unicode |
|
30 | from rhodecode.lib import safe_unicode | |
31 |
|
31 | |||
32 | log = logging.getLogger(__name__) |
|
32 | log = logging.getLogger(__name__) | |
33 |
|
33 | |||
|
34 | ||||
34 | class MarkupRenderer(object): |
|
35 | class MarkupRenderer(object): | |
35 | RESTRUCTUREDTEXT_DISALLOWED_DIRECTIVES = ['include', 'meta', 'raw'] |
|
36 | RESTRUCTUREDTEXT_DISALLOWED_DIRECTIVES = ['include', 'meta', 'raw'] | |
36 |
|
37 | |||
37 | MARKDOWN_PAT = re.compile(r'md|mkdn?|mdown|markdown',re.IGNORECASE) |
|
38 | MARKDOWN_PAT = re.compile(r'md|mkdn?|mdown|markdown', re.IGNORECASE) | |
38 | RST_PAT = re.compile(r're?st',re.IGNORECASE) |
|
39 | RST_PAT = re.compile(r're?st', re.IGNORECASE) | |
39 | PLAIN_PAT = re.compile(r'readme',re.IGNORECASE) |
|
40 | PLAIN_PAT = re.compile(r'readme', re.IGNORECASE) | |
40 |
|
41 | |||
41 | def __detect_renderer(self, source, filename=None): |
|
42 | def __detect_renderer(self, source, filename=None): | |
42 | """ |
|
43 | """ | |
43 | runs detection of what renderer should be used for generating html |
|
44 | runs detection of what renderer should be used for generating html | |
44 | from a markup language |
|
45 | from a markup language | |
45 |
|
46 | |||
46 | filename can be also explicitly a renderer name |
|
47 | filename can be also explicitly a renderer name | |
47 |
|
48 | |||
48 | :param source: |
|
49 | :param source: | |
49 | :param filename: |
|
50 | :param filename: | |
50 | """ |
|
51 | """ | |
51 |
|
52 | |||
52 | if MarkupRenderer.MARKDOWN_PAT.findall(filename): |
|
53 | if MarkupRenderer.MARKDOWN_PAT.findall(filename): | |
53 | detected_renderer = 'markdown' |
|
54 | detected_renderer = 'markdown' | |
54 | elif MarkupRenderer.RST_PAT.findall(filename): |
|
55 | elif MarkupRenderer.RST_PAT.findall(filename): | |
55 | detected_renderer = 'rst' |
|
56 | detected_renderer = 'rst' | |
56 | elif MarkupRenderer.PLAIN_PAT.findall(filename): |
|
57 | elif MarkupRenderer.PLAIN_PAT.findall(filename): | |
57 | detected_renderer = 'rst' |
|
58 | detected_renderer = 'rst' | |
58 | else: |
|
59 | else: | |
59 | detected_renderer = 'plain' |
|
60 | detected_renderer = 'plain' | |
60 |
|
61 | |||
61 | return getattr(MarkupRenderer, detected_renderer) |
|
62 | return getattr(MarkupRenderer, detected_renderer) | |
62 |
|
63 | |||
63 |
|
||||
64 | def render(self, source, filename=None): |
|
64 | def render(self, source, filename=None): | |
65 | """ |
|
65 | """ | |
66 | Renders a given filename using detected renderer |
|
66 | Renders a given filename using detected renderer | |
67 | it detects renderers based on file extension or mimetype. |
|
67 | it detects renderers based on file extension or mimetype. | |
68 | At last it will just do a simple html replacing new lines with <br/> |
|
68 | At last it will just do a simple html replacing new lines with <br/> | |
69 |
|
69 | |||
70 | :param file_name: |
|
70 | :param file_name: | |
71 | :param source: |
|
71 | :param source: | |
72 | """ |
|
72 | """ | |
73 |
|
73 | |||
74 | renderer = self.__detect_renderer(source, filename) |
|
74 | renderer = self.__detect_renderer(source, filename) | |
75 | readme_data = renderer(source) |
|
75 | readme_data = renderer(source) | |
76 | return readme_data |
|
76 | return readme_data | |
77 |
|
77 | |||
78 | @classmethod |
|
78 | @classmethod | |
79 | def plain(cls, source): |
|
79 | def plain(cls, source): | |
80 | source = safe_unicode(source) |
|
80 | source = safe_unicode(source) | |
|
81 | ||||
81 | def urlify_text(text): |
|
82 | def urlify_text(text): | |
82 | url_pat = re.compile(r'(http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]' |
|
83 | url_pat = re.compile(r'(http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]' | |
83 | '|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+)') |
|
84 | '|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+)') | |
84 |
|
85 | |||
85 | def url_func(match_obj): |
|
86 | def url_func(match_obj): | |
86 | url_full = match_obj.groups()[0] |
|
87 | url_full = match_obj.groups()[0] | |
87 | return '<a href="%(url)s">%(url)s</a>' % ({'url':url_full}) |
|
88 | return '<a href="%(url)s">%(url)s</a>' % ({'url': url_full}) | |
88 |
|
89 | |||
89 | return url_pat.sub(url_func, text) |
|
90 | return url_pat.sub(url_func, text) | |
90 |
|
91 | |||
91 | source = urlify_text(source) |
|
92 | source = urlify_text(source) | |
92 | return '<br />' + source.replace("\n", '<br />') |
|
93 | return '<br />' + source.replace("\n", '<br />') | |
93 |
|
94 | |||
94 |
|
||||
95 | @classmethod |
|
95 | @classmethod | |
96 | def markdown(cls, source): |
|
96 | def markdown(cls, source): | |
97 | source = safe_unicode(source) |
|
97 | source = safe_unicode(source) | |
98 | try: |
|
98 | try: | |
99 | import markdown as __markdown |
|
99 | import markdown as __markdown | |
100 | return __markdown.markdown(source) |
|
100 | return __markdown.markdown(source, ['codehilite']) | |
101 | except ImportError: |
|
101 | except ImportError: | |
102 | log.warning('Install markdown to use this function') |
|
102 | log.warning('Install markdown to use this function') | |
103 | return cls.plain(source) |
|
103 | return cls.plain(source) | |
104 |
|
104 | |||
105 |
|
||||
106 | @classmethod |
|
105 | @classmethod | |
107 | def rst(cls, source): |
|
106 | def rst(cls, source): | |
108 | source = safe_unicode(source) |
|
107 | source = safe_unicode(source) | |
109 | try: |
|
108 | try: | |
110 | from docutils.core import publish_parts |
|
109 | from docutils.core import publish_parts | |
111 | from docutils.parsers.rst import directives |
|
110 | from docutils.parsers.rst import directives | |
112 | docutils_settings = dict([(alias, None) for alias in |
|
111 | docutils_settings = dict([(alias, None) for alias in | |
113 | cls.RESTRUCTUREDTEXT_DISALLOWED_DIRECTIVES]) |
|
112 | cls.RESTRUCTUREDTEXT_DISALLOWED_DIRECTIVES]) | |
114 |
|
113 | |||
115 | docutils_settings.update({'input_encoding': 'unicode', |
|
114 | docutils_settings.update({'input_encoding': 'unicode', | |
116 | 'report_level':4}) |
|
115 | 'report_level': 4}) | |
117 |
|
116 | |||
118 | for k, v in docutils_settings.iteritems(): |
|
117 | for k, v in docutils_settings.iteritems(): | |
119 | directives.register_directive(k, v) |
|
118 | directives.register_directive(k, v) | |
120 |
|
119 | |||
121 | parts = publish_parts(source=source, |
|
120 | parts = publish_parts(source=source, | |
122 | writer_name="html4css1", |
|
121 | writer_name="html4css1", | |
123 | settings_overrides=docutils_settings) |
|
122 | settings_overrides=docutils_settings) | |
124 |
|
123 | |||
125 | return parts['html_title'] + parts["fragment"] |
|
124 | return parts['html_title'] + parts["fragment"] | |
126 | except ImportError: |
|
125 | except ImportError: | |
127 | log.warning('Install docutils to use this function') |
|
126 | log.warning('Install docutils to use this function') | |
128 | return cls.plain(source) |
|
127 | return cls.plain(source) | |
129 |
|
128 | |||
130 | @classmethod |
|
129 | @classmethod | |
131 | def rst_with_mentions(cls, source): |
|
130 | def rst_with_mentions(cls, source): | |
132 | mention_pat = re.compile(r'(?:^@|\s@)(\w+)') |
|
131 | mention_pat = re.compile(r'(?:^@|\s@)(\w+)') | |
133 |
|
132 | |||
134 | def wrapp(match_obj): |
|
133 | def wrapp(match_obj): | |
135 | uname = match_obj.groups()[0] |
|
134 | uname = match_obj.groups()[0] | |
136 | return ' **@%(uname)s** ' % {'uname':uname} |
|
135 | return ' **@%(uname)s** ' % {'uname':uname} | |
137 | mention_hl = mention_pat.sub(wrapp, source).strip() |
|
136 | mention_hl = mention_pat.sub(wrapp, source).strip() | |
138 | return cls.rst(mention_hl) |
|
137 | return cls.rst(mention_hl) |
@@ -1,169 +1,169 b'' | |||||
1 | div.codeblock { |
|
1 | div.codeblock { | |
2 | overflow: auto; |
|
2 | overflow: auto; | |
3 | padding: 0px; |
|
3 | padding: 0px; | |
4 | border: 1px solid #ccc; |
|
4 | border: 1px solid #ccc; | |
5 | background: #f8f8f8; |
|
5 | background: #f8f8f8; | |
6 | font-size: 100%; |
|
6 | font-size: 100%; | |
7 | line-height: 100%; |
|
7 | line-height: 100%; | |
8 | /* new */ |
|
8 | /* new */ | |
9 | line-height: 125%; |
|
9 | line-height: 125%; | |
10 | -webkit-border-radius: 4px; |
|
10 | -webkit-border-radius: 4px; | |
11 | -moz-border-radius: 4px; |
|
11 | -moz-border-radius: 4px; | |
12 | border-radius: 4px; |
|
12 | border-radius: 4px; | |
13 | } |
|
13 | } | |
14 | div.codeblock .code-header{ |
|
14 | div.codeblock .code-header{ | |
15 | border-bottom: 1px solid #CCCCCC; |
|
15 | border-bottom: 1px solid #CCCCCC; | |
16 | background: #EEEEEE; |
|
16 | background: #EEEEEE; | |
17 | padding:10px 0 10px 0; |
|
17 | padding:10px 0 10px 0; | |
18 | } |
|
18 | } | |
19 |
|
19 | |||
20 | div.codeblock .code-header .stats{ |
|
20 | div.codeblock .code-header .stats{ | |
21 | clear: both; |
|
21 | clear: both; | |
22 | margin-top:-3px; |
|
22 | margin-top:-3px; | |
23 | padding-left: 8px; |
|
23 | padding-left: 8px; | |
24 | border-bottom: 1px solid rgb(204, 204, 204); |
|
24 | border-bottom: 1px solid rgb(204, 204, 204); | |
25 | margin-bottom: 5px; height: 23px; |
|
25 | margin-bottom: 5px; height: 23px; | |
26 | } |
|
26 | } | |
27 |
|
27 | |||
28 | div.codeblock .code-header .stats .left{ |
|
28 | div.codeblock .code-header .stats .left{ | |
29 | float:left; |
|
29 | float:left; | |
30 | } |
|
30 | } | |
31 | div.codeblock .code-header .stats .left.item{ |
|
31 | div.codeblock .code-header .stats .left.item{ | |
32 | float:left; |
|
32 | float:left; | |
33 | padding: 0 9px 0 9px; |
|
33 | padding: 0 9px 0 9px; | |
34 | border-right:1px solid #ccc; |
|
34 | border-right:1px solid #ccc; | |
35 | } |
|
35 | } | |
36 | div.codeblock .code-header .stats .left.item.last{ |
|
36 | div.codeblock .code-header .stats .left.item.last{ | |
37 | border-right:none; |
|
37 | border-right:none; | |
38 | } |
|
38 | } | |
39 | div.codeblock .code-header .stats .buttons{ |
|
39 | div.codeblock .code-header .stats .buttons{ | |
40 | float:right; |
|
40 | float:right; | |
41 | padding-right:4px; |
|
41 | padding-right:4px; | |
42 | } |
|
42 | } | |
43 |
|
43 | |||
44 | div.codeblock .code-header .author{ |
|
44 | div.codeblock .code-header .author{ | |
45 | margin-left:25px; |
|
45 | margin-left:25px; | |
46 | font-weight: bold; |
|
46 | font-weight: bold; | |
47 | height: 25px; |
|
47 | height: 25px; | |
48 | } |
|
48 | } | |
49 | div.codeblock .code-header .author .user{ |
|
49 | div.codeblock .code-header .author .user{ | |
50 | padding-top:3px; |
|
50 | padding-top:3px; | |
51 | } |
|
51 | } | |
52 | div.codeblock .code-header .commit{ |
|
52 | div.codeblock .code-header .commit{ | |
53 | margin-left:25px; |
|
53 | margin-left:25px; | |
54 | font-weight: normal; |
|
54 | font-weight: normal; | |
55 | white-space:pre; |
|
55 | white-space:pre; | |
56 | } |
|
56 | } | |
57 |
|
57 | |||
58 | div.codeblock .code-body table{ |
|
58 | div.codeblock .code-body table{ | |
59 | width: 0 !important; |
|
59 | width: 0 !important; | |
60 | border: 0px !important; |
|
60 | border: 0px !important; | |
61 | } |
|
61 | } | |
62 | div.codeblock .code-body table td { |
|
62 | div.codeblock .code-body table td { | |
63 | border: 0px !important; |
|
63 | border: 0px !important; | |
64 | } |
|
64 | } | |
65 | div.code-body { |
|
65 | div.code-body { | |
66 | background-color: #FFFFFF; |
|
66 | background-color: #FFFFFF; | |
67 | } |
|
67 | } | |
68 |
|
68 | |||
69 | div.codeblock .code-header .search-path { |
|
69 | div.codeblock .code-header .search-path { | |
70 | padding: 0px 0px 0px 10px; |
|
70 | padding: 0px 0px 0px 10px; | |
71 | } |
|
71 | } | |
72 |
|
72 | |||
73 | div.search-code-body { |
|
73 | div.search-code-body { | |
74 | background-color: #FFFFFF; |
|
74 | background-color: #FFFFFF; | |
75 | padding: 5px 0px 5px 10px; |
|
75 | padding: 5px 0px 5px 10px; | |
76 | } |
|
76 | } | |
77 |
|
77 | |||
78 | div.search-code-body pre .match{ |
|
78 | div.search-code-body pre .match{ | |
79 | background-color: #FAFFA6; |
|
79 | background-color: #FAFFA6; | |
80 | } |
|
80 | } | |
81 | div.search-code-body pre .break{ |
|
81 | div.search-code-body pre .break{ | |
82 | background-color: #DDE7EF; |
|
82 | background-color: #DDE7EF; | |
83 | width: 100%; |
|
83 | width: 100%; | |
84 | color: #747474; |
|
84 | color: #747474; | |
85 | display: block; |
|
85 | display: block; | |
86 |
|
86 | |||
87 | } |
|
87 | } | |
88 | div.annotatediv{ |
|
88 | div.annotatediv{ | |
89 | margin-left:2px; |
|
89 | margin-left:2px; | |
90 | margin-right:4px; |
|
90 | margin-right:4px; | |
91 | } |
|
91 | } | |
92 | .code-highlight { |
|
92 | .code-highlight { | |
93 | padding: 0px; |
|
93 | padding: 0px; | |
94 | margin-top: 5px; |
|
94 | margin-top: 5px; | |
95 | margin-bottom: 5px; |
|
95 | margin-bottom: 5px; | |
96 | border-left: 2px solid #ccc; |
|
96 | border-left: 2px solid #ccc; | |
97 | } |
|
97 | } | |
98 | .code-highlight pre, .linenodiv pre { |
|
98 | .code-highlight pre, .linenodiv pre { | |
99 | padding: 5px; |
|
99 | padding: 5px; | |
100 | margin: 0; |
|
100 | margin: 0; | |
101 | } |
|
101 | } | |
102 | .code-highlight pre div:target { |
|
102 | .code-highlight pre div:target { | |
103 | background-color: #FFFFBE !important; |
|
103 | background-color: #FFFFBE !important; | |
104 | } |
|
104 | } | |
105 |
|
105 | |||
106 | .linenos a { text-decoration: none; } |
|
106 | .linenos a { text-decoration: none; } | |
107 |
|
107 | |||
108 | .code { display: block; } |
|
108 | .code { display: block; } | |
109 | .code-highlight .hll { background-color: #ffffcc } |
|
109 | .code-highlight .hll, .codehilite .hll { background-color: #ffffcc } | |
110 | .code-highlight .c { color: #408080; font-style: italic } /* Comment */ |
|
110 | .code-highlight .c, .codehilite .c { color: #408080; font-style: italic } /* Comment */ | |
111 | .code-highlight .err { border: 1px solid #FF0000 } /* Error */ |
|
111 | .code-highlight .err, .codehilite .err { border: 1px solid #FF0000 } /* Error */ | |
112 | .code-highlight .k { color: #008000; font-weight: bold } /* Keyword */ |
|
112 | .code-highlight .k, .codehilite .k { color: #008000; font-weight: bold } /* Keyword */ | |
113 | .code-highlight .o { color: #666666 } /* Operator */ |
|
113 | .code-highlight .o, .codehilite .o { color: #666666 } /* Operator */ | |
114 | .code-highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */ |
|
114 | .code-highlight .cm, .codehilite .cm { color: #408080; font-style: italic } /* Comment.Multiline */ | |
115 | .code-highlight .cp { color: #BC7A00 } /* Comment.Preproc */ |
|
115 | .code-highlight .cp, .codehilite .cp { color: #BC7A00 } /* Comment.Preproc */ | |
116 | .code-highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */ |
|
116 | .code-highlight .c1, .codehilite .c1 { color: #408080; font-style: italic } /* Comment.Single */ | |
117 | .code-highlight .cs { color: #408080; font-style: italic } /* Comment.Special */ |
|
117 | .code-highlight .cs, .codehilite .cs { color: #408080; font-style: italic } /* Comment.Special */ | |
118 | .code-highlight .gd { color: #A00000 } /* Generic.Deleted */ |
|
118 | .code-highlight .gd, .codehilite .gd { color: #A00000 } /* Generic.Deleted */ | |
119 | .code-highlight .ge { font-style: italic } /* Generic.Emph */ |
|
119 | .code-highlight .ge, .codehilite .ge { font-style: italic } /* Generic.Emph */ | |
120 | .code-highlight .gr { color: #FF0000 } /* Generic.Error */ |
|
120 | .code-highlight .gr, .codehilite .gr { color: #FF0000 } /* Generic.Error */ | |
121 | .code-highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ |
|
121 | .code-highlight .gh, .codehilite .gh { color: #000080; font-weight: bold } /* Generic.Heading */ | |
122 | .code-highlight .gi { color: #00A000 } /* Generic.Inserted */ |
|
122 | .code-highlight .gi, .codehilite .gi { color: #00A000 } /* Generic.Inserted */ | |
123 | .code-highlight .go { color: #808080 } /* Generic.Output */ |
|
123 | .code-highlight .go, .codehilite .go { color: #808080 } /* Generic.Output */ | |
124 | .code-highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ |
|
124 | .code-highlight .gp, .codehilite .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ | |
125 | .code-highlight .gs { font-weight: bold } /* Generic.Strong */ |
|
125 | .code-highlight .gs, .codehilite .gs { font-weight: bold } /* Generic.Strong */ | |
126 | .code-highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ |
|
126 | .code-highlight .gu, .codehilite .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ | |
127 | .code-highlight .gt { color: #0040D0 } /* Generic.Traceback */ |
|
127 | .code-highlight .gt, .codehilite .gt { color: #0040D0 } /* Generic.Traceback */ | |
128 | .code-highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ |
|
128 | .code-highlight .kc, .codehilite .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ | |
129 | .code-highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ |
|
129 | .code-highlight .kd, .codehilite .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ | |
130 | .code-highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ |
|
130 | .code-highlight .kn, .codehilite .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ | |
131 | .code-highlight .kp { color: #008000 } /* Keyword.Pseudo */ |
|
131 | .code-highlight .kp, .codehilite .kp { color: #008000 } /* Keyword.Pseudo */ | |
132 | .code-highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ |
|
132 | .code-highlight .kr, .codehilite .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ | |
133 | .code-highlight .kt { color: #B00040 } /* Keyword.Type */ |
|
133 | .code-highlight .kt, .codehilite .kt { color: #B00040 } /* Keyword.Type */ | |
134 | .code-highlight .m { color: #666666 } /* Literal.Number */ |
|
134 | .code-highlight .m, .codehilite .m { color: #666666 } /* Literal.Number */ | |
135 | .code-highlight .s { color: #BA2121 } /* Literal.String */ |
|
135 | .code-highlight .s, .codehilite .s { color: #BA2121 } /* Literal.String */ | |
136 | .code-highlight .na { color: #7D9029 } /* Name.Attribute */ |
|
136 | .code-highlight .na, .codehilite .na { color: #7D9029 } /* Name.Attribute */ | |
137 | .code-highlight .nb { color: #008000 } /* Name.Builtin */ |
|
137 | .code-highlight .nb, .codehilite .nb { color: #008000 } /* Name.Builtin */ | |
138 | .code-highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */ |
|
138 | .code-highlight .nc, .codehilite .nc { color: #0000FF; font-weight: bold } /* Name.Class */ | |
139 | .code-highlight .no { color: #880000 } /* Name.Constant */ |
|
139 | .code-highlight .no, .codehilite .no { color: #880000 } /* Name.Constant */ | |
140 | .code-highlight .nd { color: #AA22FF } /* Name.Decorator */ |
|
140 | .code-highlight .nd, .codehilite .nd { color: #AA22FF } /* Name.Decorator */ | |
141 | .code-highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */ |
|
141 | .code-highlight .ni, .codehilite .ni { color: #999999; font-weight: bold } /* Name.Entity */ | |
142 | .code-highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ |
|
142 | .code-highlight .ne, .codehilite .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ | |
143 | .code-highlight .nf { color: #0000FF } /* Name.Function */ |
|
143 | .code-highlight .nf, .codehilite .nf { color: #0000FF } /* Name.Function */ | |
144 | .code-highlight .nl { color: #A0A000 } /* Name.Label */ |
|
144 | .code-highlight .nl, .codehilite .nl { color: #A0A000 } /* Name.Label */ | |
145 | .code-highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ |
|
145 | .code-highlight .nn, .codehilite .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ | |
146 | .code-highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */ |
|
146 | .code-highlight .nt, .codehilite .nt { color: #008000; font-weight: bold } /* Name.Tag */ | |
147 | .code-highlight .nv { color: #19177C } /* Name.Variable */ |
|
147 | .code-highlight .nv, .codehilite .nv { color: #19177C } /* Name.Variable */ | |
148 | .code-highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ |
|
148 | .code-highlight .ow, .codehilite .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ | |
149 | .code-highlight .w { color: #bbbbbb } /* Text.Whitespace */ |
|
149 | .code-highlight .w, .codehilite .w { color: #bbbbbb } /* Text.Whitespace */ | |
150 | .code-highlight .mf { color: #666666 } /* Literal.Number.Float */ |
|
150 | .code-highlight .mf, .codehilite .mf { color: #666666 } /* Literal.Number.Float */ | |
151 | .code-highlight .mh { color: #666666 } /* Literal.Number.Hex */ |
|
151 | .code-highlight .mh, .codehilite .mh { color: #666666 } /* Literal.Number.Hex */ | |
152 | .code-highlight .mi { color: #666666 } /* Literal.Number.Integer */ |
|
152 | .code-highlight .mi, .codehilite .mi { color: #666666 } /* Literal.Number.Integer */ | |
153 | .code-highlight .mo { color: #666666 } /* Literal.Number.Oct */ |
|
153 | .code-highlight .mo, .codehilite .mo { color: #666666 } /* Literal.Number.Oct */ | |
154 | .code-highlight .sb { color: #BA2121 } /* Literal.String.Backtick */ |
|
154 | .code-highlight .sb, .codehilite .sb { color: #BA2121 } /* Literal.String.Backtick */ | |
155 | .code-highlight .sc { color: #BA2121 } /* Literal.String.Char */ |
|
155 | .code-highlight .sc, .codehilite .sc { color: #BA2121 } /* Literal.String.Char */ | |
156 | .code-highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ |
|
156 | .code-highlight .sd, .codehilite .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ | |
157 | .code-highlight .s2 { color: #BA2121 } /* Literal.String.Double */ |
|
157 | .code-highlight .s2, .codehilite .s2 { color: #BA2121 } /* Literal.String.Double */ | |
158 | .code-highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ |
|
158 | .code-highlight .se, .codehilite .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ | |
159 | .code-highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */ |
|
159 | .code-highlight .sh, .codehilite .sh { color: #BA2121 } /* Literal.String.Heredoc */ | |
160 | .code-highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ |
|
160 | .code-highlight .si, .codehilite .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ | |
161 | .code-highlight .sx { color: #008000 } /* Literal.String.Other */ |
|
161 | .code-highlight .sx, .codehilite .sx { color: #008000 } /* Literal.String.Other */ | |
162 | .code-highlight .sr { color: #BB6688 } /* Literal.String.Regex */ |
|
162 | .code-highlight .sr, .codehilite .sr { color: #BB6688 } /* Literal.String.Regex */ | |
163 | .code-highlight .s1 { color: #BA2121 } /* Literal.String.Single */ |
|
163 | .code-highlight .s1, .codehilite .s1 { color: #BA2121 } /* Literal.String.Single */ | |
164 | .code-highlight .ss { color: #19177C } /* Literal.String.Symbol */ |
|
164 | .code-highlight .ss, .codehilite .ss { color: #19177C } /* Literal.String.Symbol */ | |
165 | .code-highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */ |
|
165 | .code-highlight .bp, .codehilite .bp { color: #008000 } /* Name.Builtin.Pseudo */ | |
166 | .code-highlight .vc { color: #19177C } /* Name.Variable.Class */ |
|
166 | .code-highlight .vc, .codehilite .vc { color: #19177C } /* Name.Variable.Class */ | |
167 | .code-highlight .vg { color: #19177C } /* Name.Variable.Global */ |
|
167 | .code-highlight .vg, .codehilite .vg { color: #19177C } /* Name.Variable.Global */ | |
168 | .code-highlight .vi { color: #19177C } /* Name.Variable.Instance */ |
|
168 | .code-highlight .vi, .codehilite .vi { color: #19177C } /* Name.Variable.Instance */ | |
169 | .code-highlight .il { color: #666666 } /* Literal.Number.Integer.Long */ |
|
169 | .code-highlight .il, .codehilite .il { color: #666666 } /* Literal.Number.Integer.Long */ |
General Comments 0
You need to be logged in to leave comments.
Login now