kitabu 0.4.7 → 1.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/.gitmodules +3 -0
- data/.rspec +1 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +62 -0
- data/README.rdoc +187 -0
- data/Rakefile +4 -36
- data/bin/kitabu +2 -5
- data/examples/RailsGuides/config/helper.rb +29 -0
- data/examples/RailsGuides/config/kitabu.yml +48 -0
- data/examples/RailsGuides/images/challenge.png +0 -0
- data/examples/RailsGuides/images/posts_index.png +0 -0
- data/examples/RailsGuides/images/rails_welcome.png +0 -0
- data/examples/RailsGuides/output/RailsGuides.epub +0 -0
- data/examples/RailsGuides/output/RailsGuides.html +1556 -0
- data/examples/RailsGuides/output/RailsGuides.pdf +4930 -7
- data/examples/RailsGuides/templates/cover.erb +16 -0
- data/examples/RailsGuides/templates/layout.css +352 -0
- data/examples/RailsGuides/templates/layout.erb +43 -0
- data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css/idle.css → examples/RailsGuides/templates/syntax.css} +0 -0
- data/examples/RailsGuides/templates/user.css +19 -0
- data/examples/RailsGuides/text/01_Guide_Assumptions.mkdn +13 -0
- data/examples/RailsGuides/text/02_What_is_Rails.mkdn +106 -0
- data/examples/RailsGuides/text/03_Creating_a_new_Rails_project.mkdn +200 -0
- data/examples/RailsGuides/text/04_Hello_Rails.mkdn +62 -0
- data/examples/RailsGuides/text/05_Getting_Up_and_Running_Quickly_with_Scaffolding.mkdn +4 -0
- data/examples/RailsGuides/text/06_Creating_a_resource.mkdn +503 -0
- data/examples/RailsGuides/text/07_Adding_a_second_model.mkdn +232 -0
- data/examples/RailsGuides/text/08_Refactoring.mkdn +123 -0
- data/examples/RailsGuides/text/09_Deleting_comments.mkdn +57 -0
- data/examples/RailsGuides/text/09_Security.mkdn +56 -0
- data/examples/RailsGuides/text/10_Building_a_multi_model_form.mkdn +130 -0
- data/examples/RailsGuides/text/11_View_helpers.mkdn +50 -0
- data/examples/RailsGuides/text/12_Whats_next.mkdn +14 -0
- data/examples/RailsGuides/text/13_Configuration_gotchas.mkdn +10 -0
- data/kitabu.gemspec +28 -491
- data/lib/kitabu.rb +54 -46
- data/lib/kitabu/cli.rb +88 -0
- data/lib/kitabu/errors.rb +3 -0
- data/lib/kitabu/exporter.rb +81 -0
- data/lib/kitabu/extensions/redcloth.rb +65 -0
- data/lib/kitabu/extensions/string.rb +11 -0
- data/lib/kitabu/generator.rb +74 -0
- data/lib/kitabu/parser.rb +34 -0
- data/lib/kitabu/parser/epub.rb +131 -0
- data/lib/kitabu/parser/html.rb +174 -0
- data/lib/kitabu/parser/mobi.rb +17 -0
- data/lib/kitabu/parser/pdf.rb +41 -0
- data/lib/kitabu/parser/txt.rb +22 -0
- data/lib/kitabu/stream.rb +27 -0
- data/lib/kitabu/syntax.rb +109 -107
- data/lib/kitabu/toc.rb +62 -33
- data/lib/kitabu/version.rb +8 -0
- data/spec/kitabu/cli/export_spec.rb +17 -0
- data/spec/kitabu/cli/new_spec.rb +21 -0
- data/spec/kitabu/cli/permalinks_spec.rb +12 -0
- data/spec/kitabu/cli/version_spec.rb +12 -0
- data/spec/kitabu/extensions/redcloth_spec.rb +52 -0
- data/spec/kitabu/extensions/string_spec.rb +21 -0
- data/spec/kitabu/generator_spec.rb +10 -0
- data/spec/kitabu/parser/epub_spec.rb +10 -0
- data/spec/kitabu/parser/html_spec.rb +75 -0
- data/spec/kitabu/parser/pdf_spec.rb +14 -0
- data/spec/kitabu/syntax_spec.rb +80 -76
- data/spec/kitabu/toc_spec.rb +42 -68
- data/spec/kitabu_spec.rb +4 -0
- data/spec/spec_helper.rb +20 -24
- data/spec/support/exit_with_code.rb +26 -0
- data/spec/support/have_tag.rb +115 -0
- data/spec/support/helper.rb +18 -0
- data/spec/support/mybook/.gitignore +1 -0
- data/spec/support/mybook/code/.gitkeep +0 -0
- data/spec/support/mybook/code/code.rb +13 -0
- data/spec/support/mybook/config/helper.rb +29 -0
- data/spec/support/mybook/config/kitabu.yml +59 -0
- data/spec/support/mybook/images/.gitkeep +0 -0
- data/spec/support/mybook/images/logo.gif +0 -0
- data/spec/support/mybook/output/.gitkeep +0 -0
- data/spec/support/mybook/templates/cover.erb +16 -0
- data/spec/support/mybook/templates/epub.css +1 -0
- data/spec/support/mybook/templates/epub.erb +15 -0
- data/spec/support/mybook/templates/layout.css +137 -0
- data/{templates/layouts/boom/layout.html → spec/support/mybook/templates/layout.erb} +26 -17
- data/{templates/themes/mac_classic.css → spec/support/mybook/templates/syntax.css} +63 -0
- data/spec/support/mybook/templates/user.css +1 -0
- data/spec/support/mybook/text/.gitkeep +0 -0
- data/spec/support/mybook/text/01_Markdown_Chapter.markdown +8 -0
- data/spec/support/mybook/text/02_Textile_Chapter.textile +3 -0
- data/spec/support/mybook/text/03_HTML_Chapter.html +3 -0
- data/spec/support/mybook/text/04_With_Directory/Some_Chapter.mkdn +3 -0
- data/spec/support/mybook/text/CHANGELOG.textile +6 -0
- data/spec/support/mybook/text/TOC.textile +0 -0
- data/spec/support/mybook/text/_00_Introduction.markdown +3 -0
- data/spec/support/shared.rb +16 -0
- data/templates/config.erb +48 -0
- data/templates/cover.erb +16 -0
- data/templates/ebook.png +0 -0
- data/templates/epub.css +0 -0
- data/templates/epub.erb +15 -0
- data/templates/helper.rb +29 -0
- data/templates/layout.css +353 -0
- data/templates/layout.erb +44 -0
- data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/active4d.css +0 -0
- data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/all_hallows_eve.css +0 -0
- data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/amy.css +0 -0
- data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/blackboard.css +0 -0
- data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/brilliance_black.css +0 -0
- data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/brilliance_dull.css +0 -0
- data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/cobalt.css +0 -0
- data/{lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css → templates/styles}/dawn.css +0 -0
- data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/eiffel.css +0 -0
- data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/espresso_libre.css +0 -0
- data/{lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css → templates/styles}/idle.css +0 -0
- data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/iplastic.css +0 -0
- data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/lazy.css +0 -0
- data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/mac_classic.css +0 -0
- data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/magicwb_amiga.css +0 -0
- data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/pastels_on_dark.css +0 -0
- data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/slush_poppies.css +0 -0
- data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/spacecadet.css +0 -0
- data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/sunburst.css +0 -0
- data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/twilight.css +0 -0
- data/{lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css → templates/styles}/zenburnesque.css +0 -0
- data/templates/user.css +1 -1
- metadata +395 -501
- data/README.markdown +0 -60
- data/VERSION +0 -1
- data/lib/kitabu/base.rb +0 -271
- data/lib/kitabu/blackcloth.rb +0 -184
- data/lib/kitabu/command.rb +0 -94
- data/lib/kitabu/redcloth.rb +0 -964
- data/lib/kitabu/tasks.rb +0 -113
- data/lib/kitabu/templates.rb +0 -54
- data/lib/kitabu/vendor/colorize/colorize.rb +0 -81
- data/lib/kitabu/vendor/ruby1.8/plist/plist.rb +0 -22
- data/lib/kitabu/vendor/ruby1.8/plist/plist/generator.rb +0 -224
- data/lib/kitabu/vendor/ruby1.8/plist/plist/parser.rb +0 -224
- data/lib/kitabu/vendor/ruby1.8/textpow/textpow.rb +0 -10
- data/lib/kitabu/vendor/ruby1.8/textpow/textpow/debug_processor.rb +0 -36
- data/lib/kitabu/vendor/ruby1.8/textpow/textpow/score_manager.rb +0 -65
- data/lib/kitabu/vendor/ruby1.8/textpow/textpow/syntax.rb +0 -284
- data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/active4d.render +0 -140
- data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/all_hallows_eve.render +0 -104
- data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/amy.render +0 -179
- data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/blackboard.render +0 -119
- data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/brilliance_black.render +0 -560
- data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/brilliance_dull.render +0 -569
- data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/cobalt.render +0 -170
- data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/dawn.render +0 -134
- data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/eiffel.render +0 -140
- data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/espresso_libre.render +0 -131
- data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/files/css/dawn.css +0 -121
- data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/idle.render +0 -101
- data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/iplastic.render +0 -107
- data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/lazy.render +0 -104
- data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/mac_classic.render +0 -143
- data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/magicwb_amiga.render +0 -125
- data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/pastels_on_dark.render +0 -212
- data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/slush_poppies.render +0 -131
- data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/spacecadet.render +0 -89
- data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/sunburst.render +0 -194
- data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/twilight.render +0 -161
- data/lib/kitabu/vendor/ruby1.8/uv/render/xhtml/zenburnesque.render +0 -134
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/actionscript.syntax +0 -97
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/active4d.syntax +0 -276
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/active4d_html.syntax +0 -311
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/active4d_ini.syntax +0 -50
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/active4d_library.syntax +0 -21
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/ada.syntax +0 -33
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/antlr.syntax +0 -151
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/apache.syntax +0 -191
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/applescript.syntax +0 -384
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/asp.syntax +0 -70
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/asp_vb.net.syntax +0 -129
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/bibtex.syntax +0 -151
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/blog_html.syntax +0 -41
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/blog_markdown.syntax +0 -42
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/blog_text.syntax +0 -27
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/blog_textile.syntax +0 -27
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/buggy/nemerle.syntax +0 -74
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/build.syntax +0 -53
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/bulletin_board.syntax +0 -287
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/c++.syntax +0 -109
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/c.syntax +0 -326
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/cake.syntax +0 -55
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/camlp4.syntax +0 -36
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/cm.syntax +0 -32
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/coldfusion.syntax +0 -119
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/context_free.syntax +0 -176
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/cs.syntax +0 -59
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/css.syntax +0 -195
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/css_experimental.syntax +0 -1925
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/csv.syntax +0 -68
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/d.syntax +0 -142
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/diff.syntax +0 -81
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/dokuwiki.syntax +0 -204
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/dot.syntax +0 -47
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/doxygen.syntax +0 -43
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/dylan.syntax +0 -62
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/eiffel.syntax +0 -78
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/erlang.syntax +0 -922
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/f-script.syntax +0 -80
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/fortran.syntax +0 -141
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/fxscript.syntax +0 -142
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/greasemonkey.syntax +0 -34
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/gri.syntax +0 -83
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/groovy.syntax +0 -191
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/gtd.syntax +0 -22
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/gtdalt.syntax +0 -143
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/haml.syntax +0 -88
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/haskell.syntax +0 -88
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/html-asp.syntax +0 -27
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/html.syntax +0 -362
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/html_django.syntax +0 -36
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/html_for_asp.net.syntax +0 -424
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/html_mason.syntax +0 -119
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/html_rails.syntax +0 -40
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/html_tcl.syntax +0 -26
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/icalendar.syntax +0 -32
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/inform.syntax +0 -48
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/ini.syntax +0 -55
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/installer_distribution_script.syntax +0 -77
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/io.syntax +0 -81
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/java.syntax +0 -211
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/javaproperties.syntax +0 -20
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/javascript.syntax +0 -256
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/javascript_+_prototype.syntax +0 -72
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/javascript_+_prototype_bracketed.syntax +0 -140
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/jquery_javascript.syntax +0 -114
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/json.syntax +0 -136
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/languagedefinition.syntax +0 -708
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/latex.syntax +0 -566
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/latex_beamer.syntax +0 -41
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/latex_log.syntax +0 -50
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/latex_memoir.syntax +0 -64
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/lexflex.syntax +0 -219
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/lighttpd.syntax +0 -54
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/lilypond.syntax +0 -492
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/lisp.syntax +0 -61
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/literate_haskell.syntax +0 -24
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/logo.syntax +0 -29
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/logtalk.syntax +0 -152
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/lua.syntax +0 -86
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/m.syntax +0 -142
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/macports_portfile.syntax +0 -163
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/mail.syntax +0 -118
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/makefile.syntax +0 -36
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/man.syntax +0 -17
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/markdown.syntax +0 -543
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/mediawiki.syntax +0 -567
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/mel.syntax +0 -92
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/mips.syntax +0 -66
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/mod_perl.syntax +0 -50
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/modula-3.syntax +0 -47
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/moinmoin.syntax +0 -189
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/mootools.syntax +0 -572
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/movable_type.syntax +0 -162
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/multimarkdown.syntax +0 -39
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/objective-c++.syntax +0 -18
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/objective-c.syntax +0 -233
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/ocaml.syntax +0 -764
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/ocamllex.syntax +0 -167
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/ocamlyacc.syntax +0 -184
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/old/YAML.yaml +0 -160
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/old/txt2tags.yaml +0 -139
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/opengl.syntax +0 -14
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/pascal.syntax +0 -77
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/perl.syntax +0 -1115
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/php.syntax +0 -1253
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/plain_text.syntax +0 -32
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/pmwiki.syntax +0 -113
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/postscript.syntax +0 -114
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/processing.syntax +0 -106
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/prolog.syntax +0 -40
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/property_list.syntax +0 -635
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/python.syntax +0 -868
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/python_django.syntax +0 -21
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/qmake_project.syntax +0 -114
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/qt_c++.syntax +0 -26
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/quake3_config.syntax +0 -32
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/r.syntax +0 -81
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/r_console.syntax +0 -16
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/ragel.syntax +0 -201
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/rd_r_documentation.syntax +0 -91
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/regexp.syntax +0 -50
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/regular_expressions_oniguruma.syntax +0 -107
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/regular_expressions_python.syntax +0 -109
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/release_notes.syntax +0 -46
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/remind.syntax +0 -253
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/restructuredtext.syntax +0 -250
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/rez.syntax +0 -80
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/ruby.syntax +0 -1035
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/ruby_experimental.syntax +0 -145
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/ruby_on_rails.syntax +0 -88
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/s5.syntax +0 -69
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/scheme.syntax +0 -347
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/scilab.syntax +0 -41
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/setext.syntax +0 -147
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/shell-unix-generic.syntax +0 -384
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/slate.syntax +0 -149
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/smarty.syntax +0 -63
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/sql.syntax +0 -237
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/sql_rails.syntax +0 -18
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/ssh-config.syntax +0 -33
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/standard_ml.syntax +0 -121
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/strings_file.syntax +0 -39
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/subversion_commit_message.syntax +0 -36
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/sweave.syntax +0 -84
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/swig.syntax +0 -57
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/tcl.syntax +0 -152
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/template_toolkit.syntax +0 -121
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/tex.syntax +0 -86
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/tex_math.syntax +0 -49
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/textile.syntax +0 -215
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/tsv.syntax +0 -50
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/twiki.syntax +0 -241
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/txt2tags.syntax +0 -79
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/vectorscript.syntax +0 -57
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/xhtml_1.0.syntax +0 -4027
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/xml.syntax +0 -180
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/xml_strict.syntax +0 -92
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/xsl.syntax +0 -60
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/yaml.syntax +0 -160
- data/lib/kitabu/vendor/ruby1.8/uv/syntax/yui_javascript.syntax +0 -176
- data/lib/kitabu/vendor/ruby1.8/uv/uv.rb +0 -88
- data/lib/kitabu/vendor/ruby1.8/uv/uv/render_processor.rb +0 -131
- data/lib/kitabu/vendor/ruby1.8/uv/uv/utility.rb +0 -67
- data/lib/kitabu/vendor/ruby1.9/plist/plist.rb +0 -23
- data/lib/kitabu/vendor/ruby1.9/plist/plist/generator.rb +0 -228
- data/lib/kitabu/vendor/ruby1.9/plist/plist/parser.rb +0 -225
- data/lib/kitabu/vendor/ruby1.9/textpow/textpow.rb +0 -10
- data/lib/kitabu/vendor/ruby1.9/textpow/textpow/debug_processor.rb +0 -37
- data/lib/kitabu/vendor/ruby1.9/textpow/textpow/score_manager.rb +0 -66
- data/lib/kitabu/vendor/ruby1.9/textpow/textpow/syntax.rb +0 -286
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/active4d.render +0 -140
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/all_hallows_eve.render +0 -104
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/amy.render +0 -179
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/blackboard.render +0 -119
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/brilliance_black.render +0 -560
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/brilliance_dull.render +0 -569
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/cobalt.render +0 -170
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/dawn.render +0 -134
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/eiffel.render +0 -140
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/espresso_libre.render +0 -131
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/active4d.css +0 -114
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/all_hallows_eve.css +0 -72
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/amy.css +0 -147
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/blackboard.css +0 -88
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/brilliance_black.css +0 -605
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/brilliance_dull.css +0 -599
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/cobalt.css +0 -149
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/eiffel.css +0 -121
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/espresso_libre.css +0 -109
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/iplastic.css +0 -80
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/lazy.css +0 -73
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/mac_classic.css +0 -123
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/magicwb_amiga.css +0 -104
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/pastels_on_dark.css +0 -188
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/slush_poppies.css +0 -85
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/spacecadet.css +0 -51
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/sunburst.css +0 -180
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/twilight.css +0 -137
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/files/css/zenburnesque.css +0 -91
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/idle.render +0 -101
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/iplastic.render +0 -107
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/lazy.render +0 -104
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/mac_classic.render +0 -143
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/magicwb_amiga.render +0 -125
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/pastels_on_dark.render +0 -212
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/slush_poppies.render +0 -131
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/spacecadet.render +0 -89
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/sunburst.render +0 -194
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/twilight.render +0 -161
- data/lib/kitabu/vendor/ruby1.9/uv/render/xhtml/zenburnesque.render +0 -134
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/actionscript.syntax +0 -97
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/active4d.syntax +0 -276
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/active4d_html.syntax +0 -311
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/active4d_ini.syntax +0 -50
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/active4d_library.syntax +0 -21
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/ada.syntax +0 -33
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/antlr.syntax +0 -151
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/apache.syntax +0 -191
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/applescript.syntax +0 -384
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/asp.syntax +0 -70
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/asp_vb.net.syntax +0 -129
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/bibtex.syntax +0 -151
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/blog_html.syntax +0 -41
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/blog_markdown.syntax +0 -42
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/blog_text.syntax +0 -27
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/blog_textile.syntax +0 -27
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/build.syntax +0 -53
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/bulletin_board.syntax +0 -287
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/cake.syntax +0 -55
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/camlp4.syntax +0 -36
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/cm.syntax +0 -32
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/coldfusion.syntax +0 -119
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/context_free.syntax +0 -176
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/cs.syntax +0 -59
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/css.syntax +0 -195
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/css_experimental.syntax +0 -1925
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/csv.syntax +0 -68
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/d.syntax +0 -142
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/diff.syntax +0 -81
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/dokuwiki.syntax +0 -204
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/dot.syntax +0 -47
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/doxygen.syntax +0 -43
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/dylan.syntax +0 -62
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/eiffel.syntax +0 -78
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/erlang.syntax +0 -922
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/f-script.syntax +0 -80
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/fortran.syntax +0 -141
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/fxscript.syntax +0 -142
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/greasemonkey.syntax +0 -34
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/gri.syntax +0 -83
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/groovy.syntax +0 -191
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/gtd.syntax +0 -22
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/gtdalt.syntax +0 -143
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/haml.syntax +0 -88
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/haskell.syntax +0 -88
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/html-asp.syntax +0 -27
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/html.syntax +0 -362
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/html_django.syntax +0 -36
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/html_for_asp.net.syntax +0 -424
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/html_mason.syntax +0 -119
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/html_rails.syntax +0 -40
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/html_tcl.syntax +0 -26
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/icalendar.syntax +0 -32
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/inform.syntax +0 -48
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/ini.syntax +0 -55
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/installer_distribution_script.syntax +0 -77
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/io.syntax +0 -81
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/java.syntax +0 -211
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/javaproperties.syntax +0 -20
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/javascript.syntax +0 -256
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/javascript_+_prototype.syntax +0 -72
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/javascript_+_prototype_bracketed.syntax +0 -140
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/jquery_javascript.syntax +0 -114
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/json.syntax +0 -136
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/languagedefinition.syntax +0 -708
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/latex.syntax +0 -566
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/latex_beamer.syntax +0 -41
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/latex_log.syntax +0 -50
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/latex_memoir.syntax +0 -64
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/lexflex.syntax +0 -219
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/lighttpd.syntax +0 -54
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/lilypond.syntax +0 -492
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/lisp.syntax +0 -61
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/literate_haskell.syntax +0 -24
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/logo.syntax +0 -29
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/logtalk.syntax +0 -152
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/lua.syntax +0 -86
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/m.syntax +0 -142
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/macports_portfile.syntax +0 -163
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/makefile.syntax +0 -36
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/man.syntax +0 -17
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/mediawiki.syntax +0 -567
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/mips.syntax +0 -66
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/mod_perl.syntax +0 -50
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/modula-3.syntax +0 -47
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/moinmoin.syntax +0 -189
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/mootools.syntax +0 -572
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/movable_type.syntax +0 -162
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/multimarkdown.syntax +0 -39
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/objective-c++.syntax +0 -18
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/objective-c.syntax +0 -233
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/ocaml.syntax +0 -764
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/ocamllex.syntax +0 -167
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/ocamlyacc.syntax +0 -184
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/opengl.syntax +0 -14
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/pascal.syntax +0 -77
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/perl.syntax +0 -1115
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/plain_text.syntax +0 -32
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/postscript.syntax +0 -114
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/processing.syntax +0 -106
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/prolog.syntax +0 -40
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/property_list.syntax +0 -635
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/python.syntax +0 -868
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/python_django.syntax +0 -21
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/qmake_project.syntax +0 -114
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/qt_c++.syntax +0 -26
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/quake3_config.syntax +0 -32
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/r.syntax +0 -81
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/r_console.syntax +0 -16
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/ragel.syntax +0 -201
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/rd_r_documentation.syntax +0 -91
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/regexp.syntax +0 -50
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/release_notes.syntax +0 -46
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/remind.syntax +0 -253
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/restructuredtext.syntax +0 -250
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/rez.syntax +0 -80
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/ruby.syntax +0 -1035
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/ruby_experimental.syntax +0 -145
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/ruby_on_rails.syntax +0 -88
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/s5.syntax +0 -69
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/scheme.syntax +0 -347
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/scilab.syntax +0 -41
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/setext.syntax +0 -147
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/shell-unix-generic.syntax +0 -384
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/slate.syntax +0 -149
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/sql.syntax +0 -237
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/sql_rails.syntax +0 -18
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/ssh-config.syntax +0 -33
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/standard_ml.syntax +0 -121
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/strings_file.syntax +0 -39
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/subversion_commit_message.syntax +0 -36
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/sweave.syntax +0 -84
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/swig.syntax +0 -57
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/tcl.syntax +0 -152
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/template_toolkit.syntax +0 -121
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/tex.syntax +0 -86
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/tex_math.syntax +0 -49
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/textile.syntax +0 -215
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/tsv.syntax +0 -50
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/twiki.syntax +0 -241
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/txt2tags.syntax +0 -79
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/vectorscript.syntax +0 -57
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/xhtml_1.0.syntax +0 -4027
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/xml.syntax +0 -180
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/xml_strict.syntax +0 -92
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/xsl.syntax +0 -60
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/yaml.syntax +0 -160
- data/lib/kitabu/vendor/ruby1.9/uv/syntax/yui_javascript.syntax +0 -176
- data/lib/kitabu/vendor/ruby1.9/uv/uv.rb +0 -89
- data/lib/kitabu/vendor/ruby1.9/uv/uv/render_processor.rb +0 -132
- data/lib/kitabu/vendor/ruby1.9/uv/uv/utility.rb +0 -68
- data/spec/exit_matcher.rb +0 -45
- data/spec/fixtures/rails-guides/code/sample.rb +0 -7
- data/spec/kitabu/base_spec.rb +0 -159
- data/spec/kitabu/blackcloth_spec.rb +0 -41
- data/spec/kitabu/bug_fix_spec.rb +0 -25
- data/spec/kitabu/command_spec.rb +0 -82
- data/templates/Rakefile +0 -3
- data/templates/config.yml +0 -9
- data/templates/layouts/boom/layout.css +0 -469
- data/templates/syntax.css +0 -1065
- data/templates/themes/active4d.css +0 -114
- data/templates/themes/blackboard.css +0 -88
- data/templates/themes/dawn.css +0 -121
- data/templates/themes/eiffel.css +0 -121
- data/templates/themes/idle.css +0 -62
- data/templates/themes/iplastic.css +0 -80
- data/templates/themes/lazy.css +0 -73
- data/templates/themes/slush_poppies.css +0 -85
- data/templates/themes/sunburst.css +0 -180
data/lib/kitabu/command.rb
DELETED
@@ -1,94 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
KITABU_HELP = <<-TXT
|
3
|
-
The 'kitabu' command creates a new book with a default
|
4
|
-
directory structure at the path you specify.
|
5
|
-
|
6
|
-
== Usage
|
7
|
-
kitabu [options] path
|
8
|
-
|
9
|
-
For help use: kitabu -h
|
10
|
-
|
11
|
-
== Options
|
12
|
-
-h, --help Displays help message
|
13
|
-
-v, --version Display the version, then exit
|
14
|
-
-l, --layout Specify which layout to use
|
15
|
-
|
16
|
-
== Examples
|
17
|
-
Using defaults.
|
18
|
-
kitabu mybook
|
19
|
-
|
20
|
-
Specify layout.
|
21
|
-
kitabu -l boom mybook
|
22
|
-
kitabu --layout boom mybook
|
23
|
-
|
24
|
-
== Author
|
25
|
-
Nando Vieira
|
26
|
-
http://simplesideias.com.br
|
27
|
-
|
28
|
-
== Copyright
|
29
|
-
Copyright (c) 2008-2009 Nando Vieira.
|
30
|
-
Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
|
31
|
-
TXT
|
32
|
-
|
33
|
-
module Kitabu
|
34
|
-
module Command
|
35
|
-
extend self
|
36
|
-
|
37
|
-
def run!
|
38
|
-
options = {}
|
39
|
-
|
40
|
-
opts = OptionParser.new do |opts|
|
41
|
-
opts.banner = "The 'kitabu' command creates a new book with a default\ndirectory structure at the path you specify."
|
42
|
-
|
43
|
-
opts.separator ""
|
44
|
-
opts.separator "Options:"
|
45
|
-
|
46
|
-
opts.on("-l", "--layout LAYOUT", "Specify which layout to use.", "Available: #{Kitabu::Base.layouts.join(', ')}") do |layout|
|
47
|
-
if layout && !Kitabu::Base.layout?(layout)
|
48
|
-
output "Invalid layout"
|
49
|
-
exit 1
|
50
|
-
end
|
51
|
-
|
52
|
-
options[:layout] = layout
|
53
|
-
end
|
54
|
-
|
55
|
-
opts.on("-h", "--help", "Show help") do
|
56
|
-
output KITABU_HELP
|
57
|
-
exit 0
|
58
|
-
end
|
59
|
-
|
60
|
-
opts.on_tail("-v", "--version", "Show version") do
|
61
|
-
output Kitabu::VERSION
|
62
|
-
exit 0
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
args = ARGV.dup
|
67
|
-
other_args = opts.permute!
|
68
|
-
|
69
|
-
unless other_args.any?
|
70
|
-
output KITABU_HELP
|
71
|
-
exit 0
|
72
|
-
end
|
73
|
-
|
74
|
-
path = File.expand_path(other_args.first)
|
75
|
-
|
76
|
-
if File.exists?(path)
|
77
|
-
output "Output path already exists"
|
78
|
-
exit 1
|
79
|
-
end
|
80
|
-
|
81
|
-
opts.parse!(args)
|
82
|
-
|
83
|
-
Kitabu::Templates.process!({
|
84
|
-
:layout => options[:layout],
|
85
|
-
:theme => options[:theme],
|
86
|
-
:path => path
|
87
|
-
})
|
88
|
-
end
|
89
|
-
|
90
|
-
def output(*args)
|
91
|
-
puts *args
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|
data/lib/kitabu/redcloth.rb
DELETED
@@ -1,964 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
class RedCloth < String
|
3
|
-
|
4
|
-
VERSION = '3.0.4'
|
5
|
-
DEFAULT_RULES = [:textile, :markdown]
|
6
|
-
|
7
|
-
#
|
8
|
-
# Two accessor for setting security restrictions.
|
9
|
-
#
|
10
|
-
# This is a nice thing if you're using RedCloth for
|
11
|
-
# formatting in public places (e.g. Wikis) where you
|
12
|
-
# don't want users to abuse HTML for bad things.
|
13
|
-
#
|
14
|
-
# If +:filter_html+ is set, HTML which wasn't
|
15
|
-
# created by the Textile processor will be escaped.
|
16
|
-
#
|
17
|
-
# If +:filter_styles+ is set, it will also disable
|
18
|
-
# the style markup specifier. ('{color: red}')
|
19
|
-
#
|
20
|
-
attr_accessor :filter_html, :filter_styles
|
21
|
-
|
22
|
-
#
|
23
|
-
# Accessor for toggling hard breaks.
|
24
|
-
#
|
25
|
-
# If +:hard_breaks+ is set, single newlines will
|
26
|
-
# be converted to HTML break tags. This is the
|
27
|
-
# default behavior for traditional RedCloth.
|
28
|
-
#
|
29
|
-
attr_accessor :hard_breaks
|
30
|
-
|
31
|
-
# Accessor for toggling lite mode.
|
32
|
-
#
|
33
|
-
# In lite mode, block-level rules are ignored. This means
|
34
|
-
# that tables, paragraphs, lists, and such aren't available.
|
35
|
-
# Only the inline markup for bold, italics, entities and so on.
|
36
|
-
#
|
37
|
-
# r = RedCloth.new( "And then? She *fell*!", [:lite_mode] )
|
38
|
-
# r.to_html
|
39
|
-
# #=> "And then? She <strong>fell</strong>!"
|
40
|
-
#
|
41
|
-
attr_accessor :lite_mode
|
42
|
-
|
43
|
-
#
|
44
|
-
# Accessor for toggling span caps.
|
45
|
-
#
|
46
|
-
# Textile places `span' tags around capitalized
|
47
|
-
# words by default, but this wreaks havoc on Wikis.
|
48
|
-
# If +:no_span_caps+ is set, this will be
|
49
|
-
# suppressed.
|
50
|
-
#
|
51
|
-
attr_accessor :no_span_caps
|
52
|
-
|
53
|
-
#
|
54
|
-
# Establishes the markup predence. Available rules include:
|
55
|
-
#
|
56
|
-
# == Textile Rules
|
57
|
-
#
|
58
|
-
# The following textile rules can be set individually. Or add the complete
|
59
|
-
# set of rules with the single :textile rule, which supplies the rule set in
|
60
|
-
# the following precedence:
|
61
|
-
#
|
62
|
-
# refs_textile:: Textile references (i.e. [hobix]http://hobix.com/)
|
63
|
-
# block_textile_table:: Textile table block structures
|
64
|
-
# block_textile_lists:: Textile list structures
|
65
|
-
# block_textile_prefix:: Textile blocks with prefixes (i.e. bq., h2., etc.)
|
66
|
-
# inline_textile_image:: Textile inline images
|
67
|
-
# inline_textile_link:: Textile inline links
|
68
|
-
# inline_textile_span:: Textile inline spans
|
69
|
-
# glyphs_textile:: Textile entities (such as em-dashes and smart quotes)
|
70
|
-
#
|
71
|
-
# == Markdown
|
72
|
-
#
|
73
|
-
# refs_markdown:: Markdown references (for example: [hobix]: http://hobix.com/)
|
74
|
-
# block_markdown_setext:: Markdown setext headers
|
75
|
-
# block_markdown_atx:: Markdown atx headers
|
76
|
-
# block_markdown_rule:: Markdown horizontal rules
|
77
|
-
# block_markdown_bq:: Markdown blockquotes
|
78
|
-
# block_markdown_lists:: Markdown lists
|
79
|
-
# inline_markdown_link:: Markdown links
|
80
|
-
attr_accessor :rules
|
81
|
-
|
82
|
-
# Returns a new RedCloth object, based on _string_ and
|
83
|
-
# enforcing all the included _restrictions_.
|
84
|
-
#
|
85
|
-
# r = RedCloth.new( "h1. A <b>bold</b> man", [:filter_html] )
|
86
|
-
# r.to_html
|
87
|
-
# #=>"<h1>A <b>bold</b> man</h1>"
|
88
|
-
#
|
89
|
-
def initialize( string, restrictions = [] )
|
90
|
-
restrictions.each { |r| method( "#{ r }=" ).call( true ) }
|
91
|
-
super( string )
|
92
|
-
end
|
93
|
-
|
94
|
-
#
|
95
|
-
# Generates HTML from the Textile contents.
|
96
|
-
#
|
97
|
-
# r = RedCloth.new( "And then? She *fell*!" )
|
98
|
-
# r.to_html( true )
|
99
|
-
# #=>"And then? She <strong>fell</strong>!"
|
100
|
-
#
|
101
|
-
def to_html( *rules )
|
102
|
-
rules = DEFAULT_RULES if rules.empty?
|
103
|
-
# make our working copy
|
104
|
-
text = self.dup
|
105
|
-
|
106
|
-
@urlrefs = {}
|
107
|
-
@shelf = []
|
108
|
-
textile_rules = [:refs_textile, :block_textile_table, :block_textile_lists,
|
109
|
-
:block_textile_prefix, :inline_textile_image, :inline_textile_link,
|
110
|
-
:inline_textile_code, :inline_textile_span, :glyphs_textile]
|
111
|
-
markdown_rules = [:refs_markdown, :block_markdown_setext, :block_markdown_atx, :block_markdown_rule,
|
112
|
-
:block_markdown_bq, :block_markdown_lists,
|
113
|
-
:inline_markdown_reflink, :inline_markdown_link]
|
114
|
-
@rules = rules.collect do |rule|
|
115
|
-
case rule
|
116
|
-
when :markdown
|
117
|
-
markdown_rules
|
118
|
-
when :textile
|
119
|
-
textile_rules
|
120
|
-
else
|
121
|
-
rule
|
122
|
-
end
|
123
|
-
end.flatten
|
124
|
-
|
125
|
-
# standard clean up
|
126
|
-
incoming_entities text
|
127
|
-
clean_white_space text
|
128
|
-
|
129
|
-
# start processor
|
130
|
-
@pre_list = []
|
131
|
-
rip_offtags text
|
132
|
-
no_textile text
|
133
|
-
hard_break text
|
134
|
-
unless @lite_mode
|
135
|
-
refs text
|
136
|
-
blocks text
|
137
|
-
end
|
138
|
-
inline text
|
139
|
-
smooth_offtags text
|
140
|
-
|
141
|
-
retrieve text
|
142
|
-
|
143
|
-
text.gsub!( /<\/?notextile>/, '' )
|
144
|
-
text.gsub!( /x%x%/, '&' )
|
145
|
-
clean_html text if filter_html
|
146
|
-
text.strip!
|
147
|
-
text
|
148
|
-
|
149
|
-
end
|
150
|
-
|
151
|
-
#######
|
152
|
-
private
|
153
|
-
#######
|
154
|
-
#
|
155
|
-
# Mapping of 8-bit ASCII codes to HTML numerical entity equivalents.
|
156
|
-
# (from PyTextile)
|
157
|
-
#
|
158
|
-
TEXTILE_TAGS =
|
159
|
-
|
160
|
-
[[128, 8364], [129, 0], [130, 8218], [131, 402], [132, 8222], [133, 8230],
|
161
|
-
[134, 8224], [135, 8225], [136, 710], [137, 8240], [138, 352], [139, 8249],
|
162
|
-
[140, 338], [141, 0], [142, 0], [143, 0], [144, 0], [145, 8216], [146, 8217],
|
163
|
-
[147, 8220], [148, 8221], [149, 8226], [150, 8211], [151, 8212], [152, 732],
|
164
|
-
[153, 8482], [154, 353], [155, 8250], [156, 339], [157, 0], [158, 0], [159, 376]].
|
165
|
-
|
166
|
-
collect! do |a, b|
|
167
|
-
[a.chr, ( b.zero? and "" or "&#{ b };" )]
|
168
|
-
end
|
169
|
-
|
170
|
-
#
|
171
|
-
# Regular expressions to convert to HTML.
|
172
|
-
#
|
173
|
-
A_HLGN = /(?:(?:<>|<|>|\=|[()]+)+)/
|
174
|
-
A_VLGN = /[\-^~]/
|
175
|
-
C_CLAS = '(?:\([^)]+\))'
|
176
|
-
C_LNGE = '(?:\[[^\]]+\])'
|
177
|
-
C_STYL = '(?:\{[^}]+\})'
|
178
|
-
S_CSPN = '(?:\\\\\d+)'
|
179
|
-
S_RSPN = '(?:/\d+)'
|
180
|
-
A = "(?:#{A_HLGN}?#{A_VLGN}?|#{A_VLGN}?#{A_HLGN}?)"
|
181
|
-
S = "(?:#{S_CSPN}?#{S_RSPN}|#{S_RSPN}?#{S_CSPN}?)"
|
182
|
-
C = "(?:#{C_CLAS}?#{C_STYL}?#{C_LNGE}?|#{C_STYL}?#{C_LNGE}?#{C_CLAS}?|#{C_LNGE}?#{C_STYL}?#{C_CLAS}?)"
|
183
|
-
# PUNCT = Regexp::quote( '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~' )
|
184
|
-
PUNCT = Regexp::quote( '!"#$%&\'*+,-./:;=?@\\^_`|~' )
|
185
|
-
PUNCT_NOQ = Regexp::quote( '!"#$&\',./:;=?@\\`|' )
|
186
|
-
PUNCT_Q = Regexp::quote( '*-_+^~%' )
|
187
|
-
HYPERLINK = '(\S+?)([^\w\s/;=\?]*?)(?=\s|<|$)'
|
188
|
-
|
189
|
-
# Text markup tags, don't conflict with block tags
|
190
|
-
SIMPLE_HTML_TAGS = [
|
191
|
-
'tt', 'b', 'i', 'big', 'small', 'em', 'strong', 'dfn', 'code',
|
192
|
-
'samp', 'kbd', 'var', 'cite', 'abbr', 'acronym', 'a', 'img', 'br',
|
193
|
-
'br', 'map', 'q', 'sub', 'sup', 'span', 'bdo'
|
194
|
-
]
|
195
|
-
|
196
|
-
QTAGS = [
|
197
|
-
['**', 'b'],
|
198
|
-
['*', 'strong'],
|
199
|
-
['??', 'cite', :limit],
|
200
|
-
['-', 'del', :limit],
|
201
|
-
['__', 'i'],
|
202
|
-
['_', 'em', :limit],
|
203
|
-
['%', 'span', :limit],
|
204
|
-
['+', 'ins', :limit],
|
205
|
-
['^', 'sup'],
|
206
|
-
['~', 'sub']
|
207
|
-
]
|
208
|
-
QTAGS.collect! do |rc, ht, rtype|
|
209
|
-
rcq = Regexp::quote rc
|
210
|
-
re =
|
211
|
-
case rtype
|
212
|
-
when :limit
|
213
|
-
/(\W)
|
214
|
-
(#{rcq})
|
215
|
-
(#{C})
|
216
|
-
(?::(\S+?))?
|
217
|
-
(\S.*?\S|\S)
|
218
|
-
#{rcq}
|
219
|
-
(?=\W)/x
|
220
|
-
else
|
221
|
-
/(#{rcq})
|
222
|
-
(#{C})
|
223
|
-
(?::(\S+))?
|
224
|
-
(\S.*?\S|\S)
|
225
|
-
#{rcq}/xm
|
226
|
-
end
|
227
|
-
[rc, ht, re, rtype]
|
228
|
-
end
|
229
|
-
|
230
|
-
# Elements to handle
|
231
|
-
GLYPHS = [
|
232
|
-
# [ /([^\s\[{(>])?\'([dmst]\b|ll\b|ve\b|\s|:|$)/, '\1’\2' ], # single closing
|
233
|
-
[ /([^\s\[{(>#{PUNCT_Q}][#{PUNCT_Q}]*)\'/, '\1’' ], # single closing
|
234
|
-
[ /\'(?=[#{PUNCT_Q}]*(s\b|[\s#{PUNCT_NOQ}]))/, '’' ], # single closing
|
235
|
-
[ /\'/, '‘' ], # single opening
|
236
|
-
[ /</, '<' ], # less-than
|
237
|
-
[ />/, '>' ], # greater-than
|
238
|
-
# [ /([^\s\[{(])?"(\s|:|$)/, '\1”\2' ], # double closing
|
239
|
-
[ /([^\s\[{(>#{PUNCT_Q}][#{PUNCT_Q}]*)"/, '\1”' ], # double closing
|
240
|
-
[ /"(?=[#{PUNCT_Q}]*[\s#{PUNCT_NOQ}])/, '”' ], # double closing
|
241
|
-
[ /"/, '“' ], # double opening
|
242
|
-
[ /\b( )?\.{3}/, '\1…' ], # ellipsis
|
243
|
-
[ /\b([A-Z][A-Z0-9]{2,})\b(?:[(]([^)]*)[)])/, '<acronym title="\2">\1</acronym>' ], # 3+ uppercase acronym
|
244
|
-
[ /(^|[^"][>\s])([A-Z][A-Z0-9 ]+[A-Z0-9])([^<A-Za-z0-9]|$)/, '\1<span class="caps">\2</span>\3', :no_span_caps ], # 3+ uppercase caps
|
245
|
-
[ /(\.\s)?\s?--\s?/, '\1—' ], # em dash
|
246
|
-
[ /\s->\s/, ' → ' ], # right arrow
|
247
|
-
[ /\s-\s/, ' – ' ], # en dash
|
248
|
-
[ /(\d+) ?x ?(\d+)/, '\1×\2' ], # dimension sign
|
249
|
-
[ /\b ?[(\[]TM[\])]/i, '™' ], # trademark
|
250
|
-
[ /\b ?[(\[]R[\])]/i, '®' ], # registered
|
251
|
-
[ /\b ?[(\[]C[\])]/i, '©' ] # copyright
|
252
|
-
]
|
253
|
-
|
254
|
-
H_ALGN_VALS = {
|
255
|
-
'<' => 'left',
|
256
|
-
'=' => 'center',
|
257
|
-
'>' => 'right',
|
258
|
-
'<>' => 'justify'
|
259
|
-
}
|
260
|
-
|
261
|
-
V_ALGN_VALS = {
|
262
|
-
'^' => 'top',
|
263
|
-
'-' => 'middle',
|
264
|
-
'~' => 'bottom'
|
265
|
-
}
|
266
|
-
|
267
|
-
#
|
268
|
-
# Flexible HTML escaping
|
269
|
-
#
|
270
|
-
def htmlesc( str, mode )
|
271
|
-
str.gsub!( '&', '&' )
|
272
|
-
str.gsub!( '"', '"' ) if mode != :NoQuotes
|
273
|
-
str.gsub!( "'", ''' ) if mode == :Quotes
|
274
|
-
str.gsub!( '<', '<')
|
275
|
-
str.gsub!( '>', '>')
|
276
|
-
end
|
277
|
-
|
278
|
-
# Search and replace for Textile glyphs (quotes, dashes, other symbols)
|
279
|
-
def pgl( text )
|
280
|
-
GLYPHS.each do |re, resub, tog|
|
281
|
-
next if tog and method( tog ).call
|
282
|
-
text.gsub! re, resub
|
283
|
-
end
|
284
|
-
end
|
285
|
-
|
286
|
-
# Parses Textile attribute lists and builds an HTML attribute string
|
287
|
-
def pba( text_in, element = "" )
|
288
|
-
|
289
|
-
return '' unless text_in
|
290
|
-
|
291
|
-
style = []
|
292
|
-
text = text_in.dup
|
293
|
-
if element == 'td'
|
294
|
-
colspan = $1 if text =~ /\\(\d+)/
|
295
|
-
rowspan = $1 if text =~ /\/(\d+)/
|
296
|
-
style << "vertical-align:#{ v_align( $& ) };" if text =~ A_VLGN
|
297
|
-
end
|
298
|
-
|
299
|
-
style << "#{ $1 };" if not filter_styles and
|
300
|
-
text.sub!( /\{([^}]*)\}/, '' )
|
301
|
-
|
302
|
-
lang = $1 if
|
303
|
-
text.sub!( /\[([^)]+?)\]/, '' )
|
304
|
-
|
305
|
-
cls = $1 if
|
306
|
-
text.sub!( /\(([^()]+?)\)/, '' )
|
307
|
-
|
308
|
-
style << "padding-left:#{ $1.length }em;" if
|
309
|
-
text.sub!( /([(]+)/, '' )
|
310
|
-
|
311
|
-
style << "padding-right:#{ $1.length }em;" if text.sub!( /([)]+)/, '' )
|
312
|
-
|
313
|
-
style << "text-align:#{ h_align( $& ) };" if text =~ A_HLGN
|
314
|
-
|
315
|
-
cls, id = $1, $2 if cls =~ /^(.*?)#(.*)$/
|
316
|
-
|
317
|
-
atts = ''
|
318
|
-
atts << " style=\"#{ style.join }\"" unless style.empty?
|
319
|
-
atts << " class=\"#{ cls }\"" unless cls.to_s.empty?
|
320
|
-
atts << " lang=\"#{ lang }\"" if lang
|
321
|
-
atts << " id=\"#{ id }\"" if id
|
322
|
-
atts << " colspan=\"#{ colspan }\"" if colspan
|
323
|
-
atts << " rowspan=\"#{ rowspan }\"" if rowspan
|
324
|
-
|
325
|
-
atts
|
326
|
-
end
|
327
|
-
|
328
|
-
TABLE_RE = /^(?:table(_?#{S}#{A}#{C})\. ?\n)?^(#{A}#{C}\.? ?\|.*?\|)(\n\n|\Z)/m
|
329
|
-
|
330
|
-
# Parses a Textile table block, building HTML from the result.
|
331
|
-
def block_textile_table( text )
|
332
|
-
text.gsub!( TABLE_RE ) do |matches|
|
333
|
-
|
334
|
-
tatts, fullrow = $~[1..2]
|
335
|
-
tatts = pba( tatts, 'table' )
|
336
|
-
tatts = shelve( tatts ) if tatts
|
337
|
-
rows = []
|
338
|
-
|
339
|
-
fullrow.
|
340
|
-
split( /\|$/m ).
|
341
|
-
delete_if { |x| x.empty? }.
|
342
|
-
each do |row|
|
343
|
-
|
344
|
-
ratts, row = pba( $1, 'tr' ), $2 if row =~ /^(#{A}#{C}\. )(.*)/m
|
345
|
-
|
346
|
-
cells = []
|
347
|
-
row.split( '|' ).each do |cell|
|
348
|
-
ctyp = 'd'
|
349
|
-
ctyp = 'h' if cell =~ /^_/
|
350
|
-
|
351
|
-
catts = ''
|
352
|
-
catts, cell = pba( $1, 'td' ), $2 if cell =~ /^(_?#{S}#{A}#{C}\. ?)(.*)/
|
353
|
-
|
354
|
-
unless cell.strip.empty?
|
355
|
-
catts = shelve( catts ) if catts
|
356
|
-
cells << "\t\t\t<t#{ ctyp }#{ catts }>#{ cell }</t#{ ctyp }>"
|
357
|
-
end
|
358
|
-
end
|
359
|
-
ratts = shelve( ratts ) if ratts
|
360
|
-
rows << "\t\t<tr#{ ratts }>\n#{ cells.join( "\n" ) }\n\t\t</tr>"
|
361
|
-
end
|
362
|
-
"\t<table#{ tatts }>\n#{ rows.join( "\n" ) }\n\t</table>\n\n"
|
363
|
-
end
|
364
|
-
end
|
365
|
-
|
366
|
-
LISTS_RE = /^([#*]+?#{C} .*?)$(?![^#*])/m
|
367
|
-
LISTS_CONTENT_RE = /^([#*]+)(#{A}#{C}) (.*)$/m
|
368
|
-
|
369
|
-
# Parses Textile lists and generates HTML
|
370
|
-
def block_textile_lists( text )
|
371
|
-
text.gsub!( LISTS_RE ) do |match|
|
372
|
-
lines = match.split( /\n/ )
|
373
|
-
last_line = -1
|
374
|
-
depth = []
|
375
|
-
lines.each_with_index do |line, line_id|
|
376
|
-
if line =~ LISTS_CONTENT_RE
|
377
|
-
tl,atts,content = $~[1..3]
|
378
|
-
if depth.last
|
379
|
-
if depth.last.length > tl.length
|
380
|
-
(depth.length - 1).downto(0) do |i|
|
381
|
-
break if depth[i].length == tl.length
|
382
|
-
lines[line_id - 1] << "</li>\n\t</#{ lT( depth[i] ) }l>\n\t"
|
383
|
-
depth.pop
|
384
|
-
end
|
385
|
-
end
|
386
|
-
if depth.last and depth.last.length == tl.length
|
387
|
-
lines[line_id - 1] << '</li>'
|
388
|
-
end
|
389
|
-
end
|
390
|
-
unless depth.last == tl
|
391
|
-
depth << tl
|
392
|
-
atts = pba( atts )
|
393
|
-
atts = shelve( atts ) if atts
|
394
|
-
lines[line_id] = "\t<#{ lT(tl) }l#{ atts }>\n\t<li>#{ content }"
|
395
|
-
else
|
396
|
-
lines[line_id] = "\t\t<li>#{ content }"
|
397
|
-
end
|
398
|
-
last_line = line_id
|
399
|
-
|
400
|
-
else
|
401
|
-
last_line = line_id
|
402
|
-
end
|
403
|
-
if line_id - last_line > 1 or line_id == lines.length - 1
|
404
|
-
depth.delete_if do |v|
|
405
|
-
lines[last_line] << "</li>\n\t</#{ lT( v ) }l>"
|
406
|
-
end
|
407
|
-
end
|
408
|
-
end
|
409
|
-
lines.join( "\n" )
|
410
|
-
end
|
411
|
-
end
|
412
|
-
|
413
|
-
CODE_RE = /(\W)
|
414
|
-
@
|
415
|
-
(?:\|(\w+?)\|)?
|
416
|
-
(.+?)
|
417
|
-
@
|
418
|
-
(?=\W)/x
|
419
|
-
|
420
|
-
def inline_textile_code( text )
|
421
|
-
text.gsub!( CODE_RE ) do |m|
|
422
|
-
before,lang,code,after = $~[1..4]
|
423
|
-
lang = " lang=\"#{ lang }\"" if lang
|
424
|
-
rip_offtags( "#{ before }<code#{ lang }>#{ code }</code>#{ after }" )
|
425
|
-
end
|
426
|
-
end
|
427
|
-
|
428
|
-
def lT( text )
|
429
|
-
text =~ /\#$/ ? 'o' : 'u'
|
430
|
-
end
|
431
|
-
|
432
|
-
def hard_break( text )
|
433
|
-
text.gsub!( /(.)\n(?!\Z| *([#*=]+(\s|$)|[{|]))/, "\\1<br />" ) if hard_breaks
|
434
|
-
end
|
435
|
-
|
436
|
-
BLOCKS_GROUP_RE = /\n{2,}(?! )/m
|
437
|
-
|
438
|
-
def blocks( text, deep_code = false )
|
439
|
-
text.replace( text.split( BLOCKS_GROUP_RE ).collect do |blk|
|
440
|
-
plain = blk !~ /\A[#*> ]/
|
441
|
-
|
442
|
-
# skip blocks that are complex HTML
|
443
|
-
if blk =~ /^<\/?(\w+).*>/ and not SIMPLE_HTML_TAGS.include? $1
|
444
|
-
blk
|
445
|
-
else
|
446
|
-
# search for indentation levels
|
447
|
-
blk.strip!
|
448
|
-
if blk.empty?
|
449
|
-
blk
|
450
|
-
else
|
451
|
-
code_blk = nil
|
452
|
-
blk.gsub!( /((?:\n(?:\n^ +[^\n]*)+)+)/m ) do |iblk|
|
453
|
-
flush_left iblk
|
454
|
-
blocks iblk, plain
|
455
|
-
iblk.gsub( /^(\S)/, "\t\\1" )
|
456
|
-
if plain
|
457
|
-
code_blk = iblk; ""
|
458
|
-
else
|
459
|
-
iblk
|
460
|
-
end
|
461
|
-
end
|
462
|
-
|
463
|
-
block_applied = 0
|
464
|
-
@rules.each do |rule_name|
|
465
|
-
block_applied += 1 if ( rule_name.to_s.match /^block_/ and method( rule_name ).call( blk ) )
|
466
|
-
end
|
467
|
-
if block_applied.zero?
|
468
|
-
if deep_code
|
469
|
-
blk = "\t<pre><code>#{ blk }</code></pre>"
|
470
|
-
else
|
471
|
-
blk = "\t<p>#{ blk }</p>"
|
472
|
-
end
|
473
|
-
end
|
474
|
-
# hard_break blk
|
475
|
-
blk + "\n#{ code_blk }"
|
476
|
-
end
|
477
|
-
end
|
478
|
-
|
479
|
-
end.join( "\n\n" ) )
|
480
|
-
end
|
481
|
-
|
482
|
-
def textile_bq( tag, atts, cite, content )
|
483
|
-
cite, cite_title = check_refs( cite )
|
484
|
-
cite = " cite=\"#{ cite }\"" if cite
|
485
|
-
atts = shelve( atts ) if atts
|
486
|
-
"\t<blockquote#{ cite }>\n\t\t<p#{ atts }>#{ content }</p>\n\t</blockquote>"
|
487
|
-
end
|
488
|
-
|
489
|
-
def textile_p( tag, atts, cite, content )
|
490
|
-
atts = shelve( atts ) if atts
|
491
|
-
"\t<#{ tag }#{ atts }>#{ content }</#{ tag }>"
|
492
|
-
end
|
493
|
-
|
494
|
-
alias textile_h1 textile_p
|
495
|
-
alias textile_h2 textile_p
|
496
|
-
alias textile_h3 textile_p
|
497
|
-
alias textile_h4 textile_p
|
498
|
-
alias textile_h5 textile_p
|
499
|
-
alias textile_h6 textile_p
|
500
|
-
|
501
|
-
def textile_fn_( tag, num, atts, cite, content )
|
502
|
-
atts << " id=\"fn#{ num }\""
|
503
|
-
content = "<sup>#{ num }</sup> #{ content }"
|
504
|
-
atts = shelve( atts ) if atts
|
505
|
-
"\t<p#{ atts }>#{ content }</p>"
|
506
|
-
end
|
507
|
-
|
508
|
-
BLOCK_RE = /^(([a-z]+)(\d*))(#{A}#{C})\.(?::(\S+))? (.*)$/m
|
509
|
-
|
510
|
-
def block_textile_prefix( text )
|
511
|
-
if text =~ BLOCK_RE
|
512
|
-
tag,tagpre,num,atts,cite,content = $~[1..6]
|
513
|
-
atts = pba( atts )
|
514
|
-
|
515
|
-
# pass to prefix handler
|
516
|
-
if respond_to? "textile_#{ tag }", true
|
517
|
-
text.gsub!( $&, method( "textile_#{ tag }" ).call( tag, atts, cite, content ) )
|
518
|
-
elsif respond_to? "textile_#{ tagpre }_", true
|
519
|
-
text.gsub!( $&, method( "textile_#{ tagpre }_" ).call( tagpre, num, atts, cite, content ) )
|
520
|
-
end
|
521
|
-
end
|
522
|
-
end
|
523
|
-
|
524
|
-
SETEXT_RE = /\A(.+?)\n([=-])[=-]* *$/m
|
525
|
-
def block_markdown_setext( text )
|
526
|
-
if text =~ SETEXT_RE
|
527
|
-
tag = if $2 == "="; "h1"; else; "h2"; end
|
528
|
-
blk, cont = "<#{ tag }>#{ $1 }</#{ tag }>", $'
|
529
|
-
blocks cont
|
530
|
-
text.replace( blk + cont )
|
531
|
-
end
|
532
|
-
end
|
533
|
-
|
534
|
-
ATX_RE = /\A(\#{1,6}) # $1 = string of #'s
|
535
|
-
[ ]*
|
536
|
-
(.+?) # $2 = Header text
|
537
|
-
[ ]*
|
538
|
-
\#* # optional closing #'s (not counted)
|
539
|
-
$/x
|
540
|
-
def block_markdown_atx( text )
|
541
|
-
if text =~ ATX_RE
|
542
|
-
tag = "h#{ $1.length }"
|
543
|
-
blk, cont = "<#{ tag }>#{ $2 }</#{ tag }>\n\n", $'
|
544
|
-
blocks cont
|
545
|
-
text.replace( blk + cont )
|
546
|
-
end
|
547
|
-
end
|
548
|
-
|
549
|
-
MARKDOWN_BQ_RE = /\A(^ *> ?.+$(.+\n)*\n*)+/m
|
550
|
-
|
551
|
-
def block_markdown_bq( text )
|
552
|
-
text.gsub!( MARKDOWN_BQ_RE ) do |blk|
|
553
|
-
blk.gsub!( /^ *> ?/, '' )
|
554
|
-
flush_left blk
|
555
|
-
blocks blk
|
556
|
-
blk.gsub!( /^(\S)/, "\t\\1" )
|
557
|
-
"<blockquote>\n#{ blk }\n</blockquote>\n\n"
|
558
|
-
end
|
559
|
-
end
|
560
|
-
|
561
|
-
MARKDOWN_RULE_RE = /^(#{
|
562
|
-
['*', '-', '_'].collect { |ch| '( ?' + Regexp::quote( ch ) + ' ?){3,}' }.join( '|' )
|
563
|
-
})$/
|
564
|
-
|
565
|
-
def block_markdown_rule( text )
|
566
|
-
text.gsub!( MARKDOWN_RULE_RE ) do |blk|
|
567
|
-
"<hr />"
|
568
|
-
end
|
569
|
-
end
|
570
|
-
|
571
|
-
# XXX TODO XXX
|
572
|
-
def block_markdown_lists( text )
|
573
|
-
end
|
574
|
-
|
575
|
-
def inline_textile_span( text )
|
576
|
-
QTAGS.each do |qtag_rc, ht, qtag_re, rtype|
|
577
|
-
text.gsub!( qtag_re ) do |m|
|
578
|
-
|
579
|
-
case rtype
|
580
|
-
when :limit
|
581
|
-
sta,qtag,atts,cite,content = $~[1..5]
|
582
|
-
else
|
583
|
-
qtag,atts,cite,content = $~[1..4]
|
584
|
-
sta = ''
|
585
|
-
end
|
586
|
-
atts = pba( atts )
|
587
|
-
atts << " cite=\"#{ cite }\"" if cite
|
588
|
-
atts = shelve( atts ) if atts
|
589
|
-
|
590
|
-
"#{ sta }<#{ ht }#{ atts }>#{ content }</#{ ht }>"
|
591
|
-
|
592
|
-
end
|
593
|
-
end
|
594
|
-
end
|
595
|
-
|
596
|
-
LINK_RE = /
|
597
|
-
([\s\[{(]|[#{PUNCT}])? # $pre
|
598
|
-
" # start
|
599
|
-
(#{C}) # $atts
|
600
|
-
([^"]+?) # $text
|
601
|
-
\s?
|
602
|
-
(?:\(([^)]+?)\)(?="))? # $title
|
603
|
-
":
|
604
|
-
(\S+?) # $url
|
605
|
-
(\/)? # $slash
|
606
|
-
([^\w\/;]*?) # $post
|
607
|
-
(?=<|\s|$)
|
608
|
-
/x
|
609
|
-
|
610
|
-
def inline_textile_link( text )
|
611
|
-
text.gsub!( LINK_RE ) do |m|
|
612
|
-
pre,atts,text,title,url,slash,post = $~[1..7]
|
613
|
-
|
614
|
-
url, url_title = check_refs( url )
|
615
|
-
title ||= url_title
|
616
|
-
|
617
|
-
atts = pba( atts )
|
618
|
-
atts = " href=\"#{ url }#{ slash }\"#{ atts }"
|
619
|
-
atts << " title=\"#{ title }\"" if title
|
620
|
-
atts = shelve( atts ) if atts
|
621
|
-
|
622
|
-
"#{ pre }<a#{ atts }>#{ text }</a>#{ post }"
|
623
|
-
end
|
624
|
-
end
|
625
|
-
|
626
|
-
MARKDOWN_REFLINK_RE = /
|
627
|
-
\[([^\[\]]+)\] # $text
|
628
|
-
[ ]? # opt. space
|
629
|
-
(?:\n[ ]*)? # one optional newline followed by spaces
|
630
|
-
\[(.*?)\] # $id
|
631
|
-
/x
|
632
|
-
|
633
|
-
def inline_markdown_reflink( text )
|
634
|
-
text.gsub!( MARKDOWN_REFLINK_RE ) do |m|
|
635
|
-
text, id = $~[1..2]
|
636
|
-
|
637
|
-
if id.empty?
|
638
|
-
url, title = check_refs( text )
|
639
|
-
else
|
640
|
-
url, title = check_refs( id )
|
641
|
-
end
|
642
|
-
|
643
|
-
atts = " href=\"#{ url }\""
|
644
|
-
atts << " title=\"#{ title }\"" if title
|
645
|
-
atts = shelve( atts )
|
646
|
-
|
647
|
-
"<a#{ atts }>#{ text }</a>"
|
648
|
-
end
|
649
|
-
end
|
650
|
-
|
651
|
-
MARKDOWN_LINK_RE = /
|
652
|
-
\[([^\[\]]+)\] # $text
|
653
|
-
\( # open paren
|
654
|
-
[ \t]* # opt space
|
655
|
-
<?(.+?)>? # $href
|
656
|
-
[ \t]* # opt space
|
657
|
-
(?: # whole title
|
658
|
-
(['"]) # $quote
|
659
|
-
(.*?) # $title
|
660
|
-
\3 # matching quote
|
661
|
-
)? # title is optional
|
662
|
-
\)
|
663
|
-
/x
|
664
|
-
|
665
|
-
def inline_markdown_link( text )
|
666
|
-
text.gsub!( MARKDOWN_LINK_RE ) do |m|
|
667
|
-
text, url, quote, title = $~[1..4]
|
668
|
-
|
669
|
-
atts = " href=\"#{ url }\""
|
670
|
-
atts << " title=\"#{ title }\"" if title
|
671
|
-
atts = shelve( atts )
|
672
|
-
|
673
|
-
"<a#{ atts }>#{ text }</a>"
|
674
|
-
end
|
675
|
-
end
|
676
|
-
|
677
|
-
TEXTILE_REFS_RE = /(^ *)\[([^\n]+?)\](#{HYPERLINK})(?=\s|$)/
|
678
|
-
MARKDOWN_REFS_RE = /(^ *)\[([^\n]+?)\]:\s+<?(#{HYPERLINK})>?(?:\s+"((?:[^"]|\\")+)")?(?=\s|$)/m
|
679
|
-
|
680
|
-
def refs( text )
|
681
|
-
@rules.each do |rule_name|
|
682
|
-
method( rule_name ).call( text ) if rule_name.to_s.match /^refs_/
|
683
|
-
end
|
684
|
-
end
|
685
|
-
|
686
|
-
def refs_textile( text )
|
687
|
-
text.gsub!( TEXTILE_REFS_RE ) do |m|
|
688
|
-
flag, url = $~[2..3]
|
689
|
-
@urlrefs[flag.downcase] = [url, nil]
|
690
|
-
nil
|
691
|
-
end
|
692
|
-
end
|
693
|
-
|
694
|
-
def refs_markdown( text )
|
695
|
-
text.gsub!( MARKDOWN_REFS_RE ) do |m|
|
696
|
-
flag, url = $~[2..3]
|
697
|
-
title = $~[6]
|
698
|
-
@urlrefs[flag.downcase] = [url, title]
|
699
|
-
nil
|
700
|
-
end
|
701
|
-
end
|
702
|
-
|
703
|
-
def check_refs( text )
|
704
|
-
ret = @urlrefs[text.downcase] if text
|
705
|
-
ret || [text, nil]
|
706
|
-
end
|
707
|
-
|
708
|
-
IMAGE_RE = /
|
709
|
-
(<p>|.|^) # start of line?
|
710
|
-
\! # opening
|
711
|
-
(\<|\=|\>)? # optional alignment atts
|
712
|
-
(#{C}) # optional style,class atts
|
713
|
-
(?:\. )? # optional dot-space
|
714
|
-
([^\s(!]+?) # presume this is the src
|
715
|
-
\s? # optional space
|
716
|
-
(?:\(((?:[^\(\)]|\([^\)]+\))+?)\))? # optional title
|
717
|
-
\! # closing
|
718
|
-
(?::#{ HYPERLINK })? # optional href
|
719
|
-
/x
|
720
|
-
|
721
|
-
def inline_textile_image( text )
|
722
|
-
text.gsub!( IMAGE_RE ) do |m|
|
723
|
-
stln,algn,atts,url,title,href,href_a1,href_a2 = $~[1..8]
|
724
|
-
atts = pba( atts )
|
725
|
-
atts = " src=\"#{ url }\"#{ atts }"
|
726
|
-
atts << " title=\"#{ title }\"" if title
|
727
|
-
atts << " alt=\"#{ title }\""
|
728
|
-
# size = @getimagesize($url);
|
729
|
-
# if($size) $atts.= " $size[3]";
|
730
|
-
|
731
|
-
href, alt_title = check_refs( href ) if href
|
732
|
-
url, url_title = check_refs( url )
|
733
|
-
|
734
|
-
out = ''
|
735
|
-
out << "<a#{ shelve( " href=\"#{ href }\"" ) }>" if href
|
736
|
-
out << "<img#{ shelve( atts ) } />"
|
737
|
-
out << "</a>#{ href_a1 }#{ href_a2 }" if href
|
738
|
-
|
739
|
-
if algn
|
740
|
-
algn = h_align( algn )
|
741
|
-
if stln == "<p>"
|
742
|
-
out = "<p style=\"float:#{ algn }\">#{ out }"
|
743
|
-
else
|
744
|
-
out = "#{ stln }<div style=\"float:#{ algn }\">#{ out }</div>"
|
745
|
-
end
|
746
|
-
else
|
747
|
-
out = stln + out
|
748
|
-
end
|
749
|
-
|
750
|
-
out
|
751
|
-
end
|
752
|
-
end
|
753
|
-
|
754
|
-
def shelve( val )
|
755
|
-
@shelf << val
|
756
|
-
" :redsh##{ @shelf.length }:"
|
757
|
-
end
|
758
|
-
|
759
|
-
def retrieve( text )
|
760
|
-
@shelf.each_with_index do |r, i|
|
761
|
-
text.gsub!( " :redsh##{ i + 1 }:", r )
|
762
|
-
end
|
763
|
-
end
|
764
|
-
|
765
|
-
def incoming_entities( text )
|
766
|
-
## turn any incoming ampersands into a dummy character for now.
|
767
|
-
## This uses a negative lookahead for alphanumerics followed by a semicolon,
|
768
|
-
## implying an incoming html entity, to be skipped
|
769
|
-
|
770
|
-
text.gsub!( /&(?![#a-z0-9]+;)/i, "x%x%" )
|
771
|
-
end
|
772
|
-
|
773
|
-
def no_textile( text )
|
774
|
-
text.gsub!( /(^|\s)==([^=]+.*?)==(\s|$)?/,
|
775
|
-
'\1<notextile>\2</notextile>\3' )
|
776
|
-
text.gsub!( /^ *==([^=]+.*?)==/m,
|
777
|
-
'\1<notextile>\2</notextile>\3' )
|
778
|
-
end
|
779
|
-
|
780
|
-
def clean_white_space( text )
|
781
|
-
# normalize line breaks
|
782
|
-
text.gsub!( /\r\n/, "\n" )
|
783
|
-
text.gsub!( /\r/, "\n" )
|
784
|
-
text.gsub!( /\t/, ' ' )
|
785
|
-
text.gsub!( /^ +$/, '' )
|
786
|
-
text.gsub!( /\n{3,}/, "\n\n" )
|
787
|
-
text.gsub!( /"$/, "\" " )
|
788
|
-
|
789
|
-
# if entire document is indented, flush
|
790
|
-
# to the left side
|
791
|
-
flush_left text
|
792
|
-
end
|
793
|
-
|
794
|
-
def flush_left( text )
|
795
|
-
indt = 0
|
796
|
-
if text =~ /^ /
|
797
|
-
while text !~ /^ {#{indt}}\S/
|
798
|
-
indt += 1
|
799
|
-
end unless text.empty?
|
800
|
-
if indt.nonzero?
|
801
|
-
text.gsub!( /^ {#{indt}}/, '' )
|
802
|
-
end
|
803
|
-
end
|
804
|
-
end
|
805
|
-
|
806
|
-
def footnote_ref( text )
|
807
|
-
text.gsub!( /\b\[([0-9]+?)\](\s)?/,
|
808
|
-
'<sup><a href="#fn\1">\1</a></sup>\2' )
|
809
|
-
end
|
810
|
-
|
811
|
-
OFFTAGS = /(code|pre|kbd|notextile)/
|
812
|
-
OFFTAG_MATCH = /(?:(<\/#{ OFFTAGS }>)|(<#{ OFFTAGS }[^>]*>))(.*?)(?=<\/?#{ OFFTAGS }|\Z)/mi
|
813
|
-
OFFTAG_OPEN = /<#{ OFFTAGS }/
|
814
|
-
OFFTAG_CLOSE = /<\/?#{ OFFTAGS }/
|
815
|
-
HASTAG_MATCH = /(<\/?\w[^\n]*?>)/m
|
816
|
-
ALLTAG_MATCH = /(<\/?\w[^\n]*?>)|.*?(?=<\/?\w[^\n]*?>|$)/m
|
817
|
-
|
818
|
-
def glyphs_textile( text, level = 0 )
|
819
|
-
if text !~ HASTAG_MATCH
|
820
|
-
pgl text
|
821
|
-
footnote_ref text
|
822
|
-
else
|
823
|
-
codepre = 0
|
824
|
-
text.gsub!( ALLTAG_MATCH ) do |line|
|
825
|
-
## matches are off if we're between <code>, <pre> etc.
|
826
|
-
if $1
|
827
|
-
if line =~ OFFTAG_OPEN
|
828
|
-
codepre += 1
|
829
|
-
elsif line =~ OFFTAG_CLOSE
|
830
|
-
codepre -= 1
|
831
|
-
codepre = 0 if codepre < 0
|
832
|
-
end
|
833
|
-
elsif codepre.zero?
|
834
|
-
glyphs_textile( line, level + 1 )
|
835
|
-
else
|
836
|
-
htmlesc( line, :NoQuotes )
|
837
|
-
end
|
838
|
-
# p [level, codepre, line]
|
839
|
-
|
840
|
-
line
|
841
|
-
end
|
842
|
-
end
|
843
|
-
end
|
844
|
-
|
845
|
-
def rip_offtags( text )
|
846
|
-
if text =~ /<.*>/
|
847
|
-
## strip and encode <pre> content
|
848
|
-
codepre, used_offtags = 0, {}
|
849
|
-
text.gsub!( OFFTAG_MATCH ) do |line|
|
850
|
-
if $3
|
851
|
-
offtag, aftertag = $4, $5
|
852
|
-
codepre += 1
|
853
|
-
used_offtags[offtag] = true
|
854
|
-
if codepre - used_offtags.length > 0
|
855
|
-
htmlesc( line, :NoQuotes ) unless used_offtags['notextile']
|
856
|
-
@pre_list.last << line
|
857
|
-
line = ""
|
858
|
-
else
|
859
|
-
htmlesc( aftertag, :NoQuotes ) if aftertag and not used_offtags['notextile']
|
860
|
-
line = "<redpre##{ @pre_list.length }>"
|
861
|
-
@pre_list << "#{ $3 }#{ aftertag }"
|
862
|
-
end
|
863
|
-
elsif $1 and codepre > 0
|
864
|
-
if codepre - used_offtags.length > 0
|
865
|
-
htmlesc( line, :NoQuotes ) unless used_offtags['notextile']
|
866
|
-
@pre_list.last << line
|
867
|
-
line = ""
|
868
|
-
end
|
869
|
-
codepre -= 1 unless codepre.zero?
|
870
|
-
used_offtags = {} if codepre.zero?
|
871
|
-
end
|
872
|
-
line
|
873
|
-
end
|
874
|
-
end
|
875
|
-
text
|
876
|
-
end
|
877
|
-
|
878
|
-
def smooth_offtags( text )
|
879
|
-
unless @pre_list.empty?
|
880
|
-
## replace <pre> content
|
881
|
-
text.gsub!( /<redpre#(\d+)>/ ) { @pre_list[$1.to_i] }
|
882
|
-
end
|
883
|
-
end
|
884
|
-
|
885
|
-
def inline( text )
|
886
|
-
[/^inline_/, /^glyphs_/].each do |meth_re|
|
887
|
-
@rules.each do |rule_name|
|
888
|
-
method( rule_name ).call( text ) if rule_name.to_s.match( meth_re )
|
889
|
-
end
|
890
|
-
end
|
891
|
-
end
|
892
|
-
|
893
|
-
def h_align( text )
|
894
|
-
H_ALGN_VALS[text]
|
895
|
-
end
|
896
|
-
|
897
|
-
def v_align( text )
|
898
|
-
V_ALGN_VALS[text]
|
899
|
-
end
|
900
|
-
|
901
|
-
def textile_popup_help( name, windowW, windowH )
|
902
|
-
' <a target="_blank" href="http://hobix.com/textile/#' + helpvar + '" onclick="window.open(this.href, \'popupwindow\', \'width=' + windowW + ',height=' + windowH + ',scrollbars,resizable\'); return false;">' + name + '</a><br />'
|
903
|
-
end
|
904
|
-
|
905
|
-
# HTML cleansing stuff
|
906
|
-
BASIC_TAGS = {
|
907
|
-
'a' => ['href', 'title'],
|
908
|
-
'img' => ['src', 'alt', 'title'],
|
909
|
-
'br' => [],
|
910
|
-
'i' => nil,
|
911
|
-
'u' => nil,
|
912
|
-
'b' => nil,
|
913
|
-
'pre' => nil,
|
914
|
-
'kbd' => nil,
|
915
|
-
'code' => ['lang'],
|
916
|
-
'cite' => nil,
|
917
|
-
'strong' => nil,
|
918
|
-
'em' => nil,
|
919
|
-
'ins' => nil,
|
920
|
-
'sup' => nil,
|
921
|
-
'sub' => nil,
|
922
|
-
'del' => nil,
|
923
|
-
'table' => nil,
|
924
|
-
'tr' => nil,
|
925
|
-
'td' => ['colspan', 'rowspan'],
|
926
|
-
'th' => nil,
|
927
|
-
'ol' => nil,
|
928
|
-
'ul' => nil,
|
929
|
-
'li' => nil,
|
930
|
-
'p' => nil,
|
931
|
-
'h1' => nil,
|
932
|
-
'h2' => nil,
|
933
|
-
'h3' => nil,
|
934
|
-
'h4' => nil,
|
935
|
-
'h5' => nil,
|
936
|
-
'h6' => nil,
|
937
|
-
'blockquote' => ['cite']
|
938
|
-
}
|
939
|
-
|
940
|
-
def clean_html( text, tags = BASIC_TAGS )
|
941
|
-
text.gsub!( /<!\[CDATA\[/, '' )
|
942
|
-
text.gsub!( /<(\/*)(\w+)([^>]*)>/ ) do
|
943
|
-
raw = $~
|
944
|
-
tag = raw[2].downcase
|
945
|
-
if tags.has_key? tag
|
946
|
-
pcs = [tag]
|
947
|
-
tags[tag].each do |prop|
|
948
|
-
['"', "'", ''].each do |q|
|
949
|
-
q2 = ( q != '' ? q : '\s' )
|
950
|
-
if raw[3] =~ /#{prop}\s*=\s*#{q}([^#{q2}]+)#{q}/i
|
951
|
-
attrv = $1
|
952
|
-
next if prop == 'src' and attrv =~ %r{^(?!http)\w+:}
|
953
|
-
pcs << "#{prop}=\"#{$1.gsub('"', '\\"')}\""
|
954
|
-
break
|
955
|
-
end
|
956
|
-
end
|
957
|
-
end if tags[tag]
|
958
|
-
"<#{raw[1]}#{pcs.join " "}>"
|
959
|
-
else
|
960
|
-
" "
|
961
|
-
end
|
962
|
-
end
|
963
|
-
end
|
964
|
-
end
|