Skip to content

Commit ede52de

Browse files
committed
feature #111 [Themes] Upgrade to rtd 1.0.0rc1 and override incompatible default changes (wouterj)
This PR was merged into the main branch. Discussion ---------- [Themes] Upgrade to rtd 1.0.0rc1 and override incompatible default changes This new version is a bit nicer imho :) (especially with definition lists) We also changed some templates in the `default` theme for the symfony.com styling, but this broke the rtd theme. I've added the original templates to the rtd theme in order to fix our CI builds. I've also recommended using this tool to check transitions to reStructuredText for some bundle authors, so not seeing headlines and code examples is a bit of a shock for them. Commits ------- 9fb8765 Upgrade to rtd 1.0.0rc1 and override incompatible default changes
2 parents 554351e + 9fb8765 commit ede52de

File tree

8 files changed

+105
-11
lines changed

8 files changed

+105
-11
lines changed

src/Templates/rtd/assets/css/badge_only.css

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
3+
Visual Studio-like style based on original C# coloring by Jason Diamond <jason@diamond.name>
4+
5+
*/
6+
.hljs {
7+
display: block;
8+
overflow-x: auto;
9+
padding: 0.5em;
10+
background: white;
11+
color: black;
12+
}
13+
14+
.hljs-comment,
15+
.hljs-quote,
16+
.hljs-variable {
17+
color: #008000;
18+
}
19+
20+
.hljs-keyword,
21+
.hljs-selector-tag,
22+
.hljs-built_in,
23+
.hljs-name,
24+
.hljs-tag {
25+
color: #00f;
26+
}
27+
28+
.hljs-string,
29+
.hljs-title,
30+
.hljs-section,
31+
.hljs-attribute,
32+
.hljs-literal,
33+
.hljs-template-tag,
34+
.hljs-template-variable,
35+
.hljs-type,
36+
.hljs-addition {
37+
color: #a31515;
38+
}
39+
40+
.hljs-deletion,
41+
.hljs-selector-attr,
42+
.hljs-selector-pseudo,
43+
.hljs-meta {
44+
color: #2b91af;
45+
}
46+
47+
.hljs-doctag {
48+
color: #808080;
49+
}
50+
51+
.hljs-attr {
52+
color: #f00;
53+
}
54+
55+
.hljs-symbol,
56+
.hljs-bullet,
57+
.hljs-link {
58+
color: #00b0e8;
59+
}
60+
61+
62+
.hljs-emphasis {
63+
font-style: italic;
64+
}
65+
66+
.hljs-strong {
67+
font-weight: bold;
68+
}

src/Templates/rtd/assets/css/theme.css

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Templates/rtd/assets/js/badge_only.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Templates/rtd/assets/js/theme.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Templates/rtd/html/code.html.twig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<div translate="no" class="{{ languages|map(language => "highlight-#{language}")|join(' ') }} notranslate">
2+
<table class="highlighttable">
3+
<tbody>
4+
<tr>
5+
<td class="linenos">
6+
<div class="linenodiv">
7+
<pre>{{ line_numbers }}</pre>
8+
</div>
9+
</td>
10+
<td class="code">
11+
<div class="highlight">
12+
<pre class="hljs {{ languages|join(' ') }}">{{ code|raw }}</pre>
13+
</div>
14+
</td>
15+
</tr>
16+
</tbody>
17+
</table>
18+
</div>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<h{{ titleNode.level }} id="{{ titleNode.id }}">
2+
{{ titleNode.value.render()|raw }}
3+
<a class="headerlink" href="#{{ titleNode.id }}" title="Permalink to this headline">¶</a>
4+
</h{{ titleNode.level }}>

src/Templates/rtd/html/layout.html.twig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,9 @@
3232
{# CSS #}
3333

3434
<link rel="stylesheet" href="{{ asset('css/theme.css') }}" type="text/css" />
35+
<link rel="stylesheet" href="{{ asset('css/highlightjs.css') }}" type="text/css" />
3536
<link rel="stylesheet" href="{{ asset('css/badge_only.css') }}" type="text/css" />
3637

37-
{# Keep modernizr in head - http://modernizr.com/docs/#installing #}
38-
<script src="{{ asset('js/modernizr.min.js') }}"></script>
39-
4038
</head>
4139

4240
<body class="wy-body-for-nav">
@@ -137,6 +135,7 @@
137135
{#{%- endfor %}#}
138136

139137
<script type="text/javascript" src="{{ asset('js/theme.js') }}"></script>
138+
<script type="text/javascript" src="{{ asset('js/badge_only.js') }}"></script>
140139

141140
{#<script type="text/javascript">#}
142141
{#jQuery(function () {#}

0 commit comments

Comments
 (0)