gitlab-markup 1.6.1 → 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +0 -3
- data/HISTORY.md +1 -1
- data/lib/github-markup.rb +1 -1
- data/lib/github/commands/rest2html +23 -2
- data/test/markups/README.rst.html +8 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 216b27009d51155a59aa00c6ea107ba15617c493
|
4
|
+
data.tar.gz: e22c1a28edaff57ff060a98c772b4ded2fc6370c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5291f6b31d67fbb75e7630defd4d4d2bb265100d88e48cfb73264c62d828bc65619e197c31d4b4dc25e50063410baec5141308d549ccf1065beea23ddb851419
|
7
|
+
data.tar.gz: 348298df2c87487252cf2174ca51675429d0a877d3bd24ca7d92ababbb0672332ef984e532c6149df3d346dcc203fd1f767a263ed7c39bddc8414357599cd96d
|
data/.gitlab-ci.yml
CHANGED
data/HISTORY.md
CHANGED
data/lib/github-markup.rb
CHANGED
@@ -79,7 +79,18 @@ class DoctestDirective(CodeBlock):
|
|
79
79
|
return super(DoctestDirective, self).run()
|
80
80
|
|
81
81
|
|
82
|
-
class
|
82
|
+
class PlantumlDirective(CodeBlock):
|
83
|
+
"""
|
84
|
+
Render 'plantuml::' blocks as 'code:: plantuml', so they will be
|
85
|
+
picked up in GitLab by the generic Banzai::Filter::PlantumlFilter
|
86
|
+
"""
|
87
|
+
|
88
|
+
def run(self):
|
89
|
+
self.arguments = ['plantuml']
|
90
|
+
return super(PlantumlDirective, self).run()
|
91
|
+
|
92
|
+
|
93
|
+
class GitHubHTMLTranslator(HTMLTranslator, object):
|
83
94
|
|
84
95
|
# removes the <div class="document"> tag wrapped around docs
|
85
96
|
# see also: http://bit.ly/1exfq2h (warning! sourceforge link.)
|
@@ -104,9 +115,16 @@ class GitHubHTMLTranslator(HTMLTranslator):
|
|
104
115
|
if len(classes) >= 2 and classes[0] == 'code':
|
105
116
|
language = classes[1]
|
106
117
|
del classes[:]
|
107
|
-
self.body.append(self.starttag(node, 'pre'
|
118
|
+
self.body.append(self.starttag(node, 'pre'))
|
119
|
+
self.body.append(self.starttag(node, 'code', lang=language))
|
108
120
|
else:
|
109
121
|
self.body.append(self.starttag(node, 'pre'))
|
122
|
+
self.body.append(self.starttag(node, 'code'))
|
123
|
+
|
124
|
+
def depart_literal_block(self, node):
|
125
|
+
self.body.append('</code>')
|
126
|
+
|
127
|
+
return super(GitHubHTMLTranslator, self).depart_literal_block(node)
|
110
128
|
|
111
129
|
# always wrap two-backtick rst inline literals in <code>, not <tt>
|
112
130
|
# this also avoids the generation of superfluous <span> tags
|
@@ -179,6 +197,9 @@ def main():
|
|
179
197
|
# Render source code in Sphinx doctest blocks
|
180
198
|
directives.register_directive('doctest', DoctestDirective)
|
181
199
|
|
200
|
+
# Render source code in Sphinx plantuml blocks
|
201
|
+
directives.register_directive('plantuml', PlantumlDirective)
|
202
|
+
|
182
203
|
parts = publish_parts(text, writer=writer, settings_overrides=SETTINGS)
|
183
204
|
if 'html_body' in parts:
|
184
205
|
html = parts['html_body']
|
@@ -17,14 +17,17 @@
|
|
17
17
|
</ol>
|
18
18
|
<p>The UTF-8 quote character in this table used to cause python to go boom. Now docutils just silently ignores it.</p>
|
19
19
|
<pre>
|
20
|
-
|
20
|
+
<code>
|
21
|
+
A block of code</code>
|
21
22
|
</pre>
|
22
|
-
<pre
|
23
|
-
python
|
23
|
+
<pre>
|
24
|
+
<code lang="python">
|
25
|
+
python.code('hooray')</code>
|
24
26
|
</pre>
|
25
|
-
<pre
|
27
|
+
<pre>
|
28
|
+
<code lang="python">
|
26
29
|
>>> some_function()
|
27
|
-
'result'
|
30
|
+
'result'</code>
|
28
31
|
</pre>
|
29
32
|
<table>
|
30
33
|
|