newstile 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/AUTHORS +1 -0
- data/CONTRIBUTERS +6 -0
- data/COPYING +24 -0
- data/ChangeLog +5489 -0
- data/GPL +674 -0
- data/README +31 -0
- data/Rakefile +342 -0
- data/VERSION +1 -0
- data/benchmark/benchmark.rb +34 -0
- data/benchmark/generate_data.rb +112 -0
- data/benchmark/historic-jruby-1.4.0.dat +7 -0
- data/benchmark/historic-ruby-1.8.6.dat +7 -0
- data/benchmark/historic-ruby-1.8.7.dat +7 -0
- data/benchmark/historic-ruby-1.9.1p243.dat +7 -0
- data/benchmark/historic-ruby-1.9.2dev.dat +7 -0
- data/benchmark/mdbasics.text +306 -0
- data/benchmark/mdsyntax.text +888 -0
- data/benchmark/static-jruby-1.4.0.dat +7 -0
- data/benchmark/static-ruby-1.8.6.dat +7 -0
- data/benchmark/static-ruby-1.8.7.dat +7 -0
- data/benchmark/static-ruby-1.9.1p243.dat +7 -0
- data/benchmark/static-ruby-1.9.2dev.dat +7 -0
- data/benchmark/testing.sh +9 -0
- data/benchmark/timing.sh +10 -0
- data/bin/newstile +82 -0
- data/data/newstile/document.html +18 -0
- data/data/newstile/document.latex +43 -0
- data/doc/default.scss.css +519 -0
- data/doc/default.template +80 -0
- data/doc/documentation.page +72 -0
- data/doc/index.page +96 -0
- data/doc/installation.page +90 -0
- data/doc/links.markdown +6 -0
- data/doc/news.feed +10 -0
- data/doc/news.page +28 -0
- data/doc/quickref.page +564 -0
- data/doc/syntax.page +1615 -0
- data/doc/tests.page +51 -0
- data/doc/virtual +2 -0
- data/lib/newstile.rb +23 -0
- data/lib/newstile/compatibility.rb +34 -0
- data/lib/newstile/converter.rb +43 -0
- data/lib/newstile/converter/base.rb +111 -0
- data/lib/newstile/converter/html.rb +405 -0
- data/lib/newstile/converter/latex.rb +577 -0
- data/lib/newstile/converter/markdown.rb +426 -0
- data/lib/newstile/converter/newstile.rb +426 -0
- data/lib/newstile/document.rb +168 -0
- data/lib/newstile/error.rb +27 -0
- data/lib/newstile/options.rb +296 -0
- data/lib/newstile/parser.rb +39 -0
- data/lib/newstile/parser/base.rb +94 -0
- data/lib/newstile/parser/html.rb +499 -0
- data/lib/newstile/parser/newstile.rb +325 -0
- data/lib/newstile/parser/newstile/abbreviation.rb +66 -0
- data/lib/newstile/parser/newstile/attribute_list.rb +111 -0
- data/lib/newstile/parser/newstile/autolink.rb +54 -0
- data/lib/newstile/parser/newstile/blank_line.rb +43 -0
- data/lib/newstile/parser/newstile/block_boundary.rb +46 -0
- data/lib/newstile/parser/newstile/blockquote.rb +63 -0
- data/lib/newstile/parser/newstile/codeblock.rb +60 -0
- data/lib/newstile/parser/newstile/codespan.rb +57 -0
- data/lib/newstile/parser/newstile/emphasis.rb +70 -0
- data/lib/newstile/parser/newstile/eob.rb +39 -0
- data/lib/newstile/parser/newstile/escaped_chars.rb +38 -0
- data/lib/newstile/parser/newstile/extension.rb +116 -0
- data/lib/newstile/parser/newstile/footnote.rb +74 -0
- data/lib/newstile/parser/newstile/header.rb +84 -0
- data/lib/newstile/parser/newstile/horizontal_rule.rb +39 -0
- data/lib/newstile/parser/newstile/html.rb +175 -0
- data/lib/newstile/parser/newstile/html_entity.rb +39 -0
- data/lib/newstile/parser/newstile/line_break.rb +38 -0
- data/lib/newstile/parser/newstile/link.rb +177 -0
- data/lib/newstile/parser/newstile/list.rb +239 -0
- data/lib/newstile/parser/newstile/math.rb +64 -0
- data/lib/newstile/parser/newstile/paragraph.rb +55 -0
- data/lib/newstile/parser/newstile/smart_quotes.rb +214 -0
- data/lib/newstile/parser/newstile/table.rb +134 -0
- data/lib/newstile/parser/newstile/typographic_symbol.rb +54 -0
- data/lib/newstile/utils.rb +37 -0
- data/lib/newstile/utils/entities.rb +336 -0
- data/lib/newstile/utils/html.rb +75 -0
- data/lib/newstile/utils/ordered_hash.rb +79 -0
- data/lib/newstile/version.rb +28 -0
- data/man/man1/newstile.1 +246 -0
- data/setup.rb +1585 -0
- data/test/run_tests.rb +59 -0
- data/test/test_files.rb +162 -0
- data/test/testcases/block/01_blank_line/spaces.html +1 -0
- data/test/testcases/block/01_blank_line/spaces.text +3 -0
- data/test/testcases/block/01_blank_line/tabs.html +1 -0
- data/test/testcases/block/01_blank_line/tabs.text +6 -0
- data/test/testcases/block/02_eob/beginning.html +1 -0
- data/test/testcases/block/02_eob/beginning.text +3 -0
- data/test/testcases/block/02_eob/end.html +1 -0
- data/test/testcases/block/02_eob/end.text +3 -0
- data/test/testcases/block/02_eob/middle.html +1 -0
- data/test/testcases/block/02_eob/middle.text +5 -0
- data/test/testcases/block/03_paragraph/indented.html +18 -0
- data/test/testcases/block/03_paragraph/indented.text +19 -0
- data/test/testcases/block/03_paragraph/no_newline_at_end.html +5 -0
- data/test/testcases/block/03_paragraph/no_newline_at_end.text +5 -0
- data/test/testcases/block/03_paragraph/one_para.html +1 -0
- data/test/testcases/block/03_paragraph/one_para.text +1 -0
- data/test/testcases/block/03_paragraph/two_para.html +4 -0
- data/test/testcases/block/03_paragraph/two_para.text +4 -0
- data/test/testcases/block/04_header/atx_header.html +37 -0
- data/test/testcases/block/04_header/atx_header.text +34 -0
- data/test/testcases/block/04_header/atx_header_no_newline_at_end.html +1 -0
- data/test/testcases/block/04_header/atx_header_no_newline_at_end.text +1 -0
- data/test/testcases/block/04_header/setext_header.html +30 -0
- data/test/testcases/block/04_header/setext_header.html.19 +30 -0
- data/test/testcases/block/04_header/setext_header.text +36 -0
- data/test/testcases/block/04_header/setext_header_no_newline_at_end.html +1 -0
- data/test/testcases/block/04_header/setext_header_no_newline_at_end.text +2 -0
- data/test/testcases/block/04_header/with_auto_id_prefix.html +3 -0
- data/test/testcases/block/04_header/with_auto_id_prefix.options +2 -0
- data/test/testcases/block/04_header/with_auto_id_prefix.text +3 -0
- data/test/testcases/block/04_header/with_auto_ids.html +17 -0
- data/test/testcases/block/04_header/with_auto_ids.options +1 -0
- data/test/testcases/block/04_header/with_auto_ids.text +19 -0
- data/test/testcases/block/05_blockquote/indented.html +25 -0
- data/test/testcases/block/05_blockquote/indented.text +14 -0
- data/test/testcases/block/05_blockquote/lazy.html +34 -0
- data/test/testcases/block/05_blockquote/lazy.text +20 -0
- data/test/testcases/block/05_blockquote/nested.html +10 -0
- data/test/testcases/block/05_blockquote/nested.text +6 -0
- data/test/testcases/block/05_blockquote/no_newline_at_end.html +4 -0
- data/test/testcases/block/05_blockquote/no_newline_at_end.text +2 -0
- data/test/testcases/block/05_blockquote/with_code_blocks.html +15 -0
- data/test/testcases/block/05_blockquote/with_code_blocks.text +11 -0
- data/test/testcases/block/06_codeblock/error.html +4 -0
- data/test/testcases/block/06_codeblock/error.text +4 -0
- data/test/testcases/block/06_codeblock/lazy.html +4 -0
- data/test/testcases/block/06_codeblock/lazy.text +5 -0
- data/test/testcases/block/06_codeblock/no_newline_at_end.html +2 -0
- data/test/testcases/block/06_codeblock/no_newline_at_end.text +1 -0
- data/test/testcases/block/06_codeblock/no_newline_at_end_1.html +2 -0
- data/test/testcases/block/06_codeblock/no_newline_at_end_1.text +2 -0
- data/test/testcases/block/06_codeblock/normal.html +13 -0
- data/test/testcases/block/06_codeblock/normal.text +10 -0
- data/test/testcases/block/06_codeblock/tilde_syntax.html +7 -0
- data/test/testcases/block/06_codeblock/tilde_syntax.text +9 -0
- data/test/testcases/block/06_codeblock/whitespace.html +3 -0
- data/test/testcases/block/06_codeblock/whitespace.text +3 -0
- data/test/testcases/block/06_codeblock/with_blank_line.html +13 -0
- data/test/testcases/block/06_codeblock/with_blank_line.text +12 -0
- data/test/testcases/block/06_codeblock/with_eob_marker.html +6 -0
- data/test/testcases/block/06_codeblock/with_eob_marker.text +5 -0
- data/test/testcases/block/06_codeblock/with_ial.html +6 -0
- data/test/testcases/block/06_codeblock/with_ial.text +5 -0
- data/test/testcases/block/07_horizontal_rule/error.html +7 -0
- data/test/testcases/block/07_horizontal_rule/error.html.19 +7 -0
- data/test/testcases/block/07_horizontal_rule/error.text +7 -0
- data/test/testcases/block/07_horizontal_rule/normal.html +17 -0
- data/test/testcases/block/07_horizontal_rule/normal.text +17 -0
- data/test/testcases/block/07_horizontal_rule/sepspaces.html +3 -0
- data/test/testcases/block/07_horizontal_rule/sepspaces.text +3 -0
- data/test/testcases/block/07_horizontal_rule/septabs.html +3 -0
- data/test/testcases/block/07_horizontal_rule/septabs.text +3 -0
- data/test/testcases/block/08_list/escaping.html +17 -0
- data/test/testcases/block/08_list/escaping.text +17 -0
- data/test/testcases/block/08_list/item_ial.html +7 -0
- data/test/testcases/block/08_list/item_ial.text +5 -0
- data/test/testcases/block/08_list/lazy.html +39 -0
- data/test/testcases/block/08_list/lazy.text +29 -0
- data/test/testcases/block/08_list/list_and_hr.html +9 -0
- data/test/testcases/block/08_list/list_and_hr.text +5 -0
- data/test/testcases/block/08_list/list_and_others.html +40 -0
- data/test/testcases/block/08_list/list_and_others.text +26 -0
- data/test/testcases/block/08_list/mixed.html +117 -0
- data/test/testcases/block/08_list/mixed.text +66 -0
- data/test/testcases/block/08_list/nested.html +17 -0
- data/test/testcases/block/08_list/nested.text +7 -0
- data/test/testcases/block/08_list/other_first_element.html +39 -0
- data/test/testcases/block/08_list/other_first_element.text +18 -0
- data/test/testcases/block/08_list/simple_ol.html +19 -0
- data/test/testcases/block/08_list/simple_ol.text +13 -0
- data/test/testcases/block/08_list/simple_ul.html +48 -0
- data/test/testcases/block/08_list/simple_ul.text +36 -0
- data/test/testcases/block/08_list/single_item.html +3 -0
- data/test/testcases/block/08_list/single_item.text +1 -0
- data/test/testcases/block/08_list/special_cases.html +55 -0
- data/test/testcases/block/08_list/special_cases.text +35 -0
- data/test/testcases/block/09_html/comment.html +18 -0
- data/test/testcases/block/09_html/comment.text +15 -0
- data/test/testcases/block/09_html/content_model/deflists.html +6 -0
- data/test/testcases/block/09_html/content_model/deflists.options +1 -0
- data/test/testcases/block/09_html/content_model/deflists.text +6 -0
- data/test/testcases/block/09_html/content_model/tables.html +14 -0
- data/test/testcases/block/09_html/content_model/tables.options +1 -0
- data/test/testcases/block/09_html/content_model/tables.text +14 -0
- data/test/testcases/block/09_html/html_and_codeblocks.html +15 -0
- data/test/testcases/block/09_html/html_and_codeblocks.options +1 -0
- data/test/testcases/block/09_html/html_and_codeblocks.text +13 -0
- data/test/testcases/block/09_html/html_to_native/code.html +10 -0
- data/test/testcases/block/09_html/html_to_native/code.text +9 -0
- data/test/testcases/block/09_html/html_to_native/comment.html +7 -0
- data/test/testcases/block/09_html/html_to_native/comment.text +8 -0
- data/test/testcases/block/09_html/html_to_native/emphasis.html +3 -0
- data/test/testcases/block/09_html/html_to_native/emphasis.text +3 -0
- data/test/testcases/block/09_html/html_to_native/entity.html +1 -0
- data/test/testcases/block/09_html/html_to_native/entity.text +1 -0
- data/test/testcases/block/09_html/html_to_native/header.html +6 -0
- data/test/testcases/block/09_html/html_to_native/header.options +2 -0
- data/test/testcases/block/09_html/html_to_native/header.text +6 -0
- data/test/testcases/block/09_html/html_to_native/list_dl.html +8 -0
- data/test/testcases/block/09_html/html_to_native/list_dl.text +8 -0
- data/test/testcases/block/09_html/html_to_native/list_ol.html +15 -0
- data/test/testcases/block/09_html/html_to_native/list_ol.text +17 -0
- data/test/testcases/block/09_html/html_to_native/list_ul.html +19 -0
- data/test/testcases/block/09_html/html_to_native/list_ul.text +22 -0
- data/test/testcases/block/09_html/html_to_native/options +1 -0
- data/test/testcases/block/09_html/html_to_native/paragraph.html +3 -0
- data/test/testcases/block/09_html/html_to_native/paragraph.text +4 -0
- data/test/testcases/block/09_html/html_to_native/table_normal.html +14 -0
- data/test/testcases/block/09_html/html_to_native/table_normal.text +12 -0
- data/test/testcases/block/09_html/html_to_native/table_simple.html +48 -0
- data/test/testcases/block/09_html/html_to_native/table_simple.text +56 -0
- data/test/testcases/block/09_html/html_to_native/typography.html +1 -0
- data/test/testcases/block/09_html/html_to_native/typography.html.19 +1 -0
- data/test/testcases/block/09_html/html_to_native/typography.text +1 -0
- data/test/testcases/block/09_html/invalid_html_1.html +5 -0
- data/test/testcases/block/09_html/invalid_html_1.text +5 -0
- data/test/testcases/block/09_html/invalid_html_2.html +5 -0
- data/test/testcases/block/09_html/invalid_html_2.text +5 -0
- data/test/testcases/block/09_html/markdown_attr.html +38 -0
- data/test/testcases/block/09_html/markdown_attr.text +38 -0
- data/test/testcases/block/09_html/not_parsed.html +24 -0
- data/test/testcases/block/09_html/not_parsed.text +24 -0
- data/test/testcases/block/09_html/parse_as_raw.html +30 -0
- data/test/testcases/block/09_html/parse_as_raw.options +1 -0
- data/test/testcases/block/09_html/parse_as_raw.text +29 -0
- data/test/testcases/block/09_html/parse_as_span.html +12 -0
- data/test/testcases/block/09_html/parse_as_span.options +1 -0
- data/test/testcases/block/09_html/parse_as_span.text +9 -0
- data/test/testcases/block/09_html/parse_block_html.html +21 -0
- data/test/testcases/block/09_html/parse_block_html.options +1 -0
- data/test/testcases/block/09_html/parse_block_html.text +17 -0
- data/test/testcases/block/09_html/processing_instruction.html +13 -0
- data/test/testcases/block/09_html/processing_instruction.text +12 -0
- data/test/testcases/block/09_html/simple.html +64 -0
- data/test/testcases/block/09_html/simple.html.19 +64 -0
- data/test/testcases/block/09_html/simple.options +1 -0
- data/test/testcases/block/09_html/simple.text +59 -0
- data/test/testcases/block/10_ald/simple.html +2 -0
- data/test/testcases/block/10_ald/simple.text +8 -0
- data/test/testcases/block/11_ial/auto_id_and_ial.html +1 -0
- data/test/testcases/block/11_ial/auto_id_and_ial.options +1 -0
- data/test/testcases/block/11_ial/auto_id_and_ial.text +2 -0
- data/test/testcases/block/11_ial/simple.html +25 -0
- data/test/testcases/block/11_ial/simple.text +34 -0
- data/test/testcases/block/12_extension/comment.html +8 -0
- data/test/testcases/block/12_extension/comment.text +12 -0
- data/test/testcases/block/12_extension/ignored.html +8 -0
- data/test/testcases/block/12_extension/ignored.text +8 -0
- data/test/testcases/block/12_extension/nomarkdown.html +10 -0
- data/test/testcases/block/12_extension/nomarkdown.kramdown +20 -0
- data/test/testcases/block/12_extension/nomarkdown.latex +13 -0
- data/test/testcases/block/12_extension/nomarkdown.text +21 -0
- data/test/testcases/block/12_extension/options.html +21 -0
- data/test/testcases/block/12_extension/options.text +21 -0
- data/test/testcases/block/12_extension/options2.html +10 -0
- data/test/testcases/block/12_extension/options2.text +5 -0
- data/test/testcases/block/12_extension/options3.html +7 -0
- data/test/testcases/block/12_extension/options3.text +7 -0
- data/test/testcases/block/13_definition_list/definition_at_beginning.html +1 -0
- data/test/testcases/block/13_definition_list/definition_at_beginning.text +1 -0
- data/test/testcases/block/13_definition_list/item_ial.html +12 -0
- data/test/testcases/block/13_definition_list/item_ial.text +8 -0
- data/test/testcases/block/13_definition_list/multiple_terms.html +13 -0
- data/test/testcases/block/13_definition_list/multiple_terms.text +10 -0
- data/test/testcases/block/13_definition_list/no_def_list.html +2 -0
- data/test/testcases/block/13_definition_list/no_def_list.text +2 -0
- data/test/testcases/block/13_definition_list/para_wrapping.html +10 -0
- data/test/testcases/block/13_definition_list/para_wrapping.text +6 -0
- data/test/testcases/block/13_definition_list/separated_by_eob.html +8 -0
- data/test/testcases/block/13_definition_list/separated_by_eob.text +5 -0
- data/test/testcases/block/13_definition_list/simple.html +8 -0
- data/test/testcases/block/13_definition_list/simple.text +7 -0
- data/test/testcases/block/13_definition_list/styled_terms.html +4 -0
- data/test/testcases/block/13_definition_list/styled_terms.text +2 -0
- data/test/testcases/block/13_definition_list/too_much_space.html +3 -0
- data/test/testcases/block/13_definition_list/too_much_space.text +4 -0
- data/test/testcases/block/13_definition_list/with_blocks.html +38 -0
- data/test/testcases/block/13_definition_list/with_blocks.text +24 -0
- data/test/testcases/block/14_table/errors.html +8 -0
- data/test/testcases/block/14_table/errors.text +9 -0
- data/test/testcases/block/14_table/footer.html +65 -0
- data/test/testcases/block/14_table/footer.text +25 -0
- data/test/testcases/block/14_table/header.html +103 -0
- data/test/testcases/block/14_table/header.text +32 -0
- data/test/testcases/block/14_table/no_table.html +3 -0
- data/test/testcases/block/14_table/no_table.text +3 -0
- data/test/testcases/block/14_table/simple.html +139 -0
- data/test/testcases/block/14_table/simple.text +38 -0
- data/test/testcases/block/15_math/normal.html +26 -0
- data/test/testcases/block/15_math/normal.text +28 -0
- data/test/testcases/block/16_toc/no_toc_depth.html +33 -0
- data/test/testcases/block/16_toc/no_toc_depth.options +1 -0
- data/test/testcases/block/16_toc/no_toc_depth.text +16 -0
- data/test/testcases/block/16_toc/toc_depth_2.html +24 -0
- data/test/testcases/block/16_toc/toc_depth_2.options +1 -0
- data/test/testcases/block/16_toc/toc_depth_2.text +16 -0
- data/test/testcases/encoding.html +46 -0
- data/test/testcases/encoding.text +28 -0
- data/test/testcases/span/01_link/empty.html +5 -0
- data/test/testcases/span/01_link/empty.text +5 -0
- data/test/testcases/span/01_link/image_in_a.html +5 -0
- data/test/testcases/span/01_link/image_in_a.text +5 -0
- data/test/testcases/span/01_link/imagelinks.html +14 -0
- data/test/testcases/span/01_link/imagelinks.text +16 -0
- data/test/testcases/span/01_link/inline.html +46 -0
- data/test/testcases/span/01_link/inline.html.19 +46 -0
- data/test/testcases/span/01_link/inline.text +48 -0
- data/test/testcases/span/01_link/link_defs.html +9 -0
- data/test/testcases/span/01_link/link_defs.text +26 -0
- data/test/testcases/span/01_link/links_with_angle_brackets.html +3 -0
- data/test/testcases/span/01_link/links_with_angle_brackets.text +3 -0
- data/test/testcases/span/01_link/reference.html +35 -0
- data/test/testcases/span/01_link/reference.html.19 +35 -0
- data/test/testcases/span/01_link/reference.text +47 -0
- data/test/testcases/span/02_emphasis/empty.html +3 -0
- data/test/testcases/span/02_emphasis/empty.text +3 -0
- data/test/testcases/span/02_emphasis/errors.html +9 -0
- data/test/testcases/span/02_emphasis/errors.text +9 -0
- data/test/testcases/span/02_emphasis/nesting.html +38 -0
- data/test/testcases/span/02_emphasis/nesting.text +33 -0
- data/test/testcases/span/02_emphasis/normal.html +46 -0
- data/test/testcases/span/02_emphasis/normal.text +46 -0
- data/test/testcases/span/03_codespan/empty.html +5 -0
- data/test/testcases/span/03_codespan/empty.text +5 -0
- data/test/testcases/span/03_codespan/errors.html +1 -0
- data/test/testcases/span/03_codespan/errors.text +1 -0
- data/test/testcases/span/03_codespan/highlighting.html +1 -0
- data/test/testcases/span/03_codespan/highlighting.text +1 -0
- data/test/testcases/span/03_codespan/normal.html +16 -0
- data/test/testcases/span/03_codespan/normal.text +16 -0
- data/test/testcases/span/04_footnote/definitions.html +17 -0
- data/test/testcases/span/04_footnote/definitions.latex +17 -0
- data/test/testcases/span/04_footnote/definitions.text +24 -0
- data/test/testcases/span/04_footnote/footnote_nr.html +12 -0
- data/test/testcases/span/04_footnote/footnote_nr.latex +2 -0
- data/test/testcases/span/04_footnote/footnote_nr.options +1 -0
- data/test/testcases/span/04_footnote/footnote_nr.text +4 -0
- data/test/testcases/span/04_footnote/markers.html +46 -0
- data/test/testcases/span/04_footnote/markers.latex +23 -0
- data/test/testcases/span/04_footnote/markers.text +26 -0
- data/test/testcases/span/05_html/across_lines.html +1 -0
- data/test/testcases/span/05_html/across_lines.text +2 -0
- data/test/testcases/span/05_html/invalid.html +1 -0
- data/test/testcases/span/05_html/invalid.text +1 -0
- data/test/testcases/span/05_html/link_with_mailto.html +1 -0
- data/test/testcases/span/05_html/link_with_mailto.text +1 -0
- data/test/testcases/span/05_html/markdown_attr.html +6 -0
- data/test/testcases/span/05_html/markdown_attr.text +6 -0
- data/test/testcases/span/05_html/normal.html +30 -0
- data/test/testcases/span/05_html/normal.text +30 -0
- data/test/testcases/span/abbreviations/abbrev.html +8 -0
- data/test/testcases/span/abbreviations/abbrev.text +15 -0
- data/test/testcases/span/abbreviations/abbrev_defs.html +2 -0
- data/test/testcases/span/abbreviations/abbrev_defs.text +5 -0
- data/test/testcases/span/autolinks/url_links.html +12 -0
- data/test/testcases/span/autolinks/url_links.text +12 -0
- data/test/testcases/span/escaped_chars/normal.html +43 -0
- data/test/testcases/span/escaped_chars/normal.text +43 -0
- data/test/testcases/span/extension/comment.html +6 -0
- data/test/testcases/span/extension/comment.text +6 -0
- data/test/testcases/span/extension/ignored.html +1 -0
- data/test/testcases/span/extension/ignored.text +1 -0
- data/test/testcases/span/extension/nomarkdown.html +1 -0
- data/test/testcases/span/extension/nomarkdown.text +1 -0
- data/test/testcases/span/extension/options.html +1 -0
- data/test/testcases/span/extension/options.text +1 -0
- data/test/testcases/span/ial/simple.html +6 -0
- data/test/testcases/span/ial/simple.text +6 -0
- data/test/testcases/span/line_breaks/normal.html +11 -0
- data/test/testcases/span/line_breaks/normal.latex +12 -0
- data/test/testcases/span/line_breaks/normal.text +11 -0
- data/test/testcases/span/math/normal.html +5 -0
- data/test/testcases/span/math/normal.text +5 -0
- data/test/testcases/span/text_substitutions/entities.html +4 -0
- data/test/testcases/span/text_substitutions/entities.options +1 -0
- data/test/testcases/span/text_substitutions/entities.text +4 -0
- data/test/testcases/span/text_substitutions/entities_as_char.html +1 -0
- data/test/testcases/span/text_substitutions/entities_as_char.html.19 +1 -0
- data/test/testcases/span/text_substitutions/entities_as_char.options +1 -0
- data/test/testcases/span/text_substitutions/entities_as_char.text +1 -0
- data/test/testcases/span/text_substitutions/entities_as_input.html +1 -0
- data/test/testcases/span/text_substitutions/entities_as_input.options +1 -0
- data/test/testcases/span/text_substitutions/entities_as_input.text +1 -0
- data/test/testcases/span/text_substitutions/entities_numeric.html +1 -0
- data/test/testcases/span/text_substitutions/entities_numeric.options +1 -0
- data/test/testcases/span/text_substitutions/entities_numeric.text +1 -0
- data/test/testcases/span/text_substitutions/entities_symbolic.html +1 -0
- data/test/testcases/span/text_substitutions/entities_symbolic.options +1 -0
- data/test/testcases/span/text_substitutions/entities_symbolic.text +1 -0
- data/test/testcases/span/text_substitutions/greaterthan.html +1 -0
- data/test/testcases/span/text_substitutions/greaterthan.text +1 -0
- data/test/testcases/span/text_substitutions/lowerthan.html +1 -0
- data/test/testcases/span/text_substitutions/lowerthan.text +1 -0
- data/test/testcases/span/text_substitutions/typography.html +18 -0
- data/test/testcases/span/text_substitutions/typography.html.19 +18 -0
- data/test/testcases/span/text_substitutions/typography.text +18 -0
- metadata +476 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{lang:}" lang="{lang:}">
|
|
3
|
+
<head>
|
|
4
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
|
5
|
+
<meta name="author" content="Thomas Leitner" />
|
|
6
|
+
<meta name="copyright" content="2009-2010 Thomas Leitner" />
|
|
7
|
+
<meta name="description" content="newstile is a fast, pure-Ruby Markdown-superset converter" />
|
|
8
|
+
<meta name="keywords" content="ruby, newstile, markdown, text markup" />
|
|
9
|
+
<link href="{relocatable: default.css}" type="text/css" rel="stylesheet" media="screen,projection" />
|
|
10
|
+
<link href="{relocatable: news.atom}" type="application/atom+xml" rel="alternate" />
|
|
11
|
+
<script src="http://newstile.rubyforge.org/js/jsMath/easy/load.js" type="text/javascript"></script>
|
|
12
|
+
<title>{title:} | newstile</title>
|
|
13
|
+
</head>
|
|
14
|
+
<body>
|
|
15
|
+
<div id="fullheader">
|
|
16
|
+
<div id="header">
|
|
17
|
+
<h1 id="logo"><a href="{relocatable: /}" title="Homepage">newstile <span class='slogan'>fast, pure-Ruby Markdown-superset converter</span></a></h1>
|
|
18
|
+
</div>
|
|
19
|
+
<div id="donation">
|
|
20
|
+
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
|
21
|
+
<input type="hidden" name="cmd" value="_s-xclick" />
|
|
22
|
+
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHJwYJKoZIhvcNAQcEoIIHGDCCBxQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYDA8HEgfduoLW7LANqmfG9shb8sk23qWHt1vJ65J7bcOHFW1Hw/aZV7O2Xf2hRtVmHBQemuFBMVCLFFYn1Tj667ay65xPWrbtNdOcxJ6diwwVcrxMJ/EyS7niUKuTfujgmq5ra9CgNy84WSa0Cw/sWSMrK6XMX9brALPBcKbB003TELMAkGBSsOAwIaBQAwgaQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQITt+KFiwA4NOAgYBJEwBt4G0KjfWMn428qsUqj7nBGl9dhhOT9FsHPoKHm5lmzadeIhtu7vPwqaH5cZAbE/nZBhkV9/MdgWCt9kMkDLD4Jq+TGLa4RDK+ltxErnPNgr9TYvBOGPAoYTXvA12w+KUewhV1cB/gSdz43oHrBPAyO6x4ZWUhndD2+yqZhKCCA4cwggODMIIC7KADAgECAgEAMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTAeFw0wNDAyMTMxMDEzMTVaFw0zNTAyMTMxMDEzMTVaMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwUdO3fxEzEtcnI7ZKZL412XvZPugoni7i7D7prCe0AtaHTc97CYgm7NsAtJyxNLixmhLV8pyIEaiHXWAh8fPKW+R017+EmXrr9EaquPmsVvTywAAE1PMNOKqo2kl4Gxiz9zZqIajOm1fZGWcGS0f5JQ2kBqNbvbg2/Za+GJ/qwUCAwEAAaOB7jCB6zAdBgNVHQ4EFgQUlp98u8ZvF71ZP1LXChvsENZklGswgbsGA1UdIwSBszCBsIAUlp98u8ZvF71ZP1LXChvsENZklGuhgZSkgZEwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAgV86VpqAWuXvX6Oro4qJ1tYVIT5DgWpE692Ag422H7yRIr/9j/iKG4Thia/Oflx4TdL+IFJBAyPK9v6zZNZtBgPBynXb048hsP16l2vi0k5Q2JKiPDsEfBhGI+HnxLXEaUWAcVfCsQFvd2A1sxRr67ip5y2wwBelUecP3AjJ+YcxggGaMIIBlgIBATCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTEwMDcxOTA2MzUwOVowIwYJKoZIhvcNAQkEMRYEFBdLGCmffPW6PMR/W24T+7ktQe1iMA0GCSqGSIb3DQEBAQUABIGAdn5PO7OJuHq/YpWaWKkJMDNhCqAyRyWpaM4LMQXzyA+ADoKvPnpgHrCdJpvB01L/Wk2apJ59CpB7iFerXh6QRgX85lE6HFl3C+GDRikabulgIn0F/1SMeUuvuRZ8g//Z3xcktOzdchB65K2LyUowAV8rpeWGmt8JFNwOZbeqcmw=-----END PKCS7-----
|
|
23
|
+
" />
|
|
24
|
+
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" />
|
|
25
|
+
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
|
|
26
|
+
</form>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
<div id="fullnav">
|
|
30
|
+
<div id="nav">
|
|
31
|
+
{menu: {max_levels: 1, used_nodes: files}}
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
<div id="fullintro">
|
|
35
|
+
<% if context.content_node.node_info[:page].blocks.has_key?('intro') %>
|
|
36
|
+
<div id="intro">
|
|
37
|
+
<div id="intro-in">
|
|
38
|
+
<webgen:block name="intro" node="first" />
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
<% end %>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div id="container">
|
|
45
|
+
|
|
46
|
+
<div id="sidebar"><div id="sidebar-content">
|
|
47
|
+
<webgen:block name="sidebar" node="first" notfound="ignore" />
|
|
48
|
+
</div></div>
|
|
49
|
+
|
|
50
|
+
<div id="main">
|
|
51
|
+
<webgen:block name="content" />
|
|
52
|
+
<div class="clear"></div>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<div id="footer" class="shadow">
|
|
58
|
+
<div class="float-left">Copyright © 2009 Thomas Leitner</div>
|
|
59
|
+
<div class="float-right">Based on a design by <a href="http://www.davidkohout.cz" title="Original template design">David Kohout</a></div>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<!-- Start of StatCounter Code -->
|
|
63
|
+
<script type="text/javascript">
|
|
64
|
+
var sc_project=4267845;
|
|
65
|
+
var sc_invisible=1;
|
|
66
|
+
var sc_partition=46;
|
|
67
|
+
var sc_click_stat=1;
|
|
68
|
+
var sc_security="41321455";
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<script type="text/javascript" src="http://www.statcounter.com/counter/counter_xhtml.js"></script>
|
|
72
|
+
<noscript><div class="statcounter">
|
|
73
|
+
<a title="web counter" class="statcounter" href="http://www.statcounter.com/free_hit_counter.html">
|
|
74
|
+
<img class="statcounter" src="http://c.statcounter.com/4267845/0/41321455/1/" alt="web counter" />
|
|
75
|
+
</a>
|
|
76
|
+
</div></noscript>
|
|
77
|
+
<!-- End of StatCounter Code -->
|
|
78
|
+
|
|
79
|
+
</body>
|
|
80
|
+
</html>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Documentation
|
|
3
|
+
in_menu: true
|
|
4
|
+
sort_info: 7
|
|
5
|
+
---
|
|
6
|
+
## Overview
|
|
7
|
+
|
|
8
|
+
newstile is first and foremost a library for converting text written in a superset of Markdown to
|
|
9
|
+
HTML. However, due to its modular architecture it is able to support additional input and output
|
|
10
|
+
formats. The following input and output formats are currently supported:
|
|
11
|
+
|
|
12
|
+
* Input: [newstile](parser/newstile.html) (a superset of Markdown), [html](parser/html.html)
|
|
13
|
+
* Output: [HTML](converter/html.html), [LaTeX](converter/latex.html), [newstile](converter/newstile.html)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
{:ruby: lang='ruby'}
|
|
19
|
+
|
|
20
|
+
The newstile package provides two ways for using it:
|
|
21
|
+
|
|
22
|
+
* **As a library**
|
|
23
|
+
|
|
24
|
+
newstile uses basically the same API as [RedCloth], [BlueCloth] and [Maruku]:
|
|
25
|
+
|
|
26
|
+
require 'newstile'
|
|
27
|
+
|
|
28
|
+
puts Newstile::Document.new(text).to_html
|
|
29
|
+
{:ruby}
|
|
30
|
+
|
|
31
|
+
The second parameter to the `new` call is an options hash for (de)activating certain features. For
|
|
32
|
+
example, to disable automatic header ID generation, you can do the following:
|
|
33
|
+
|
|
34
|
+
puts Newstile::Document.new(text, :auto_ids => false).to_html
|
|
35
|
+
{:ruby}
|
|
36
|
+
|
|
37
|
+
The default parser used is `newstile`, however, you can select a different one with the `:input`
|
|
38
|
+
option:
|
|
39
|
+
|
|
40
|
+
puts Newstile::Document.new(text, :input => 'html').to_latex
|
|
41
|
+
{:ruby}
|
|
42
|
+
|
|
43
|
+
You can also reuse the created document object to produce multiple outputs:
|
|
44
|
+
|
|
45
|
+
doc = Newstile::Document.new(text, :input => 'html')
|
|
46
|
+
puts doc.to_html
|
|
47
|
+
puts doc.to_latex
|
|
48
|
+
{:ruby}
|
|
49
|
+
|
|
50
|
+
More information on how to use or extend newstile can be found in the [API
|
|
51
|
+
documentation](rdoc/index.html)!
|
|
52
|
+
|
|
53
|
+
* **As an application**
|
|
54
|
+
|
|
55
|
+
Together with the library files a binary called `newstile` is shipped which can be used to convert
|
|
56
|
+
text in any supported format (currently only newstile syntax) to any supported output format (e.g.
|
|
57
|
+
HTML or LaTeX). It either reads from the files specified as the command line arguments or from the
|
|
58
|
+
standard input. For example:
|
|
59
|
+
|
|
60
|
+
newstile path/to/newstile/doc/syntax.page
|
|
61
|
+
|
|
62
|
+
The input and output formats as well as all available newstile options are supported through
|
|
63
|
+
command line switches.
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## Tests
|
|
67
|
+
|
|
68
|
+
newstile uses various test suites to verify the correct working of the parsers and converters. For
|
|
69
|
+
more information, have a look at the [tests document](tests.html).
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
{include_file: doc/links.markdown}
|
data/doc/index.page
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Home
|
|
3
|
+
in_menu: true
|
|
4
|
+
sort_info: 1
|
|
5
|
+
---
|
|
6
|
+
## Overview
|
|
7
|
+
|
|
8
|
+
If you want to get started with newstile, have a look at the [installation page](installation.html)
|
|
9
|
+
to see how you can install it on your system. Then look through the
|
|
10
|
+
[documentation](documentation.html) for finding information about how to actually use newstile and
|
|
11
|
+
its parsers/converters. The [syntax](syntax.html) provides a detailed description of the superset of
|
|
12
|
+
Markdown which newstile supports.
|
|
13
|
+
|
|
14
|
+
{tikz:: path: overview.png
|
|
15
|
+
img_attr: {style: 'background:transparent'}
|
|
16
|
+
libraries: [mindmap, trees, arrows]
|
|
17
|
+
transparent: true
|
|
18
|
+
resolution: 300 100
|
|
19
|
+
opts: |
|
|
20
|
+
mindmap, concept color=black, text=white,
|
|
21
|
+
root concept/.append style={font=\Large},
|
|
22
|
+
level 1 concept/.append style={font=\Large, minimum size=2.6cm},
|
|
23
|
+
level 2 concept/.append style={font=\Large},
|
|
24
|
+
}
|
|
25
|
+
\node[concept, font=\Large] (lib) {newstile's internal representation}
|
|
26
|
+
child[concept color=orange, grow=150, ->] {node[concept] (i-newstile) {newstile}}
|
|
27
|
+
child[concept color=orange, grow=210] {node[concept] (i-html) {HTML}}
|
|
28
|
+
child[concept color=green!50!black, grow=40] {node[concept] (o-html) {HTML}}
|
|
29
|
+
child[concept color=green!50!black, grow=0] {node[concept] (o-newstile) {newstile}}
|
|
30
|
+
child[concept color=green!50!black, grow=-45] {
|
|
31
|
+
node[concept] (o-latex) {\LaTeX}
|
|
32
|
+
child[grow=0] {
|
|
33
|
+
node[concept] (o-latex-pdf) {PDF}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
child[concept color=green!50!black, grow=-45] {node[concept] {\LaTeX}}
|
|
37
|
+
;
|
|
38
|
+
\draw [dash pattern=on 0pt off 2pt,line width=5pt,arrows=-angle 60,shorten >=15pt,shorten <=10pt,color=orange]
|
|
39
|
+
(i-newstile) edge(lib)
|
|
40
|
+
(i-html) edge (lib);
|
|
41
|
+
\draw [dash pattern=on 0pt off 2pt,line width=5pt,arrows=-angle 60,shorten >=10pt,shorten <=15pt,color=green!50!black]
|
|
42
|
+
(lib) edge(o-html)
|
|
43
|
+
(lib) edge (o-newstile)
|
|
44
|
+
(lib) edge (o-latex);
|
|
45
|
+
{tikz}
|
|
46
|
+
{: style="text-align: center"}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## Bugs, Forums, Mailing Lists
|
|
50
|
+
|
|
51
|
+
If you have found a bug, you should [report it here][bug_report]. Also, there are [forums][forum]
|
|
52
|
+
and [mailing lists][ml] available if you have any questions!
|
|
53
|
+
|
|
54
|
+
[bug_report]: http://rubyforge.org/tracker/?atid=28673&group_id=7403&func=browse
|
|
55
|
+
[forum]: http://rubyforge.org/forum/?group_id=7403
|
|
56
|
+
[ml]: http://rubyforge.org/mail/?group_id=7403
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
## Thanks
|
|
60
|
+
|
|
61
|
+
newstile would not be possible without the prior work of many other people. I want to thank everyone
|
|
62
|
+
involved with making Markdown such a nice markup language and especially the developers of other
|
|
63
|
+
Markdown implementations because newstile borrowed many ideas from existing packages.
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## Author
|
|
67
|
+
|
|
68
|
+
* Thomas Leitner
|
|
69
|
+
* e-Mail: <t_leitner@gmx.at>
|
|
70
|
+
* GPG Key-Id: 0xB2D0A854
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
[PHP Markdown Extra]: http://michelf.com/projects/php-markdown/extra/
|
|
74
|
+
[Maruku]: http://maruku.rubyforge.org
|
|
75
|
+
[BlueCloth]: http://www.deveiate.org/projects/BlueCloth
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
--- name:intro
|
|
79
|
+
|
|
80
|
+
## Welcome to the newstile site
|
|
81
|
+
|
|
82
|
+
**newstile** (sic, not Newstile or KramDown, just newstile) is a *free* GPL-licensed
|
|
83
|
+
[Ruby](http://www.ruby-lang.org) library for parsing and converting a superset of Markdown. It is
|
|
84
|
+
completely written in Ruby, supports standard Markdown (with some minor modifications) and various
|
|
85
|
+
extensions that have been made popular by the [PHP Markdown Extra] package and [Maruku].
|
|
86
|
+
|
|
87
|
+
It is probably the fastest pure-Ruby Markdown converter available (June 2010), being about 4x faster
|
|
88
|
+
than [Maruku] and about 9x faster than [BlueFeather].
|
|
89
|
+
|
|
90
|
+
<p class="a-center">
|
|
91
|
+
The latest version of newstile is <b>0.11.0</b> and it was released on <b>2010-10-01</b>.
|
|
92
|
+
</p>
|
|
93
|
+
|
|
94
|
+
[PHP Markdown Extra]: http://michelf.com/projects/php-markdown/extra/
|
|
95
|
+
[Maruku]: http://maruku.rubyforge.org
|
|
96
|
+
[BlueFeather]: http://ruby.morphball.net/bluefeather/index_en.html
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Download & Installation
|
|
3
|
+
in_menu: true
|
|
4
|
+
sort_info: 5
|
|
5
|
+
---
|
|
6
|
+
# Download & Installation
|
|
7
|
+
|
|
8
|
+
## Compatibility Notes
|
|
9
|
+
|
|
10
|
+
newstile should work on any platform which supports Ruby. It has been successfully tested on the
|
|
11
|
+
following platforms:
|
|
12
|
+
|
|
13
|
+
* Linux with Ruby 1.8.5, 1.8.6, 1.8.7, 1.9.1, 1.9.2-preview1 and jruby 1.5.0.
|
|
14
|
+
* Mac OSX with Ruby 1.8.5, 1.8.6, 1.8.7, 1.9.1, 1.9.2-preview1 and jruby 1.5.0.
|
|
15
|
+
|
|
16
|
+
See the platform specific installation notes for more information!
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## Platform Specific Installation Instructions
|
|
20
|
+
|
|
21
|
+
### Linux
|
|
22
|
+
|
|
23
|
+
There are a variety of Linux distributions out there with different package management systems. So
|
|
24
|
+
we will focus on instructions for Ubuntu 9.04 here (which should probably also work for any newer
|
|
25
|
+
Ubuntu version or any recent Debian based distribution).
|
|
26
|
+
|
|
27
|
+
After running the following commands, newstile is installed and ready to use:
|
|
28
|
+
|
|
29
|
+
sudo aptitude install ruby rubygems
|
|
30
|
+
sudo gem1.8 install newstile
|
|
31
|
+
|
|
32
|
+
> You will also need to add `export PATH=$PATH:/var/lib/gems/1.8/bin` to your `~/.bashrc` because
|
|
33
|
+
> this is the binary path the executable files get installed to.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Mac OS X
|
|
37
|
+
|
|
38
|
+
Mac OS X Snow Leopard comes with Ruby and Rubygems preinstalled. So installing newstile is as easy
|
|
39
|
+
as running:
|
|
40
|
+
|
|
41
|
+
sudo gem install newstile
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Windows
|
|
45
|
+
|
|
46
|
+
You need to install Ruby first. This can easily be done by using the One-Click-Installer - just
|
|
47
|
+
download the *latest* installation binary from the [files section][1] of the One-Click-Installer
|
|
48
|
+
homepage and run it. After that open a command shell (select `Start -> Run...`, then enter `cmd` and
|
|
49
|
+
click on `Ok`) and type in the following:
|
|
50
|
+
|
|
51
|
+
gem install newstile
|
|
52
|
+
|
|
53
|
+
[1]: http://rubyforge.org/frs/?group_id=167
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
## Generic Installation Instructions
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### Using Rubygems
|
|
60
|
+
|
|
61
|
+
If you are using Rubygems, installing the latest version of newstile is as simple as executing
|
|
62
|
+
|
|
63
|
+
gem install newstile
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Manual Installation
|
|
67
|
+
|
|
68
|
+
The latest version of newstile can always be downloaded as `.tar.gz` or `.zip` from [its files
|
|
69
|
+
section on Rubyforge](http://rubyforge.org/frs/?group_id=7403). After the download the package needs
|
|
70
|
+
to be decompressed and then you can install newstile using the included `setup.rb` installation
|
|
71
|
+
method:
|
|
72
|
+
|
|
73
|
+
$ ruby setup.rb config
|
|
74
|
+
$ ruby setup.rb setup
|
|
75
|
+
$ ruby setup.rb install
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
### Using the repository version
|
|
79
|
+
|
|
80
|
+
newstile uses git as its versioning system and newstile's repository is hosted on GitHub. The
|
|
81
|
+
repository always contains a clean state of the current development version of newstile. To check
|
|
82
|
+
out newstile use the following command:
|
|
83
|
+
|
|
84
|
+
git clone git://github.com/gettalong/newstile.git
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## Dependencies
|
|
88
|
+
|
|
89
|
+
Since newstile is written in Ruby, you just need the [Ruby interpreter](http://www.ruby-lang.org)
|
|
90
|
+
versions 1.8.5, 1.8.6, 1.8.7 or 1.9.1. There are no other dependencies.
|
data/doc/links.markdown
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
[Maruku]: http://maruku.rubyforge.org
|
|
2
|
+
[PHP Markdown Extra]: http://michelf.com/projects/php-markdown/extra/
|
|
3
|
+
[Pandoc]: http://johnmacfarlane.net/pandoc/
|
|
4
|
+
[jsMath]: http://www.math.union.edu/~dpvc/jsMath/
|
|
5
|
+
[BlueCloth]: http://deveiate.org/projects/BlueCloth
|
|
6
|
+
[RedCloth]: http://redcloth.org/
|
data/doc/news.feed
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: newstile News
|
|
3
|
+
description: newstile - a fast, pure Ruby Markdown-superset converter
|
|
4
|
+
site_url: http://newstile.rubyforge.org/
|
|
5
|
+
author: Thomas Leitner
|
|
6
|
+
author_url: http://newstile.rubyforge.org
|
|
7
|
+
number_of_entries: 10
|
|
8
|
+
rss: false
|
|
9
|
+
entries: [news/*.html]
|
|
10
|
+
|
data/doc/news.page
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: News
|
|
3
|
+
in_menu: true
|
|
4
|
+
sort_info: 30
|
|
5
|
+
--- pipeline:tags,blocks,fragments
|
|
6
|
+
|
|
7
|
+
<h1>News</h1>
|
|
8
|
+
|
|
9
|
+
<a href="{relocatable: news.atom}">Atom-Feed</a>
|
|
10
|
+
|
|
11
|
+
<webgen:block name="newsdata" node="current" />
|
|
12
|
+
|
|
13
|
+
--- name:newsdata pipeline:erb
|
|
14
|
+
<%
|
|
15
|
+
context.content_node.tree.node_access[:alcn].select do |na,no|
|
|
16
|
+
na =~ /\/news\/.+/ && no.is_file?
|
|
17
|
+
end.collect {|na,no| no}.sort.reverse.each do |node|
|
|
18
|
+
context.options['contentprocessor.newstile.options'] = {:auto_id_prefix => node.lcn.tr('.', '-')}
|
|
19
|
+
%>
|
|
20
|
+
|
|
21
|
+
<div class='news-item'>
|
|
22
|
+
<div class="news-date float-right">
|
|
23
|
+
Published on <%= node['created_at'].strftime("%A, %d %B %Y") %>
|
|
24
|
+
</div>
|
|
25
|
+
<%= context.render_block(:name => 'content', :chain => [node]) %>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<% end %>
|
data/doc/quickref.page
ADDED
|
@@ -0,0 +1,564 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Quick Reference
|
|
3
|
+
in_menu: true
|
|
4
|
+
sort_info: 9
|
|
5
|
+
--- name:sidebar
|
|
6
|
+
<h1>Contents</h1>
|
|
7
|
+
|
|
8
|
+
{menu: {used_nodes: fragments, min_levels: 4, max_levels: 6}}
|
|
9
|
+
--- name:content
|
|
10
|
+
# Quick Reference
|
|
11
|
+
|
|
12
|
+
Below are examples of all available structural elements that can be used in a newstile text. Since
|
|
13
|
+
the newstile syntax is a superset of the Markdown syntax, only a small part of the available syntax
|
|
14
|
+
is not available in standard Markdown syntax. Note, that only the most basic syntax information is
|
|
15
|
+
given. However, a link to the detailed syntax for each element is provided (which also details the
|
|
16
|
+
differences to the standard Markdown syntax). The quick reference is for version **<%=
|
|
17
|
+
::Newstile::VERSION %>** of the syntax documentation.
|
|
18
|
+
|
|
19
|
+
newstile has two main classes of elements: block and span level elements. Block level elements are
|
|
20
|
+
used to create paragraphs, headers, lists and so on whereas span level elements are used to markup
|
|
21
|
+
text phrases as emphasized, as a link and so on.
|
|
22
|
+
|
|
23
|
+
All examples below feature the newstile source, the converted HTML source and the output as it
|
|
24
|
+
appears in the browser. This looks like this:
|
|
25
|
+
|
|
26
|
+
<div class="kdexample">
|
|
27
|
+
<pre class="kdexample-before"><code>newstile example code</code></pre>
|
|
28
|
+
<pre class="kdexample-after-source"><code>Example code converted to HTML</code></pre>
|
|
29
|
+
<div class="kdexample-after-live" style="clear:none">
|
|
30
|
+
Live browser view of example code
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="clear"></div>
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# Block Level Elements - Main Structural Elements
|
|
37
|
+
|
|
38
|
+
## Paragraphs
|
|
39
|
+
|
|
40
|
+
{kdlink: {oid: paragraphs, part: "paragraphs"}}
|
|
41
|
+
|
|
42
|
+
Paragraphs are separated by one or more blank lines:
|
|
43
|
+
|
|
44
|
+
{kdexample::}
|
|
45
|
+
The first paragraph.
|
|
46
|
+
|
|
47
|
+
Another paragraph
|
|
48
|
+
{kdexample}
|
|
49
|
+
|
|
50
|
+
Explicit line breaks in a paragraph can be made by using two spaces or two backslashes at the end of a line:
|
|
51
|
+
|
|
52
|
+
{kdexample::}
|
|
53
|
+
This is a paragraph
|
|
54
|
+
which contains a hard line break.
|
|
55
|
+
{kdexample}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## Headers
|
|
59
|
+
|
|
60
|
+
{kdlink: {oid: headers, part: "headers"}}
|
|
61
|
+
|
|
62
|
+
newstile supports Setext style headers and atx style headers. A header must always be preceded by a
|
|
63
|
+
blank line except at the beginning of the document:
|
|
64
|
+
|
|
65
|
+
{kdexample::}
|
|
66
|
+
First level header
|
|
67
|
+
==================
|
|
68
|
+
|
|
69
|
+
Second level header
|
|
70
|
+
-------------------
|
|
71
|
+
{kdexample}
|
|
72
|
+
|
|
73
|
+
{kdexample::}
|
|
74
|
+
# H1 header
|
|
75
|
+
|
|
76
|
+
## H2 header
|
|
77
|
+
|
|
78
|
+
### H3 header
|
|
79
|
+
|
|
80
|
+
#### H4 header
|
|
81
|
+
|
|
82
|
+
##### H5 header
|
|
83
|
+
|
|
84
|
+
###### H6 header
|
|
85
|
+
{kdexample}
|
|
86
|
+
|
|
87
|
+
If you set the option `auto_ids` to `false` (for example, by using the `options` extension, see
|
|
88
|
+
[Extensions](#extensions)), then the automatic header ID generation is turned off:
|
|
89
|
+
|
|
90
|
+
{kdexample::}
|
|
91
|
+
{:options auto_ids="false" /}
|
|
92
|
+
|
|
93
|
+
# A header without an ID
|
|
94
|
+
{kdexample}
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
## Blockquotes
|
|
98
|
+
|
|
99
|
+
{kdlink: {oid: blockquotes, part: "blockquotes"}}
|
|
100
|
+
|
|
101
|
+
A blockquote is started using the `>` marker followed by an optional space; all following lines that
|
|
102
|
+
are also started with the blockquote marker belong to the blockquote. You can use any block level
|
|
103
|
+
elements inside a blockquote:
|
|
104
|
+
|
|
105
|
+
{kdexample::}
|
|
106
|
+
> A sample blockquote.
|
|
107
|
+
> >Nested blockquotes are
|
|
108
|
+
> >also possible.
|
|
109
|
+
>
|
|
110
|
+
> ## Headers work too
|
|
111
|
+
> This is the outer quote again.
|
|
112
|
+
{kdexample}
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
## Code Blocks
|
|
116
|
+
|
|
117
|
+
{kdlink: {oid: code-blocks, part: "code blocks"}}
|
|
118
|
+
|
|
119
|
+
newstile supports two different code block styles. One uses lines indented with either four spaces
|
|
120
|
+
or one tab whereas the other uses lines with tilde characters as delimiters -- therefore the content
|
|
121
|
+
does not need to be indented:
|
|
122
|
+
|
|
123
|
+
{kdexample::}
|
|
124
|
+
This is a sample code block.
|
|
125
|
+
|
|
126
|
+
Continued here.
|
|
127
|
+
{kdexample}
|
|
128
|
+
|
|
129
|
+
{kdexample::}
|
|
130
|
+
~~~~~~
|
|
131
|
+
This is also a code block.
|
|
132
|
+
~~~
|
|
133
|
+
Ending lines must have at least as
|
|
134
|
+
many tildes as the starting line.
|
|
135
|
+
~~~~~~~~~~~~
|
|
136
|
+
{kdexample}
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
## Horizontal Rules
|
|
140
|
+
|
|
141
|
+
{kdlink: {oid: horizontal-rules, part: "horizontal rules"}}
|
|
142
|
+
|
|
143
|
+
It is easy to insert a horizontal rule in newstile: just use three or more asterisks, dashes or
|
|
144
|
+
underscores, optionally separated by spaces or tabs, on an otherwise blank line:
|
|
145
|
+
|
|
146
|
+
{kdexample::}
|
|
147
|
+
* * *
|
|
148
|
+
|
|
149
|
+
\---
|
|
150
|
+
|
|
151
|
+
_ _ _ _
|
|
152
|
+
|
|
153
|
+
---------------
|
|
154
|
+
{kdexample}
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
## Lists
|
|
158
|
+
|
|
159
|
+
{kdlink: {oid: lists, part: "lists"}}
|
|
160
|
+
|
|
161
|
+
newstile supports ordered and unordered lists. Ordered lists are started by using a number followed
|
|
162
|
+
by a period, a space and then the list item text. The content of a list item consists of block level
|
|
163
|
+
elements. All lines which have the same indent as the text of the line with the list marker belong
|
|
164
|
+
to the list item:
|
|
165
|
+
|
|
166
|
+
{kdexample::}
|
|
167
|
+
1. This is a list item
|
|
168
|
+
2. And another item
|
|
169
|
+
2. And the third one
|
|
170
|
+
with additional. text
|
|
171
|
+
{kdexample}
|
|
172
|
+
|
|
173
|
+
As the content consists of block level elements you can do things like the following:
|
|
174
|
+
|
|
175
|
+
{kdexample::}
|
|
176
|
+
1. This is a list item
|
|
177
|
+
|
|
178
|
+
> with a blockquote
|
|
179
|
+
|
|
180
|
+
# And a header
|
|
181
|
+
|
|
182
|
+
2. Followed by another item
|
|
183
|
+
{kdexample}
|
|
184
|
+
|
|
185
|
+
Nested lists are also easy to create:
|
|
186
|
+
|
|
187
|
+
{kdexample::}
|
|
188
|
+
1. Item one
|
|
189
|
+
1. sub item one
|
|
190
|
+
2. sub item two
|
|
191
|
+
3. sub item three
|
|
192
|
+
2. Item two
|
|
193
|
+
{kdexample}
|
|
194
|
+
|
|
195
|
+
Lists can occur directly after other block level elements, however, there has to be at least one
|
|
196
|
+
blank line if you want to follow a paragraph with a list:
|
|
197
|
+
|
|
198
|
+
{kdexample::}
|
|
199
|
+
This is a paragraph.
|
|
200
|
+
1. This is NOT a list.
|
|
201
|
+
|
|
202
|
+
1. This is a list!
|
|
203
|
+
{kdexample}
|
|
204
|
+
|
|
205
|
+
Unordered lists are started by using an asterisk, a dash or a plus sign (they can be mixed) and a
|
|
206
|
+
space. Apart from that unordered lists follow the same rules as ordered lists:
|
|
207
|
+
|
|
208
|
+
{kdexample::}
|
|
209
|
+
* Item one
|
|
210
|
+
+ Item two
|
|
211
|
+
- Item three
|
|
212
|
+
{kdexample}
|
|
213
|
+
|
|
214
|
+
## Definition Lists
|
|
215
|
+
|
|
216
|
+
{kdlink: {oid: definition-lists, part: "definition lists"}}
|
|
217
|
+
|
|
218
|
+
A definition list works similar to a normal list and is used to associate definitions with terms.
|
|
219
|
+
Definition lists are started when a normal paragraph is followed by a line starting with a colon and
|
|
220
|
+
then the definition text. One term can have many definitions and multiple terms can have the same
|
|
221
|
+
definition. Each line of the preceding paragraph is assumed to contain one term, for example:
|
|
222
|
+
|
|
223
|
+
{kdexample::}
|
|
224
|
+
term
|
|
225
|
+
: definition
|
|
226
|
+
: another definition
|
|
227
|
+
|
|
228
|
+
another term
|
|
229
|
+
and another term
|
|
230
|
+
: and a definition for the term
|
|
231
|
+
{kdexample}
|
|
232
|
+
|
|
233
|
+
If you insert a blank line before a definition (note: there must only be one blank line between the
|
|
234
|
+
terms and the first definition), the definition will be wrapped in a paragraph:
|
|
235
|
+
|
|
236
|
+
{kdexample::}
|
|
237
|
+
term
|
|
238
|
+
|
|
239
|
+
: definition
|
|
240
|
+
: definition
|
|
241
|
+
{kdexample}
|
|
242
|
+
|
|
243
|
+
Each term can be styled using span level elements and each definition is parsed as block level
|
|
244
|
+
elements, i.e. you can use any block level in a definition. Just use the same indent for the lines
|
|
245
|
+
following the definition line:
|
|
246
|
+
|
|
247
|
+
{kdexample::}
|
|
248
|
+
This *is* a term
|
|
249
|
+
|
|
250
|
+
: This will be a para
|
|
251
|
+
> a blockquote
|
|
252
|
+
|
|
253
|
+
# A header
|
|
254
|
+
{kdexample}
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
## Tables
|
|
258
|
+
|
|
259
|
+
{kdlink: {oid: tables, part: "tables"}}
|
|
260
|
+
|
|
261
|
+
newstile supports a syntax for creating simple tables. A line starting with a pipe character (`|`)
|
|
262
|
+
starts a table row. However, if the pipe characters is immediately followed by a dash (`-`), a
|
|
263
|
+
separator line is created. Separator lines are used to split the table header from the table body
|
|
264
|
+
(and optionally align the table columns) and to split the table body into multiple parts. If the
|
|
265
|
+
pipe character is followed by an equal sign (`=`), the tables rows below it are part of the table
|
|
266
|
+
footer.
|
|
267
|
+
|
|
268
|
+
{kdexample::}
|
|
269
|
+
| A simple | table |
|
|
270
|
+
| with multiple | lines|
|
|
271
|
+
{kdexample}
|
|
272
|
+
|
|
273
|
+
{kdexample::}
|
|
274
|
+
| Header1 | Header2 | Header3 |
|
|
275
|
+
|:--------|:-------:|--------:|
|
|
276
|
+
| cell1 | cell2 | cell3 |
|
|
277
|
+
| cell4 | cell5 | cell6 |
|
|
278
|
+
|----
|
|
279
|
+
| cell1 | cell2 | cell3 |
|
|
280
|
+
| cell4 | cell5 | cell6 |
|
|
281
|
+
|=====
|
|
282
|
+
| Foot1 | Foot2 | Foot3
|
|
283
|
+
{: rules="groups"}
|
|
284
|
+
{kdexample}
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
## HTML elements
|
|
288
|
+
|
|
289
|
+
{kdlink: {oid: html-blocks, part: "HTML blocks"}}
|
|
290
|
+
|
|
291
|
+
newstile allows you to use block level HTML tags (`div`, `p`, `pre`, ...) to markup whole blocks of
|
|
292
|
+
text -- just start a line with a block level HTML tag. newstile syntax is normally not processed
|
|
293
|
+
inside an HTML tag but this can be changed with the `parse_block_html` option. If this options is
|
|
294
|
+
set to `true`, then the content of a block level HTML tag is parsed by newstile either as block
|
|
295
|
+
level or span level text, depending on the tag:
|
|
296
|
+
|
|
297
|
+
{kdexample::}
|
|
298
|
+
<div style="float: right">
|
|
299
|
+
Something that stays right and is not wrapped in a para.
|
|
300
|
+
</div>
|
|
301
|
+
{options: parse_block_html="true"}
|
|
302
|
+
<div>
|
|
303
|
+
This is wrapped in a para.
|
|
304
|
+
</div>
|
|
305
|
+
<p>
|
|
306
|
+
This can contain only *span* level elements.
|
|
307
|
+
</p>
|
|
308
|
+
{kdexample}
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
## Block Attributes
|
|
312
|
+
|
|
313
|
+
{kdlink: {oid: block-ials, part: "block IALs"}}
|
|
314
|
+
{kdlink: {oid: attribute-list-definitions, part: "ALDs"}}
|
|
315
|
+
|
|
316
|
+
You can assign any attribute to a block level element. Just directly follow the block with a *block
|
|
317
|
+
inline attribute list* (or short: block IAL). A block IAL consists of a left curly brace, followed
|
|
318
|
+
by a colon, the attribute definitions and a right curly brace. Here is a simple example which sets the
|
|
319
|
+
`title` attribute of a block quote:
|
|
320
|
+
|
|
321
|
+
{kdexample::}
|
|
322
|
+
> A nice blockquote
|
|
323
|
+
{: title="Blockquote title"}
|
|
324
|
+
{kdexample}
|
|
325
|
+
|
|
326
|
+
As one often wants to set one or more CSS classes on an element, there is an easy shortcut:
|
|
327
|
+
|
|
328
|
+
{kdexample::}
|
|
329
|
+
> A nice blockquote
|
|
330
|
+
{: .class1 .class2}
|
|
331
|
+
{kdexample}
|
|
332
|
+
|
|
333
|
+
A shortcut for setting the ID is also provided. Just prefix the ID with a hash symbol:
|
|
334
|
+
|
|
335
|
+
{kdexample::}
|
|
336
|
+
> A nice blockquote
|
|
337
|
+
{: #with-an-id}
|
|
338
|
+
{kdexample}
|
|
339
|
+
|
|
340
|
+
Sometimes one wants to use the same attributes for many elements. newstile allows you to define the
|
|
341
|
+
attributes in one place with an *attribute list definition* (or short: ALD) and just reference this
|
|
342
|
+
definition in a block IAL. An ALD has the same structure as a block IAL but the colon has to be
|
|
343
|
+
replace with a colon, the reference name and another colon. By just using the reference name as-is
|
|
344
|
+
in a block IAL, one can include the attributes of the referenced ALD:
|
|
345
|
+
|
|
346
|
+
{kdexample::}
|
|
347
|
+
{:refdef: .c1 #id .c2 title="title"}
|
|
348
|
+
paragraph
|
|
349
|
+
{: refdef}
|
|
350
|
+
{kdexample}
|
|
351
|
+
|
|
352
|
+
The order in a block IAL or ALD is important because later defined attributes overwrite (with the
|
|
353
|
+
exception of the shortcut for CSS classes) prior defined attributes:
|
|
354
|
+
|
|
355
|
+
{kdexample::}
|
|
356
|
+
{:refdef: .c1 #id .c2 title="title"}
|
|
357
|
+
paragraph
|
|
358
|
+
{: refdef .c3 title="t" #para}
|
|
359
|
+
{kdexample}
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
## Extensions
|
|
363
|
+
|
|
364
|
+
{kdlink: {oid: extensions, part: "extensions"}}
|
|
365
|
+
|
|
366
|
+
newstile provides some less used functionality through a common syntax. This will allow the easy
|
|
367
|
+
addition of other extensions if need arises. Currently, there are extensions for ignoring text (i.e.
|
|
368
|
+
treating text as comment), for inserting arbitrary text as-is into the output and for setting
|
|
369
|
+
newstile options.
|
|
370
|
+
|
|
371
|
+
Here is an example that shows how to insert comments into text:
|
|
372
|
+
|
|
373
|
+
{kdexample::}
|
|
374
|
+
This is a paragraph
|
|
375
|
+
{:comment}
|
|
376
|
+
This is a comment which is
|
|
377
|
+
completely ignored.
|
|
378
|
+
{:/comment}
|
|
379
|
+
... paragraph continues here.
|
|
380
|
+
|
|
381
|
+
Extensions can also be used
|
|
382
|
+
inline {:nomarkdown}**see**{:/}!
|
|
383
|
+
{kdexample}
|
|
384
|
+
|
|
385
|
+
As one can see from the above example, the syntax for extensions is nearly identical to that of
|
|
386
|
+
ALDs. However, there is no trailing colon after the extension name and the extension end tag needs a
|
|
387
|
+
slash between the colon and the extension name. One can also use the short form of the end tag, i.e.
|
|
388
|
+
`{:/}`. Attribute definitions can be specified on the start tag by separating them with a space from
|
|
389
|
+
the extension name. Also, if the extension does not have a body, there needs to be a slash right
|
|
390
|
+
before the closing brace:
|
|
391
|
+
|
|
392
|
+
{kdexample::}
|
|
393
|
+
{:options auto_ids="false" /}
|
|
394
|
+
|
|
395
|
+
# Header without id
|
|
396
|
+
{kdexample}
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
# Span Level Elements - Text Modifiers
|
|
402
|
+
|
|
403
|
+
## Emphasis
|
|
404
|
+
|
|
405
|
+
{kdlink: {oid: emphasis, part: "emphasis"}}
|
|
406
|
+
|
|
407
|
+
Emphasis can be added to text by surrounding the text with either asterisks or underscores:
|
|
408
|
+
|
|
409
|
+
{kdexample::}
|
|
410
|
+
This is *emphasized*,
|
|
411
|
+
_this_ too!
|
|
412
|
+
{kdexample}
|
|
413
|
+
|
|
414
|
+
Strong emphasis can be done by doubling the delimiters:
|
|
415
|
+
|
|
416
|
+
{kdexample::}
|
|
417
|
+
This is **strong**,
|
|
418
|
+
__this__ too!
|
|
419
|
+
{kdexample}
|
|
420
|
+
|
|
421
|
+
The form with the asterisks can also be used to markup parts of words:
|
|
422
|
+
|
|
423
|
+
{kdexample::}
|
|
424
|
+
This w**ork**s as expected!
|
|
425
|
+
{kdexample}
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
## Links and Images
|
|
429
|
+
|
|
430
|
+
{kdlink: {oid: links-and-images, part: "links and images"}}
|
|
431
|
+
|
|
432
|
+
A simple link can be created by surrounding the text with square brackets and the link URL with
|
|
433
|
+
parentheses:
|
|
434
|
+
|
|
435
|
+
{kdexample::}
|
|
436
|
+
A [link](http://newstile.rubyforge.org)
|
|
437
|
+
to the newstile homepage.
|
|
438
|
+
{kdexample}
|
|
439
|
+
|
|
440
|
+
You can also add title information to the link:
|
|
441
|
+
|
|
442
|
+
{kdexample::}
|
|
443
|
+
A [link](http://newstile.rubyforge.org "hp")
|
|
444
|
+
to the homepage.
|
|
445
|
+
{kdexample}
|
|
446
|
+
|
|
447
|
+
There is another way to create links which does not interrupt the text flow. The URL and title are
|
|
448
|
+
defined using a reference name and this reference name is then used in square brackets instead of
|
|
449
|
+
the link URL:
|
|
450
|
+
|
|
451
|
+
{kdexample::}
|
|
452
|
+
A [link][newstile hp]
|
|
453
|
+
to the homepage.
|
|
454
|
+
|
|
455
|
+
[newstile hp]: http://newstile.rubyforge.org "hp"
|
|
456
|
+
{kdexample}
|
|
457
|
+
|
|
458
|
+
If the link text itself is the reference name, the second set of square brackets can be omitted:
|
|
459
|
+
|
|
460
|
+
{kdexample::}
|
|
461
|
+
A link to the [newstile hp].
|
|
462
|
+
|
|
463
|
+
[newstile hp]: http://newstile.rubyforge.org "hp"
|
|
464
|
+
{kdexample}
|
|
465
|
+
|
|
466
|
+
Images can be created in a similar way: just use an exclamation mark before the square brackets. The
|
|
467
|
+
link text will become the alternative text of the image and the link URL specifies the image source:
|
|
468
|
+
|
|
469
|
+
{kdexample::}
|
|
470
|
+
An image: 
|
|
471
|
+
{kdexample}
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
## Inline Code
|
|
475
|
+
|
|
476
|
+
{kdlink: {oid: code-spans, part: "code spans"}}
|
|
477
|
+
|
|
478
|
+
Text phrases can be easily marked up as code by surrounding them with backticks:
|
|
479
|
+
|
|
480
|
+
{kdexample::}
|
|
481
|
+
Use `Newstile::Document.new(text).to_html`
|
|
482
|
+
to convert the `text` in newstile
|
|
483
|
+
syntax to HTML.
|
|
484
|
+
{kdexample}
|
|
485
|
+
|
|
486
|
+
If you want to use literal backticks in your code, just use two or more backticks as delimiters. The
|
|
487
|
+
space right after the beginning delimiter and the one right before the closing delimiter are ignore:
|
|
488
|
+
|
|
489
|
+
{kdexample::}
|
|
490
|
+
Use backticks to markup code,
|
|
491
|
+
e.g. `` `code` ``.
|
|
492
|
+
{kdexample}
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
## Footnotes
|
|
496
|
+
|
|
497
|
+
{kdlink: {oid: footnotes, part: "footnotes"}}
|
|
498
|
+
|
|
499
|
+
Footnotes can easily be used in newstile. Just set a footnote marker (consists of square brackets
|
|
500
|
+
with a caret and the footnote name inside) in the text and somewhere else the footnote definition (which
|
|
501
|
+
basically looks like a reference link definition):
|
|
502
|
+
|
|
503
|
+
{kdexample::}
|
|
504
|
+
This is a text with a
|
|
505
|
+
footnote[^1].
|
|
506
|
+
|
|
507
|
+
[^1]: And here is the definition.
|
|
508
|
+
{kdexample}
|
|
509
|
+
|
|
510
|
+
The footnote definition can contain any block level element, all lines following a footnote
|
|
511
|
+
definition indented with four spaces or one tab belong to the definition:
|
|
512
|
+
|
|
513
|
+
{kdexample::}
|
|
514
|
+
This is a text with a
|
|
515
|
+
footnote[^2].
|
|
516
|
+
|
|
517
|
+
[^2]:
|
|
518
|
+
And here is the definition.
|
|
519
|
+
|
|
520
|
+
> With a quote!
|
|
521
|
+
{kdexample}
|
|
522
|
+
|
|
523
|
+
As can be seen above the footnote name is only used for the anchors and the numbering is done
|
|
524
|
+
automatically in document order.
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
## Abbreviations
|
|
528
|
+
|
|
529
|
+
{kdlink: {oid: abbreviations, part: "abbreviations"}}
|
|
530
|
+
|
|
531
|
+
Abbreviations will work out of the box once you add an abbreviation definition. So you can just
|
|
532
|
+
write the text and add the definitions later on.
|
|
533
|
+
|
|
534
|
+
{kdexample::}
|
|
535
|
+
This is an HTML
|
|
536
|
+
example.
|
|
537
|
+
|
|
538
|
+
*[HTML]: Hyper Text Markup Language
|
|
539
|
+
{kdexample}
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
## HTML Elements
|
|
543
|
+
|
|
544
|
+
{kdlink: {oid: html-spans, part: "HTML spans"}}
|
|
545
|
+
|
|
546
|
+
HTML is not only supported on the block level but also on the span level:
|
|
547
|
+
|
|
548
|
+
{kdexample::}
|
|
549
|
+
This is <span style="color: red">written in
|
|
550
|
+
red</span>.
|
|
551
|
+
{kdexample}
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
## Inline Attributes
|
|
555
|
+
|
|
556
|
+
{kdlink: {oid: span-ials, part: "span IALs"}}
|
|
557
|
+
|
|
558
|
+
As with a block level element you can assign any attribute to a span level elements using a *span
|
|
559
|
+
inline attribute list* (or short: span IAL). A span IAL has the same syntax as a block IAL and must
|
|
560
|
+
immediately follow the span level element:
|
|
561
|
+
|
|
562
|
+
{kdexample::}
|
|
563
|
+
This is *red*{: style="color: red"}.
|
|
564
|
+
{kdexample}
|