gitlab-markup 1.5.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +5 -0
  3. data/.gitlab-ci.yml +27 -0
  4. data/.kick +26 -0
  5. data/.travis.yml +21 -0
  6. data/CONTRIBUTING.md +49 -0
  7. data/Gemfile +13 -0
  8. data/HISTORY.md +128 -0
  9. data/LICENSE +20 -0
  10. data/README.md +58 -0
  11. data/Rakefile +17 -0
  12. data/bin/github-markup +10 -0
  13. data/gitlab-markup.gemspec +25 -0
  14. data/lib/github-markup.rb +6 -0
  15. data/lib/github/commands/rest2html +200 -0
  16. data/lib/github/markup.rb +55 -0
  17. data/lib/github/markup/command_implementation.rb +71 -0
  18. data/lib/github/markup/gem_implementation.rb +30 -0
  19. data/lib/github/markup/implementation.rb +28 -0
  20. data/lib/github/markup/markdown.rb +60 -0
  21. data/lib/github/markup/rdoc.rb +26 -0
  22. data/lib/github/markups.rb +50 -0
  23. data/script/bootstrap +8 -0
  24. data/script/cibuild +20 -0
  25. data/test/fixtures/fail.sh +3 -0
  26. data/test/markup_test.rb +116 -0
  27. data/test/markups/README.asciidoc +23 -0
  28. data/test/markups/README.asciidoc.html +59 -0
  29. data/test/markups/README.creole +34 -0
  30. data/test/markups/README.creole.html +20 -0
  31. data/test/markups/README.litcoffee +59 -0
  32. data/test/markups/README.litcoffee.html +66 -0
  33. data/test/markups/README.markdown +2 -0
  34. data/test/markups/README.markdown.html +4 -0
  35. data/test/markups/README.mediawiki +30 -0
  36. data/test/markups/README.mediawiki.html +60 -0
  37. data/test/markups/README.noformat +2 -0
  38. data/test/markups/README.noformat.html +2 -0
  39. data/test/markups/README.org +131 -0
  40. data/test/markups/README.org.html +139 -0
  41. data/test/markups/README.pod +88 -0
  42. data/test/markups/README.pod.html +85 -0
  43. data/test/markups/README.rdoc +6 -0
  44. data/test/markups/README.rdoc.html +12 -0
  45. data/test/markups/README.rmd +3 -0
  46. data/test/markups/README.rmd.html +6 -0
  47. data/test/markups/README.rst +79 -0
  48. data/test/markups/README.rst.html +91 -0
  49. data/test/markups/README.rst.txt +21 -0
  50. data/test/markups/README.rst.txt.html +37 -0
  51. data/test/markups/README.textile +2 -0
  52. data/test/markups/README.textile.html +4 -0
  53. data/test/markups/README.toc.rst +30 -0
  54. data/test/markups/README.toc.rst.html +32 -0
  55. data/test/markups/README.txt +2 -0
  56. data/test/markups/README.txt.html +2 -0
  57. metadata +216 -0
@@ -0,0 +1,23 @@
1
+ = Document Title
2
+
3
+ == First Section
4
+
5
+ * One
6
+ * Two
7
+
8
+ Refer to <<another-section>> or <<another-section-1>>.
9
+
10
+ == Another Section
11
+
12
+ NOTE: Here is some source code.
13
+
14
+ ```ruby
15
+ puts "Hello, World!"
16
+ ```
17
+
18
+ * [ ] todo
19
+ * [x] done
20
+
21
+ == Another Section
22
+
23
+ content
@@ -0,0 +1,59 @@
1
+ <h1>Document Title</h1>
2
+ <div>
3
+ <h2>First Section</h2>
4
+ <div>
5
+ <div>
6
+ <ul>
7
+ <li>
8
+ <p>One</p>
9
+ </li>
10
+ <li>
11
+ <p>Two</p>
12
+ </li>
13
+ </ul>
14
+ </div>
15
+ <div>
16
+ <p>Refer to <a href="#another-section">Another Section</a> or <a href="#another-section-1">Another Section</a>.</p>
17
+ </div>
18
+ </div>
19
+ </div>
20
+ <div>
21
+ <h2>Another Section</h2>
22
+ <div>
23
+ <div>
24
+ <table>
25
+ <tr>
26
+ <td>
27
+ <div>Note</div>
28
+ </td>
29
+ <td>
30
+ Here is some source code.
31
+ </td>
32
+ </tr>
33
+ </table>
34
+ </div>
35
+ <div>
36
+ <div>
37
+ <pre lang="ruby"><code>puts "Hello, World!"</code></pre>
38
+ </div>
39
+ </div>
40
+ <div>
41
+ <ul>
42
+ <li>
43
+ <p>❏ todo</p>
44
+ </li>
45
+ <li>
46
+ <p>✓ done</p>
47
+ </li>
48
+ </ul>
49
+ </div>
50
+ </div>
51
+ </div>
52
+ <div>
53
+ <h2>Another Section</h2>
54
+ <div>
55
+ <div>
56
+ <p>content</p>
57
+ </div>
58
+ </div>
59
+ </div>
@@ -0,0 +1,34 @@
1
+ = H1 =
2
+
3
+ == H2 ==
4
+
5
+ paragraph of text that will be turned into a paragraph element. It can
6
+ go over several lines with line breaks, it will be turned into a
7
+ contiguous paragraph element.
8
+
9
+ You can force a linebreak in your paragraph text\\thusly.
10
+
11
+
12
+ * a list element
13
+ ** sub list element
14
+ * 2nd list element
15
+
16
+ {{{
17
+ pre formatted text
18
+
19
+ $ ls -la
20
+ total 56
21
+ drwxr-xr-x 6 nferrier users 4096 Jul 5 23:10 .
22
+ drwxr-x--- 120 nferrier users 12288 Jul 5 19:36 ..
23
+ drwxr-xr-x 2 nferrier users 4096 Jul 5 18:19 bin
24
+ -rw-r--r-- 1 nferrier users 6 Jul 5 18:19 .gitignore
25
+ drwxr-xr-x 4 nferrier users 4096 Jul 5 23:10 .hg
26
+ -rw-r--r-- 1 nferrier users 1182 Jul 5 18:19 HISTORY.md
27
+ -rw-r--r-- 1 nferrier users 562 Jul 5 18:19 .kick
28
+ drwxr-xr-x 3 nferrier users 4096 Jul 5 18:19 lib
29
+ -rw-r--r-- 1 nferrier users 1050 Jul 5 18:19 LICENSE
30
+ -rw-r--r-- 1 nferrier users 1312 Jul 5 18:19 Rakefile
31
+ -rw-r--r-- 1 nferrier users 3390 Jul 5 18:19 README.md
32
+ drwxr-xr-x 3 nferrier users 4096 Jul 5 18:19 test
33
+ }}}
34
+
@@ -0,0 +1,20 @@
1
+ <h1>H1</h1><h2>H2</h2><p>paragraph of text that will be turned into a paragraph element. It can go over several lines with line breaks, it will be turned into a contiguous paragraph element.</p><p>You can force a linebreak in your paragraph text<br>thusly.</p><ul>
2
+ <li>a list element<ul><li>sub list element</li></ul>
3
+ </li>
4
+ <li>2nd list element</li>
5
+ </ul><pre>pre formatted text
6
+
7
+ $ ls -la
8
+ total 56
9
+ drwxr-xr-x 6 nferrier users 4096 Jul 5 23:10 .
10
+ drwxr-x--- 120 nferrier users 12288 Jul 5 19:36 ..
11
+ drwxr-xr-x 2 nferrier users 4096 Jul 5 18:19 bin
12
+ -rw-r--r-- 1 nferrier users 6 Jul 5 18:19 .gitignore
13
+ drwxr-xr-x 4 nferrier users 4096 Jul 5 23:10 .hg
14
+ -rw-r--r-- 1 nferrier users 1182 Jul 5 18:19 HISTORY.md
15
+ -rw-r--r-- 1 nferrier users 562 Jul 5 18:19 .kick
16
+ drwxr-xr-x 3 nferrier users 4096 Jul 5 18:19 lib
17
+ -rw-r--r-- 1 nferrier users 1050 Jul 5 18:19 LICENSE
18
+ -rw-r--r-- 1 nferrier users 1312 Jul 5 18:19 Rakefile
19
+ -rw-r--r-- 1 nferrier users 3390 Jul 5 18:19 README.md
20
+ drwxr-xr-x 3 nferrier users 4096 Jul 5 18:19 test</pre>
@@ -0,0 +1,59 @@
1
+ Literate CoffeeScript Test
2
+ --------------------------
3
+
4
+ > Taken from https://github.com/jashkenas/coffee-script/blob/master/test/literate.litcoffee
5
+
6
+ comment comment
7
+
8
+ test "basic literate CoffeeScript parsing", ->
9
+ ok yes
10
+
11
+ now with a...
12
+
13
+ test "broken up indentation", ->
14
+
15
+ ... broken up ...
16
+
17
+ do ->
18
+
19
+ ... nested block.
20
+
21
+ ok yes
22
+
23
+ Code must be separated from text by a blank line.
24
+
25
+ test "code blocks must be preceded by a blank line", ->
26
+
27
+ The next line is part of the text and will not be executed.
28
+ fail()
29
+
30
+ ok yes
31
+
32
+ Code in `backticks is not parsed` and...
33
+
34
+ test "comments in indented blocks work", ->
35
+ do ->
36
+ do ->
37
+ # Regular comment.
38
+
39
+ ###
40
+ Block comment.
41
+ ###
42
+
43
+ ok yes
44
+
45
+ Regular [Markdown](http://example.com/markdown) features,
46
+ like links and unordered lists, are fine:
47
+
48
+ * I
49
+
50
+ * Am
51
+
52
+ * A
53
+
54
+ * List
55
+
56
+ Tabs work too:
57
+
58
+ test "tabbed code", ->
59
+ ok yes
@@ -0,0 +1,66 @@
1
+ <h2>Literate CoffeeScript Test</h2>
2
+
3
+ <blockquote>
4
+ <p>Taken from https://github.com/jashkenas/coffee-script/blob/master/test/literate.litcoffee</p>
5
+ </blockquote>
6
+
7
+ <p>comment comment</p>
8
+
9
+ <pre><code>test "basic literate CoffeeScript parsing", -&gt;
10
+ ok yes
11
+ </code></pre>
12
+
13
+ <p>now with a...</p>
14
+
15
+ <pre><code>test "broken up indentation", -&gt;
16
+ </code></pre>
17
+
18
+ <p>... broken up ...</p>
19
+
20
+ <pre><code> do -&gt;
21
+ </code></pre>
22
+
23
+ <p>... nested block.</p>
24
+
25
+ <pre><code> ok yes
26
+ </code></pre>
27
+
28
+ <p>Code must be separated from text by a blank line.</p>
29
+
30
+ <pre><code>test "code blocks must be preceded by a blank line", -&gt;
31
+ </code></pre>
32
+
33
+ <p>The next line is part of the text and will not be executed.
34
+ fail()</p>
35
+
36
+ <pre><code> ok yes
37
+ </code></pre>
38
+
39
+ <p>Code in <code>backticks is not parsed</code> and...</p>
40
+
41
+ <pre><code>test "comments in indented blocks work", -&gt;
42
+ do -&gt;
43
+ do -&gt;
44
+ # Regular comment.
45
+
46
+ ###
47
+ Block comment.
48
+ ###
49
+
50
+ ok yes
51
+ </code></pre>
52
+
53
+ <p>Regular <a href="http://example.com/markdown">Markdown</a> features,
54
+ like links and unordered lists, are fine:</p>
55
+
56
+ <ul>
57
+ <li><p>I</p></li>
58
+ <li><p>Am</p></li>
59
+ <li><p>A</p></li>
60
+ <li><p>List</p></li>
61
+ </ul>
62
+
63
+ <p>Tabs work too:</p>
64
+
65
+ <p>test "tabbed code", -&gt;
66
+ ok yes</p>
@@ -0,0 +1,2 @@
1
+ * One
2
+ * Two
@@ -0,0 +1,4 @@
1
+ <ul>
2
+ <li>One</li>
3
+ <li>Two</li>
4
+ </ul>
@@ -0,0 +1,30 @@
1
+ [[Home|&raquo; JRuby Project Wiki Home Page]]
2
+ <h1>Embedding JRuby</h1>
3
+ Using Java from Ruby is JRuby's best-known feature---but you can also go in the other direction, and use Ruby from Java. There are several different ways to do this. You can execute entire Ruby scripts, call individual Ruby methods, or even implement a Java interface in Ruby (thus allowing you to treat Ruby objects like Java ones). We refer to all these techniques generically as "embedding." This section will explain how to embed JRuby in your Java project.
4
+
5
+ __TOC__
6
+
7
+ = Red Bridge (JRuby Embed) =
8
+
9
+ <tt>one-<two</tt>
10
+ <pre>a-b</pre>
11
+
12
+ JRuby has long had a private embedding API, which was closely tied to the runtime's internals and therefore changed frequently as JRuby evolved. Since version 1.4, however, we have also provided a more stable public API, known as Red Bridge or JRuby Embed. Existing Java programs written to the [[DirectJRubyEmbedding|legacy API]] should still work, but we strongly recommend Red Bridge for all new projects.
13
+
14
+ == Features of Red Bridge ==
15
+ Red Bridge consists of two layers: Embed Core on the bottom, and implementations of [http://www.jcp.org/en/jsr/detail?id=223 JSR223] and [http://jakarta.apache.org/bsf/ BSF] on top. Embed Core is JRuby-specific, and can take advantage of much of JRuby's power. JSR223 and BSF are more general interfaces that provide a common ground across scripting languages.
16
+
17
+ Which API should you use? For projects where Ruby is the only scripting language involved, we recommend Embed Core for the following reasons:
18
+
19
+ # With Embed Core, you can create several Ruby environments in one JVM, and configure them individually (via <code>org.jruby.RubyInstanceConfig</code>. With the other APIs, configuration options can only be set globally, via the <code>System</code> properties.
20
+ # Embed Core offers several shortcuts, such as loading scripts from a <code>java.io.InputStream</code>, or returning Java-friendly objects from Ruby code. These allow you to skip a lot of boilerplate.
21
+
22
+ For projects requiring multiple scripting languages, JSR223 is a good fit. Though the API is language-independent, JRuby's implementation of it allows you to set some Ruby-specific options. In particular, you can control the threading model of the scripting engine, the lifetime of local variables, compilation mode, and how line numbers are displayed.
23
+
24
+ The full [http://jruby-embed.kenai.com/docs/ API documentation] has all the gory details. It's worth talking about a couple of the finer points here.
25
+
26
+ = Previous Embedding JRuby Page=
27
+ We recommend using Embed Core; however, if you're maintaining code that uses the old API, you can find its documentation on the [[JavaIntegration|legacy embedding]]<ref>This link goes nowhere.</ref> page.
28
+
29
+ = References =
30
+ <references/>
@@ -0,0 +1,60 @@
1
+ <p><a href="Home">» JRuby Project Wiki Home Page</a>
2
+ </p><h1>Embedding JRuby</h1>
3
+ Using Java from Ruby is JRuby's best-known feature---but you can also go in the other direction, and use Ruby from Java. There are several different ways to do this. You can execute entire Ruby scripts, call individual Ruby methods, or even implement a Java interface in Ruby (thus allowing you to treat Ruby objects like Java ones). We refer to all these techniques generically as "embedding." This section will explain how to embed JRuby in your Java project.
4
+
5
+ <p></p><table summary="Contents"><tr><td>
6
+ <div><h2>Table of Contents</h2></div>
7
+ <ul>
8
+ <li>
9
+ <a href="#Red_Bridge_JRuby_Embed">Red Bridge (JRuby Embed)</a><ul><li><a href="#Features_of_Red_Bridge">Features of Red Bridge</a></li></ul>
10
+ </li>
11
+ <li><a href="#Previous_Embedding_JRuby_Page">Previous Embedding JRuby Page</a></li>
12
+ <li><a href="#References">References</a></li>
13
+ </ul>
14
+ </td></tr></table>
15
+
16
+
17
+ <h1>
18
+ <a name="Red_Bridge_JRuby_Embed"></a>Red Bridge (JRuby Embed)</h1>
19
+
20
+
21
+ <p><tt>one-&lt;two</tt>
22
+ </p><pre>a-b</pre>
23
+
24
+
25
+ <p>JRuby has long had a private embedding API, which was closely tied to the runtime's internals and therefore changed frequently as JRuby evolved. Since version 1.4, however, we have also provided a more stable public API, known as Red Bridge or JRuby Embed. Existing Java programs written to the <a href="DirectJRubyEmbedding">legacy API</a> should still work, but we strongly recommend Red Bridge for all new projects.
26
+ </p>
27
+
28
+ <h2>
29
+ <a name="Features_of_Red_Bridge"></a>Features of Red Bridge</h2>
30
+
31
+
32
+ <p>Red Bridge consists of two layers: Embed Core on the bottom, and implementations of <a href="http://www.jcp.org/en/jsr/detail?id=223" target="_blank">JSR223</a> and <a href="http://jakarta.apache.org/bsf/" target="_blank">BSF</a> on top. Embed Core is JRuby-specific, and can take advantage of much of JRuby's power. JSR223 and BSF are more general interfaces that provide a common ground across scripting languages.
33
+ </p>
34
+ <p>Which API should you use? For projects where Ruby is the only scripting language involved, we recommend Embed Core for the following reasons:
35
+ </p>
36
+
37
+
38
+
39
+ <p></p><ol>
40
+ <li>With Embed Core, you can create several Ruby environments in one JVM, and configure them individually (via <code>org.jruby.RubyInstanceConfig</code>. With the other APIs, configuration options can only be set globally, via the <code>System</code> properties.</li>
41
+ <li>Embed Core offers several shortcuts, such as loading scripts from a <code>java.io.InputStream</code>, or returning Java-friendly objects from Ruby code. These allow you to skip a lot of boilerplate.</li>
42
+ </ol>
43
+ For projects requiring multiple scripting languages, JSR223 is a good fit. Though the API is language-independent, JRuby's implementation of it allows you to set some Ruby-specific options. In particular, you can control the threading model of the scripting engine, the lifetime of local variables, compilation mode, and how line numbers are displayed.
44
+
45
+ <p>The full <a href="http://jruby-embed.kenai.com/docs/" target="_blank">API documentation</a> has all the gory details. It's worth talking about a couple of the finer points here.
46
+ </p>
47
+
48
+ <h1>
49
+ <a name="Previous_Embedding_JRuby_Page"></a>Previous Embedding JRuby Page</h1>
50
+
51
+
52
+ <p>We recommend using Embed Core; however, if you're maintaining code that uses the old API, you can find its documentation on the <a href="JavaIntegration">legacy embedding</a><sup>[<a href="#cite_note-1">1</a>]</sup> page.
53
+ </p>
54
+
55
+ <h1>
56
+ <a name="References"></a>References</h1>
57
+
58
+
59
+ <p></p><ol><li>
60
+ <b><a href="#cite_ref-1-0">^</a> </b> This link goes nowhere.</li></ol>
@@ -0,0 +1,2 @@
1
+ * One
2
+ * Two
@@ -0,0 +1,2 @@
1
+ * One
2
+ * Two
@@ -0,0 +1,131 @@
1
+ #+TITLE: org-ruby
2
+ #+AUTHOR: Brian Dewey
3
+ #+EMAIL: bdewey@gmail.com
4
+ #+DATE: 2009-12-21
5
+ #+DESCRIPTION:
6
+ #+KEYWORDS:
7
+ #+LANGUAGE: en
8
+ #+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
9
+ #+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:nil pri:nil tags:not-in-toc
10
+ #+EXPORT_EXCLUDE_TAGS: exclude
11
+ #+STARTUP: showall
12
+
13
+ | Status: | Under Development |
14
+ | Location: | [[http://github.com/wallyqs/org-ruby]] |
15
+ | Version: | 0.9.0 |
16
+
17
+ * Description
18
+
19
+ Helpful Ruby routines for parsing orgmode files. The most
20
+ significant thing this library does today is convert orgmode files
21
+ to textile. Currently, you cannot do much to customize the
22
+ conversion. The supplied textile conversion is optimized for
23
+ extracting "content" from the orgfile as opposed to "metadata."
24
+
25
+ * History
26
+
27
+ ** 2014-02-08: Version 0.9.0
28
+
29
+ - Let's make sure =#+INCLUDE:= is not supported
30
+
31
+ #+INCLUDE: "./README.txt" src text
32
+
33
+ - And confirm that syntax highlight is supported
34
+
35
+ #+begin_src ruby
36
+ module GitHub
37
+ module Markup
38
+ VERSION = 'test'
39
+ Version = VERSION
40
+ end
41
+ end
42
+ #+end_src
43
+
44
+ ** 2009-12-30: Version 0.5.1
45
+
46
+ - Minor enhancement: Recognize lines starting with ":" as examples.
47
+ - Minor enhancement: Recognize #+BEGIN_SRC as source blocks
48
+ - Minor enhancement: Add "src" and "example" classes to <pre> blocks.
49
+
50
+
51
+ ** 2009-12-30: Version 0.5.0
52
+
53
+ - Parse (but not necessarily *use*) in-buffer settings. The following
54
+ in-buffer settings *are* used:
55
+ - Understand the #+TITLE: directive.
56
+ - Exporting todo keywords (option todo:t)
57
+ - Numbering headlines (option num:t)
58
+ - Skipping text before the first headline (option skip:t)
59
+ - Skipping tables (option |:nil)
60
+ - Custom todo keywords
61
+ - EXPORT_SELECT_TAGS and EXPORT_EXLUDE_TAGS for controlling parts of
62
+ the tree to export
63
+ - Rewrite "file:(blah).org" links to "http:(blah).html" links. This
64
+ makes the inter-links to other org-mode files work.
65
+ - Uses <th> tags inside table rows that precede table separators.
66
+ - Bugfixes:
67
+ - Headings now have HTML escaped.
68
+
69
+ ** 2009-12-29: Version 0.4.2
70
+
71
+ - Got rid of the extraneous newline at the start of code blocks.
72
+ - Everything now shows up in code blocks, even org-mode metadata.
73
+ - Fixed bugs:
74
+ - Regressed smart double quotes with HTML escaping. Added a test
75
+ case and fixed the regression.
76
+
77
+ ** 2009-12-29: Version 0.4.1
78
+ - HTML is now escaped by default
79
+ - org-mode comments will show up in a code block.
80
+
81
+ ** 2009-12-29: Version 0.4
82
+
83
+ - The first thing output in HTML gets the class "title"
84
+ - HTML output is now indented
85
+ - Proper support for multi-paragraph list items.
86
+
87
+ See? This paragraph is part of the last bullet.
88
+
89
+ - Fixed bugs:
90
+ - "rake spec" wouldn't work on Linux. Needed "require 'rubygems'".
91
+
92
+ ** 2009-12-27: Version 0.3
93
+
94
+ - Uses rubypants to get better typography (smart quotes, elipses, etc...).
95
+ - Fixed bugs:
96
+ - Tables and lists did not get properly closed at the end of file
97
+ - You couldn't do inline formatting inside table cells
98
+ - Characters in PRE blocks were not HTML escaped.
99
+
100
+ ** 2009-12-26: Version 0.2
101
+
102
+ - Added =to_html= output on the parser.
103
+ - Added support for the full range of inline markup: *bold*,
104
+ /italic/, =code=, ~verbatim~, _underline_, +strikethrough+.
105
+ - Lots of refactoring to make the code more maintainable.
106
+
107
+ ** 2009-12-23: Version 0.1
108
+
109
+ - Added support for block code, like this:
110
+
111
+ #+BEGIN_EXAMPLE
112
+ def flush!
113
+ @logger.debug "FLUSH ==========> #{@output_type}"
114
+ if (@output_type == :blank) then
115
+ @output << "\n"
116
+ elsif (@buffer.length > 0) then
117
+ if @cancel_modifier then
118
+ @output << "p. " if @output_type == :paragraph
119
+ @cancel_modifier = false
120
+ end
121
+ @output << @paragraph_modifier if (@paragraph_modifier and not sticky_modifier?)
122
+ @output << @buffer.textile_substitution << "\n"
123
+ end
124
+ @buffer = ""
125
+ end
126
+ #+END_EXAMPLE
127
+
128
+ - Major code cleanup: Created the =OutputBuffer= class that
129
+ greatly simplified a lot of the messiness of =textile=
130
+ conversion.
131
+ - Added support for line breaks within list items.