Skip to content
Snippets Groups Projects
Commit b90deaeb authored by kakwa's avatar kakwa
Browse files

Merge remote-tracking branch 'upstream/master' into raw_html_rst

Conflicts:
	lib/github/commands/rest2html
parents 68557d27 c4c66036
No related branches found
No related tags found
No related merge requests found
# Contributing
 
This project adheres to the [Open Code of Conduct][code-of-conduct]. By participating, you are expected to honor this code.
[code-of-conduct]: http://todogroup.org/opencodeofconduct/#GitHub%20Markup/opensource@github.com
This library's only job is to decide which markup format to use and call out to an external library to convert the markup to HTML (see the [README](README.md) for more information on how markup is rendered on GitHub.com).
 
If you are having an issue with:
Loading
Loading
module GitHub
module Markup
VERSION = '1.3.3'
VERSION = '1.4.0'
Version = VERSION
end
end
Loading
Loading
@@ -45,7 +45,8 @@ except:
import codecs
 
from docutils import nodes
from docutils.parsers.rst import roles
from docutils.parsers.rst import directives, roles
from docutils.parsers.rst.directives.body import CodeBlock
from docutils.core import publish_parts
from docutils.writers.html4css1 import Writer, HTMLTranslator
 
Loading
Loading
@@ -64,6 +65,17 @@ SETTINGS = {
}
 
 
class DoctestDirective(CodeBlock):
"""Render Sphinx 'doctest:: [group]' blocks as 'code:: python'
"""
def run(self):
"""Discard any doctest group argument, render contents as python code
"""
self.arguments = ['python']
return super(DoctestDirective, self).run()
class GitHubHTMLTranslator(HTMLTranslator):
 
# removes the <div class="document"> tag wrapped around docs
Loading
Loading
@@ -157,6 +169,9 @@ def main():
 
roles.register_canonical_role('kbd', kbd)
 
# Render source code in Sphinx doctest blocks
directives.register_directive('doctest', DoctestDirective)
parts = publish_parts(text, writer=writer, settings_overrides=SETTINGS)
if 'html_body' in parts:
html = parts['html_body']
Loading
Loading
Loading
Loading
@@ -22,7 +22,9 @@ markup(:creole, /creole/) do |content|
end
 
markup(:wikicloth, /mediawiki|wiki/) do |content|
WikiCloth::WikiCloth.new(:data => content).to_html(:noedit => true)
wikicloth = WikiCloth::WikiCloth.new(:data => content)
WikiCloth::WikiBuffer::HTMLElement::ESCAPED_TAGS << 'tt'
wikicloth.to_html(:noedit => true)
end
 
markup(:asciidoctor, /adoc|asc(iidoc)?/) do |content|
Loading
Loading
Loading
Loading
@@ -6,6 +6,9 @@ __TOC__
 
= Red Bridge (JRuby Embed) =
 
<tt>one-<two</tt>
<pre>a-b</pre>
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.
 
== Features of Red Bridge ==
Loading
Loading
Loading
Loading
@@ -18,6 +18,9 @@ Using Java from Ruby is JRuby's best-known feature---but you can also go in the
<a name="Red_Bridge_JRuby_Embed"></a>Red Bridge (JRuby Embed)</h1>
 
 
<p><tt>one-&lt;two</tt>
</p><pre>a-b</pre>
 
<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.
</p>
Loading
Loading
Loading
Loading
@@ -31,6 +31,19 @@ The UTF-8 quote character in this table used to cause python to go boom. Now doc
Tabular Data, 5
Made up ratings, 11
 
.. code::
A block of code
.. code:: python
python.code('hooray')
.. doctest:: ignored
>>> some_function()
'result'
============== ==========================================================
Travis http://travis-ci.org/tony/pullv
Docs http://pullv.rtfd.org
Loading
Loading
Loading
Loading
@@ -16,6 +16,16 @@
<li>Somé UTF-8°</li>
</ol>
<p>The UTF-8 quote character in this table used to cause python to go boom. Now docutils just silently ignores it.</p>
<pre>
A block of code
</pre>
<pre lang="python">
python.code('hooray')
</pre>
<pre lang="python">
&gt;&gt;&gt; some_function()
'result'
</pre>
<table>
 
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment