[DRE-commits] [ruby-org] 159/303: Merge latest features from master
Jérémy Bobbio
lunar at alioth.debian.org
Fri Aug 9 17:33:49 UTC 2013
This is an automated email from the git hooks/post-receive script.
lunar pushed a commit to branch master
in repository ruby-org.
commit 73cd4d02c6abedfa9a5fa9b6bb8ae2ef23c67c5f
Merge: 978e73f d05ceca
Author: Waldemar Quevedo <waldemar.quevedo at gmail.com>
Date: Sat Jul 7 23:51:33 2012 +0900
Merge latest features from master
TAGS | 133 --
bench/Gemfile | 4 +
bench/Gemfile_6_0 | 3 +
bench/Gemfile_6_1 | 3 +
bench/Gemfile_6_2 | 3 +
bench/Gemfile_6_3 | 3 +
bench/Gemfile_redcarpet | 3 +
bench/bench.org | 291 +++++
bench/parsing_redcarpet_test.rb | 19 +
bench/parsing_test.rb | 41 +
bin/org-ruby | 6 +-
doc/History_txt.html | 288 ----
doc/OrgRuby.html | 294 -----
doc/Orgmode.html | 909 -------------
doc/Orgmode/Headline.html | 522 --------
doc/Orgmode/HtmlOutputBuffer.html | 466 -------
doc/Orgmode/Line.html | 1369 --------------------
doc/Orgmode/OutputBuffer.html | 750 -----------
doc/Orgmode/Parser.html | 808 ------------
doc/Orgmode/RegexpHelper.html | 596 ---------
doc/Orgmode/TextileOutputBuffer.html | 430 ------
doc/README_rdoc.html | 181 ---
doc/Tilt.html | 143 --
doc/Tilt/OrgTemplate.html | 298 -----
doc/announcement_txt.html | 136 --
doc/bin/org-ruby.html | 54 -
doc/created.rid | 16 -
doc/images/add.png | Bin 733 -> 0 bytes
doc/images/brick.png | Bin 452 -> 0 bytes
doc/images/brick_link.png | Bin 764 -> 0 bytes
doc/images/bug.png | Bin 774 -> 0 bytes
doc/images/bullet_black.png | Bin 211 -> 0 bytes
doc/images/bullet_toggle_minus.png | Bin 207 -> 0 bytes
doc/images/bullet_toggle_plus.png | Bin 209 -> 0 bytes
doc/images/date.png | Bin 626 -> 0 bytes
doc/images/delete.png | Bin 715 -> 0 bytes
doc/images/find.png | Bin 659 -> 0 bytes
doc/images/loadingAnimation.gif | Bin 5886 -> 0 bytes
doc/images/macFFBgHack.png | Bin 207 -> 0 bytes
doc/images/package.png | Bin 853 -> 0 bytes
doc/images/page_green.png | Bin 621 -> 0 bytes
doc/images/page_white_text.png | Bin 342 -> 0 bytes
doc/images/page_white_width.png | Bin 309 -> 0 bytes
doc/images/plugin.png | Bin 591 -> 0 bytes
doc/images/ruby.png | Bin 592 -> 0 bytes
doc/images/tag_blue.png | Bin 1880 -> 0 bytes
doc/images/tag_green.png | Bin 613 -> 0 bytes
doc/images/transparent.png | Bin 97 -> 0 bytes
doc/images/wrench.png | Bin 610 -> 0 bytes
doc/images/wrench_orange.png | Bin 584 -> 0 bytes
doc/images/zoom.png | Bin 692 -> 0 bytes
doc/index.html | 180 ---
doc/js/darkfish.js | 153 ---
doc/js/jquery.js | 18 -
doc/js/navigation.js | 142 --
doc/js/search.js | 94 --
doc/js/search_index.js | 1 -
doc/js/searcher.js | 228 ----
doc/lib/org-ruby/headline_rb.html | 52 -
doc/lib/org-ruby/html_output_buffer_rb.html | 52 -
doc/lib/org-ruby/html_symbol_replace_rb.html | 55 -
doc/lib/org-ruby/line_rb.html | 52 -
doc/lib/org-ruby/output_buffer_rb.html | 54 -
doc/lib/org-ruby/parser_rb.html | 56 -
doc/lib/org-ruby/regexp_helper_rb.html | 54 -
doc/lib/org-ruby/textile_output_buffer_rb.html | 54 -
doc/lib/org-ruby/textile_symbol_replace_rb.html | 55 -
doc/lib/org-ruby/tilt_rb.html | 56 -
doc/lib/org-ruby_rb.html | 52 -
doc/rdoc.css | 543 --------
doc/table_of_contents.html | 311 -----
lib/org-ruby.rb | 42 +-
lib/org-ruby/headline.rb | 2 -
lib/org-ruby/html_output_buffer.rb | 62 +-
lib/org-ruby/line.rb | 18 +-
lib/org-ruby/output_buffer.rb | 18 +-
lib/org-ruby/parser.rb | 5 +-
lib/org-ruby/regexp_helper.rb | 6 +-
pkg/org-ruby-0.6.2.gem | Bin 57856 -> 0 bytes
pkg/org-ruby-0.6.2.tgz | Bin 53787 -> 0 bytes
pkg/org-ruby-0.6.2/.bnsignore | 18 -
pkg/org-ruby-0.6.2/.gitignore | 2 -
pkg/org-ruby-0.6.2/Gemfile | 8 -
pkg/org-ruby-0.6.2/Gemfile.lock | 36 -
pkg/org-ruby-0.6.2/History.txt | 106 --
pkg/org-ruby-0.6.2/README.rdoc | 67 -
pkg/org-ruby-0.6.2/Rakefile | 26 -
pkg/org-ruby-0.6.2/TAGS | 133 --
pkg/org-ruby-0.6.2/announcement.txt | 19 -
pkg/org-ruby-0.6.2/bin/org-ruby | 45 -
pkg/org-ruby-0.6.2/lib/org-ruby.rb | 50 -
pkg/org-ruby-0.6.2/lib/org-ruby/headline.rb | 110 --
.../lib/org-ruby/html_output_buffer.rb | 245 ----
.../lib/org-ruby/html_symbol_replace.rb | 345 -----
pkg/org-ruby-0.6.2/lib/org-ruby/line.rb | 251 ----
pkg/org-ruby-0.6.2/lib/org-ruby/output_buffer.rb | 237 ----
pkg/org-ruby-0.6.2/lib/org-ruby/parser.rb | 366 ------
pkg/org-ruby-0.6.2/lib/org-ruby/regexp_helper.rb | 187 ---
.../lib/org-ruby/textile_output_buffer.rb | 102 --
.../lib/org-ruby/textile_symbol_replace.rb | 346 -----
pkg/org-ruby-0.6.2/lib/org-ruby/tilt.rb | 29 -
pkg/org-ruby-0.6.2/org-ruby.gemspec | 37 -
pkg/org-ruby-0.6.2/spec/data/freeform-example.org | 113 --
pkg/org-ruby-0.6.2/spec/data/freeform.org | 111 --
pkg/org-ruby-0.6.2/spec/data/hyp-planning.org | 335 -----
pkg/org-ruby-0.6.2/spec/data/remember.org | 53 -
pkg/org-ruby-0.6.2/spec/headline_spec.rb | 65 -
.../spec/html_examples/advanced-code.html | 81 --
.../spec/html_examples/advanced-code.org | 106 --
.../spec/html_examples/advanced-lists.html | 31 -
.../spec/html_examples/advanced-lists.org | 31 -
.../spec/html_examples/block_code.html | 28 -
.../spec/html_examples/block_code.org | 35 -
.../spec/html_examples/blockcomment.html | 3 -
.../spec/html_examples/blockcomment.org | 15 -
.../spec/html_examples/blockquote.html | 7 -
.../spec/html_examples/blockquote.org | 13 -
pkg/org-ruby-0.6.2/spec/html_examples/center.html | 6 -
pkg/org-ruby-0.6.2/spec/html_examples/center.org | 7 -
.../spec/html_examples/code-comment.html | 18 -
.../spec/html_examples/code-comment.org | 22 -
.../spec/html_examples/comment-trees.html | 4 -
.../spec/html_examples/comment-trees.org | 13 -
.../spec/html_examples/custom-seq-todo.html | 15 -
.../spec/html_examples/custom-seq-todo.org | 24 -
.../spec/html_examples/custom-todo.html | 15 -
.../spec/html_examples/custom-todo.org | 24 -
.../spec/html_examples/custom-typ-todo.html | 15 -
.../spec/html_examples/custom-typ-todo.org | 24 -
pkg/org-ruby-0.6.2/spec/html_examples/deflist.html | 6 -
pkg/org-ruby-0.6.2/spec/html_examples/deflist.org | 6 -
.../spec/html_examples/entities.html | 4 -
pkg/org-ruby-0.6.2/spec/html_examples/entities.org | 11 -
.../spec/html_examples/escape-pre.html | 6 -
.../spec/html_examples/escape-pre.org | 6 -
.../spec/html_examples/export-exclude-only.html | 13 -
.../spec/html_examples/export-exclude-only.org | 81 --
.../spec/html_examples/export-keywords.html | 4 -
.../spec/html_examples/export-keywords.org | 18 -
.../spec/html_examples/export-tags.html | 8 -
.../spec/html_examples/export-tags.org | 82 --
.../spec/html_examples/export-title.html | 2 -
.../spec/html_examples/export-title.org | 4 -
.../spec/html_examples/footnotes.html | 10 -
.../spec/html_examples/footnotes.org | 7 -
.../spec/html_examples/horizontal_rule.html | 4 -
.../spec/html_examples/horizontal_rule.org | 5 -
.../spec/html_examples/html-literal.html | 2 -
.../spec/html_examples/html-literal.org | 6 -
.../spec/html_examples/inline-formatting.html | 25 -
.../spec/html_examples/inline-formatting.org | 43 -
.../spec/html_examples/inline-images.html | 10 -
.../spec/html_examples/inline-images.org | 15 -
.../spec/html_examples/link-features.html | 8 -
.../spec/html_examples/link-features.org | 19 -
pkg/org-ruby-0.6.2/spec/html_examples/lists.html | 23 -
pkg/org-ruby-0.6.2/spec/html_examples/lists.org | 47 -
.../spec/html_examples/metadata-comment.html | 27 -
.../spec/html_examples/metadata-comment.org | 30 -
.../spec/html_examples/only-list.html | 5 -
.../spec/html_examples/only-list.org | 3 -
.../spec/html_examples/only-table.html | 6 -
.../spec/html_examples/only-table.org | 5 -
.../spec/html_examples/skip-header.html | 3 -
.../spec/html_examples/skip-header.org | 28 -
.../spec/html_examples/skip-table.html | 4 -
.../spec/html_examples/skip-table.org | 19 -
.../spec/html_examples/subsupscript-nil.html | 3 -
.../spec/html_examples/subsupscript-nil.org | 6 -
.../spec/html_examples/subsupscript.html | 3 -
.../spec/html_examples/subsupscript.org | 5 -
pkg/org-ruby-0.6.2/spec/html_examples/tables.html | 35 -
pkg/org-ruby-0.6.2/spec/html_examples/tables.org | 50 -
pkg/org-ruby-0.6.2/spec/html_examples/text.html | 2 -
pkg/org-ruby-0.6.2/spec/html_examples/text.org | 16 -
pkg/org-ruby-0.6.2/spec/line_spec.rb | 162 ---
pkg/org-ruby-0.6.2/spec/output_buffer_spec.rb | 19 -
pkg/org-ruby-0.6.2/spec/parser_spec.rb | 158 ---
pkg/org-ruby-0.6.2/spec/regexp_helper_spec.rb | 57 -
pkg/org-ruby-0.6.2/spec/spec_helper.rb | 20 -
.../spec/textile_examples/block_code.org | 35 -
.../spec/textile_examples/block_code.textile | 29 -
.../spec/textile_examples/blockquote.org | 13 -
.../spec/textile_examples/blockquote.textile | 11 -
.../spec/textile_examples/center.org | 7 -
.../spec/textile_examples/center.textile | 6 -
.../spec/textile_examples/footnotes.org | 7 -
.../spec/textile_examples/footnotes.textile | 8 -
.../spec/textile_examples/keywords.org | 13 -
.../spec/textile_examples/keywords.textile | 11 -
pkg/org-ruby-0.6.2/spec/textile_examples/links.org | 11 -
.../spec/textile_examples/links.textile | 10 -
pkg/org-ruby-0.6.2/spec/textile_examples/lists.org | 36 -
.../spec/textile_examples/lists.textile | 20 -
.../textile_examples/single-space-plain-list.org | 13 -
.../single-space-plain-list.textile | 10 -
.../spec/textile_examples/tables.org | 50 -
.../spec/textile_examples/tables.textile | 40 -
.../spec/textile_output_buffer_spec.rb | 21 -
pkg/org-ruby-0.6.2/tasks/test_case.rake | 49 -
pkg/org-ruby-0.6.2/util/gen-special-replace.el | 37 -
spec/headline_spec.rb | 3 +-
spec/html_examples/advanced-lists.html | 39 +-
spec/html_examples/block_code.html | 6 +-
spec/html_examples/code-lists.html | 119 ++
spec/html_examples/code-lists.org | 83 ++
spec/html_examples/custom-seq-todo.html | 6 +-
spec/html_examples/custom-todo.html | 6 +-
spec/html_examples/custom-typ-todo.html | 6 +-
spec/html_examples/inline-formatting.html | 15 +-
spec/html_examples/inline-images.html | 12 +-
spec/html_examples/link-features.html | 18 +-
spec/html_examples/lists.html | 21 +-
spec/html_examples/only-list.html | 9 +-
spec/html_examples/properties_drawer.html | 19 +
spec/html_examples/properties_drawer.org | 37 +
spec/line_spec.rb | 6 +-
spec/output_buffer_spec.rb | 2 +-
spec/parser_spec.rb | 3 +-
spec/regexp_helper_spec.rb | 2 +-
spec/spec_helper.rb | 6 +-
spec/textile_output_buffer_spec.rb | 2 +-
tasks/test_case.rake | 3 -
223 files changed, 829 insertions(+), 15335 deletions(-)
diff --cc lib/org-ruby/html_output_buffer.rb
index a4437e1,6630d77..811c1f7
--- a/lib/org-ruby/html_output_buffer.rb
+++ b/lib/org-ruby/html_output_buffer.rb
@@@ -1,17 -1,3 +1,14 @@@
- require OrgRuby.libpath(*%w[org-ruby html_symbol_replace])
- require OrgRuby.libpath(*%w[org-ruby output_buffer])
-
+begin
+ require 'pygments'
+rescue LoadError
+ # Pygments is not supported so we try instead with CodeRay
+ begin
+ require 'coderay'
+ rescue LoadError
+ # No code syntax highlighting
+ end
+end
+
module Orgmode
class HtmlOutputBuffer < OutputBuffer
@@@ -69,11 -56,8 +67,12 @@@
css_class = " class=\"src src-#{@block_lang}\"" if mode == :src and not @block_lang.empty?
css_class = " class=\"example\"" if (mode == :example || mode == :inline_example)
css_class = " style=\"text-align: center\"" if mode == :center
- @logger.debug "#{mode}: <#{ModeTag[mode]}#{css_class}>\n"
- @output << "<#{ModeTag[mode]}#{css_class}>\n" unless mode == :table and skip_tables?
++
+ unless ((mode == :table and skip_tables?) or
+ (mode == :src and defined? Pygments))
+ @logger.debug "#{mode}: <#{ModeTag[mode]}#{css_class}>\n"
+ @output << "<#{ModeTag[mode]}#{css_class}>\n"
+ end
# Entering a new mode obliterates the title decoration
@title_decoration = ""
end
@@@ -86,11 -70,19 +85,22 @@@
m = super(mode)
if ModeTag[m] then
output_indentation
+ # Need to close the floating li elements before closing the list
+ if (m == :unordered_list or
+ m == :ordered_list or
+ m == :definition_list) and
+ (not @unclosed_tags.empty?)
+ close_floating_li_tags
+ end
+
- @logger.debug "</#{ModeTag[m]}>\n"
- @output << "</#{ModeTag[m]}>\n" unless mode == :table and skip_tables?
+ unless ((mode == :table and skip_tables?) or
+ (mode == :src and defined? Pygments))
+ @logger.debug "</#{ModeTag[m]}>\n"
+ @output << "</#{ModeTag[m]}>\n"
+ end
+
+ # In case it was a sublist, close it here
+ close_last_li_tag_maybe
end
end
@@@ -286,14 -263,28 +312,38 @@@
str
end
+ def close_floating_li_tags
+ unless @final_list_node
+ unless @unclosed_tags.empty?
+ @output << " " << @unclosed_tags.pop
+ output_indentation
+ end
+ end
+
+ @final_list_node = false
+ end
+
+ def close_last_li_tag_maybe
+ if (@list_indent_stack.count < @unclosed_tags.count) and not
+ (@list_indent_stack.empty? and @unclosed_tags.empty?)
+ output_indentation
+ @output << @unclosed_tags.pop
+ if (@list_indent_stack.count == @unclosed_tags.count) and not
+ (@list_indent_stack.empty? and @unclosed_tags.empty?)
+ @final_list_node = true
+ pop_mode
+ end
+ end
+ end
++
+ # Helper method taken from Rails
+ # https://github.com/rails/rails/blob/c2c8ef57d6f00d1c22743dc43746f95704d67a95/activesupport/lib/active_support/core_ext/kernel/reporting.rb#L10
+ def silence_warnings
+ warn_level = $VERBOSE
+ $VERBOSE = nil
+ yield
+ ensure
+ $VERBOSE = warn_level
+ end
end # class HtmlOutputBuffer
end # module Orgmode
diff --cc lib/org-ruby/output_buffer.rb
index 630e072,720b086..c7f9730
--- a/lib/org-ruby/output_buffer.rb
+++ b/lib/org-ruby/output_buffer.rb
@@@ -78,19 -78,12 +78,19 @@@ module Orgmod
# Prepares the output buffer to receive content from a line.
# As a side effect, this may flush the current accumulated text.
def prepare(line)
- @logger.debug "Looking at #{line.paragraph_type}: #{line.to_s}"
- if not should_accumulate_output?(line) then
- @block_lang = line.block_lang if line.begin_block? and line.code_block_type?
+ @logger.debug "Looking at #{line.paragraph_type}(#{current_mode}) : #{line.to_s}"
+ if line.begin_block? and line.code_block?
+ flush!
+ # We try to get the lang from #+BEGIN_SRC blocks
+ @block_lang = line.block_lang
+ @output_type = line.paragraph_type
+ elsif current_mode == :example and line.end_block?
+ flush!
+ @output_type = line.paragraph_type
+ elsif not should_accumulate_output?(line)
flush!
maintain_list_indent_stack(line)
- @output_type = line.paragraph_type
+ @output_type = line.paragraph_type
end
push_mode(:inline_example) if line.inline_example? and current_mode != :inline_example and not line.property_drawer?
pop_mode(:inline_example) if current_mode == :inline_example and !line.inline_example?
diff --cc lib/org-ruby/parser.rb
index 1c5891e,6a441c3..1e2ad6d
--- a/lib/org-ruby/parser.rb
+++ b/lib/org-ruby/parser.rb
@@@ -285,11 -269,12 +284,11 @@@ module Orgmod
output_buffer << line.output_text
- when :src
+ when :src
- output_buffer << line.output_text << "\n"
+ output_buffer << line.output_text << "\n"
else
-
if output_buffer.preserve_whitespace? then
output_buffer << line.output_text
else
diff --cc spec/html_examples/properties_drawer.html
index 0000000,45a0c7b..c500381
mode 000000,100644..100644
--- a/spec/html_examples/properties_drawer.html
+++ b/spec/html_examples/properties_drawer.html
@@@ -1,0 -1,25 +1,19 @@@
+ <h1 class="title">The mount point of the fullest disk</h1>
+ <h2>query all mounted disks</h2>
-<pre class="src src-sh">
++<pre class="example">
+ df \
+ </pre>
+ <h2>strip the header row</h2>
-<pre class="src src-sh">
- <table>
- <tr><td>sed '1d' \</tr>
- </table>
++<pre class="example">
++ |sed '1d' \
+ </pre>
+ <h2>sort by the percent full</h2>
-<pre class="src src-sh">
- <table>
- <tr><td>awk '{print $5 " " $6}'</td><td>sort -n</td><td>tail -1 \</tr>
- </table>
++<pre class="example">
++ |awk '{print $5 " " $6}'|sort -n |tail -1 \
+ </pre>
+ <h2>extract the mount point</h2>
-<pre class="src src-sh">
- <table>
- <tr><td>awk '{print $2}'</tr>
- </table>
++<pre class="example">
++ |awk '{print $2}'
+ </pre>
+ <h1>Properties drawer example</h1>
+ <p>These properties are metadata so they should not be visible.</p>
diff --cc spec/html_examples/properties_drawer.org
index 0000000,d267c61..7d67ed8
mode 000000,100644..100644
--- a/spec/html_examples/properties_drawer.org
+++ b/spec/html_examples/properties_drawer.org
@@@ -1,0 -1,37 +1,37 @@@
+ # Example taken from the wiki
+ # http://orgmode.org/manual/noweb_002dref.html#noweb_002dref
+ * The mount point of the fullest disk
+ :PROPERTIES:
+ :noweb-ref: fullest-disk
+ :END:
+
+ ** query all mounted disks
-#+BEGIN_SRC sh
++#+BEGIN_EXAMPLE
+ df \
-#+END_SRC
++#+END_EXAMPLE
+
+ ** strip the header row
-#+BEGIN_SRC sh
++#+BEGIN_EXAMPLE
+ |sed '1d' \
-#+END_SRC
++#+END_EXAMPLE
+
+ ** sort by the percent full
-#+BEGIN_SRC sh
++#+BEGIN_EXAMPLE
+ |awk '{print $5 " " $6}'|sort -n |tail -1 \
-#+END_SRC
++#+END_EXAMPLE
+
+ ** extract the mount point
-#+BEGIN_SRC sh
++#+BEGIN_EXAMPLE
+ |awk '{print $2}'
-#+END_SRC
++#+END_EXAMPLE
+
+ * Properties drawer example
+ :PROPERTIES:
+ :ARCHIVE_TIME: 2009-12-26 Sat 22:16
+ :ARCHIVE_FILE: ~/brians-brain/content/projects/orgmode_parser.org
+ :ARCHIVE_OLPATH: <%= @page.title %>/Future Development
+ :ARCHIVE_CATEGORY: orgmode_parser
+ :ARCHIVE_TODO: DONE
+ :END:
+
+ These properties are metadata so they should not be visible.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-org.git
More information about the Pkg-ruby-extras-commits
mailing list