Skip to content

Commit 3377397

Browse files
committed
Clean up symfonycom extension
1 parent f9b3f70 commit 3377397

File tree

3 files changed

+1
-213
lines changed

3 files changed

+1
-213
lines changed

_build/_static/rtd_custom.css

Lines changed: 0 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -21,137 +21,3 @@ p, .rst-content li{
2121
background:#1e2125 !important;
2222
color:#fafafa !important;
2323
}
24-
.bp {
25-
color:#3465a4 !important;
26-
}
27-
.c, .c1, .cm, .cs {
28-
color:#d15eed !important;
29-
font-style:italic !important;
30-
}
31-
.cp {
32-
color:#a0a0a0 !important;
33-
}
34-
.err {
35-
color:#a40000 !important;
36-
border:1px solid #ef2929 !important;
37-
}
38-
.g {
39-
color:#fff !important;
40-
}
41-
.gd {
42-
color:#a40000 !important;
43-
}
44-
.ge {
45-
color:#fff !important;
46-
font-style:italic !important;
47-
}
48-
.gh {
49-
color:navy !important;
50-
}
51-
.gi {
52-
color:#00a000 !important;
53-
}
54-
.go {
55-
color:grey !important;
56-
}
57-
.gp {
58-
color:#745334 !important;
59-
}
60-
.gr {
61-
color:#ef2929 !important;
62-
}
63-
.gs {
64-
color:#fff !important;
65-
}
66-
.gs,
67-
.gt {
68-
font-weight:700 !important;
69-
}
70-
.gt {
71-
color:#a40000 !important;
72-
}
73-
.gu {
74-
color:purple !important;
75-
font-weight:700 !important;
76-
}
77-
.hll {
78-
background-color:#ff3 !important;
79-
}
80-
.il {
81-
color:#1299da !important;
82-
}
83-
.k, .kc, .kd, .kn, .kp, .kr, .kt {
84-
color:#ff8400 !important;
85-
}
86-
.l, .ld {
87-
color:#fff !important;
88-
}
89-
.m, .mf, .mh, .mi, .mo {
90-
color:#1299da !important;
91-
}
92-
.n, .na, .nb, .nc, .nf, .nn, .no, .nv, .nx {
93-
color:#fff !important;
94-
}
95-
.nd {
96-
color:grey !important;
97-
}
98-
.ne {
99-
color:#ef2929 !important;
100-
}
101-
.nl {
102-
color:#ff8400 !important;
103-
}
104-
.nt {
105-
color:#ccc !important;
106-
}
107-
.ni, .o, .ow {
108-
color:#e67700 !important;
109-
}
110-
.p {
111-
color:#939393 !important;
112-
}
113-
.py {
114-
color:#fff !important;
115-
}
116-
.s, .s1, .s2, .sb, .sc, .se, .sh, .si, .sr, .ss, .sx {
117-
color:#56db3a !important;
118-
}
119-
.sd {
120-
color:#d15eed !important;
121-
font-style:italic !important;
122-
}
123-
.vc, .vg, .vi {
124-
color:#fff !important;
125-
}
126-
.w {
127-
color:#f8f8f8 !important;
128-
text-decoration:underline !important;
129-
}
130-
.x {
131-
color:#fff !important;
132-
}
133-
.p-Indicator {
134-
color:#ff8400 !important;
135-
}
136-
.highlight-rst .gh {
137-
color:#fff !important;
138-
}
139-
.highlight-php .highlight .err {
140-
border:0 !important;
141-
color:inherit !important;
142-
}
143-
.highlight-diff .highlight>pre {
144-
padding-left:1.5em !important;
145-
}
146-
.highlight-diff .gi {
147-
background:rgba(51,102,102,.4) !important;
148-
color:#8c8 !important;
149-
margin-left:-15px !important;
150-
padding:2px 0 2px 1px !important;
151-
}
152-
.highlight-diff .gd {
153-
background:rgba(102,51,51,.6) !important;
154-
color:#c88 !important;
155-
margin-left:-15px !important;
156-
padding:2px 0 2px 1px !important;
157-
}
Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,7 @@
1-
from sphinx.highlighting import lexers, PygmentsBridge
21
from pygments.style import Style
3-
from pygments.formatters import HtmlFormatter
42
from pygments.token import Keyword, Name, Comment, String, Error, \
53
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
64

7-
from sphinx.writers.html import HTMLTranslator
8-
from docutils import nodes
9-
from sphinx.locale import admonitionlabels, lazy_gettext
10-
11-
customadmonitionlabels = admonitionlabels
12-
l_ = lazy_gettext
13-
customadmonitionlabels['best-practice'] = l_('Best Practice')
14-
15-
def _getType(path):
16-
return path[:path.find('/')]
17-
18-
def _isIndex(path):
19-
return 'index' in path
20-
21-
class SensioHTMLTranslator(HTMLTranslator):
22-
def __init__(self, builder, *args, **kwds):
23-
HTMLTranslator.__init__(self, builder, *args, **kwds)
24-
builder.templates.environment.filters['get_type'] = _getType
25-
builder.templates.environment.tests['index'] = _isIndex
26-
27-
def visit_literal(self, node):
28-
self.body.append(self.starttag(node, 'code', '', CLASS='docutils literal notranslate'))
29-
30-
def depart_literal(self, node):
31-
self.body.append('</code>')
32-
33-
def visit_admonition(self, node, name=''):
34-
self.body.append(self.starttag(node, 'div', CLASS=('admonition-wrapper')))
35-
self.body.append('<div class="admonition ' + name + '">')
36-
if name and name != 'seealso':
37-
node.insert(0, nodes.title(name, customadmonitionlabels[name]))
38-
self.set_first_last(node)
39-
40-
def depart_admonition(self, node=None):
41-
self.body.append('</div></div>\n')
42-
43-
def visit_sidebar(self, node):
44-
self.body.append(self.starttag(node, 'div', CLASS=('admonition-wrapper')))
45-
self.body.append('<div class="admonition admonition-sidebar">')
46-
self.set_first_last(node)
47-
self.in_sidebar = 1
48-
49-
def depart_sidebar(self, node):
50-
self.body.append('</div></div>\n')
51-
self.in_sidebar = None
52-
53-
# overriden to add a new highlight div around each block
54-
def visit_literal_block(self, node):
55-
if node.rawsource != node.astext():
56-
# most probably a parsed-literal block -- don't highlight
57-
return BaseTranslator.visit_literal_block(self, node)
58-
lang = self.highlightlang
59-
linenos = node.rawsource.count('\n') >= \
60-
self.highlightlinenothreshold - 1
61-
highlight_args = node.get('highlight_args', {})
62-
if node.has_key('language'):
63-
# code-block directives
64-
lang = node['language']
65-
highlight_args['force'] = True
66-
if node.has_key('linenos'):
67-
linenos = node['linenos']
68-
def warner(msg):
69-
self.builder.warn(msg, (self.builder.current_docname, node.line))
70-
highlighted = self.highlighter.highlight_block(
71-
node.rawsource, lang, warn=warner, linenos=linenos,
72-
**highlight_args)
73-
starttag = self.starttag(node, 'div', suffix='',
74-
CLASS='highlight-%s' % lang)
75-
self.body.append('<div class="literal-block">' + starttag + highlighted + '</div></div>\n')
76-
raise nodes.SkipNode
77-
785
class SensioStyle(Style):
796
background_color = "#000000"
807
default_style = ""
@@ -157,8 +84,3 @@ class SensioStyle(Style):
15784
Generic.Subheading: "bold #800080", # class: 'gu'
15885
Generic.Traceback: "bold #a40000", # class: 'gt'
15986
}
160-
161-
def setup(app):
162-
app.set_translator('html', SensioHTMLTranslator)
163-
164-
return {'parallel_read_safe': True}

_build/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
#show_authors = False
101101

102102
# The name of the Pygments (syntax highlighting) style to use.
103-
pygments_style = 'sphinx'
103+
pygments_style = 'symfonycom.sphinx.SensioStyle'
104104

105105
# A list of ignored prefixes for module index sorting.
106106
#modindex_common_prefix = []

0 commit comments

Comments
 (0)