gitlab-markup 1.6.2 → 1.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +4 -0
- data/lib/github-markup.rb +1 -1
- data/lib/github/commands/rest2html +21 -2
- data/test/markups/README.rst +11 -1
- data/test/markups/README.rst.html +11 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82795809627f394f8c953c348cd41b408fb3b205
|
4
|
+
data.tar.gz: 8ad6727f7393d9e0206dc7227b32a14931102448
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18a7fde6790047ac49d7269835ef78747e8514b68e5c0cfe1ba8564ce2ddab30b23f9fb9c5fa3767412c1bd129d1b5dfce880c305eaee3bd522ac547dc7efa1a
|
7
|
+
data.tar.gz: b8ace4828588e671f59c6f8a184e9443819542a0b26526a2180d66e8edfdff8c4cf0979e130c27149c6a303aaedf813215463d2600aae000557c0cd77b576493
|
data/HISTORY.md
CHANGED
data/lib/github-markup.rb
CHANGED
@@ -47,7 +47,7 @@ except:
|
|
47
47
|
import codecs
|
48
48
|
import io
|
49
49
|
|
50
|
-
from docutils import nodes
|
50
|
+
from docutils import nodes, statemachine
|
51
51
|
from docutils.parsers.rst import directives, roles
|
52
52
|
from docutils.parsers.rst.directives.body import CodeBlock
|
53
53
|
from docutils.core import publish_parts
|
@@ -85,9 +85,25 @@ class PlantumlDirective(CodeBlock):
|
|
85
85
|
picked up in GitLab by the generic Banzai::Filter::PlantumlFilter
|
86
86
|
"""
|
87
87
|
|
88
|
+
option_spec = CodeBlock.option_spec.copy()
|
89
|
+
option_spec.update({
|
90
|
+
'caption': directives.unchanged
|
91
|
+
})
|
92
|
+
|
88
93
|
def run(self):
|
89
94
|
self.arguments = ['plantuml']
|
90
|
-
|
95
|
+
node = super(PlantumlDirective, self).run()
|
96
|
+
|
97
|
+
if 'caption' in self.options:
|
98
|
+
# create an anonymous container to parse the caption content
|
99
|
+
container = nodes.Element()
|
100
|
+
content = statemachine.StringList([self.options['caption']])
|
101
|
+
self.state.nested_parse(content, self.content_offset, container)
|
102
|
+
caption = nodes.caption(self.options['caption'], '', *container)
|
103
|
+
|
104
|
+
node.append(caption)
|
105
|
+
|
106
|
+
return node
|
91
107
|
|
92
108
|
|
93
109
|
class GitHubHTMLTranslator(HTMLTranslator, object):
|
@@ -112,6 +128,7 @@ class GitHubHTMLTranslator(HTMLTranslator, object):
|
|
112
128
|
|
113
129
|
def visit_literal_block(self, node):
|
114
130
|
classes = node.attributes['classes']
|
131
|
+
|
115
132
|
if len(classes) >= 2 and classes[0] == 'code':
|
116
133
|
language = classes[1]
|
117
134
|
del classes[:]
|
@@ -198,7 +215,9 @@ def main():
|
|
198
215
|
directives.register_directive('doctest', DoctestDirective)
|
199
216
|
|
200
217
|
# Render source code in Sphinx plantuml blocks
|
218
|
+
# Also support uml:: directive for compatibility with sphinxcontrib-plantuml
|
201
219
|
directives.register_directive('plantuml', PlantumlDirective)
|
220
|
+
directives.register_directive('uml', PlantumlDirective)
|
202
221
|
|
203
222
|
parts = publish_parts(text, writer=writer, settings_overrides=SETTINGS)
|
204
223
|
if 'html_body' in parts:
|
data/test/markups/README.rst
CHANGED
@@ -73,7 +73,17 @@ someone@somewhere.org
|
|
73
73
|
|
74
74
|
Press :kbd:`Ctrl+C` to quit
|
75
75
|
|
76
|
-
|
77
76
|
.. raw:: html
|
78
77
|
|
79
78
|
<p><strong>RAW HTML!</strong></p><style> p {color:blue;} </style>
|
79
|
+
|
80
|
+
.. plantuml::
|
81
|
+
:caption: Caption with **bold** and *italic*
|
82
|
+
|
83
|
+
Bob -> Alice: hello
|
84
|
+
Alice -> Bob: Go Away
|
85
|
+
|
86
|
+
.. uml::
|
87
|
+
|
88
|
+
Bob -> Alice: hello
|
89
|
+
Alice -> Bob: Go Away
|
@@ -90,4 +90,14 @@ but no problem!</td>
|
|
90
90
|
<p><a href="mailto:someone@somewhere.org">someone@somewhere.org</a></p>
|
91
91
|
|
92
92
|
<p>Press <kbd>Ctrl+C</kbd> to quit</p>
|
93
|
-
|
93
|
+
<pre>
|
94
|
+
<code lang="plantuml">
|
95
|
+
Bob -> Alice: hello
|
96
|
+
Alice -> Bob: Go Away</code>
|
97
|
+
</pre>
|
98
|
+
<p>Caption with <strong>bold</strong> and <em>italic</em></p>
|
99
|
+
<pre>
|
100
|
+
<code lang="plantuml">
|
101
|
+
Bob -> Alice: hello
|
102
|
+
Alice -> Bob: Go Away</code>
|
103
|
+
</pre>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-markup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Wanstrath
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|