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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ba2e135a901e431badeb43ed260ac0328e989c0e
4
- data.tar.gz: 497d621b020dae18a892877a670e25eab141dac4
3
+ metadata.gz: 216b27009d51155a59aa00c6ea107ba15617c493
4
+ data.tar.gz: e22c1a28edaff57ff060a98c772b4ded2fc6370c
5
5
  SHA512:
6
- metadata.gz: 199cbd714975aec603d2cd9d6bc9ade114f4e073652b32fbbfbfca5127ab81ab1a587609bafa20c75ce5351ed0c34d93a246792f11f14ff3b510ef880e32cd39
7
- data.tar.gz: 0d429b9532d24a0b9800c0b44d741fe92d389a73a3ed90e45715b8834f13420306b66533976d2a2ba84b98099a650f4277ced260aaff6f5b71d1dc2e5ae70cee
6
+ metadata.gz: 5291f6b31d67fbb75e7630defd4d4d2bb265100d88e48cfb73264c62d828bc65619e197c31d4b4dc25e50063410baec5141308d549ccf1065beea23ddb851419
7
+ data.tar.gz: 348298df2c87487252cf2174ca51675429d0a877d3bd24ca7d92ababbb0672332ef984e532c6149df3d346dcc203fd1f767a263ed7c39bddc8414357599cd96d
@@ -13,9 +13,6 @@ variables:
13
13
  script:
14
14
  - bundle exec rake test
15
15
 
16
- ruby-20:
17
- image: ruby:2.0
18
- <<: *specs
19
16
  ruby-21:
20
17
  image: ruby:2.1
21
18
  <<: *specs
data/HISTORY.md CHANGED
@@ -1,4 +1,4 @@
1
- ## 1.6.1 (2017-09-20)
1
+ ## 1.6.2 (2017-09-20)
2
2
 
3
3
  * Support PlantUML blocks in reStructuredText
4
4
 
@@ -1,6 +1,6 @@
1
1
  module GitHub
2
2
  module Markup
3
- VERSION = '1.6.1'
3
+ VERSION = '1.6.2'
4
4
  Version = VERSION
5
5
  end
6
6
  end
@@ -79,7 +79,18 @@ class DoctestDirective(CodeBlock):
79
79
  return super(DoctestDirective, self).run()
80
80
 
81
81
 
82
- class GitHubHTMLTranslator(HTMLTranslator):
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', lang=language))
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
- A block of code
20
+ <code>
21
+ A block of code</code>
21
22
  </pre>
22
- <pre lang="python">
23
- python.code('hooray')
23
+ <pre>
24
+ <code lang="python">
25
+ python.code('hooray')</code>
24
26
  </pre>
25
- <pre lang="python">
27
+ <pre>
28
+ <code lang="python">
26
29
  &gt;&gt;&gt; some_function()
27
- 'result'
30
+ 'result'</code>
28
31
  </pre>
29
32
  <table>
30
33
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-markup
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Wanstrath