diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:13:14 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:13:14 +0000 |
commit | d0233291bc8a5068e52c69c210e5979e5324b5bc (patch) | |
tree | 7d9459449c33792c63eeb7baa071e76352e0baab /trunk/lib/rdoc/markup/to_texinfo.rb | |
parent | 0dc342de848a642ecce8db697b8fecd83a63e117 (diff) | |
parent | 72eaacaa15256ab95c3b52ea386f88586fb9da40 (diff) |
re-adding tag v1_9_0_4 as an alias of trunk@18848v1_9_0_4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_9_0_4@18849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'trunk/lib/rdoc/markup/to_texinfo.rb')
-rw-r--r-- | trunk/lib/rdoc/markup/to_texinfo.rb | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/trunk/lib/rdoc/markup/to_texinfo.rb b/trunk/lib/rdoc/markup/to_texinfo.rb deleted file mode 100644 index 533d3e34a0..0000000000 --- a/trunk/lib/rdoc/markup/to_texinfo.rb +++ /dev/null @@ -1,69 +0,0 @@ -require 'rdoc/markup/formatter' -require 'rdoc/markup/fragments' -require 'rdoc/markup/inline' - -require 'rdoc/markup' -require 'rdoc/markup/formatter' - -## -# Convert SimpleMarkup to basic TexInfo format -# -# TODO: WTF is AttributeManager for? -# -class RDoc::Markup::ToTexInfo < RDoc::Markup::Formatter - - def start_accepting - @text = [] - end - - def end_accepting - @text.join("\n") - end - - def accept_paragraph(attributes, text) - @text << format(text) - end - - def accept_verbatim(attributes, text) - @text << "@verb{|#{format(text)}|}" - end - - def accept_heading(attributes, text) - heading = ['@majorheading', '@chapheading'][text.head_level - 1] || '@heading' - @text << "#{heading}{#{format(text)}}" - end - - def accept_list_start(attributes, text) - @text << '@itemize @bullet' - end - - def accept_list_end(attributes, text) - @text << '@end itemize' - end - - def accept_list_item(attributes, text) - @text << "@item\n#{format(text)}" - end - - def accept_blank_line(attributes, text) - @text << "\n" - end - - def accept_rule(attributes, text) - @text << '-----' - end - - def format(text) - text.txt. - gsub(/@/, "@@"). - gsub(/\{/, "@{"). - gsub(/\}/, "@}"). - # gsub(/,/, "@,"). # technically only required in cross-refs - gsub(/\+([\w]+)\+/, "@code{\\1}"). - gsub(/\<tt\>([^<]+)\<\/tt\>/, "@code{\\1}"). - gsub(/\*([\w]+)\*/, "@strong{\\1}"). - gsub(/\<b\>([^<]+)\<\/b\>/, "@strong{\\1}"). - gsub(/_([\w]+)_/, "@emph{\\1}"). - gsub(/\<em\>([^<]+)\<\/em\>/, "@emph{\\1}") - end -end |