You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2016/01/05 17:05:29 UTC

[1/3] allura git commit: [#7987] ticket:882 uset FencedCodeProcessor for fence code

Repository: allura
Updated Branches:
  refs/heads/ib/7987 [created] 0cfb87197


[#7987] ticket:882 uset FencedCodeProcessor for fence code


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/c29eac95
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/c29eac95
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/c29eac95

Branch: refs/heads/ib/7987
Commit: c29eac9523ececb7b25bdcc35a2774805bf6624d
Parents: a784bde
Author: Denis Kotov <de...@gmail.com>
Authored: Fri Dec 25 21:22:34 2015 +0200
Committer: Denis Kotov <de...@gmail.com>
Committed: Fri Dec 25 21:22:34 2015 +0200

----------------------------------------------------------------------
 Allura/allura/lib/markdown_extensions.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/c29eac95/Allura/allura/lib/markdown_extensions.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/markdown_extensions.py b/Allura/allura/lib/markdown_extensions.py
index cbccf5d..016c5e4 100644
--- a/Allura/allura/lib/markdown_extensions.py
+++ b/Allura/allura/lib/markdown_extensions.py
@@ -21,6 +21,7 @@ from urlparse import urljoin
 
 from tg import config
 from bs4 import BeautifulSoup
+from markdown.extensions.fenced_code import FencedBlockPreprocessor
 import html5lib
 import html5lib.serializer
 import html5lib.filters.alphabeticalattributes
@@ -248,7 +249,7 @@ class ForgeExtension(markdown.Extension):
         # allow markdown within e.g. <div markdown>...</div>  More info at:
         # https://github.com/waylan/Python-Markdown/issues/52
         md.preprocessors['html_block'].markdown_in_raw = True
-        md.preprocessors['fenced-code'] = FencedCodeProcessor()
+        md.preprocessors['fenced-code'] = FencedBlockPreprocessor(md)
         md.preprocessors.add('plain_text_block', PlainTextPreprocessor(md), "_begin")
         md.preprocessors.add('macro_include', ForgeMacroIncludePreprocessor(md), '_end')
         # this has to be before the 'escape' processor, otherwise weird


[3/3] allura git commit: [#7987] ticket:882 Move docs changes to appropriate section

Posted by je...@apache.org.
[#7987] ticket:882 Move docs changes to appropriate section


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/0cfb8719
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/0cfb8719
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/0cfb8719

Branch: refs/heads/ib/7987
Commit: 0cfb87197cf000f4560b737036271b1e5cb61924
Parents: fe5650d
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Jan 5 16:28:43 2016 +0200
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Tue Jan 5 16:28:43 2016 +0200

----------------------------------------------------------------------
 Allura/allura/templates/jinja_master/lib.html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/0cfb8719/Allura/allura/templates/jinja_master/lib.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/lib.html b/Allura/allura/templates/jinja_master/lib.html
index b913f41..865807f 100644
--- a/Allura/allura/templates/jinja_master/lib.html
+++ b/Allura/allura/templates/jinja_master/lib.html
@@ -692,6 +692,8 @@ allowed, permitting basic styling and layout: &lt;div markdown style="float:left
 <h2 id="md_ex_code{{id}}">Code Highlighting</h2>
 <p>The code highlighting syntax uses <a href="http://pythonhosted.org/Markdown/extensions/code_hilite.html">CodeHilite</a> and is colored with <a href="http://pygments.org/">Pygments</a>. It follows the same syntax as regular Markdown code blocks, except that there are two ways to tell the highlighter what language to use for the code block.</p>
 
+<p>Fenced Code Blocks <a href="https://pythonhosted.org/Markdown/extensions/fenced_code_blocks.html">syntax</a> is also supported.</p>
+
 <p>If the first line of the codeblock contains a shebang, the language is derived from that and line numbers are used.</p>
 
 <div class="codehilite"><pre>
@@ -731,8 +733,6 @@ allowed, permitting basic styling and layout: &lt;div markdown style="float:left
 ~~~~~~''')}}
 </div>
 
-<p><a href="https://pythonhosted.org/Markdown/extensions/fenced_code_blocks.html">Fenced Code Blocks syntax is also supported</a> </p>
-
 
 <div class="markdown_syntax_section hidden_in_modal md_ex_includes{{id}}">
 <h2 id="md_ex_includes{{id}}">Includes</h2>


[2/3] allura git commit: [#7987] ticket:882 Remove deprecated FencedCodeProcessor, change user docs

Posted by je...@apache.org.
[#7987] ticket:882 Remove deprecated FencedCodeProcessor, change user docs


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/fe5650d6
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/fe5650d6
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/fe5650d6

Branch: refs/heads/ib/7987
Commit: fe5650d6ffb17bf3a144e0bbb2a2af51060abe93
Parents: c29eac9
Author: Denis Kotov <de...@gmail.com>
Authored: Mon Dec 28 12:13:34 2015 +0200
Committer: Denis Kotov <de...@gmail.com>
Committed: Mon Dec 28 12:13:34 2015 +0200

----------------------------------------------------------------------
 Allura/allura/lib/app_globals.py              |  2 +-
 Allura/allura/lib/markdown_extensions.py      | 19 -------------------
 Allura/allura/templates/jinja_master/lib.html |  2 ++
 3 files changed, 3 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/fe5650d6/Allura/allura/lib/app_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/app_globals.py b/Allura/allura/lib/app_globals.py
index f7392cd..7e8e5db 100644
--- a/Allura/allura/lib/app_globals.py
+++ b/Allura/allura/lib/app_globals.py
@@ -439,7 +439,7 @@ class Globals(object):
         '''return a markdown.Markdown object on which you can call convert'''
         return ForgeMarkdown(
             # 'fenced_code'
-            extensions=['codehilite',
+            extensions=['fenced_code', 'codehilite',
                         ForgeExtension(
                             **kwargs), 'tables', 'toc', 'nl2br'],
             output_format='html4')

http://git-wip-us.apache.org/repos/asf/allura/blob/fe5650d6/Allura/allura/lib/markdown_extensions.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/markdown_extensions.py b/Allura/allura/lib/markdown_extensions.py
index 016c5e4..c292d66 100644
--- a/Allura/allura/lib/markdown_extensions.py
+++ b/Allura/allura/lib/markdown_extensions.py
@@ -21,7 +21,6 @@ from urlparse import urljoin
 
 from tg import config
 from bs4 import BeautifulSoup
-from markdown.extensions.fenced_code import FencedBlockPreprocessor
 import html5lib
 import html5lib.serializer
 import html5lib.filters.alphabeticalattributes
@@ -249,7 +248,6 @@ class ForgeExtension(markdown.Extension):
         # allow markdown within e.g. <div markdown>...</div>  More info at:
         # https://github.com/waylan/Python-Markdown/issues/52
         md.preprocessors['html_block'].markdown_in_raw = True
-        md.preprocessors['fenced-code'] = FencedBlockPreprocessor(md)
         md.preprocessors.add('plain_text_block', PlainTextPreprocessor(md), "_begin")
         md.preprocessors.add('macro_include', ForgeMacroIncludePreprocessor(md), '_end')
         # this has to be before the 'escape' processor, otherwise weird
@@ -376,23 +374,6 @@ class PlainTextPreprocessor(markdown.preprocessors.Preprocessor):
         return txt
 
 
-class FencedCodeProcessor(markdown.preprocessors.Preprocessor):
-    pattern = '~~~~'
-
-    def run(self, lines):
-        in_block = False
-        new_lines = []
-        for line in lines:
-            if line.lstrip().startswith(self.pattern):
-                in_block = not in_block
-                continue
-            if in_block:
-                new_lines.append('    ' + line)
-            else:
-                new_lines.append(line)
-        return new_lines
-
-
 class ForgeMacroPattern(markdown.inlinepatterns.Pattern):
 
     def __init__(self, *args, **kwargs):

http://git-wip-us.apache.org/repos/asf/allura/blob/fe5650d6/Allura/allura/templates/jinja_master/lib.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/lib.html b/Allura/allura/templates/jinja_master/lib.html
index b3626e9..b913f41 100644
--- a/Allura/allura/templates/jinja_master/lib.html
+++ b/Allura/allura/templates/jinja_master/lib.html
@@ -731,6 +731,8 @@ allowed, permitting basic styling and layout: &lt;div markdown style="float:left
 ~~~~~~''')}}
 </div>
 
+<p><a href="https://pythonhosted.org/Markdown/extensions/fenced_code_blocks.html">Fenced Code Blocks syntax is also supported</a> </p>
+
 
 <div class="markdown_syntax_section hidden_in_modal md_ex_includes{{id}}">
 <h2 id="md_ex_includes{{id}}">Includes</h2>