From edf2f3bec1de42965e347eb808f8604151c35bdb Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> Date: Wed, 2 Jul 2003 17:51:01 +0000 Subject: This commit was manufactured by cvs2svn to create branch 'ax'. git-svn-id: http://svn.code.sf.net/p/docutils/code/branches/ax@1551 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- docutils/.cvsignore | 1 - docutils/COPYING.txt | 124 - docutils/FAQ.txt | 480 -- docutils/HISTORY.txt | 1179 ---- docutils/MANIFEST.in | 10 - docutils/README.txt | 330 - docutils/docs/dev/pysource.dtd | 258 - docutils/docs/dev/pysource.txt | 130 - docutils/docs/dev/rst/alternatives.txt | 2005 ------ docutils/docs/dev/rst/problems.txt | 870 --- docutils/docs/dev/semantics.txt | 119 - docutils/docs/dev/todo.txt | 2114 ------ docutils/docs/howto/i18n.txt | 178 - docutils/docs/howto/rst-directives.txt | 348 - docutils/docs/peps/pep-0256.txt | 299 - docutils/docs/peps/pep-0257.txt | 328 - docutils/docs/peps/pep-0258.txt | 999 --- docutils/docs/peps/pep-0287.txt | 815 --- docutils/docs/ref/doctree.txt | 4840 ------------- docutils/docs/ref/docutils.dtd | 571 -- docutils/docs/ref/rst/directives.txt | 979 --- docutils/docs/ref/rst/introduction.txt | 315 - docutils/docs/ref/rst/restructuredtext.txt | 2679 ------- docutils/docs/ref/rst/roles.txt | 175 - docutils/docs/ref/soextblx.dtd | 312 - docutils/docs/ref/transforms.txt | 103 - docutils/docs/user/latex.txt | 263 - docutils/docs/user/rst/images/ball1.gif | Bin 4361 -> 0 bytes docutils/docs/user/rst/images/biohazard.png | Bin 179 -> 0 bytes docutils/docs/user/rst/images/title.png | Bin 1171 -> 0 bytes docutils/docs/user/rst/quickref.html | 1243 ---- docutils/docs/user/rst/quickstart.txt | 382 - docutils/docs/user/tools.txt | 724 -- docutils/docutils/__init__.py | 128 - docutils/docutils/core.py | 360 - docutils/docutils/frontend.py | 477 -- docutils/docutils/io.py | 289 - docutils/docutils/languages/__init__.py | 23 - docutils/docutils/languages/af.py | 60 - docutils/docutils/languages/de.py | 60 - docutils/docutils/languages/en.py | 62 - docutils/docutils/languages/es.py | 60 - docutils/docutils/languages/fr.py | 60 - docutils/docutils/languages/it.py | 60 - docutils/docutils/languages/ru.py | 68 - docutils/docutils/languages/sk.py | 60 - docutils/docutils/languages/sv.py | 61 - docutils/docutils/nodes.py | 1478 ---- docutils/docutils/parsers/__init__.py | 48 - docutils/docutils/parsers/rst/__init__.py | 123 - .../docutils/parsers/rst/directives/__init__.py | 252 - .../docutils/parsers/rst/directives/admonitions.py | 90 - docutils/docutils/parsers/rst/directives/body.py | 122 - docutils/docutils/parsers/rst/directives/html.py | 96 - docutils/docutils/parsers/rst/directives/images.py | 100 - docutils/docutils/parsers/rst/directives/misc.py | 231 - docutils/docutils/parsers/rst/directives/parts.py | 56 - .../docutils/parsers/rst/directives/references.py | 23 - .../docutils/parsers/rst/languages/__init__.py | 27 - docutils/docutils/parsers/rst/languages/af.py | 92 - docutils/docutils/parsers/rst/languages/de.py | 83 - docutils/docutils/parsers/rst/languages/en.py | 94 - docutils/docutils/parsers/rst/languages/es.py | 102 - docutils/docutils/parsers/rst/languages/fr.py | 89 - docutils/docutils/parsers/rst/languages/it.py | 81 - docutils/docutils/parsers/rst/languages/ru.py | 93 - docutils/docutils/parsers/rst/languages/sk.py | 81 - docutils/docutils/parsers/rst/languages/sv.py | 80 - docutils/docutils/parsers/rst/states.py | 2913 -------- docutils/docutils/parsers/rst/tableparser.py | 530 -- docutils/docutils/readers/__init__.py | 88 - docutils/docutils/readers/pep.py | 58 - docutils/docutils/readers/python/__init__.py | 19 - docutils/docutils/readers/python/moduleparser.py | 784 --- docutils/docutils/readers/standalone.py | 49 - docutils/docutils/statemachine.py | 1451 ---- docutils/docutils/transforms/__init__.py | 166 - docutils/docutils/transforms/components.py | 54 - docutils/docutils/transforms/frontmatter.py | 399 -- docutils/docutils/transforms/misc.py | 62 - docutils/docutils/transforms/parts.py | 176 - docutils/docutils/transforms/peps.py | 294 - docutils/docutils/transforms/references.py | 762 -- docutils/docutils/transforms/universal.py | 185 - docutils/docutils/urischemes.py | 105 - docutils/docutils/utils.py | 447 -- docutils/docutils/writers/__init__.py | 83 - docutils/docutils/writers/docutils_xml.py | 66 - docutils/docutils/writers/html4css1.py | 1244 ---- docutils/docutils/writers/latex2e.py | 1472 ---- docutils/docutils/writers/pep_html.py | 113 - docutils/docutils/writers/pseudoxml.py | 30 - docutils/extras/optparse.py | 1401 ---- docutils/extras/roman.py | 81 - docutils/extras/textwrap.py | 355 - docutils/install.py | 21 - docutils/licenses/gpl.txt | 340 - docutils/licenses/python-2-1-1.txt | 232 - docutils/licenses/python-2-2.txt | 246 - docutils/licenses/python-2-3.txt | 253 - docutils/setup.py | 117 - docutils/test/.cvsignore | 2 - docutils/test/DocutilsTestSupport.py | 611 -- docutils/test/alltests.py | 70 - docutils/test/difflib.py | 1089 --- docutils/test/package_unittest.py | 156 - docutils/test/test_language.py | 210 - docutils/test/test_nodes.py | 153 - docutils/test/test_parsers/__init__.py | 14 - docutils/test/test_parsers/test_rst/__init__.py | 14 - .../test_parsers/test_rst/includes/include9.txt | 3 - .../test_rst/test_SimpleTableParser.py | 101 - .../test/test_parsers/test_rst/test_TableParser.py | 198 - .../test_parsers/test_rst/test_block_quotes.py | 252 - .../test_parsers/test_rst/test_bullet_lists.py | 181 - .../test/test_parsers/test_rst/test_citations.py | 139 - .../test/test_parsers/test_rst/test_comments.py | 319 - .../test_parsers/test_rst/test_definition_lists.py | 377 - .../test_rst/test_directives/__init__.py | 14 - .../test_rst/test_directives/include1.txt | 4 - .../test_rst/test_directives/include2.txt | 5 - .../test_rst/test_directives/include3.txt | 3 - .../test_rst/test_directives/include8.txt | 3 - .../test_rst/test_directives/include9.txt | 7 - .../test_rst/test_directives/includes/include4.txt | 3 - .../test_rst/test_directives/includes/include5.txt | 3 - .../test_directives/includes/more/include6.txt | 3 - .../test_directives/includes/sibling/include7.txt | 1 - .../test_parsers/test_rst/test_directives/raw1.txt | 1 - .../test_rst/test_directives/test_admonitions.py | 184 - .../test_rst/test_directives/test_contents.py | 208 - .../test_rst/test_directives/test_figures.py | 287 - .../test_rst/test_directives/test_images.py | 249 - .../test_rst/test_directives/test_include.py | 309 - .../test_rst/test_directives/test_meta.py | 232 - .../test_rst/test_directives/test_raw.py | 84 - .../test_rst/test_directives/test_replace.py | 135 - .../test_rst/test_directives/test_rubrics.py | 74 - .../test_directives/test_test_directives.py | 195 - .../test_rst/test_directives/test_topics.py | 242 - .../test_rst/test_directives/test_unicode.py | 131 - .../test_rst/test_directives/test_unknown.py | 67 - .../test_parsers/test_rst/test_doctest_blocks.py | 74 - .../test_parsers/test_rst/test_enumerated_lists.py | 727 -- .../test/test_parsers/test_rst/test_field_lists.py | 469 -- .../test/test_parsers/test_rst/test_footnotes.py | 332 - .../test/test_parsers/test_rst/test_functions.py | 38 - .../test_parsers/test_rst/test_inline_markup.py | 851 --- .../test/test_parsers/test_rst/test_interpreted.py | 305 - .../test_parsers/test_rst/test_literal_blocks.py | 234 - .../test_parsers/test_rst/test_option_lists.py | 684 -- .../test/test_parsers/test_rst/test_outdenting.py | 90 - .../test/test_parsers/test_rst/test_paragraphs.py | 89 - .../test_parsers/test_rst/test_section_headers.py | 912 --- .../test_parsers/test_rst/test_substitutions.py | 231 - docutils/test/test_parsers/test_rst/test_tables.py | 1151 --- .../test/test_parsers/test_rst/test_targets.py | 448 -- .../test/test_parsers/test_rst/test_transitions.py | 220 - docutils/test/test_readers/__init__.py | 14 - docutils/test/test_readers/test_pep/__init__.py | 14 - .../test_readers/test_pep/test_inline_markup.py | 140 - .../test/test_readers/test_pep/test_rfc2822.py | 291 - docutils/test/test_readers/test_python/__init__.py | 14 - docutils/test/test_readers/test_python/showast | 57 - docutils/test/test_readers/test_python/showdoc | 33 - docutils/test/test_readers/test_python/showparse | 48 - docutils/test/test_readers/test_python/showtok | 40 - .../test_readers/test_python/test_functions.py | 56 - .../test/test_readers/test_python/test_parser.py | 745 -- .../test_readers/test_python/test_token_parser.py | 46 - docutils/test/test_statemachine.py | 283 - docutils/test/test_transforms/__init__.py | 14 - docutils/test/test_transforms/test_class.py | 104 - docutils/test/test_transforms/test_contents.py | 377 - docutils/test/test_transforms/test_docinfo.py | 336 - docutils/test/test_transforms/test_doctitle.py | 175 - docutils/test/test_transforms/test_filter.py | 41 - docutils/test/test_transforms/test_final_checks.py | 46 - docutils/test/test_transforms/test_footnotes.py | 520 -- docutils/test/test_transforms/test_hyperlinks.py | 520 -- docutils/test/test_transforms/test_messages.py | 66 - docutils/test/test_transforms/test_peps.py | 68 - docutils/test/test_transforms/test_sectnum.py | 226 - .../test/test_transforms/test_substitutions.py | 151 - docutils/test/test_utils.py | 297 - docutils/test/test_viewlist.py | 166 - docutils/test/test_writers/__init__.py | 14 - docutils/test/test_writers/test_latex2e.py | 255 - docutils/tools/buildhtml.py | 227 - docutils/tools/docutils-xml.py | 25 - docutils/tools/docutils.conf | 15 - docutils/tools/editors/README.txt | 12 - docutils/tools/editors/emacs/restructuredtext.el | 149 - docutils/tools/editors/emacs/rst-html.el | 129 - docutils/tools/editors/emacs/rst-mode.el | 696 -- docutils/tools/html.py | 25 - docutils/tools/pep-html-template | 27 - docutils/tools/pep.py | 27 - docutils/tools/pep2html.py | 531 -- docutils/tools/publish.py | 25 - docutils/tools/quicktest.py | 211 - docutils/tools/rst2latex.py | 25 - docutils/tools/stylesheets/default.css | 224 - docutils/tools/stylesheets/pep.css | 240 - docutils/tools/unicode2rstsubs.py | 195 - sandbox/README.txt | 32 - sandbox/aahz/OO/Makefile | 27 - sandbox/aahz/OO/OOdirectives.py | 72 - sandbox/aahz/OO/OOtext.py | 127 - sandbox/aahz/OO/OOwriter.py | 676 -- sandbox/aahz/OO/graphics_output.py | 28 - sandbox/aahz/OO/open_office.py | 33 - sandbox/aahz/OO/publish.py | 27 - sandbox/bbum/00README.txt | 14 - sandbox/bbum/ChangeLog | 38 - sandbox/bbum/DocArticle/00README.txt | 15 - .../bbum/DocArticle/DocArticle/DocArticleText.py | 37 - sandbox/bbum/DocArticle/DocArticle/__init__.py | 941 --- sandbox/bbum/DocArticle/LICENSE.txt | 22 - sandbox/bbum/DocArticle/docarticle.py | 27 - sandbox/bbum/DocArticle/setup.py | 18 - sandbox/blais/css_tricks/README.txt | 12 - sandbox/blais/css_tricks/boxed_titles/castro.png | Bin 20738 -> 0 bytes sandbox/blais/css_tricks/boxed_titles/clinton.png | Bin 16129 -> 0 bytes .../blais/css_tricks/boxed_titles/docutils.conf | 3 - sandbox/blais/css_tricks/boxed_titles/index.txt | 37 - sandbox/blais/css_tricks/boxed_titles/style.css | 16 - .../blais/css_tricks/section_based/docutils.conf | 3 - sandbox/blais/css_tricks/section_based/index.txt | 35 - sandbox/blais/css_tricks/section_based/style.css | 11 - sandbox/davidg/infrastructure/docutils-update | 109 - sandbox/davidg/pysource_reader/en.py | 31 - sandbox/davidg/pysource_reader/nodes.py | 98 - sandbox/dreamcatcher/ChangeLog | 13 - sandbox/dreamcatcher/reportlabs.diff | 1258 ---- sandbox/dreamcatcher/rlpdf/README.txt | 2 - sandbox/dreamcatcher/rlpdf/__init__.py | 5 - sandbox/dreamcatcher/rlpdf/rllicense.txt | 29 - sandbox/dreamcatcher/rlpdf/rlpdf.py | 789 --- sandbox/dreamcatcher/rlpdf/rltemplate.py | 143 - sandbox/dreamcatcher/rlpdf/stylesheet.py | 212 - sandbox/dreamcatcher/tools/pdf.py | 22 - sandbox/grubert/README.txt | 69 - sandbox/grubert/directory_structur | 24 - sandbox/grubert/docutils.sty | 54 - sandbox/grubert/latex.py | 23 - sandbox/grubert/latex/__init__.py | 1 - sandbox/grubert/latex2e-README.txt | 173 - sandbox/grubert/ltx-test.txt | 476 -- sandbox/grubert/making_a_writer.txt | 133 - sandbox/grubert/pdf1 | 24 - sandbox/grubert/pdftest_1.txt | 127 - sandbox/grubert/pdftest_2.txt | 49 - sandbox/grubert/rllicense.txt | 29 - sandbox/grubert/rlpdf/README.txt | 2 - sandbox/grubert/rlpdf/__init__.py | 5 - sandbox/grubert/rlpdf/rlpdf.py | 671 -- sandbox/grubert/rlpdf/rltemplate.py | 143 - sandbox/grubert/rlpdf/stylesheet.py | 158 - sandbox/grubert/runtest | 131 - sandbox/grubert/style.tex | 21 - sandbox/grubert/tools/pdf.py | 22 - sandbox/gschwant/docfactory/LICENSE.txt | 32 - sandbox/gschwant/docfactory/NOTES.txt | 52 - sandbox/gschwant/docfactory/README.txt | 434 -- sandbox/gschwant/docfactory/createdoc.py | 25 - sandbox/gschwant/docfactory/doc/FAQ.txt | 52 - sandbox/gschwant/docfactory/doc/HISTORY.txt | 67 - sandbox/gschwant/docfactory/doc/docutils.conf | 12 - sandbox/gschwant/docfactory/doc/downloads.txt | 11 - sandbox/gschwant/docfactory/doc/head.html | 8 - sandbox/gschwant/docfactory/doc/index.html | 24 - sandbox/gschwant/docfactory/doc/navigation_l.html | 68 - sandbox/gschwant/docfactory/doc/pics/DF.png | Bin 82144 -> 0 bytes .../gschwant/docfactory/doc/pics/screenshot1.jpg | Bin 163761 -> 0 bytes .../gschwant/docfactory/doc/pics/screenshot2.jpg | Bin 61033 -> 0 bytes sandbox/gschwant/docfactory/doc/screenshots.txt | 11 - sandbox/gschwant/docfactory/doc/start.txt | 26 - sandbox/gschwant/docfactory/doc/stylesheets/df.css | 411 -- .../docfactory/doc/stylesheets/navigation_l.css | 38 - sandbox/gschwant/docfactory/docfactory.ico | Bin 3638 -> 0 bytes sandbox/gschwant/docfactory/docfactory.py | 10 - sandbox/gschwant/docfactory/docfactory2exe.py | 17 - sandbox/gschwant/docfactory/docutils.conf | 12 - sandbox/gschwant/docfactory/factory/.cvsignore | 1 - sandbox/gschwant/docfactory/factory/__init__.py | 0 sandbox/gschwant/docfactory/factory/browser.py | 198 - sandbox/gschwant/docfactory/factory/controls.py | 183 - sandbox/gschwant/docfactory/factory/dialogs.py | 853 --- .../gschwant/docfactory/factory/docutilsadapter.py | 112 - sandbox/gschwant/docfactory/factory/images.py | 460 -- sandbox/gschwant/docfactory/factory/main.py | 1707 ----- sandbox/gschwant/docfactory/factory/stylesheets.py | 528 -- sandbox/gschwant/docfactory/factory/throbimages.py | 7340 -------------------- sandbox/gschwant/docfactory/setup.py | 39 - sandbox/gschwant/htmlnav/README.txt | 183 - sandbox/gschwant/htmlnav/rst2htmlnav.py | 19 - sandbox/gschwant/htmlnav/setup.py | 21 - sandbox/gschwant/htmlnav/writer/htmlnav.py | 193 - sandbox/ianb/extractor/default.css | 245 - sandbox/ianb/extractor/extractor.py | 339 - sandbox/ianb/wiki/Wiki.py | 251 - sandbox/ianb/wiki/docs/Wiki.txt | 54 - sandbox/mly/restblog/Makefile | 36 - sandbox/mly/restblog/README.txt | 5 - sandbox/mly/restblog/date_index.py | 39 - sandbox/mly/restblog/default.css | 43 - sandbox/mly/restblog/keyw_index.py | 3 - sandbox/mly/restblog/main_index.py | 28 - sandbox/mly/restblog/restblog.py | 32 - sandbox/mly/restblog/subj_index.py | 3 - sandbox/mwh/README | 2 - sandbox/mwh/advopostwriter.py | 59 - sandbox/oliverr/docbook/README.txt | 14 - sandbox/oliverr/docbook/rst2docbook.py | 28 - sandbox/oliverr/docbook/setup.py | 24 - sandbox/oliverr/docbook/writer/docbook.py | 1046 --- sandbox/oliverr/ht/README.txt | 20 - sandbox/oliverr/ht/TODO.txt | 10 - sandbox/oliverr/ht/hthtml.py | 134 - sandbox/oliverr/ht/rst2ht.py | 29 - sandbox/paultremblay/README.txt | 36 - sandbox/paultremblay/docutils_nest/README.txt | 238 - sandbox/paultremblay/docutils_nest/configure.py | 146 - .../paultremblay/docutils_nest/data/configure.xml | 9 - sandbox/paultremblay/docutils_nest/doc/README.txt | 236 - .../docutils_nest/docutils_nest/__init__.py | 3 - .../docutils_nest/docutils_nest/inline_to_xml.py | 459 -- .../docutils_nest/docutils_nest/nest_docutils.py | 123 - .../docutils_nest/docutils_nest/nest_utils.py | 181 - .../docutils_nest/docutils_nest/nested_inline.py | 352 - .../docutils_nest/docutils_nest/options_trem.py | 386 - .../docutils_nest/docutils_nest/read_config.py | 143 - .../docutils_nest/docutils_nest/rst_options.py | 106 - .../docutils_nest/docutils_nest/well_formed_xml.py | 73 - sandbox/paultremblay/docutils_nest/options_trem.py | 377 - sandbox/paultremblay/docutils_nest/read_config.py | 144 - .../docutils_nest/scripts/docutils-nest-xml.py | 37 - sandbox/paultremblay/docutils_nest/setup.py | 28 - .../paultremblay/docutils_nest/test_files/test.txt | 10 - sandbox/paultremblay/rst_to_docbook/README.txt | 2 - sandbox/paultremblay/rst_to_docbook/configure.py | 138 - .../paultremblay/rst_to_docbook/data/configure.xml | 5 - .../data/xslt_stylesheets/reStruct_field_names.xsl | 117 - .../reStruct_field_names_tokenize.xsl | 57 - .../data/xslt_stylesheets/reStruct_to_docbook.xsl | 343 - .../xslt_stylesheets/reStructure_to_docbook.xsl | 387 -- .../rst_to_docbook/rst_to_docbook/__init__.py | 3 - .../rst_to_docbook/convert_rst_to_docbook.py | 194 - .../rst_to_docbook/rst_to_docbook/location.py | 6 - .../rst_to_docbook/rst_to_docbook/options_trem.py | 387 -- .../rst_to_docbook/rst_to_docbook/output.xml | 93 - .../rst_to_docbook/rst_to_docbook/read_config.py | 131 - .../rst_to_docbook/rst_to_docbook/xsl_convert.py | 145 - .../rst_to_docbook/scripts/rst2docbook.py | 25 - sandbox/paultremblay/rst_to_docbook/setup.py | 44 - .../test_files/reStructure_docbook_example.rst | 65 - .../rst_to_docbook/test_files/simple.xml | 3 - .../rst_to_docbook/test_files/simple.xsl | 18 - .../rst_to_docbook/test_files/test_simple.rst | 11 - sandbox/pobrien/LinuxFormat/LXFwriter.py | 984 --- sandbox/pobrien/LinuxFormat/__init__.py | 1 - sandbox/pobrien/LinuxFormat/rest2lxf.py | 26 - sandbox/pobrien/OpenOffice/OOdirectives.py | 77 - sandbox/pobrien/OpenOffice/OOtext.py | 707 -- sandbox/pobrien/OpenOffice/OOwriter.py | 780 --- sandbox/pobrien/OpenOffice/__init__.py | 1 - sandbox/pobrien/OpenOffice/rest2oo.py | 53 - sandbox/pobrien/OpenOffice/rest2oopseudo.py | 24 - sandbox/pobrien/OpenOffice/rest2ooxml.py | 27 - sandbox/pobrien/WriterTemplate.py | 1081 --- sandbox/pobrien/dwArticle/__init__.py | 1 - sandbox/richard/ZReST/.cvsignore | 3 - sandbox/richard/ZReST/Makefile | 15 - sandbox/richard/ZReST/README.txt | 45 - sandbox/richard/ZReST/TODO.txt | 6 - sandbox/richard/ZReST/ZReST.py | 288 - sandbox/richard/ZReST/__init__.py | 27 - .../richard/ZReST/dtml/manage_addZReSTForm.dtml | 45 - sandbox/richard/ZReST/dtml/manage_editForm.dtml | 88 - sandbox/richard/ZReST/refresh.txt | 1 - sandbox/richard/ZReST/version.txt | 1 - sandbox/richard/pythonpoint/example_slides.txt | 38 - sandbox/richard/pythonpoint/pythonpoint.py | 328 - sandbox/richard/pythonpoint/readme.txt | 5 - sandbox/simonb/inline_target.txt | 48 - sandbox/tibs/pysource/.cvsignore | 2 - sandbox/tibs/pysource/__init__.py | 5 - sandbox/tibs/pysource/buildhtml.py | 354 - sandbox/tibs/pysource/buildtree.py | 403 -- sandbox/tibs/pysource/doc/readme.rtxt | 189 - sandbox/tibs/pysource/doc/whythis.rtxt | 122 - sandbox/tibs/pysource/group-notes.txt | 220 - sandbox/tibs/pysource/html.py | 1163 ---- sandbox/tibs/pysource/notes/notes.py | 115 - sandbox/tibs/pysource/notes/notes.txt | 7 - sandbox/tibs/pysource/notes/roles.txt | 61 - sandbox/tibs/pysource/notes/scope.txt | 19 - sandbox/tibs/pysource/notes/string.html | 225 - sandbox/tibs/pysource/notes/thoughts.txt | 170 - sandbox/tibs/pysource/pysource.py | 262 - sandbox/tibs/pysource/rjhack.py | 58 - sandbox/tibs/pysource/test/readme.txt | 27 - sandbox/tibs/pysource/test/test.doctest | 12 - sandbox/tibs/pysource/test/test.py | 124 - sandbox/tibs/pysource/test/test.rtxt | 442 -- sandbox/tibs/pysource/test/testassign.py | 12 - sandbox/tibs/pysource/test/testfunc.py | 34 - sandbox/tibs/pysource/test/testinterpreted.py | 44 - sandbox/tibs/pysource/test/testinterpreted2.py | 37 - sandbox/tibs/pysource/test/testsimp.py | 12 - sandbox/tibs/pysource/test/testyield.py | 8 - sandbox/tibs/pysource/transform.py | 358 - sandbox/tibs/pysource/utils.py | 474 -- sandbox/tibs/pysource/visit.py | 2074 ------ sandbox/wilk/french/docutils.conf | 3 - sandbox/wilk/french/quickstart-fr.txt | 375 - web/PyBanner016.png | Bin 720 -> 0 bytes web/default.css | 18 - web/docutils.conf | 4 - web/index.txt | 436 -- web/mirror/setext.txt | 27 - web/rst.png | Bin 1170 -> 0 bytes web/rst.txt | 225 - 424 files changed, 105136 deletions(-) delete mode 100644 docutils/.cvsignore delete mode 100644 docutils/COPYING.txt delete mode 100644 docutils/FAQ.txt delete mode 100644 docutils/HISTORY.txt delete mode 100644 docutils/MANIFEST.in delete mode 100644 docutils/README.txt delete mode 100644 docutils/docs/dev/pysource.dtd delete mode 100644 docutils/docs/dev/pysource.txt delete mode 100644 docutils/docs/dev/rst/alternatives.txt delete mode 100644 docutils/docs/dev/rst/problems.txt delete mode 100644 docutils/docs/dev/semantics.txt delete mode 100644 docutils/docs/dev/todo.txt delete mode 100644 docutils/docs/howto/i18n.txt delete mode 100644 docutils/docs/howto/rst-directives.txt delete mode 100644 docutils/docs/peps/pep-0256.txt delete mode 100644 docutils/docs/peps/pep-0257.txt delete mode 100644 docutils/docs/peps/pep-0258.txt delete mode 100644 docutils/docs/peps/pep-0287.txt delete mode 100644 docutils/docs/ref/doctree.txt delete mode 100644 docutils/docs/ref/docutils.dtd delete mode 100644 docutils/docs/ref/rst/directives.txt delete mode 100644 docutils/docs/ref/rst/introduction.txt delete mode 100644 docutils/docs/ref/rst/restructuredtext.txt delete mode 100644 docutils/docs/ref/rst/roles.txt delete mode 100644 docutils/docs/ref/soextblx.dtd delete mode 100644 docutils/docs/ref/transforms.txt delete mode 100644 docutils/docs/user/latex.txt delete mode 100644 docutils/docs/user/rst/images/ball1.gif delete mode 100644 docutils/docs/user/rst/images/biohazard.png delete mode 100644 docutils/docs/user/rst/images/title.png delete mode 100644 docutils/docs/user/rst/quickref.html delete mode 100644 docutils/docs/user/rst/quickstart.txt delete mode 100644 docutils/docs/user/tools.txt delete mode 100644 docutils/docutils/__init__.py delete mode 100644 docutils/docutils/core.py delete mode 100644 docutils/docutils/frontend.py delete mode 100644 docutils/docutils/io.py delete mode 100644 docutils/docutils/languages/__init__.py delete mode 100644 docutils/docutils/languages/af.py delete mode 100644 docutils/docutils/languages/de.py delete mode 100644 docutils/docutils/languages/en.py delete mode 100644 docutils/docutils/languages/es.py delete mode 100644 docutils/docutils/languages/fr.py delete mode 100644 docutils/docutils/languages/it.py delete mode 100644 docutils/docutils/languages/ru.py delete mode 100644 docutils/docutils/languages/sk.py delete mode 100644 docutils/docutils/languages/sv.py delete mode 100644 docutils/docutils/nodes.py delete mode 100644 docutils/docutils/parsers/__init__.py delete mode 100644 docutils/docutils/parsers/rst/__init__.py delete mode 100644 docutils/docutils/parsers/rst/directives/__init__.py delete mode 100644 docutils/docutils/parsers/rst/directives/admonitions.py delete mode 100644 docutils/docutils/parsers/rst/directives/body.py delete mode 100644 docutils/docutils/parsers/rst/directives/html.py delete mode 100644 docutils/docutils/parsers/rst/directives/images.py delete mode 100644 docutils/docutils/parsers/rst/directives/misc.py delete mode 100644 docutils/docutils/parsers/rst/directives/parts.py delete mode 100644 docutils/docutils/parsers/rst/directives/references.py delete mode 100644 docutils/docutils/parsers/rst/languages/__init__.py delete mode 100644 docutils/docutils/parsers/rst/languages/af.py delete mode 100644 docutils/docutils/parsers/rst/languages/de.py delete mode 100644 docutils/docutils/parsers/rst/languages/en.py delete mode 100644 docutils/docutils/parsers/rst/languages/es.py delete mode 100644 docutils/docutils/parsers/rst/languages/fr.py delete mode 100644 docutils/docutils/parsers/rst/languages/it.py delete mode 100644 docutils/docutils/parsers/rst/languages/ru.py delete mode 100644 docutils/docutils/parsers/rst/languages/sk.py delete mode 100644 docutils/docutils/parsers/rst/languages/sv.py delete mode 100644 docutils/docutils/parsers/rst/states.py delete mode 100644 docutils/docutils/parsers/rst/tableparser.py delete mode 100644 docutils/docutils/readers/__init__.py delete mode 100644 docutils/docutils/readers/pep.py delete mode 100644 docutils/docutils/readers/python/__init__.py delete mode 100644 docutils/docutils/readers/python/moduleparser.py delete mode 100644 docutils/docutils/readers/standalone.py delete mode 100644 docutils/docutils/statemachine.py delete mode 100644 docutils/docutils/transforms/__init__.py delete mode 100644 docutils/docutils/transforms/components.py delete mode 100644 docutils/docutils/transforms/frontmatter.py delete mode 100644 docutils/docutils/transforms/misc.py delete mode 100644 docutils/docutils/transforms/parts.py delete mode 100644 docutils/docutils/transforms/peps.py delete mode 100644 docutils/docutils/transforms/references.py delete mode 100644 docutils/docutils/transforms/universal.py delete mode 100644 docutils/docutils/urischemes.py delete mode 100644 docutils/docutils/utils.py delete mode 100644 docutils/docutils/writers/__init__.py delete mode 100644 docutils/docutils/writers/docutils_xml.py delete mode 100644 docutils/docutils/writers/html4css1.py delete mode 100644 docutils/docutils/writers/latex2e.py delete mode 100644 docutils/docutils/writers/pep_html.py delete mode 100644 docutils/docutils/writers/pseudoxml.py delete mode 100644 docutils/extras/optparse.py delete mode 100644 docutils/extras/roman.py delete mode 100644 docutils/extras/textwrap.py delete mode 100755 docutils/install.py delete mode 100644 docutils/licenses/gpl.txt delete mode 100644 docutils/licenses/python-2-1-1.txt delete mode 100644 docutils/licenses/python-2-2.txt delete mode 100644 docutils/licenses/python-2-3.txt delete mode 100755 docutils/setup.py delete mode 100644 docutils/test/.cvsignore delete mode 100644 docutils/test/DocutilsTestSupport.py delete mode 100755 docutils/test/alltests.py delete mode 100644 docutils/test/difflib.py delete mode 100644 docutils/test/package_unittest.py delete mode 100644 docutils/test/test_language.py delete mode 100755 docutils/test/test_nodes.py delete mode 100644 docutils/test/test_parsers/__init__.py delete mode 100644 docutils/test/test_parsers/test_rst/__init__.py delete mode 100644 docutils/test/test_parsers/test_rst/includes/include9.txt delete mode 100644 docutils/test/test_parsers/test_rst/test_SimpleTableParser.py delete mode 100755 docutils/test/test_parsers/test_rst/test_TableParser.py delete mode 100755 docutils/test/test_parsers/test_rst/test_block_quotes.py delete mode 100755 docutils/test/test_parsers/test_rst/test_bullet_lists.py delete mode 100755 docutils/test/test_parsers/test_rst/test_citations.py delete mode 100755 docutils/test/test_parsers/test_rst/test_comments.py delete mode 100755 docutils/test/test_parsers/test_rst/test_definition_lists.py delete mode 100644 docutils/test/test_parsers/test_rst/test_directives/__init__.py delete mode 100644 docutils/test/test_parsers/test_rst/test_directives/include1.txt delete mode 100644 docutils/test/test_parsers/test_rst/test_directives/include2.txt delete mode 100644 docutils/test/test_parsers/test_rst/test_directives/include3.txt delete mode 100644 docutils/test/test_parsers/test_rst/test_directives/include8.txt delete mode 100644 docutils/test/test_parsers/test_rst/test_directives/include9.txt delete mode 100644 docutils/test/test_parsers/test_rst/test_directives/includes/include4.txt delete mode 100644 docutils/test/test_parsers/test_rst/test_directives/includes/include5.txt delete mode 100644 docutils/test/test_parsers/test_rst/test_directives/includes/more/include6.txt delete mode 100644 docutils/test/test_parsers/test_rst/test_directives/includes/sibling/include7.txt delete mode 100644 docutils/test/test_parsers/test_rst/test_directives/raw1.txt delete mode 100755 docutils/test/test_parsers/test_rst/test_directives/test_admonitions.py delete mode 100755 docutils/test/test_parsers/test_rst/test_directives/test_contents.py delete mode 100755 docutils/test/test_parsers/test_rst/test_directives/test_figures.py delete mode 100755 docutils/test/test_parsers/test_rst/test_directives/test_images.py delete mode 100755 docutils/test/test_parsers/test_rst/test_directives/test_include.py delete mode 100755 docutils/test/test_parsers/test_rst/test_directives/test_meta.py delete mode 100755 docutils/test/test_parsers/test_rst/test_directives/test_raw.py delete mode 100755 docutils/test/test_parsers/test_rst/test_directives/test_replace.py delete mode 100755 docutils/test/test_parsers/test_rst/test_directives/test_rubrics.py delete mode 100755 docutils/test/test_parsers/test_rst/test_directives/test_test_directives.py delete mode 100644 docutils/test/test_parsers/test_rst/test_directives/test_topics.py delete mode 100755 docutils/test/test_parsers/test_rst/test_directives/test_unicode.py delete mode 100755 docutils/test/test_parsers/test_rst/test_directives/test_unknown.py delete mode 100755 docutils/test/test_parsers/test_rst/test_doctest_blocks.py delete mode 100755 docutils/test/test_parsers/test_rst/test_enumerated_lists.py delete mode 100755 docutils/test/test_parsers/test_rst/test_field_lists.py delete mode 100755 docutils/test/test_parsers/test_rst/test_footnotes.py delete mode 100755 docutils/test/test_parsers/test_rst/test_functions.py delete mode 100755 docutils/test/test_parsers/test_rst/test_inline_markup.py delete mode 100644 docutils/test/test_parsers/test_rst/test_interpreted.py delete mode 100755 docutils/test/test_parsers/test_rst/test_literal_blocks.py delete mode 100755 docutils/test/test_parsers/test_rst/test_option_lists.py delete mode 100755 docutils/test/test_parsers/test_rst/test_outdenting.py delete mode 100755 docutils/test/test_parsers/test_rst/test_paragraphs.py delete mode 100755 docutils/test/test_parsers/test_rst/test_section_headers.py delete mode 100755 docutils/test/test_parsers/test_rst/test_substitutions.py delete mode 100755 docutils/test/test_parsers/test_rst/test_tables.py delete mode 100755 docutils/test/test_parsers/test_rst/test_targets.py delete mode 100755 docutils/test/test_parsers/test_rst/test_transitions.py delete mode 100644 docutils/test/test_readers/__init__.py delete mode 100644 docutils/test/test_readers/test_pep/__init__.py delete mode 100644 docutils/test/test_readers/test_pep/test_inline_markup.py delete mode 100644 docutils/test/test_readers/test_pep/test_rfc2822.py delete mode 100644 docutils/test/test_readers/test_python/__init__.py delete mode 100755 docutils/test/test_readers/test_python/showast delete mode 100755 docutils/test/test_readers/test_python/showdoc delete mode 100755 docutils/test/test_readers/test_python/showparse delete mode 100755 docutils/test/test_readers/test_python/showtok delete mode 100644 docutils/test/test_readers/test_python/test_functions.py delete mode 100644 docutils/test/test_readers/test_python/test_parser.py delete mode 100644 docutils/test/test_readers/test_python/test_token_parser.py delete mode 100755 docutils/test/test_statemachine.py delete mode 100644 docutils/test/test_transforms/__init__.py delete mode 100755 docutils/test/test_transforms/test_class.py delete mode 100755 docutils/test/test_transforms/test_contents.py delete mode 100755 docutils/test/test_transforms/test_docinfo.py delete mode 100755 docutils/test/test_transforms/test_doctitle.py delete mode 100644 docutils/test/test_transforms/test_filter.py delete mode 100755 docutils/test/test_transforms/test_final_checks.py delete mode 100755 docutils/test/test_transforms/test_footnotes.py delete mode 100755 docutils/test/test_transforms/test_hyperlinks.py delete mode 100755 docutils/test/test_transforms/test_messages.py delete mode 100644 docutils/test/test_transforms/test_peps.py delete mode 100644 docutils/test/test_transforms/test_sectnum.py delete mode 100755 docutils/test/test_transforms/test_substitutions.py delete mode 100755 docutils/test/test_utils.py delete mode 100644 docutils/test/test_viewlist.py delete mode 100644 docutils/test/test_writers/__init__.py delete mode 100644 docutils/test/test_writers/test_latex2e.py delete mode 100755 docutils/tools/buildhtml.py delete mode 100755 docutils/tools/docutils-xml.py delete mode 100644 docutils/tools/docutils.conf delete mode 100644 docutils/tools/editors/README.txt delete mode 100644 docutils/tools/editors/emacs/restructuredtext.el delete mode 100644 docutils/tools/editors/emacs/rst-html.el delete mode 100644 docutils/tools/editors/emacs/rst-mode.el delete mode 100755 docutils/tools/html.py delete mode 100644 docutils/tools/pep-html-template delete mode 100755 docutils/tools/pep.py delete mode 100755 docutils/tools/pep2html.py delete mode 100755 docutils/tools/publish.py delete mode 100755 docutils/tools/quicktest.py delete mode 100755 docutils/tools/rst2latex.py delete mode 100644 docutils/tools/stylesheets/default.css delete mode 100644 docutils/tools/stylesheets/pep.css delete mode 100755 docutils/tools/unicode2rstsubs.py delete mode 100644 sandbox/README.txt delete mode 100644 sandbox/aahz/OO/Makefile delete mode 100644 sandbox/aahz/OO/OOdirectives.py delete mode 100644 sandbox/aahz/OO/OOtext.py delete mode 100644 sandbox/aahz/OO/OOwriter.py delete mode 100644 sandbox/aahz/OO/graphics_output.py delete mode 100644 sandbox/aahz/OO/open_office.py delete mode 100755 sandbox/aahz/OO/publish.py delete mode 100644 sandbox/bbum/00README.txt delete mode 100644 sandbox/bbum/ChangeLog delete mode 100644 sandbox/bbum/DocArticle/00README.txt delete mode 100644 sandbox/bbum/DocArticle/DocArticle/DocArticleText.py delete mode 100644 sandbox/bbum/DocArticle/DocArticle/__init__.py delete mode 100644 sandbox/bbum/DocArticle/LICENSE.txt delete mode 100755 sandbox/bbum/DocArticle/docarticle.py delete mode 100755 sandbox/bbum/DocArticle/setup.py delete mode 100644 sandbox/blais/css_tricks/README.txt delete mode 100644 sandbox/blais/css_tricks/boxed_titles/castro.png delete mode 100644 sandbox/blais/css_tricks/boxed_titles/clinton.png delete mode 100644 sandbox/blais/css_tricks/boxed_titles/docutils.conf delete mode 100644 sandbox/blais/css_tricks/boxed_titles/index.txt delete mode 100644 sandbox/blais/css_tricks/boxed_titles/style.css delete mode 100644 sandbox/blais/css_tricks/section_based/docutils.conf delete mode 100644 sandbox/blais/css_tricks/section_based/index.txt delete mode 100644 sandbox/blais/css_tricks/section_based/style.css delete mode 100755 sandbox/davidg/infrastructure/docutils-update delete mode 100644 sandbox/davidg/pysource_reader/en.py delete mode 100644 sandbox/davidg/pysource_reader/nodes.py delete mode 100644 sandbox/dreamcatcher/ChangeLog delete mode 100644 sandbox/dreamcatcher/reportlabs.diff delete mode 100644 sandbox/dreamcatcher/rlpdf/README.txt delete mode 100644 sandbox/dreamcatcher/rlpdf/__init__.py delete mode 100644 sandbox/dreamcatcher/rlpdf/rllicense.txt delete mode 100644 sandbox/dreamcatcher/rlpdf/rlpdf.py delete mode 100644 sandbox/dreamcatcher/rlpdf/rltemplate.py delete mode 100644 sandbox/dreamcatcher/rlpdf/stylesheet.py delete mode 100755 sandbox/dreamcatcher/tools/pdf.py delete mode 100644 sandbox/grubert/README.txt delete mode 100644 sandbox/grubert/directory_structur delete mode 100644 sandbox/grubert/docutils.sty delete mode 100755 sandbox/grubert/latex.py delete mode 100644 sandbox/grubert/latex/__init__.py delete mode 100644 sandbox/grubert/latex2e-README.txt delete mode 100644 sandbox/grubert/ltx-test.txt delete mode 100644 sandbox/grubert/making_a_writer.txt delete mode 100755 sandbox/grubert/pdf1 delete mode 100644 sandbox/grubert/pdftest_1.txt delete mode 100644 sandbox/grubert/pdftest_2.txt delete mode 100644 sandbox/grubert/rllicense.txt delete mode 100644 sandbox/grubert/rlpdf/README.txt delete mode 100644 sandbox/grubert/rlpdf/__init__.py delete mode 100644 sandbox/grubert/rlpdf/rlpdf.py delete mode 100644 sandbox/grubert/rlpdf/rltemplate.py delete mode 100644 sandbox/grubert/rlpdf/stylesheet.py delete mode 100755 sandbox/grubert/runtest delete mode 100644 sandbox/grubert/style.tex delete mode 100755 sandbox/grubert/tools/pdf.py delete mode 100644 sandbox/gschwant/docfactory/LICENSE.txt delete mode 100644 sandbox/gschwant/docfactory/NOTES.txt delete mode 100644 sandbox/gschwant/docfactory/README.txt delete mode 100644 sandbox/gschwant/docfactory/createdoc.py delete mode 100644 sandbox/gschwant/docfactory/doc/FAQ.txt delete mode 100644 sandbox/gschwant/docfactory/doc/HISTORY.txt delete mode 100644 sandbox/gschwant/docfactory/doc/docutils.conf delete mode 100644 sandbox/gschwant/docfactory/doc/downloads.txt delete mode 100644 sandbox/gschwant/docfactory/doc/head.html delete mode 100644 sandbox/gschwant/docfactory/doc/index.html delete mode 100644 sandbox/gschwant/docfactory/doc/navigation_l.html delete mode 100644 sandbox/gschwant/docfactory/doc/pics/DF.png delete mode 100644 sandbox/gschwant/docfactory/doc/pics/screenshot1.jpg delete mode 100644 sandbox/gschwant/docfactory/doc/pics/screenshot2.jpg delete mode 100644 sandbox/gschwant/docfactory/doc/screenshots.txt delete mode 100644 sandbox/gschwant/docfactory/doc/start.txt delete mode 100644 sandbox/gschwant/docfactory/doc/stylesheets/df.css delete mode 100644 sandbox/gschwant/docfactory/doc/stylesheets/navigation_l.css delete mode 100644 sandbox/gschwant/docfactory/docfactory.ico delete mode 100755 sandbox/gschwant/docfactory/docfactory.py delete mode 100644 sandbox/gschwant/docfactory/docfactory2exe.py delete mode 100644 sandbox/gschwant/docfactory/docutils.conf delete mode 100644 sandbox/gschwant/docfactory/factory/.cvsignore delete mode 100644 sandbox/gschwant/docfactory/factory/__init__.py delete mode 100644 sandbox/gschwant/docfactory/factory/browser.py delete mode 100644 sandbox/gschwant/docfactory/factory/controls.py delete mode 100644 sandbox/gschwant/docfactory/factory/dialogs.py delete mode 100644 sandbox/gschwant/docfactory/factory/docutilsadapter.py delete mode 100644 sandbox/gschwant/docfactory/factory/images.py delete mode 100755 sandbox/gschwant/docfactory/factory/main.py delete mode 100644 sandbox/gschwant/docfactory/factory/stylesheets.py delete mode 100644 sandbox/gschwant/docfactory/factory/throbimages.py delete mode 100755 sandbox/gschwant/docfactory/setup.py delete mode 100644 sandbox/gschwant/htmlnav/README.txt delete mode 100644 sandbox/gschwant/htmlnav/rst2htmlnav.py delete mode 100644 sandbox/gschwant/htmlnav/setup.py delete mode 100644 sandbox/gschwant/htmlnav/writer/htmlnav.py delete mode 100644 sandbox/ianb/extractor/default.css delete mode 100644 sandbox/ianb/extractor/extractor.py delete mode 100644 sandbox/ianb/wiki/Wiki.py delete mode 100644 sandbox/ianb/wiki/docs/Wiki.txt delete mode 100755 sandbox/mly/restblog/Makefile delete mode 100755 sandbox/mly/restblog/README.txt delete mode 100755 sandbox/mly/restblog/date_index.py delete mode 100755 sandbox/mly/restblog/default.css delete mode 100755 sandbox/mly/restblog/keyw_index.py delete mode 100755 sandbox/mly/restblog/main_index.py delete mode 100755 sandbox/mly/restblog/restblog.py delete mode 100755 sandbox/mly/restblog/subj_index.py delete mode 100644 sandbox/mwh/README delete mode 100644 sandbox/mwh/advopostwriter.py delete mode 100644 sandbox/oliverr/docbook/README.txt delete mode 100644 sandbox/oliverr/docbook/rst2docbook.py delete mode 100644 sandbox/oliverr/docbook/setup.py delete mode 100644 sandbox/oliverr/docbook/writer/docbook.py delete mode 100644 sandbox/oliverr/ht/README.txt delete mode 100644 sandbox/oliverr/ht/TODO.txt delete mode 100644 sandbox/oliverr/ht/hthtml.py delete mode 100644 sandbox/oliverr/ht/rst2ht.py delete mode 100644 sandbox/paultremblay/README.txt delete mode 100644 sandbox/paultremblay/docutils_nest/README.txt delete mode 100644 sandbox/paultremblay/docutils_nest/configure.py delete mode 100644 sandbox/paultremblay/docutils_nest/data/configure.xml delete mode 100644 sandbox/paultremblay/docutils_nest/doc/README.txt delete mode 100644 sandbox/paultremblay/docutils_nest/docutils_nest/__init__.py delete mode 100644 sandbox/paultremblay/docutils_nest/docutils_nest/inline_to_xml.py delete mode 100644 sandbox/paultremblay/docutils_nest/docutils_nest/nest_docutils.py delete mode 100644 sandbox/paultremblay/docutils_nest/docutils_nest/nest_utils.py delete mode 100644 sandbox/paultremblay/docutils_nest/docutils_nest/nested_inline.py delete mode 100644 sandbox/paultremblay/docutils_nest/docutils_nest/options_trem.py delete mode 100644 sandbox/paultremblay/docutils_nest/docutils_nest/read_config.py delete mode 100644 sandbox/paultremblay/docutils_nest/docutils_nest/rst_options.py delete mode 100644 sandbox/paultremblay/docutils_nest/docutils_nest/well_formed_xml.py delete mode 100644 sandbox/paultremblay/docutils_nest/options_trem.py delete mode 100644 sandbox/paultremblay/docutils_nest/read_config.py delete mode 100755 sandbox/paultremblay/docutils_nest/scripts/docutils-nest-xml.py delete mode 100644 sandbox/paultremblay/docutils_nest/setup.py delete mode 100644 sandbox/paultremblay/docutils_nest/test_files/test.txt delete mode 100644 sandbox/paultremblay/rst_to_docbook/README.txt delete mode 100644 sandbox/paultremblay/rst_to_docbook/configure.py delete mode 100644 sandbox/paultremblay/rst_to_docbook/data/configure.xml delete mode 100644 sandbox/paultremblay/rst_to_docbook/data/xslt_stylesheets/reStruct_field_names.xsl delete mode 100644 sandbox/paultremblay/rst_to_docbook/data/xslt_stylesheets/reStruct_field_names_tokenize.xsl delete mode 100644 sandbox/paultremblay/rst_to_docbook/data/xslt_stylesheets/reStruct_to_docbook.xsl delete mode 100644 sandbox/paultremblay/rst_to_docbook/data/xslt_stylesheets/reStructure_to_docbook.xsl delete mode 100644 sandbox/paultremblay/rst_to_docbook/rst_to_docbook/__init__.py delete mode 100644 sandbox/paultremblay/rst_to_docbook/rst_to_docbook/convert_rst_to_docbook.py delete mode 100644 sandbox/paultremblay/rst_to_docbook/rst_to_docbook/location.py delete mode 100644 sandbox/paultremblay/rst_to_docbook/rst_to_docbook/options_trem.py delete mode 100644 sandbox/paultremblay/rst_to_docbook/rst_to_docbook/output.xml delete mode 100644 sandbox/paultremblay/rst_to_docbook/rst_to_docbook/read_config.py delete mode 100644 sandbox/paultremblay/rst_to_docbook/rst_to_docbook/xsl_convert.py delete mode 100644 sandbox/paultremblay/rst_to_docbook/scripts/rst2docbook.py delete mode 100644 sandbox/paultremblay/rst_to_docbook/setup.py delete mode 100644 sandbox/paultremblay/rst_to_docbook/test_files/reStructure_docbook_example.rst delete mode 100644 sandbox/paultremblay/rst_to_docbook/test_files/simple.xml delete mode 100644 sandbox/paultremblay/rst_to_docbook/test_files/simple.xsl delete mode 100644 sandbox/paultremblay/rst_to_docbook/test_files/test_simple.rst delete mode 100644 sandbox/pobrien/LinuxFormat/LXFwriter.py delete mode 100644 sandbox/pobrien/LinuxFormat/__init__.py delete mode 100755 sandbox/pobrien/LinuxFormat/rest2lxf.py delete mode 100644 sandbox/pobrien/OpenOffice/OOdirectives.py delete mode 100644 sandbox/pobrien/OpenOffice/OOtext.py delete mode 100644 sandbox/pobrien/OpenOffice/OOwriter.py delete mode 100644 sandbox/pobrien/OpenOffice/__init__.py delete mode 100755 sandbox/pobrien/OpenOffice/rest2oo.py delete mode 100755 sandbox/pobrien/OpenOffice/rest2oopseudo.py delete mode 100755 sandbox/pobrien/OpenOffice/rest2ooxml.py delete mode 100644 sandbox/pobrien/WriterTemplate.py delete mode 100644 sandbox/pobrien/dwArticle/__init__.py delete mode 100644 sandbox/richard/ZReST/.cvsignore delete mode 100644 sandbox/richard/ZReST/Makefile delete mode 100644 sandbox/richard/ZReST/README.txt delete mode 100644 sandbox/richard/ZReST/TODO.txt delete mode 100644 sandbox/richard/ZReST/ZReST.py delete mode 100644 sandbox/richard/ZReST/__init__.py delete mode 100644 sandbox/richard/ZReST/dtml/manage_addZReSTForm.dtml delete mode 100644 sandbox/richard/ZReST/dtml/manage_editForm.dtml delete mode 100644 sandbox/richard/ZReST/refresh.txt delete mode 100644 sandbox/richard/ZReST/version.txt delete mode 100644 sandbox/richard/pythonpoint/example_slides.txt delete mode 100644 sandbox/richard/pythonpoint/pythonpoint.py delete mode 100644 sandbox/richard/pythonpoint/readme.txt delete mode 100644 sandbox/simonb/inline_target.txt delete mode 100644 sandbox/tibs/pysource/.cvsignore delete mode 100755 sandbox/tibs/pysource/__init__.py delete mode 100755 sandbox/tibs/pysource/buildhtml.py delete mode 100755 sandbox/tibs/pysource/buildtree.py delete mode 100644 sandbox/tibs/pysource/doc/readme.rtxt delete mode 100644 sandbox/tibs/pysource/doc/whythis.rtxt delete mode 100644 sandbox/tibs/pysource/group-notes.txt delete mode 100755 sandbox/tibs/pysource/html.py delete mode 100755 sandbox/tibs/pysource/notes/notes.py delete mode 100644 sandbox/tibs/pysource/notes/notes.txt delete mode 100644 sandbox/tibs/pysource/notes/roles.txt delete mode 100644 sandbox/tibs/pysource/notes/scope.txt delete mode 100755 sandbox/tibs/pysource/notes/string.html delete mode 100644 sandbox/tibs/pysource/notes/thoughts.txt delete mode 100755 sandbox/tibs/pysource/pysource.py delete mode 100755 sandbox/tibs/pysource/rjhack.py delete mode 100644 sandbox/tibs/pysource/test/readme.txt delete mode 100644 sandbox/tibs/pysource/test/test.doctest delete mode 100755 sandbox/tibs/pysource/test/test.py delete mode 100644 sandbox/tibs/pysource/test/test.rtxt delete mode 100755 sandbox/tibs/pysource/test/testassign.py delete mode 100755 sandbox/tibs/pysource/test/testfunc.py delete mode 100755 sandbox/tibs/pysource/test/testinterpreted.py delete mode 100755 sandbox/tibs/pysource/test/testinterpreted2.py delete mode 100755 sandbox/tibs/pysource/test/testsimp.py delete mode 100755 sandbox/tibs/pysource/test/testyield.py delete mode 100755 sandbox/tibs/pysource/transform.py delete mode 100755 sandbox/tibs/pysource/utils.py delete mode 100755 sandbox/tibs/pysource/visit.py delete mode 100644 sandbox/wilk/french/docutils.conf delete mode 100644 sandbox/wilk/french/quickstart-fr.txt delete mode 100644 web/PyBanner016.png delete mode 100644 web/default.css delete mode 100644 web/docutils.conf delete mode 100644 web/index.txt delete mode 100644 web/mirror/setext.txt delete mode 100644 web/rst.png delete mode 100644 web/rst.txt diff --git a/docutils/.cvsignore b/docutils/.cvsignore deleted file mode 100644 index 378eac25d..000000000 --- a/docutils/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -build diff --git a/docutils/COPYING.txt b/docutils/COPYING.txt deleted file mode 100644 index cdeefe248..000000000 --- a/docutils/COPYING.txt +++ /dev/null @@ -1,124 +0,0 @@ -================== - Copying Docutils -================== - -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Date: $Date$ -:Web site: http://docutils.sourceforge.net/ -:Copyright: This document has been placed in the public domain. - -Most of the files included in this project have been placed in the -public domain, and therefore have no license requirements and no -restrictions on copying or usage; see the `Public Domain Dedication`_ -below. There are a few exceptions_, listed below. - -One goal of the Docutils project is to be included in the Python -standard library distribution, at which time it is expected that -copyright will be asserted by the `Python Software Foundation -`_. - - -Public Domain Dedication -======================== - -The persons who have associated their work with this project (the -"Dedicator": David Goodger and the many contributors to the Docutils -project) hereby dedicate the entire copyright, less the exceptions_ -listed below, in the work of authorship known as "Docutils" identified -below (the "Work") to the public domain. - -The primary repository for the Work is the Internet World Wide Web -site . The Work consists of the -files within the "docutils" module of the Docutils project CVS -repository (Internet host cvs.sourceforge.net, filesystem path -/cvsroot/docutils), whose Internet web interface is located at -. -Files dedicated to the public domain may be identified by the -inclusion, near the beginning of each file, of a declaration of the -form:: - - Copyright: This document/module/DTD/stylesheet/file/etc. has been - placed in the public domain. - -Dedicator makes this dedication for the benefit of the public at large -and to the detriment of Dedicator's heirs and successors. Dedicator -intends this dedication to be an overt act of relinquishment in -perpetuity of all present and future rights under copyright law, -whether vested or contingent, in the Work. Dedicator understands that -such relinquishment of all rights includes the relinquishment of all -rights to enforce (by lawsuit or otherwise) those copyrights in the -Work. - -Dedicator recognizes that, once placed in the public domain, the Work -may be freely reproduced, distributed, transmitted, used, modified, -built upon, or otherwise exploited by anyone for any purpose, -commercial or non-commercial, and in any way, including by methods -that have not yet been invented or conceived. - -(This dedication is derived from the text of the `Creative Commons -Public Domain Dedication -`_.) - - -Exceptions -========== - -The exceptions to the `Public Domain Dedication`_ above are: - -* extras/optparse.py, copyright by Gregory P. Ward, released under a - BSD-style license (which can be found in the module's source code). - -* extras/textwrap.py, copyright by Gregory P. Ward and the Python - Software Foundation, released under the `Python 2.3 license`_ - (`local copy`__). - - __ licenses/python-2-3.txt - -* extras/roman.py, copyright by Mark Pilgrim, released under the - `Python 2.1.1 license`_ (`local copy`__). - - __ licenses/python-2-1-1.txt - -* test/difflib.py, copyright by the Python Software Foundation, - released under the `Python 2.2 license`_ (`local copy`__). This - file is included for compatibility with Python versions less than - 2.2; if you have Python 2.2 or higher, difflib.py is not needed and - may be removed. (It's only used to report test failures anyhow; it - isn't installed anywhere. The included file is a pre-generator - version of the difflib.py module included in Python 2.2.) - - __ licenses/python-2-2.txt - -* tools/pep2html.py, copyright by the Python Software Foundation, - released under the `Python 2.2 license`_ (`local copy`__). - - __ licenses/python-2-2.txt - -* tools/editors/emacs/rst-html.el, copyright by Martin Blais, released - under the `GNU General Public License`_ (`local copy`__). - - __ licenses/gpl.txt - -* tools/editors/emacs/rst-mode.el, copyright by Stefan Merten, - released under the `GNU General Public License`_ (`local copy`__). - - __ licenses/gpl.txt - -(Disclaimer: I am not a lawyer.) The BSD license and the Python -licenses are OSI-approved_ and GPL-compatible_. Although complicated -by multiple owners and lots of legalese, the Python license basically -lets you copy, use, modify, and redistribute files as long as you keep -the copyright attribution intact, note any changes you make, and don't -use the owner's name in vain. The BSD license is similar. - -Plaintext versions of all the linked-to licenses are provided in the -licenses_ directory. - -.. _licenses: licenses/ -.. _Python 2.1.1 license: http://www.python.org/2.1.1/license.html -.. _Python 2.2 license: http://www.python.org/2.2/license.html -.. _Python 2.3 license: http://www.python.org/2.3/license.html -.. _GNU General Public License: http://www.gnu.org/copyleft/gpl.html -.. _OSI-approved: http://opensource.org/licenses/ -.. _GPL-compatible: http://www.gnu.org/philosophy/license-list.html diff --git a/docutils/FAQ.txt b/docutils/FAQ.txt deleted file mode 100644 index 327c1ddf5..000000000 --- a/docutils/FAQ.txt +++ /dev/null @@ -1,480 +0,0 @@ -===================================== - Docutils Frequently Asked Questions -===================================== - -:Date: $Date$ -:Web site: http://docutils.sourceforge.net/ -:Copyright: This document has been placed in the public domain. - -.. Please note that until there's a Q&A-specific construct available, - this FAQ will use section titles for questions. Therefore - questions must fit on one line. The title may be a summary of the - question, with the full question in the section body. - - -.. contents:: -.. sectnum:: - - -This is a work in progress. Please feel free to ask questions and/or -provide answers; `send email`__ to the `Docutils-Users mailing -list`__. Project members should feel free to edit the source text -file directly. - -.. _let us know: -__ mailto:docutils-users@lists.sourceforge.net -__ http://lists.sourceforge.net/lists/listinfo/docutils-users - - -Docutils -======== - -What is Docutils? ------------------ - -Docutils_ is a system for processing plaintext documentation into -useful formats, such as HTML, XML, and TeX. It supports multiple -types of input, such as standalone files (implemented), inline -documentation from Python modules and packages (under development), -`PEPs (Python Enhancement Proposals)`_ (implemented), and others as -discovered. - -For an overview of the Docutils project implementation, see `PEP -258`_, "Docutils Design Specification". - -Docutils is implemented in Python_. - -.. _Docutils: http://docutils.sourceforge.net/ -.. _PEPs (Python Enhancement Proposals): - http://www.python.org/peps/pep-0012.html -.. _PEP 258: spec/pep-0258.html -.. _Python: http://www.python.org/ - - -Why is it called "Docutils"? ----------------------------- - -Docutils is short for "Python Documentation Utilities". The name -"Docutils" was inspired by "Distutils", the Python Distribution -Utilities architected by Greg Ward, a component of Python's standard -library. - -The earliest known use of the term "docutils" in a Python context was -a `fleeting reference`__ in a message by Fred Drake on 1999-12-02 in -the Python Doc-SIG mailing list. It was suggested `as a project -name`__ on 2000-11-27 on Doc-SIG, again by Fred Drake, in response to -a question from Tony "Tibs" Ibbs: "What do we want to *call* this -thing?". This was shortly after David Goodger first `announced -reStructuredText`__ on Doc-SIG. - -Tibs used the name "Docutils" for `his effort`__ "to document what the -Python docutils package should support, with a particular emphasis on -documentation strings". Tibs joined the current project (and its -predecessors) and graciously donated the name. - -For more history of reStructuredText and the Docutils project, see `An -Introduction to reStructuredText`_. - -Please note that the name is "Docutils", not "DocUtils" or "Doc-Utils" -or any other variation. - -.. _An Introduction to reStructuredText: spec/rst/introduction.html -__ http://mail.python.org/pipermail/doc-sig/1999-December/000878.html -__ http://mail.python.org/pipermail/doc-sig/2000-November/001252.html -__ http://mail.python.org/pipermail/doc-sig/2000-November/001239.html -__ http://homepage.ntlworld.com/tibsnjoan/docutils/STpy.html - - -Is there a GUI authoring environment for Docutils? --------------------------------------------------- - -DocFactory_ is under development. It uses wxPython and looks very -promising. - -.. _DocFactory: - http://docutils.sf.net/sandbox/gschwant/docfactory/doc/ - - -What is the status of the Docutils project? -------------------------------------------- - -Although useful and relatively stable, Docutils is experimental code, -with APIs and architecture subject to change. - -Our highest priority is to fix bugs as they are reported. So the -latest code from CVS (or `development snapshots`_) is almost always -the most stable (bug-free) as well as the most featureful. - - -What is the Docutils project release policy? --------------------------------------------- - -It ought to be "release early & often", but official releases are a -significant effort and aren't done that often. We have -automatically-generated `development snapshots`_ which always contain -the latest code from CVS. As the project matures, we may formalize on -a stable/development-branch scheme, but we're not using anything like -that yet. - -If anyone would like to volunteer as a release coordinator, please -`contact the project coordinator`_. - -.. _development snapshots: - http://docutils.sf.net/#development-snapshots - -.. _contact the project coordinator: - mailto:goodger@python.org - - -reStructuredText -================ - -What is reStructuredText? -------------------------- - -reStructuredText_ is an easy-to-read, what-you-see-is-what-you-get -plaintext markup syntax and parser system. The reStructuredText -parser is a component of Docutils_. reStructuredText is a revision -and reinterpretation of the StructuredText_ and Setext_ lightweight -markup systems. - -If you are reading this on the web, you can see for yourself. `The -source for this FAQ `_ is written in reStructuredText; open -it in another window and compare them side by side. - -`A ReStructuredText Primer `_ and the `Quick -reStructuredText `_ user reference are a good -place to start. The `reStructuredText Markup Specification -`_ is a detailed technical -specification. - -.. _reStructuredText: http://docutils.sourceforge.net/rst.html -.. _StructuredText: - http://dev.zope.org/Members/jim/StructuredTextWiki/FrontPage/ -.. _Setext: mirror/setext.html - - -Why is it called "reStructuredText"? ------------------------------------- - -The name came from a combination of "StructuredText", one of -reStructuredText's predecessors, with "re": "revised", "reworked", and -"reinterpreted", and as in the ``re.py`` regular expression module. -For a detailed history of reStructuredText and the Docutils project, -see `An Introduction to reStructuredText`_. - - -What's the standard abbreviation for "reStructuredText"? --------------------------------------------------------- - -"RST" and "ReST" (or "reST") are both acceptable. Care should be -taken with capitalization, to avoid confusion with "REST__", an -acronym for "Representational State Transfer". - -The abbreviations "reSTX" and "rSTX"/"rstx" should **not** be used; -they overemphasize reStructuredText's precedessor, Zope's -StructuredText. - -__ http://www.xml.com/pub/a/2002/02/06/rest.html - - -What's the standard filename extension for a reStructuredText file? -------------------------------------------------------------------- - -It's ".txt". Some people would like to use ".rest" or ".rst" or -".restx", but why bother? ReStructuredText source files are meant to -be readable as plaintext, and most operating systems already associate -".txt" with text files. Using a specialized filename extension would -require that users alter their OS settings, which is something that -many users will not be willing or able to do. - - -Are there any reStructuredText editor extensions? -------------------------------------------------- - -There is `some code under development for Emacs`__. - -Extensions for other editors are welcome. - -__ http://docutils.sf.net/tools/editors/emacs/ - - -How can I indicate the document title? Subtitle? -------------------------------------------------- - -A uniquely-adorned section title at the beginning of a document is -treated specially, as the document title. Similarly, a -uniquely-adorned section title immediately after the document title -becomes the document subtitle. For example:: - - This is the Document Title - ========================== - - This is the Document Subtitle - ----------------------------- - - Here's an ordinary paragraph. - -Counterexample:: - - Here's an ordinary paragraph. - - This is *not* a Document Title - ============================== - - The "ordinary paragraph" above the section title - prevents it from becoming the document title. - - -How can I represent esoteric characters (e.g. character entities) in a document? --------------------------------------------------------------------------------- - -For example, say you want an em-dash (XML character entity —, -Unicode character ``\u2014``) in your document: use a real em-dash. -Insert concrete characters (e.g. type a *real* em-dash) into your -input file, using whatever encoding suits your application, and tell -Docutils the input encoding. Docutils uses Unicode internally, so the -em-dash character is a real em-dash internally. - -ReStructuredText has no character entity subsystem; it doesn't know -anything about XML charents. To Docutils, "—" in input text is -7 discrete characters; no interpretation happens. When writing HTML, -the "&" is converted to "&", so in the raw output you'd see -"&mdash;". There's no difference in interpretation for text -inside or outside inline literals or literal blocks -- there's no -character entity interpretation in either case. - -If you can't use a Unicode-compatible encoding and must rely on 7-bit -ASCII, there is a workaround. Files containing character entity set -substitution definitions using the "unicode" directive `are available -`__ (`tarball `__). A description -and instructions for use `are here `__. -Thanks to David Priest for the original idea. Incorporating these -files into Docutils is on the `to-do list `_. - -If you insist on using XML-style charents, you'll have to implement a -pre-processing system to convert to UTF-8 or something. That -introduces complications though; you can no longer *write* about -charents naturally; instead of writing "—" you'd have to write -"&mdash;". - - -How can I generate backticks using a Scandinavian keyboard? ------------------------------------------------------------ - -The use of backticks in reStructuredText is a bit awkward with -Scandinavian keyboards, where the backtick is a "dead" key. To get -one ` character one must press SHIFT-` + SPACE. - -Unfortunately, with all the variations out there, there's no way to -please everyone. For Scandinavian programmers and technical writers, -this is not limited to reStructuredText but affects many languages and -environments. - -Possible solutions include - -* If you have to input a lot of backticks, simply type one in the - normal/awkward way, select it, copy and then paste the rest (CTRL-V - is a lot faster than SHIFT-` + SPACE). - -* Use keyboard macros. - -* Remap the keyboard. The Scandinavian keyboard layout is awkward for - other programming/technical characters too; for example, []{} - etc. are a bit awkward compared to US keyboards. - -If anyone knows of other/better solutions, please `let us know`_. - - -Are there any tools for HTML/XML-to-reStructuredText? (Round-tripping) ------------------------------------------------------------------------ - -People have tossed the idea around, but little if any actual work has -ever been done. There's no reason why reStructuredText should not be -round-trippable to/from XML; any technicalities which prevent -round-tripping would be considered bugs. Whitespace would not be -identical, but paragraphs shouldn't suffer. The tricky parts would be -the smaller details, like links and IDs and other bookkeeping. - -For HTML, true round-tripping may not be possible. Even adding lots -of extra "class" attributes may not be enough. A "simple HTML" to RST -filter is possible -- for some definition of "simple HTML" -- but HTML -is used as dumb formatting so much that such a filter may not be -particularly useful. No general-purpose filter exists. An 80/20 -approach should work though: build a tool that does 80% of the work -automatically, leaving the other 20% for manual tweaks. - - -Are there any Wikis that use reStructuredText syntax? ------------------------------------------------------ - -There are several, with various degrees of completeness. With no -implied endorsement or recommendation, and in no particular order: - -* `Ian Bicking's experimental code `__ -* `MoinMoin `__ has some support; `here's a sample - `__ -* Zope-based `Zwiki `__ -* `StikiWiki `__ - -Please `let us know`_ of any other reStructuredText Wikis. - -The example application for the `Web Framework Shootout -` article is a Wiki using -reStructuredText. - - -Are there any Weblog (Blog) projects that use reStructuredText syntax? ----------------------------------------------------------------------- - -With no implied endorsement or recommendation, and in no particular -order: - -* `Python Desktop Server `__ -* `PyBloxsom `__ - -Please `let us know`_ of any other reStructuredText Blogs. - - -HTML Writer -=========== - -What is the status of the HTML Writer? --------------------------------------- - -The HTML Writer module, ``docutils/writers/html4css1.py``, is a -proof-of-concept reference implementation. While it is a complete -implementation, some aspects of the HTML it produces may be -incompatible with older browsers or specialized applications (such as -web templating). Alternate implementations are welcome. - - -What kind of HTML does it produce? ----------------------------------- - -It produces XHTML compatible with the `HTML 4.01`_ and `XHTML 1.0`_ -specifications. A cascading style sheet ("default.css" by default) is -required for proper viewing with a modern graphical browser. Correct -rendering of the HTML produced depends on the CSS support of the -browser. - -.. _HTML 4.01: http://www.w3.org/TR/html4/ -.. _XHTML 1.0: http://www.w3.org/TR/xhtml1/ - - -What browsers are supported? ----------------------------- - -No specific browser is targeted; all modern graphical browsers should -work. Some older browsers, text-only browsers, and browsers without -full CSS support are known to produce inferior results. Mozilla -(version 1.0 and up) and MS Internet Explorer (version 5.0 and up) are -known to give good results. Reports of experiences with other -browsers are welcome. - - -Unexpected results from tools/html.py: H1, H1 instead of H1, H2. Why? ----------------------------------------------------------------------- - -Here's the question in full: - - I have this text:: - - Heading 1 - ========= - - All my life, I wanted to be H1. - - Heading 1.1 - ----------- - - But along came H1, and so shouldn't I be H2? - No! I'm H1! - - Heading 1.1.1 - ************* - - Yeah, imagine me, I'm stuck at H3! No?!? - - When I run it through tools/html.py, I get unexpected results - (below). I was expecting H1, H2, then H3; instead, I get H1, H1, - H2:: - - ... - - - ... - Heading 1 - - - -
-

Heading 1

<-- first H1 -

All my life, I wanted to be H1.

-
-

Heading 1.1

<-- H1 -

But along came H1, and so now I must be H2.

-
-

Heading 1.1.1

-

Yeah, imagine me, I'm stuck at H3!

- ... - - What gives? - -Check the "class" attribute on the H1 tags, and you will see a -difference. The first H1 is actually ``

``; this is -the document title, and the default stylesheet renders it centered. -There can also be an ``

`` for the document -subtitle. - -If there's only one highest-level section title at the beginning of a -document, it is treated specially, as the document title. (Similarly, -a lone second-highest-level section title may become the document -subtitle.) Rather than use a plain H1 for that, we use ``

`` so that we can use H1 again within the document. Why -do we do this? HTML only has H1-H6, so by making H1 do double duty, -we effectively reserve these tags to provide 6 levels of heading -beyond the single document title. - -HTML is being used for dumb formatting for nothing but final display. -A stylesheet *is required*, and one is provided: -tools/stylesheets/default.css. Of course, you're welcome to roll your -own. - -(Thanks to Mark McEahern for the question and much of the answer.) - - -Why do enumerated lists only use numbers (no letters or roman numerals)? ------------------------------------------------------------------------- - -The rendering of enumerators (the numbers or letters acting as list -markers) is completely governed by the stylesheet, so either the -browser can't find the stylesheet (try using the "--embed-stylesheet" -option), or the browser can't understand it (try a recent Mozilla or -MSIE). - - -Python Source Reader -==================== - -Can I use Docutils for Python auto-documentation? -------------------------------------------------- - -Docstring extraction is still under development. There is most of a -source code parsing module in docutils/readers/python/moduleparser.py. -I (David Goodger) haven't worked on it in a while, but I do plan to -finish it eventually. Ian Bicking wrote an initial front end for my -moduleparser module, in sandbox/ianb/extractor/extractor.py. - - -Miscellaneous -============= - -Is the Docutils document model based on any existing XML models? ----------------------------------------------------------------- - -Not directly, no. It borrows bits from DocBook, HTML, and others. I -(David Goodger) have designed several document models over the years, -and have my own biases. The Docutils document model is designed for -simplicity and extensibility, and has been influenced by the needs of -the reStructuredText markup. diff --git a/docutils/HISTORY.txt b/docutils/HISTORY.txt deleted file mode 100644 index b8ef1a128..000000000 --- a/docutils/HISTORY.txt +++ /dev/null @@ -1,1179 +0,0 @@ -================== - Docutils History -================== - -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Date: $Date$ -:Web site: http://docutils.sourceforge.net/ -:Copyright: This document has been placed in the public domain. - -.. contents:: - -Acknowledgements -================ - -I would like to acknowledge the people who have made a direct impact -on the Docutils project, knowingly or not, in terms of encouragement, -suggestions, criticism, bug reports, code contributions, tasty treats, -and related projects: - - Aahz, David Abrahams, David Ascher, Eric Bellot, Ian Bicking, - Martin Blais, Fred Bremmer, Simon Budig, Bill Bumgarner, Brett - Cannon, Adam Chodorowski, Jason Diamond, William Dode, Fred Drake, - Dethe Elza, Marcus Ertl, Benja Fallenstein, fantasai, Stefane - Fermigier, Jim Fulton, Peter Funk, Jorge Gonzalez, Engelbert - Gruber, Simon Hefti, Doug Hellmann, Juergen Hermann, Jannie - Hofmeyr, Michael Hudson, Marcelo Huerta San Martin, Ludger - Humbert, Jeremy Hylton, Tony Ibbs, Alan Jaffray, Dmitry Jemerov, - Richard Jones, Andreas Jung, Garth Kidd, Nicola Larosa, Daniel - Larsson, Marc-Andre Lemburg, Julien Letessier, Wolfgang Lipp, - Edward Loper, Dallas Mahrt, Ken Manheimer, Vasko Miroslav, Skip - Montanaro, Paul Moore, Nigel W. Moriarty, Mark Nodine, Patrick - K. O'Brien, Michel Pelletier, Sam Penrose, Tim Peters, Pearu - Peterson, Mark Pilgrim, Brett g Porter, David Priest, Jens Quade, - Andy Robinson, Tavis Rudd, Oliver Rutherfurd, Kenichi Sato, Ueli - Schlaepfer, Gunnar Schwant, Bruce Smith, Roman Suzi, tav, Bob - Tolbert, Paul Tremblay, Laurence Tratt, Adrian van den Dries, - Guido van Rossum, Martin von Loewis, Greg Ward, Barry Warsaw, - Edward Welbourne, Ka-Ping Yee, Moshe Zadka - -Thank you! - -(I'm still waiting for contributions of computer equipment and cold -hard cash :-).) Hopefully I haven't forgotten anyone or misspelled -any names; apologies (and please let me know!) if I have. - - -Future Plans -============ - -* The config file layout will be completely overhauled for the 0.4 - release. - -* Include substitution files for character entities, produced by the - tools/unicode2rstsubs.py. As static data, these files could go - inside the docutils package somewhere. - -* Rename front-end tools (perhaps to "rst2*" pattern) and have - setup.py install them. - -* A Python Source Reader component (Python auto-documentation) will be - added as soon as there's enough time, effort, and will. If you'd - like to help, let me know! - - -Changes Since 0.3 -================= - -* docutils/core.py: - - - Catch system messages to stop tracebacks from parsing errors. - - Catch exceptions during processing report & exit without - tracebacks, except when "--traceback" used. - -* docutils/frontend.py: - - - Added "--traceback" & "--no-traceback" options ("traceback" - setting). - -* docutils/io.py: - - - Catch IOErrors when opening source & destination files, report & - exit without tracebacks. - -* docutils/utils.py: - - - Added "level" attribute to SystemMessage exceptions. - -* docutils/languages/af.py: Added to project; Afrikaans - mappings by Jannie Hofmeyr. - -* docutils/languages/ru.py: Added to project; Russian mappings by - Roman Suzi. - -* docutils/parsers/rst/languages/af.py: Added to project; Afrikaans - mappings by Jannie Hofmeyr. - -* docutils/parsers/rst/languages/ru.py: Added to project; Russian - mappings by Roman Suzi. - -* docutils/writers/html4css1.py: - - - Fixed unicode handling of attribute values (bug 760673). - - -Release 0.3 (2003-06-24) -======================== - -General: - -* Renamed "attribute" to "option" for directives/extensions. - -* Renamed transform method "transform" to "apply". - -* Renamed "options" to "settings" for runtime settings (as set by - command-line options). Sometimes "option" (singular) became - "settings" (plural). Some variations below: - - - document.options -> document.settings (stored in other objects as - well) - - option_spec -> settings_spec (not directives though) - - OptionSpec -> SettingsSpec - - cmdline_options -> settings_spec - - relative_path_options -> relative_path_settings - - option_default_overrides -> settings_default_overrides - - Publisher.set_options -> Publisher.get_settings - -Specific: - -* COPYING.txt: Added "Public Domain Dedication". - -* FAQ.txt: Frequently asked questions, added to project. - -* setup.py: - - - Updated with PyPI Trove classifiers. - - Conditional installation of third-party modules. - -* docutils/__init__.py: - - - Bumped version to 0.2.1 to reflect changes to I/O classes. - - Bumped version to 0.2.2 to reflect changes to stylesheet options. - - Factored ``SettingsSpec`` out of ``Component``; separately useful. - - Bumped version to 0.2.3 because of the new "--embed-stylesheet" - option and its effect on the PEP template & writer. - - Bumped version to 0.2.4 due to changes to the PEP template & - stylesheet. - - Bumped version to 0.2.5 to reflect changes to Reporter output. - - Added ``TransformSpec`` class for new transform system. - - Bumped version to 0.2.6 for API changes (renaming). - - Bumped version to 0.2.7 for new ``docutils.core.publish_*`` - convenience functions. - - Added ``Component.component_type`` attribute. - - Bumped version to 0.2.8 because of the internal parser switch from - plain lists to the docutils.statemachine.StringList objects. - - Bumped version to 0.2.9 because of the frontend.py API changes. - - Bumped version to 0.2.10 due to changes to the project layout - (third-party modules removed from the "docutils" package), and - signature changes in ``io.Input``/``io.Output``. - - Changed version to 0.3.0 for release. - -* docutils/core.py: - - - Made ``publish()`` a bit more convenient. - - Generalized ``Publisher.set_io``. - - Renamed ``publish()`` to ``publish_cmdline()``; rearranged its - parameters; improved its docstring. - - Added ``publish_file()`` and ``publish_string()``. - - Factored ``Publisher.set_source()`` and ``.set_destination()`` - out of ``.set_io``. - - Added support for "--dump-pseudo-xml", "--dump-settings", and - "--dump-transforms" hidden options. - - Added ``Publisher.apply_transforms()`` method. - - Added ``Publisher.set_components()`` method; support for - ``publish_*()`` conveninece functions. - - Moved config file processing to docutils/frontend.py. - - Added support for exit status ("exit_level" setting & - ``enable_exit`` parameter for Publisher.publish() and convenience - functions). - -* docutils/frontend.py: - - - Check for & exit on identical source & destination paths. - - Fixed bug with absolute paths & "--config". - - Set non-command-line defaults in ``OptionParser.__init__()``: - ``_source`` & ``_destination``. - - Distributed ``relative_path_settings`` to components; updated - ``OptionParser.populate_from_components()`` to combine it all. - - Require list of keys in ``make_paths_absolute`` (was implicit in - global ``relative_path_settings``). - - Added "--expose-internal-attribute", "--dump-pseudo-xml", - "--dump-settings", and "--dump-transforms" hidden options. - - Removed nasty internals-fiddling ``ConfigParser.get_section`` - code, replaced with correct code. - - Added validation functionality for config files. - - Added "--error-encoding" option/setting, "_disable_config" - internal setting. - - Added encoding validation; updated "--input-encoding" and - "--output-encoding"; added "--error-encoding-error-handler" and - "--output-encoding-error-handler". - - Moved config file processing from docutils/core.py. - - Updated ``OptionParser.populate_from_components`` to handle new - ``SettingsSpec.settings_defaults`` dict. - - Added support for "-" => stdin/stdout. - - Added "exit_level" setting ("--exit" option). - -* docutils/io.py: - - - Split ``IO`` classes into subclasses of ``Input`` and ``Output``. - - Added automatic closing to ``FileInput`` and ``FileOutput``. - - Delayed opening of ``FileOutput`` file until ``write()`` called. - - ``FileOutput.write()`` now returns the encoded output string. - - Try to get path/stream name automatically in ``FileInput`` & - ``FileOutput``. - - Added defaults for source & destination paths. - - Allow for Unicode I/O with an explicit "unicode" encoding. - - Added ``Output.encode()``. - - Removed dependency on runtime settings; pass encoding directly. - - Recognize Unicode strings in ``Input.decode()``. - - Added support for output encoding error handlers. - -* docutils/nodes.py: - - - Added "Invisible" element category class. - - Changed ``Node.walk()`` & ``.walkabout()`` to permit more tree - modification during a traversal. - - Added element classes: ``line_block``, ``generated``, ``address``, - ``sidebar``, ``rubric``, ``attribution``, ``admonition``, - ``superscript``, ``subscript``, ``inline`` - - Added support for lists of nodes to ``Element.insert()``. - - Fixed parent linking in ``Element.replace()``. - - Added new abstract superclass ``FixedTextElement``; adds - "xml:space" attribute. - - Added support for "line" attribute of ``system_message`` nodes. - - Added support for the observer pattern from ``utils.Reporter``. - Added ``parse_messages`` and ``transform_messages`` attributes to - ``document``, removed ``messages``. Added ``note_parse_message`` - and ``note_transform_message`` methods. - - Added support for improved diagnostics: - - - Added "document", "source", and "line" internal attributes to - ``Node``, set by ``Node.setup_child()``. - - Converted variations on ``node.parent = self`` to - ``self.setup_child(node)``. - - Added ``document.current_source`` & ``.current_line`` - attributes, and ``.note_source`` observer method. - - Changed "system_message" output to GNU-Tools format. - - - Added a "rawsource" attribute to the ``Text`` class, for text - before backslash-escape resolution. - - Support for new transform system. - - Reworked ``pending`` element. - - Fixed XML DOM bug (SF #660611). - - Removed the ``interpeted`` element class and added - ``title_reference``, ``abbreviation``, ``acronym``. - - Made substitutions case-sensitive-but-forgiving; moved some code - from the parser. - - Fixed Unicode bug on element attributes (report: William Dode). - -* docutils/optik.py: Removed from project; replaced with - extras/optparse.py and extras/textwrap.py. These will be installed - only if they're not already present in the Python installation. - -* docutils/roman.py: Moved to extras/roman.py; this will be installed - only if it's not already present in the Python installation. - -* docutils/statemachine.py: - - - Factored out ``State.add_initial_transitions()`` so it can be - extended. - - Converted whitespace-specific "blank" and "indent" transitions - from special-case code to ordinary transitions: removed - ``StateMachineWS.check_line()`` & ``.check_whitespace()``, added - ``StateWS.add_initial_transitions()`` method, ``ws_patterns`` & - ``ws_initial_transitions`` attributes. - - Removed ``State.match_transition()`` after merging it into - ``.check_line()``. - - Added ``StateCorrection`` exception. - - Added support for ``StateCorrection`` in ``StateMachine.run()`` - (moved ``TransitionCorrection`` support there too.) - - Changed ``StateMachine.next_line()`` and ``.goto_line()`` to raise - ``EOFError`` instead of ``IndexError``. - - Added ``State.no_match`` method. - - Added support for the Observer pattern, triggered by input line - changes. - - Added ``strip_top`` parameter to - ``StateMachineWS.get_first_known_indented``. - - Made ``context`` a parameter to ``StateMachine.run()``. - - Added ``ViewList`` & ``StringList`` classes; - ``extract_indented()`` becomes ``StringList.get_indented()``. - - Added ``StateMachine.insert_input()``. - - Fixed ViewList slice handling for Python 2.3. Patch from (and - thanks to) Fred Drake. - -* docutils/utils.py: - - - Added a ``source`` attribute to Reporter instances and - ``system_message`` elements. - - Added an observer pattern to ``utils.Reporter`` to keep track of - system messages. - - Fixed bugs in ``relative_path()``. - - Added support for improved diagnostics. - - Moved ``normalize_name()`` to nodes.py (``fully_normalize_name``). - - Added support for encoding Reporter stderr output, and encoding - error handlers. - - Reporter keeps track of the highest level system message yet - generated. - -* docutils/languages: Fixed bibliographic field language lookups. - -* docutils/languages/es.py: Added to project; Spanish mappings by - Marcelo Huerta San Martin. - -* docutils/languages/fr.py: Added to project; French mappings by - Stefane Fermigier. - -* docutils/languages/it.py: Added to project; Italian mappings by - Nicola Larosa. - -* docutils/languages/sk.py: Added to project; Slovak mappings by - Miroslav Vasko. - -* docutils/parser/__init__.py: - - - Added ``Parser.finish_parse()`` method. - -* docutils/parser/rst/__init__.py: - - - Added options: "--pep-references", "--rfc-references", - "--tab-width", "--trim-footnote-reference-space". - -* docutils/parsers/rst/states.py: - - - Changed "title under/overline too short" system messages from INFO - to WARNING, and fixed its insertion location. - - Fixed enumerated list item parsing to allow paragraphs & section - titles to begin with enumerators. - - Converted system messages to use the new "line" attribute. - - Fixed a substitution reference edge case. - - Added support for "--pep-references" and "--rfc-references" - options; reworked ``Inliner`` code to make customization easier. - - Removed field argument parsing. - - Added support for short section title over/underlines. - - Fixed "simple reference name" regexp to ignore text like - "object.__method__"; not an anonymous reference. - - Added support for improved diagnostics. - - Reworked directive API, based on Dethe Elza's contribution. Added - ``Body.parse_directive()``, ``.parse_directive_options()``, - ``.parse_directive_arguments()`` methods. - - Added ``ExtensionOptions`` class, to parse directive options - without parsing field bodies. Factored - ``Body.parse_field_body()`` out of ``Body.field()``, overridden in - ``ExtensionOptions``. - - Improved definition list term/classifier parsing. - - Added warnings for unknown directives. - - Renamed ``Stuff`` to ``Struct``. - - Now flagged as errors: transitions at the beginning or end of - sections, empty sections (except title), and empty documents. - - Updated for ``statemachine.StringList``. - - Enabled recognition of schemeless email addresses in targets. - - Added support for embedded URIs in hyperlink references. - - Added backslash-escapes to inline markup end-string suffix. - - Added support for correct interpreted text processing. - - Fixed nested title parsing (topic, sidebar directives). - - Added special processing of backslash-escaped whitespace (idea - from David Abrahams). - - Made substitutions case-sensitive-but-forgiving; moved some code - to ``docutils.nodes``. - - Added support for block quote attributions. - - Added a kludge to work-around a conflict between the bubble-up - parser strategy and short titles (<= 3 char-long over- & - underlines). Fixes SF bug #738803 "infinite loop with multiple - titles" submitted by Jason Diamond. - - Added explicit interpreted text roles for standard inline markup: - "emphasis", "strong", "literal". - - Implemented "superscript" and "subscript" interpreted text roles. - - Added initial support for "abbreviation" and "acronym" roles; - incomplete. - - Added support for "--trim-footnote-reference-space" option. - - Optional space before colons in directives & hyperlink targets. - -* docutils/parsers/rst/tableparser.py: - - - Fixed a bug that was producing unwanted empty rows in "simple" - tables. - - Detect bad column spans in "simple" tables. - -* docutils/parsers/rst/directives: Updated all directive functions to - new API. - -* docutils/parsers/rst/directives/__init__.py: - - - Added ``flag()``, ``unchanged()``, ``path()``, - ``nonnegative_int()``, ``choice()``, and ``class_option()`` - directive option helper functions. - - Added warnings for unknown directives. - - Return ``None`` for missing directives. - - Added ``register_directive()``, thanks to William Dode and Paul - Moore. - -* docutils/parsers/rst/directives/admonitions.py: - - - Added "admonition" directive. - -* docutils/parsers/rst/directives/body.py: Added to project. Contains - the "topic", "sidebar" (from Patrick O'Brien), "line-block", - "parsed-literal", "rubric", "epigraph", "highlights" and - "pull-quote" directives. - -* docutils/parsers/rst/directives/images.py: - - - Added an "align" attribute to the "image" & "figure" directives - (by Adam Chodorowski). - - Added "class" option to "image", and "figclass" to "figure". - -* docutils/parsers/rst/directives/misc.py: - - - Added "include", "raw", and "replace" directives, courtesy of - Dethe Elza. - - Added "unicode" and "class" directives. - -* docutils/parsers/rst/directives/parts.py: - - - Added the "sectnum" directive; by Dmitry Jemerov. - - Added "class" option to "contents" directive. - -* docutils/parsers/rst/directives/references.py: Added to project. - Contains the "target-notes" directive. - -* docutils/parsers/rst/languages/__init__.py: - - - Return ``None`` from get_language() for missing language modules. - -* docutils/parsers/rst/languages/de.py: Added to project; German - mappings by Engelbert Gruber. - -* docutils/parsers/rst/languages/en.py: - - - Added interpreted text roles mapping. - -* docutils/parsers/rst/languages/es.py: Added to project; Spanish - mappings by Marcelo Huerta San Martin. - -* docutils/parsers/rst/languages/fr.py: Added to project; French - mappings by William Dode. - -* docutils/parsers/rst/languages/it.py: Added to project; Italian - mappings by Nicola Larosa. - -* docutils/parsers/rst/languages/sk.py: Added to project; Slovak - mappings by Miroslav Vasko. - -* docutils/readers/__init__.py: - - - Added support for the observer pattern from ``utils.Reporter``, in - ``Reader.parse`` and ``Reader.transform``. - - Removed ``Reader.transform()`` method. - - Added default parameter values to ``Reader.__init__()`` to make - instantiation easier. - - Removed bogus aliases: "restructuredtext" is *not* a Reader. - -* docutils/readers/pep.py: - - - Added the ``peps.TargetNotes`` transform to the Reader. - - Removed PEP & RFC reference detection code; moved to - parsers/rst/states.py as options (enabled here by default). - - Added support for pre-acceptance PEPs (no PEP number yet). - - Moved ``Inliner`` & made it a class attribute of ``Reader`` for - easy subclassing. - -* docutils/readers/python: Python Source Reader subpackage added to - project, including preliminary versions of: - - - __init__.py - - moduleparser.py: Parser for Python modules. - -* docutils/transforms/__init__.py: - - - Added ``Transformer`` class and completed transform reform. - -* docutils/transforms/frontmatter.py: - - - Improved support for generic fields. - - Fixed bibliographic field language lookups. - -* docutils/transforms/misc.py: Added to project. Miscellaneous - transforms. - -* docutils/transforms/parts.py: - - - Moved the "id" attribute from TOC list items to the references - (``Contents.build_contents()``). - - Added the ``SectNum`` transform; by Dmitry Jemerov. - - Added "class" attribute support to ``Contents``. - -* docutils/transforms/peps.py: - - - Added ``mask_email()`` function, updating to pep2html.py's - functionality. - - Linked "Content-Type: text/x-rst" to PEP 12. - - Added the ``TargetNotes`` PEP-specific transform. - - Added ``TargetNotes.cleanup_callback``. - - Added title check to ``Headers``. - -* docutils/transforms/references.py: - - - Added the ``TargetNotes`` generic transform. - - Split ``Hyperlinks`` into multiple transforms. - - Fixed bug with multiply-indirect references (report: Bruce Smith). - - Added check for circular indirect references. - - Made substitutions case-sensitive-but-forgiving. - -* docutils/transforms/universal.py: - - - Added support for the "--expose-internal-attributes" option. - - Removed ``Pending`` transform classes & data. - -* docutils/writers/__init__.py: - - - Removed ``Writer.transform()`` method. - -* docutils/writers/docutils-xml.py: - - - Added XML and doctype declarations. - - Added "--no-doctype" and "--no-xml-declaration" options. - -* docutils/writers/html4css1.py: - - - "name" attributes only on these tags: a, applet, form, frame, - iframe, img, map. - - Added "name" attribute to in section titles for Netscape 4 - support (bug report: Pearu Peterson). - - Fixed targets (names) on footnote, citation, topic title, - problematic, and system_message nodes (for Netscape 4). - - Changed field names from "" to "". - - Added "@" to "@" encoding to thwart address harvesters. - - Improved the vertical whitespace optimization; ignore "invisible" - nodes (targets, comments, etc.). - - Improved inline literals with ```` around chunks - of text and `` `` for runs of spaces. - - Improved modularity of output; added ``self.body_pre_docinfo`` and - ``self.docinfo`` segments. - - Added support for "line_block", "address" elements. - - Improved backlinks (footnotes & system_messages). - - Improved system_message output. - - Redefined "--stylesheet" as containing an invariant URL, used - verbatim. Added "--stylesheet-path", interpreted w.r.t. the - working directory. - - Added "--footnote-references" option (superscript or brackets). - - Added "--compact-lists" and "--no-compact-lists" options. - - Added "--embed-stylesheet" and "--link-stylesheet" options; - factored out ``HTMLTranslator.get_stylesheet_reference()``. - - Improved field list rendering. - - Added Docutils version to "generator" meta tag. - - Fixed a bug with images; they must be inline, so wrapped in

. - - Improved layout of

 HTML source.
-  - Fixed attribute typo on .
-  - Refined XML prologue.
-  - Support for no stylesheet.
-  - Removed "interpreted" element support.
-  - Added support for "title_reference", "sidebar", "attribution",
-    "rubric", and generic "admonition" elements.
-  - Added "--attribution" option.
-  - Added support for "inline", "subscript", "superscript" elements.
-  - Added initial support for "abbreviation" and "acronym";
-    incomplete.
-
-* docutils/writers/latex2e.py: LaTeX Writer, added by Engelbert Gruber
-  (from the sandbox).
-
-  - Added french.
-  - Double quotes in literal blocks (special treatment for de/ngerman).
-  - Added '--hyperlink-color' option ('0' turns off coloring of links).
-  - Added  "--attribution" option.
-  - Right align attributions. 
-
-* docutils/writers/pep_html.py:
-
-  - Parameterized output encoding in PEP template.
-  - Reworked substitutions from ``locals()`` into ``subs`` dict.
-  - Redefined "--pep-stylesheet" as containing an invariant URL, used
-    verbatim.  Added "--pep-stylesheet-path", interpreted w.r.t. the
-    working directory.
-  - Added an override on the "--footnote-references" option.
-  - Factored out ``HTMLTranslator.get_stylesheet_reference()``.
-  - Added Docutils version to "generator" meta tag.
-  - Added a "DO NOT EDIT THIS FILE" comment to generated HTML.
-
-* docs/tools.txt:
-
-  - Added a "silent" setting for ``buildhtml.py``.
-  - Added a "Getting Help" section.
-  - Rearranged the structure.
-  - Kept up to date, with new settings, command-line options etc.
-  - Added section for ``rst2latex.py`` (Engelbert Gruber).
-  - Converted settings table into a definition list.
-
-* docs/rst/quickstart.txt:
-
-  - Added a table of contents.
-  - Added feedback information.
-  - Added mention of minimum section title underline lengths.
-  - Removed the 4-character minimum for section title underlines.
-
-* docs/rst/quickref.html:
-
-  - Added a "Getting Help" section.
-  - Added a style to make section title backlinks more subtle.
-  - Added mention of minimum section title underline lengths.
-  - Removed the 4-character minimum for section title underlines.
-
-* extras: Directory added to project; contains third-party modules
-  that Docutils depends on (optparse, textwrap, roman).  These are
-  only installed if they're not already present.
-
-* licenses: Directory added to project; contains copies of license
-  files for non-public-domain files.
-
-* spec/doctree.txt:
-
-  - Changed the focus.  It's about DTD elements:  structural
-    relationships, semantics, and external (public) attributes.  Not
-    about the element class library.
-  - Moved some implementation-specific stuff into ``docutils.nodes``
-    docstrings.
-  - Wrote descriptions of all common attributes and parameter
-    entities.  Filled in introductory material.
-  - Working through the element descriptions: 55 down, 37 to go.
-  - Removed "Representation of Horizontal Rules" to
-    spec/rst/alternatives.txt.
-
-* spec/docutils.dtd:
-
-  - Added "generated" inline element.
-  - Added "line_block" body element.
-  - Added "auto" attribute to "title".
-  - Changed content models of "literal_block" and "doctest_block" to
-    ``%text.model``.
-  - Added ``%number;`` attribute type parameter entity.
-  - Changed ``%structural.elements;`` to ``%section.elements``.
-  - Updated attribute types; made more specific.
-  - Added "address" bibliographic element.
-  - Added "line" attribute to ``system_message`` element.
-  - Removed "field_argument" element; "field_name" may contain
-    multiple words and whitespace.
-  - Changed public identifier to docutils.sf.net.
-  - Removed "interpreted" element; added "title_reference",
-    "abbreviation", "acronym".
-  - Removed "refuri" attribute from "footnote_reference" and
-    "citation_reference".
-  - Added "sidebar", "rubric", "attribution", "admonition",
-    "superscript", "subscript", and "inline" elements.
-
-* spec/pep-0256.txt: Converted to reStructuredText & updated.
-
-* spec/pep-0257.txt: Converted to reStructuredText & updated.
-
-* spec/pep-0258.txt: Converted to reStructuredText & updated.
-
-* spec/semantics.txt: Updated with text from a Doc-SIG response to
-  Dallas Mahrt.
-
-* spec/transforms.txt: Added to project.
-
-* spec/howto: Added subdirectory, for developer how-to docs.
-
-* spec/howto/rst-directives.txt: Added to project.  Original by Dethe
-  Elza, edited & extended by David Goodger.
-
-* spec/howto/i18n.txt: Docutils Internationalization.  Added to
-  project.
-
-* spec/rst/alternatives.txt:
-
-  - Added "Doctree Representation of Transitions" from
-    spec/doctree.txt.
-  - Updated "Inline External Targets" & closed the debate.
-  - Added ideas for interpreted text syntax extensions.
-  - Added "Nested Inline Markup" section.
-
-* spec/rst/directives.txt:
-
-  - Added directives: "topic", "sectnum", "target-notes",
-    "line-block", "parsed-literal", "include", "replace", "sidebar",
-    "admonition", "rubric", "epigraph", "highlights", "unicode" and
-    "class".
-  - Formalized descriptions of directive details.
-  - Added an "align" attribute to the "image" & "figure" directives
-    (by Adam Chodorowski).
-  - Added "class" options to "topic", "sidebar", "line-block",
-    "parsed-literal", "contents", and "image"; and "figclass" to
-    "figure".
-
-* spec/rst/interpreted.txt: Added to project.  Descriptions of
-  interpreted text roles.
-
-* spec/rst/introduction.txt:
-
-  - Added pointers to material for new users.
-
-* spec/rst/reStructuredText.txt:
-
-  - Disambiguated comments (just add a newline after the "::").
-  - Updated enumerated list description; added a discussion of the
-    second-line validity checking.
-  - Updated directive description.
-  - Added a note redirecting newbies to the user docs.
-  - Expanded description of inline markup start-strings in non-markup
-    contexts.
-  - Removed field arguments and made field lists a generic construct.
-  - Removed the 4-character minimum for section title underlines.
-  - Clarified term/classifier delimiter & inline markup ambiguity
-    (definition lists).
-  - Added "Embedded URIs".
-  - Updated "Interpreted Text" section.
-  - Added "Character-Level Inline Markup" section.
-
-* test: Continually adding & updating tests.
-
-  - Moved test/test_rst/ to test/test_parsers/test_rst/.
-  - Moved test/test_pep/ to test/test_readers/test_pep/.
-  - Added test/test_readers/test_python/.
-  - Added test/test_writers/ (Engelbert Gruber).
-
-* tools:
-
-  - Made the ``locale.setlocale()`` calls in front ends
-    fault-tolerant.
-
-* tools/buildhtml.py:
-
-  - Added "--silent" option.
-  - Fixed bug with absolute paths & "--config".
-  - Updated for new I/O classes.
-  - Added some exception handling.
-  - Separated publishers' setting defaults; prevents interference.
-  - Updated for new ``publish_file()`` convenience function.
-
-* tools/pep-html-template:
-
-  - Allow for "--embed-stylesheet".
-  - Added Docutils version to "generator" meta tag.
-  - Added a "DO NOT EDIT THIS FILE" comment to generated HTML.
-  - Conform to XHTML spec.
-
-* tools/pep2html.py:
-
-  - Made ``argv`` a parameter to ``main()``.
-  - Added support for "Content-Type:" header & arbitrary PEP formats.
-  - Linked "Content-Type: text/plain" to PEP 9.
-  - Files skipped (due to an error) are not pushed onto the server.
-  - Updated for new I/O classes.
-  - Added ``check_requirements()`` & ``pep_type_error()``.
-  - Added some exception handling.
-  - Updated for new ``publish_string()`` convenience function.
-  - Added a "DO NOT EDIT THIS FILE" comment to generated HTML.
-
-* tools/quicktest.py:
-
-  - Added "-V"/"--version" option.
-
-* tools/rst2latex.py: LaTeX front end, added by Engelbert Gruber.
-
-* tools/unicode2rstsubs.py: Added to project.  Produces character
-  entity files (reSructuredText substitutions) from the MathML master
-  unicode.xml file.
-
-* tools/editors: Support code for editors, added to project.  Contains
-  ``emacs/restructuredtext.el``.
-
-* tools/stylesheets/default.css: Moved into the stylesheets directory.
-
-  - Added style for chunks of inline literals.
-  - Removed margin for first child of table cells.
-  - Right-aligned field list names.
-  - Support for auto-numbered section titles in TOCs.
-  - Increased the size of inline literals () in titles.
-  - Restored the light gray background for inline literals.
-  - Added support for "line_block" elements.
-  - Added style for "address" elements.
-  - Removed "a.footnote-reference" style; doing it with ```` now.
-  - Improved field list rendering.
-  - Vertical whitespace improvements.
-  - Removed "a.target" style.
-
-* tools/stylesheets/pep.css:
-
-  - Fixed nested section margins.
-  - Other changes parallel those of ``../default.css``.
-
-
-Release 0.2 (2002-07-31)
-========================
-
-General:
-
-- The word "component" was being used ambiguously.  From now on,
-  "component" will be used to mean "Docutils component", as in Reader,
-  Writer, Parser, or Transform.  Portions of documents (Table of
-  Contents, sections, etc.)  will be called "document parts".
-- Did a grand renaming: a lot of ``verylongnames`` became
-  ``very_long_names``.
-- Cleaned up imports: no more relative package imports or
-  comma-separated lists of top-level modules.
-- Added support for an option values object which carries default
-  settings and overrides (from command-line options and library use).
-- Added internal Unicode support, and support for both input and
-  output encodings.
-- Added support for the ``docutils.io.IO`` class & subclasses.
-
-Specific:
-
-* docutils/__init__.py:
-
-  - Added ``ApplicationError`` and ``DataError``, for use throughout
-    the package.
-  - Added ``Component`` base class for Docutils components; implements
-    the ``supports`` method.
-  - Added ``__version__`` (thus, ``docutils.__version__``).
-
-* docutils/core.py:
-
-  - Removed many keyword parameters to ``Publisher.__init__()`` and
-    ``publish()``; bundled into an option values object.  Added
-    "argv", "usage", "description", and "option_spec" parameters for
-    command-line support.
-  - Added ``Publisher.process_command_line()`` and ``.set_options()``
-    methods.
-  - Reworked I/O model for ``docutils.io`` wrappers.
-  - Updated ``Publisher.set_options()``; now returns option values
-    object.
-  - Added support for configuration files (/etc/docutils.conf,
-    ./docutils.conf, ~/.docutils).
-  - Added ``Publisher.setup_option_parser()``.
-  - Added default usage message and description.
-
-* docutils/frontend.py: Added to project; support for front-end
-  (command-line) scripts.  Option specifications may be augmented by
-  components.  Requires Optik (http://optik.sf.net/) for option
-  processing (installed locally as docutils/optik.py).
-
-* docutils/io.py: Added to project; uniform API for a variety of input
-  output mechanisms.
-
-* docutils/nodes.py:
-
-  - Added ``TreeCopyVisitor`` class.
-  - Added a ``copy`` method to ``Node`` and subclasses.
-  - Added a ``SkipDeparture`` exception for visitors.
-  - Renamed ``TreePruningException`` from ``VisitorException``.
-  - Added docstrings to ``TreePruningException``, subclasses, and
-    ``Nodes.walk()``.
-  - Improved docstrings.
-  - Added ``SparseNodeVisitor``, refined ``NodeVisitor``.
-  - Moved ``utils.id()`` to ``nodes.make_id()`` to avoid circular
-    imports.
-  - Added ``decoration``, ``header``, and ``footer`` node classes, and
-    ``PreDecorative`` mixin.
-  - Reworked the name/id bookkeeping; to ``document``, removed
-    ``explicit_targets`` and ``implicit_targets`` attributes, added
-    ``nametypes`` attribute and ``set_name_id_map`` method.
-  - Added ``NodeFound`` exception, for use with ``NodeVisitor``
-    traversals.
-  - Added ``document.has_name()`` method.
-  - Fixed DOM generation for list-attributes.
-  - Added category class ``Labeled`` (used by footnotes & citations).
-  - Added ``Element.set_class()`` method (sets "class" attribute).
-
-* docutils/optik.py: Added to project.  Combined from the Optik
-  package, with added option groups and other modifications.  The use
-  of this module is probably only temporary.
-
-* docutils/statemachine.py:
-
-  - Added ``runtime_init`` method to ``StateMachine`` and ``State``.
-  - Added underscores to improve many awkward names.
-  - In ``string2lines()``, changed whitespace normalizing translation
-    table to regexp; restores Python 2.0 compatibility with Unicode.
-
-* docutils/urischemes.py:
-
-  - Filled in some descriptions.
-  - Added "shttp" scheme.
-
-* docutils/utils.py:
-
-  - Added ``clean_rcs_keywords`` function (moved from
-    docutils/transforms/frontmatter.py
-    ``DocInfo.filter_rcs_keywords``).
-  - Added underscores to improve many awkward names.
-  - Changed names of Reporter's thresholds:
-    warning_level -> report_level; error_level -> halt_level.
-  - Moved ``utils.id()`` to ``nodes.make_id()``.
-  - Added ``relative_path(source, target)``.
-
-* docutils/languages/de.py: German mappings; added to project.  Thanks
-  to Gunnar Schwant for the translations.
-
-* docutils/languages/en.py: Added "Dedication" bibliographic field
-  mappings.
-
-* docutils/languages/sv.py: Swedish mappings; added to project by Adam
-  Chodorowski.
-
-* docutils/parsers/rst/states.py:
-
-  - Added underscores to improve many awkward names.
-  - Added RFC-2822 header support.
-  - Extracted the inline parsing code from ``RSTState`` to a separate
-    class, ``Inliner``, which will allow easy subclassing.
-  - Made local bindings for ``memo`` container & often-used contents
-    (reduces code complexity a lot).  See ``RSTState.runtime_init()``.
-  - ``RSTState.parent`` replaces ``RSTState.statemachine.node``.
-  - Added ``MarkupMismatch`` exception; for late corrections.
-  - Added ``-/:`` characters to inline markup's start string prefix,
-    ``/`` to end string suffix.
-  - Fixed a footnote bug.
-  - Fixed a bug with literal blocks.
-  - Applied patch from Simon Budig: simplified regexps with symbolic
-    names, removed ``Inliner.groups`` and ``Body.explicit.groups``.
-  - Converted regexps from ``'%s' % var`` to ``'%(var)s' % locals()``.
-  - Fixed a bug in ``Inliner.interpreted_or_phrase_ref()``.
-  - Allowed non-ASCII in "simple names" (directive names, field names,
-    references, etc.).
-  - Converted ``Inliner.patterns.initial`` to be dynamically built
-    from parts with ``build_regexp()`` function.
-  - Changed ``Inliner.inline_target`` to ``.inline_internal_target``.
-  - Updated docstrings.
-  - Changed "table" to "grid_table"; added "simple_table" support.
-
-* docutils/parsers/rst/tableparser.py:
-
-  - Changed ``TableParser`` to ``GridTableParser``.
-  - Added ``SimpleTableParser``.
-  - Refactored naming.
-
-* docutils/parsers/rst/directives/__init__.py: Added "en" (English) as
-  a fallback language for directive names.
-
-* docutils/parsers/rst/directives/html.py: Changed the ``meta``
-  directive to use a ``pending`` element, used only by HTML writers.
-
-* docutils/parsers/rst/directives/parts.py: Renamed from
-  components.py.
-
-  - Added "backlinks" attribute to "contents" directive.
-
-* docutils/parsers/rst/languages/sv.py: Swedish mappings; added to
-  project by Adam Chodorowski.
-
-* docutils/readers/__init__.py: Gave Readers more control over
-  choosing and instantiating Parsers.
-
-* docutils/readers/pep.py: Added to project; for PEP processing.
-
-* docutils/transforms/__init__.py: ``Transform.__init__()`` now
-  requires a ``component`` parameter.
-
-* docutils/transforms/components.py: Added to project; transforms
-  related to Docutils components.
-
-* docutils/transforms/frontmatter.py:
-
-  - In ``DocInfo.extract_authors``, check for a single "author" in an
-    "authors" group, and convert it to a single "author" element.
-  - Added support for "Dedication" and generic bibliographic fields.
-
-* docutils/transforms/peps.py: Added to project; PEP-specific.
-
-* docutils/transforms/parts.py: Renamed from old components.py.
-
-  - Added filter for `Contents`, to use alt-text for inline images,
-    and to remove inline markup that doesn't make sense in the ToC.
-  - Added "name" attribute to TOC topic depending on its title.
-  - Added support for optional TOC backlinks.
-
-* docutils/transforms/references.py: Fixed indirect target resolution
-  in ``Hyperlinks`` transform.
-
-* docutils/transforms/universal.py:
-
-  - Changed ``Messages`` transform to properly filter out system
-    messages below the warning threshold.
-  - Added ``Decorations`` transform (support for ``--generator``,
-    ``--date``, ``--time``, ``--source-link`` options).
-
-* docutils/writers/__init__.py: Added "pdf" alias in anticipation of
-  Engelbert Gruber's PDF writer.
-
-* docutils/writers/html4css1.py:
-
-  - Made XHTML-compatible (switched to lowercase element & attribute
-    names; empty tag format).
-  - Escape double-dashes in comment text.
-  - Improved boilerplate & modularity of output.
-  - Exposed modular output in Writer class.
-  - Added a "generator" meta tag to .
-  - Added support for the ``--stylesheet`` option.
-  - Added support for ``decoration``, ``header``, and ``footer``
-    elements.
-  - In ``HTMLTranslator.attval()``, changed whitespace normalizing
-    translation table to regexp; restores Python 2.0 compatibility
-    with Unicode.
-  - Added the translator class as instance variable to the Writer, to
-    make it easily subclassable.
-  - Improved option list spacing (thanks to Richard Jones).
-  - Modified field list output.
-  - Added backlinks to footnotes & citations.
-  - Added percentage widths to "" tags (from colspec).
-  - Option lists: "" changed to "", ``option_argument``
-    "" changed to "".
-  - Inline literals: "" changed to "".
-  - Many changes to optimize vertical space: compact simple lists etc.
-  - Add a command-line options & directive attributes to control TOC
-    and footnote/citation backlinks.
-  - Added support for optional footnote/citation backlinks.
-  - Added support for generic bibliographic fields.
-  - Identify backrefs.
-  - Relative URLs for stylesheet links.
-
-* docutils/writers/pep_html.py: Added to project; HTML Writer for
-  PEPs (subclass of ``html4css1.Writer``).
-
-* docutils/writers/pseudoxml.py: Renamed from pprint.py.
-
-* docutils/writers/docutils_xml.py: Added to project; trivial writer
-  of the Docutils internal doctree in XML.
-
-* docs/tools.txt: "Docutils Front-End Tools", added to project.
-
-* spec/doctree.txt:
-
-  - Changed the title to "The Docutils Document Tree".
-  - Added "Hyperlink Bookkeeping" section.
-
-* spec/docutils.dtd:
-
-  - Added ``decoration``, ``header``, and ``footer`` elements.
-  - Brought ``interpreted`` element in line with the parser: changed
-    attribute "type" to "role", added "position".
-  - Added support for generic bibliographic fields.
-
-* spec/notes.txt: Continual updates.  Added "Project Policies".
-
-* spec/pep-0256.txt:  Updated.  Added "Roadmap to the Doctring PEPs"
-  section.
-
-* spec/pep-0257.txt: Clarified prohibition of signature repetition.
-
-* spec/pep-0258.txt: Updated.  Added text from pysource.txt and
-  mailing list discussions.
-
-* spec/pep-0287.txt:
-
-  - Renamed to "reStructuredText Docstring Format".
-  - Minor edits.
-  - Reworked Q&A as an enumerated list.
-  - Converted to reStructuredText format.
-
-* spec/pysource.dtd:
-
-  - Reworked structural elements, incorporating ideas from Tony Ibbs.
-
-* spec/pysource.txt: Removed from project.  Moved much of its contents
-  to pep-0258.txt.
-
-* spec/rst/alternatives.txt:
-
-  - Expanded auto-enumerated list idea; thanks to Fred Bremmer.
-  - Added "Inline External Targets" section.
-
-* spec/rst/directives.txt:
-
-  - Added "backlinks" attribute to "contents" directive.
-
-* spec/rst/problems.txt:
-
-  - Updated the Enumerated List Markup discussion.
-  - Added new alternative table markup syntaxes.
-
-* spec/rst/reStructuredText.txt:
-
-  - Clarified field list usage.
-  - Updated enumerated list description.
-  - Clarified purpose of directives.
-  - Added ``-/:`` characters to inline markup's start string prefix,
-    ``/`` to end string suffix.
-  - Updated "Authors" bibliographic field behavior.
-  - Changed "inline hyperlink targets" to "inline internal targets".
-  - Added "simple table" syntax to supplement the existing but
-    newly-renamed "grid tables".
-  - Added cautions for anonymous hyperlink use.
-  - Added "Dedication" and generic bibliographic fields.
-
-* test: Made test modules standalone (subdirectories became packages).
-
-* test/DocutilsTestSupport.py:
-
-  - Added support for PEP extensions to reStructuredText.
-  - Added support for simple tables.
-  - Refactored naming.
-
-* test/package_unittest.py: Renamed from UnitTestFolder.py.
-
-  - Now supports true packages containing test modules
-    (``__init__.py`` files required); fixes duplicate module name bug.
-
-* test/test_pep/: Subpackage added to project; PEP testing.
-
-* test/test_rst/test_SimpleTableParser.py: Added to project.
-
-* tools:
-
-  - Updated html.py and publish.py front-end tools to use the new
-    command-line processing facilities of ``docutils.frontend``
-    (exposed in ``docutils.core.Publisher``), reducing each to just a
-    few lines of code.
-  - Added ``locale.setlocale()`` calls to front-end tools.
-
-* tools/buildhtml.py: Added to project; batch-generates .html from all
-  the .txt files in directories and subdirectories.
-
-* tools/default.css:
-
-  - Added support for ``header`` and ``footer`` elements.
-  - Added styles for "Dedication" topics (biblio fields).
-
-* tools/docutils.conf: A configuration file; added to project.
-
-* tools/docutils-xml.py: Added to project.
-
-* tools/pep.py: Added to project; PEP to HTML front-end tool.
-
-* tools/pep-html-template: Added to project.
-
-* tools/pep2html.py: Added to project from Python (nondist/peps).
-  Added support for Docutils (reStructuredText PEPs).
-
-* tools/quicktest.py:
-
-  - Added the ``--attributes`` option, hacked a bit.
-  - Added a second command-line argument (output file); cleaned up.
-
-* tools/stylesheets/: Subdirectory added to project.
-
-* tools/stylesheets/pep.css: Added to project; stylesheet for PEPs.
-
-
-Release 0.1 (2002-04-20)
-========================
-
-This is the first release of Docutils, merged from the now inactive
-reStructuredText__ and `Docstring Processing System`__ projects.  For
-the pre-Docutils history, see the `reStructuredText HISTORY`__ and the
-`DPS HISTORY`__ files.
-
-__ http://structuredtext.sourceforge.net/
-__ http://docstring.sourceforge.net/
-__ http://structuredtext.sourceforge.net/HISTORY.html
-__ http://docstring.sourceforge.net/HISTORY.html
-
-General changes: renamed 'dps' package to 'docutils'; renamed
-'restructuredtext' subpackage to 'rst'; merged the codebases; merged
-the test suites (reStructuredText's test/test_states renamed to
-test/test_rst); and all modifications required to make it all work.
-
-* docutils/parsers/rst/states.py:
-
-  - Improved diagnostic system messages for missing blank lines.
-  - Fixed substitution_reference bug.
-
-
-..
-   Local Variables:
-   mode: indented-text
-   indent-tabs-mode: nil
-   sentence-end-double-space: t
-   fill-column: 70
-   End:
diff --git a/docutils/MANIFEST.in b/docutils/MANIFEST.in
deleted file mode 100644
index 0c4105833..000000000
--- a/docutils/MANIFEST.in
+++ /dev/null
@@ -1,10 +0,0 @@
-include *.txt
-include *.py
-recursive-include docutils *
-recursive-include docs *
-recursive-include extras *
-recursive-include licenses *
-recursive-include spec *
-recursive-include test *
-recursive-include tools *
-recursive-exclude * .cvsignore *.pyc *~
diff --git a/docutils/README.txt b/docutils/README.txt
deleted file mode 100644
index 9b0823c23..000000000
--- a/docutils/README.txt
+++ /dev/null
@@ -1,330 +0,0 @@
-==================
- README: Docutils
-==================
-
-:Author: David Goodger
-:Contact: goodger@users.sourceforge.net
-:Date: $Date$
-:Web site: http://docutils.sourceforge.net/
-:Copyright: This document has been placed in the public domain.
-
-.. contents::
-
-
-Thank you for downloading the Python Docutils project archive.  As
-this is a work in progress, please check the project website for
-updated working files (snapshots).  This project should be considered
-highly experimental; APIs are subject to change at any time.
-
-
-Quick-Start
-===========
-
-This is for those who want to get up & running quickly.  Read on for
-complete details.
-
-1. Get and install the latest release of Python, available from
-
-       http://www.python.org/
-
-   Python 2.2 or later [#py21]_ is required; Python 2.2.2 or later is
-   recommended.
-
-2. Use the latest Docutils code.  Get the code from CVS or from the
-   snapshot:
-
-       http://docutils.sf.net/docutils-snapshot.tgz
-
-   See `Releases & Snapshots`_ below for details.
-
-3. Unpack the tarball and install with the standard ::
-
-       python setup.py install
-
-   See Installation_ below for details.
-
-4. Use a front-end tool from the "tools" subdirectory of the same
-   directory as in step 3.  For example::
-
-       cd tools
-       html.py test.txt test.html
-
-   See Usage_ below for details.
-
-
-Purpose
-=======
-
-The purpose of the Docutils project is to create a set of tools for
-processing plaintext documentation into useful formats, such as HTML,
-XML, and TeX.  Support for the following sources has been implemented:
-
-* Standalone files.
-
-* `PEPs (Python Enhancement Proposals)`_.
-
-Support for the following sources is planned:
-
-* Inline documentation from Python modules and packages, extracted
-  with namespace context.  **This is the focus of the current
-  development effort.**
-
-* Email (RFC-822 headers, quoted excerpts, signatures, MIME parts).
-
-* Wikis, with global reference lookups of "wiki links".
-
-* Compound documents, such as multiple chapter files merged into a
-  book.
-
-* And others as discovered.
-
-.. _PEPs (Python Enhancement Proposals):
-   http://www.python.org/peps/pep-0012.html
-
-
-Releases & Snapshots
-====================
-
-Putting together an official "Release" of Docutils is a significant
-effort, so it isn't done that often.  In the meantime, the CVS
-snapshots always contain the latest code and documentation, usually
-updated within an hour of changes being committed to the repository,
-and usually bug-free:
-
-* Snapshot of Docutils code, front-end tools, tests, documentation,
-  and specifications: http://docutils.sf.net/docutils-snapshot.tgz
-
-* Snapshot of the Sandbox (experimental, contributed code):
-  http://docutils.sf.net/docutils-sandbox-snapshot.tgz
-
-* Snapshot of web files (the files that generate the web site):
-  http://docutils.sf.net/docutils-web-snapshot.tgz
-
-To keep up to date on the latest developments, download fresh copies
-of the snapshots regularly.  New functionality is being added weekly,
-sometimes daily.  (There's also the CVS repository, and a mailing list
-for CVS messages.  See the web site [address above] or spec/notes.txt
-for details.)
-
-
-Requirements
-============
-
-To run the code, Python 2.2 or later [#py21]_ must already be
-installed.  The latest release is recommended (2.2.2 as of this
-writing).  Python is available from http://www.python.org/.
-
-.. [#py21] Python 2.1 may be used providing the compiler package is
-   installed.  The compiler package can be found in the Tools/
-   directory of Python 2.1's source distribution.
-
-
-Project Files & Directories
-===========================
-
-* README.txt: You're reading it.
-
-* COPYING.txt: Public Domain Dedication and copyright details for
-  non-public-domain files (most are PD).
-
-* FAQ.txt: Docutils Frequently Asked Questions.
-
-* HISTORY.txt: Release notes for the current and previous project
-  releases.
-
-* setup.py: Installation script.  See "Installation" below.
-
-* install.py: Quick & dirty installation script.  Just run it.
-
-* docutils: The project source directory, installed as a Python
-  package.
-
-* extras: Directory for third-party modules that Docutils depends on.
-  These are only installed if they're not already present.
-
-* docs: The project user documentation directory.  Contains the
-  following documents:
-
-  - docs/tools.txt: Docutils Front-End Tools
-  - docs/latex.txt: Docutils LaTeX Writer
-  - docs/rst/quickstart.txt: A ReStructuredText Primer
-  - docs/rst/quickref.html: Quick reStructuredText (HTML only)
-
-* licenses: Directory containing copies of license files for
-  non-public-domain files.
-
-* spec: The project specification directory.  Contains PEPs (Python
-  Enhancement Proposals), XML DTDs (document type definitions), and
-  other documents.  The ``spec/rst`` directory contains the
-  reStructuredText specification.  The ``spec/howto`` directory
-  contains How-To documents for developers.
-
-* tools: Directory for Docutils front-end tools.  See docs/tools.txt
-  for documentation.
-
-* test: Unit tests.  Not required to use the software, but very useful
-  if you're planning to modify it.  See `Running the Test Suite`_
-  below.
-
-
-Installation
-============
-
-The first step is to expand the ``.tar.gz`` or ``.tgz`` archive.  It
-contains a distutils setup file "setup.py".  OS-specific installation
-instructions follow.
-
-
-GNU/Linux, BSDs, Unix, Mac OS X, etc.
--------------------------------------
-
-1. Open a shell.
-
-2. Go to the directory created by expanding the archive::
-
-       cd 
-
-3. Install the package::
-
-       python setup.py install
-
-   If the python executable isn't on your path, you'll have to specify
-   the complete path, such as /usr/local/bin/python.  You may need
-   root permissions to complete this step.
-
-You can also just run install.py; it does the same thing.
-
-
-Windows
--------
-
-1. Open a DOS box (Command Shell, MSDOS Prompt, or whatever they're
-   calling it these days).
-
-2. Go to the directory created by expanding the archive::
-
-       cd 
-
-3. Install the package::
-
-       \python setup.py install
-
-If your system is set up to run Python when you double-click on .py
-files, you can run install.py to do the same as the above.
-
-
-Mac OS 8/9
-----------
-
-1. Open the folder containing the expanded archive.
-
-2. Double-click on the file "setup.py", which should be a "Python
-   module" file.
-
-   If the file isn't a "Python module", the line endings are probably
-   also wrong, and you will need to set up your system to recognize
-   ".py" file extensions as Python files.  See
-   http://gotools.sourceforge.net/mac/python.html for detailed
-   instructions.  Once set up, it's easiest to start over by expanding
-   the archive again.
-
-3. The distutils options window will appear.  From the "Command" popup
-   list choose "install", click "Add", then click "OK".
-
-If install.py is a "Python module" (see step 2 above if it isn't), you
-can run it (double-click) instead of the above.  The distutils options
-window will not appear.
-
-
-Usage
-=====
-
-After unpacking and installing the Docutils package, the following
-shell commands will generate HTML for all included documentation::
-
-    cd /tools
-    buildhtml.py ../
-
-The final directory name of the ```` is
-"docutils" for snapshots.  For official releases, the directory may be
-called "docutils-X.Y", where "X.Y" is the release version.
-Alternatively::
-
-    cd 
-    tools/buildhtml.py --config=tools/docutils.conf
-
-Some files may generate system messages (warnings and errors).  The
-``tools/test.txt`` file (under the archive directory) contains 5
-intentional errors.  (They test the error reporting mechanism!)
-
-There are many front-end tools in the unpacked "tools" subdirectory.
-You may want to begin with the "html.py" front-end tool.  Most tools
-take up to two arguments, the source path and destination path, with
-STDIN and STDOUT being the defaults.  Use the "--help" option to the
-front-end tools for details on options and arguments.  See `Docutils
-Front-End Tools`_ (``docs/tools.txt``) for full documentation.
-
-The package modules are continually growing and evolving.  The
-``docutils.statemachine`` module is usable independently.  It contains
-extensive inline documentation (in reStructuredText format of course).
-
-Contributions are welcome!
-
-.. _Docutils Front-End Tools: docs/tools.html
-
-
-Running the Test Suite
-======================
-
-To run the entire test suite, after installation_ open a shell and use
-the following commands::
-
-    cd /test
-    ./alltests.py
-
-You should see a long line of periods, one for each test, and then a
-summary like this::
-
-    Ran 518 tests in 24.653s
-
-    OK
-    Elapsed time: 26.189 seconds
-
-The number of tests will grow over time, and the times reported will
-depend on the computer running the tests.  The difference between the
-two times represents the time required to set up the tests (import
-modules, create data structures, etc.).
-
-If any of the tests fail, please `open a bug report`_ or `send
-email`_.  Please include all relevant output, information about your
-operating system, Python version, and Docutils version.  To see the
-Docutils version, use these commands::
-
-    cd ../tools
-    ./quicktest.py --version
-
-.. _open a bug report:
-   http://sourceforge.net/tracker/?group_id=38414&atid=422030
-.. _send email: mailto:docutils-users@lists.sourceforge.net
-   ?subject=Docutils%20test%20suite%20failure
-
-
-Getting Help
-============
-
-If you have questions or need assistance with Docutils or
-reStructuredText, please `post a message`_ to the `Docutils-Users
-mailing list`_.
-
-.. _post a message: mailto:docutils-users@lists.sourceforge.net
-.. _Docutils-Users mailing list:
-   http://lists.sourceforge.net/lists/listinfo/docutils-users
-
-
-..
-   Local Variables:
-   mode: indented-text
-   indent-tabs-mode: nil
-   sentence-end-double-space: t
-   fill-column: 70
-   End:
diff --git a/docutils/docs/dev/pysource.dtd b/docutils/docs/dev/pysource.dtd
deleted file mode 100644
index 79a074cec..000000000
--- a/docutils/docs/dev/pysource.dtd
+++ /dev/null
@@ -1,258 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-%docutils;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docutils/docs/dev/pysource.txt b/docutils/docs/dev/pysource.txt
deleted file mode 100644
index ab677a004..000000000
--- a/docutils/docs/dev/pysource.txt
+++ /dev/null
@@ -1,130 +0,0 @@
-======================
- Python Source Reader
-======================
-:Author: David Goodger
-:Contact: goodger@users.sourceforge.net
-:Revision: $Revision$
-:Date: $Date$
-:Copyright: This document has been placed in the public domain.
-
-This document explores issues around extracting and processing
-docstrings from Python modules.
-
-For definitive element hierarchy details, see the "Python Plaintext
-Document Interface DTD" XML document type definition, pysource.dtd_
-(which modifies the generic docutils.dtd_).  Descriptions below list
-'DTD elements' (XML 'generic identifiers' or tag names) corresponding
-to syntax constructs.
-
-
-.. contents::
-
-
-Model
-=====
-
-The Python Source Reader ("PySource") model that's evolving in my mind
-goes something like this:
-
-1. Extract the docstring/namespace [#]_ tree from the module(s) and/or
-   package(s).
-
-   .. [#] See `Docstring Extractor`_ below.
-
-2. Run the parser on each docstring in turn, producing a forest of
-   doctrees (per nodes.py).
-
-3. Join the docstring trees together into a single tree, running
-   transforms:
-
-   - merge hyperlinks
-   - merge namespaces
-   - create various sections like "Module Attributes", "Functions",
-     "Classes", "Class Attributes", etc.; see spec/ppdi.dtd
-   - convert the above special sections to ordinary doctree nodes
-
-4. Run transforms on the combined doctree.  Examples: resolving
-   cross-references/hyperlinks (including interpreted text on Python
-   identifiers); footnote auto-numbering; first field list ->
-   bibliographic elements.
-
-   (Or should step 4's transforms come before step 3?)
-
-5. Pass the resulting unified tree to the writer/builder.
-
-I've had trouble reconciling the roles of input parser and output
-writer with the idea of modes ("readers" or "directors").  Does the
-mode govern the tranformation of the input, the output, or both?
-Perhaps the mode should be split into two.
-
-For example, say the source of our input is a Python module.  Our
-"input mode" should be the "Python Source Reader".  It discovers (from
-``__docformat__``) that the input parser is "reStructuredText".  If we
-want HTML, we'll specify the "HTML" output formatter.  But there's a
-piece missing.  What *kind* or *style* of HTML output do we want?
-PyDoc-style, LibRefMan style, etc.  (many people will want to specify
-and control their own style).  Is the output style specific to a
-particular output format (XML, HTML, etc.)?  Is the style specific to
-the input mode?  Or can/should they be independent?
-
-I envision interaction between the input parser, an "input mode" , and
-the output formatter.  The same intermediate data format would be used
-between each of these, being transformed as it progresses.
-
-
-Docstring Extractor
-===================
-
-We need code that scans a parsed Python module, and returns an ordered
-tree containing the names, docstrings (including attribute and
-additional docstrings), and additional info (in parentheses below) of
-all of the following objects:
-
-- packages
-- modules
-- module attributes (+ values)
-- classes (+ inheritance)
-- class attributes (+ values)
-- instance attributes (+ values)
-- methods (+ formal parameters & defaults)
-- functions (+ formal parameters & defaults)
-
-(Extract comments too?  For example, comments at the start of a module
-would be a good place for bibliographic field lists.)
-
-In order to evaluate interpreted text cross-references, namespaces for
-each of the above will also be required.
-
-See python-dev/docstring-develop thread "AST mining", started on
-2001-08-14.
-
-
-Interpreted Text
-================
-
-DTD elements: package, module, class, method, function,
-module_attribute, class_attribute, instance_attribute, variable,
-parameter, type, exception_class, warning_class.
-
-To classify identifiers explicitly, the role is given along with the
-identifier in either prefix or suffix form::
-
-    Use :method:`Keeper.storedata` to store the object's data in
-    `Keeper.data`:instance_attribute:.
-
-The role may be one of 'package', 'module', 'class', 'method',
-'function', 'module_attribute', 'class_attribute',
-'instance_attribute', 'variable', 'parameter', 'type',
-'exception_class', 'exception', 'warning_class', or 'warning'.  Other
-roles may be defined.
-
-.. _pysource.dtd: http://docutils.sourceforge.net/spec/pysource.dtd
-.. _docutils.dtd: http://docutils.sourceforge.net/spec/docutils.dtd
-
-
-..
-   Local Variables:
-   mode: indented-text
-   indent-tabs-mode: nil
-   fill-column: 70
-   End:
diff --git a/docutils/docs/dev/rst/alternatives.txt b/docutils/docs/dev/rst/alternatives.txt
deleted file mode 100644
index b089d58b2..000000000
--- a/docutils/docs/dev/rst/alternatives.txt
+++ /dev/null
@@ -1,2005 +0,0 @@
-==================================================
- A Record of reStructuredText Syntax Alternatives
-==================================================
-:Author: David Goodger
-:Contact: goodger@users.sourceforge.net
-:Revision: $Revision$
-:Date: $Date$
-:Copyright: This document has been placed in the public domain.
-
-The following are ideas, alternatives, and justifications that were
-considered for reStructuredText syntax, which did not originate with
-Setext_ or StructuredText_.  For an analysis of constructs which *did*
-originate with StructuredText or Setext, please see `Problems With
-StructuredText`_.  See the `reStructuredText Markup Specification`_
-for full details of the established syntax.
-
-.. _Setext: http://docutils.sourceforge.net/mirror/setext.html
-.. _StructuredText:
-   http://dev.zope.org/Members/jim/StructuredTextWiki/FrontPage
-.. _Problems with StructuredText: problems.html
-.. _reStructuredText Markup Specification: reStructuredText.html
-
-
-.. contents::
-
-
-... Or Not To Do?
-=================
-
-This is the realm of the possible but questionably probable.  These
-ideas are kept here as a record of what has been proposed, for
-posterity and in case any of them prove to be useful.
-
-
-Compound Enumerated Lists
--------------------------
-
-Allow for compound enumerators, such as "1.1." or "1.a." or "1(a)", to
-allow for nested enumerated lists without indentation?
-
-
-Sloppy Indentation of List Items
---------------------------------
-
-Perhaps the indentation shouldn't be so strict.  Currently, this is
-required::
-
-    1. First line,
-       second line.
-
-Anything wrong with this? ::
-
-    1. First line,
-     second line.
-
-Problem? ::
-
-    1. First para.
-
-       Block quote.  (no good: requires some indent relative to first
-       para)
-
-     Second Para.
-
-    2. Have to carefully define where the literal block ends::
-
-         Literal block
-
-       Literal block?
-
-Hmm...  Non-strict indentation isn't such a good idea.
-
-
-Lazy Indentation of List Items
-------------------------------
-
-Another approach: Going back to the first draft of reStructuredText
-(2000-11-27 post to Doc-SIG)::
-
-    - This is the fourth item of the main list (no blank line above).
-    The second line of this item is not indented relative to the
-    bullet, which precludes it from having a second paragraph.
-
-Change that to *require* a blank line above and below, to reduce
-ambiguity.  This "loosening" may be added later, once the parser's
-been nailed down.  However, a serious drawback of this approach is to
-limit the content of each list item to a single paragraph.
-
-
-David's Idea for Lazy Indentation
-`````````````````````````````````
-
-Consider a paragraph in a word processor.  It is a single logical line
-of text which ends with a newline, soft-wrapped arbitrarily at the
-right edge of the page or screen.  We can think of a plaintext
-paragraph in the same way, as a single logical line of text, ending
-with two newlines (a blank line) instead of one, and which may contain
-arbitrary line breaks (newlines) where it was accidentally
-hard-wrapped by an application.  We can compensate for the accidental
-hard-wrapping by "unwrapping" every unindented second and subsequent
-line.  The indentation of the first line of a paragraph or list item
-would determine the indentation for the entire element.  Blank lines
-would be required between list items when using lazy indentation.
-
-The following example shows the lazy indentation of multiple body
-elements::
-
-    - This is the first paragraph
-    of the first list item.
-
-      Here is the second paragraph
-    of the first list item.
-
-    - This is the first paragraph
-    of the second list item.
-
-      Here is the second paragraph
-    of the second list item.
-
-A more complex example shows the limitations of lazy indentation::
-
-    - This is the first paragraph
-    of the first list item.
-
-      Next is a definition list item:
-
-      Term
-          Definition.  The indentation of the term is
-    required, as is the indentation of the definition's
-    first line.
-
-          When the definition extends to more than
-    one line, lazy indentation may occur.  (This is the second
-    paragraph of the definition.)
-
-    - This is the first paragraph
-    of the second list item.
-
-      - Here is the first paragraph of
-    the first item of a nested list.
-
-      So this paragraph would be outside of the nested list,
-    but inside the second list item of the outer list.
-
-    But this paragraph is not part of the list at all.
-
-And the ambiguity remains::
-
-    - Look at the hyphen at the beginning of the next line
-    - is it a second list item marker, or a dash in the text?
-
-    Similarly, we may want to refer to numbers inside enumerated
-    lists:
-
-    1. How many socks in a pair? There are
-    2. How many pants in a pair? Exactly
-    1. Go figure.
-
-Literal blocks and block quotes would still require consistent
-indentation for all their lines.  For block quotes, we might be able
-to get away with only requiring that the first line of each contained
-element be indented.  For example::
-
-    Here's a paragraph.
-
-        This is a paragraph inside a block quote.
-    Second and subsequent lines need not be indented at all.
-
-        - A bullet list inside
-    the block quote.
-
-          Second paragraph of the
-    bullet list inside the block quote.
-
-Although feasible, this form of lazy indentation has problems.  The
-document structure and hierarchy is not obvious from the indentation,
-making the source plaintext difficult to read.  This will also make
-keeping track of the indentation while writing difficult and
-error-prone.  However, these problems may be acceptable for Wikis and
-email mode, where we may be able to rely on less complex structure
-(few nested lists, for example).
-
-
-Multiple Roles in Interpreted Text
-----------------------------------
-
-In reStructuredText, inline markup cannot be nested (yet; `see
-below`__).  This also applies to interpreted text.  In order to
-simultaneously combine multiple roles for a single piece of text, a
-syntax extension would be necessary.  Ideas:
-
-1. Initial idea::
-
-       `interpreted text`:role1,role2:
-
-2. Suggested by Jason Diamond::
-
-       `interpreted text`:role1:role2:
-
-If a document is so complex as to require nested inline markup,
-perhaps another markup system should be considered.  By design,
-reStructuredText does not have the flexibility of XML.
-
-__ `Nested Inline Markup`_
-
-
-Parameterized Interpreted Text
-------------------------------
-
-In some cases it may be expedient to pass parameters to interpreted
-text, analogous to function calls.  Ideas:
-
-1. Parameterize the interpreted text role itself (suggested by Jason
-   Diamond)::
-
-       `interpreted text`:role1(foo=bar):
-
-   Positional parameters could also be supported::
-
-       `CSS`:acronym(Cascading Style Sheets): is used for HTML, and
-       `CSS`:acronym(Content Scrambling System): is used for DVDs.
-
-   Technical problem: current interpreted text syntax does not
-   recognize roles containing whitespace.  Design problem: this smells
-   like programming language syntax, but reStructuredText is not a
-   programming language.
-
-2. Put the parameters inside the interpreted text::
-
-       `CSS (Cascading Style Sheets)`:acronym: is used for HTML, and
-       `CSS (Content Scrambling System)`:acronym: is used for DVDs.
-
-   Although this could be defined on an individual basis (per role),
-   we ought to have a standard.  Hyperlinks with embedded URIs already
-   use angle brackets; perhaps they could be used here too::
-
-       `CSS `:acronym: is used for HTML, and
-       `CSS `:acronym: is used for DVDs.
-
-   Do angle brackets connote URLs too much for this to be acceptable?
-   How about the "tag" connotation -- does it save them or doom them?
-
-Does this push inline markup too far?  Readability becomes a serious
-issue.  Substitutions may provide a better alternative (at the expense
-of verbosity and duplication) by pulling the details out of the text
-flow::
-
-    |CSS| is used for HTML, and |CSS-DVD| is used for DVDs.
-
-    .. |CSS| acronym:: Cascading Style Sheets
-    .. |CSS-DVD| acronym:: Content Scrambling System
-       :text: CSS
-
-----------------------------------------------------------------------
-
-This whole idea may be going beyond the scope of reStructuredText.
-Documents requiring this functionality may be better off using XML or
-another markup system.
-
-This argument comes up regularly when pushing the envelope of
-reStructuredText syntax.  I think it's a useful argument in that it
-provides a check on creeping featurism.  In many cases, the resulting
-verbosity produces such unreadable plaintext that there's a natural
-desire *not* to use it unless absolutely necessary.  It's a matter of
-finding the right balance.
-
-
-Character Processing
---------------------
-
-Several people have suggested adding some form of character processing
-to reStructuredText:
-
-* Some sort of automated replacement of ASCII sequences:
-
-  - ``--`` to em-dash (or ``--`` to en-dash, and ``---`` to em-dash).
-  - Convert quotes to curly quote entities.  (Essentially impossible
-    for HTML?  Unnecessary for TeX.)
-  - Various forms of ``:-)`` to smiley icons.
-  - ``"\ "`` to  .  Problem with line-wrapping though: it could
-    end up escaping the newline.
-  - Escaped newlines to 
. - - Escaped period or quote or dash as a disappearing catalyst to - allow character-level inline markup? - -* XML-style character entities, such as "©" for the copyright - symbol. - -Docutils has no need of a character entity subsystem. Supporting -Unicode and text encodings, character entities should be directly -represented in the text: a copyright symbol should be represented by -the copyright symbol character. If this is not possible in an -authoring environment, a pre-processing stage can be added, or a table -of substitution definitions can be devised. - -A "unicode" directive has been implemented to allow direct -specification of esoteric characters. In combination with the -substitution construct, "include" files defining common sets of -character entities can be defined and used. - -To allow for `character-level inline markup`_, a limited form of -character processing has been added to the spec and parser: escaped -whitespace characters are removed from the processed document. Any -further character processing will be of this functional type, rather -than of the character-encoding type. - -.. _character-level inline markup: - reStructuredText.html#character-level-inline-markup - - -Field Lists -=========== - -Prior to the syntax for field lists being finalized, several -alternatives were proposed. - -1. Unadorned RFC822_ everywhere:: - - Author: Me - Version: 1 - - Advantages: clean, precedent (RFC822-compliant). Disadvantage: - ambiguous (these paragraphs are a prime example). - - Conclusion: rejected. - -2. Special case: use unadorned RFC822_ for the very first or very last - text block of a document:: - - """ - Author: Me - Version: 1 - - The rest of the document... - """ - - Advantages: clean, precedent (RFC822-compliant). Disadvantages: - special case, flat (unnested) field lists only, still ambiguous:: - - """ - Usage: cmdname [options] arg1 arg2 ... - - We obviously *don't* want the like above to be interpreted as a - field list item. Or do we? - """ - - Conclusion: rejected for the general case, accepted for specific - contexts (PEPs, email). - -3. Use a directive:: - - .. fields:: - - Author: Me - Version: 1 - - Advantages: explicit and unambiguous, RFC822-compliant. - Disadvantage: cumbersome. - - Conclusion: rejected for the general case (but such a directive - could certainly be written). - -4. Use Javadoc-style:: - - @Author: Me - @Version: 1 - @param a: integer - - Advantages: unambiguous, precedent, flexible. Disadvantages: - non-intuitive, ugly, not RFC822-compliant. - - Conclusion: rejected. - -5. Use leading colons:: - - :Author: Me - :Version: 1 - - Advantages: unambiguous, obvious (*almost* RFC822-compliant), - flexible, perhaps even elegant. Disadvantages: no precedent, not - quite RFC822-compliant. - - Conclusion: accepted! - -6. Use double colons:: - - Author:: Me - Version:: 1 - - Advantages: unambiguous, obvious? (*almost* RFC822-compliant), - flexible, similar to syntax already used for literal blocks and - directives. Disadvantages: no precedent, not quite - RFC822-compliant, similar to syntax already used for literal blocks - and directives. - - Conclusion: rejected because of the syntax similarity & conflicts. - -Why is RFC822 compliance important? It's a universal Internet -standard, and super obvious. Also, I'd like to support the PEP format -(ulterior motive: get PEPs to use reStructuredText as their standard). -But it *would* be easy to get used to an alternative (easy even to -convert PEPs; probably harder to convert python-deviants ;-). - -Unfortunately, without well-defined context (such as in email headers: -RFC822 only applies before any blank lines), the RFC822 format is -ambiguous. It is very common in ordinary text. To implement field -lists unambiguously, we need explicit syntax. - -The following question was posed in a footnote: - - Should "bibliographic field lists" be defined at the parser level, - or at the DPS transformation level? In other words, are they - reStructuredText-specific, or would they also be applicable to - another (many/every other?) syntax? - -The answer is that bibliographic fields are a -reStructuredText-specific markup convention. Other syntaxes may -implement the bibliographic elements explicitly. For example, there -would be no need for such a transformation for an XML-based markup -syntax. - -.. _RFC822: http://www.rfc-editor.org/rfc/rfc822.txt - - -Interpreted Text "Roles" -======================== - -The original purpose of interpreted text was as a mechanism for -descriptive markup, to describe the nature or role of a word or -phrase. For example, in XML we could say "len" -to mark up "len" as a function. It is envisaged that within Python -docstrings (inline documentation in Python module source files, the -primary market for reStructuredText) the role of a piece of -interpreted text can be inferred implicitly from the context of the -docstring within the program source. For other applications, however, -the role may have to be indicated explicitly. - -Interpreted text is enclosed in single backquotes (`). - -1. Initially, it was proposed that an explicit role could be indicated - as a word or phrase within the enclosing backquotes: - - - As a prefix, separated by a colon and whitespace:: - - `role: interpreted text` - - - As a suffix, separated by whitespace and a colon:: - - `interpreted text :role` - - There are problems with the initial approach: - - - There could be ambiguity with interpreted text containing colons. - For example, an index entry of "Mission: Impossible" would - require a backslash-escaped colon. - - - The explicit role is descriptive markup, not content, and will - not be visible in the processed output. Putting it inside the - backquotes doesn't feel right; the *role* isn't being quoted. - -2. Tony Ibbs suggested that the role be placed outside the - backquotes:: - - role:`prefix` or `suffix`:role - - This removes the embedded-colons ambiguity, but limits the role - identifier to be a single word (whitespace would be illegal). - Since roles are not meant to be visible after processing, the lack - of whitespace support is not important. - - The suggested syntax remains ambiguous with respect to ratios and - some writing styles. For example, suppose there is a "signal" - identifier, and we write:: - - ...calculate the `signal`:noise ratio. - - "noise" looks like a role. - -3. As an improvement on #2, we can bracket the role with colons:: - - :role:`prefix` or `suffix`:role: - - This syntax is similar to that of field lists, which is fine since - both are doing similar things: describing. - - This is the syntax chosen for reStructuredText. - -4. Another alternative is two colons instead of one:: - - role::`prefix` or `suffix`::role - - But this is used for analogies ("A:B::C:D": "A is to B as C is to - D"). - - Both alternative #2 and #4 lack delimiters on both sides of the - role, making it difficult to parse (by the reader). - -5. Some kind of bracketing could be used: - - - Parentheses:: - - (role)`prefix` or `suffix`(role) - - - Braces:: - - {role}`prefix` or `suffix`{role} - - - Square brackets:: - - [role]`prefix` or `suffix`[role] - - - Angle brackets:: - - `prefix` or `suffix` - - (The overlap of \*ML tags with angle brackets would be too - confusing and precludes their use.) - -Syntax #3 was chosen for reStructuredText. - - -Comments -======== - -A problem with comments (actually, with all indented constructs) is -that they cannot be followed by an indented block -- a block quote -- -without swallowing it up. - -I thought that perhaps comments should be one-liners only. But would -this mean that footnotes, hyperlink targets, and directives must then -also be one-liners? Not a good solution. - -Tony Ibbs suggested a "comment" directive. I added that we could -limit a comment to a single text block, and that a "multi-block -comment" could use "comment-start" and "comment-end" directives. This -would remove the indentation incompatibility. A "comment" directive -automatically suggests "footnote" and (hyperlink) "target" directives -as well. This could go on forever! Bad choice. - -Garth Kidd suggested that an "empty comment", a ".." explicit markup -start with nothing on the first line (except possibly whitespace) and -a blank line immediately following, could serve as an "unindent". An -empty comment does **not** swallow up indented blocks following it, -so block quotes are safe. "A tiny but practical wart." Accepted. - - -Anonymous Hyperlinks -==================== - -Alan Jaffray came up with this idea, along with the following syntax:: - - Search the `Python DOC-SIG mailing list archives`{}_. - - .. _: http://mail.python.org/pipermail/doc-sig/ - -The idea is sound and useful. I suggested a "double underscore" -syntax:: - - Search the `Python DOC-SIG mailing list archives`__. - - .. __: http://mail.python.org/pipermail/doc-sig/ - -But perhaps single underscores are okay? The syntax looks better, but -the hyperlink itself doesn't explicitly say "anonymous":: - - Search the `Python DOC-SIG mailing list archives`_. - - .. _: http://mail.python.org/pipermail/doc-sig/ - -Mixing anonymous and named hyperlinks becomes confusing. The order of -targets is not significant for named hyperlinks, but it is for -anonymous hyperlinks:: - - Hyperlinks: anonymous_, named_, and another anonymous_. - - .. _named: named - .. _: anonymous1 - .. _: anonymous2 - -Without the extra syntax of double underscores, determining which -hyperlink references are anonymous may be difficult. We'd have to -check which references don't have corresponding targets, and match -those up with anonymous targets. Keeping to a simple consistent -ordering (as with auto-numbered footnotes) seems simplest. - -reStructuredText will use the explicit double-underscore syntax for -anonymous hyperlinks. An alternative (see `Reworking Explicit -Markup`_ below) for the somewhat awkward ".. __:" syntax is "__":: - - An anonymous__ reference. - - __ http://anonymous - - -Reworking Explicit Markup -========================= - -Alan Jaffray came up with the idea of `anonymous hyperlinks`_, added -to reStructuredText. Subsequently it was asserted that hyperlinks -(especially anonymous hyperlinks) would play an increasingly important -role in reStructuredText documents, and therefore they require a -simpler and more concise syntax. This prompted a review of the -current and proposed explicit markup syntaxes with regards to -improving usability. - -1. Original syntax:: - - .. _blah: internal hyperlink target - .. _blah: http://somewhere external hyperlink target - .. _blah: blahblah_ indirect hyperlink target - .. __: anonymous internal target - .. __: http://somewhere anonymous external target - .. __: blahblah_ anonymous indirect target - .. [blah] http://somewhere footnote - .. blah:: http://somewhere directive - .. blah: http://somewhere comment - - .. Note:: - - The comment text was intentionally made to look like a hyperlink - target. - - Origins: - - * Except for the colon (a delimiter necessary to allow for - phrase-links), hyperlink target ``.. _blah:`` comes from Setext. - * Comment syntax from Setext. - * Footnote syntax from StructuredText ("named links"). - * Directives and anonymous hyperlinks original to reStructuredText. - - Advantages: - - + Consistent explicit markup indicator: "..". - + Consistent hyperlink syntax: ".. _" & ":". - - Disadvantages: - - - Anonymous target markup is awkward: ".. __:". - - The explicit markup indicator ("..") is excessively overloaded? - - Comment text is limited (can't look like a footnote, hyperlink, - or directive). But this is probably not important. - -2. Alan Jaffray's proposed syntax #1:: - - __ _blah internal hyperlink target - __ blah: http://somewhere external hyperlink target - __ blah: blahblah_ indirect hyperlink target - __ anonymous internal target - __ http://somewhere anonymous external target - __ blahblah_ anonymous indirect target - __ [blah] http://somewhere footnote - .. blah:: http://somewhere directive - .. blah: http://somewhere comment - - The hyperlink-connoted underscores have become first-level syntax. - - Advantages: - - + Anonymous targets are simpler. - + All hyperlink targets are one character shorter. - - Disadvantages: - - - Inconsistent internal hyperlink targets. Unlike all other named - hyperlink targets, there's no colon. There's an extra leading - underscore, but we can't drop it because without it, "blah" looks - like a relative URI. Unless we restore the colon:: - - __ blah: internal hyperlink target - - - Obtrusive markup? - -3. Alan Jaffray's proposed syntax #2:: - - .. _blah internal hyperlink target - .. blah: http://somewhere external hyperlink target - .. blah: blahblah_ indirect hyperlink target - .. anonymous internal target - .. http://somewhere anonymous external target - .. blahblah_ anonymous indirect target - .. [blah] http://somewhere footnote - !! blah: http://somewhere directive - ## blah: http://somewhere comment - - Leading underscores have been (almost) replaced by "..", while - comments and directives have gained their own syntax. - - Advantages: - - + Anonymous hyperlinks are simpler. - + Unique syntax for comments. Connotation of "comment" from - some programming languages (including our favorite). - + Unique syntax for directives. Connotation of "action!". - - Disadvantages: - - - Inconsistent internal hyperlink targets. Again, unlike all other - named hyperlink targets, there's no colon. There's a leading - underscore, matching the trailing underscores of references, - which no other hyperlink targets have. We can't drop that one - leading underscore though: without it, "blah" looks like a - relative URI. Again, unless we restore the colon:: - - .. blah: internal hyperlink target - - - All (except for internal) hyperlink targets lack their leading - underscores, losing the "hyperlink" connotation. - - - Obtrusive syntax for comments. Alternatives:: - - ;; blah: http://somewhere - (also comment syntax in Lisp & others) - ,, blah: http://somewhere - ("comma comma": sounds like "comment"!) - - - Iffy syntax for directives. Alternatives? - -4. Tony Ibbs' proposed syntax:: - - .. _blah: internal hyperlink target - .. _blah: http://somewhere external hyperlink target - .. _blah: blahblah_ indirect hyperlink target - .. anonymous internal target - .. http://somewhere anonymous external target - .. blahblah_ anonymous indirect target - .. [blah] http://somewhere footnote - .. blah:: http://somewhere directive - .. blah: http://somewhere comment - - This is the same as the current syntax, except for anonymous - targets which drop their "__: ". - - Advantage: - - + Anonymous targets are simpler. - - Disadvantages: - - - Anonymous targets lack their leading underscores, losing the - "hyperlink" connotation. - - Anonymous targets are almost indistinguishable from comments. - (Better to know "up front".) - -5. David Goodger's proposed syntax: Perhaps going back to one of - Alan's earlier suggestions might be the best solution. How about - simply adding "__ " as a synonym for ".. __: " in the original - syntax? These would become equivalent:: - - .. __: anonymous internal target - .. __: http://somewhere anonymous external target - .. __: blahblah_ anonymous indirect target - - __ anonymous internal target - __ http://somewhere anonymous external target - __ blahblah_ anonymous indirect target - -Alternative 5 has been adopted. - - -Backquotes in Phrase-Links -========================== - -[From a 2001-06-05 Doc-SIG post in reply to questions from Doug -Hellmann.] - -The first draft of the spec, posted to the Doc-SIG in November 2000, -used square brackets for phrase-links. I changed my mind because: - -1. In the first draft, I had already decided on single-backquotes for - inline literal text. - -2. However, I wanted to minimize the necessity for backslash escapes, - for example when quoting Python repr-equivalent syntax that uses - backquotes. - -3. The processing of identifiers (function/method/attribute/module - etc. names) into hyperlinks is a useful feature. PyDoc recognizes - identifiers heuristically, but it doesn't take much imagination to - come up with counter-examples where PyDoc's heuristics would result - in embarassing failure. I wanted to do it deterministically, and - that called for syntax. I called this construct "interpreted - text". - -4. Leveraging off the ``*emphasis*/**strong**`` syntax, lead to the - idea of using double-backquotes as syntax. - -5. I worked out some rules for inline markup recognition. - -6. In combination with #5, double backquotes lent themselves to inline - literals, neatly satisfying #2, minimizing backslash escapes. In - fact, the spec says that no interpretation of any kind is done - within double-backquote inline literal text; backslashes do *no* - escaping within literal text. - -7. Single backquotes are then freed up for interpreted text. - -8. I already had square brackets required for footnote references. - -9. Since interpreted text will typically turn into hyperlinks, it was - a natural fit to use backquotes as the phrase-quoting syntax for - trailing-underscore hyperlinks. - -The original inspiration for the trailing underscore hyperlink syntax -was Setext. But for phrases Setext used a very cumbersome -``underscores_between_words_like_this_`` syntax. - -The underscores can be viewed as if they were right-pointing arrows: -``-->``. So ``hyperlink_`` points away from the reference, and -``.. _hyperlink:`` points toward the target. - - -Substitution Mechanism -====================== - -Substitutions arose out of a Doc-SIG thread begun on 2001-10-28 by -Alan Jaffray, "reStructuredText inline markup". It reminded me of a -missing piece of the reStructuredText puzzle, first referred to in my -contribution to "Documentation markup & processing / PEPs" (Doc-SIG -2001-06-21). - -Substitutions allow the power and flexibility of directives to be -shared by inline text. They are a way to allow arbitrarily complex -inline objects, while keeping the details out of the flow of text. -They are the equivalent of SGML/XML's named entities. For example, an -inline image (using reference syntax alternative 4d (vertical bars) -and definition alternative 3, the alternatives chosen for inclusion in -the spec):: - - The |biohazard| symbol must be used on containers used to dispose - of medical waste. - - .. |biohazard| image:: biohazard.png - [height=20 width=20] - -The ``|biohazard|`` substitution reference will be replaced in-line by -whatever the ``.. |biohazard|`` substitution definition generates (in -this case, an image). A substitution definition contains the -substitution text bracketed with vertical bars, followed by a an -embedded inline-compatible directive, such as "image". A transform is -required to complete the substitution. - -Syntax alternatives for the reference: - -1. Use the existing interpreted text syntax, with a predefined role - such as "sub":: - - The `biohazard`:sub: symbol... - - Advantages: existing syntax, explicit. Disadvantages: verbose, - obtrusive. - -2. Use a variant of the interpreted text syntax, with a new suffix - akin to the underscore in phrase-link references:: - - (a) `name`@ - (b) `name`# - (c) `name`& - (d) `name`/ - (e) `name`< - (f) `name`:: - (g) `name`: - - - Due to incompatibility with other constructs and ordinary text - usage, (f) and (g) are not possible. - -3. Use interpreted text syntax with a fixed internal format:: - - (a) `:name:` - (b) `name:` - (c) `name::` - (d) `::name::` - (e) `%name%` - (f) `#name#` - (g) `/name/` - (h) `&name&` - (i) `|name|` - (j) `[name]` - (k) `` - (l) `&name;` - (m) `'name'` - - To avoid ML confusion (k) and (l) are definitely out. Square - brackets (j) won't work in the target (the substitution definition - would be indistinguishable from a footnote). - - The ```/name/``` syntax (g) is reminiscent of "s/find/sub" - substitution syntax in ed-like languages. However, it may have a - misleading association with regexps, and looks like an absolute - POSIX path. (i) is visually equivalent and lacking the - connotations. - - A disadvantage of all of these is that they limit interpreted text, - albeit only slightly. - -4. Use specialized syntax, something new:: - - (a) #name# - (b) @name@ - (c) /name/ - (d) |name| - (e) <> - (f) //name// - (g) ||name|| - (h) ^name^ - (i) [[name]] - (j) ~name~ - (k) !name! - (l) =name= - (m) ?name? - (n) >name< - - "#" (a) and "@" (b) are obtrusive. "/" (c) without backquotes - looks just like a POSIX path; it is likely for such usage to appear - in text. - - "|" (d) and "^" (h) are feasible. - -5. Redefine the trailing underscore syntax. See definition syntax - alternative 4, below. - -Syntax alternatives for the definition: - -1. Use the existing directive syntax, with a predefined directive such - as "sub". It contains a further embedded directive resolving to an - inline-compatible object:: - - .. sub:: biohazard - .. image:: biohazard.png - [height=20 width=20] - - .. sub:: parrot - That bird wouldn't *voom* if you put 10,000,000 volts - through it! - - The advantages and disadvantages are the same as in inline - alternative 1. - -2. Use syntax as in #1, but with an embedded directivecompressed:: - - .. sub:: biohazard image:: biohazard.png - [height=20 width=20] - - This is a bit better than alternative 1, but still too much. - -3. Use a variant of directive syntax, incorporating the substitution - text, obviating the need for a special "sub" directive name. If we - assume reference alternative 4d (vertical bars), the matching - definition would look like this:: - - .. |biohazard| image:: biohazard.png - [height=20 width=20] - -4. (Suggested by Alan Jaffray on Doc-SIG from 2001-11-06.) - - Instead of adding new syntax, redefine the trailing underscore - syntax to mean "substitution reference" instead of "hyperlink - reference". Alan's example:: - - I had lunch with Jonathan_ today. We talked about Zope_. - - .. _Jonathan: lj [user=jhl] - .. _Zope: http://www.zope.org/ - - A problem with the proposed syntax is that URIs which look like - simple reference names (alphanum plus ".", "-", "_") would be - indistinguishable from substitution directive names. A more - consistent syntax would be:: - - I had lunch with Jonathan_ today. We talked about Zope_. - - .. _Jonathan: lj:: user=jhl - .. _Zope: http://www.zope.org/ - - (``::`` after ``.. _Jonathan: lj``.) - - The "Zope" target is a simple external hyperlink, but the - "Jonathan" target contains a directive. Alan proposed is that the - reference text be replaced by whatever the referenced directive - (the "directive target") produces. A directive reference becomes a - hyperlink reference if the contents of the directive target resolve - to a hyperlink. If the directive target resolves to an icon, the - reference is replaced by an inline icon. If the directive target - resolves to a hyperlink, the directive reference becomes a - hyperlink reference. - - This seems too indirect and complicated for easy comprehension. - - The reference in the text will sometimes become a link, sometimes - not. Sometimes the reference text will remain, sometimes not. We - don't know *at the reference*:: - - This is a `hyperlink reference`_; its text will remain. - This is an `inline icon`_; its text will disappear. - - That's a problem. - -The syntax that has been incorporated into the spec and parser is -reference alternative 4d with definition alternative 3:: - - The |biohazard| symbol... - - .. |biohazard| image:: biohazard.png - [height=20 width=20] - -We can also combine substitution references with hyperlink references, -by appending a "_" (named hyperlink reference) or "__" (anonymous -hyperlink reference) suffix to the substitution reference. This -allows us to click on an image-link:: - - The |biohazard|_ symbol... - - .. |biohazard| image:: biohazard.png - [height=20 width=20] - .. _biohazard: http://www.cdc.gov/ - -There have been several suggestions for the naming of these -constructs, originally called "substitution references" and -"substitutions". - -1. Candidate names for the reference construct: - - (a) substitution reference - (b) tagging reference - (c) inline directive reference - (d) directive reference - (e) indirect inline directive reference - (f) inline directive placeholder - (g) inline directive insertion reference - (h) directive insertion reference - (i) insertion reference - (j) directive macro reference - (k) macro reference - (l) substitution directive reference - -2. Candidate names for the definition construct: - - (a) substitution - (b) substitution directive - (c) tag - (d) tagged directive - (e) directive target - (f) inline directive - (g) inline directive definition - (h) referenced directive - (i) indirect directive - (j) indirect directive definition - (k) directive definition - (l) indirect inline directive - (m) named directive definition - (n) inline directive insertion definition - (o) directive insertion definition - (p) insertion definition - (q) insertion directive - (r) substitution definition - (s) directive macro definition - (t) macro definition - (u) substitution directive definition - (v) substitution definition - -"Inline directive reference" (1c) seems to be an appropriate term at -first, but the term "inline" is redundant in the case of the -reference. Its counterpart "inline directive definition" (2g) is -awkward, because the directive definition itself is not inline. - -"Directive reference" (1d) and "directive definition" (2k) are too -vague. "Directive definition" could be used to refer to any -directive, not just those used for inline substitutions. - -One meaning of the term "macro" (1k, 2s, 2t) is too -programming-language-specific. Also, macros are typically simple text -substitution mechanisms: the text is substituted first and evaluated -later. reStructuredText substitution definitions are evaluated in -place at parse time and substituted afterwards. - -"Insertion" (1h, 1i, 2n-2q) is almost right, but it implies that -something new is getting added rather than one construct being -replaced by another. - -Which brings us back to "substitution". The overall best names are -"substitution reference" (1a) and "substitution definition" (2v). A -long way to go to add one word! - - -Reworking Footnotes -=================== - -As a further wrinkle (see `Reworking Explicit Markup`_ above), in the -wee hours of 2002-02-28 I posted several ideas for changes to footnote -syntax: - - - Change footnote syntax from ``.. [1]`` to ``_[1]``? ... - - Differentiate (with new DTD elements) author-date "citations" - (``[GVR2002]``) from numbered footnotes? ... - - Render footnote references as superscripts without "[]"? ... - -These ideas are all related, and suggest changes in the -reStructuredText syntax as well as the docutils tree model. - -The footnote has been used for both true footnotes (asides expanding -on points or defining terms) and for citations (references to external -works). Rather than dealing with one amalgam construct, we could -separate the current footnote concept into strict footnotes and -citations. Citations could be interpreted and treated differently -from footnotes. Footnotes would be limited to numerical labels: -manual ("1") and auto-numbered (anonymous "#", named "#label"). - -The footnote is the only explicit markup construct (starts with ".. ") -that directly translates to a visible body element. I've always been -a little bit uncomfortable with the ".. " marker for footnotes because -of this; ".. " has a connotation of "special", but footnotes aren't -especially "special". Printed texts often put footnotes at the bottom -of the page where the reference occurs (thus "foot note"). Some HTML -designs would leave footnotes to be rendered the same positions where -they're defined. Other online and printed designs will gather -footnotes into a section near the end of the document, converting them -to "endnotes" (perhaps using a directive in our case); but this -"special processing" is not an intrinsic property of the footnote -itself, but a decision made by the document author or processing -system. - -Citations are almost invariably collected in a section at the end of a -document or section. Citations "disappear" from where they are -defined and are magically reinserted at some well-defined point. -There's more of a connection to the "special" connotation of the ".. " -syntax. The point at which the list of citations is inserted could be -defined manually by a directive (e.g., ".. citations::"), and/or have -default behavior (e.g., a section automatically inserted at the end of -the document) that might be influenced by options to the Writer. - -Syntax proposals: - -+ Footnotes: - - - Current syntax:: - - .. [1] Footnote 1 - .. [#] Auto-numbered footnote. - .. [#label] Auto-labeled footnote. - - - The syntax proposed in the original 2002-02-28 Doc-SIG post: - remove the ".. ", prefix a "_":: - - _[1] Footnote 1 - _[#] Auto-numbered footnote. - _[#label] Auto-labeled footnote. - - The leading underscore syntax (earlier dropped because - ``.. _[1]:`` was too verbose) is a useful reminder that footnotes - are hyperlink targets. - - - Minimal syntax: remove the ".. [" and "]", prefix a "_", and - suffix a ".":: - - _1. Footnote 1. - _#. Auto-numbered footnote. - _#label. Auto-labeled footnote. - - ``_1.``, ``_#.``, and ``_#label.`` are markers, - like list markers. - - Footnotes could be rendered something like this in HTML - - | 1. This is a footnote. The brackets could be dropped - | from the label, and a vertical bar could set them - | off from the rest of the document in the HTML. - - Two-way hyperlinks on the footnote marker ("1." above) would also - help to differentiate footnotes from enumerated lists. - - If converted to endnotes (by a directive/transform), a horizontal - half-line might be used instead. Page-oriented output formats - would typically use the horizontal line for true footnotes. - -+ Footnote references: - - - Current syntax:: - - [1]_, [#]_, [#label]_ - - - Minimal syntax to match the minimal footnote syntax above:: - - 1_, #_, #label_ - - As a consequence, pure-numeric hyperlink references would not be - possible; they'd be interpreted as footnote references. - -+ Citation references: no change is proposed from the current footnote - reference syntax:: - - [GVR2001]_ - -+ Citations: - - - Current syntax (footnote syntax):: - - .. [GVR2001] Python Documentation; van Rossum, Drake, et al.; - http://www.python.org/doc/ - - - Possible new syntax:: - - _[GVR2001] Python Documentation; van Rossum, Drake, et al.; - http://www.python.org/doc/ - - _[DJG2002] - Docutils: Python Documentation Utilities project; Goodger - et al.; http://docutils.sourceforge.net/ - - Without the ".. " marker, subsequent lines would either have to - align as in one of the above, or we'd have to allow loose - alignment (I'd rather not):: - - _[GVR2001] Python Documentation; van Rossum, Drake, et al.; - http://www.python.org/doc/ - -I proposed adopting the "minimal" syntax for footnotes and footnote -references, and adding citations and citation references to -reStructuredText's repertoire. The current footnote syntax for -citations is better than the alternatives given. - -From a reply by Tony Ibbs on 2002-03-01: - - However, I think easier with examples, so let's create one:: - - Fans of Terry Pratchett are perhaps more likely to use - footnotes [1]_ in their own writings than other people - [2]_. Of course, in *general*, one only sees footnotes - in academic or technical writing - it's use in fiction - and letter writing is not normally considered good - style [4]_, particularly in emails (not a medium that - lends itself to footnotes). - - .. [1] That is, little bits of referenced text at the - bottom of the page. - .. [2] Because Terry himself does, of course [3]_. - .. [3] Although he has the distinction of being - *funny* when he does it, and his fans don't always - achieve that aim. - .. [4] Presumably because it detracts from linear - reading of the text - this is, of course, the point. - - and look at it with the second syntax proposal:: - - Fans of Terry Pratchett are perhaps more likely to use - footnotes [1]_ in their own writings than other people - [2]_. Of course, in *general*, one only sees footnotes - in academic or technical writing - it's use in fiction - and letter writing is not normally considered good - style [4]_, particularly in emails (not a medium that - lends itself to footnotes). - - _[1] That is, little bits of referenced text at the - bottom of the page. - _[2] Because Terry himself does, of course [3]_. - _[3] Although he has the distinction of being - *funny* when he does it, and his fans don't always - achieve that aim. - _[4] Presumably because it detracts from linear - reading of the text - this is, of course, the point. - - (I note here that if I have gotten the indentation of the - footnotes themselves correct, this is clearly not as nice. And if - the indentation should be to the left margin instead, I like that - even less). - - and the third (new) proposal:: - - Fans of Terry Pratchett are perhaps more likely to use - footnotes 1_ in their own writings than other people - 2_. Of course, in *general*, one only sees footnotes - in academic or technical writing - it's use in fiction - and letter writing is not normally considered good - style 4_, particularly in emails (not a medium that - lends itself to footnotes). - - _1. That is, little bits of referenced text at the - bottom of the page. - _2. Because Terry himself does, of course 3_. - _3. Although he has the distinction of being - *funny* when he does it, and his fans don't always - achieve that aim. - _4. Presumably because it detracts from linear - reading of the text - this is, of course, the point. - - I think I don't, in practice, mind the targets too much (the use - of a dot after the number helps a lot here), but I do have a - problem with the body text, in that I don't naturally separate out - the footnotes as different than the rest of the text - instead I - keep wondering why there are numbers interspered in the text. The - use of brackets around the numbers ([ and ]) made me somehow parse - the footnote references as "odd" - i.e., not part of the body text - - and thus both easier to skip, and also (paradoxically) easier to - pick out so that I could follow them. - - Thus, for the moment (and as always susceptable to argument), I'd - say -1 on the new form of footnote reference (i.e., I much prefer - the existing ``[1]_`` over the proposed ``1_``), and ambivalent - over the proposed target change. - - That leaves David's problem of wanting to distinguish footnotes - and citations - and the only thing I can propose there is that - footnotes are numeric or # and citations are not (which, as a - human being, I can probably cope with!). - -From a reply by Paul Moore on 2002-03-01: - - I think the current footnote syntax ``[1]_`` is *exactly* the - right balance of distinctness vs unobtrusiveness. I very - definitely don't think this should change. - - On the target change, it doesn't matter much to me. - -From a further reply by Tony Ibbs on 2002-03-01, referring to the -"[1]" form and actual usage in email: - - Clearly this is a form people are used to, and thus we should - consider it strongly (in the same way that the usage of ``*..*`` - to mean emphasis was taken partly from email practise). - - Equally clearly, there is something "magical" for people in the - use of a similar form (i.e., ``[1]``) for both footnote reference - and footnote target - it seems natural to keep them similar. - - ... - - I think that this established plaintext usage leads me to strongly - believe we should retain square brackets at both ends of a - footnote. The markup of the reference end (a single trailing - underscore) seems about as minimal as we can get away with. The - markup of the target end depends on how one envisages the thing - - if ".." means "I am a target" (as I tend to see it), then that's - good, but one can also argue that the "_[1]" syntax has a neat - symmetry with the footnote reference itself, if one wishes (in - which case ".." presumably means "hidden/special" as David seems - to think, which is why one needs a ".." *and* a leading underline - for hyperlink targets. - -Given the persuading arguments voiced, we'll leave footnote & footnote -reference syntax alone. Except that these discussions gave rise to -the "auto-symbol footnote" concept, which has been added. Citations -and citation references have also been added. - - -Auto-Enumerated Lists -===================== - -The advantage of auto-numbered enumerated lists would be similar to -that of auto-numbered footnotes: lists could be written and rearranged -without having to manually renumber them. The disadvantages are also -the same: input and output wouldn't match exactly; the markup may be -ugly or confusing (depending on which alternative is chosen). - -1. Use the "#" symbol. Example:: - - #. Item 1. - #. Item 2. - #. Item 3. - - Advantages: simple, explicit. Disadvantage: enumeration sequence - cannot be specified (limited to arabic numerals); ugly. - -2. As a variation on #1, first initialize the enumeration sequence? - For example:: - - a) Item a. - #) Item b. - #) Item c. - - Advantages: simple, explicit, any enumeration sequence possible. - Disadvantages: ugly; perhaps confusing with mixed concrete/abstract - enumerators. - -3. Alternative suggested by Fred Bremmer, from experience with MoinMoin:: - - 1. Item 1. - 1. Item 2. - 1. Item 3. - - Advantages: enumeration sequence is explicit (could be multiple - "a." or "(I)" tokens). Disadvantages: perhaps confusing; otherwise - erroneous input (e.g., a duplicate item "1.") would pass silently, - either causing a problem later in the list (if no blank lines - between items) or creating two lists (with blanks). - - Take this input for example:: - - 1. Item 1. - - 1. Unintentional duplicate of item 1. - - 2. Item 2. - - Currently the parser will produce two list, "1" and "1,2" (no - warnings, because of the presence of blank lines). Using Fred's - notation, the current behavior is "1,1,2 -> 1 1,2" (without blank - lines between items, it would be "1,1,2 -> 1 [WARNING] 1,2"). What - should the behavior be with auto-numbering? - - Fred has produced a patch__, whose initial behavior is as follows:: - - 1,1,1 -> 1,2,3 - 1,2,2 -> 1,2,3 - 3,3,3 -> 3,4,5 - 1,2,2,3 -> 1,2,3 [WARNING] 3 - 1,1,2 -> 1,2 [WARNING] 2 - - (After the "[WARNING]", the "3" would begin a new list.) - - I have mixed feelings about adding this functionality to the spec & - parser. It would certainly be useful to some users (myself - included; I often have to renumber lists). Perhaps it's too - clever, asking the parser to guess too much. What if you *do* want - three one-item lists in a row, each beginning with "1."? You'd - have to use empty comments to force breaks. Also, I question - whether "1,2,2 -> 1,2,3" is optimal behavior. - - In response, Fred came up with "a stricter and more explicit rule - [which] would be to only auto-number silently if *all* the - enumerators of a list were identical". In that case:: - - 1,1,1 -> 1,2,3 - 1,2,2 -> 1,2 [WARNING] 2 - 3,3,3 -> 3,4,5 - 1,2,2,3 -> 1,2 [WARNING] 2,3 - 1,1,2 -> 1,2 [WARNING] 2 - - Should any start-value be allowed ("3,3,3"), or should - auto-numbered lists be limited to begin with ordinal-1 ("1", "A", - "a", "I", or "i")? - - __ http://sourceforge.net/tracker/index.php?func=detail&aid=548802 - &group_id=38414&atid=422032 - -4. Alternative proposed by Tony Ibbs:: - - #1. First item. - #3. Aha - I edited this in later. - #2. Second item. - - The initial proposal required unique enumerators within a list, but - this limits the convenience of a feature of already limited - applicability and convenience. Not a useful requirement; dropped. - - Instead, simply prepend a "#" to a standard list enumerator to - indicate auto-enumeration. The numbers (or letters) of the - enumerators themselves are not significant, except: - - - as a sequence indicator (arabic, roman, alphabetic; upper/lower), - - - and perhaps as a start value (first list item). - - Advantages: explicit, any enumeration sequence possible. - Disadvantages: a bit ugly. - - -Inline External Targets -======================= - -Currently reStructuredText has two hyperlink syntax variations: - -* Named hyperlinks:: - - This is a named reference_ of one word ("reference"). Here is - a `phrase reference`_. Phrase references may even cross `line - boundaries`_. - - .. _reference: http://www.example.org/reference/ - .. _phrase reference: http://www.example.org/phrase_reference/ - .. _line boundaries: http://www.example.org/line_boundaries/ - - + Advantages: - - - The plaintext is readable. - - Each target may be reused multiple times (e.g., just write - ``"reference_"`` again). - - No syncronized ordering of references and targets is necessary. - - + Disadvantages: - - - The reference text must be repeated as target names; could lead - to mistakes. - - The target URLs may be located far from the references, and hard - to find in the plaintext. - -* Anonymous hyperlinks (in current reStructuredText):: - - This is an anonymous reference__. Here is an anonymous - `phrase reference`__. Phrase references may even cross `line - boundaries`__. - - __ http://www.example.org/reference/ - __ http://www.example.org/phrase_reference/ - __ http://www.example.org/line_boundaries/ - - + Advantages: - - - The plaintext is readable. - - The reference text does not have to be repeated. - - + Disadvantages: - - - References and targets must be kept in sync. - - Targets cannot be reused. - - The target URLs may be located far from the references. - -For comparison and historical background, StructuredText also has two -syntaxes for hyperlinks: - -* First, ``"reference text":URL``:: - - This is a "reference":http://www.example.org/reference/ - of one word ("reference"). Here is a "phrase - reference":http://www.example.org/phrase_reference/. - -* Second, ``"reference text", http://example.com/absolute_URL``:: - - This is a "reference", http://www.example.org/reference/ - of one word ("reference"). Here is a "phrase reference", - http://www.example.org/phrase_reference/. - -Both syntaxes share advantages and disadvantages: - -+ Advantages: - - - The target is specified immediately adjacent to the reference. - -+ Disadvantages: - - - Poor plaintext readability. - - Targets cannot be reused. - - Both syntaxes use double quotes, common in ordinary text. - - In the first syntax, the URL and the last word are stuck - together, exacerbating the line wrap problem. - - The second syntax is too magical; text could easily be written - that way by accident (although only absolute URLs are recognized - here, perhaps because of the potential for ambiguity). - -A new type of "inline external hyperlink" has been proposed. - -1. On 2002-06-28, Simon Budig proposed__ a new syntax for - reStructuredText hyperlinks:: - - This is a reference_(http://www.example.org/reference/) of one - word ("reference"). Here is a `phrase - reference`_(http://www.example.org/phrase_reference/). Are - these examples, (single-underscore), named? If so, `anonymous - references`__(http://www.example.org/anonymous/) using two - underscores would probably be preferable. - - __ http://mail.python.org/pipermail/doc-sig/2002-June/002648.html - - The syntax, advantages, and disadvantages are similar to those of - StructuredText. - - + Advantages: - - - The target is specified immediately adjacent to the reference. - - + Disadvantages: - - - Poor plaintext readability. - - Targets cannot be reused (unless named, but the semantics are - unclear). - - + Problems: - - - The ``"`ref`_(URL)"`` syntax forces the last word of the - reference text to be joined to the URL, making a potentially - very long word that can't be wrapped (URLs can be very long). - The reference and the URL should be separate. This is a - symptom of the following point: - - - The syntax produces a single compound construct made up of two - equally important parts, *with syntax in the middle*, *between* - the reference and the target. This is unprecedented in - reStructuredText. - - - The "inline hyperlink" text is *not* a named reference (there's - no lookup by name), so it shouldn't look like one. - - - According to the IETF standards RFC 2396 and RFC 2732, - parentheses are legal URI characters and curly braces are legal - email characters, making their use prohibitively difficult. - - - The named/anonymous semantics are unclear. - -2. After an analysis__ of the syntax of (1) above, we came up with the - following compromise syntax:: - - This is an anonymous reference__ - __ of one word - ("reference"). Here is a `phrase reference`__ - __. `Named - references`_ _ use single - underscores. - - __ http://mail.python.org/pipermail/doc-sig/2002-July/002670.html - - The syntax builds on that of the existing "inline internal - targets": ``an _`inline internal target`.`` - - + Advantages: - - - The target is specified immediately adjacent to the reference, - improving maintainability: - - - References and targets are easily kept in sync. - - The reference text does not have to be repeated. - - - The construct is executed in two parts: references identical to - existing references, and targets that are new but not too big a - stretch from current syntax. - - - There's overwhelming precedent for quoting URLs with angle - brackets [#]_. - - + Disadvantages: - - - Poor plaintext readability. - - Lots of "line noise". - - Targets cannot be reused (unless named; see below). - - To alleviate the readability issue slightly, we could allow the - target to appear later, such as after the end of the sentence:: - - This is a named reference__ of one word ("reference"). - __ Here is a `phrase - reference`__. __ - - Problem: this could only work for one reference at a time - (reference/target pairs must be proximate [refA trgA refB trgB], - not interleaved [refA refB trgA trgB] or nested [refA refB trgB - trgA]). This variation is too problematic; references and inline - external targets will have to be kept imediately adjacent (see (3) - below). - - The ``"reference__ __"`` syntax is actually for "anonymous - inline external targets", emphasized by the double underscores. It - follows that single trailing and leading underscores would lead to - *implicitly named* inline external targets. This would allow the - reuse of targets by name. So after ``"reference_ _"``, - another ``"reference_"`` would point to the same target. - - .. [#] - From RFC 2396 (URI syntax): - - The angle-bracket "<" and ">" and double-quote (") - characters are excluded [from URIs] because they are often - used as the delimiters around URI in text documents and - protocol fields. - - Using <> angle brackets around each URI is especially - recommended as a delimiting style for URI that contain - whitespace. - - From RFC 822 (email headers): - - Angle brackets ("<" and ">") are generally used to indicate - the presence of a one machine-usable reference (e.g., - delimiting mailboxes), possibly including source-routing to - the machine. - -3. If it is best for references and inline external targets to be - immediately adjacent, then they might as well be integrated. - Here's an alternative syntax embedding the target URL in the - reference:: - - This is an anonymous `reference `__ of one word ("reference"). Here is a `phrase - reference `__. - - Advantages and disadvantages are similar to those in (2). - Readability is still an issue, but the syntax is a bit less - heavyweight (reduced line noise). Backquotes are required, even - for one-word references; the target URL is included within the - reference text, forcing a phrase context. - - We'll call this variant "embedded URIs". - - Problem: how to refer to a title like "HTML Anchors:
" (which - ends with an HTML/SGML/XML tag)? We could either require more - syntax on the target (like ``"`reference text - __`__"``), or require the odd conflicting - title to be escaped (like ``"`HTML Anchors: \`__"``). The - latter seems preferable, and not too onerous. - - Similarly to (2) above, a single trailing underscore would convert - the reference & inline external target from anonymous to implicitly - named, allowing reuse of targets by name. - - I think this is the least objectionable of the syntax alternatives. - -Other syntax variations have been proposed (by Brett Cannon and Benja -Fallenstein):: - - `phrase reference`->http://www.example.com - - `phrase reference`@http://www.example.com - - `phrase reference`__ ->http://www.example.com - - `phrase reference` [-> http://www.example.com] - - `phrase reference`__ [-> http://www.example.com] - - `phrase reference` _ - -None of these variations are clearly superior to #3 above. Some have -problems that exclude their use. - -With any kind of inline external target syntax it comes down to the -conflict between maintainability and plaintext readability. I don't -see a major problem with reStructuredText's maintainability, and I -don't want to sacrifice plaintext readability to "improve" it. - -The proponents of inline external targets want them for easily -maintainable web pages. The arguments go something like this: - -- Named hyperlinks are difficult to maintain because the reference - text is duplicated as the target name. - - To which I said, "So use anonymous hyperlinks." - -- Anonymous hyperlinks are difficult to maintain becuase the - references and targets have to be kept in sync. - - "So keep the targets close to the references, grouped after each - paragraph. Maintenance is trivial." - -- But targets grouped after paragraphs break the flow of text. - - "Surely less than URLs embedded in the text! And if the intent is - to produce web pages, not readable plaintext, then who cares about - the flow of text?" - -Many participants have voiced their objections to the proposed syntax: - - Garth Kidd: "I strongly prefer the current way of doing it. - Inline is spectactularly messy, IMHO." - - Tony Ibbs: "I vehemently agree... that the inline alternatives - being suggested look messy - there are/were good reasons they've - been taken out... I don't believe I would gain from the new - syntaxes." - - Paul Moore: "I agree as well. The proposed syntax is far too - punctuation-heavy, and any of the alternatives discussed are - ambiguous or too subtle." - -Others have voiced their support: - - fantasai: "I agree with Simon. In many cases, though certainly - not in all, I find parenthesizing the url in plain text flows - better than relegating it to a footnote." - - Ken Manheimer: "I'd like to weigh in requesting some kind of easy, - direct inline reference link." - -(Interesting that those *against* the proposal have been using -reStructuredText for a while, and those *for* the proposal are either -new to the list ["fantasai", background unknown] or longtime -StructuredText users [Ken Manheimer].) - -I was initially ambivalent/against the proposed "inline external -targets". I value reStructuredText's readability very highly, and -although the proposed syntax offers convenience, I don't know if the -convenience is worth the cost in ugliness. Does the proposed syntax -compromise readability too much, or should the choice be left up to -the author? Perhaps if the syntax is *allowed* but its use strongly -*discouraged*, for aesthetic/readability reasons? - -After a great deal of thought and much input from users, I've decided -that there are reasonable use cases for this construct. The -documentation should strongly caution against its use in most -situations, recommending independent block-level targets instead. -Syntax #3 above ("embedded URIs") will be used. - - -Doctree Representation of Transitions -===================================== - -(Although not reStructuredText-specific, this section fits best in -this document.) - -Having added the "horizontal rule" construct to the `reStructuredText -Markup Specification`_, a decision had to be made as to how to reflect -the construct in the implementation of the document tree. Given this -source:: - - Document - ======== - - Paragraph 1 - - -------- - - Paragraph 2 - -The horizontal rule indicates a "transition" (in prose terms) or the -start of a new "division". Before implementation, the parsed document -tree would be:: - - -
- - Document - <paragraph> - Paragraph 1 - -------- <--- error here - <paragraph> - Paragraph 2 - -There are several possibilities for the implementation: - -1. Implement horizontal rules as "divisions" or segments. A - "division" is a title-less, non-hierarchical section. The first - try at an implementation looked like this:: - - <document> - <section name="document"> - <title> - Document - <paragraph> - Paragraph 1 - <division> - <paragraph> - Paragraph 2 - - But the two paragraphs are really at the same level; they shouldn't - appear to be at different levels. There's really an invisible - "first division". The horizontal rule splits the document body - into two segments, which should be treated uniformly. - -2. Treating "divisions" uniformly brings us to the second - possibility:: - - <document> - <section name="document"> - <title> - Document - <division> - <paragraph> - Paragraph 1 - <division> - <paragraph> - Paragraph 2 - - With this change, documents and sections will directly contain - divisions and sections, but not body elements. Only divisions will - directly contain body elements. Even without a horizontal rule - anywhere, the body elements of a document or section would be - contained within a division element. This makes the document tree - deeper. This is similar to the way HTML_ treats document contents: - grouped within a ``<body>`` element. - -3. Implement them as "transitions", empty elements:: - - <document> - <section name="document"> - <title> - Document - <paragraph> - Paragraph 1 - <transition> - <paragraph> - Paragraph 2 - - A transition would be a "point element", not containing anything, - only identifying a point within the document structure. This keeps - the document tree flatter, but the idea of a "point element" like - "transition" smells bad. A transition isn't a thing itself, it's - the space between two divisions. However, transitions are a - practical solution. - -Solution 3 was chosen for incorporation into the document tree model. - -.. _HTML: http://www.w3.org/MarkUp/ - - -Nested Inline Markup -==================== - -These are collected notes on a long-discussed issue. The original -mailing list messages should be referred to for details. - -* In a 2001-10-31 discussion I wrote: - - Try, for example, `Ed Loper's 2001-03-21 post`_, which details - some rules for nested inline markup. I think the complexity is - prohibitive for the marginal benefit. (And if you can understand - that tree without going mad, you're a better man than I. ;-) - - Inline markup is already fragile. Allowing nested inline markup - would only be asking for trouble IMHO. If it proves absolutely - necessary, it can be added later. The rules for what can appear - inside what must be well thought out first though. - - .. _Ed Loper's 2001-03-21 post: - http://mail.python.org/pipermail/doc-sig/2001-March/001487.html - - -- http://mail.python.org/pipermail/doc-sig/2001-October/002354.html - -* In a 2001-11-09 Doc-SIG post, I wrote: - - The problem is that in the - what-you-see-is-more-or-less-what-you-get markup language that - is reStructuredText, the symbols used for inline markup ("*", - "**", "`", "``", etc.) may preclude nesting. - - I've rethought this position. Nested markup is not precluded, just - tricky. People and software parse "double and 'single' quotes" all - the time. Continuing, - - I've thought over how we might implement nested inline - markup. The first algorithm ("first identify the outer inline - markup as we do now, then recursively scan for nested inline - markup") won't work; counterexamples were given in my `last post - <http://mail.python.org/pipermail/doc-sig/2001-November/002363.html>`__. - - The second algorithm makes my head hurt:: - - while 1: - scan for start-string - if found: - push on stack - scan for start or end string - if new start string found: - recurse - elif matching end string found: - pop stack - elif non-matching end string found: - if its a markup error: - generate warning - elif the initial start-string was misinterpreted: - # e.g. in this case: ***strong** in emphasis* - restart with the other interpretation - # but it might be several layers back ... - ... - - This is similar to how the parser does section title - recognition, but sections are much more regular and - deterministic. - - Bottom line is, I don't think the benefits are worth the effort, - even if it is possible. I'm not going to try to write the code, - at least not now. If somebody codes up a consistent, working, - general solution, I'll be happy to consider it. - - -- http://mail.python.org/pipermail/doc-sig/2001-November/002388.html - -* In a `2003-05-06 Docutils-Users post`__ Paul Tremblay proposed a new - syntax to allow for easier nesting. It eventually evolved into - this:: - - :role:[inline text] - - The duplication with the existing interpreted text syntax is - problematic though. - - __ http://article.gmane.org/gmane.text.docutils.user/317 - -* Could the parser be extended to parse nested interpreted text? :: - - :emphasis:`Some emphasized text with :strong:`some more - emphasized text` in it and **perhaps** :reference:`a link`` - -* In a `2003-06-18 Docutils-Develop post`__, Mark Nodine reported on - his implementation of a form of nested inline markup in his - Perl-based parser (unpublished). He brought up some interesting - ideas. The implementation was flawed, however, by the change in - semantics required for backslash escapes. - - __ http://article.gmane.org/gmane.text.docutils.devel/795 - -It may be possible to accomplish nested inline markup in general with -a more powerful inline markup parser. There may be some issues, but -I'm not averse to the idea of nested inline markup in general. I just -don't have the time or inclination to write a new parser now. Of -course, a good patch would be welcome! - -I envisage something like this. Explicit-role interpreted text must -be nestable. Prefix-based is probably preferred, since suffix-based -will look like inline literals:: - - ``text`:role1:`:role2: - -But it can be disambiguated, so it ought to be left up to the author:: - - `\ `text`:role1:`:role2: - -In addition, other forms of inline markup may be nested if -unambiguous:: - - *emphasized ``literal`` and |substitution ref| and link_* - -IOW, the parser ought to be as permissive as possible. - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: diff --git a/docutils/docs/dev/rst/problems.txt b/docutils/docs/dev/rst/problems.txt deleted file mode 100644 index a8747af88..000000000 --- a/docutils/docs/dev/rst/problems.txt +++ /dev/null @@ -1,870 +0,0 @@ -============================== - Problems With StructuredText -============================== -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This document has been placed in the public domain. - -There are several problems, unresolved issues, and areas of -controversy within StructuredText_ (Classic and Next Generation). In -order to resolve all these issues, this analysis brings all of the -issues out into the open, enumerates all the alternatives, and -proposes solutions to be incorporated into the reStructuredText_ -specification. - - -.. contents:: - - -Formal Specification -==================== - -The description in the original StructuredText.py has been criticized -for being vague. For practical purposes, "the code *is* the spec." -Tony Ibbs has been working on deducing a `detailed description`_ from -the documentation and code of StructuredTextNG_. Edward Loper's -STMinus_ is another attempt to formalize a spec. - -For this kind of a project, the specification should always precede -the code. Otherwise, the markup is a moving target which can never be -adopted as a standard. Of course, a specification may be revised -during lifetime of the code, but without a spec there is no visible -control and thus no confidence. - - -Understanding and Extending the Code -==================================== - -The original StructuredText_ is a dense mass of sparsely commented -code and inscrutable regular expressions. It was not designed to be -extended and is very difficult to understand. StructuredTextNG_ has -been designed to allow input (syntax) and output extensions, but its -documentation (both internal [comments & docstrings], and external) is -inadequate for the complexity of the code itself. - -For reStructuredText to become truly useful, perhaps even part of -Python's standard library, it must have clear, understandable -documentation and implementation code. For the implementation of -reStructuredText to be taken seriously, it must be a sterling example -of the potential of docstrings; the implementation must practice what -the specification preaches. - - -Section Structure via Indentation -================================= - -Setext_ required that body text be indented by 2 spaces. The original -StructuredText_ and StructuredTextNG_ require that section structure -be indicated through indentation, as "inspired by Python". For -certain structures with a very limited, local extent (such as lists, -block quotes, and literal blocks), indentation naturally indicates -structure or hierarchy. For sections (which may have a very large -extent), structure via indentation is unnecessary, unnatural and -ambiguous. Rather, the syntax of the section title *itself* should -indicate that it is a section title. - -The original StructuredText states that "A single-line paragraph whose -immediately succeeding paragraphs are lower level is treated as a -header." Requiring indentation in this way is: - -- Unnecessary. The vast majority of docstrings and standalone - documents will have no more than one level of section structure. - Requiring indentation for such docstrings is unnecessary and - irritating. - -- Unnatural. Most published works use title style (type size, face, - weight, and position) and/or section/subsection numbering rather - than indentation to indicate hierarchy. This is a tradition with a - very long history. - -- Ambiguous. A StructuredText header is indistinguishable from a - one-line paragraph followed by a block quote (precluding the use of - block quotes). Enumerated section titles are ambiguous (is it a - header? is it a list item?). Some additional adornment must be - required to confirm the line's role as a title, both to a parser and - to the human reader of the source text. - -Python's use of significant whitespace is a wonderful (if not -original) innovation, however requiring indentation in ordinary -written text is hypergeneralization. - -reStructuredText_ indicates section structure through title adornment -style (as exemplified by this document). This is far more natural. -In fact, it is already in widespread use in plain text documents, -including in Python's standard distribution (such as the toplevel -README_ file). - - -Character Escaping Mechanism -============================ - -No matter what characters are chosen for markup, some day someone will -want to write documentation *about* that markup or using markup -characters in a non-markup context. Therefore, any complete markup -language must have an escaping or encoding mechanism. For a -lightweight markup system, encoding mechanisms like SGML/XML's '*' -are out. So an escaping mechanism is in. However, with carefully -chosen markup, it should be necessary to use the escaping mechanism -only infrequently. - -reStructuredText_ needs an escaping mechanism: a way to treat -markup-significant characters as the characters themselves. Currently -there is no such mechanism (although ZWiki uses '!'). What are the -candidates? - -1. ``!`` (http://dev.zope.org/Members/jim/StructuredTextWiki/NGEscaping) -2. ``\`` -3. ``~`` -4. doubling of characters - -The best choice for this is the backslash (``\``). It's "the single -most popular escaping character in the world!", therefore familiar and -unsurprising. Since characters only need to be escaped under special -circumstances, which are typically those explaining technical -programming issues, the use of the backslash is natural and -understandable. Python docstrings can be raw (prefixed with an 'r', -as in 'r""'), which would obviate the need for gratuitous doubling-up -of backslashes. - -(On 2001-03-29 on the Doc-SIG mailing list, GvR endorsed backslash -escapes, saying, "'nuff said. Backslash it is." Although neither -legally binding nor irrevocable nor any kind of guarantee of anything, -it is a good sign.) - -The rule would be: An unescaped backslash followed by any markup -character escapes the character. The escaped character represents the -character itself, and is prevented from playing a role in any markup -interpretation. The backslash is removed from the output. A literal -backslash is represented by an "escaped backslash," two backslashes in -a row. - -A carefully constructed set of recognition rules for inline markup -will obviate the need for backslash-escapes in almost all cases; see -`Delimitation of Inline Markup`_ below. - -When an expression (requiring backslashes and other characters used -for markup) becomes too complicated and therefore unreadable, a -literal block may be used instead. Inside literal blocks, no markup -is recognized, therefore backslashes (for the purpose of escaping -markup) become unnecessary. - -We could allow backslashes preceding non-markup characters to remain -in the output. This would make describing regular expressions and -other uses of backslashes easier. However, this would complicate the -markup rules and would be confusing. - - -Blank Lines in Lists -==================== - -Oft-requested in Doc-SIG (the earliest reference is dated 1996-08-13) -is the ability to write lists without requiring blank lines between -items. In docstrings, space is at a premium. Authors want to convey -their API or usage information in as compact a form as possible. -StructuredText_ requires blank lines between all body elements, -including list items, even when boundaries are obvious from the markup -itself. - -In reStructuredText, blank lines are optional between list items. -However, in order to eliminate ambiguity, a blank line is required -before the first list item and after the last. Nested lists also -require blank lines before the list start and after the list end. - - -Bullet List Markup -================== - -StructuredText_ includes 'o' as a bullet character. This is dangerous -and counter to the language-independent nature of the markup. There -are many languages in which 'o' is a word. For example, in Spanish:: - - Llamame a la casa - o al trabajo. - - (Call me at home or at work.) - -And in Japanese (when romanized):: - - Senshuu no doyoubi ni tegami - o kakimashita. - - ([I] wrote a letter on Saturday last week.) - -If a paragraph containing an 'o' word wraps such that the 'o' is the -first text on a line, or if a paragraph begins with such a word, it -could be misinterpreted as a bullet list. - -In reStructuredText_, 'o' is not used as a bullet character. '-', -'*', and '+' are the possible bullet characters. - - -Enumerated List Markup -====================== - -StructuredText enumerated lists are allowed to begin with numbers and -letters followed by a period or right-parenthesis, then whitespace. -This has surprising consequences for writing styles. For example, -this is recognized as an enumerated list item by StructuredText:: - - Mr. Creosote. - -People will write enumerated lists in all different ways. It is folly -to try to come up with the "perfect" format for an enumerated list, -and limit the docstring parser's recognition to that one format only. - -Rather, the parser should recognize a variety of enumerator styles. -It is also recommended that the enumerator of the first list item be -ordinal-1 ('1', 'A', 'a', 'I', or 'i'), as output formats may not be -able to begin a list at an arbitrary enumeration. - -An initial idea was to require two or more consistent enumerated list -items in a row. This idea proved impractical and was dropped. In -practice, the presence of a proper enumerator is enough to reliably -recognize an enumerated list item; any ambiguities are reported by the -parser. Here's the original idea for posterity: - - The parser should recognize a variety of enumerator styles, mark - each block as a potential enumerated list item (PELI), and - interpret the enumerators of adjacent PELIs to decide whether they - make up a consistent enumerated list. - - If a PELI is labeled with a "1.", and is immediately followed by a - PELI labeled with a "2.", we've got an enumerated list. Or "(A)" - followed by "(B)". Or "i)" followed by "ii)", etc. The chances - of accidentally recognizing two adjacent and consistently labeled - PELIs, are acceptably small. - - For an enumerated list to be recognized, the following must be - true: - - - the list must consist of multiple adjacent list items (2 or - more) - - the enumerators must all have the same format - - the enumerators must be sequential - - -Definition List Markup -====================== - -StructuredText uses ' -- ' (whitespace, two hyphens, whitespace) on -the first line of a paragraph to indicate a definition list item. The -' -- ' serves to separate the term (on the left) from the definition -(on the right). - -Many people use ' -- ' as an em-dash in their text, conflicting with -the StructuredText usage. Although the Chicago Manual of Style says -that spaces should not be used around an em-dash, Peter Funk pointed -out that this is standard usage in German (according to the Duden, the -official German reference), and possibly in other languages as well. -The widespread use of ' -- ' precludes its use for definition lists; -it would violate the "unsurprising" criterion. - -A simpler, and at least equally visually distinctive construct -(proposed by Guido van Rossum, who incidentally is a frequent user of -' -- ') would do just as well:: - - term 1 - Definition. - - term 2 - Definition 2, paragraph 1. - - Definition 2, paragraph 2. - -A reStructuredText definition list item consists of a term and a -definition. A term is a simple one-line paragraph. A definition is a -block indented relative to the term, and may contain multiple -paragraphs and other body elements. No blank line precedes a -definition (this distinguishes definition lists from block quotes). - - -Literal Blocks -============== - -The StructuredText_ specification has literal blocks indicated by -'example', 'examples', or '::' ending the preceding paragraph. STNG -only recognizes '::'; 'example'/'examples' are not implemented. This -is good; it fixes an unnecessary language dependency. The problem is -what to do with the sometimes- unwanted '::'. - -In reStructuredText_ '::' at the end of a paragraph indicates that -subsequent *indented* blocks are treated as literal text. No further -markup interpretation is done within literal blocks (not even -backslash-escapes). If the '::' is preceded by whitespace, '::' is -omitted from the output; if '::' was the sole content of a paragraph, -the entire paragraph is removed (no 'empty' paragraph remains). If -'::' is preceded by a non-whitespace character, '::' is replaced by -':' (i.e., the extra colon is removed). - -Thus, a section could begin with a literal block as follows:: - - Section Title - ------------- - - :: - - print "this is example literal" - - -Tables -====== - -The table markup scheme in classic StructuredText was horrible. Its -omission from StructuredTextNG is welcome, and its markup will not be -repeated here. However, tables themselves are useful in -documentation. Alternatives: - -1. This format is the most natural and obvious. It was independently - invented (no great feat of creation!), and later found to be the - format supported by the `Emacs table mode`_:: - - +------------+------------+------------+--------------+ - | Header 1 | Header 2 | Header 3 | Header 4 | - +============+============+============+==============+ - | Column 1 | Column 2 | Column 3 & 4 span (Row 1) | - +------------+------------+------------+--------------+ - | Column 1 & 2 span | Column 3 | - Column 4 | - +------------+------------+------------+ - Row 2 & 3 | - | 1 | 2 | 3 | - span | - +------------+------------+------------+--------------+ - - Tables are described with a visual outline made up of the - characters '-', '=', '|', and '+': - - - The hyphen ('-') is used for horizontal lines (row separators). - - The equals sign ('=') is optionally used as a header separator - (as of version 1.5.24, this is not supported by the Emacs table - mode). - - The vertical bar ('|') is used for for vertical lines (column - separators). - - The plus sign ('+') is used for intersections of horizontal and - vertical lines. - - Row and column spans are possible simply by omitting the column or - row separators, respectively. The header row separator must be - complete; in other words, a header cell may not span into the table - body. Each cell contains body elements, and may have multiple - paragraphs, lists, etc. Initial spaces for a left margin are - allowed; the first line of text in a cell determines its left - margin. - -2. Below is a simpler table structure. It may be better suited to - manual input than alternative #1, but there is no Emacs editing - mode available. One disadvantage is that it resembles section - titles; a one-column table would look exactly like section & - subsection titles. :: - - ============ ============ ============ ============== - Header 1 Header 2 Header 3 Header 4 - ============ ============ ============ ============== - Column 1 Column 2 Column 3 & 4 span (Row 1) - ------------ ------------ --------------------------- - Column 1 & 2 span Column 3 - Column 4 - ------------------------- ------------ - Row 2 & 3 - 1 2 3 - span - ============ ============ ============ ============== - - The table begins with a top border of equals signs with a space at - each column boundary (regardless of spans). Each row is - underlined. Internal row separators are underlines of '-', with - spaces at column boundaries. The last of the optional head rows is - underlined with '=', again with spaces at column boundaries. - Column spans have no spaces in their underline. Row spans simply - lack an underline at the row boundary. The bottom boundary of the - table consists of '=' underlines. A blank line is required - following a table. - -3. A minimalist alternative is as follows:: - - ==== ===== ======== ======== ======= ==== ===== ===== - Old State Input Action New State Notes - ----------- -------- ----------------- ----------- - ids types new type sys.msg. dupname ids types - ==== ===== ======== ======== ======= ==== ===== ===== - -- -- explicit -- -- new True - -- -- implicit -- -- new False - None False explicit -- -- new True - old False explicit implicit old new True - None True explicit explicit new None True - old True explicit explicit new,old None True [1] - None False implicit implicit new None False - old False implicit implicit new,old None False - None True implicit implicit new None True - old True implicit implicit new old True - ==== ===== ======== ======== ======= ==== ===== ===== - - The table begins with a top border of equals signs with one or more - spaces at each column boundary (regardless of spans). There must - be at least two columns in the table (to differentiate it from - section headers). Each line starts a new row. The rightmost - column is unbounded; text may continue past the edge of the table. - Each row/line must contain spaces at column boundaries, except for - explicit column spans. Underlines of '-' can be used to indicate - column spans, but should be used sparingly if at all. Lines - containing column span underlines may not contain any other text. - The last of the optional head rows is underlined with '=', again - with spaces at column boundaries. The bottom boundary of the table - consists of '=' underlines. A blank line is required following a - table. - - This table sums up the features. Using all the features in such a - small space is not pretty though:: - - ======== ======== ======== - Header 2 & 3 Span - ------------------ - Header 1 Header 2 Header 3 - ======== ======== ======== - Each line is a new row. - Each row consists of one line only. - Row spans are not possible. - The last column may spill over to the right. - Column spans are possible with an underline joining columns. - ---------------------------- - The span is limited to the row above the underline. - ======== ======== ======== - -4. As a variation of alternative 3, bullet list syntax in the first - column could be used to indicate row starts. Multi-line rows are - possible, but row spans are not. For example:: - - ===== ===== - col 1 col 2 - ===== ===== - - 1 Second column of row 1. - - 2 Second column of row 2. - Second line of paragraph. - - 3 Second column of row 3. - - Second paragraph of row 3, - column 2 - ===== ===== - - Column spans would be indicated on the line after the last line of - the row. To indicate a real bullet list within a first-column - cell, simply nest the bullets. - -5. In a further variation, we could simply assume that whitespace in - the first column implies a multi-line row; the text in other - columns is continuation text. For example:: - - ===== ===== - col 1 col 2 - ===== ===== - 1 Second column of row 1. - 2 Second column of row 2. - Second line of paragraph. - 3 Second column of row 3. - - Second paragraph of row 3, - column 2 - ===== ===== - - Limitations of this approach: - - - Cells in the first column are limited to one line of text. - - - Cells in the first column *must* contain some text; blank cells - would lead to a misinterpretation. An empty comment ("..") is - sufficient. - -6. Combining alternative 3 and 4, a bullet list in the first column - could mean multi-line rows, and no bullet list means single-line - rows only. - -Alternatives 1 and 5 has been adopted by reStructuredText. - - -Delimitation of Inline Markup -============================= - -StructuredText specifies that inline markup must begin with -whitespace, precluding such constructs as parenthesized or quoted -emphatic text:: - - "**What?**" she cried. (*exit stage left*) - -The `reStructuredText markup specification`_ allows for such -constructs and disambiguates inline markup through a set of -recognition rules. These recognition rules define the context of -markup start-strings and end-strings, allowing markup characters to be -used in most non-markup contexts without a problem (or a backslash). -So we can say, "Use asterisks (*) around words or phrases to -*emphasisze* them." The '(*)' will not be recognized as markup. This -reduces the need for markup escaping to the point where an escape -character is *almost* (but not quite!) unnecessary. - - -Underlining -=========== - -StructuredText uses '_text_' to indicate underlining. To quote David -Ascher in his 2000-01-21 Doc-SIG mailing list post, "Docstring -grammar: a very revised proposal": - - The tagging of underlined text with _'s is suboptimal. Underlines - shouldn't be used from a typographic perspective (underlines were - designed to be used in manuscripts to communicate to the - typesetter that the text should be italicized -- no well-typeset - book ever uses underlines), and conflict with double-underscored - Python variable names (__init__ and the like), which would get - truncated and underlined when that effect is not desired. Note - that while *complete* markup would prevent that truncation - ('__init__'), I think of docstring markups much like I think of - type annotations -- they should be optional and above all do no - harm. In this case the underline markup does harm. - -Underlining is not part of the reStructuredText specification. - - -Inline Literals -=============== - -StructuredText's markup for inline literals (text left as-is, -verbatim, usually in a monospaced font; as in HTML <TT>) is single -quotes ('literals'). The problem with single quotes is that they are -too often used for other purposes: - -- Apostrophes: "Don't blame me, 'cause it ain't mine, it's Chris'."; - -- Quoting text: - - First Bruce: "Well Bruce, I heard the prime minister use it. - 'S'hot enough to boil a monkey's bum in 'ere your Majesty,' he - said, and she smiled quietly to herself." - - In the UK, single quotes are used for dialogue in published works. - -- String literals: s = '' - -Alternatives:: - - 'text' \'text\' ''text'' "text" \"text\" ""text"" - #text# @text@ `text` ^text^ ``text'' ``text`` - -The examples below contain inline literals, quoted text, and -apostrophes. Each example should evaluate to the following HTML:: - - Some <TT>code</TT>, with a 'quote', "double", ain't it grand? - Does <TT>a[b] = 'c' + "d" + `2^3`</TT> work? - - 0. Some code, with a quote, double, ain't it grand? - Does a[b] = 'c' + "d" + `2^3` work? - 1. Some 'code', with a \'quote\', "double", ain\'t it grand? - Does 'a[b] = \'c\' + "d" + `2^3`' work? - 2. Some \'code\', with a 'quote', "double", ain't it grand? - Does \'a[b] = 'c' + "d" + `2^3`\' work? - 3. Some ''code'', with a 'quote', "double", ain't it grand? - Does ''a[b] = 'c' + "d" + `2^3`'' work? - 4. Some "code", with a 'quote', \"double\", ain't it grand? - Does "a[b] = 'c' + "d" + `2^3`" work? - 5. Some \"code\", with a 'quote', "double", ain't it grand? - Does \"a[b] = 'c' + "d" + `2^3`\" work? - 6. Some ""code"", with a 'quote', "double", ain't it grand? - Does ""a[b] = 'c' + "d" + `2^3`"" work? - 7. Some #code#, with a 'quote', "double", ain't it grand? - Does #a[b] = 'c' + "d" + `2^3`# work? - 8. Some @code@, with a 'quote', "double", ain't it grand? - Does @a[b] = 'c' + "d" + `2^3`@ work? - 9. Some `code`, with a 'quote', "double", ain't it grand? - Does `a[b] = 'c' + "d" + \`2^3\`` work? - 10. Some ^code^, with a 'quote', "double", ain't it grand? - Does ^a[b] = 'c' + "d" + `2\^3`^ work? - 11. Some ``code'', with a 'quote', "double", ain't it grand? - Does ``a[b] = 'c' + "d" + `2^3`'' work? - 12. Some ``code``, with a 'quote', "double", ain't it grand? - Does ``a[b] = 'c' + "d" + `2^3\``` work? - -Backquotes (#9 & #12) are the best choice. They are unobtrusive and -relatviely rarely used (more rarely than ' or ", anyhow). Backquotes -have the connotation of 'quotes', which other options (like carets, -#10) don't. - -Analogously with ``*emph*`` & ``**strong**``, double-backquotes (#12) -could be used for inline literals. If single-backquotes are used for -'interpreted text' (context-sensitive domain-specific descriptive -markup) such as function name hyperlinks in Python docstrings, then -double-backquotes could be used for absolute-literals, wherein no -processing whatsoever takes place. An advantage of double-backquotes -would be that backslash-escaping would no longer be necessary for -embedded single-backquotes; however, embedded double-backquotes (in an -end-string context) would be illegal. See `Backquotes in -Phrase-Links`__ in `Record of reStructuredText Syntax Alternatives`__. - -__ alternatives.html#backquotes-in-phrase-links -__ alternatives.html - -Alternative choices are carets (#10) and TeX-style quotes (#11). For -examples of TeX-style quoting, see -http://www.zope.org/Members/jim/StructuredTextWiki/CustomizingTheDocumentProcessor. - -Some existing uses of backquotes: - -1. As a synonym for repr() in Python. -2. For command-interpolation in shell scripts. -3. Used as open-quotes in TeX code (and carried over into plaintext - by TeXies). - -The inline markup start-string and end-string recognition rules -defined by the `reStructuredText markup specification`_ would allow -all of these cases inside inline literals, with very few exceptions. -As a fallback, literal blocks could handle all cases. - -Outside of inline literals, the above uses of backquotes would require -backslash-escaping. However, these are all prime examples of text -that should be marked up with inline literals. - -If either backquotes or straight single-quotes are used as markup, -TeX-quotes are too troublesome to support, so no special-casing of -TeX-quotes should be done (at least at first). If TeX-quotes have to -be used outside of literals, a single backslash-escaped would suffice: -\``TeX quote''. Ugly, true, but very infrequently used. - -Using literal blocks is a fallback option which removes the need for -backslash-escaping:: - - like this:: - - Here, we can do ``absolutely'' anything `'`'\|/|\ we like! - -No mechanism for inline literals is perfect, just as no escaping -mechanism is perfect. No matter what we use, complicated inline -expressions involving the inline literal quote and/or the backslash -will end up looking ugly. We can only choose the least often ugly -option. - -reStructuredText will use double backquotes for inline literals, and -single backqoutes for interpreted text. - - -Hyperlinks -========== - -There are three forms of hyperlink currently in StructuredText_: - -1. (Absolute & relative URIs.) Text enclosed by double quotes - followed by a colon, a URI, and concluded by punctuation plus white - space, or just white space, is treated as a hyperlink:: - - "Python":http://www.python.org/ - -2. (Absolute URIs only.) Text enclosed by double quotes followed by a - comma, one or more spaces, an absolute URI and concluded by - punctuation plus white space, or just white space, is treated as a - hyperlink:: - - "mail me", mailto:me@mail.com - -3. (Endnotes.) Text enclosed by brackets link to an endnote at the - end of the document: at the beginning of the line, two dots, a - space, and the same text in brackets, followed by the end note - itself:: - - Please refer to the fine manual [GVR2001]. - - .. [GVR2001] Python Documentation, Release 2.1, van Rossum, - Drake, et al., http://www.python.org/doc/ - -The problem with forms 1 and 2 is that they are neither intuitive nor -unobtrusive (they break design goals 5 & 2). They overload -double-quotes, which are too often used in ordinary text (potentially -breaking design goal 4). The brackets in form 3 are also too common -in ordinary text (such as [nested] asides and Python lists like [12]). - -Alternatives: - -1. Have no special markup for hyperlinks. - -2. A. Interpret and mark up hyperlinks as any contiguous text - containing '://' or ':...@' (absolute URI) or '@' (email - address) after an alphanumeric word. To de-emphasize the URI, - simply enclose it in parentheses: - - Python (http://www.python.org/) - - B. Leave special hyperlink markup as a domain-specific extension. - Hyperlinks in ordinary reStructuredText documents would be - required to be standalone (i.e. the URI text inline in the - document text). Processed hyperlinks (where the URI text is - hidden behind the link) are important enough to warrant syntax. - -3. The original Setext_ introduced a mechanism of indirect hyperlinks. - A source link word ('hot word') in the text was given a trailing - underscore:: - - Here is some text with a hyperlink_ built in. - - The hyperlink itself appeared at the end of the document on a line - by itself, beginning with two dots, a space, the link word with a - leading underscore, whitespace, and the URI itself:: - - .. _hyperlink http://www.123.xyz - - Setext used ``underscores_instead_of_spaces_`` for phrase links. - -With some modification, alternative 3 best satisfies the design goals. -It has the advantage of being readable and relatively unobtrusive. -Since each source link must match up to a target, the odd variable -ending in an underscore can be spared being marked up (although it -should generate a "no such link target" warning). The only -disadvantage is that phrase-links aren't possible without some -obtrusive syntax. - -We could achieve phrase-links if we enclose the link text: - -1. in double quotes:: - - "like this"_ - -2. in brackets:: - - [like this]_ - -3. or in backquotes:: - - `like this`_ - -Each gives us somewhat obtrusive markup, but that is unavoidable. The -bracketed syntax (#2) is reminiscent of links on many web pages -(intuitive), although it is somewhat obtrusive. Alternative #3 is -much less obtrusive, and is consistent with interpreted text: the -trailing underscore indicates the interpretation of the phrase, as a -hyperlink. #3 also disambiguates hyperlinks from footnote references. -Alternative #3 wins. - -The same trailing underscore markup can also be used for footnote and -citation references, removing the problem with ordinary bracketed text -and Python lists:: - - Please refer to the fine manual [GVR2000]_. - - .. [GVR2000] Python Documentation, van Rossum, Drake, et al., - http://www.python.org/doc/ - -The two-dots-and-a-space syntax was generalized by Setext for -comments, which are removed from the (visible) processed output. -reStructuredText uses this syntax for comments, footnotes, and link -target, collectively termed "explicit markup". For link targets, in -order to eliminate ambiguity with comments and footnotes, -reStructuredText specifies that a colon always follow the link target -word/phrase. The colon denotes 'maps to'. There is no reason to -restrict target links to the end of the document; they could just as -easily be interspersed. - -Internal hyperlinks (links from one point to another within a single -document) can be expressed by a source link as before, and a target -link with a colon but no URI. In effect, these targets 'map to' the -element immediately following. - -As an added bonus, we now have a perfect candidate for -reStructuredText directives, a simple extension mechanism: explicit -markup containing a single word followed by two colons and whitespace. -The interpretation of subsequent data on the directive line or -following is directive-dependent. - -To summarize:: - - .. This is a comment. - - .. The line below is an example of a directive. - .. version:: 1 - - This is a footnote [1]_. - - This internal hyperlink will take us to the footnotes_ area below. - - Here is a one-word_ external hyperlink. - - Here is `a hyperlink phrase`_. - - .. _footnotes: - .. [1] Footnote text goes here. - - .. external hyperlink target mappings: - .. _one-word: http://www.123.xyz - .. _a hyperlink phrase: http://www.123.xyz - -The presence or absence of a colon after the target link -differentiates an indirect hyperlink from a footnote, respectively. A -footnote requires brackets. Backquotes around a target link word or -phrase are required if the phrase contains a colon, optional -otherwise. - -Below are examples using no markup, the two StructuredText hypertext -styles, and the reStructuredText hypertext style. Each example -contains an indirect link, a direct link, a footnote/endnote, and -bracketed text. In HTML, each example should evaluate to:: - - <P>A <A HREF="http://spam.org">URI</A>, see <A HREF="#eggs2000"> - [eggs2000]</A> (in Bacon [Publisher]). Also see - <A HREF="http://eggs.org">http://eggs.org</A>.</P> - - <P><A NAME="eggs2000">[eggs2000]</A> "Spam, Spam, Spam, Eggs, - Bacon, and Spam"</P> - -1. No markup:: - - A URI http://spam.org, see eggs2000 (in Bacon [Publisher]). - Also see http://eggs.org. - - eggs2000 "Spam, Spam, Spam, Eggs, Bacon, and Spam" - -2. StructuredText absolute/relative URI syntax - ("text":http://www.url.org):: - - A "URI":http://spam.org, see [eggs2000] (in Bacon [Publisher]). - Also see "http://eggs.org":http://eggs.org. - - .. [eggs2000] "Spam, Spam, Spam, Eggs, Bacon, and Spam" - - Note that StructuredText does not recognize standalone URIs, - forcing doubling up as shown in the second line of the example - above. - -3. StructuredText absolute-only URI syntax - ("text", mailto:you@your.com):: - - A "URI", http://spam.org, see [eggs2000] (in Bacon - [Publisher]). Also see "http://eggs.org", http://eggs.org. - - .. [eggs2000] "Spam, Spam, Spam, Eggs, Bacon, and Spam" - -4. reStructuredText syntax:: - - 4. A URI_, see [eggs2000]_ (in Bacon [Publisher]). - Also see http://eggs.org. - - .. _URI: http:/spam.org - .. [eggs2000] "Spam, Spam, Spam, Eggs, Bacon, and Spam" - -The bracketed text '[Publisher]' may be problematic with -StructuredText (syntax 2 & 3). - -reStructuredText's syntax (#4) is definitely the most readable. The -text is separated from the link URI and the footnote, resulting in -cleanly readable text. - -.. _StructuredText: - http://dev.zope.org/Members/jim/StructuredTextWiki/FrontPage -.. _Setext: http://docutils.sourceforge.net/mirror/setext.html -.. _reStructuredText: http://docutils.sourceforge.net/rst.html -.. _detailed description: - http://www.tibsnjoan.demon.co.uk/STNG-format.html -.. _STMinus: http://www.cis.upenn.edu/~edloper/pydoc/stminus.html -.. _StructuredTextNG: - http://dev.zope.org/Members/jim/StructuredTextWiki/StructuredTextNG -.. _README: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/~checkout~/ - python/python/dist/src/README -.. _Emacs table mode: http://table.sourceforge.net/ -.. _reStructuredText Markup Specification: reStructuredText.html - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: diff --git a/docutils/docs/dev/semantics.txt b/docutils/docs/dev/semantics.txt deleted file mode 100644 index cd20e15f6..000000000 --- a/docutils/docs/dev/semantics.txt +++ /dev/null @@ -1,119 +0,0 @@ -===================== - Docstring Semantics -===================== -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This document has been placed in the public domain. - -These are notes for a possible future PEP providing the final piece of -the Python docstring puzzle: docstring semantics or documentation -methodology. `PEP 257`_, Docstring Conventions, sketches out some -guidelines, but does not get into methodology details. - -I haven't explored documentation methodology more because, in my -opinion, it is a completely separate issue from syntax, and it's even -more controversial than syntax. Nobody wants to be told how to lay -out their documentation, a la JavaDoc_. I think the JavaDoc way is -butt-ugly, but it *is* an established standard for the Java world. -Any standard documentation methodology has to be formal enough to be -useful but remain light enough to be usable. If the methodology is -too strict, too heavy, or too ugly, many/most will not want to use it. - -I think a standard methodology could benefit the Python community, but -it would be a hard sell. A PEP would be the place to start. For most -human-readable documentation needs, the free-form text approach is -adequate. We'd only need a formal methodology if we want to extract -the parameters into a data dictionary, index, or summary of some kind. - - -PythonDoc -========= - -(Not to be confused with Daniel Larsson's pythondoc_ project.) - -A Python version of the JavaDoc_ semantics (not syntax). A set of -conventions which are understood by the Docutils. What JavaDoc has -done is to establish a syntax that enables a certain documentation -methodology, or standard *semantics*. JavaDoc is not just syntax; it -prescribes a methodology. - -- Use field lists or definition lists for "tagged blocks". By this I - mean that field lists can be used similarly to JavaDoc's ``@tag`` - syntax. That's actually one of the motivators behind field lists. - For example, we could have:: - - """ - :Parameters: - - `lines`: a list of one-line strings without newlines. - - `until_blank`: Stop collecting at the first blank line if - true (1). - - `strip_indent`: Strip common leading indent if true (1, - default). - - :Return: - - a list of indented lines with mininum indent removed; - - the amount of the indent; - - whether or not the block finished with a blank line or at - the end of `lines`. - """ - - This is taken straight out of docutils/statemachine.py, in which I - experimented with a simple documentation methodology. Another - variation I've thought of exploits the Grouch_-compatible - "classifier" element of definition lists. For example:: - - :Parameters: - `lines` : [string] - List of one-line strings without newlines. - `until_blank` : boolean - Stop collecting at the first blank line if true (1). - `strip_indent` : boolean - Strip common leading indent if true (1, default). - -- Field lists could even be used in a one-to-one correspondence with - JavaDoc ``@tags``, although I doubt if I'd recommend it. Several - ports of JavaDoc's ``@tag`` methodology exist in Python, most - recently Ed Loper's "epydoc_". - - -Other Ideas -=========== - -- Can we extract comments from parsed modules? Could be handy for - documenting function/method parameters:: - - def method(self, - source, # path of input file - dest # path of output file - ): - - This would save having to repeat parameter names in the docstring. - - Idea from Mark Hammond's 1998-06-23 Doc-SIG post, "Re: [Doc-SIG] - Documentation tool": - - it would be quite hard to add a new param to this method without - realising you should document it - -- Frederic Giacometti's `iPhrase Python documentation conventions`_ is - an attachment to his Doc-SIG post of 2001-05-30. - - -.. _PEP 257: http://www.python.org/peps/pep-0257.html -.. _JavaDoc: http://java.sun.com/j2se/javadoc/ -.. _pythondoc: http://starship.python.net/crew/danilo/pythondoc/ -.. _Grouch: http://www.mems-exchange.org/software/grouch/ -.. _epydoc: http://epydoc.sf.net/ -.. _iPhrase Python documentation conventions: - http://mail.python.org/pipermail/doc-sig/2001-May/001840.html - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: diff --git a/docutils/docs/dev/todo.txt b/docutils/docs/dev/todo.txt deleted file mode 100644 index eab2208fe..000000000 --- a/docutils/docs/dev/todo.txt +++ /dev/null @@ -1,2114 +0,0 @@ -================= - Docutils_ Notes -================= -:Author: David Goodger (with input from many) -:Contact: goodger@users.sourceforge.net -:Date: $Date$ -:Revision: $Revision$ -:Copyright: This document has been placed in the public domain. - -.. _Docutils: http://docutils.sourceforge.net/ - -.. contents:: - - -To Do -===== - -Priority items are marked with "@" symbols. The more @s, the higher -the priority. Items in question form (containing "?") are ideas which -require more thought and debate; they are potential to-do's. - -Many of these items are awaiting champions. If you see something -you'd like to tackle, please do! - - -Bugs ----- - -* The "contents" directive now automatically names the "topic" - produced (using its title), so that it can be referred to by name. - However, this naming happens late in the game, after most references - have been resolved. So the following indirect target produces a - warning because the name "contents" is not available when resolved:: - - .. contents:: - - .. _alternate name for contents: contents_ - - Fixing this may be tricky, and isn't a high priority. - - Idea: two-pass hyperlink resolution, ignoring errors on the first - pass? - - Perhaps the directive should do a bit more work up-front: create the - "topic" and "title", and leave the "pending" node for contents. - -* The parser doesn't know anything about double-width characters such - as Chinese hanza & Japanese kanji/kana. Also, it's dependent on - whitespace and punctuation as markup delimiters, which may not be - applicable in these languages. - -* In text inserted by the "include" directive, errors are often not - reported with the correct "source" or "line" numbers. Perhaps all - Reporter calls need a "base_node" parameter. There's a test in - test/test_parsers/test_rst/test_directives/test_include.py - (commented out, because the test fails). - -* tools/buildhtml.py needs a mechanism to skip directories - (e.g. licenses, test). Perhaps a ".prune-buildhtml" file? A - command-line option wouldn't work because it would require user - action. - - -General -------- - -* Refactor - - - Rename methods & variables according to the `Python coding - conventions`_ below. - - - The name-to-id conversion and hyperlink resolution code needs to be - checked for correctness and refactored. I'm afraid it's a bit of - a spaghetti mess now. - -* Add validation? See http://pytrex.sourceforge.net, RELAX NG, pyRXP. - -* Ask Python-dev for opinions (GvR for a pronouncement) on special - variables (__author__, __version__, etc.): convenience vs. namespace - pollution. Ask opinions on whether or not Docutils should recognize - & use them. - -* In ``docutils.readers.get_reader_class`` (& ``parsers`` & - ``writers`` too), should we be importing "standalone" or - "docutils.readers.standalone"? (This would avoid importing - top-level modules if the module name is not in docutils/readers. - Potential nastiness.) - -* Perhaps store a _`name-to-id mapping file`? This could be stored - permanently, read by subsequent processing runs, and updated with - new entries. ("Persistent ID mapping"?) - -* Need a Unicode to HTML entities codec for HTML writer? - -* Perhaps the ``Component.supports`` method should deal with - individual features ("meta" etc.) instead of formats ("html" etc.)? - -* Standalone Reader: Implement an option to turn off the DocTitle - transform? - -* Add /usr/etc/docutils.conf to config file list? System-wide, - whereas /etc/docutils.conf is machine-specific. - /usr/local/etc/docutils.conf too? See the `Filesystem Hierarchy - Standard`_. - - .. _Filesystem Hierarchy Standard: http://www.pathname.com/fhs. - -* Add _`object numbering and object references` (tables & figures). - These would be the equivalent of DocBook's "formal" elements. - - We may need _`persistent sequences`, such as chapter numbers. See - `OpenOffice.org XML`_ "fields". Should the sequences be automatic - or manual (user-specifyable)? - - We need to name the objects: - - - "name" option for the "figure" directive? :: - - .. figure:: image.png - :name: image's name - - To name tables, we could use a "table" directive:: - - .. table:: optional title here - :name: table's name - - ===== ===== - x not x - ===== ===== - True False - False True - ===== ===== - - This would also allow other options to be set, like border - styles. The same technique could be used for other objects. - - - The object could also be done this way:: - - .. _figure name: - - .. figure:: image.png - - This may be a more general solution, equally applicable to tables. - However, explicit naming using an option seems simpler to users. - - We'll also need syntax for object references. See `OpenOffice.org - XML`_ "reference fields": - - - Parameterized substitutions? For example:: - - See |figure (figure name)|, on |page (figure name)|. - - .. |figure (name)| figure-ref:: (name) - .. |page (name)| page-ref:: (name) - - The result would be:: - - See figure 3.11 on page 157. - - But this would require substitution directives to be processed at - reference-time, not at definition-time as they are now. Or, - perhaps the directives could just leave ``pending`` elements - behind, and the transforms do the work? How to pass the data - through? Too complicated. - - - An interpreted text approach is simpler and better:: - - See :figure:`figure name` on :page:`figure name`. - - The "figure" and "page" roles could generate appropriate - boilerplate text. The position of the role (prefix or suffix) - could also be utilized. - - See `Interpreted Text`_ below. - - .. _OpenOffice.org XML: http://xml.openoffice.org/ - -* Think about large documents made up of multiple subdocument files. - Issues: continuity (`persistent sequences`_ above), cross-references - (`name-to-id mapping file`_ above and `targets in other documents`_ - below). - - When writing a book, the author probably wants to split it up into - files, perhaps one per chapter (but perhaps even more detailed). - However, we'd like to be able to have references from one chapter to - another, and have continuous numbering (pages and chapters, as - applicable). Of course, none of this is implemented yet. There has - been some thought put into some aspects; see `the "include" - directive`__ and the `Reference Merging`_ transform below. - - When I was working with SGML in Japan, we had a system where there - was a top-level coordinating file, book.sgml, which contained the - top-level structure of a book: the <book> element, containing the - book <title> and empty component elements (<preface>, <chapter>, - <appendix>, etc.), each with filename attributes pointing to the - actual source for the component. Something like this:: - - <book id="bk01"> - <title>Title of the Book - - - - - - - - (The "inrefid" attribute stood for "insertion reference ID".) - - The processing system would process each component separately, but - it would recognize and use the book file to coordinate chapter and - page numbering, and keep a persistent ID to (title, page number) - mapping database for cross-references. Docutils could use a similar - system for large-scale, multipart documents. - - __ rst/directives.html#including-an-external-document-fragment - - Aahz's idea: - - First the ToC:: - - .. ToC-list:: - Introduction.txt - Objects.txt - Data.txt - Control.txt - - Then a sample use:: - - .. include:: ToC.txt - - As I said earlier in chapter :chapter:`Objects.txt`, the - reference count gets increased every time a binding is made. - - Which produces:: - - As I said earlier in chapter 2, the - reference count gets increased every time a binding is made. - - The ToC in this form doesn't even need to be references to actual - reST documents; I'm simply doing it that way for a minimum of - future-proofing, in case I do want to add the ability to pick up - references within external chapters. - - Perhaps, instead of ToC (which would overload the "contents" - directive concept already in use), we could use "manifest". A - "manifest" directive might associate local reference names with - files:: - - .. manifest:: - intro: Introduction.txt - objects: Objects.txt - data: Data.txt - control: Control.txt - - Then the sample becomes:: - - .. include:: manifest.txt - - As I said earlier in chapter :chapter:`objects`, the - reference count gets increased every time a binding is made. - -* Add functional testing to Docutils: Readers, Writers, front ends. - -* Changes to sandbox/davidg/infrastructure/docutils-update? - - - Modify the script to only update the snapshots if files have - actually changed in CVS (saving some SourceForge server cycles). - - - Make passing the test suite a prerequisite to snapshot update, - but only if the process is completely automatic. - - - Rewrite in Python? - -* Publisher: "Ordinary setup" shouldn't requre specific ordering; at - the very least, there ought to be error checking higher up in the - call chain. [Aahz] - - ``Publisher.get_settings`` requires that all components be set up - before it's called. Perhaps the I/O *objects* shouldn't be set, but - I/O *classes*. Then options are set up (``.set_options``), and - ``Publisher.set_io`` (or equivalent code) is called with source & - destination paths, creating the I/O objects. - - Perhaps I/O objects shouldn't be instantiated until required. For - split output, the Writer may be called multiple times, once for each - doctree, and each doctree should have a separate Output object (with - a different path). Is the "Builder" pattern applicable here? - -* Perhaps I/O objects should become full-fledged components (i.e. - subclasses of ``docutils.Component``, as are Readers, Parsers, and - Writers now), and thus have associated option/setting specs and - transforms. - -* Multiple file I/O suggestion from Michael Hudson: use a file-like - object or something you can iterate over to get file-like objects. - -* Language modules: in accented languages it may be useful to have - both accented and unaccented entries in the ``bibliographic_fields`` - mapping for versatility. - -* Add a "--strict-language" option & setting: no English fallback for - language-dependent features. - -* Add an "--input-language" option & setting? Specify a different - language module for input (bibliographic fields, directives) than - for output. The "--language" option would set both input & output - languages. - -* Auto-generate reference tables for language-dependent features? - Could be generated from the source modules. A special command-line - option could be added to Docutils front ends to do this. (Idea from - Engelbert Gruber.) - -* Change the "class" attribute of elements (set with - Element.set_class) to a list? - -* Enable feedback of some kind from internal decisions, such as - reporting the successful input encoding. Modify runtime settings? - System message? Simple stderr output? - -* Perhaps we need to re-evaluate the config file format, possibly - enabling a section for each Docutils component so that (for example) - HTML's and LaTeX's stylesheets don't interfere with each other. - - Idea: adopt sections in the config file corresponding to Docutils - components, which define flat namespaces that can be applied in an - overlay fashion defined by the components themselves. For example, - if the "pep_html" writer defines itself as derivative of the - "html4css1" writer, the "stylesheet" setting in the "[html4css1]" - section will be used unless the "[pep_html]" section overrides it. - In the absence of any "stylesheet" setting in either section, a - "stylesheet" setting in "[general]" would be used. This would also - allow component-specific definitions of general or - other-component-specific settings, such as writer-specific overrides - for the "trim_footnote_reference_space" parser setting. - -* The "docutils.conf" included with Docutils should become complete, - with examples of every setting (possibly commented). It's currently - sparse, requiring doc lookups. - -* Add internationalization to footer boilerplate text (resulting from - "--generator", "--source-link", and "--date" etc.), allowing - translations. - - -Documentation -------------- - -* User docs. What's needed? - - -Implementation Docs -``````````````````` - -* Internal module documentation (docstrings). - -* spec/doctree.txt: DTD element structural relationships, semantics, - and attributes. In progress; element descriptions to be completed. - -* How-to docs: In spec/howto/. - - - How a Writer works & how to write one - - - Transforms - -* Document the ``pending`` elements, how they're generated and what - they do. - -* Document the transforms (perhaps in docstrings?): how they're used, - what they do, dependencies & order considerations. - -* Document the HTML classes used by html4css1.py. - - -Specification -````````````` - -* Complete PEP 258 Docutils Design Specification. - - - Fill in the blanks in API details. - - - Specify the nodes.py internal data structure implementation? - - [Tibs:] Eventually we need to have direct documentation in - there on how it all hangs together - the DTD is not enough - (indeed, is it still meant to be correct? [Yes, it is. - --DG]). - -* Rework PEP 257, separating style from spec from tools, wrt Docutils? - See Doc-SIG from 2001-06-19/20. - - -Web Site -```````` - -* Add an "examples" directory, beside "tools" and "docs", for - interesting examples of Docutils usage? Have a top-level README.txt - file and a subdirectory for each example. (Martin Blais) - - -Python Source Reader --------------------- - -General: - -* Analyze Tony Ibbs' PySource code. - -* Analyze Doug Hellmann's HappyDoc project. - -* Investigate how POD handles literate programming. - -* Take the best ideas and integrate them into Docutils 0.3. - -Miscellaneous ideas: - -* If we can detect that a comment block begins with ``##``, a la - JavaDoc, it might be useful to indicate interspersed section headers - & explanatory text in a module. For example:: - - """Module docstring.""" - - ## - # Constants - # ========= - - a = 1 - b = 2 - - ## - # Exception Classes - # ================= - - class MyException(Exception): pass - - # etc. - -* Should standalone strings also become (module/class) docstrings? - Under what conditions? We want to prevent arbitrary strings from - becomming docstrings of prior attribute assignments etc. Assume - that there must be no blank lines between attributes and attribute - docstrings? (Use lineno of NEWLINE token.) - - Triple-quotes are sometimes used for multi-line comments (such as - commenting out blocks of code). How to reconcile? - -* HappyDoc's idea of using comment blocks when there's no docstring - may be useful to get around the conflict between `additional - docstrings`_ and ``from __future__ import`` for module docstrings. - A module could begin like this:: - - #!/usr/bin/env python - # :Author: Me - # :Copyright: whatever - - """This is the public module docstring (``__doc__``).""" - - # More docs, in comments. - # All comments at the beginning of a module could be - # accumulated as docstrings. - # We can't have another docstring here, because of the - # ``__future__`` statement. - - from __future__ import division - - Using the JavaDoc convention of a doc-comment block beginning with - ``##`` is useful though. It allows doc-comments and implementation - comments. - - .. _additional docstrings: pep-0258.html#additional-docstrings - -* HappyDoc uses an initial comment block to set "parser configuration - values". Do the same thing for Docutils, to set runtime settings on - a per-module basis? I.e.:: - - # Docutils:setting=value - - Could be used to turn on/off function parameter comment recognition - & other marginal features. Could be used as a general mechanism to - augment config files and command-line options (but which takes - precedence?). - -* Multi-file output should be divisible at arbitrary level. - -* Support all forms of ``import`` statements: - - - ``import module``: listed as "module" - - ``import module as alias``: "alias (module)" - - ``from module import identifier``: "identifier (from module)" - - ``from module import identifier as alias``: "alias (identifier - from module)" - - ``from module import *``: "all identifiers (``*``) from module" - -* Have links to colorized Python source files from API docs? And - vice-versa: backlinks from the colorized source files to the API - docs! - -* In summaries, use the first *sentence* of a docstring if the first - line is not followed by a blank line. - - -reStructuredText Parser ------------------------ - -Also see the `... Or Not To Do?`__ list. - -__ rst/alternatives.html#or-not-to-do - -* Clean up the code; refactor as required. - -* Add motivation sections for constructs in spec. - -* Allow very long titles (on two or more lines)? - -* And for the sake of completeness, should definition list terms be - allowed to be very long (two or more lines) also? - -* Support generic hyperlink references to _`targets in other - documents`? Not in an HTML-centric way, though (it's trivial to say - ``http://www.example.com/doc#name``, and useless in non-HTML - contexts). XLink/XPointer? ``.. baseref::``? See Doc-SIG - 2001-08-10. - -* .. _adaptable file extensions: - - In target URLs, it would be useful to not explicitly specify the - file extension. If we're generating HTML, then ".html" is - appropriate; if PDF, then ".pdf"; etc. How about using ".*" to - indicate "choose the most appropriate filename extension? For - example:: - - .. _Another Document: another.* - - Should the choice be from among existing files only? Documents - only, or objects (images, etc.) also? (How to differentiate? - Element context [within "image"]?) - - This may not be just a parser issue though; it may need framework - support. - -* Implement the header row separator modification to table.el. (Wrote - to Takaaki Ota & the table.el mailing list on 2001-08-12, suggesting - support for "=====" header rows. On 2001-08-17 he replied, saying - he'd put it on his to-do list, but "don't hold your breath".) - -* Tony says inline markup rule 7 could do with a *little* more - exposition in the spec, to make clear what is going on for people - with head colds. - -* @@ Fix the parser's indentation handling to conform with the - stricter definition in the spec. (Explicit markup blocks should be - strict or forgiving?) - -* @@ Tighten up the spec for indentation of "constructs using complex - markers": field lists and option lists? Bodies may begin on the - same line as the marker or on a subsequent line (with blank lines - optional). Require that for bodies beginning on the same line as - the marker, all lines be in strict alignment. Currently, this is - acceptable:: - - :Field-name-of-medium-length: Field body beginning on the same - line as the field name. - - This proposal would make the above example illegal, instead - requiring strict alignment. A field body may either begin on the - same line:: - - :Field-name-of-medium-length: Field body beginning on the same - line as the field name. - - Or it may begin on a subsequent line:: - - :Field-name-of-medium-length: - Field body beginning on a line subsequent to that of the - field name. - - This would be especially relevant in degenerate cases like this:: - - :Number-of-African-swallows-requried-to-carry-a-coconut: - It would be very difficult to align the field body with - the left edge of the first line if it began on the same - line as the field name. - -* Allow for variant styles by interpreting indented lists as if they - weren't indented? For example, currently the list below will be - parsed as a list within a block quote:: - - paragraph - - * list item 1 - * list item 2 - - But a lot of people seem to write that way, and HTML browsers make - it look as if that's the way it should be. The parser could check - the contents of block quotes, and if they contain only a single - list, remove the block quote wrapper. There would be two problems: - - 1. What if we actually *do* want a list inside a block quote? - - 2. What if such a list comes immediately after an indented - construct, such as a literal block? - - Both could be solved using empty comments (problem 2 already exists - for a block quote after a literal block). But that's a hack. - - Perhaps a runtime setting, allowing or disabling this convenience, - would be appropriate. But that raises issues too: - - User A, who writes lists indented (and their config file is set - up to allow it), sends a file to user B, who doesn't (and their - config file disables indented lists). The result of processing - by the two users will be different. - - It may seem minor, but it adds ambiguity to the parser, which is - bad. - - See the Doc-SIG discussion starting 2001-04-18 with Ed Loper's - "Structuring: a summary; and an attempt at EBNF", item 4. Also - docutils-users, 2003-02-17. - -* Make the parser modular. Allow syntax constructs to be added or - disabled at run-time. Or is subclassing enough? - -* Continue to report (info, level 1) enumerated lists whose start - value is not ordinal-1? - -* Generalize the "doctest block" construct (which is overly - Python-centric) to other interactive sessions? "Doctest block" - could be renamed to "I/O block" or "interactive block", and each of - these could also be recognized as such by the parser: - - - Shell sessions:: - - $ cat example1.txt - A block beginning with a "$ " prompt is interpreted as a shell - session interactive block. As with Doctest blocks, the - interactive block ends with the first blank line, and wouldn't - have to be indented. - - - Root shell sessions:: - - # cat example2.txt - A block beginning with a "# " prompt is interpreted as a root - shell session (the user is or has to be logged in as root) - interactive block. Again, the block ends with a blank line. - - Other standard (and unambiguous) interactive session prompts could - easily be added (such as "> " for WinDOS). - - Tony Ibbs spoke out against this idea (2002-06-14 Doc-SIG thread - "docutils feedback"). - -* Generalize the "literal block" construct to allow blocks with a - per-line quoting to avoid indentation? For example, in this email - reply quoting the original, the block quoted with "``>``" (and - prefaced by "``::``") would be treated as a literal block:: - - John Doe wrote:: - - >> Great idea! - > - > Why didn't I think of that? - - You just did! ;-) - - The literal block would have to be a continuous text block (the - first blank line ends it) where every line begins with the same - non-alphanumeric non-whitespace character. - -* Should the "doctest" element go away, and the construct simply be a - front-end to generic literal blocks? - -* Add support for pragma (syntax-altering) directives. - - Some pragma directives could be local-scope unless explicitly - specified as global/pragma using ":global:" options. - -* Remove leading numbers from section titles for implicit link names? - A section titled "3. Conclusion" could then be referred to by - "``Conclusion_``" (i.e., without the "3."). - -* Syntax for the "line-block" directive? How about a - literal-block-like prefix, perhaps "``;;``"? (It is, after all, a - *semi-literal* literal block, no?) Example:: - - Take it away, Eric the Orchestra Leader! ;; - - A one, two, a one two three four - - Half a bee, philosophically, - must, *ipso facto*, half not be. - But half the bee has got to be, - *vis a vis* its entity. D'you see? - - But can a bee be said to be - or not to be an entire bee, - when half the bee is not a bee, - due to some ancient injury? - - Singing... - - Another idea: in an ordinary paragraph, if the first line ends with - a backslash (escaping the newline), interpret the entire paragraph - as a verse block? For example:: - - Add just one backslash\ - And this paragraph becomes - An awful haiku - - (And arguably invalid, since in Japanese the word "haiku" contains - three syllables.) - -* Implement auto-enumerated lists? See `Auto-Enumerated Lists`__. - - __ rst/alternatives.html#auto-enumerated-lists - -* Support whitespace in angle-bracketed standalone URLs according to - Appendix E ("Recommendations for Delimiting URI in Context") of `RFC - 2396`_. - - .. _RFC 2396: http://www.rfc-editor.org/rfc/rfc2396.txt - -* Use the vertical spacing of the source text to determine the - corresponding vertical spacing of the output? - -* [From Mark Nodine] For cells in simple tables that comprise a - single line, the justification can be inferred according to the - following rules: - - 1. If the text begins at the leftmost column of the cell, - then left justification, ELSE - 2. If the text begins at the rightmost column of the cell, - then right justification, ELSE - 3. Center justification. - - The onus is on the author to make the text unambiguous by adding - blank columns as necessary. There should be a parser setting to - turn off justification-recognition (normally on would be fine). - - Decimal justification? - -* Make enumerated list parsing more strict, so that this would parse - as a paragraph with an info message:: - - 1. line one - 3. line two - -* Line numbers in system messages are inconsistent in the parser. - Fix? - -* Generalize the "target-notes" directive into a command-line option - somehow? See docutils-develop 2003-02-13. - -* Include the _`character entity substitution definition files` - `temporarily stored here `__, perhaps in a - ``docutils/parsers/rst/includes/`` directory. See `misc.include`_ - below. - -* Should ^L (or something else in reST) be defined to mean - force/suggest page breaks in whatever output we have? - - A "break" or "page-break" directive would be easy to add. A new - doctree element would be required though (perhaps "break"). The - final behavior would be up to the Writer. The directive argument - could be one of page/column/recto/verso for added flexibility. - - Currently ^L (Python's "\f") characters are treated as whitespace. - They're converted to single spaces, actually, as are vertical tabs - (^K, Python's "\v"). It would be possible to recognize form feeds - as markup, but it requires some thought and discussion first. Are - there any downsides? Many editing environments do not allow the - insertion of control characters. Will it cause any harm? It would - be useful as a shorthand for the directive. - - It's common practice to use ^L before Emacs "Local Variables" - lists:: - - ^L - .. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: - - These are already present in many PEPs and Docutils project - documents. From the Emacs manual (info): - - A "local variables list" goes near the end of the file, in the - last page. (It is often best to put it on a page by itself.) - - It would be unfortunate if this construct caused a final blank page - to be generated (for those Writers that recognize the page breaks). - We'll have to add a transform that looks for a "break" plus zero or - more comments at the end of a document, and removes them. - -* Could the "break" concept above be extended to inline forms? - E.g. "^L" in the middle of a sentence could cause a line break. - Only recognize it at the end of a line (i.e., "\f\n")? - - Or is formfeed inappropriate? Perhaps vertical tab ("\v"), but even - that's a stretch. Can't use carriage returns, since they're - commonly used for line endings. - -* Allow a "::"-only paragraph (first line, actually) to introduce a - literal block without a blank line? (Idea from Paul Moore.) :: - - :: - This is a literal block - - Is indentation enough to make the separation between a paragraph - which contains just a ``::`` and the literal text unambiguous? - There's one problem with this concession. What if one wants a - definition list item which defines the term "::"? We'd have to - escape it. Currenty, "\::" doesn't work (although it should; - **bug**), and ":\:" is misinterpreted as a field name (name "\"; - also a **bug**). Assuming these bugs are squashed, I suppose it's a - useful special case. It would only be reasonable to apply it to - "::"-only paragraphs though. I think the blank line is visually - necessary if there's text before the "::":: - - The text in this paragraph needs separation - from the literal block following:: - This doesn't look right. - - Another idea. Would it be worthwhile to allow literal blocks to - begin without a newline after the "::"? Example:: - - :: while True: - print 'hello world' - - Perhaps. Perhaps not. - -* Add new syntax for _`nested inline markup`? Or extend the parser to - parse nested inline markup somehow? See the `collected notes - `__. - -* Idea from Beni Cherniavsky:: - - I'm writing a README document linking to all other interesting - files in its directory. If these were full URLs I could just - write them in the text but these are relative links that can't - be auto-recognized. The shortest way to make such links that I - found was `file_name `_. Perhaps a shortcut for such - usage could be added, e.g. ``_ would take the target - as the link name? - - IOW these would be equivalent:: - - ``_ - `file_name `_ - - Another possibility is to drop the backticks. Should the angle - brackets be kept in the output or not? This syntax could be adopted - in addition to the one above:: - - _ - - -Directives -`````````` - -Directives below are often referred to as "module.directive", the -directive function. The "module." is not part of the directive name -when used in a document. - -* Allow directives to be added at run-time? - -* Use the language module for directive option names? - -* Add "substitution_only" and "substitution_ok" function attributes, - and automate context checking? - -* Implement options on existing directives: - - - Add a "name" option to directives, to set an author-supplied - identifier? - - - _`images.image`: "border"? "link"? - - Units of measure? (See docutils-users, 2003-03-02.) - - - _`images.figure`: "title" and "number", to indicate a formal - figure? - - - _`parts.sectnum`: "local"?, "start", "refnum" - - A "local" option could enable numbering for sections from a - certain point down, and sections in the rest of the document are - not numbered. For example, a reference section of a manual might - be numbered, but not the rest. OTOH, an all-or-nothing approach - would probably be enough. - - The "start" option will specify the sequence set to use at the - same time as the starting value, for the first part of the section - number (i.e., section, not subsection). For example:: - - .. sectnum: :start: 1 - - .. sectnum: :start: A - - .. sectnum: :start: 5 - - .. sectnum: :start: I - - The first one is the default: start at 1, numbered. The second - one specifies letters, and start at "A". The third specifies - numbers, start at 5. The last example could signal Roman - numerals, although I don't know if they'd be applicable here. - Enumerated lists already do all this; perhaps that code could be - reused. - - Here comes the tricky part. The "sectnum" directive should be - usable multiple times in a single document. For example, in a - long document with "chapter" and "appendix" sections, there could - be a second "sectnum" before the first appendix, changing the - sequence used (from 1,2,3... to A,B,C...). This is where the - "local" concept comes in. This part of the implementation can be - left for later. - - A "refnum" option (better name?) would insert reference names - (targets) consisting of the reference number. Then a URL could be - of the form ``http://host/document.html#2.5`` (or "2-5"?). Allow - internal references by number? Allow name-based *and* - number-based ids at the same time, or only one or the other (which - would the table of contents use)? Usage issue: altering the - section structure of a document could render hyperlinks invalid. - - - _`parts.contents`: Add a "suppress" or "prune" option? It would - suppress contents display for sections in a branch from that point - down. Or a new directive, like "prune-contents"? - - Add an option to include topics in the TOC? Another for sidebars? - See docutils-develop 2003-01-29. - - - _`misc.include`: - - - "encoding" option? Take default from runtime settings. Use - Input component to read it in? - - - Option to select a range of lines? - - - Option to label lines? - - - Default directory for "built-in includes", using the C syntax - ``#include ``? - - Use C-preprocessor semantics for locating include files? - E.g., ``.. include:: file.txt`` will read another file into - the current one, relative to the current file's directory, - and ``.. include:: `` will read a standard include - file from ``docutils/include/``. (Should "quotes" be - required around non-standard include files?) - - -- http://sf.net/mailarchive/message.php?msg_id=1938401 - - I now think that ``docutils/parsers/rst/include/`` is a better - place for these files, since they're reStructuredText-specific. - - Keeping standard data files together with the package code makes - sense to me. It seems much less complex to implement than a - separate system data directory, such as ``/usr/share/docutils``. - Any reason a system data directory should be used? How does - Distutils handle data files? - - How about an environment variable, say RSTINCLUDEPATH or - RSTPATH? This could be combined with a setting/option to allow - user-defined include directories. - - For a specific application, see the discussion of `character - entity substitution definition files`_ above. - -* Implement directives. Each of the list items below begins with an - identifier of the form, "module_name.directive_function_name". The - directive name itself could be the same as the - directive_function_name, or it could differ. - - - _`html.imagemap` (Useful outside of HTML? If not, replace with - image only in non-HTML writers?) - - - _`parts.endnotes` (or "footnotes"): See `Footnote & Citation Gathering`_. - - - _`parts.citations`: See `Footnote & Citation Gathering`_. - - - _`misc.exec`: Execute Python code & insert the results. Perhaps - dangerous? Call it "python" to allow for other languages? - - - _`misc.system`?: Execute an ``os.system()`` call, and insert the - results (possibly as a literal block). Definitely dangerous! How - to make it safe? Perhaps such processing should be left outside - of the document, in the user's production system (a makefile or a - script or whatever). Or, the directive could be disabled by - default and only enabled with an explicit command-line option or - config file setting. Even then, an interactive prompt may be - useful, such as: - - The file.txt document you are processing contains a "system" - directive requesting that the ``sudo rm -rf /`` command be - executed. Allow it to execute? (y/N) - - - _`misc.eval`: Evaluate an expression & insert the text. At parse - time or at substitution time? Dangerous? Perhaps limit to canned - macros; see text.date_ below. - - - _`misc.encoding`: Specify the character encoding of the input - data. But there are problems: - - - When it sees the directive, the parser will already have read - the input data, and encoding determination will already have - been done. - - - If a file with an "encoding" directive is edited and saved with - a different encoding, the directive may cause data corruption. - - - _`misc.language`: Specify the language of a document. There is a - problem similar to the first problem listed for misc.encoding_, - although to a lesser degree. - - - _`misc.settings`: Set any Docutils runtime setting from within a - document? - - - _`misc.charents`: Equivalent to:: - - .. include:: {includepath}/charents.txt - - - Docutils already has the ability to say "use this content for - Writer X" (via the "raw" directive), but it doesn't have the - ability to say "use this content for any Writer other than X". It - wouldn't be difficult to add this ability though. - - My first idea would be to add a set of conditional directives. - Let's call them "writer-is" and "writer-is-not" for discussion - purposes (don't worry about implemention details). We might - have:: - - .. writer-is:: text-only - - :: - - +----------+ - | SNMP | - +----------+ - | UDP | - +----------+ - | IP | - +----------+ - | Ethernet | - +----------+ - - .. writer-is:: pdf - - .. figure:: protocol_stack.eps - - .. writer-is-not:: text-only pdf - - .. figure:: protocol_stack.png - - This could be an interface to the Filter transform - (docutils.transforms.components.Filter). - - The ideas in `adaptable file extensions`_ above may also be - applicable here. - - Here's an example of a directive that could produce multiple - outputs (*both* raw troff pass-through *and* a GIF, for example) - and allow the Writer to select. :: - - .. eqn:: - - .EQ - delim %% - .EN - %sum from i=o to inf c sup i~=~lim from {m -> inf} - sum from i=0 to m sup i% - .EQ - delim off - .EN - - - _`body.qa` (directive a.k.a. "faq", "questions"): Questions & - Answers. Implement as a generic two-column marked list? As a - standalone (non-directive) construct? (Is the markup ambiguous?) - Add support to parts.contents. - - New elements would be required. Perhaps:: - - - - - - - - Originally I thought of implementing a Q&A list with special - syntax:: - - Q: What am I? - - A: You are a question-and-answer - list. - - Q: What are you? - - A: I am the omniscient "we". - - Where each "Q" and "A" could also be numbered (e.g., "Q1"). - However, a simple enumerated or bulleted list will do just fine - for syntax. A directive could treat the list specially; e.g. the - first paragraph could be treated as a question, the remainder as - the answer (multiple answers could be represented by nested - lists). Without special syntax, this directive becomes low - priority. - - - _`body.example`: Examples; suggested by Simon Hefti. Semantics as - per Docbook's "example"; admonition-style, numbered, reference, - with a caption/title. - - - _`body.index`: Index targets. - - Were I writing a book with an index, I guess I'd need two - different kinds of index targets: inline/implicit and - out-of-line/explicit. For example:: - - In this `paragraph`:index:, several words are being - `marked`:index: inline as implicit `index`:index: - entries. - - .. index:: markup - .. index:: syntax - - The explicit index directives above would refer to - this paragraph. - - The words "paragraph", "marked", and "index" would become index - entries pointing at the words in the first paragraph. The index - entry words appear verbatim in the text. (Don't worry about the - ugly ":index:" part; if indexing is the only/main application of - interpreted text in your documents, it can be implicit and - omitted.) The two directives provide manual indexing, where the - index entry words ("markup" and "syntax") do not appear in the - main text. We could combine the two directives into one:: - - .. index:: markup; syntax - - Semicolons instead of commas because commas could *be* part of the - index target, like:: - - .. index:: van Rossum, Guido - - Another reason for index directives is because other inline markup - wouldn't be possible within inline index targets. - - Sometimes index entries have multiple levels. Given:: - - .. index:: statement syntax: expression statements - - In a hypothetical index, combined with other entries, it might - look like this:: - - statement syntax - expression statements ..... 56 - assignment ................ 57 - simple statements ......... 58 - compound statements ....... 60 - - Inline multi-level index targets could be done too. Perhaps - something like:: - - When dealing with `expression statements `, - we must remember ... - - The opposite sense could also be possible:: - - When dealing with `index entries <:multi-level>`, there are - many permutations to consider. - - Also "see / see also" index entries. - - Given:: - - Here's a paragraph. - - .. index:: paragraph - - (The "index" directive above actually targets the *preceding* - object.) The directive should produce something like this XML:: - - - - Here's a paragraph. - - - This kind of content model would also allow true inline - index-entries:: - - Here's a `paragraph`:index:. - - If the "index" role were the default for the application, it could be - dropped:: - - Here's a `paragraph`. - - Both of these would result in this XML:: - - - Here's a paragraph. - - - - _`body.literal`: Literal block, possibly "formal" (see `object - numbering and object references`_ above). Possible options: - - - "highlight" a range of lines - - "number" or "line-numbers" - - See docutils-users 2003-03-03. - - - _`body.sidebar`: Add to the already implemented directive. Allow - internal section structure, with adornment styles independent of - the main document. - - - _`colorize.python`: Colorize Python code. Fine for HTML output, - but what about other formats? Revert to a literal block? Do we - need some kind of "alternate" mechanism? Perhaps use a "pending" - transform, which could switch its output based on the "format" in - use. Use a factory function "transformFF()" which returns either - "HTMLTransform()" instance or "GenericTransform" instance? - - If we take a Python-to-HTML pretty-printer and make it output a - Docutils internal doctree (as per nodes.py) instead of HTML, then - each output format's stylesheet (or equivalent) mechanism could - take care of the rest. The pretty-printer code could turn this - doctree fragment:: - - - print 'This is Python code.' - for i in range(10): - print i - - - into something like this ("" is end-tag shorthand):: - - - print 'This is Python code.' - for i in range(10): - print i - - - But I'm leaning toward adding a single new general-purpose - element, "phrase", equivalent to HTML's . Here's the - example rewritten using the generic "phrase":: - - - print 'This is Python code.' - for i in range(10): - print i - - - It's more verbose but more easily extensible and more appropriate - for the case at hand. It allows us to edit style sheets to add - support for new formats, not the Docutils code itself. - - Perhaps a single directive with a format parameter would be - better:: - - .. colorize:: python - - print 'This is Python code.' - for i in range(10): - print i - - But directives can have synonyms for convenience. "format:: - python" was suggested, but "format" seems too generic. - - - _`text.date`: Datestamp. For substitutions. The directive could - be followed by a formatting string, using strftime codes. Default - is "%Y-%m-%d" (ISO 8601 date), but time fields can also be used. - - - Combined with the "include" directive, implement canned macros? - E.g.:: - - .. include:: - - Today's date is |date|. - - Where "macros" contains ``.. |date| date::``, among others. - - - _`text.time`: Timestamp. For substitutions. Shortcut for - ``.. date:: %H:%M``. Date fields can also be used. - - - _`pysource.usage`: Extract a usage message from the program, - either by running it at the command line with a ``--help`` option - or through an exposed API. [Suggestion for Optik.] - - -Interpreted Text -```````````````` - -Interpreted text is entirely a reStructuredText markup construct, a -way to get around built-in limitations of the medium. Some roles are -intended to introduce new doctree elements, such as "title-reference". -Others are merely convenience features, like "RFC". - -All supported interpreted text roles must be known by the Parser. -Adding a new role often involves adding a new element to the DTD and -may require extensive support, therefore such additions should be well -thought-out. There should be a limited number of roles. - -The only place where no limit is placed on variation is at the start, -at the Reader/Parser interface. Transforms are inserted by the Reader -into the Transformer's queue, where non-standard elements are -converted. Once past the Transformer, no variation from the standard -Docutils doctree is possible. - -An example is the Python Source Reader, which will use interpreted -text extensively. The default role will be "Python identifier", which -will be further interpreted by namespace context into , -, , , etc. elements (see -spec/pysource.dtd), which will be transformed into standard hyperlink -references, which will be processed by the various Writers. No Writer -will need to have any knowledge of the Python-Reader origin of these -elements. - -* @@@ Add a test for language mappings of roles. - -* Alan Jaffray suggested (and I agree) that it would be sensible to: - - - have a directive and/or command-line option to specify a default - role for interpreted text - - allow the reST processor to take an argument for the default role - (this will be subsumed by the above via the runtime settings - mechanism) - - issue a warning when processing documents with no default role - which contain interpreted text with no explicitly specified role - (there will always be a default role, so this won't happen) - -* Add a directive establishing a mapping of interpreted text role - aliases? A set of default roles (index, acronym, etc.) could exist, - and the directive could assign abbreviations (i, a, etc.) or other - alternatives. - -* Add explicit interpreted text roles for the rest of the implicit - inline markup constructs: named-reference, anonymous-reference, - footnote-reference, citation-reference, substitution-reference, - target, uri-riference (& synonyms). - -* Add directives for each role as well? This would allow indirect - nested markup:: - - This text contains |nested inline markup|. - - .. |nested inline markup| emphasis:: - - nested ``inline`` markup - -* Add document-local _`role bindings`, associating directives with - roles? :: - - ``She wore ribbons in her hair and it lay with streaks of - grey``:rewrite: - - .. :rewrite: class:: rewrite - - The syntax is similar to that of substitution declarations, and the - directive/role association may resolve implementation issues. The - semantics, ramifications, and implementation details do need to be - worked out though. Syntax idea from Jeffrey C. Jacobs. - - The example above would implement the "rewrite" role as adding a - ``class="rewrite"`` attribute to the interpreted text ("inline" - element). The stylesheet would then pick up on the "class" - attribute to do the actual formatting. - - The same thing could be done with a directive, albeit a bit more - verbosely:: - - .. role:: rewrite - :class: rewrite - - The advantage of the new syntax would be flexibility. Uses other - than "class" may present themselves. - -* Perhaps a "role" directive can modify existing roles with - attributes? :: - - .. :api-ti: role:: api - :base: twisted.internet - - To start the reactor, use the :api-ti:`reactor.run` method. To - stop it, use :api-ti:`reactor.stop`. - -* Implement roles: - - - "acronym" and "abbreviation": Associate the full text with a short - form. Jason Diamond's description: - - I want to translate ```reST`:acronym:`` into ``reST``. The value of the - title attribute has to be defined out-of-band since you can't - parameterize interpreted text. Right now I have them in a - separate file but I'm experimenting with creating a directive - that will use some form of reST syntax to let you define them. - - Should Docutils complain about undefined acronyms or - abbreviations? - - What to do if there are multiple definitions? How to - differentiate between CSS (Content Scrambling System) and CSS - (Cascading Style Sheets) in a single document? - - How to define the full text? Possibilities: - - 1. With a directive and a definition list? :: - - .. acronyms:: - - reST - reStructuredText - DPS - Docstring Processing System - - Would this list remain in the document as a glossary, or would - it simply build an internal lookup table? A "glossary" - directive could be used to make the intention clear. - Acronyms/abbreviations and glossaries could work together. - - Then again, a glossary could be formed by gathering individual - definitions from around the document. - - 2. Some kind of `inline parameter syntax`__? :: - - `reST `:acronym: is `WYSIWYG `:acronym: plaintext markup. - - __ rst/alternatives.html#parameterized-interpreted-text - - 3. A combination of 1 & 2? - - The multiple definitions issue could be handled by establishing - rules of priority. For example, directive-based lookup tables - have highest priority, followed by the first inline definition. - Multiple definitions in directive-based lookup tables would - trigger warnings, similar to the rules of `implicit hyperlink - targets`__. - - __ rst/reStructuredText.html#implicit-hyperlink-targets - - - "annotation": The equivalent of the HTML "title" attribute. This - is secondary information that may "pop up" when the pointer hovers - over the main text. A corresponding directive would be required - to associate annotations with the original text (by name, or - positionally as in anonymous targets?). - - - "figure", "table", "listing", "chapter", "page", etc: See `object - numbering and object references`_ above. - - - "term"?: Unfamiliar or specialized terminology. - - - "glossary-term": This would establish a link to a glossary. It - would require an associated "glossary-entry" directive, whose - contents could be a definition list:: - - .. glossary-entry:: - - term1 - definition1 - term2 - definition2 - - This would allow entries to be defined anywhere in the document, - and collected (via a "glossary" directive perhaps) at one point. - - -Unimplemented Transforms ------------------------- - -Footnote & Citation Gathering -````````````````````````````` - -Collect and move footnotes & citations to the end of a document. -(Separate transforms.) - - -Hyperlink Target Gathering -`````````````````````````` - -It probably comes in two phases, because in a Python context we need -to *resolve* them on a per-docstring basis [do we? --DG], but if the -user is trying to do the callout form of presentation, they would -then want to group them all at the end of the document. - - -Reference Merging -````````````````` - -When merging two or more subdocuments (such as docstrings), -conflicting references may need to be resolved. There may be: - -* duplicate reference and/or substitution names that need to be made - unique; and/or -* duplicate footnote numbers that need to be renumbered. - -Should this be done before or after reference-resolving transforms -are applied? What about references from within one subdocument to -inside another? - - -Document Splitting -`````````````````` - -If the processed document is written to multiple files (possibly in a -directory tree), it will need to be split up. Internal references -will have to be adjusted. - -(HTML only? Initially, yes. Eventually, anything should be -splittable.) - -Idea: insert a "split here" attribute into the root element of each -split-out document, containing the path/filename. The Output object -will recognize this attribute and split out the files accordingly. -Must allow for common headers & footers, prev/next, breadcrumbs, etc. - - -Navigation -`````````` - -If a document is split up, each segment will need navigation links: -parent, children (small TOC), previous (preorder), next (preorder). -Part of `Document Splitting`_? - - -List of System Messages -``````````````````````` - -The ``system_message`` elements are inserted into the document tree, -adjacent to the problems themselves where possible. Some (those -generated post-parse) are kept until later, in ``document.messages``, -and added as a special final section, "Docutils System Messages". - -Docutils could be made to generate hyperlinks to all known -system_messages and add them to the document, perhaps to the end of -the "Docutils System Messages" section. - -Fred L. Drake, Jr. wrote: - - I'd like to propose that both parse- and transformation-time - messages are included in the "Docutils System Messages" section. - If there are no objections, I can make the change. - -The advantage of the current way of doing things is that parse-time -system messages don't require a transform; they're already in the -document. This is valuable for testing (unit tests, -tools/quicktest.py). So if we do decide to make a change, I think the -insertion of parse-time system messages ought to remain as-is and the -Messages transform ought to move all parse-time system messages -(remove from their originally inserted positions, insert in System -Messages section). - - -Filtering System Messages -````````````````````````` - -Currently the Writer is responsible for filtering out system messages -that are below the current threshold. Should the filtering be in a -separate transform? It would then happen regardless of the writer -used. Perhaps some writers don't want system messages filtered? - - -Others -`````` - -Index - - -HTML Writer ------------ - -* @@ Construct a _`templating system`, as in ht2html/yaptu, using - directives and substitutions for dynamic stuff. Or a specialized - writer to generate .ht & links.h files for ht2html? - -* Add a setting (or another writer) which produces just the contents - of the element. What about the rest; it should be accessible - somehow, especially the docinfo fields. Part of the ht2html - implementation? Generic component output? - - I think a separate writer which inherits from html4css1.py would be - a good start. An "inline" or body-only HTML writer has to omit some - of the information given by the full HTML writer. Some applications - won't need this information, but others will; they'll want to deal - with it in different ways. I envision such a writer returning a set - of values: body html, and everything else (metadata). Perhaps a - tuple of this form:: - - (body_html, {'title': value, - 'subtitle': value, - 'docinfo': (tuple of (name, value) pairs), - etc.}) - - By having a separate writer, a different return data structure is - possible. We may need to add support to all of docutils to allow - for this variant output. Should the metadata values be simple text - strings, or HTML snippets (they may contain markup), or both? There - may be other issues to be worked out. - -* Add more support for elements, especially for navigation - bars. - -* Make the admonitions more distinctive and varied. - -* Make the "class" attributes optional? Implies no stylesheet? - -* Add a setting to customize the header tag levels, i.e.

. - -* Base list compaction on the spacing of source list? Would require - parser support. (Idea: fantasai, 16 Dec 2002, doc-sig.) - -* Add a tool tip ("title" attribute?) to footnote back-links - identifying them as such. Text in Docutils language module. - -* Add an option to restrict the document title to only, - and not include it in the document body. Subtitle? - - -Front-End Tools ---------------- - -* What about if we don't know which Reader and/or Writer we are - going to use? If the Reader/Writer is specified on the - command-line? (Will this ever happen?) - - Perhaps have different types of front ends: - - a) _`Fully qualified`: Reader and Writer are hard-coded into the - front end (e.g. ``pep2html [options]``, ``pysource2pdf - [options]``). - - b) _`Partially qualified`: Reader is hard-coded, and the Writer is - specified a sub-command (e.g. ``pep2 html [options]``, - ``pysource2 pdf [options]``). The Writer is known before option - processing happens, allowing the OptionParser to be built - dynamically. Alternatively, the Writer could be hard-coded and - the Reader specified as a sub-command (e.g. ``htmlfrom pep - [options]``). - - c) _`Unqualified`: Reader and Writer are specified as subcommands - (e.g. ``publish pep html [options]``, ``publish pysource pdf - [options]``). A single front end would be sufficient, but - probably only useful for testing purposes. - - d) _`Dynamic`: Reader and/or Writer are specified by options, with - defaults if unspecified (e.g. ``publish --writer pdf - [options]``). Is this possible? The option parser would have - to be told about new options it needs to handle, on the fly. - Component-specific options would have to be specified *after* - the component-specifying option. - - Allow common options before subcommands, as in CVS? Or group all - options together? In the case of the `fully qualified`_ - front ends, all the options will have to be grouped together - anyway, so there's no advantage (we can't use it to avoid - conflicts) to splitting common and component-specific options - apart. - -* Parameterize help text & defaults somehow? Perhaps a callback? Or - initialize ``settings_spec`` in ``__init__`` or ``init_options``? - -* Disable common options that don't apply? - -* Implement the "sectnum" directive as a command-line option also? - -* @@@ Come up with better names for the most-used tools, and install - them as scripts. - -* Create a single dynamic_ or unqualified_ front end that can be - installed? - - -Project Policies -================ - -A few quotes sum up the policies of the Docutils project. The IETF's -classic credo (by MIT professor Dave Clark) is an ideal we can aspire -to: - - We reject: kings, presidents, and voting. We believe in: rough - consensus and running code. - -As architect, chief cook and bottle-washer, I currently function as -BDFN (Benevolent Dictator For Now), but I would happily abdicate the -throne given a suitable candidate. Any takers? - -Eric S. Raymond, anthropologist of the hacker subculture, writes in -his essay `The Magic Cauldron`_: - - The number of contributors [to] projects is strongly and inversely - correlated with the number of hoops each project makes a user go - through to contribute. - - .. _The Magic Cauldron: - http://www.tuxedo.org/~esr/writings/magic-cauldron/ - -Therefore, we will endeavour to keep the barrier to entry as low as -possible. The policies below should not be thought of as barriers, -but merely as a codification of experience to date. These are "best -practices", not absolutes; exceptions are expected, tolerated, and -used as a source of improvement. - -As for control issues, Emmett Plant (CEO of the Xiph.org Foundation, -originators of Ogg Vorbis) put it well when he said: - - Open source dictates that you lose a certain amount of control - over your codebase, and that's okay with us. - - -Python Coding Conventions -------------------------- - -These are the conventions I use in my own code. Contributed code will -not be refused merely because it does not strictly adhere to these -conditions; as long as it's internally consistent, clean, and correct, -it probably will be accepted. But don't be surprised if the -"offending" code gets fiddled over time to conform to these -conventions. - -The Docutils project shall follow the generic coding conventions as -specified in the `Style Guide for Python Code`_ and `Docstring -Conventions`_ PEPs, with the following clarifications (from most to -least important): - -* 4 spaces per indentation level. No tabs. Indent continuation lines - according to the Emacs python-mode standard. - -* Use only ASCII, no 8-bit strings. See `Docutils - Internationalization`_. - -* No one-liner compound statements (i.e., no ``if x: return``: use two - lines & indentation), except for degenerate class or method - definitions (i.e., ``class X: pass`` is O.K.). - -* Lines should be no more than 78 characters long. - -* Use "StudlyCaps" for class names (except for element classes in - docutils.nodes). - -* Use "lowercase" or "lowercase_with_underscores" for function, - method, and variable names. For short names, maximum two words, - joined lowercase may be used (e.g. "tagname"). For long names with - three or more words, or where it's hard to parse the split between - two words, use lowercase_with_underscores (e.g., - "note_explicit_target", "explicit_target"). If in doubt, use - underscores. - -* Use 'single quotes' for string literals, and """triple double - quotes""" for docstrings. - -.. _Style Guide for Python Code: - http://www.python.org/peps/pep-0008.html -.. _Docstring Conventions: http://www.python.org/peps/pep-0257.html -.. _Docutils Internationalization: howto/i18n.html#python-code - - -Copyrights and Licensing ------------------------- - -The majority of the Docutils project code and documentation has been -placed in the public domain. Unless clearly and explicitly indicated -otherwise, any patches (modifications to existing files) submitted to -the project for inclusion (via CVS, SourceForge trackers, mailing -lists, or private email) are assumed to be in the public domain as -well. - -Any new files contributed to the project should clearly state their -intentions regarding copyright, in one of the following ways: - -* Public domain (preferred): include the statement "This - module/document has been placed in the public domain." - -* Copyright & open source license: include a copyright notice, along - with either an embedded license statement, a reference to an - accompanying license file, or a license URL. - -One of the goals of the Docutils project, once complete, is to be -incorporated into the Python standard library. At that time copyright -of the Docutils code will be assumed by or transferred to the Python -Software Foundation (PSF), and will be released under Python's -license. If the copyright/license option is chosen for new files, the -license should be compatible with Python's current license, and the -author(s) of the files should be willing to assign copyright to the -PSF. - - -CVS Check-ins -------------- - -Instructions for CVS access can be found at -http://sourceforge.net/cvs/?group_id=38414. Anyone can access the CVS -repository anonymously. Only project developers can make changes. - -Unless you really *really* know what you're doing, please limit your -CVS commands to ``cvs checkout``, ``cvs commit/checkin``, and ``cvs -add``. Do **NOT** use ``cvs import`` unless you're absolutely sure -you know what you're doing. Even then, grab a copy of the `nightly -CVS tarball <http://cvs.sf.net/cvstarballs/docutils-cvsroot.tar.gz>`_, -set it up on your own machine, and experiment *there* first. - -The `main source tree`_ ("docutils" CVS module) should always be kept -in a stable state (usable and as problem-free as possible). The -Docutils project shall follow the `Python Check-in Policies`_ (as -applicable), with particular emphasis as follows: - -* Before checking in any changes, run the entire Docutils test suite - to be sure that you haven't broken anything. From a shell:: - - cd docutils/test - alltests.py - -* When adding new functionality (or fixing bugs), be sure to add test - cases to the test suite. Practise test-first programming; it's fun, - it's addictive, and it works! - -* The `sandbox CVS directory`_ is the place to put new, incomplete or - experimental code. See `Additions to Docutils`_ and `The Sandbox`_ - below. - -* For bugs or omissions that have an obvious fix and can't possibly - mess up anything else, go right ahead and check it in directly. - -* For larger changes, use your best judgement. If you're unsure of - the impact, or feel that you require advice or approval, patches or - `the sandbox`_ are the way to go. - -Docutils will pursue an open and trusting policy for as long as -possible, and deal with any abberations if (and hopefully not when) -they happen. I'd rather see a torrent of loose contributions than -just a trickle of perfect-as-they-stand changes. The occasional -mistake is easy to fix. That's what CVS is for. - -.. _main source tree: - http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/docutils/docutils/ -.. _Python Check-in Policies: http://www.python.org/dev/tools.html -.. _sandbox CVS directory: - http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/docutils/sandbox/ - - -Additions to Docutils -````````````````````` - -Additions to the project, such as new components, should be developed -in the `sandbox CVS directory`_ until they're in `good shape`_, -usable_, and `reasonably complete`_. Adding to the `main source -tree`_ or to a `parallel project`_ implies a commitment to the -Docutils user community. - -* Why the sandbox? - - Developers should be able to try out new components while they're - being developed for addition to main source tree. See `The - Sandbox`_ below. - -* _`Good shape` means that the component code is clean, readable, and - free of junk code (unused legacy code; by analogy with "junk DNA"). - -* _`Usable` means that the code does what it claims to do. An "XYZ - Writer" should produce reasonable XYZ. - -* _`Reasonably complete` means that the code must handle all input. - Here "handle" means that no input can cause the code to fail (cause - an exception, or silently and incorrectly produce nothing). - "Reasonably complete" does not mean "finished" (no work left to be - done). For example, a writer must handle every standard element - from the Docutils document model; for unimplemented elements, it - must *at the very least* warn that "Output for element X is not yet - implemented in writer Y". - -If you really want to check code into the main source tree, you can, -but you'll have to be prepared to work on it intensively and complete -it quickly. People will start to use it and they will expect it to -work! If there are any issues with your code, or if you only have -time for gradual development, you should put it in the sandbox first. -It's easy to move code over to the main source tree once it's closer -to completion. - - -Mailing Lists -------------- - -Developers should subscribe to the mailing lists: - -* The `Python Documentation Special Interest Group (Doc-SIG) mailing - list`__ for high-level discussions on syntax, strategy, and design - (email to Doc-SIG@python.org). -* Docutils-develop__, for implementation discussions - (email to docutils-develop@lists.sourceforge.net). -* Docutils-checkins__, to monitor CVS checkin messages (automatically - generated; normally read-only). - -__ http://mail.python.org/mailman/listinfo/doc-sig -__ http://lists.sourceforge.net/lists/listinfo/docutils-develop -__ http://lists.sourceforge.net/lists/listinfo/docutils-checkins - - -The Sandbox ------------ - -The `sandbox CVS directory`_ is a place to play around, to try out and -share ideas. It's a part of the CVS repository but it isn't -distributed as part of Docutils releases. Feel free to check in code -to the CVS sandbox; that way people can try it out but you won't have -to worry about it working 100% error-free, as is the goal of the `main -source tree`_. Each developer who wants to play in the sandbox should -create their own subdirectory (suggested name: SourceForge ID, -nickname, or given name + family initial). It's OK to make a mess! -But please, play nice. - -Please update the `sandbox README`_ file with links and a brief -description of your work. - -In order to minimize the work necessary for others to install and try -out new, experimental components, the following sandbox directory -structure is recommended:: - - sandbox/ - userid/ - component_name/ # A verbose name is best. - README.txt # Please explain requirements, - # purpose/goals, and usage. - docs/ - ... - component.py # The component is a single module. - # *OR* (but *not* both) - component/ # The component is a package. - __init__.py # Contains the Reader/Writer class. - other1.py # Other modules and data files used - data.txt # by this component. - ... - test/ # Test suite. - ... - tools/ # For front ends etc. - ... - setup.py # Use Distutils to install the component - # code and tools/ files into the right - # places in Docutils. - -Some sandbox projects are destined to become Docutils components once -completed. Others, such as add-ons to Docutils or applications of -Docutils, graduate to become `parallel projects`_. - -.. _sandbox README: http://docutils.sf.net/sandbox/README.html - - -.. _parallel project: - -Parallel Projects ------------------ - -Parallel projects contain useful code that is not central to the -functioning of Docutils. Examples are specialized add-ons or -plug-ins, and applications of Docutils. They use Docutils, but -Docutils does not require their presence to function. - -An official parallel project will have its own CVS directory beside -(or parallel to) the main Docutils CVS directory. It can have its own -web page in the docutils.sourceforge.net domain, its own file releases -and downloadable CVS snapshots, and even a mailing list if that proves -useful. However, an official parallel project has implications: it is -expected to be maintained and continue to work with changes to the -core Docutils. - -A parallel project requires a project leader, who must commit to -coordinate and maintain the implementation: - -* Answer questions from users and developers. -* Review suggestions, bug reports, and patches. -* Monitor changes and ensure the quality of the code and - documentation. -* Coordinate with Docutils to ensure interoperability. -* Put together official project releases. - -Of course, related projects may be created independently of Docutils. -The advantage of a parallel project is that the SourceForge -environment and the developer and user communities are already -established. Core Docutils developers are available for consultation -and may contribute to the parallel project. It's easier to keep the -projects in sync when there are changes made to the core Docutils -code. - - -Release Procedure -================= - -1. Edit the version number in the following files: - - * docutils: - - - setup.py - - HISTORY.txt - - docutils/__init__.py - - * web: index.txt - -2. Run the test suite: ``cd test ; alltests.py``. - -3. Isolate from outside influence: - - (a) Remove the old installation from site-packages (including - roman.py, and optparse.py, textwrap.py for pre-2.3 - installations). - - (b) Clear/unset the PYTHONPATH environment variable. - -4. Create the release tarball: - - (a) Create a new empty directory and ``cd`` into it. - - (b) Get a clean snapshot of the CVS files:: - - cvs -z3 -d:pserver:anonymous@cvs.sf.net:/cvsroot/docutils \ - export -rHEAD docutils - - (c) Use Distutils to create the release tarball:: - - cd docutils - python setup.py sdist - -5. Expand and install the release tarball **in isolation** (as per - step 3 above): - - (a) Expand the tarball in a new location, not over any existing - files. - - (b) Install from expanded directory:: - - cd docutils-X.Y - python setup.py install - - The "install" command may require root permissions. - -6. Run the test suite from the expanded archive directory: ``cd test ; - alltests.py``. - -7. Run ``cd tools ; buildhtml.py ..`` to confirm that there are no - unexpected issues with the docs. - -8. Upload the release tarball:: - - $ ftp upload.sourceforge.net - Connected to osdn.dl.sourceforge.net. - ... - Name (upload.sourceforge.net:david): anonymous - 331 Anonymous login ok, send your complete e-mail address as password. - Password: - ... - 230 Anonymous access granted, restrictions apply. - ftp> bin - 200 Type set to I. - ftp> cd /incoming - 250 CWD command successful. - ftp> put filename - -9. Log in to the SourceForge web interface. - -10. Access the file release system on SourceForge (Admin interface). - Fill in the fields: - - :Package ID: docutils - :Release Name: <use release number only, e.g. 0.3> - :Release Date: <today's date> - :Status: Active - :File Name: <select the file just uploaded> - :File Type: Source .gz - :Processor Type: Platform-Independent - :Release Notes: <insert README.txt file here> - :Change Log: <insert summary from announcement> - - Also check the "Preserve my pre-formatted text" box. - -11. Wait up to 30 minutes for the file to become available on - SourceForge. - -12. Download the release tarball and verify its integrity by walking - through an installation, as outlined above (steps 5, 6, & 7). - -13. Add a SourceForge News item, with title "Docutils 0.x released" - and containing the release tarball's download URL. - -14. Send announcement email to: - - * docutils-develop@lists.sourceforge.net - * docutils-users@lists.sourceforge.net - * doc-sig@python.org - * python-list@python.org - * python-announce@python.org - -15. Register - - (a) with PyPI (Fill in details. ``python setup.py register``? - How to log in?) - (b) with Vaults of Parnassus - (c) with FreshMeat? - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: diff --git a/docutils/docs/howto/i18n.txt b/docutils/docs/howto/i18n.txt deleted file mode 100644 index 11a8d13bd..000000000 --- a/docutils/docs/howto/i18n.txt +++ /dev/null @@ -1,178 +0,0 @@ -================================ - Docutils_ Internationalization -================================ - -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Date: $Date$ -:Revision: $Revision$ -:Copyright: This document has been placed in the public domain. - - -.. contents:: - - -This document describes the internationalization facilities of the -Docutils_ project. `Introduction to i18n`_ by Tomohiro KUBOTA is a -good general reference. "Internationalization" is often abbreviated -as "i18n": "i" + 18 letters + "n". - -.. Note:: - - The i18n facilities of Docutils should be considered a "first - draft". They work so far, but improvements are welcome. - Specifically, standard i18n facilities like "gettext" have yet to - be explored. - -Docutils is designed to work flexibly with text in multiple languages -(one language at a time). Language-specific features are (or should -be [#]_) fully parameterized. To enable a new language, two modules -have to be added to the project: one for Docutils itself (the -`Docutils Language Module`_) and one for the reStructuredText parser -(the `reStructuredText Language Module`_). - -.. [#] If anything in Docutils is insufficiently parameterized, it - should be considered a bug. Please report bugs to the Docutils - project bug tracker on SourceForge at - http://sourceforge.net/tracker/?group_id=38414&atid=422030. - -.. _Docutils: http://docutils.sourceforge.net/ -.. _Introduction to i18n: - http://www.debian.org/doc/manuals/intro-i18n/ - - -Language Module Names -===================== - -Language modules are named using a case-insensitive language -identifier as defined in `RFC 1766`_. A typical language identifier -consists of a 2-letter language code from `ISO 639`_ (3-letter codes -can be used if no 2-letter code exists; RFC 1766 is currently being -revised to allow 3-letter codes). The language identifier can have an -optional subtag, typically for variations based on country (from `ISO -3166`_ 2-letter country codes). If no language identifier is -specified, the default is "en" for English. Examples of module names -include ``en.py``, ``fr.py``, ``ja.py``, and ``pt-br.py``. - -.. _RFC 1766: http://www.faqs.org/rfcs/rfc1766.html -.. _ISO 639: http://lcweb.loc.gov/standards/iso639-2/englangn.html -.. _ISO 3166: http://www.iso.ch/iso/en/prods-services/iso3166ma/ - 02iso-3166-code-lists/index.html - - -Python Code -=========== - -All Python code in Docutils will be ASCII-only. In language modules, -Unicode-escapes will have to be used for non-ASCII characters. -Although it may be possible for some developers to store non-ASCII -characters directly in strings, it will cause problems for other -developers whose locales are set up differently. - -`PEP 263`_ introduces source code encodings to Python modules, -implemented beginning in Python 2.3. Until PEP 263 is fully -implemented as a well-established convention, proven robust in daily -use, and the tools (editors, CVS, email, etc.) recognize this -convention, Docutils shall remain conservative. - -As mentioned in the note above, developers are invited to explore -"gettext" and other i18n technologies. - -.. _PEP 263: http://www.python.org/peps/pep-0263.html - - -Docutils Language Module -======================== - -Modules in ``docutils/languages`` contain language mappings for -markup-independent language-specific features of Docutils. To make a -new language module, just copy the ``en.py`` file, rename it with the -code for your language (see `Language Module Names`_ above), and -translate the terms as described below. - -Each Docutils language module contains three module attributes: - -``labels`` - This is a mapping of node class names to language-dependent - boilerplate label text. The label text is used by Writer - components when they encounter document tree elements whose class - names are the mapping keys. - - The entry values (*not* the keys) should be translated to the - target language. - -``bibliographic_fields`` - This is a mapping of language-dependent field names (converted to - lower case) to canonical field names (keys of - ``DocInfo.biblio_notes`` in ``docutils.transforms.frontmatter``). - It is used when transforming bibliographic fields. - - The keys should be translated to the target language. - -``author_separators`` - This is a list of strings used to parse the 'Authors' - bibliographic field. They separate individual authors' names, and - are tried in order (i.e., earlier items take priority, and the - first item that matches wins). The English-language module - defines them as ``[';', ',']``; semi-colons can be used to - separate names like "Arthur Pewtie, Esq.". - - Most languages won't have to "translate" this list. - - -reStructuredText Language Module -================================ - -Modules in ``docutils/parsers/rst/languages`` contain language -mappings for language-specific features of the reStructuredText -parser. To make a new language module, just copy the ``en.py`` file, -rename it with the code for your language (see `Language Module -Names`_ above), and translate the terms as described below. - -Each reStructuredText language module contains just one module -attribute: - -``directives`` - This is a mapping from language-dependent directive names to - canonical directive names. The canonical directive names are - registered in ``docutils/parsers/rst/directives/__init__.py``, in - ``_directive_registry``. - - The keys should be translated to the target language. Synonyms - (multiple keys with the same values) are allowed; this is useful - for abbreviations. - -``roles`` - This is a mapping language-dependent role names to canonical role - names for interpreted text. The canonical directive names are - registered in ``docutils/parsers/rst/states.py``, in - ``Inliner._interpreted_roles`` (this may change). - - The keys should be translated to the target language. Synonyms - (multiple keys with the same values) are allowed; this is useful - for abbreviations. - - -Testing the Language Modules -============================ - -Whenever a new language module is added or an existing one modified, -the unit tests should be run. The test modules can be found in the -docutils/test directory from CVS_ or from the `latest CVS snapshot`_. - -The ``test_language.py`` module can be run as a script. With no -arguments, it will test all language modules. With one or more -language codes, it will test just those languages. For example:: - - $ python test_language.py en - .. - ---------------------------------------- - Ran 2 tests in 0.095s - - OK - -Use the "alltests.py" script to run all test modules, exhaustively -testing the parser and other parts of the Docutils system. - -.. _CVS: http://sourceforge.net/cvs/?group_id=38414 -.. _latest CVS snapshot: http://docutils.sf.net/docutils-snapshot.tgz diff --git a/docutils/docs/howto/rst-directives.txt b/docutils/docs/howto/rst-directives.txt deleted file mode 100644 index 377ca31ad..000000000 --- a/docutils/docs/howto/rst-directives.txt +++ /dev/null @@ -1,348 +0,0 @@ -====================================== - Creating reStructuredText Directives -====================================== - -:Authors: Dethe Elza, David Goodger -:Contact: delza@enfoldingsystems.com -:Date: $Date$ -:Revision: $Revision$ -:Copyright: This document has been placed in the public domain. - -Directives are the primary extension mechanism of reStructuredText. -This document aims to make the creation of new directives as easy and -understandable as possible. There are only a couple of -reStructuredText-specific features the developer needs to know to -create a basic directive. - -The syntax of directives is detailed in the `reStructuredText Markup -Specification`_, and standard directives are described in -`reStructuredText Directives`_. - -.. _reStructuredText Markup Specification: - ../rst/reStructuredText.html#directives -.. _reStructuredText Directives: ../rst/directives.html - - -.. contents:: Table of Contents - - -Define the Directive Function -============================= - -The directive function does any processing that the directive -requires. This may require the use of other parts of the -reStructuredText parser. This is where the directive actually *does* -something. - -The directive implementation itself is a callback function whose -signature is as follows:: - - def directive_fn(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - code... - - # Set function attributes: - directive_fn.arguments = ... - directive_fn.options = ... - direcitve_fn.content = ... - -Function attributes are described below (see `Specify Directive -Arguments, Options, and Content`_). The directive function parameters -are as follows: - -- ``name`` is the directive type or name. - -- ``arguments`` is a list of positional arguments, as specified in the - ``arguments`` function attribute. - -- ``options`` is a dictionary mapping option names to values. The - options handled by a directive function are specified in the - ``options`` function attribute. - -- ``content`` is a list of strings, the directive content. Use the - ``content`` function attribute to allow directive content. - -- ``lineno`` is the line number of the first line of the directive. - -- ``content_offset`` is the line offset of the first line of the - content from the beginning of the current input. Used when - initiating a nested parse. - -- ``block_text`` is a string containing the entire directive. Include - it as the content of a literal block in a system message if there is - a problem. - -- ``state`` is the state which called the directive function. - -- ``state_machine`` is the state machine which controls the state - which called the directive function. - -Directive functions return a list of nodes which will be inserted into -the document tree at the point where the directive was encountered. -This can be an empty list if there is nothing to insert. Directives -have no corresponding element; choose the most appropriate elements -from the existing Docutils elements. See `The Docutils Document -Tree`_ and the ``docutils.nodes`` module. - -.. _The Docutils Document Tree: ../doctree.html - - -Specify Directive Arguments, Options, and Content -================================================= - -Function attributes are interpreted by the directive parser (the -``docutils.parsers.rst.states.Body.parse_directive()`` method). If -unspecified, directive function attributes are assumed to have the -value ``None``. Three directive function attributes are recognized: - -- ``arguments``: A 3-tuple specifying the expected positional - arguments, or ``None`` if the directive has no arguments. The 3 - items in the tuple are: - - 1. The number of required arguments. - 2. The number of optional arguments. - 3. A boolean, indicating if the final argument may contain whitespace. - - Arguments are normally single whitespace-separated words. The final - argument may contain whitespace when indicated by the value 1 (True) - for the third item in the argument spec tuple. In this case, the - final argument in the ``arguments`` parameter to the directive - function will contain spaces and/or newlines, preserved from the - input text. - - If the form of the arguments is more complex, specify only one - argument (either required or optional) and indicate that final - whitespace is OK (1/True); the client code must do any - context-sensitive parsing. - -- ``options``: The option specification. ``None`` or an empty dict - implies no options to parse. - - An option specification must be defined detailing the options - available to the directive. An option spec is a mapping of option - name to conversion function; conversion functions are applied to - each option value to check validity and convert them to the expected - type. Python's built-in conversion functions are often usable for - this, such as ``int``, ``float``, and ``bool`` (included in Python - from version 2.2.1). Other useful conversion functions are included - in the ``docutils.parsers.rst.directives`` package (in the - ``__init__.py`` module): - - - ``flag``: For options with no option arguments. Checks for an - argument (raises ``ValueError`` if found), returns ``None`` for - valid flag options. - - - ``unchanged``: Returns the argument, unchanged. Raises - ``ValueError`` if no argument is found. - - - ``path``: Returns the path argument unwrapped (with newlines - removed). Raises ``ValueError`` if no argument is found or if the - path contains internal whitespace. - - - ``nonnegative_int``: Checks for a nonnegative integer argument, - and raises ``ValueError`` if not. - - A further utility function, ``choice``, is supplied to enable - options whose argument must be a member of a finite set of possible - values. A custom conversion function must be written to use it. - For example:: - - from docutils.parsers.rst import directives - - def yesno(argument): - return directives.choice(argument, ('yes', 'no')) - - For example, here is an option spec for a directive which allows two - options, "name" and "value", each with an option argument:: - - directive_fn.options = {'name': unchanged, 'value': int} - -- ``content``: A boolean; true if content is allowed. Directive - functions must handle the case where content is required but not - present in the input text (an empty content list will be supplied). - -The final step of the ``parse_directive()`` method is to call the -directive function itself. - - -Register the Directive -====================== - -Register the new directive in -``docutils/parsers/rst/directives/__init__.py``, in the -``_directive_registry`` dictionary. This allows the reStructuredText -parser to find and use the directive. - -Add an entry to ``docutils/parsers/rst/languages/en.py`` for the -directive, mapping the English name to the canonical name (both -lowercase). Usually the English name and the canonical name are the -same. - -Please check for and update any other language modules for languages -in which you are proficient. - - -Examples -======== - -For the most direct and accurate information, "Use the Source, Luke!". -All standard directives are documented in `reStructuredText -Directives`_, and the source code implementing them is located in the -``docutils/parsers/rst/directives`` package. The ``__init__.py`` -module contains a mapping of directive name to module & function name. -Several representative directives are described below. - - -Admonitions ------------ - -Admonition directives, such as "note" and "caution", are quite simple. -They have no directive arguments or options. Admonition directive -content is interpreted as ordinary reStructuredText. The directive -function simply hands off control to a generic directive function:: - - def note(*args): - return admonition(nodes.note, *args) - - attention.content = 1 - -Note that the only thing distinguishing the various admonition -directives is the element (node class) generated. In the code above, -the node class is passed as the first argument to the generic -directive function, where the actual processing takes place:: - - def admonition(node_class, name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - text = '\n'.join(content) - admonition_node = node_class(text) - if text: - state.nested_parse(content, content_offset, admonition_node) - return [admonition_node] - else: - warning = state_machine.reporter.warning( - 'The "%s" admonition is empty; content required.' - % (name), '', - nodes.literal_block(block_text, block_text), line=lineno) - return [warning] - -Three things are noteworthy in the function above: - -1. The ``admonition_node = node_class(text)`` line creates the wrapper - element, using the class passed in from the initial (stub) - directive function. - -2. The call to ``state.nested_parse()`` is what does the actual - processing. It parses the directive content and adds any generated - elements as child elements of ``admonition_node``. - -3. If there was no directive content, a warning is generated and - returned. The call to ``state_machine.reporter.warning()`` - includes a literal block containing the entire directive text - (``block_text``) and the line (``lineno``) of the top of the - directive. - - -"image" -------- - -The "image" directive is used to insert a picture into a document. -This directive has one argument, the path to the image file, and -supports several options. There is no directive content. Here's the -image directive function:: - - def image(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - reference = ''.join(arguments[0].split('\n')) - if reference.find(' ') != -1: - error = state_machine.reporter.error( - 'Image URI contains whitespace.', '', - nodes.literal_block(block_text, block_text), - line=lineno) - return [error] - options['uri'] = reference - image_node = nodes.image(block_text, **options) - return [image_node] - - image.arguments = (1, 0, 1) - image.options = {'alt': directives.unchanged, - 'height': directives.nonnegative_int, - 'width': directives.nonnegative_int, - 'scale': directives.nonnegative_int, - 'align': align} - -Several things are noteworthy in the code above: - -1. The "image" directive requires a single argument, which is allowed - to contain whitespace (see the argument spec above, - ``image.arguments = (1, 0, 1)``). This is to allow for long URLs - which may span multiple lines. The first line of the ``image`` - function joins the URL, discarding any embedded newlines. Then the - result is checked for embedded spaces, which are *not* allowed. - -2. The reference is added to the ``options`` dictionary under the - "uri" key; this becomes an attribute of the ``nodes.image`` element - object. Any other attributes have already been set explicitly in - the source text. - -3. The "align" option depends on the following definitions (which - actually occur earlier in the source code):: - - align_values = ('top', 'middle', 'bottom', 'left', 'center', - 'right') - - def align(argument): - return directives.choice(argument, align_values) - - -"contents" ----------- - -The "contents" directive is used to insert an auto-generated table of -contents (TOC) into a document. It takes one optional argument, a -title for the TOC. If no title is specified, a default title is used -instead. The directive also handles several options. Here's the -code:: - - def contents(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - """Table of contents.""" - if arguments: - title_text = arguments[0] - text_nodes, messages = state.inline_text(title_text, lineno) - title = nodes.title(title_text, '', *text_nodes) - else: - messages = [] - title = None - pending = nodes.pending(parts.Contents, {'title': title}, - block_text) - pending.details.update(options) - state_machine.document.note_pending(pending) - return [pending] + messages - - contents.arguments = (0, 1, 1) - contents.options = {'depth': directives.nonnegative_int, - 'local': directives.flag, - 'backlinks': backlinks} - -Aspects of note include: - -1. The ``contents.arguments = (0, 1, 1)`` function attribute specifies - a single, *optional* argument. If no argument is present, the - ``arguments`` parameter to the directive function will be an empty - list. - -2. If an argument *is* present, its text is passed to - ``state.inline_text()`` for parsing. Titles may contain inline - markup, such as emphasis or inline literals. - -3. The table of contents is not generated right away. Typically, a - TOC is placed near the beginning of a document, and is a summary or - outline of the section structure of the document. The entire - document must already be processed before a summary can be made. - This directive leaves a ``nodes.pending`` placeholder element in - the document tree, marking the position of the TOC and including a - ``details`` internal attribute containing all the directive - options, effectively communicating the options forward. The actual - table of contents processing is performed by a transform, - ``docutils.transforms.parts.Contents``, after the rest of the - document has been parsed. diff --git a/docutils/docs/peps/pep-0256.txt b/docutils/docs/peps/pep-0256.txt deleted file mode 100644 index bad386391..000000000 --- a/docutils/docs/peps/pep-0256.txt +++ /dev/null @@ -1,299 +0,0 @@ -PEP: 256 -Title: Docstring Processing System Framework -Version: $Revision$ -Last-Modified: $Date$ -Author: David Goodger <goodger@users.sourceforge.net> -Discussions-To: <doc-sig@python.org> -Status: Draft -Type: Standards Track -Content-Type: text/x-rst -Created: 01-Jun-2001 -Post-History: 13-Jun-2001 - - -Abstract -======== - -Python lends itself to inline documentation. With its built-in -docstring syntax, a limited form of `Literate Programming`_ is easy to -do in Python. However, there are no satisfactory standard tools for -extracting and processing Python docstrings. The lack of a standard -toolset is a significant gap in Python's infrastructure; this PEP aims -to fill the gap. - -The issues surrounding docstring processing have been contentious and -difficult to resolve. This PEP proposes a generic Docstring -Processing System (DPS) framework, which separates out the components -(program and conceptual), enabling the resolution of individual issues -either through consensus (one solution) or through divergence (many). -It promotes standard interfaces which will allow a variety of plug-in -components (input context readers, markup parsers, and output format -writers) to be used. - -The concepts of a DPS framework are presented independently of -implementation details. - - -Road Map to the Docstring PEPs -============================== - -There are many aspects to docstring processing. The "Docstring PEPs" -have broken up the issues in order to deal with each of them in -isolation, or as close as possible. The individual aspects and -associated PEPs are as follows: - -* Docstring syntax. PEP 287, "reStructuredText Docstring Format" - [#PEP-287]_, proposes a syntax for Python docstrings, PEPs, and - other uses. - -* Docstring semantics consist of at least two aspects: - - - Conventions: the high-level structure of docstrings. Dealt with - in PEP 257, "Docstring Conventions" [#PEP-257]_. - - - Methodology: rules for the informational content of docstrings. - Not addressed. - -* Processing mechanisms. This PEP (PEP 256) outlines the high-level - issues and specification of an abstract docstring processing system - (DPS). PEP 258, "Docutils Design Specification" [#PEP-258]_, is an - overview of the design and implementation of one DPS under - development. - -* Output styles: developers want the documentation generated from - their source code to look good, and there are many different ideas - about what that means. PEP 258 touches on "Stylist Transforms". - This aspect of docstring processing has yet to be fully explored. - -By separating out the issues, we can form consensus more easily -(smaller fights ;-), and accept divergence more readily. - - -Rationale -========= - -There are standard inline documentation systems for some other -languages. For example, Perl has POD_ ("Plain Old Documentation") and -Java has Javadoc_, but neither of these mesh with the Pythonic way. -POD syntax is very explicit, but takes after Perl in terms of -readability. Javadoc is HTML-centric; except for "``@field``" tags, -raw HTML is used for markup. There are also general tools such as -Autoduck_ and Web_ (Tangle & Weave), useful for multiple languages. - -There have been many attempts to write auto-documentation systems -for Python (not an exhaustive list): - -- Marc-Andre Lemburg's doc.py_ - -- Daniel Larsson's pythondoc_ & gendoc_ - -- Doug Hellmann's HappyDoc_ - -- Laurence Tratt's Crystal_ - -- Ka-Ping Yee's pydoc_ (pydoc.py is now part of the Python standard - library; see below) - -- Tony Ibbs' docutils_ (Tony has donated this name to the `Docutils - project`_) - -- Edward Loper's STminus_ formalization and related efforts - -These systems, each with different goals, have had varying degrees of -success. A problem with many of the above systems was over-ambition -combined with inflexibility. They provided a self-contained set of -components: a docstring extraction system, a markup parser, an -internal processing system and one or more output format writers with -a fixed style. Inevitably, one or more aspects of each system had -serious shortcomings, and they were not easily extended or modified, -preventing them from being adopted as standard tools. - -It has become clear (to this author, at least) that the "all or -nothing" approach cannot succeed, since no monolithic self-contained -system could possibly be agreed upon by all interested parties. A -modular component approach designed for extension, where components -may be multiply implemented, may be the only chance for success. -Standard inter-component APIs will make the DPS components -comprehensible without requiring detailed knowledge of the whole, -lowering the barrier for contributions, and ultimately resulting in a -rich and varied system. - -Each of the components of a docstring processing system should be -developed independently. A "best of breed" system should be chosen, -either merged from existing systems, and/or developed anew. This -system should be included in Python's standard library. - - -PyDoc & Other Existing Systems ------------------------------- - -PyDoc became part of the Python standard library as of release 2.1. -It extracts and displays docstrings from within the Python interactive -interpreter, from the shell command line, and from a GUI window into a -web browser (HTML). Although a very useful tool, PyDoc has several -deficiencies, including: - -- In the case of the GUI/HTML, except for some heuristic hyperlinking - of identifier names, no formatting of the docstrings is done. They - are presented within ``<p><small><tt>`` tags to avoid unwanted line - wrapping. Unfortunately, the result is not attractive. - -- PyDoc extracts docstrings and structural information (class - identifiers, method signatures, etc.) from imported module objects. - There are security issues involved with importing untrusted code. - Also, information from the source is lost when importing, such as - comments, "additional docstrings" (string literals in non-docstring - contexts; see PEP 258 [#PEP-258]_), and the order of definitions. - -The functionality proposed in this PEP could be added to or used by -PyDoc when serving HTML pages. The proposed docstring processing -system's functionality is much more than PyDoc needs in its current -form. Either an independent tool will be developed (which PyDoc may -or may not use), or PyDoc could be expanded to encompass this -functionality and *become* the docstring processing system (or one -such system). That decision is beyond the scope of this PEP. - -Similarly for other existing docstring processing systems, their -authors may or may not choose compatibility with this framework. -However, if this framework is accepted and adopted as the Python -standard, compatibility will become an important consideration in -these systems' future. - - -Specification -============= - -The docstring processing system framework is broken up as follows: - -1. Docstring conventions. Documents issues such as: - - - What should be documented where. - - - First line is a one-line synopsis. - - PEP 257 [#PEP-257]_ documents some of these issues. - -2. Docstring processing system design specification. Documents - issues such as: - - - High-level spec: what a DPS does. - - - Command-line interface for executable script. - - - System Python API. - - - Docstring extraction rules. - - - Readers, which encapsulate the input context. - - - Parsers. - - - Document tree: the intermediate internal data structure. The - output of the Parser and Reader, and the input to the Writer all - share the same data structure. - - - Transforms, which modify the document tree. - - - Writers for output formats. - - - Distributors, which handle output management (one file, many - files, or objects in memory). - - These issues are applicable to any docstring processing system - implementation. PEP 258 [#PEP-258]_ documents these issues. - -3. Docstring processing system implementation. - -4. Input markup specifications: docstring syntax. PEP 287 [#PEP-287]_ - proposes a standard syntax. - -5. Input parser implementations. - -6. Input context readers ("modes": Python source code, PEP, standalone - text file, email, etc.) and implementations. - -7. Stylists: certain input context readers may have associated - stylists which allow for a variety of output document styles. - -8. Output formats (HTML, XML, TeX, DocBook, info, etc.) and writer - implementations. - -Components 1, 2/3/5, and 4 are the subject of individual companion -PEPs. If there is another implementation of the framework or -syntax/parser, additional PEPs may be required. Multiple -implementations of each of components 6 and 7 will be required; the -PEP mechanism may be overkill for these components. - - -Project Web Site -================ - -A SourceForge project has been set up for this work at -http://docutils.sourceforge.net/. - - -References and Footnotes -======================== - -.. [#PEP-287] PEP 287, reStructuredText Docstring Format, Goodger - (http://www.python.org/peps/pep-0287.html) - -.. [#PEP-257] PEP 257, Docstring Conventions, Goodger, Van Rossum - (http://www.python.org/peps/pep-0257.html) - -.. [#PEP-258] PEP 258, Docutils Design Specification, Goodger - (http://www.python.org/peps/pep-0258.html) - -.. _Literate Programming: http://www.literateprogramming.com/ - -.. _POD: http://www.perldoc.com/perl5.6/pod/perlpod.html - -.. _Javadoc: http://java.sun.com/j2se/javadoc/ - -.. _Autoduck: - http://www.helpmaster.com/hlp-developmentaids-autoduck.htm - -.. _Web: http://www-cs-faculty.stanford.edu/~knuth/cweb.html - -.. _doc.py: - http://www.lemburg.com/files/python/SoftwareDescriptions.html#doc.py - -.. _pythondoc: -.. _gendoc: http://starship.python.net/crew/danilo/pythondoc/ - -.. _HappyDoc: http://happydoc.sourceforge.net/ - -.. _Crystal: http://www.btinternet.com/~tratt/comp/python/crystal/ - -.. _pydoc: http://www.python.org/doc/current/lib/module-pydoc.html - -.. _docutils: http://homepage.ntlworld.com/tibsnjoan/docutils/ - -.. _Docutils project: http://docutils.sourceforge.net/ - -.. _STMinus: http://www.cis.upenn.edu/~edloper/pydoc/ - -.. _Python Doc-SIG: http://www.python.org/sigs/doc-sig/ - - -Copyright -========= - -This document has been placed in the public domain. - - -Acknowledgements -================ - -This document borrows ideas from the archives of the `Python -Doc-SIG`_. Thanks to all members past & present. - - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: diff --git a/docutils/docs/peps/pep-0257.txt b/docutils/docs/peps/pep-0257.txt deleted file mode 100644 index 23094c56a..000000000 --- a/docutils/docs/peps/pep-0257.txt +++ /dev/null @@ -1,328 +0,0 @@ -PEP: 257 -Title: Docstring Conventions -Version: $Revision$ -Last-Modified: $Date$ -Author: David Goodger <goodger@users.sourceforge.net>, - Guido van Rossum <guido@python.org> -Discussions-To: doc-sig@python.org -Status: Active -Type: Informational -Content-Type: text/x-rst -Created: 29-May-2001 -Post-History: 13-Jun-2001 - - -Abstract -======== - -This PEP documents the semantics and conventions associated with -Python docstrings. - - -Rationale -========= - -The aim of this PEP is to standardize the high-level structure of -docstrings: what they should contain, and how to say it (without -touching on any markup syntax within docstrings). The PEP contains -conventions, not laws or syntax. - - "A universal convention supplies all of maintainability, clarity, - consistency, and a foundation for good programming habits too. - What it doesn't do is insist that you follow it against your will. - That's Python!" - - -- Tim Peters on comp.lang.python, 2001-06-16 - -If you violate these conventions, the worst you'll get is some dirty -looks. But some software (such as the Docutils_ docstring processing -system [1]_ [2]_) will be aware of the conventions, so following them -will get you the best results. - - -Specification -============= - -What is a Docstring? --------------------- - -A docstring is a string literal that occurs as the first statement in -a module, function, class, or method definition. Such a docstring -becomes the ``__doc__`` special attribute of that object. - -All modules should normally have docstrings, and all functions and -classes exported by a module should also have docstrings. Public -methods (including the ``__init__`` constructor) should also have -docstrings. A package may be documented in the module docstring of -the ``__init__.py`` file in the package directory. - -String literals occurring elsewhere in Python code may also act as -documentation. They are not recognized by the Python bytecode -compiler and are not accessible as runtime object attributes (i.e. not -assigned to ``__doc__``), but two types of extra docstrings may be -extracted by software tools: - -1. String literals occurring immediately after a simple assignment at - the top level of a module, class, or ``__init__`` method are called - "attribute docstrings". - -2. String literals occurring immediately after another docstring are - called "additional docstrings". - -Please see PEP 258, "Docutils Design Specification" [2]_, for a -detailed description of attribute and additional docstrings. - -XXX Mention docstrings of 2.2 properties. - -For consistency, always use ``"""triple double quotes"""`` around -docstrings. Use ``r"""raw triple double quotes"""`` if you use any -backslashes in your docstrings. For Unicode docstrings, use -``u"""Unicode triple-quoted strings"""``. - -There are two forms of docstrings: one-liners and multi-line -docstrings. - - -One-line Docstrings --------------------- - -One-liners are for really obvious cases. They should really fit on -one line. For example:: - - def kos_root(): - """Return the pathname of the KOS root directory.""" - global _kos_root - if _kos_root: return _kos_root - ... - -Notes: - -- Triple quotes are used even though the string fits on one line. - This makes it easy to later expand it. - -- The closing quotes are on the same line as the opening quotes. This - looks better for one-liners. - -- There's no blank line either before or after the docstring. - -- The docstring is a phrase ending in a period. It prescribes the - function or method's effect as a command ("Do this", "Return that"), - not as a description; e.g. don't write "Returns the pathname ...". - -- The one-line docstring should NOT be a "signature" reiterating the - function/method parameters (which can be obtained by introspection). - Don't do:: - - def function(a, b): - """function(a, b) -> list""" - - This type of docstring is only appropriate for C functions (such as - built-ins), where introspection is not possible. However, the - nature of the *return value* cannot be determined by introspection, - so it should be mentioned. The preferred form for such a docstring - would be something like:: - - def function(a, b): - """Do X and return a list.""" - - (Of course "Do X" should be replaced by a useful description!) - - -Multi-line Docstrings ----------------------- - -Multi-line docstrings consist of a summary line just like a one-line -docstring, followed by a blank line, followed by a more elaborate -description. The summary line may be used by automatic indexing -tools; it is important that it fits on one line and is separated from -the rest of the docstring by a blank line. The summary line may be on -the same line as the opening quotes or on the next line. The entire -docstring is indented the same as the quotes at its first line (see -example below). - -Insert a blank line before and after all docstrings (one-line or -multi-line) that document a class -- generally speaking, the class's -methods are separated from each other by a single blank line, and the -docstring needs to be offset from the first method by a blank line; -for symmetry, put a blank line between the class header and the -docstring. Docstrings documenting functions or methods generally -don't have this requirement, unless the function or method's body is -written as a number of blank-line separated sections -- in this case, -treat the docstring as another section, and precede it with a blank -line. - -The docstring of a script (a stand-alone program) should be usable as -its "usage" message, printed when the script is invoked with incorrect -or missing arguments (or perhaps with a "-h" option, for "help"). -Such a docstring should document the script's function and command -line syntax, environment variables, and files. Usage messages can be -fairly elaborate (several screens full) and should be sufficient for a -new user to use the command properly, as well as a complete quick -reference to all options and arguments for the sophisticated user. - -The docstring for a module should generally list the classes, -exceptions and functions (and any other objects) that are exported by -the module, with a one-line summary of each. (These summaries -generally give less detail than the summary line in the object's -docstring.) The docstring for a package (i.e., the docstring of the -package's ``__init__.py`` module) should also list the modules and -subpackages exported by the package. - -The docstring for a function or method should summarize its behavior -and document its arguments, return value(s), side effects, exceptions -raised, and restrictions on when it can be called (all if applicable). -Optional arguments should be indicated. It should be documented -whether keyword arguments are part of the interface. - -The docstring for a class should summarize its behavior and list the -public methods and instance variables. If the class is intended to be -subclassed, and has an additional interface for subclasses, this -interface should be listed separately (in the docstring). The class -constructor should be documented in the docstring for its ``__init__`` -method. Individual methods should be documented by their own -docstring. - -If a class subclasses another class and its behavior is mostly -inherited from that class, its docstring should mention this and -summarize the differences. Use the verb "override" to indicate that a -subclass method replaces a superclass method and does not call the -superclass method; use the verb "extend" to indicate that a subclass -method calls the superclass method (in addition to its own behavior). - -*Do not* use the Emacs convention of mentioning the arguments of -functions or methods in upper case in running text. Python is case -sensitive and the argument names can be used for keyword arguments, so -the docstring should document the correct argument names. It is best -to list each argument on a separate line. For example:: - - def complex(real=0.0, imag=0.0): - """Form a complex number. - - Keyword arguments: - real -- the real part (default 0.0) - imag -- the imaginary part (default 0.0) - - """ - if imag == 0.0 and real == 0.0: return complex_zero - ... - -The BDFL [3]_ recommends inserting a blank line between the last -paragraph in a multi-line docstring and its closing quotes, placing -the closing quotes on a line by themselves. This way, Emacs' -``fill-paragraph`` command can be used on it. - - -Handling Docstring Indentation ------------------------------- - -Docstring processing tools will strip a uniform amount of indentation -from the second and further lines of the docstring, equal to the -minimum indentation of all non-blank lines after the first line. Any -indentation in the first line of the docstring (i.e., up to the first -newline) is insignificant and removed. Relative indentation of later -lines in the docstring is retained. Blank lines should be removed -from the beginning and end of the docstring. - -Since code is much more precise than words, here is an implementation -of the algorithm:: - - def trim(docstring): - if not docstring: - return '' - # Convert tabs to spaces (following the normal Python rules) - # and split into a list of lines: - lines = docstring.expandtabs().splitlines() - # Determine minimum indentation (first line doesn't count): - indent = sys.maxint - for line in lines[1:]: - stripped = line.lstrip() - if stripped: - indent = min(indent, len(line) - len(stripped)) - # Remove indentation (first line is special): - trimmed = [lines[0].strip()] - if indent < sys.maxint: - for line in lines[1:]: - trimmed.append(line[indent:].rstrip()) - # Strip off trailing and leading blank lines: - while trimmed and not trimmed[-1]: - trimmed.pop() - while trimmed and not trimmed[0]: - trimmed.pop(0) - # Return a single string: - return '\n'.join(trimmed) - -The docstring in this example contains two newline characters and is -therefore 3 lines long. The first and last lines are blank:: - - def foo(): - """ - This is the second line of the docstring. - """ - -To illustrate:: - - >>> print repr(foo.__doc__) - '\n This is the second line of the docstring.\n ' - >>> foo.__doc__.splitlines() - ['', ' This is the second line of the docstring.', ' '] - >>> trim(foo.__doc__) - 'This is the second line of the docstring.' - -Once trimmed, these docstrings are equivalent:: - - def foo(): - """A multi-line - docstring. - """ - - def bar(): - """ - A multi-line - docstring. - """ - - -References and Footnotes -======================== - -.. [1] PEP 256, Docstring Processing System Framework, Goodger - (http://www.python.org/peps/pep-0256.html) - -.. [2] PEP 258, Docutils Design Specification, Goodger - (http://www.python.org/peps/pep-0258.html) - -.. [3] Guido van Rossum, Python's creator and Benevolent Dictator For - Life. - -.. _Docutils: http://docutils.sourceforge.net/ - -.. _Python Style Guide: - http://www.python.org/doc/essays/styleguide.html - -.. _Doc-SIG: http://www.python.org/sigs/doc-sig/ - - -Copyright -========= - -This document has been placed in the public domain. - - -Acknowledgements -================ - -The "Specification" text comes mostly verbatim from the `Python Style -Guide`_ essay by Guido van Rossum. - -This document borrows ideas from the archives of the Python Doc-SIG_. -Thanks to all members past and present. - - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - fill-column: 70 - sentence-end-double-space: t - End: diff --git a/docutils/docs/peps/pep-0258.txt b/docutils/docs/peps/pep-0258.txt deleted file mode 100644 index 09bec5d88..000000000 --- a/docutils/docs/peps/pep-0258.txt +++ /dev/null @@ -1,999 +0,0 @@ -PEP: 258 -Title: Docutils Design Specification -Version: $Revision$ -Last-Modified: $Date$ -Author: David Goodger <goodger@users.sourceforge.net> -Discussions-To: <doc-sig@python.org> -Status: Draft -Type: Standards Track -Content-Type: text/x-rst -Requires: 256, 257 -Created: 31-May-2001 -Post-History: 13-Jun-2001 - - -========== - Abstract -========== - -This PEP documents design issues and implementation details for -Docutils, a Python Docstring Processing System (DPS). The rationale -and high-level concepts of a DPS are documented in PEP 256, "Docstring -Processing System Framework" [#PEP-256]_. Also see PEP 256 for a -"Road Map to the Docstring PEPs". - -Docutils is being designed modularly so that any of its components can -be replaced easily. In addition, Docutils is not limited to the -processing of Python docstrings; it processes standalone documents as -well, in several contexts. - -No changes to the core Python language are required by this PEP. Its -deliverables consist of a package for the standard library and its -documentation. - - -=============== - Specification -=============== - -Docutils Project Model -====================== - -Project components and data flow:: - - +---------------------------+ - | Docutils: | - | docutils.core.Publisher, | - | docutils.core.publish_*() | - +---------------------------+ - / | \ - / | \ - 1,3,5 / 6 | \ 7 - +--------+ +-------------+ +--------+ - | READER | ----> | TRANSFORMER | ====> | WRITER | - +--------+ +-------------+ +--------+ - / \\ | - / \\ | - 2 / 4 \\ 8 | - +-------+ +--------+ +--------+ - | INPUT | | PARSER | | OUTPUT | - +-------+ +--------+ +--------+ - -The numbers above each component indicate the path a document's data -takes. Double-width lines between Reader & Parser and between -Transformer & Writer indicate that data sent along these paths should -be standard (pure & unextended) Docutils doc trees. Single-width -lines signify that internal tree extensions or completely unrelated -representations are possible, but they must be supported at both ends. - - -Publisher ---------- - -The ``docutils.core`` module contains a "Publisher" facade class and -several convenience functions: "publish_cmdline()" (for command-line -front ends), "publish_file()" (for programmatic use with file-like -I/O), and "publish_string()" (for programmatic use with string I/O). -The Publisher class encapsulates the high-level logic of a Docutils -system. The Publisher class has overall responsibility for -processing, controlled by the ``Publisher.publish()`` method: - -1. Set up internal settings (may include config files & command-line - options) and I/O objects. - -2. Call the Reader object to read data from the source Input object - and parse the data with the Parser object. A document object is - returned. - -3. Set up and apply transforms via the Transformer object attached to - the document. - -4. Call the Writer object which translates the document to the final - output format and writes the formatted data to the destination - Output object. Depending on the Output object, the output may be - returned from the Writer, and then from the ``publish()`` method. - -Calling the "publish" function (or instantiating a "Publisher" object) -with component names will result in default behavior. For custom -behavior (customizing component settings), create custom component -objects first, and pass *them* to the Publisher or ``publish_*`` -convenience functions. - - -Readers -------- - -Readers understand the input context (where the data is coming from), -send the whole input or discrete "chunks" to the parser, and provide -the context to bind the chunks together back into a cohesive whole. - -Each reader is a module or package exporting a "Reader" class with a -"read" method. The base "Reader" class can be found in the -``docutils/readers/__init__.py`` module. - -Most Readers will have to be told what parser to use. So far (see the -list of examples below), only the Python Source Reader ("PySource"; -still incomplete) will be able to determine the parser on its own. - -Responsibilities: - -* Get input text from the source I/O. - -* Pass the input text to the parser, along with a fresh `document - tree`_ root. - -Examples: - -* Standalone (Raw/Plain): Just read a text file and process it. - The reader needs to be told which parser to use. - - The "Standalone Reader" has been implemented in module - ``docutils.readers.standalone``. - -* Python Source: See `Python Source Reader`_ below. This Reader is - currently in development in the Docutils sandbox. - -* Email: RFC-822 headers, quoted excerpts, signatures, MIME parts. - -* PEP: RFC-822 headers, "PEP xxxx" and "RFC xxxx" conversion to URIs. - The "PEP Reader" has been implemented in module - ``docutils.readers.pep``; see PEP 287 and PEP 12. - -* Wiki: Global reference lookups of "wiki links" incorporated into - transforms. (CamelCase only or unrestricted?) Lazy - indentation? - -* Web Page: As standalone, but recognize meta fields as meta tags. - Support for templates of some sort? (After ``<body>``, before - ``</body>``?) - -* FAQ: Structured "question & answer(s)" constructs. - -* Compound document: Merge chapters into a book. Master manifest - file? - - -Parsers -------- - -Parsers analyze their input and produce a Docutils `document tree`_. -They don't know or care anything about the source or destination of -the data. - -Each input parser is a module or package exporting a "Parser" class -with a "parse" method. The base "Parser" class can be found in the -``docutils/parsers/__init__.py`` module. - -Responsibilities: Given raw input text and a doctree root node, -populate the doctree by parsing the input text. - -Example: The only parser implemented so far is for the -reStructuredText markup. It is implemented in the -``docutils/parsers/rst/`` package. - -The development and integration of other parsers is possible and -encouraged. - - -.. _transforms: - -Transformer ------------ - -The Transformer class, in ``docutils/transforms/__init__.py``, stores -transforms and applies them to documents. A transformer object is -attached to every new document tree. The Publisher_ calls -``Transformer.apply_transforms()`` to apply all stored transforms to -the document tree. Transforms change the document tree from one form -to another, add to the tree, or prune it. Transforms resolve -references and footnote numbers, process interpreted text, and do -other context-sensitive processing. - -Some transforms are specific to components (Readers, Parser, Writers, -Input, Output). Standard component-specific transforms are specified -in the ``default_transforms`` attribute of component classes. After -the Reader has finished processing, the Publisher_ calls -``Transformer.populate_from_components()`` with a list of components -and all default transforms are stored. - -Each transform is a class in a module in the ``docutils/transforms/`` -package, a subclass of ``docutils.tranforms.Transform``. Transform -classes each have a ``default_priority`` attribute which is used by -the Transformer to apply transforms in order (low to high). The -default priority can be overridden when adding transforms to the -Transformer object. - -Transformer responsibilities: - -* Apply transforms to the document tree, in priority order. - -* Store a mapping of component type name ('reader', 'writer', etc.) to - component objects. These are used by certain transforms (such as - "components.Filter") to determine suitability. - -Transform responsibilities: - -* Modify a doctree in-place, either purely transforming one structure - into another, or adding new structures based on the doctree and/or - external data. - -Examples of transforms (in the ``docutils/transforms/`` package): - -* frontmatter.DocInfo: Conversion of document metadata (bibliographic - information). - -* references.AnonymousHyperlinks: Resolution of anonymous references - to corresponding targets. - -* parts.Contents: Generates a table of contents for a document. - -* document.Merger: Combining multiple populated doctrees into one. - (Not yet implemented or fully understood.) - -* document.Splitter: Splits a document into a tree-structure of - subdocuments, perhaps by section. It will have to transform - references appropriately. (Neither implemented not remotely - understood.) - -* components.Filter: Includes or excludes elements which depend on a - specific Docutils component. - - -Writers -------- - -Writers produce the final output (HTML, XML, TeX, etc.). Writers -translate the internal `document tree`_ structure into the final data -format, possibly running Writer-specific transforms_ first. - -By the time the document gets to the Writer, it should be in final -form. The Writer's job is simply (and only) to translate from the -Docutils doctree structure to the target format. Some small -transforms may be required, but they should be local and -format-specific. - -Each writer is a module or package exporting a "Writer" class with a -"write" method. The base "Writer" class can be found in the -``docutils/writers/__init__.py`` module. - -Responsibilities: - -* Translate doctree(s) into specific output formats. - - - Transform references into format-native forms. - -* Write the translated output to the destination I/O. - -Examples: - -* XML: Various forms, such as: - - - Docutils XML (an expression of the internal document tree, - implemented as ``docutils.writers.docutils_xml``). - - - DocBook (being implemented in the Docutils sandbox). - -* HTML (XHTML implemented as ``docutils.writers.html4css1``). - -* PDF (a ReportLabs interface is being developed in the Docutils - sandbox). - -* TeX (a LaTeX Writer is being implemented in the sandbox). - -* Docutils-native pseudo-XML (implemented as - ``docutils.writers.pseudoxml``, used for testing). - -* Plain text - -* reStructuredText? - - -Input/Output ------------- - -I/O classes provide a uniform API for low-level input and output. -Subclasses will exist for a variety of input/output mechanisms. -However, they can be considered an implementation detail. Most -applications should be satisfied using one of the convenience -functions associated with the Publisher_. - -I/O classes are currently in the preliminary stages; there's a lot of -work yet to be done. Issues: - -* How to represent multi-file input (files & directories) in the API? - -* How to represent multi-file output? Perhaps "Writer" variants, one - for each output distribution type? Or Output objects with - associated transforms? - -Responsibilities: - -* Read data from the input source (Input objects) or write data to the - output destination (Output objects). - -Examples of input sources: - -* A single file on disk or a stream (implemented as - ``docutils.io.FileInput``). - -* Multiple files on disk (``MultiFileInput``?). - -* Python source files: modules and packages. - -* Python strings, as received from a client application - (implemented as ``docutils.io.StringInput``). - -Examples of output destinations: - -* A single file on disk or a stream (implemented as - ``docutils.io.FileOutput``). - -* A tree of directories and files on disk. - -* A Python string, returned to a client application (implemented as - ``docutils.io.StringOutput``). - -* No output; useful for programmatic applications where only a portion - of the normal output is to be used (implemented as - ``docutils.io.NullOutput``). - -* A single tree-shaped data structure in memory. - -* Some other set of data structures in memory. - - -Docutils Package Structure -========================== - -* Package "docutils". - - - Module "__init__.py" contains: class "Component", a base class for - Docutils components; class "SettingsSpec", a base class for - specifying runtime settings (used by docutils.frontend); and class - "TransformSpec", a base class for specifying transforms. - - - Module "docutils.core" contains facade class "Publisher" and - convenience functions. See `Publisher`_ above. - - - Module "docutils.frontend" provides runtime settings support, for - programmatic use and front-end tools (including configuration file - support, and command-line argument and option processing). - - - Module "docutils.io" provides a uniform API for low-level input - and output. See `Input/Output`_ above. - - - Module "docutils.nodes" contains the Docutils document tree - element class library plus tree-traversal Visitor pattern base - classes. See `Document Tree`_ below. - - - Module "docutils.statemachine" contains a finite state machine - specialized for regular-expression-based text filters and parsers. - The reStructuredText parser implementation is based on this - module. - - - Module "docutils.urischemes" contains a mapping of known URI - schemes ("http", "ftp", "mail", etc.). - - - Module "docutils.utils" contains utility functions and classes, - including a logger class ("Reporter"; see `Error Handling`_ - below). - - - Package "docutils.parsers": markup parsers_. - - - Function "get_parser_class(parser_name)" returns a parser module - by name. Class "Parser" is the base class of specific parsers. - (``docutils/parsers/__init__.py``) - - - Package "docutils.parsers.rst": the reStructuredText parser. - - - Alternate markup parsers may be added. - - See `Parsers`_ above. - - - Package "docutils.readers": context-aware input readers. - - - Function "get_reader_class(reader_name)" returns a reader module - by name or alias. Class "Reader" is the base class of specific - readers. (``docutils/readers/__init__.py``) - - - Module "docutils.readers.standalone" reads independent document - files. - - - Module "docutils.readers.pep" reads PEPs (Python Enhancement - Proposals). - - - Readers to be added for: Python source code (structure & - docstrings), email, FAQ, and perhaps Wiki and others. - - See `Readers`_ above. - - - Package "docutils.writers": output format writers. - - - Function "get_writer_class(writer_name)" returns a writer module - by name. Class "Writer" is the base class of specific writers. - (``docutils/writers/__init__.py``) - - - Module "docutils.writers.html4css1" is a simple HyperText Markup - Language document tree writer for HTML 4.01 and CSS1. - - - Module "docutils.writers.docutils_xml" writes the internal - document tree in XML form. - - - Module "docutils.writers.pseudoxml" is a simple internal - document tree writer; it writes indented pseudo-XML. - - - Writers to be added: HTML 3.2 or 4.01-loose, XML (various forms, - such as DocBook), PDF, TeX, plaintext, reStructuredText, and - perhaps others. - - See `Writers`_ above. - - - Package "docutils.transforms": tree transform classes. - - - Class "Transformer" stores transforms and applies them to - document trees. (``docutils/transforms/__init__.py``) - - - Class "Transform" is the base class of specific transforms. - (``docutils/transforms/__init__.py``) - - - Each module contains related transform classes. - - See `Transforms`_ above. - - - Package "docutils.languages": Language modules contain - language-dependent strings and mappings. They are named for their - language identifier (as defined in `Choice of Docstring Format`_ - below), converting dashes to underscores. - - - Function "get_language(language_code)", returns matching - language module. (``docutils/languages/__init__.py``) - - - Modules: en.py (English), de.py (German), fr.py (French), it.py - (Italian), sk.py (Slovak), sv.py (Swedish). - - - Other languages to be added. - -* Third-party modules: "extras" directory. These modules are - installed only if they're not already present in the Python - installation. - - - ``extras/optparse.py`` and ``extras/textwrap.py`` provide - option parsing and command-line help; from Greg Ward's - http://optik.sf.net/ project, included for convenience. - - - ``extras/roman.py`` contains Roman numeral conversion routines. - - -Front-End Tools -=============== - -The ``tools/`` directory contains several front ends for common -Docutils processing. See `Docutils Front-End Tools`_ for details. - -.. _Docutils Front-End Tools: http://docutils.sf.net/docs/tools.html - - -Document Tree -============= - -A single intermediate data structure is used internally by Docutils, -in the interfaces between components; it is defined in the -``docutils.nodes`` module. It is not required that this data -structure be used *internally* by any of the components, just -*between* components as outlined in the diagram in the `Docutils -Project Model`_ above. - -Custom node types are allowed, provided that either (a) a transform -converts them to standard Docutils nodes before they reach the Writer -proper, or (b) the custom node is explicitly supported by certain -Writers, and is wrapped in a filtered "pending" node. An example of -condition (a) is the `Python Source Reader`_ (see below), where a -"stylist" transform converts custom nodes. The HTML ``<meta>`` tag is -an example of condition (b); it is supported by the HTML Writer but -not by others. The reStructuredText "meta" directive creates a -"pending" node, which contains knowledge that the embedded "meta" node -can only be handled by HTML-compatible writers. The "pending" node is -resolved by the ``docutils.transforms.components.Filter`` transform, -which checks that the calling writer supports HTML; if it doesn't, the -"pending" node (and enclosed "meta" node) is removed from the -document. - -The document tree data structure is similar to a DOM tree, but with -specific node names (classes) instead of DOM's generic nodes. The -schema is documented in an XML DTD (eXtensible Markup Language -Document Type Definition), which comes in two parts: - -* the Docutils Generic DTD, docutils.dtd_, and - -* the OASIS Exchange Table Model, soextbl.dtd_. - -The DTD defines a rich set of elements, suitable for many input and -output formats. The DTD retains all information necessary to -reconstruct the original input text, or a reasonable facsimile -thereof. - -See `The Docutils Document Tree`_ for details (incomplete). - - -Error Handling -============== - -When the parser encounters an error in markup, it inserts a system -message (DTD element "system_message"). There are five levels of -system messages: - -* Level-0, "DEBUG": an internal reporting issue. There is no effect - on the processing. Level-0 system messages are handled separately - from the others. - -* Level-1, "INFO": a minor issue that can be ignored. There is little - or no effect on the processing. Typically level-1 system messages - are not reported. - -* Level-2, "WARNING": an issue that should be addressed. If ignored, - there may be minor problems with the output. Typically level-2 - system messages are reported but do not halt processing - -* Level-3, "ERROR": a major issue that should be addressed. If - ignored, the output will contain unpredictable errors. Typically - level-3 system messages are reported but do not halt processing - -* Level-4, "SEVERE": a critical error that must be addressed. - Typically level-4 system messages are turned into exceptions which - halt processing. If ignored, the output will contain severe errors. - -Although the initial message levels were devised independently, they -have a strong correspondence to `VMS error condition severity -levels`_; the names in quotes for levels 1 through 4 were borrowed -from VMS. Error handling has since been influenced by the `log4j -project`_. - - -Python Source Reader -==================== - -The Python Source Reader ("PySource") is the Docutils component that -reads Python source files, extracts docstrings in context, then -parses, links, and assembles the docstrings into a cohesive whole. It -is a major and non-trivial component, currently under experimental -development in the Docutils sandbox. High-level design issues are -presented here. - - -Processing Model ----------------- - -This model will evolve over time, incorporating experience and -discoveries. - -1. The PySource Reader uses an Input class to read in Python packages - and modules, into a tree of strings. - -2. The Python modules are parsed, converting the tree of strings into - a tree of abstract syntax trees with docstring nodes. - -3. The abstract syntax trees are converted into an internal - representation of the packages/modules. Docstrings are extracted, - as well as code structure details. See `AST Mining`_ below. - Namespaces are constructed for lookup in step 6. - -4. One at a time, the docstrings are parsed, producing standard - Docutils doctrees. - -5. PySource assembles all the individual docstrings' doctrees into a - Python-specific custom Docutils tree paralleling the - package/module/class structure; this is a custom Reader-specific - internal representation (see the `Docutils Python Source DTD`_). - Namespaces must be merged: Python identifiers, hyperlink targets. - -6. Cross-references from docstrings (interpreted text) to Python - identifiers are resolved according to the Python namespace lookup - rules. See `Identifier Cross-References`_ below. - -7. A "Stylist" transform is applied to the custom doctree (by the - Transformer_), custom nodes are rendered using standard nodes as - primitives, and a standard document tree is emitted. See `Stylist - Transforms`_ below. - -8. Other transforms are applied to the standard doctree by the - Transformer_. - -9. The standard doctree is sent to a Writer, which translates the - document into a concrete format (HTML, PDF, etc.). - -10. The Writer uses an Output class to write the resulting data to its - destination (disk file, directories and files, etc.). - - -AST Mining ----------- - -Abstract Syntax Tree mining code will be written (or adapted) that -scans a parsed Python module, and returns an ordered tree containing -the names, docstrings (including attribute and additional docstrings; -see below), and additional info (in parentheses below) of all of the -following objects: - -* packages -* modules -* module attributes (+ initial values) -* classes (+ inheritance) -* class attributes (+ initial values) -* instance attributes (+ initial values) -* methods (+ parameters & defaults) -* functions (+ parameters & defaults) - -(Extract comments too? For example, comments at the start of a module -would be a good place for bibliographic field lists.) - -In order to evaluate interpreted text cross-references, namespaces for -each of the above will also be required. - -See the python-dev/docstring-develop thread "AST mining", started on -2001-08-14. - - -Docstring Extraction Rules --------------------------- - -1. What to examine: - - a) If the "``__all__``" variable is present in the module being - documented, only identifiers listed in "``__all__``" are - examined for docstrings. - - b) In the absence of "``__all__``", all identifiers are examined, - except those whose names are private (names begin with "_" but - don't begin and end with "__"). - - c) 1a and 1b can be overridden by runtime settings. - -2. Where: - - Docstrings are string literal expressions, and are recognized in - the following places within Python modules: - - a) At the beginning of a module, function definition, class - definition, or method definition, after any comments. This is - the standard for Python ``__doc__`` attributes. - - b) Immediately following a simple assignment at the top level of a - module, class definition, or ``__init__`` method definition, - after any comments. See `Attribute Docstrings`_ below. - - c) Additional string literals found immediately after the - docstrings in (a) and (b) will be recognized, extracted, and - concatenated. See `Additional Docstrings`_ below. - - d) @@@ 2.2-style "properties" with attribute docstrings? Wait for - syntax? - -3. How: - - Whenever possible, Python modules should be parsed by Docutils, not - imported. There are several reasons: - - - Importing untrusted code is inherently insecure. - - - Information from the source is lost when using introspection to - examine an imported module, such as comments and the order of - definitions. - - - Docstrings are to be recognized in places where the byte-code - compiler ignores string literal expressions (2b and 2c above), - meaning importing the module will lose these docstrings. - - Of course, standard Python parsing tools such as the "parser" - library module should be used. - - When the Python source code for a module is not available - (i.e. only the ``.pyc`` file exists) or for C extension modules, to - access docstrings the module can only be imported, and any - limitations must be lived with. - -Since attribute docstrings and additional docstrings are ignored by -the Python byte-code compiler, no namespace pollution or runtime bloat -will result from their use. They are not assigned to ``__doc__`` or -to any other attribute. The initial parsing of a module may take a -slight performance hit. - - -Attribute Docstrings -'''''''''''''''''''' - -(This is a simplified version of PEP 224 [#PEP-224]_.) - -A string literal immediately following an assignment statement is -interpreted by the docstring extraction machinery as the docstring of -the target of the assignment statement, under the following -conditions: - -1. The assignment must be in one of the following contexts: - - a) At the top level of a module (i.e., not nested inside a compound - statement such as a loop or conditional): a module attribute. - - b) At the top level of a class definition: a class attribute. - - c) At the top level of the "``__init__``" method definition of a - class: an instance attribute. Instance attributes assigned in - other methods are assumed to be implementation details. (@@@ - ``__new__`` methods?) - - d) A function attribute assignment at the top level of a module or - class definition. - - Since each of the above contexts are at the top level (i.e., in the - outermost suite of a definition), it may be necessary to place - dummy assignments for attributes assigned conditionally or in a - loop. - -2. The assignment must be to a single target, not to a list or a tuple - of targets. - -3. The form of the target: - - a) For contexts 1a and 1b above, the target must be a simple - identifier (not a dotted identifier, a subscripted expression, - or a sliced expression). - - b) For context 1c above, the target must be of the form - "``self.attrib``", where "``self``" matches the "``__init__``" - method's first parameter (the instance parameter) and "attrib" - is a simple identifier as in 3a. - - c) For context 1d above, the target must be of the form - "``name.attrib``", where "``name``" matches an already-defined - function or method name and "attrib" is a simple identifier as - in 3a. - -Blank lines may be used after attribute docstrings to emphasize the -connection between the assignment and the docstring. - -Examples:: - - g = 'module attribute (module-global variable)' - """This is g's docstring.""" - - class AClass: - - c = 'class attribute' - """This is AClass.c's docstring.""" - - def __init__(self): - """Method __init__'s docstring.""" - - self.i = 'instance attribute' - """This is self.i's docstring.""" - - def f(x): - """Function f's docstring.""" - return x**2 - - f.a = 1 - """Function attribute f.a's docstring.""" - - -Additional Docstrings -''''''''''''''''''''' - -(This idea was adapted from PEP 216 [#PEP-216]_.) - -Many programmers would like to make extensive use of docstrings for -API documentation. However, docstrings do take up space in the -running program, so some programmers are reluctant to "bloat up" their -code. Also, not all API documentation is applicable to interactive -environments, where ``__doc__`` would be displayed. - -Docutils' docstring extraction tools will concatenate all string -literal expressions which appear at the beginning of a definition or -after a simple assignment. Only the first strings in definitions will -be available as ``__doc__``, and can be used for brief usage text -suitable for interactive sessions; subsequent string literals and all -attribute docstrings are ignored by the Python byte-code compiler and -may contain more extensive API information. - -Example:: - - def function(arg): - """This is __doc__, function's docstring.""" - """ - This is an additional docstring, ignored by the byte-code - compiler, but extracted by Docutils. - """ - pass - -.. topic:: Issue: ``from __future__ import`` - - This would break "``from __future__ import``" statements introduced - in Python 2.1 for multiple module docstrings (main docstring plus - additional docstring(s)). The Python Reference Manual specifies: - - A future statement must appear near the top of the module. The - only lines that can appear before a future statement are: - - * the module docstring (if any), - * comments, - * blank lines, and - * other future statements. - - Resolution? - - 1. Should we search for docstrings after a ``__future__`` - statement? Very ugly. - - 2. Redefine ``__future__`` statements to allow multiple preceding - string literals? - - 3. Or should we not even worry about this? There probably - shouldn't be ``__future__`` statements in production code, after - all. Perhaps modules with ``__future__`` statements will simply - have to put up with the single-docstring limitation. - - -Choice of Docstring Format --------------------------- - -Rather than force everyone to use a single docstring format, multiple -input formats are allowed by the processing system. A special -variable, ``__docformat__``, may appear at the top level of a module -before any function or class definitions. Over time or through -decree, a standard format or set of formats should emerge. - -The ``__docformat__`` variable is a string containing the name of the -format being used, a case-insensitive string matching the input -parser's module or package name (i.e., the same name as required to -"import" the module or package), or a registered alias. If no -``__docformat__`` is specified, the default format is "plaintext" for -now; this may be changed to the standard format if one is ever -established. - -The ``__docformat__`` string may contain an optional second field, -separated from the format name (first field) by a single space: a -case-insensitive language identifier as defined in RFC 1766. A -typical language identifier consists of a 2-letter language code from -`ISO 639`_ (3-letter codes used only if no 2-letter code exists; RFC -1766 is currently being revised to allow 3-letter codes). If no -language identifier is specified, the default is "en" for English. -The language identifier is passed to the parser and can be used for -language-dependent markup features. - - -Identifier Cross-References ---------------------------- - -In Python docstrings, interpreted text is used to classify and mark up -program identifiers, such as the names of variables, functions, -classes, and modules. If the identifier alone is given, its role is -inferred implicitly according to the Python namespace lookup rules. -For functions and methods (even when dynamically assigned), -parentheses ('()') may be included:: - - This function uses `another()` to do its work. - -For class, instance and module attributes, dotted identifiers are used -when necessary. For example (using reStructuredText markup):: - - class Keeper(Storer): - - """ - Extend `Storer`. Class attribute `instances` keeps track - of the number of `Keeper` objects instantiated. - """ - - instances = 0 - """How many `Keeper` objects are there?""" - - def __init__(self): - """ - Extend `Storer.__init__()` to keep track of instances. - - Keep count in `Keeper.instances`, data in `self.data`. - """ - Storer.__init__(self) - Keeper.instances += 1 - - self.data = [] - """Store data in a list, most recent last.""" - - def store_data(self, data): - """ - Extend `Storer.store_data()`; append new `data` to a - list (in `self.data`). - """ - self.data = data - -Each of the identifiers quoted with backquotes ("`") will become -references to the definitions of the identifiers themselves. - - -Stylist Transforms ------------------- - -Stylist transforms are specialized transforms specific to the PySource -Reader. The PySource Reader doesn't have to make any decisions as to -style; it just produces a logically constructed document tree, parsed -and linked, including custom node types. Stylist transforms -understand the custom nodes created by the Reader and convert them -into standard Docutils nodes. - -Multiple Stylist transforms may be implemented and one can be chosen -at runtime (through a "--style" or "--stylist" command-line option). -Each Stylist transform implements a different layout or style; thus -the name. They decouple the context-understanding part of the Reader -from the layout-generating part of processing, resulting in a more -flexible and robust system. This also serves to "separate style from -content", the SGML/XML ideal. - -By keeping the piece of code that does the styling small and modular, -it becomes much easier for people to roll their own styles. The -"barrier to entry" is too high with existing tools; extracting the -stylist code will lower the barrier considerably. - - -========================== - References and Footnotes -========================== - -.. [#PEP-256] PEP 256, Docstring Processing System Framework, Goodger - (http://www.python.org/peps/pep-0256.html) - -.. [#PEP-224] PEP 224, Attribute Docstrings, Lemburg - (http://www.python.org/peps/pep-0224.html) - -.. [#PEP-216] PEP 216, Docstring Format, Zadka - (http://www.python.org/peps/pep-0216.html) - -.. _docutils.dtd: http://docutils.sourceforge.net/spec/docutils.dtd - -.. _soextbl.dtd: http://docutils.sourceforge.net/spec/soextblx.dtd - -.. _The Docutils Document Tree: - http://docutils.sourceforge.net/spec/doctree.html - -.. _VMS error condition severity levels: - http://www.openvms.compaq.com:8000/73final/5841/841pro_027.html - #error_cond_severity - -.. _log4j project: http://jakarta.apache.org/log4j/ - -.. _Docutils Python Source DTD: - http://docutils.sourceforge.net/spec/pysource.dtd - -.. _ISO 639: http://lcweb.loc.gov/standards/iso639-2/englangn.html - -.. _Python Doc-SIG: http://www.python.org/sigs/doc-sig/ - - - -================== - Project Web Site -================== - -A SourceForge project has been set up for this work at -http://docutils.sourceforge.net/. - - -=========== - Copyright -=========== - -This document has been placed in the public domain. - - -================== - Acknowledgements -================== - -This document borrows ideas from the archives of the `Python -Doc-SIG`_. Thanks to all members past & present. - - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: diff --git a/docutils/docs/peps/pep-0287.txt b/docutils/docs/peps/pep-0287.txt deleted file mode 100644 index c6e48901b..000000000 --- a/docutils/docs/peps/pep-0287.txt +++ /dev/null @@ -1,815 +0,0 @@ -PEP: 287 -Title: reStructuredText Docstring Format -Version: $Revision$ -Last-Modified: $Date$ -Author: David Goodger <goodger@users.sourceforge.net> -Discussions-To: <doc-sig@python.org> -Status: Draft -Type: Informational -Content-Type: text/x-rst -Created: 25-Mar-2002 -Post-History: 02-Apr-2002 -Replaces: 216 - - -Abstract -======== - -When plaintext hasn't been expressive enough for inline documentation, -Python programmers have sought out a format for docstrings. This PEP -proposes that the `reStructuredText markup`_ be adopted as a standard -markup format for structured plaintext documentation in Python -docstrings, and for PEPs and ancillary documents as well. -reStructuredText is a rich and extensible yet easy-to-read, -what-you-see-is-what-you-get plaintext markup syntax. - -Only the low-level syntax of docstrings is addressed here. This PEP -is not concerned with docstring semantics or processing at all (see -PEP 256 for a "Road Map to the Docstring PEPs"). Nor is it an attempt -to deprecate pure plaintext docstrings, which are always going to be -legitimate. The reStructuredText markup is an alternative for those -who want more expressive docstrings. - - -Benefits -======== - -Programmers are by nature a lazy breed. We reuse code with functions, -classes, modules, and subsystems. Through its docstring syntax, -Python allows us to document our code from within. The "holy grail" -of the Python Documentation Special Interest Group (Doc-SIG_) has been -a markup syntax and toolset to allow auto-documentation, where the -docstrings of Python systems can be extracted in context and processed -into useful, high-quality documentation for multiple purposes. - -Document markup languages have three groups of customers: the authors -who write the documents, the software systems that process the data, -and the readers, who are the final consumers and the most important -group. Most markups are designed for the authors and software -systems; readers are only meant to see the processed form, either on -paper or via browser software. ReStructuredText is different: it is -intended to be easily readable in source form, without prior knowledge -of the markup. ReStructuredText is entirely readable in plaintext -format, and many of the markup forms match common usage (e.g., -``*emphasis*``), so it reads quite naturally. Yet it is rich enough -to produce complex documents, and extensible so that there are few -limits. Of course, to write reStructuredText documents some prior -knowledge is required. - -The markup offers functionality and expressivity, while maintaining -easy readability in the source text. The processed form (HTML etc.) -makes it all accessible to readers: inline live hyperlinks; live links -to and from footnotes; automatic tables of contents (with live -links!); tables; images for diagrams etc.; pleasant, readable styled -text. - -The reStructuredText parser is available now, part of the Docutils_ -project. Standalone reStructuredText documents and PEPs can be -converted to HTML; other output format writers are being worked on and -will become available over time. Work is progressing on a Python -source "Reader" which will implement auto-documentation from -docstrings. Authors of existing auto-documentation tools are -encouraged to integrate the reStructuredText parser into their -projects, or better yet, to join forces to produce a world-class -toolset for the Python standard library. - -Tools will become available in the near future, which will allow -programmers to generate HTML for online help, XML for multiple -purposes, and eventually PDF, DocBook, and LaTeX for printed -documentation, essentially "for free" from the existing docstrings. -The adoption of a standard will, at the very least, benefit docstring -processing tools by preventing further "reinventing the wheel". - -Eventually PyDoc, the one existing standard auto-documentation tool, -could have reStructuredText support added. In the interim it will -have no problem with reStructuredText markup, since it treats all -docstrings as preformatted plaintext. - - -Goals -===== - -These are the generally accepted goals for a docstring format, as -discussed in the Doc-SIG: - -1. It must be readable in source form by the casual observer. - -2. It must be easy to type with any standard text editor. - -3. It must not need to contain information which can be deduced from - parsing the module. - -4. It must contain sufficient information (structure) so it can be - converted to any reasonable markup format. - -5. It must be possible to write a module's entire documentation in - docstrings, without feeling hampered by the markup language. - -reStructuredText meets and exceeds all of these goals, and sets its -own goals as well, even more stringent. See `Docstring-Significant -Features`_ below. - -The goals of this PEP are as follows: - -1. To establish reStructuredText as a standard structured plaintext - format for docstrings (inline documentation of Python modules and - packages), PEPs, README-type files and other standalone documents. - "Accepted" status will be sought through Python community consensus - and eventual BDFL pronouncement. - - Please note that reStructuredText is being proposed as *a* - standard, not *the only* standard. Its use will be entirely - optional. Those who don't want to use it need not. - -2. To solicit and address any related concerns raised by the Python - community. - -3. To encourage community support. As long as multiple competing - markups are out there, the development community remains fractured. - Once a standard exists, people will start to use it, and momentum - will inevitably gather. - -4. To consolidate efforts from related auto-documentation projects. - It is hoped that interested developers will join forces and work on - a joint/merged/common implementation. - -Once reStructuredText is a Python standard, effort can be focused on -tools instead of arguing for a standard. Python needs a standard set -of documentation tools. - -With regard to PEPs, one or both of the following strategies may be -applied: - -a) Keep the existing PEP section structure constructs (one-line - section headers, indented body text). Subsections can either be - forbidden, or supported with reStructuredText-style underlined - headers in the indented body text. - -b) Replace the PEP section structure constructs with the - reStructuredText syntax. Section headers will require underlines, - subsections will be supported out of the box, and body text need - not be indented (except for block quotes). - -Strategy (b) is recommended, and its implementation is complete. - -Support for RFC 2822 headers has been added to the reStructuredText -parser for PEPs (unambiguous given a specific context: the first -contiguous block of the document). It may be desired to concretely -specify what over/underline styles are allowed for PEP section -headers, for uniformity. - - -Rationale -========= - -The lack of a standard syntax for docstrings has hampered the -development of standard tools for extracting and converting docstrings -into documentation in standard formats (e.g., HTML, DocBook, TeX). -There have been a number of proposed markup formats and variations, -and many tools tied to these proposals, but without a standard -docstring format they have failed to gain a strong following and/or -floundered half-finished. - -Throughout the existence of the Doc-SIG, consensus on a single -standard docstring format has never been reached. A lightweight, -implicit markup has been sought, for the following reasons (among -others): - -1. Docstrings written within Python code are available from within the - interactive interpreter, and can be "print"ed. Thus the use of - plaintext for easy readability. - -2. Programmers want to add structure to their docstrings, without - sacrificing raw docstring readability. Unadorned plaintext cannot - be transformed ("up-translated") into useful structured formats. - -3. Explicit markup (like XML or TeX) is widely considered unreadable - by the uninitiated. - -4. Implicit markup is aesthetically compatible with the clean and - minimalist Python syntax. - -Many alternative markups for docstrings have been proposed on the -Doc-SIG over the years; a representative sample is listed below. Each -is briefly analyzed in terms of the goals stated above. Please note -that this is *not* intended to be an exclusive list of all existing -markup systems; there are many other markups (Texinfo, Doxygen, TIM, -YODL, AFT, ...) which are not mentioned. - -- XML_, SGML_, DocBook_, HTML_, XHTML_ - - XML and SGML are explicit, well-formed meta-languages suitable for - all kinds of documentation. XML is a variant of SGML. They are - best used behind the scenes, because to untrained eyes they are - verbose, difficult to type, and too cluttered to read comfortably as - source. DocBook, HTML, and XHTML are all applications of SGML - and/or XML, and all share the same basic syntax and the same - shortcomings. - -- TeX_ - - TeX is similar to XML/SGML in that it's explicit, but not very easy - to write, and not easy for the uninitiated to read. - -- `Perl POD`_ - - Most Perl modules are documented in a format called POD (Plain Old - Documentation). This is an easy-to-type, very low level format with - strong integration with the Perl parser. Many tools exist to turn - POD documentation into other formats: info, HTML and man pages, - among others. However, the POD syntax takes after Perl itself in - terms of readability. - -- JavaDoc_ - - Special comments before Java classes and functions serve to document - the code. A program to extract these, and turn them into HTML - documentation is called javadoc, and is part of the standard Java - distribution. However, JavaDoc has a very intimate relationship - with HTML, using HTML tags for most markup. Thus it shares the - readability problems of HTML. - -- Setext_, StructuredText_ - - Early on, variants of Setext (Structure Enhanced Text), including - Zope Corp's StructuredText, were proposed for Python docstring - formatting. Hereafter these variants will collectively be called - "STexts". STexts have the advantage of being easy to read without - special knowledge, and relatively easy to write. - - Although used by some (including in most existing Python - auto-documentation tools), until now STexts have failed to become - standard because: - - - STexts have been incomplete. Lacking "essential" constructs that - people want to use in their docstrings, STexts are rendered less - than ideal. Note that these "essential" constructs are not - universal; everyone has their own requirements. - - - STexts have been sometimes surprising. Bits of text are - unexpectedly interpreted as being marked up, leading to user - frustration. - - - SText implementations have been buggy. - - - Most STexts have have had no formal specification except for the - implementation itself. A buggy implementation meant a buggy spec, - and vice-versa. - - - There has been no mechanism to get around the SText markup rules - when a markup character is used in a non-markup context. In other - words, no way to escape markup. - -Proponents of implicit STexts have vigorously opposed proposals for -explicit markup (XML, HTML, TeX, POD, etc.), and the debates have -continued off and on since 1996 or earlier. - -reStructuredText is a complete revision and reinterpretation of the -SText idea, addressing all of the problems listed above. - - -Specification -============= - -The specification and user documentaton for reStructuredText is -quite extensive. Rather than repeating or summarizing it all -here, links to the originals are provided. - -Please first take a look at `A ReStructuredText Primer`_, a short and -gentle introduction. The `Quick reStructuredText`_ user reference -quickly summarizes all of the markup constructs. For complete and -extensive details, please refer to the following documents: - -- `An Introduction to reStructuredText`_ - -- `reStructuredText Markup Specification`_ - -- `reStructuredText Directives`_ - -In addition, `Problems With StructuredText`_ explains many markup -decisions made with regards to StructuredText, and `A Record of -reStructuredText Syntax Alternatives`_ records markup decisions made -independently. - - -Docstring-Significant Features -============================== - -- A markup escaping mechanism. - - Backslashes (``\``) are used to escape markup characters when needed - for non-markup purposes. However, the inline markup recognition - rules have been constructed in order to minimize the need for - backslash-escapes. For example, although asterisks are used for - *emphasis*, in non-markup contexts such as "*" or "(*)" or "x * y", - the asterisks are not interpreted as markup and are left unchanged. - For many non-markup uses of backslashes (e.g., describing regular - expressions), inline literals or literal blocks are applicable; see - the next item. - -- Markup to include Python source code and Python interactive - sessions: inline literals, literal blocks, and doctest blocks. - - Inline literals use ``double-backquotes`` to indicate program I/O or - code snippets. No markup interpretation (including backslash-escape - [``\``] interpretation) is done within inline literals. - - Literal blocks (block-level literal text, such as code excerpts or - ASCII graphics) are indented, and indicated with a double-colon - ("::") at the end of the preceding paragraph (right here -->):: - - if literal_block: - text = 'is left as-is' - spaces_and_linebreaks = 'are preserved' - markup_processing = None - - Doctest blocks begin with ">>> " and end with a blank line. Neither - indentation nor literal block double-colons are required. For - example:: - - Here's a doctest block: - - >>> print 'Python-specific usage examples; begun with ">>>"' - Python-specific usage examples; begun with ">>>" - >>> print '(cut and pasted from interactive sessions)' - (cut and pasted from interactive sessions) - -- Markup that isolates a Python identifier: interpreted text. - - Text enclosed in single backquotes is recognized as "interpreted - text", whose interpretation is application-dependent. In the - context of a Python docstring, the default interpretation of - interpreted text is as Python identifiers. The text will be marked - up with a hyperlink connected to the documentation for the - identifier given. Lookup rules are the same as in Python itself: - LGB namespace lookups (local, global, builtin). The "role" of the - interpreted text (identifying a class, module, function, etc.) is - determined implicitly from the namespace lookup. For example:: - - class Keeper(Storer): - - """ - Keep data fresher longer. - - Extend `Storer`. Class attribute `instances` keeps track - of the number of `Keeper` objects instantiated. - """ - - instances = 0 - """How many `Keeper` objects are there?""" - - def __init__(self): - """ - Extend `Storer.__init__()` to keep track of - instances. Keep count in `self.instances` and data - in `self.data`. - """ - Storer.__init__(self) - self.instances += 1 - - self.data = [] - """Store data in a list, most recent last.""" - - def storedata(self, data): - """ - Extend `Storer.storedata()`; append new `data` to a - list (in `self.data`). - """ - self.data = data - - Each piece of interpreted text is looked up according to the local - namespace of the block containing its docstring. - -- Markup that isolates a Python identifier and specifies its type: - interpreted text with roles. - - Although the Python source context reader is designed not to require - explicit roles, they may be used. To classify identifiers - explicitly, the role is given along with the identifier in either - prefix or suffix form:: - - Use :method:`Keeper.storedata` to store the object's data in - `Keeper.data`:instance_attribute:. - - The syntax chosen for roles is verbose, but necessarily so (if - anyone has a better alternative, please post it to the Doc-SIG_). - The intention of the markup is that there should be little need to - use explicit roles; their use is to be kept to an absolute minimum. - -- Markup for "tagged lists" or "label lists": field lists. - - Field lists represent a mapping from field name to field body. - These are mostly used for extension syntax, such as "bibliographic - field lists" (representing document metadata such as author, date, - and version) and extension attributes for directives (see below). - They may be used to implement methodologies (docstring semantics), - such as identifying parameters, exceptions raised, etc.; such usage - is beyond the scope of this PEP. - - A modified RFC 2822 syntax is used, with a colon *before* as well as - *after* the field name. Field bodies are more versatile as well; - they may contain multiple field bodies (even nested field lists). - For example:: - - :Date: 2002-03-22 - :Version: 1 - :Authors: - - Me - - Myself - - I - - Standard RFC 2822 header syntax cannot be used for this construct - because it is ambiguous. A word followed by a colon at the - beginning of a line is common in written text. - -- Markup extensibility: directives and substitutions. - - Directives are used as an extension mechanism for reStructuredText, - a way of adding support for new block-level constructs without - adding new syntax. Directives for images, admonitions (note, - caution, etc.), and tables of contents generation (among others) - have been implemented. For example, here's how to place an image:: - - .. image:: mylogo.png - - Substitution definitions allow the power and flexibility of - block-level directives to be shared by inline text. For example:: - - The |biohazard| symbol must be used on containers used to - dispose of medical waste. - - .. |biohazard| image:: biohazard.png - -- Section structure markup. - - Section headers in reStructuredText use adornment via underlines - (and possibly overlines) rather than indentation. For example:: - - This is a Section Title - ======================= - - This is a Subsection Title - -------------------------- - - This paragraph is in the subsection. - - This is Another Section Title - ============================= - - This paragraph is in the second section. - - -Questions & Answers -=================== - -1. Is reStructuredText rich enough? - - Yes, it is for most people. If it lacks some construct that is - required for a specific application, it can be added via the - directive mechanism. If a useful and common construct has been - overlooked and a suitably readable syntax can be found, it can be - added to the specification and parser. - -2. Is reStructuredText *too* rich? - - For specific applications or individuals, perhaps. In general, no. - - Since the very beginning, whenever a docstring markup syntax has - been proposed on the Doc-SIG_, someone has complained about the - lack of support for some construct or other. The reply was often - something like, "These are docstrings we're talking about, and - docstrings shouldn't have complex markup." The problem is that a - construct that seems superfluous to one person may be absolutely - essential to another. - - reStructuredText takes the opposite approach: it provides a rich - set of implicit markup constructs (plus a generic extension - mechanism for explicit markup), allowing for all kinds of - documents. If the set of constructs is too rich for a particular - application, the unused constructs can either be removed from the - parser (via application-specific overrides) or simply omitted by - convention. - -3. Why not use indentation for section structure, like StructuredText - does? Isn't it more "Pythonic"? - - Guido van Rossum wrote the following in a 2001-06-13 Doc-SIG post: - - I still think that using indentation to indicate sectioning is - wrong. If you look at how real books and other print - publications are laid out, you'll notice that indentation is - used frequently, but mostly at the intra-section level. - Indentation can be used to offset lists, tables, quotations, - examples, and the like. (The argument that docstrings are - different because they are input for a text formatter is wrong: - the whole point is that they are also readable without - processing.) - - I reject the argument that using indentation is Pythonic: text - is not code, and different traditions and conventions hold. - People have been presenting text for readability for over 30 - centuries. Let's not innovate needlessly. - - See `Section Structure via Indentation`__ in `Problems With - StructuredText`_ for further elaboration. - - __ http://docutils.sourceforge.net/spec/rst/problems.html - #section-structure-via-indentation - -4. Why use reStructuredText for PEPs? What's wrong with the existing - standard? - - The existing standard for PEPs is very limited in terms of general - expressibility, and referencing is especially lacking for such a - reference-rich document type. PEPs are currently converted into - HTML, but the results (mostly monospaced text) are less than - attractive, and most of the value-added potential of HTML - (especially inline hyperlinks) is untapped. - - Making reStructuredText a standard markup for PEPs will enable much - richer expression, including support for section structure, inline - markup, graphics, and tables. In several PEPs there are ASCII - graphics diagrams, which are all that plaintext documents can - support. Since PEPs are made available in HTML form, the ability - to include proper diagrams would be immediately useful. - - Current PEP practices allow for reference markers in the form "[1]" - in the text, and the footnotes/references themselves are listed in - a section toward the end of the document. There is currently no - hyperlinking between the reference marker and the - footnote/reference itself (it would be possible to add this to - pep2html.py, but the "markup" as it stands is ambiguous and - mistakes would be inevitable). A PEP with many references (such as - this one ;-) requires a lot of flipping back and forth. When - revising a PEP, often new references are added or unused references - deleted. It is painful to renumber the references, since it has to - be done in two places and can have a cascading effect (insert a - single new reference 1, and every other reference has to be - renumbered; always adding new references to the end is suboptimal). - It is easy for references to go out of sync. - - PEPs use references for two purposes: simple URL references and - footnotes. reStructuredText differentiates between the two. A PEP - might contain references like this:: - - Abstract - - This PEP proposes adding frungible doodads [1] to the core. - It extends PEP 9876 [2] via the BCA [3] mechanism. - - ... - - References and Footnotes - - [1] http://www.example.org/ - - [2] PEP 9876, Let's Hope We Never Get Here - http://www.python.org/peps/pep-9876.html - - [3] "Bogus Complexity Addition" - - Reference 1 is a simple URL reference. Reference 2 is a footnote - containing text and a URL. Reference 3 is a footnote containing - text only. Rewritten using reStructuredText, this PEP could look - like this:: - - Abstract - ======== - - This PEP proposes adding `frungible doodads`_ to the core. It - extends PEP 9876 [#pep9876]_ via the BCA [#]_ mechanism. - - ... - - References & Footnotes - ====================== - - .. _frungible doodads: http://www.example.org/ - - .. [#pep9876] PEP 9876, Let's Hope We Never Get Here - - .. [#] "Bogus Complexity Addition" - - URLs and footnotes can be defined close to their references if - desired, making them easier to read in the source text, and making - the PEPs easier to revise. The "References and Footnotes" section - can be auto-generated with a document tree transform. Footnotes - from throughout the PEP would be gathered and displayed under a - standard header. If URL references should likewise be written out - explicitly (in citation form), another tree transform could be - used. - - URL references can be named ("frungible doodads"), and can be - referenced from multiple places in the document without additional - definitions. When converted to HTML, references will be replaced - with inline hyperlinks (HTML <a> tags). The two footnotes are - automatically numbered, so they will always stay in sync. The - first footnote also contains an internal reference name, "pep9876", - so it's easier to see the connection between reference and footnote - in the source text. Named footnotes can be referenced multiple - times, maintaining consistent numbering. - - The "#pep9876" footnote could also be written in the form of a - citation:: - - It extends PEP 9876 [PEP9876]_ ... - - .. [PEP9876] PEP 9876, Let's Hope We Never Get Here - - Footnotes are numbered, whereas citations use text for their - references. - -5. Wouldn't it be better to keep the docstring and PEP proposals - separate? - - The PEP markup proposal may be removed if it is deemed that there - is no need for PEP markup, or it could be made into a separate PEP. - If accepted, PEP 1, PEP Purpose and Guidelines [#PEP-1]_, and PEP - 9, Sample PEP Template [#PEP-9]_ will be updated. - - It seems natural to adopt a single consistent markup standard for - all uses of structured plaintext in Python, and to propose it all - in one place. - -6. The existing pep2html.py script converts the existing PEP format to - HTML. How will the new-format PEPs be converted to HTML? - - A new version of pep2html.py with integrated reStructuredText - parsing has been completed. The Docutils project supports PEPs - with a "PEP Reader" component, including all functionality - currently in pep2html.py (auto-recognition of PEP & RFC references, - email masking, etc.). - -7. Who's going to convert the existing PEPs to reStructuredText? - - PEP authors or volunteers may convert existing PEPs if they like, - but there is no requirement to do so. The reStructuredText-based - PEPs will coexist with the old PEP standard. The pep2html.py - mentioned in answer 6 processes both old and new standards. - -8. Why use reStructuredText for README and other ancillary files? - - The reasoning given for PEPs in answer 4 above also applies to - README and other ancillary files. By adopting a standard markup, - these files can be converted to attractive cross-referenced HTML - and put up on python.org. Developers of other projects can also - take advantage of this facility for their own documentation. - -9. Won't the superficial similarity to existing markup conventions - cause problems, and result in people writing invalid markup (and - not noticing, because the plaintext looks natural)? How forgiving - is reStructuredText of "not quite right" markup? - - There will be some mis-steps, as there would be when moving from - one programming language to another. As with any language, - proficiency grows with experience. Luckily, reStructuredText is a - very little language indeed. - - As with any syntax, there is the possibility of syntax errors. It - is expected that a user will run the processing system over their - input and check the output for correctness. - - In a strict sense, the reStructuredText parser is very unforgiving - (as it should be; "In the face of ambiguity, refuse the temptation - to guess" [#Zen]_ applies to parsing markup as well as computer - languages). Here's design goal 3 from `An Introduction to - reStructuredText`_: - - Unambiguous. The rules for markup must not be open for - interpretation. For any given input, there should be one and - only one possible output (including error output). - - While unforgiving, at the same time the parser does try to be - helpful by producing useful diagnostic output ("system messages"). - The parser reports problems, indicating their level of severity - (from least to most: debug, info, warning, error, severe). The - user or the client software can decide on reporting thresholds; - they can ignore low-level problems or cause high-level problems to - bring processing to an immediate halt. Problems are reported - during the parse as well as included in the output, often with - two-way links between the source of the problem and the system - message explaining it. - -10. Will the docstrings in the Python standard library modules be - converted to reStructuredText? - - No. Python's library reference documentation is maintained - separately from the source. Docstrings in the Python standard - library should not try to duplicate the library reference - documentation. The current policy for docstrings in the Python - standard library is that they should be no more than concise - hints, simple and markup-free (although many *do* contain ad-hoc - implicit markup). - -11. I want to write all my strings in Unicode. Will anything - break? - - The parser fully supports Unicode. Docutils supports arbitrary - input and output encodings. - -12. Why does the community need a new structured text design? - - The existing structured text designs are deficient, for the - reasons given in "Rationale" above. reStructuredText aims to be a - complete markup syntax, within the limitations of the "readable - plaintext" medium. - -13. What is wrong with existing documentation methodologies? - - What existing methodologies? For Python docstrings, there is - **no** official standard markup format, let alone a documentation - methodology akin to JavaDoc. The question of methodology is at a - much higher level than syntax (which this PEP addresses). It is - potentially much more controversial and difficult to resolve, and - is intentionally left out of this discussion. - - -References & Footnotes -====================== - -.. [#PEP-1] PEP 1, PEP Guidelines, Warsaw, Hylton - (http://www.python.org/peps/pep-0001.html) - -.. [#PEP-9] PEP 9, Sample PEP Template, Warsaw - (http://www.python.org/peps/pep-0009.html) - -.. [#Zen] From `The Zen of Python (by Tim Peters)`__ (or just - "``import this``" in Python) - -__ http://www.python.org/doc/Humor.html#zen - -.. [#PEP-216] PEP 216, Docstring Format, Zadka - (http://www.python.org/peps/pep-0216.html) - -.. _reStructuredText markup: http://docutils.sourceforge.net/spec/rst.html - -.. _Doc-SIG: http://www.python.org/sigs/doc-sig/ - -.. _XML: http://www.w3.org/XML/ - -.. _SGML: http://www.oasis-open.org/cover/general.html - -.. _DocBook: http://docbook.org/tdg/en/html/docbook.html - -.. _HTML: http://www.w3.org/MarkUp/ - -.. _XHTML: http://www.w3.org/MarkUp/#xhtml1 - -.. _TeX: http://www.tug.org/interest.html - -.. _Perl POD: http://www.perldoc.com/perl5.6/pod/perlpod.html - -.. _JavaDoc: http://java.sun.com/j2se/javadoc/ - -.. _Setext: http://docutils.sourceforge.net/mirror/setext.html - -.. _StructuredText: - http://dev.zope.org/Members/jim/StructuredTextWiki/FrontPage - -.. _A ReStructuredText Primer: - http://docutils.sourceforge.net/docs/rst/quickstart.html - -.. _Quick reStructuredText: - http://docutils.sourceforge.net/docs/rst/quickref.html - -.. _An Introduction to reStructuredText: - http://docutils.sourceforge.net/spec/rst/introduction.html - -.. _reStructuredText Markup Specification: - http://docutils.sourceforge.net/spec/rst/reStructuredText.html - -.. _reStructuredText Directives: - http://docutils.sourceforge.net/spec/rst/directives.html - -.. _Problems with StructuredText: - http://docutils.sourceforge.net/spec/rst/problems.html - -.. _A Record of reStructuredText Syntax Alternatives: - http://docutils.sourceforge.net/spec/rst/alternatives.html - -.. _Docutils: http://docutils.sourceforge.net/ - - -Copyright -========= - -This document has been placed in the public domain. - - -Acknowledgements -================ - -Some text is borrowed from PEP 216, Docstring Format [#PEP-216]_, by -Moshe Zadka. - -Special thanks to all members past & present of the Python Doc-SIG_. - - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: diff --git a/docutils/docs/ref/doctree.txt b/docutils/docs/ref/doctree.txt deleted file mode 100644 index 7f0c6cd6d..000000000 --- a/docutils/docs/ref/doctree.txt +++ /dev/null @@ -1,4840 +0,0 @@ -============================ - The Docutils Document Tree -============================ - -A Guide to the Docutils DTD -*************************** - -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This document has been placed in the public domain. - - -.. contents:: :depth: 1 - - -This document describes the XML data structure of Docutils_ documents: -the relationships and semantics of elements and attributes. The -Docutils document structure is formally defined by the `Docutils -Generic DTD`_ XML document type definition, docutils.dtd_, which is -the definitive source for details of element structural relationships. - -This document does not discuss implementation details. Those can be -found in internal documentation (docstrings) for the -``docutils.nodes`` module, where the document tree data structure is -implemented in a class library. - -The reader is assumed to have some familiarity with XML or SGML, and -an understanding of the data structure meaning of "tree". For a list -of introductory articles, see `Introducing the Extensible Markup -Language (XML)`_. - -The reStructuredText_ markup is used for illustrative examples -throughout this document. For a gentle introduction, see `A -ReStructuredText Primer`_. For complete technical details, see the -`reStructuredText Markup Specification`_. - - -.. _Docutils: http://docutils.sourceforge.net/ -.. _Docutils Generic DTD: -.. _Docutils DTD: -.. _docutils.dtd: docutils.dtd -.. _Introducing the Extensible Markup Language (XML): - http://xml.coverpages.org/xmlIntro.html -.. _reStructuredText: http://docutils.sourceforge.net/rst.html -.. _A ReStructuredText Primer: ../docs/rst/quickstart.html -.. _reStructuredText Markup Specification: rst/reStructuredText.html - - -------------------- - Element Hierarchy -------------------- - -.. contents:: :local: - -Below is a simplified diagram of the hierarchy of elements in the -Docutils document tree structure. An element may contain any other -elements immediately below it in the diagram. Notes are written in -square brackets. Element types in parentheses indicate recursive or -one-to-many relationships; sections may contain (sub)sections, tables -contain further body elements, etc. :: - - +--------------------------------------------------------------------+ - | document [may begin with a title, subtitle, docinfo, decoration] | - | +--------------------------------------+ - | | sections [each begins with a title] | - +-----------------------------+-------------------------+------------+ - | [body elements:] | (sections) | - | | - literal | - lists | | - hyperlink +------------+ - | | blocks | - tables | | targets | - | para- | - doctest | - block | foot- | - sub. defs | - | graphs | blocks | quotes | notes | - comments | - +---------+-----------+----------+-------+--------------+ - | [text]+ | [text] | (body elements) | [text] | - | (inline +-----------+------------------+--------------+ - | markup) | - +---------+ - -The Docutils document model uses a simple, recursive model for section -structure. A document_ node may contain body elements and section_ -elements. Sections in turn may contain body elements and sections. -The level (depth) of a section element is determined from its physical -nesting level; unlike other document models (``<h1>`` in HTML_, -``<sect1>`` in DocBook_, ``<div1>`` in XMLSpec_) the level is not -incorporated into the element name. - -The Docutils document model uses strict element content models. Every -element has a unique structure and semantics, but elements may be -classified into general categories (below). Only elements which are -meant to directly contain text data have a mixed content model, where -text data and inline elements may be intermixed. This is unlike the -much looser HTML_ document model, where paragraphs and text data may -occur at the same level. - - -Structural Elements -=================== - -Structural elements may only contain child elements; they do not -directly contain text data. Structural elements may contain body -elements or further structural elements. Structural elements can only -be child elements of other structural elements. - -Category members: document_, section_, topic_, sidebar_ - - -Structural Subelements ----------------------- - -Structural subelements are child elements of structural elements. - -Category members: title_, subtitle_, docinfo_, decoration_, -transition_ - - -Bibliographic Elements -`````````````````````` - -The docinfo_ element is an optional child of document_. It groups -bibliographic elements together. - -Category members: address_, author_, authors_, contact_, copyright_, -date_, field_, organization_, revision_, status_, version_ - - -Decorative Elements -``````````````````` - -The decoration_ element is also an optional child of document_. It -groups together elements used to generate page headers and footers. - -Category members: footer_, header_ - - -Body Elements -============= - -Body elements are contained within structural elements and compound -body elements. There are two subcategories of body elements: simple -and compound. - -Category members: admonition_, attention_, block_quote_, bullet_list_, -caution_, citation_, comment_, danger_, definition_list_, -doctest_block_, enumerated_list_, error_, field_list_, figure_, -footnote_, hint_, image_, important_, line_block_, literal_block_, -note_, option_list_, paragraph_, pending_, raw_, rubric_, -substitution_definition_, system_message_, table_, target_, tip_, -warning_ - - -Simple Body Elements --------------------- - -Simple body elements directly are empty or contain text data. Those -that contain text data may also contain inline elements. Such -elements therefore have a "mixed content model". - -Category members: comment_, doctest_block_, image_, line_block_, -literal_block_, paragraph_, pending_, raw_, rubric_, -substitution_definition_, target_ - - -Compound Body Elements ----------------------- - -Compound body elements contain local substructure (body subelements) -and further body elements. They do not directly contain text data. - -Category members: admonition_, attention_, block_quote_, bullet_list_, -caution_, citation_, danger_, definition_list_, enumerated_list_, -error_, field_list_, figure_, footnote_, hint_, important_, note_, -option_list_, system_message_, table_, tip_, warning_ - - -Body Subelements -```````````````` - -Compound body elements contain specific subelements (e.g. bullet_list_ -contains list_item_). Subelements may themselves be compound elements -(containing further child elements, like field_) or simple data -elements (containing text data, like field_name_). These subelements -always occur within specific parent elements, never at the body -element level (beside paragraphs, etc.). - -Category members (simple): attribution_, caption_, classifier_, -colspec_, field_name_, label_, option_argument_, option_string_, term_ - -Category members (compound): definition_, definition_list_item_, -description_, entry_, field_, field_body_, legend_, list_item_, -option_, option_group_, option_list_item_, row_, tbody_, tgroup_, -thead_ - - -Inline Elements -=============== - -Inline elements directly contain text data, and may also contain -further inline elements. Inline elements are contained within simple -body elements. Most inline elements have a "mixed content model". - -Category members: abbreviation_, acronym_, citation_reference_, -emphasis_, footnote_reference_, generated_, image_, inline_, literal_, -problematic_, reference_, strong_, subscript_, -substitution_reference_, superscript_, target_, title_reference_, raw_ - - -.. _HTML: http://www.w3.org/MarkUp/ -.. _DocBook: http://docbook.org/tdg/en/html/docbook.html -.. _XMLSpec: http://www.w3.org/XML/1998/06/xmlspec-report.htm - - -------------------- - Element Reference -------------------- - -.. contents:: :local: - :depth: 1 - -Each element in the DTD (document type definition) is described in its -own section below. Each section contains an introduction plus the -following subsections: - -* Details (of element relationships and semantics): - - - Category: One or more references to the element categories in - `Element Hierarchy`_ above. Some elements belong to more than one - category. - - - Parents: A list of elements which may contain the element. - - - Children: A list of elements which may occur within the element. - - - Analogues: Describes analogous elements in well-known document - models such as HTML_ or DocBook_. Lists similarities and - differences. - - - Processing: Lists formatting or rendering recommendations for the - element. - -* Content Model: - - The formal XML content model from the `Docutils DTD`_, followed by: - - - Attributes: Describes (or refers to descriptions of) the possible - values and semantics of each attribute. - - - Parameter Entities: Lists the parameter entities which directly or - indirectly include the element. - -* Examples: reStructuredText_ examples are shown along with - fragments of the document trees resulting from parsing. - _`Pseudo-XML` is used for the results of parsing and processing. - Pseudo-XML is a representation of XML where nesting is indicated by - indentation and end-tags are not shown. Some of the precision of - real XML is given up in exchange for easier readability. For - example, the following are equivalent: - - - Real XML:: - - <document> - <section id="a-title" name="a title"> - <title>A Title - A paragraph. -

-
- - - Pseudo-XML:: - - -
- - A Title - <paragraph> - A paragraph. - --------------------- - -Many of the element reference sections below are marked "_`to be -completed`". Please help complete this document by contributing to -its writing. - - -``abbreviation`` -================ - -`To be completed`_. - - -``acronym`` -=========== - -`To be completed`_. - - -``address`` -=========== - -The ``address`` element holds the surface mailing address information -for the author (individual or group) of the document, or a third-party -contact address. Its structure is identical to that of the -line_block_ element: whitespace is significant, especially newlines. - - -Details -------- - -:Category: - `Bibliographic Elements`_ - -:Parents: - The following elements may contain ``address``: docinfo_, authors_ - -:Children: - ``address`` elements contain text data plus `inline elements`_. - -:Analogues: - ``address`` is analogous to the DocBook "address" element. - -:Processing: - As with the line_block_ element, newlines and other whitespace is - significant and must be preserved. However, a monospaced typeface - need not be used. - - See also docinfo_. - - -Content Model -------------- - -.. parsed-literal:: - - `%text.model;`_ - -:Attributes: - The ``address`` element contains the `common attributes`_ (id_, - name_, dupname_, source_, and class_), plus `xml:space`_. - -:Parameter Entities: - The `%bibliographic.elements;`_ parameter entity directly includes - ``address``. - - -Examples --------- - -reStructuredText_ source:: - - Document Title - ============== - - :Address: 123 Example Ave. - Example, EX - -Complete pseudo-XML_ result after parsing and applying transforms:: - - <document id="document-title" name="document title"> - <title> - Document Title - <docinfo> - <address> - 123 Example Ave. - Example, EX - -See docinfo_ for a more complete example, including processing -context. - - -``admonition`` -============== - -This element is a generic, titled admonition. Also see the specific -admonition elements Docutils offers (in alphabetical order): caution_, -danger_, error_, hint_, important_, note_, tip_, warning_. - - -Details -------- - -:Category: - `Compound Body Elements`_ - -:Parents: - All elements employing the `%body.elements;`_ or - `%structure.model;`_ parameter entities in their content models - may contain ``admonition``. - -:Children: - ``admonition`` elements begin with a title_ and may contain one or - more `body elements`_. - -:Analogues: - ``admonition`` has no direct analogues in common DTDs. It can be - emulated with primitives and type effects. - -:Processing: - Rendered distinctly (inset and/or in a box, etc.). - - -Content Model -------------- - -.. parsed-literal:: - - (title_, (`%body.elements;`_)+) - -:Attributes: - The ``admonition`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%body.elements;`_ parameter entity directly includes - ``admonition``. The `%structure.model;`_ parameter entity - indirectly includes ``admonition``. - - -Examples --------- - -reStructuredText source:: - - .. admonition:: And, by the way... - - You can make up your own admonition too. - -Pseudo-XML_ fragment from simple parsing:: - - <admonition class="admonition-and-by-the-way"> - <title> - And, by the way... - <paragraph> - You can make up your own admonition too. - - -``attention`` -============= - -The ``attention`` element is an admonition, a distinctive and -self-contained notice. Also see the other admonition elements -Docutils offers (in alphabetical order): caution_, danger_, error_, -hint_, important_, note_, tip_, warning_, and the generic admonition_. - - -Details -------- - -:Category: - `Compound Body Elements`_ - -:Parents: - All elements employing the `%body.elements;`_ or - `%structure.model;`_ parameter entities in their content models - may contain ``attention``. - -:Children: - ``attention`` elements contain one or more `body elements`_. - -:Analogues: - ``attention`` has no direct analogues in common DTDs. It can be - emulated with primitives and type effects. - -:Processing: - Rendered distinctly (inset and/or in a box, etc.), with the - generated title "Attention!" (or similar). - - -Content Model -------------- - -.. parsed-literal:: - - (`%body.elements;`_)+ - -:Attributes: - The ``attention`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%body.elements;`_ parameter entity directly includes - ``attention``. The `%structure.model;`_ parameter entity - indirectly includes ``attention``. - - -Examples --------- - -reStructuredText source:: - - .. Attention:: All your base are belong to us. - -Pseudo-XML_ fragment from simple parsing:: - - <attention> - <paragraph> - All your base are belong to us. - - -``attribution`` -=============== - -`To be completed`_. - - -``author`` -========== - -The ``author`` element holds the name of the author of the document. - - -Details -------- - -:Category: - `Bibliographic Elements`_ - -:Parents: - The following elements may contain ``author``: docinfo_, authors_ - -:Children: - ``author`` elements may contain text data plus `inline elements`_. - -:Analogues: - ``author`` is analogous to the DocBook "author" element. - -:Processing: - See docinfo_. - - -Content Model -------------- - -.. parsed-literal:: - - `%text.model;`_ - -:Attributes: - The ``author`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%bibliographic.elements;`_ parameter entity directly includes - ``author``. - - -Examples --------- - -reStructuredText_ source:: - - Document Title - ============== - - :Author: J. Random Hacker - -Complete pseudo-XML_ result after parsing and applying transforms:: - - <document id="document-title" name="document title"> - <title> - Document Title - <docinfo> - <author> - J. Random Hacker - -See docinfo_ for a more complete example, including processing -context. - - -``authors`` -=========== - -The ``authors`` element is a container for author information for -documents with multiple authors. - - -Details -------- - -:Category: - `Bibliographic Elements`_ - -:Parents: - Only the docinfo_ element contains ``authors``. - -:Children: - ``authors`` elements may contain the following elements: author_, - organization_, address_, contact_ - -:Analogues: - ``authors`` is analogous to the DocBook "authors" element. - -:Processing: - See docinfo_. - - -Content Model -------------- - -.. parsed-literal:: - - ((author_, organization_?, address_?, contact_?)+) - -:Attributes: - The ``authors`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%bibliographic.elements;`_ parameter entity directly includes - ``authors``. - - -Examples --------- - -reStructuredText_ source:: - - Document Title - ============== - - :Authors: J. Random Hacker; Jane Doe - -Complete pseudo-XML_ result after parsing and applying transforms:: - - <document id="document-title" name="document title"> - <title> - Document Title - <docinfo> - <authors> - <author> - J. Random Hacker - <author> - Jane Doe - -In reStructuredText, multiple author's names are separated with -semicolons (";") or commas (","); semicolons take precedence. There -is currently no way to represent the author's organization, address, -or contact in a reStructuredText "Authors" field. - -See docinfo_ for a more complete example, including processing -context. - - -``block_quote`` -=============== - -The ``block_quote`` element is used for quotations set off from the -main text (standalone). - - -Details -------- - -:Category: - `Compound Body Elements`_ - -:Parents: - All elements employing the `%body.elements;`_ or - `%structure.model;`_ parameter entities in their content models - may contain ``block_quote``. - -:Children: - ``block_quote`` elements contain `body elements`_ followed by an - optional attribution_ element. - -:Analogues: - ``block_quote`` is analogous to the "blockquote" element in both - HTML and DocBook. - -:Processing: - ``block_quote`` elements serve to set their contents off from the - main text, typically with indentation and/or other decoration. - - -Content Model -------------- - -.. parsed-literal:: - - ((`%body.elements;`_)+, attribution_?) - -:Attributes: - The ``block_quote`` element contains only the `common - attributes`_: id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%body.elements;`_ parameter entity directly includes - ``block_quote``. The `%structure.model;`_ parameter entity - indirectly includes ``block_quote``. - - -Examples --------- - -reStructuredText source:: - - As a great paleontologist once said, - - This theory, that is mine, is mine. - - -- Anne Elk (Miss) - -Pseudo-XML_ fragment from simple parsing:: - - <paragraph> - As a great paleontologist once said, - <block_quote> - <paragraph> - This theory, that is mine, is mine. - <attribution> - Anne Elk (Miss) - - -``bullet_list`` -=============== - -The ``bullet_list`` element contains list_item_ elements which are -uniformly marked with bullets. Bullets are typically simple dingbats -(symbols) such as circles and squares. - - -Details -------- - -:Category: - `Compound Body Elements`_ - -:Parents: - All elements employing the `%body.elements;`_ or - `%structure.model;`_ parameter entities in their content models - may contain ``bullet_list``. - -:Children: - ``bullet_list`` elements contain one or more list_item_ elements. - -:Analogues: - ``bullet_list`` is analogous to the HTML "ul" element and to the - DocBook "itemizedlist" element. HTML's "ul" is short for - "unordered list", which we consider to be a misnomer. "Unordered" - implies that the list items may be randomly rearranged without - affecting the meaning of the list. Bullet lists *are* often - ordered; the ordering is simply left implicit. - -:Processing: - Each list item should begin a new vertical block, prefaced by a - bullet/dingbat. - - -Content Model -------------- - -.. parsed-literal:: - - (list_item_ +) - -:Attributes: - The ``bullet_list`` element contains the `common attributes`_ - (id_, name_, dupname_, source_, and class_), plus bullet_. - - ``bullet`` is used to record the style of bullet from the input - data. In documents processed from reStructuredText_, it contains - one of "-", "+", or "*". It may be ignored in processing. - -:Parameter Entities: - The `%body.elements;`_ parameter entity directly includes - ``bullet_list``. The `%structure.model;`_ parameter entity - indirectly includes ``bullet_list``. - - -Examples --------- - -reStructuredText_ source:: - - - Item 1, paragraph 1. - - Item 1, paragraph 2. - - - Item 2. - -Pseudo-XML_ fragment from simple parsing:: - - <bullet_list bullet="-"> - <list_item> - <paragraph> - Item 1, paragraph 1. - <paragraph> - Item 1, paragraph 2. - <list_item> - <paragraph> - Item 2. - -See list_item_ for another example. - - -``caption`` -=========== - -`To be completed`_. - - -``caution`` -=========== - -The ``caution`` element is an admonition, a distinctive and -self-contained notice. Also see the other admonition elements -Docutils offers (in alphabetical order): attention_, danger_, error_, -hint_, important_, note_, tip_, warning_, and the generic admonition_. - - -Details -------- - -:Category: - `Compound Body Elements`_ - -:Parents: - All elements employing the `%body.elements;`_ or - `%structure.model;`_ parameter entities in their content models - may contain ``caution``. - -:Children: - ``caution`` elements contain one or more `body elements`_. - -:Analogues: - ``caution`` is analogous to the DocBook "caution" element. - -:Processing: - Rendered distinctly (inset and/or in a box, etc.), with the - generated title "Caution" (or similar). - - -Content Model -------------- - -.. parsed-literal:: - - (`%body.elements;`_)+ - -:Attributes: - The ``caution`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%body.elements;`_ parameter entity directly includes - ``caution``. The `%structure.model;`_ parameter entity - indirectly includes ``caution``. - - -Examples --------- - -reStructuredText source:: - - .. Caution:: Don't take any wooden nickels. - -Pseudo-XML_ fragment from simple parsing:: - - <caution> - <paragraph> - Don't take any wooden nickels. - - -``citation`` -============ - -`To be completed`_. - - -``citation_reference`` -====================== - -`To be completed`_. - - -``classifier`` -============== - -The ``classifier`` element contains the classification or type of the -term_ being defined in a definition_list_. For example, it can be -used to indicate the type of a variable. - - -Details -------- - -:Category: - `Body Subelements`_ (simple) - -:Parents: - Only the definition_list_item_ element contains ``classifier``. - -:Children: - ``classifier`` elements may contain text data plus `inline elements`_. - -:Analogues: - ``classifier`` has no direct analogues in common DTDs. It can be - emulated with primitives or type effects. - -:Processing: - See definition_list_item_. - - -Content Model -------------- - -.. parsed-literal:: - - `%text.model;`_ - -:Attributes: - The ``classifier`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - - -Examples --------- - -Here is a hypothetical data dictionary. reStructuredText_ source:: - - name : string - Customer name. - i : int - Temporary index variable. - -Pseudo-XML_ fragment from simple parsing:: - - <definition_list> - <definition_list_item> - <term> - name - <classifier> - string - <definition> - <paragraph> - Customer name. - <definition_list_item> - <term> - i - <classifier> - int - <definition> - <paragraph> - Temporary index variable. - - -``colspec`` -=========== - -`To be completed`_. - - -``comment`` -=========== - -`To be completed`_. - - -``contact`` -=========== - -The ``contact`` element holds contact information for the author -(individual or group) of the document, or a third-party contact. It -is typically used for an email or web address. - - -Details -------- - -:Category: - `Bibliographic Elements`_ - -:Parents: - The following elements may contain ``contact``: docinfo_, authors_ - -:Children: - ``contact`` elements may contain text data plus `inline - elements`_. - -:Analogues: - ``contact`` is analogous to the DocBook "email" element. The HTML - "address" element serves a similar purpose. - -:Processing: - See docinfo_. - - -Content Model -------------- - -.. parsed-literal:: - - `%text.model;`_ - -:Attributes: - The ``contact`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%bibliographic.elements;`_ parameter entity directly includes - ``contact``. - - -Examples --------- - -reStructuredText_ source:: - - Document Title - ============== - - :Contact: jrh@example.com - -Complete pseudo-XML_ result after parsing and applying transforms:: - - <document id="document-title" name="document title"> - <title> - Document Title - <docinfo> - <contact> - <reference refuri="mailto:jrh@example.com"> - jrh@example.com - -See docinfo_ for a more complete example, including processing -context. - - -``copyright`` -============= - -The ``copyright`` element contains the document's copyright statement. - - -Details -------- - -:Category: - `Bibliographic Elements`_ - -:Parents: - Only the docinfo_ element contains ``copyright``. - -:Children: - ``copyright`` elements may contain text data plus `inline - elements`_. - -:Analogues: - ``copyright`` is analogous to the DocBook "copyright" element. - -:Processing: - See docinfo_. - - -Content Model -------------- - -.. parsed-literal:: - - `%text.model;`_ - -:Attributes: - The ``copyright`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%bibliographic.elements;`_ parameter entity directly includes - ``copyright``. - - -Examples --------- - -reStructuredText_ source:: - - Document Title - ============== - - :Copyright: This document has been placed in the public domain. - -Complete pseudo-XML_ result after parsing and applying transforms:: - - <document id="document-title" name="document title"> - <title> - Document Title - <docinfo> - <copyright> - This document has been placed in the public domain. - -See docinfo_ for a more complete example, including processing -context. - - -``danger`` -========== - -The ``danger`` element is an admonition, a distinctive and -self-contained notice. Also see the other admonition elements -Docutils offers (in alphabetical order): attention_, caution_, error_, -hint_, important_, note_, tip_, warning_, and the generic admonition_. - - -Details -------- - -:Category: - `Compound Body Elements`_ - -:Parents: - All elements employing the `%body.elements;`_ or - `%structure.model;`_ parameter entities in their content models - may contain ``danger``. - -:Children: - ``danger`` elements contain one or more `body elements`_. - -:Analogues: - ``danger`` has no direct analogues in common DTDs. It can be - emulated with primitives and type effects. - -:Processing: - Rendered distinctly (inset and/or in a box, etc.), with the - generated title "!DANGER!" (or similar). - - -Content Model -------------- - -.. parsed-literal:: - - (`%body.elements;`_)+ - -:Attributes: - The ``danger`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%body.elements;`_ parameter entity directly includes - ``danger``. The `%structure.model;`_ parameter entity - indirectly includes ``danger``. - - -Examples --------- - -reStructuredText source:: - - .. DANGER:: Mad scientist at work! - -Pseudo-XML_ fragment from simple parsing:: - - <danger> - <paragraph> - Mad scientist at work! - - -``date`` -======== - -The ``date`` element contains the date of publication, release, or -last modification of the document. - - -Details -------- - -:Category: - `Bibliographic Elements`_ - -:Parents: - Only the docinfo_ element contains ``date``. - -:Children: - ``date`` elements may contain text data plus `inline elements`_. - -:Analogues: - ``date`` is analogous to the DocBook "date" element. - -:Processing: - Often used with the RCS/CVS keyword "Date". See docinfo_. - - -Content Model -------------- - -.. parsed-literal:: - - `%text.model;`_ - -:Attributes: - The ``date`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%bibliographic.elements;`_ parameter entity directly includes - ``date``. - - -Examples --------- - -reStructuredText_ source:: - - Document Title - ============== - - :Date: 2002-08-20 - -Complete pseudo-XML_ result after parsing and applying transforms:: - - <document id="document-title" name="document title"> - <title> - Document Title - <docinfo> - <date> - 2002-08-20 - -See docinfo_ for a more complete example, including processing -context. - - -``decoration`` -============== - -The ``decoration`` element is a container for header_ and footer_ -elements and potential future extensions. These elements are used for -page navigation, notes, time/datestamp, etc. Currently only the -footer_ element is implemented, populated with processing information -(datestamp, a link to Docutils_, etc.). - - -Details -------- - -:Category: - `Structural Subelements`_ - -:Parents: - Only the document_ element contains ``decoration``. - -:Children: - ``decoration`` elements may contain `decorative elements`_. - -:Analogues: - There are no direct analogies to ``decoration`` in HTML or in - DocBook. Equivalents are typically constructed from primitives - and/or generated by the processing system. - -:Processing: - See the individual `decorative elements`_. - -Content Model -------------- - -.. parsed-literal:: - - (header_?, footer_?) - -Although the content model doesn't specifically require contents, no -empty ``decoration`` elements are ever created. - -:Attributes: - The ``decoration`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - - -Examples --------- - -reStructuredText_ source:: - - A paragraph. - -Complete pseudo-XML_ result after parsing and applying transforms, -assuming that the datestamp command-line option or configuration -setting has been supplied:: - - <document> - <decoration> - <footer> - <paragraph> - Generated on: 2002-08-20. - <paragraph> - A paragraph. - - -``definition`` -============== - -The ``definition`` element is a container for the body elements used -to define a term_ in a definition_list_. - - -Details -------- - -:Category: - `Body Subelements`_ (compound) - -:Parents: - Only definition_list_item_ elements contain ``definition``. - -:Children: - ``definition`` elements may contain `body elements`_. - -:Analogues: - ``definition`` is analogous to the HTML "dd" element and to the - DocBook "listitem" element (inside a "variablelistentry" element). - -:Processing: - See definition_list_item_. - - -Content Model -------------- - -.. parsed-literal:: - - (`%body.elements;`_)+ - -:Attributes: - The ``definition`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - - -Examples --------- - -See the examples for the definition_list_, definition_list_item_, and -classifier_ elements. - - -``definition_list`` -=================== - -The ``definition_list`` element contains a list of terms and their -definitions. It can be used for glossaries or dictionaries, to -describe or classify things, for dialogues, or to itemize subtopics -(such as in this reference). - - -Details -------- - -:Category: - `Compound Body Elements`_ - -:Parents: - All elements employing the `%body.elements;`_ or - `%structure.model;`_ parameter entities in their content models - may contain ``definition_list``. - -:Children: - ``definition_list`` elements contain one or more - definition_list_item_ elements. - -:Analogues: - ``definition_list`` is analogous to the HTML "dl" element and to - the DocBook "variablelist" element. - -:Processing: - See definition_list_item_. - - -Content Model -------------- - -.. parsed-literal:: - - (definition_list_item_ +) - -:Attributes: - The ``definition_list`` element contains only the `common - attributes`_: id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%body.elements;`_ parameter entity directly includes - ``definition_list``. The `%structure.model;`_ parameter entity - indirectly includes ``definition_list``. - - -Examples --------- - -reStructuredText_ source:: - - Term - Definition. - - Term : classifier - The ' : ' indicates a classifier in - definition list item terms only. - -Pseudo-XML_ fragment from simple parsing:: - - <definition_list> - <definition_list_item> - <term> - Term - <definition> - <paragraph> - Definition. - <definition_list_item> - <term> - Term - <classifier> - classifier - <definition> - <paragraph> - The ' : ' indicates a classifier in - definition list item terms only. - -See definition_list_item_ and classifier_ for further examples. - - -``definition_list_item`` -======================== - -The ``definition_list_item`` element contains a single -term_/definition_ pair (with optional classifier_). - - -Details -------- - -:Category: - `Body Subelements`_ (compound) - -:Parents: - Only the definition_list_ element contains - ``definition_list_item``. - -:Children: - ``definition_list_item`` elements each contain a single term_, - an optional classifier_, and a definition_. - -:Analogues: - ``definition_list_item`` is analogous to the DocBook - "variablelistentry" element. - -:Processing: - The optional classifier_ can be rendered differently from the - term_. They should be separated visually, typically by spaces - plus a colon or dash. - - -Content Model -------------- - -.. parsed-literal:: - - (term_, classifier_?, definition_) - -:Attributes: - The ``definition_list_item`` element contains only the `common - attributes`_: id_, name_, dupname_, source_, and class_. - - -Examples --------- - -reStructuredText_ source:: - - Tyrannosaurus Rex : carnivore - Big and scary; the "Tyrant King". - - Brontosaurus : herbivore - All brontosauruses are thin at one end, - much much thicker in the middle - and then thin again at the far end. - - -- Anne Elk (Miss) - -Pseudo-XML_ fragment from simple parsing:: - - <definition_list> - <definition_list_item> - <term> - Tyrannosaurus Rex - <classifier> - carnivore - <definition> - <paragraph> - Big and scary; the "Tyrant King". - <definition_list_item> - <term> - Brontosaurus - <classifier> - herbivore - <definition> - <paragraph> - All brontosauruses are thin at one end, - much much thicker in the middle - and then thin again at the far end. - <paragraph> - -- Anne Elk (Miss) - -See definition_list_ and classifier_ for further examples. - - -``description`` -=============== - -The ``description`` element contains body elements, describing the -purpose or effect of a command-line option or group of options. - - -Details -------- - -:Category: - `Body Subelements`_ - -:Parents: - Only the option_list_item_ element contains ``description``. - -:Children: - ``description`` elements may contain `body elements`_. - -:Analogues: - ``description`` has no direct analogues in common DTDs. - -:Processing: - See option_list_. - - -Content Model -------------- - -.. parsed-literal:: - - (`%body.elements;`_)+ - -:Attributes: - The ``description`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - - -Examples --------- - -See the examples for the option_list_ element. - - -``docinfo`` -=========== - -The ``docinfo`` element is a container for document bibliographic -data, or meta-data (data about the document). It corresponds to the -front matter of a book, such as the title page and copyright page. - - -Details -------- - -:Category: - `Structural Subelements`_ - -:Parents: - Only the document_ element contains ``docinfo``. - -:Children: - ``docinfo`` elements contain `bibliographic elements`_. - -:Analogues: - ``docinfo`` is analogous to DocBook "info" elements ("bookinfo" - etc.). There are no directly analogous HTML elements; the "meta" - element carries some of the same information, albeit invisibly. - -:Processing: - The ``docinfo`` element may be rendered as a two-column table or - in other styles. It may even be invisible or omitted from the - processed output. Meta-data may be extracted from ``docinfo`` - children; for example, HTML ``<meta>`` tags may be constructed. - - When Docutils_ transforms a reStructuredText_ field_list_ into a - ``docinfo`` element (see the examples below), RCS/CVS keywords are - normally stripped from simple (one paragraph) field bodies. For - complete details, please see `RCS Keywords`_ in the - `reStructuredText Markup Specification`_. - - .. _RCS Keywords: rst/reStructuredText.html#rcs-keywords - - -Content Model -------------- - -.. parsed-literal:: - - (`%bibliographic.elements;`_)+ - -:Attributes: - The ``docinfo`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - - -Examples --------- - -Docinfo is represented in reStructuredText_ by a field_list_ in a -bibliographic context: the first non-comment element of a document_, -after any document title_/subtitle_. The field list is transformed -into a ``docinfo`` element and its children by a transform. Source:: - - Docinfo Example - =============== - - :Author: J. Random Hacker - :Contact: jrh@example.com - :Date: 2002-08-18 - :Status: Work In Progress - :Version: 1 - :Filename: $RCSfile$ - :Copyright: This document has been placed in the public domain. - -Complete pseudo-XML_ result after parsing and applying transforms:: - - <document id="docinfo-example" name="docinfo example"> - <title> - Docinfo Example - <docinfo> - <author> - J. Random Hacker - <contact> - <reference refuri="mailto:jrh@example.com"> - jrh@example.com - <date> - 2002-08-18 - <status> - Work In Progress - <version> - 1 - <field> - <field_name> - Filename - <field_body> - <paragraph> - doctree.txt - <copyright> - This document has been placed in the public domain. - -Note that "Filename" is a non-standard ``docinfo`` field, so becomes a -generic ``field`` element. Also note that the "RCSfile" keyword -syntax has been stripped from the "Filename" data. - -See field_list_ for an example in a non-bibliographic context. Also -see the individual examples for the various `bibliographic elements`_. - - -``doctest_block`` -================= - -The ``doctest_block`` element is a Python-specific variant of -literal_block_. It is a block of text where line breaks and -whitespace are significant and must be preserved. ``doctest_block`` -elements are used for interactive Python interpreter sessions, which -are distinguished by their input prompt: ``>>>``. They are meant to -illustrate usage by example, and provide an elegant and powerful -testing environment via the `doctest module`_ in the Python standard -library. - -.. _doctest module: - http://www.python.org/doc/current/lib/module-doctest.html - - -Details -------- - -:Category: - `Simple Body Elements`_ - -:Parents: - All elements employing the `%body.elements;`_ or - `%structure.model;`_ parameter entities in their content models - may contain ``doctest_block``. - -:Children: - ``doctest_block`` elements may contain text data plus `inline - elements`_. - -:Analogues: - ``doctest_block`` is analogous to the HTML "pre" element and to - the DocBook "programlisting" and "screen" elements. - -:Processing: - As with literal_block_, ``doctest_block`` elements are typically - rendered in a monospaced typeface. It is crucial that all - whitespace and line breaks are preserved in the rendered form. - - -Content Model -------------- - -.. parsed-literal:: - - `%text.model;`_ - -:Attributes: - The ``doctest_block`` element contains the `common attributes`_ - (id_, name_, dupname_, source_, and class_), plus `xml:space`_. - -:Parameter Entities: - The `%body.elements;`_ parameter entity directly includes - ``doctest_block``. The `%structure.model;`_ parameter entity - indirectly includes ``doctest_block``. - - -Examples --------- - -reStructuredText source:: - - This is an ordinary paragraph. - - >>> print 'this is a Doctest block' - this is a Doctest block - -Pseudo-XML_ fragment from simple parsing:: - - <paragraph> - This is an ordinary paragraph. - <doctest_block xml:space="preserve"> - >>> print 'this is a Doctest block' - this is a Doctest block - - -``document`` -============ - -The ``document`` element is the root (topmost) element of the Docutils -document tree. ``document`` is the direct or indirect ancestor of -every other element in the tree. It encloses the entire document -tree. It is the starting point for a document. - - -Details -------- - -:Category: - `Structural Elements`_ - -:Parents: - The ``document`` element has no parents. - -:Children: - ``document`` elements may contain `structural subelements`_, - `structural elements`_, and `body elements`_. - -:Analogues: - ``document`` is analogous to the HTML "html" element and to - several DocBook elements such as "book". - - -Content Model -------------- - -.. parsed-literal:: - - ((title_, - subtitle_?)?, - docinfo_?, - decoration_?, - `%structure.model;`_) - -Depending on the source of the data and the stage of processing, the -"document" may not initially contain a "title". A document title is -not directly representable in reStructuredText_. Instead, a lone -top-level section may have its title promoted to become the document -title_, and similarly for a lone second-level (sub)section's title to -become the document subtitle_. The "docinfo_" may be transformed from -an initial field_list_, and "decoration_" is usually constructed -programmatically. - -See the `%structure.model;`_ parameter entity for details of the body -of a ``document``. - -:Attributes: - The ``document`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - - -Examples --------- - -reStructuredText_ source:: - - A Title - ======= - - A paragraph. - -Complete pseudo-XML_ result from simple parsing:: - - <document> - <section id="a-title" name="a title"> - <title> - A Title - <paragraph> - A paragraph. - -After applying transforms, the section title is promoted to become the -document title:: - - <document id="a-title" name="a title"> - <title> - A Title - <paragraph> - A paragraph. - - -``emphasis`` -============ - -`To be completed`_. - - -``entry`` -========= - -`To be completed`_. - - -``enumerated_list`` -=================== - -The ``enumerated_list`` element contains list_item_ elements which are -uniformly marked with enumerator labels. - - -Details -------- - -:Category: - `Compound Body Elements`_ - -:Parents: - All elements employing the `%body.elements;`_ or - `%structure.model;`_ parameter entities in their content models - may contain ``enumerated_list``. - -:Children: - ``enumerated_list`` elements contain one or more list_item_ - elements. - -:Analogues: - ``enumerated_list`` is analogous to the HTML "ol" element and to - the DocBook "orderedlist" element. - -:Processing: - Each list item should begin a new vertical block, prefaced by a - enumeration marker (such as "1."). - - -Content Model -------------- - -.. parsed-literal:: - - (list_item_ +) - -:Attributes: - The ``enumerated_list`` element contains the `common attributes`_ - (id_, name_, dupname_, source_, and class_), plus enumtype_, - prefix_, suffix_, and start_. - - ``enumtype`` is used to record the intended enumeration sequence, - one of "arabic" (1, 2, 3, ...), "loweralpha" (a, b, c, ..., z), - "upperalpha" (A, B, C, ..., Z), "lowerroman" (i, ii, iii, iv, ..., - mmmmcmxcix [4999]), or "upperroman" (I, II, III, IV, ..., - MMMMCMXCIX [4999]). - - ``prefix`` stores the formatting characters used before the - enumerator. In documents originating from reStructuredText_ data, - it will contain either "" (empty string) or "(" (left - parenthesis). It may or may not affect processing. - - ``suffix`` stores the formatting characters used after the - enumerator. In documents originating from reStructuredText_ data, - it will contain either "." (period) or ")" (right parenthesis). - Depending on the capabilities of the output format, this attribute - may or may not affect processing. - - ``start`` contains the ordinal value of the first item in the - list, in decimal. For lists beginning at value 1 ("1", "a", "A", - "i", or "I"), this attribute may be omitted. - -:Parameter Entities: - The `%body.elements;`_ parameter entity directly includes - ``enumerated_list``. The `%structure.model;`_ parameter entity - indirectly includes ``enumerated_list``. - - -Examples --------- - -reStructuredText_ source:: - - 1. Item 1. - - (A) Item A. - (B) Item B. - (C) Item C. - - 2. Item 2. - -Pseudo-XML_ fragment from simple parsing:: - - <enumerated_list enumtype="arabic" prefix="" suffix="."> - <list_item> - <paragraph> - Item 1. - <enumerated_list enumtype="upperalpha" prefix="(" suffix=")"> - <list_item> - <paragraph> - Item A. - <list_item> - <paragraph> - Item B. - <list_item> - <paragraph> - Item C. - <list_item> - <paragraph> - Item 2. - -See list_item_ for another example. - - -``error`` -========= - -The ``error`` element is an admonition, a distinctive and -self-contained notice. Also see the other admonition elements -Docutils offers (in alphabetical order): attention_, caution_, -danger_, hint_, important_, note_, tip_, warning_, and the generic -admonition_. - - -Details -------- - -:Category: - `Compound Body Elements`_ - -:Parents: - All elements employing the `%body.elements;`_ or - `%structure.model;`_ parameter entities in their content models - may contain ``error``. - -:Children: - ``error`` elements contain one or more `body elements`_. - -:Analogues: - ``error`` has no direct analogues in common DTDs. It can be - emulated with primitives and type effects. - -:Processing: - Rendered distinctly (inset and/or in a box, etc.), with the - generated title "Error" (or similar). - - -Content Model -------------- - -.. parsed-literal:: - - (`%body.elements;`_)+ - -:Attributes: - The ``error`` element contains only the `common attributes`_: id_, - name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%body.elements;`_ parameter entity directly includes - ``error``. The `%structure.model;`_ parameter entity indirectly - includes ``error``. - - -Examples --------- - -reStructuredText source:: - - .. Error:: Does not compute. - -Pseudo-XML_ fragment from simple parsing:: - - <error> - <paragraph> - Does not compute. - - -``field`` -========= - -The ``field`` element contains a pair of field_name_ and field_body_ -elements. - - -Details -------- - -:Category: - `Body Subelements`_ - -:Parents: - The following elements may contain ``field``: docinfo_, - field_list_ - -:Children: - Each ``field`` element contains one field_name_ and one - field_body_ element. - -:Analogues: - ``field`` has no direct analogues in common DTDs. - -:Processing: - See field_list_. - - -Content Model -------------- - -.. parsed-literal:: - - (field_name_, field_body_) - -:Attributes: - The ``field`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%bibliographic.elements;`_ parameter entity directly includes - ``field``. - - -Examples --------- - -See the examples for the field_list_ and docinfo_ elements. - - -``field_body`` -============== - -The ``field_body`` element contains body elements. It is analogous to -a database field's data. - - -Details -------- - -:Category: - `Body Subelements`_ - -:Parents: - Only the field_ element contains ``field_body``. - -:Children: - ``field_body`` elements may contain `body elements`_. - -:Analogues: - ``field_body`` has no direct analogues in common DTDs. - -:Processing: - See field_list_. - - -Content Model -------------- - -.. parsed-literal:: - - (`%body.elements;`_)* - -:Attributes: - The ``field_body`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - - -Examples --------- - -See the examples for the field_list_ and docinfo_ elements. - - -``field_list`` -============== - -The ``field_list`` element contains two-column table-like structures -resembling database records (label & data pairs). Field lists are -often meant for further processing. In reStructuredText_, field lists -are used to represent bibliographic fields (contents of the docinfo_ -element) and directive options. - - -Details -------- - -:Category: - `Compound Body Elements`_ - -:Parents: - All elements employing the `%body.elements;`_ or - `%structure.model;`_ parameter entities in their content models - may contain ``field_list``. - -:Children: - ``field_list`` elements contain one or more field_ elements. - -:Analogues: - ``field_list`` has no direct analogues in common DTDs. It can be - emulated with primitives such as tables. - -:Processing: - A ``field_list`` is typically rendered as a two-column list, where - the first column contains "labels" (usually with a colon suffix). - However, field lists are often used for extension syntax or - special processing. Such structures do not survive as field lists - to be rendered. - - -Content Model -------------- - -.. parsed-literal:: - - (field_ +) - -:Attributes: - The ``field_list`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%body.elements;`_ parameter entity directly includes - ``field_list``. The `%structure.model;`_ parameter entity - indirectly includes ``field_list``. - - -Examples --------- - -reStructuredText_ source:: - - :Author: Me - :Version: 1 - :Date: 2001-08-11 - :Parameter i: integer - -Pseudo-XML_ fragment from simple parsing:: - - <field_list> - <field> - <field_name> - Author - <field_body> - <paragraph> - Me - <field> - <field_name> - Version - <field_body> - <paragraph> - 1 - <field> - <field_name> - Date - <field_body> - <paragraph> - 2001-08-11 - <field> - <field_name> - Parameter i - <field_body> - <paragraph> - integer - - -``field_name`` -============== - -The ``field_name`` element contains text data only. It is analogous -to a database field's name. - - -Details -------- - -:Category: - `Body Subelements`_ - -:Parents: - Only the field_ element contains ``field_name``. - -:Children: - ``field_name`` elements have no children. They may contain text - data only. - -:Analogues: - ``field_name`` has no direct analogues in common DTDs. - -:Processing: - See field_list_. - - -Content Model -------------- - -.. parsed-literal:: - - (#PCDATA) - -:Attributes: - The ``field_name`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - - -Examples --------- - -See the examples for the field_list_ and docinfo_ elements. - - -``figure`` -========== - -`To be completed`_. - - -``footer`` -========== - -The ``footer`` element is a container element whose contents are meant -to appear at the bottom of a web page, or repeated at the bottom of -every printed page. Currently the ``footer`` element may contain -processing information (datestamp, a link to Docutils_, etc.). - - -Details -------- - -:Category: - `Decorative Elements`_ - -:Parents: - Only the decoration_ element contains ``footer``. - -:Children: - ``footer`` elements may contain `body elements`_. - -:Analogues: - There are no direct analogies to ``footer`` in HTML or DocBook. - Equivalents are typically constructed from primitives and/or - generated by the processing system. - - -Content Model -------------- - -.. parsed-literal:: - - (`%body.elements;`_)+ - -:Attributes: - The ``footer`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - - -Examples --------- - -reStructuredText_ source:: - - A paragraph. - -Complete pseudo-XML_ result after parsing and applying transforms, -assuming that the datestamp command-line option or configuration -setting has been supplied:: - - <document> - <decoration> - <footer> - <paragraph> - Generated on: 2002-08-20. - <paragraph> - A paragraph. - - -``footnote`` -============ - -`To be completed`_. - - -``footnote_reference`` -====================== - -`To be completed`_. - - -``generated`` -============= - -`To be completed`_. - - -``header`` -========== - -The ``header`` element is a container element whose contents are meant -to appear at the top of a web page, or at the top of every printed -page. Docutils does not yet make use of the ``header`` element. - - -Details -------- - -:Category: - `Decorative Elements`_ - -:Parents: - Only the decoration_ element contains ``header``. - -:Children: - ``header`` elements may contain `body elements`_. - -:Analogues: - There are no direct analogies to ``header`` in HTML or DocBook. - Equivalents are typically constructed from primitives and/or - generated by the processing system. - - -Content Model -------------- - -.. parsed-literal:: - - (`%body.elements;`_)+ - -:Attributes: - The ``header`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - - -Examples --------- - -None. - - -``hint`` -======== - -The ``hint`` element is an admonition, a distinctive and -self-contained notice. Also see the other admonition elements -Docutils offers (in alphabetical order): attention_, caution_, -danger_, error_, important_, note_, tip_, warning_, and the generic -admonition_. - - -Details -------- - -:Category: - `Compound Body Elements`_ - -:Parents: - All elements employing the `%body.elements;`_ or - `%structure.model;`_ parameter entities in their content models - may contain ``hint``. - -:Children: - ``hint`` elements contain one or more `body elements`_. - -:Analogues: - ``hint`` has no direct analogues in common DTDs. It can be - emulated with primitives and type effects. - -:Processing: - Rendered distinctly (inset and/or in a box, etc.), with the - generated title "Hint" (or similar). - - -Content Model -------------- - -.. parsed-literal:: - - (`%body.elements;`_)+ - -:Attributes: - The ``hint`` element contains only the `common attributes`_: id_, - name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%body.elements;`_ parameter entity directly includes - ``hint``. The `%structure.model;`_ parameter entity indirectly - includes ``hint``. - - -Examples --------- - -reStructuredText source:: - - .. Hint:: It's bigger than a bread box. - -Pseudo-XML_ fragment from simple parsing:: - - <hint> - <paragraph> - It's bigger than a bread box. - - -``image`` -========= - -`To be completed`_. - - -``important`` -============= - -The ``important`` element is an admonition, a distinctive and -self-contained notice. Also see the other admonition elements -Docutils offers (in alphabetical order): attention_, caution_, -danger_, error_, hint_, note_, tip_, warning_, and the generic -admonition_. - - -Details -------- - -:Category: - `Compound Body Elements`_ - -:Parents: - All elements employing the `%body.elements;`_ or - `%structure.model;`_ parameter entities in their content models - may contain ``important``. - -:Children: - ``important`` elements contain one or more `body elements`_. - -:Analogues: - ``important`` is analogous to the DocBook "important" element. - -:Processing: - Rendered distinctly (inset and/or in a box, etc.), with the - generated title "Important" (or similar). - - -Content Model -------------- - -.. parsed-literal:: - - (`%body.elements;`_)+ - -:Attributes: - The ``important`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%body.elements;`_ parameter entity directly includes - ``important``. The `%structure.model;`_ parameter entity - indirectly includes ``important``. - - -Examples --------- - -reStructuredText source:: - - .. Important:: - - * Wash behind your ears. - * Clean up your room. - * Back up your data. - * Call your mother. - -Pseudo-XML_ fragment from simple parsing:: - - <important> - <bullet_list> - <list_item> - <paragraph> - Wash behind your ears. - <list_item> - <paragraph> - Clean up your room. - <list_item> - <paragraph> - Back up your data. - <list_item> - <paragraph> - Call your mother. - - -``inline`` -========== - -`To be completed`_. - - -``label`` -========= - -`To be completed`_. - - -``legend`` -========== - -`To be completed`_. - - -``line_block`` -============== - -The ``line_block`` element contains a block of text where line breaks -and whitespace are significant and must be preserved. ``line_block`` -elements are commonly used for verse and addresses. See `line_block`_ -for an alternative useful for program listings and interactive -computer sessions. - - -Details -------- - -:Category: - `Simple Body Elements`_ - -:Parents: - All elements employing the `%body.elements;`_ or - `%structure.model;`_ parameter entities in their content models - may contain ``line_block``. - -:Children: - ``line_block`` elements may contain text data plus `inline - elements`_. - -:Analogues: - ``line_block`` is analogous to the DocBook "literallayout" element - and to the HTML "pre" element (with modifications to typeface - styles). - -:Processing: - Unline ``literal_block``, ``line_block`` elements are typically - rendered in an ordinary text typeface. It is crucial that all - whitespace and line breaks are preserved in the rendered form. - - -Content Model -------------- - -.. parsed-literal:: - - `%text.model;`_ - -:Attributes: - The ``line_block`` element contains the `common attributes`_ (id_, - name_, dupname_, source_, and class_), plus `xml:space`_. - -:Parameter Entities: - The `%body.elements;`_ parameter entity directly includes - ``line_block``. The `%structure.model;`_ parameter entity - indirectly includes ``line_block``. - - -Examples --------- - -reStructuredText uses a directive to indicate a ``line_block``. -Example source:: - - Take it away, Eric the Orchestra Leader! - - .. line-block:: - - A one, two, a one two three four - - Half a bee, philosophically, - must, *ipso facto*, half not be. - But half the bee has got to be, - *vis a vis* its entity. D'you see? - - But can a bee be said to be - or not to be an entire bee, - when half the bee is not a bee, - due to some ancient injury? - - Singing... - -Pseudo-XML_ fragment from simple parsing:: - - <paragraph> - Take it away, Eric the Orchestra Leader! - <line_block xml:space="preserve"> - A one, two, a one two three four - - Half a bee, philosophically, - must, <emphasis>ipso facto</emphasis>, half not be. - But half the bee has got to be, - <emphasis>vis a vis</emphasis>its entity. D'you see? - - But can a bee be said to be - or not to be an entire bee, - when half the bee is not a bee, - due to some ancient injury? - - Singing... - - -``list_item`` -============= - -The ``list_item`` element is a container for the elements of a list -item. - - -Details -------- - -:Category: - `Body Subelements`_ (compound) - -:Parents: - The bullet_list_ and enumerated_list_ elements contain - ``list_item``. - -:Children: - ``list_item`` elements may contain `body elements`_. - -:Analogues: - ``list_item`` is analogous to the HTML "li" element and to the - DocBook "listitem" element. - -:Processing: - See bullet_list_ or enumerated_list_. - - -Content Model -------------- - -.. parsed-literal:: - - (`%body.elements;`_)+ - -:Attributes: - The ``list_item`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - - -Examples --------- - -reStructuredText_ source:: - - 1. Outer list, item 1. - - * Inner list, item 1. - * Inner list, item 2. - - 2. Outer list, item 2. - -Pseudo-XML_ fragment from simple parsing:: - - <enumerated_list enumtype="arabic" prefix="" suffix="."> - <list_item> - <paragraph> - Outer list, item 1. - <bullet_list bullet="*"> - <list_item> - <paragraph> - Inner list, item 1. - <list_item> - <paragraph> - Inner list, item 2. - <list_item> - <paragraph> - Outer list, item 2. - -See bullet_list_ or enumerated_list_ for further examples. - - -``literal`` -=========== - -`To be completed`_. - - -``literal_block`` -================= - -The ``literal_block`` element contains a block of text where line -breaks and whitespace are significant and must be preserved. -``literal_block`` elements are commonly used for program listings and -interactive computer sessions. See `line_block`_ for an alternative -useful for verse and addresses. - - -Details -------- - -:Category: - `Simple Body Elements`_ - -:Parents: - All elements employing the `%body.elements;`_ or - `%structure.model;`_ parameter entities in their content models - may contain ``literal_block``. - -:Children: - ``literal_block`` elements may contain text data plus `inline - elements`_. - -:Analogues: - ``literal_block`` is analogous to the HTML "pre" element and to - the DocBook "programlisting" and "screen" elements. - -:Processing: - ``literal_block`` elements are typically rendered in a monospaced - typeface. It is crucial that all whitespace and line breaks are - preserved in the rendered form. - - -Content Model -------------- - -.. parsed-literal:: - - `%text.model;`_ - -:Attributes: - The ``literal_block`` element contains the `common attributes`_ - (id_, name_, dupname_, source_, and class_), plus `xml:space`_. - -:Parameter Entities: - The `%body.elements;`_ parameter entity directly includes - ``literal_block``. The `%structure.model;`_ parameter entity - indirectly includes ``literal_block``. - - -Examples --------- - -reStructuredText source:: - - Here is a literal block:: - - if literal_block: - text = 'is left as-is' - spaces_and_linebreaks = 'are preserved' - markup_processing = None - -Pseudo-XML_ fragment from simple parsing:: - - <paragraph> - Here is a literal block: - <literal_block xml:space="preserve"> - if literal_block: - text = 'is left as-is' - spaces_and_linebreaks = 'are preserved' - markup_processing = None - - -``note`` -======== - -The ``note`` element is an admonition, a distinctive and -self-contained notice. Also see the other admonition elements -Docutils offers (in alphabetical order): attention_, caution_, -danger_, error_, hint_, important_, tip_, warning_, and the generic -admonition_. - - -Details -------- - -:Category: - `Compound Body Elements`_ - -:Parents: - All elements employing the `%body.elements;`_ or - `%structure.model;`_ parameter entities in their content models - may contain ``note``. - -:Children: - ``note`` elements contain one or more `body elements`_. - -:Analogues: - ``note`` is analogous to the DocBook "note" element. - -:Processing: - Rendered distinctly (inset and/or in a box, etc.), with the - generated title "Note" (or similar). - - -Content Model -------------- - -.. parsed-literal:: - - (`%body.elements;`_)+ - -:Attributes: - The ``note`` element contains only the `common attributes`_: id_, - name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%body.elements;`_ parameter entity directly includes - ``note``. The `%structure.model;`_ parameter entity indirectly - includes ``note``. - - -Examples --------- - -reStructuredText source:: - - .. Note:: Admonitions can be handy to break up a - long boring technical document. - -Pseudo-XML_ fragment from simple parsing:: - - <note> - <paragraph> - Admonitions can be handy to break up a - long boring technical document. - -``option`` -========== - -The ``option`` element groups an option string together with zero or -more option argument placeholders. Note that reStructuredText_ -currently supports only one argument per option. - - -Details -------- - -:Category: - `Body Subelements`_ - -:Parents: - Only the option_group_ element contains ``option``. - -:Children: - Each ``option`` element contains one option_string_ and zero or - more option_argument_ elements. - -:Analogues: - ``option`` has no direct analogues in common DTDs. - -:Processing: - See option_list_. - - -Content Model -------------- - -.. parsed-literal:: - - (option_string_, option_argument_ \*) - -:Attributes: - The ``option`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - - -Examples --------- - -See the examples for the option_list_ element. - - -``option_argument`` -=================== - -The ``option_argument`` element contains placeholder text for option -arguments. - - -Details -------- - -:Category: - `Body Subelements`_ - -:Parents: - Only the option_ element contains ``option_argument``. - -:Children: - ``option_argument`` elements contain text data only. - -:Analogues: - ``option_argument`` has no direct analogues in common DTDs. - -:Processing: - The value of the "delimiter" attribute is prefixed to the - ``option_argument``, separating it from its option_string_ or a - preceding ``option_argument``. The ``option_argument`` text is - typically rendered in a monospaced typeface, possibly italicized - or otherwise altered to indicate its placeholder nature. - - -Content Model -------------- - -.. parsed-literal:: - - (#PCDATA) - -:Attributes: - The ``option_argument`` element contains the `common attributes`_ (id_, - name_, dupname_, source_, and class_), plus delimiter_. - - ``delimiter`` contains the text preceding the ``option_argument``: - either the text separating it from the option_string_ (typically - either "=" or " ") or the text between option arguments (typically - either "," or " "). - - -Examples --------- - -See the examples for the option_list_ element. - - -``option_group`` -================ - -The ``option_group`` element groups together one or more option_ -elements, all synonyms. - - -Details -------- - -:Category: - `Body Subelements`_ - -:Parents: - Only the option_list_item_ element contains ``option_group``. - -:Children: - ``option_group`` elements contain one or more option_ elements. - - ``option_group`` is an empty element and has no children. - - Each ``option_group`` element contains one _ and - one _ element. - -:Analogues: - ``option_group`` has no direct analogues in common DTDs. - -:Processing: - Typically option_ elements within an ``option_group`` are joined - together in a comma-separated list. - - -Content Model -------------- - -.. parsed-literal:: - - (option_group_, description_) - -:Attributes: - The ``option_group`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - - -Examples --------- - -See the examples for the option_list_ element. - - -``option_list`` -=============== - -Each ``option_list`` element contains a two-column list of -command-line options and descriptions, documenting a program's -options. - - -Details -------- - -:Category: - `Compound Body Elements`_ - -:Parents: - All elements employing the `%body.elements;`_ or - `%structure.model;`_ parameter entities in their content models - may contain ``option_list``. - -:Children: - ``option_list`` elements contain one or more option_list_item_ - elements. - -:Analogues: - ``option_list`` has no direct analogues in common DTDs. It can be - emulated with primitives such as tables. - -:Processing: - An ``option_list`` is typically rendered as a two-column list, - where the first column contains option strings and arguments, and - the second column contains descriptions. - - -Content Model -------------- - -.. parsed-literal:: - - (option_list_item_ +) - -:Attributes: - The ``option_list`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%body.elements;`_ parameter entity directly includes - ``option_list``. The `%structure.model;`_ parameter entity - indirectly includes ``option_list``. - - -Examples --------- - -reStructuredText_ source:: - - -a command-line option "a" - -1 file, --one=file, --two file - Multiple options with arguments. - -Pseudo-XML_ fragment from simple parsing:: - - <option_list> - <option_list_item> - <option_group> - <option> - <option_string> - -a - <description> - <paragraph> - command-line option "a" - <option_list_item> - <option_group> - <option> - <option_string> - -1 - <option_argument delimiter=" "> - file - <option> - <option_string> - --one - <option_argument delimiter="="> - file - <option> - <option_string> - --two - <option_argument delimiter=" "> - file - <description> - <paragraph> - Multiple options with arguments. - - -``option_list_item`` -==================== - -The ``option_list_item`` element is a container for a pair of -option_group_ and description_ elements. - - -Details -------- - -:Category: - `Body Subelements`_ - -:Parents: - Only the option_list_ element contains ``option_list_item``. - -:Children: - Each ``option_list_item`` element contains one option_group_ and - one description_ element. - -:Analogues: - ``option_list_item`` has no direct analogues in common DTDs. - -:Processing: - See option_list_. - - -Content Model -------------- - -.. parsed-literal:: - - (option_group_, description_) - -:Attributes: - The ``option_list_item`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - - -Examples --------- - -See the examples for the option_list_ element. - - -``option_string`` -================= - -The ``option_string`` element contains the text of a command-line -option. - - -Details -------- - -:Category: - `Body Subelements`_ - -:Parents: - Only the option_ element contains ``option_string``. - -:Children: - ``option_string`` elements contain text data only. - -:Analogues: - ``option_string`` has no direct analogues in common DTDs. - -:Processing: - The ``option_string`` text is typically rendered in a monospaced - typeface. - - -Content Model -------------- - -.. parsed-literal:: - - (#PCDATA) - -:Attributes: - The ``option_string`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - - -Examples --------- - -See the examples for the option_list_ element. - - -``organization`` -================ - -The ``organization`` element contains the name of document author's -organization, or the organization responsible for the document. - - -Details -------- - -:Category: - `Bibliographic Elements`_ - -:Parents: - Only the docinfo_ element contains ``organization``. - -:Children: - ``organization`` elements may contain text data plus `inline - elements`_. - -:Analogues: - ``organization`` is analogous to the DocBook "orgname", - "corpname", or "publishername" elements. - -:Processing: - See docinfo_. - - -Content Model -------------- - -.. parsed-literal:: - - `%text.model;`_ - -:Attributes: - The ``organization`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%bibliographic.elements;`_ parameter entity directly includes - ``organization``. - - -Examples --------- - -reStructuredText_ source:: - - Document Title - ============== - - :Organization: Humankind - -Complete pseudo-XML_ result after parsing and applying transforms:: - - <document id="document-title" name="document title"> - <title> - Document Title - <docinfo> - <organization> - Humankind - -See docinfo_ for a more complete example, including processing -context. - - -``paragraph`` -============= - -The ``paragraph`` element contains the text and inline elements of a -single paragraph, a fundamental building block of documents. - - -Details -------- - -:Category: - `Simple Body Elements`_ - -:Parents: - All elements employing the `%body.elements;`_ or - `%structure.model;`_ parameter entities in their content models - may contain ``paragraph``. - -:Children: - ``paragraph`` elements may contain text data plus `inline - elements`_. - -:Analogues: - ``paragraph`` is analogous to the HTML "p" element and to the - DocBook "para" elements. - - -Content Model -------------- - -.. parsed-literal:: - - `%text.model;`_ - -:Attributes: - The ``paragraph`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%body.elements;`_ parameter entity directly includes - ``paragraph``. The `%structure.model;`_ parameter entity - indirectly includes ``paragraph``. - - -Examples --------- - -reStructuredText_ source:: - - A paragraph. - -Pseudo-XML_ fragment from simple parsing:: - - <paragraph> - A paragraph. - - -``pending`` -=========== - -`To be completed`_. - - -``problematic`` -=============== - -`To be completed`_. - - -``raw`` -======= - -`To be completed`_. - - -``reference`` -============= - -`To be completed`_. - - -``revision`` -============ - -The ``revision`` element contains the revision number of the document. -It can be used alone or in conjunction with version_. - - -Details -------- - -:Category: - `Bibliographic Elements`_ - -:Parents: - Only the docinfo_ element contains ``revision``. - -:Children: - ``revision`` elements may contain text data plus `inline - elements`_. - -:Analogues: - ``revision`` is analogous to but simpler than the DocBook - "revision" element. It closely matches the DocBook "revnumber" - element, but in a simpler context. - -:Processing: - Often used with the RCS/CVS keyword "Revision". See docinfo_. - - -Content Model -------------- - -.. parsed-literal:: - - `%text.model;`_ - -:Attributes: - The ``revision`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%bibliographic.elements;`_ parameter entity directly includes - ``revision``. - - -Examples --------- - -reStructuredText_ source:: - - Document Title - ============== - - :Version: 1 - :Revision: b - -Complete pseudo-XML_ result after parsing and applying transforms:: - - <document id="document-title" name="document title"> - <title> - Document Title - <docinfo> - <version> - 1 - <revision> - b - -See docinfo_ for a more complete example, including processing -context. - - -``row`` -======= - -`To be completed`_. - - -``rubric`` -========== - - rubric n. 1. a title, heading, or the like, in a manuscript, - book, statute, etc., written or printed in red or otherwise - distinguished from the rest of the text. ... - - -- Random House Webster's College Dictionary, 1991 - -A rubric is like an informal heading that doesn't correspond to the -document's structure. - -`To be completed`_. - - -``section`` -=========== - -The ``section`` element is the main unit of hierarchy for Docutils -documents. Docutils ``section`` elements are a recursive structure; a -``section`` may contain other ``section`` elements, without limit. -Paragraphs and other body elements may occur before a ``section``, but -not after it. - - -Details -------- - -:Category: - `Structural Elements`_ - -:Parents: - The following elements may contain ``section``: document_, - section_ - -:Children: - ``section`` elements begin with a title_, and may contain `body - elements`_ as well as transition_, topic_, and sidebar_ elements. - -:Analogues: - ``section`` is analogous to DocBook recursive "section" elements, - and to HTML "div" elements combined with "h1" etc. title elements. - - -Content Model -------------- - -.. parsed-literal:: - - (title_, - `%structure.model;`_) - -See the `%structure.model;`_ parameter entity for details of the body -of a ``section``. - -:Attributes: - The ``section`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%section.elements;`_ parameter entity directly includes - ``section``. The `%structure.model;`_ parameter entity indirectly - includes ``section``. - - -Examples --------- - -reStructuredText_ source:: - - Title 1 - ======= - Paragraph 1. - - Title 2 - ------- - Paragraph 2. - - Title 3 - ======= - Paragraph 3. - - Title 4 - ------- - Paragraph 4. - -Complete pseudo-XML_ result after parsing:: - - <document> - <section id="title-1" name="title 1"> - <title> - Title 1 - <paragraph> - Paragraph 1. - <section id="title-2" name="title 2"> - <title> - Title 2 - <paragraph> - Paragraph 2. - <section id="title-3" name="title 3"> - <title> - Title 3 - <paragraph> - Paragraph 3. - <section id="title-4" name="title 4"> - <title> - Title 4 - <paragraph> - Paragraph 4. - - -``sidebar`` -=========== - -Sidebars are like miniature, parallel documents that occur inside -other documents, providing related or reference material. A -``sidebar`` is typically offset by a border and "floats" to the side -of the page; the document's main text may flow around it. Sidebars -can also be likened to super-footnotes; their content is outside of -the flow of the document's main text. - -The ``sidebar`` element is a nonrecursive section_-like construct -which may occur at the top level of a section_ wherever a body element -(list, table, etc.) is allowed. In other words, ``sidebar`` elements -cannot nest inside body elements, so you can't have a ``sidebar`` -inside a ``table`` or a ``list``, or inside another ``sidebar`` (or -topic_). - - -Details -------- - -:Category: - `Structural Elements`_ - -:Parents: - The following elements may contain ``sidebar``: document_, - section_ - -:Children: - ``sidebar`` elements begin with a title_ and an optional subtitle_ - and contain `body elements`_. - -:Analogues: - ``sidebar`` is analogous to the DocBook "sidebar" element. - -:Processing: - A ``sidebar`` element should be set off from the rest of the - document somehow, typically with a border. Sidebars typically - "float" to the side of the page and the document's main text flows - around them. - - -Content Model -------------- - -.. parsed-literal:: - - (title_, subtitle_?, - (`%body.elements;`_)+) - -:Attributes: - The ``sidebar`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%structure.model;`_ parameter entity directly includes - ``sidebar``. - - -Examples --------- - -The `"sidebar" directive`_ is used to create a ``sidebar`` element. -reStructuredText_ source:: - - .. sidebar:: Title - :subtitle: If Desired - - Body. - -Pseudo-XML_ fragment from simple parsing:: - - <sidebar> - <title> - Title - <subtitle> - If Desired - <paragraph> - Body. - -.. _"sidebar" directive: rst/directives.html#sidebar - - -``status`` -========== - -The ``status`` element contains a status statement for the document, -such as "Draft", "Final", "Work In Progress", etc. - - -Details -------- - -:Category: - `Bibliographic Elements`_ - -:Parents: - Only the docinfo_ element contains ``status``. - -:Children: - ``status`` elements may contain text data plus `inline elements`_. - -:Analogues: - ``status`` is analogous to the DocBook "status" element. - -:Processing: - See docinfo_. - - -Content Model -------------- - -.. parsed-literal:: - - `%text.model;`_ - -:Attributes: - The ``status`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%bibliographic.elements;`_ parameter entity directly includes - ``status``. - - -Examples --------- - -reStructuredText_ source:: - - Document Title - ============== - - :Status: Work In Progress - -Complete pseudo-XML_ result after parsing and applying transforms:: - - <document id="document-title" name="document title"> - <title> - Document Title - <docinfo> - <status> - Work In Progress - -See docinfo_ for a more complete example, including processing -context. - - -``strong`` -========== - -`To be completed`_. - - -``subscript`` -============= - -`To be completed`_. - - -``substitution_definition`` -=========================== - -`To be completed`_. - - -``substitution_reference`` -========================== - -`To be completed`_. - - -``subtitle`` -============ - -The ``subtitle`` element stores the subtitle of a document_. - - -Details -------- - -:Category: - `Structural Subelements`_ - -:Parents: - The document_ and sidebar_ elements may contain ``subtitle``. - -:Children: - ``subtitle`` elements may contain text data plus `inline - elements`_. - -:Analogues: - ``subtitle`` is analogous to HTML header elements ("h2" etc.) and - to the DocBook "subtitle" element. - -:Processing: - A document's subtitle is usually rendered smaller than its title_. - - -Content Model -------------- - -.. parsed-literal:: - - `%text.model;`_ - -:Attributes: - The ``subtitle`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - - -Examples --------- - -reStructuredText_ source:: - - ======= - Title - ======= - ---------- - Subtitle - ---------- - - A paragraph. - -Complete pseudo-XML_ result after parsing and applying transforms:: - - <document id="title" name="title"> - <title> - Title - <subtitle id="subtitle" name="subtitle"> - Subtitle - <paragraph> - A paragraph. - -Note how two section levels have collapsed, promoting their titles to -become the document's title and subtitle. Since there is only one -structural element (document), the subsection's ``id`` and ``name`` -attributes are stored in the ``subtitle`` element. - - -``superscript`` -=============== - -`To be completed`_. - - -``system_message`` -================== - -`To be completed`_. - - -``table`` -========= - -`To be completed`_. - - -``target`` -========== - -`To be completed`_. - - -``tbody`` -========= - -`To be completed`_. - - -``term`` -======== - -The ``term`` element contains a word or phrase being defined in a -definition_list_. - - -Details -------- - -:Category: - `Body Subelements`_ (simple) - -:Parents: - Only the definition_list_item_ element contains ``term``. - -:Children: - ``term`` elements may contain text data plus `inline elements`_. - -:Analogues: - ``term`` is analogous to the HTML "dt" element and to the DocBook - "term" element. - -:Processing: - See definition_list_item_. - - -Content Model -------------- - -.. parsed-literal:: - - `%text.model;`_ - -:Attributes: - The ``term`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - - -Examples --------- - -See the examples for the definition_list_, definition_list_item_, and -classifier_ elements. - - -``tgroup`` -========== - -`To be completed`_. - - -``thead`` -========= - -`To be completed`_. - - -``tip`` -======= - -The ``tip`` element is an admonition, a distinctive and self-contained -notice. Also see the other admonition elements Docutils offers (in -alphabetical order): attention_, caution_, danger_, error_, hint_, -important_, note_, warning_, and the generic admonition_. - - -Details -------- - -:Category: - `Compound Body Elements`_ - -:Parents: - All elements employing the `%body.elements;`_ or - `%structure.model;`_ parameter entities in their content models - may contain ``tip``. - -:Children: - ``tip`` elements contain one or more `body elements`_. - -:Analogues: - ``tip`` is analogous to the DocBook "tip" element. - -:Processing: - Rendered distinctly (inset and/or in a box, etc.), with the - generated title "Tip" (or similar). - - -Content Model -------------- - -.. parsed-literal:: - - (`%body.elements;`_)+ - -:Attributes: - The ``tip`` element contains only the `common attributes`_: id_, - name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%body.elements;`_ parameter entity directly includes ``tip``. - The `%structure.model;`_ parameter entity indirectly includes - ``tip``. - - -Examples --------- - -reStructuredText source:: - - .. Tip:: 15% if the service is good. - -Pseudo-XML_ fragment from simple parsing:: - - <tip> - <paragraph> - 15% if the service is good. - - -``title`` -========= - -The ``title`` element stores the title of a document_, section_, -topic_, sidebar_, or generic admonition_. - - -Details -------- - -:Category: - `Structural Subelements`_ - -:Parents: - The following elements may contain ``title``: document_, section_, - topic_, sidebar_, admonition_ - -:Children: - ``title`` elements may contain text data plus `inline elements`_. - -:Analogues: - ``title`` is analogous to HTML "title" and header ("h1" etc.) - elements, and to the DocBook "title" element. - - -Content Model -------------- - -.. parsed-literal:: - - `%text.model;`_ - -:Attributes: - The ``title`` element contains the `common attributes`_ (id_, - name_, dupname_, source_, and class_), plus refid_ and auto_. - - ``refid`` is used as a backlink to a table of contents entry. - - ``auto`` is used to indicate (with value "1") that the ``title`` - has been numbered automatically. - - -Examples --------- - -reStructuredText_ source:: - - A Title - ======= - - A paragraph. - -Pseudo-XML_ fragment from simple parsing:: - - <section id="a-title" name="a title"> - <title> - A Title - <paragraph> - A paragraph. - - -``title_reference`` -=================== - -`To be completed`_. - - -``topic`` -========= - -The ``topic`` element is a nonrecursive section_-like construct which -may occur at the top level of a section_ wherever a body element -(list, table, etc.) is allowed. In other words, ``topic`` elements -cannot nest inside body elements, so you can't have a ``topic`` inside -a ``table`` or a ``list``, or inside another ``topic`` (or sidebar_). - - -Details -------- - -:Category: - `Structural Elements`_ - -:Parents: - The following elements may contain ``topic``: document_, section_ - -:Children: - ``topic`` elements begin with a title_ and may contain `body - elements`_. - -:Analogues: - ``topic`` is analogous to the DocBook "simplesect" element. - -:Processing: - A ``topic`` element should be set off from the rest of the - document somehow, such as with indentation or a border. - - -Content Model -------------- - -.. parsed-literal:: - - (title_?, - (`%body.elements;`_)+) - -:Attributes: - The ``topic`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%structure.model;`_ parameter entity directly includes - ``topic``. - - -Examples --------- - -The `"topic" directive`_ is used to create a ``topic`` element. -reStructuredText_ source:: - - .. topic:: Title - - Body. - -Pseudo-XML_ fragment from simple parsing:: - - <topic> - <title> - Title - <paragraph> - Body. - -.. _"topic" directive: rst/directives.html#topic - - -``transition`` -============== - -The ``transition`` element is commonly seen in novels and short -fiction, as a gap spanning one or more lines, with or without a type -ornament such as a row of asterisks. Transitions separate other body -elements, dividing a section into untitled divisions. A transition -may not begin or end a section or document, nor may two transitions be -immediately adjacent. - -See `Doctree Representation of Transitions`__ in `A Record of -reStructuredText Syntax Alternatives`__. - -__ rst/alternatives.txt#doctree-representation-of-transitions -__ rst/alternatives.txt - - -Details -------- - -:Category: - `Structural Subelements`_ - -:Parents: - The following elements may contain ``transition``: document_, - section_ - -:Children: - ``transition`` is an empty element and has no children. - -:Analogues: - ``transition`` is analogous to the HTML "hr" element. - -:Processing: - The ``transition`` element is typically rendered as vertical - whitespace (more than that separating paragraphs), with or without - a horizontal line or row of asterisks. In novels, transitions are - often represented as a row of three well-spaced asterisks with - vertical space above and below. - - -Content Model -------------- - -:: - - EMPTY - -The ``transition`` element has no content; it is a "point element". - -:Attributes: - The ``transition`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%structure.model;`_ parameter entity directly includes - ``transition``. - - -Examples --------- - -reStructuredText_ source:: - - Paragraph 1. - - -------- - - Paragraph 2. - -Complete pseudo-XML_ result after parsing:: - - <document> - <paragraph> - Paragraph 1. - <transition> - <paragraph> - Paragraph 2. - - -``version`` -=========== - -The ``version`` element contains the version number of the document. -It can be used alone or in conjunction with revision_. - - -Details -------- - -:Category: - `Bibliographic Elements`_ - -:Parents: - Only the docinfo_ element contains ``version``. - -:Children: - ``version`` elements may contain text data plus `inline - elements`_. - -:Analogues: - ``version`` may be considered analogous to the DocBook "revision", - "revnumber", or "biblioid" elements. - -:Processing: - Sometimes used with the RCS/CVS keyword "Revision". See docinfo_ - and revision_. - - -Content Model -------------- - -.. parsed-literal:: - - `%text.model;`_ - -:Attributes: - The ``version`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%bibliographic.elements;`_ parameter entity directly includes - ``version``. - - -Examples --------- - -reStructuredText_ source:: - - Document Title - ============== - - :Version: 1.1 - -Complete pseudo-XML_ result after parsing and applying transforms:: - - <document id="document-title" name="document title"> - <title> - Document Title - <docinfo> - <version> - 1.1 - -See docinfo_ for a more complete example, including processing -context. - - -``warning`` -=========== - -The ``warning`` element is an admonition, a distinctive and -self-contained notice. Also see the other admonition elements -Docutils offers (in alphabetical order): attention_, caution_, -danger_, error_, hint_, important_, note_, tip_. - - -Details -------- - -:Category: - `Compound Body Elements`_ - -:Parents: - All elements employing the `%body.elements;`_ or - `%structure.model;`_ parameter entities in their content models - may contain ``warning``. - -:Children: - ``warning`` elements contain one or more `body elements`_. - -:Analogues: - ``warning`` is analogous to the DocBook "warning" element. - -:Processing: - Rendered distinctly (inset and/or in a box, etc.), with the - generated title "Warning" (or similar). - - -Content Model -------------- - -.. parsed-literal:: - - (`%body.elements;`_)+ - -:Attributes: - The ``warning`` element contains only the `common attributes`_: - id_, name_, dupname_, source_, and class_. - -:Parameter Entities: - The `%body.elements;`_ parameter entity directly includes - ``warning``. The `%structure.model;`_ parameter entity indirectly - includes ``warning``. - - -Examples --------- - -reStructuredText source:: - - .. WARNING:: Reader discretion is strongly advised. - -Pseudo-XML_ fragment from simple parsing:: - - <warning> - <paragraph> - Reader discretion is strongly advised. - - ---------------------- - Attribute Reference ---------------------- - -.. contents:: :local: - :depth: 1 - -_`Common Attributes`: Through the `%basic.atts;`_ parameter entity, -all elements contain the following attributes: id_, name_, dupname_, -source_, and class_. - -.. _attribute type: - -Attribute types: - -``CDATA`` - Character data. ``CDATA`` attributes may contain arbitrary text. - -``ID`` - Like a ``NMTOKEN``, but it must begin with a letter (a "name - production"). Identical ``ID`` values must not appear more than - once in a document; i.e., ID values must uniquely identify their - elements. - -``IDREF`` - A reference to an ``ID`` value (a name production) of another - element. - -``IDREFS`` - One or more space-separated ``ID`` references (name productions). - -``NMTOKEN`` - A "name token". One or more of letters, digits, ".", "-", and - "_". - -``NMTOKENS`` - One or more space-separated ``NMTOKEN`` names. - -``%yesorno;`` - No if zero ("0"), yes if any other value. This is a parameter - entity which resolves to a ``NMTOKEN`` attribute type. - -``%number;`` - This emphasizes that the attribute value must be a number. This - is a parameter entity which resolves to a ``NMTOKEN`` attribute - type. - -enumeration - The attribute value may be one of a specified list of values. - - -``anonymous`` -============= - -`Attribute type`_: ``%yesorno;``. Default value: none (implies no). - -The ``anonymous`` attribute is used for unnamed hyperlinks in the -target_ and reference_ elements (via the `%anonymous.att;`_ parameter -entity). - - -``auto`` -======== - -`Attribute type`_: ``CDATA``. Default value: none. - -The ``auto`` attribute is used to indicate automatically-numbered -footnote_, footnote_reference_ and title_ elements (via the -`%auto.att;`_ parameter entity). - - -``backrefs`` -============ - -`Attribute type`_: ``IDREFS``. Default value: none. - -The ``backrefs`` attribute contains a space-separated list of id_ -references, used for backlinks from footnote_, citation_, and -system_message_ elements (via the `%backrefs.att;`_ parameter entity). - - -``bullet`` -========== - -`Attribute type`_: ``CDATA``. Default value: none. - -The ``bullet`` attribute is used in the bullet_list_ element. - - -``class`` -========= - -`Attribute type`_: ``NMTOKENS``. Default value: none. - -The ``class`` attribute contains one or more names used to classify an -element. The purpose of the attribute is to indicate an "is-a" -variant relationship, to allow an extensible way of defining -sub-classes of existing elements. It can be used to carry context -forward between a Docutils Reader and Writer, when a custom structure -is reduced to a standardized document tree. One common use is in -conjunction with stylesheets, to add selection criteria. It should -not be used to carry formatting instructions or arbitrary content. - -The ``class`` attribute's contents should be ignorable. Writers that -are not familiar with the variant expressed should be able to ignore -the attribute. - -``class`` is one of the `common attributes`_, shared by all Docutils -elements. - - -``delimiter`` -============= - -`Attribute type`_: ``CDATA``. Default value: none. - -The ``delimiter`` attribute is used in the option_argument_ element. - - -``dupname`` -=========== - -`Attribute type`_: ``NMTOKENS``. Default value: none. - -The ``dupname`` attribute contains the name of an element when there -has been a naming conflict. The contents of the ``dupname`` attribute -would have been transferred from the `name`_ attribute. An element -may have at most one of the ``name`` or ``dupname`` attributes, but -not both. ``dupname`` is one of the `common attributes`_, shared by -all Docutils elements. - - -``enumtype`` -============ - -`Attribute type`_: enumeration, one of "arabic", "loweralpha", -"upperalpha", "lowerroman", or "upperroman". Default value: none. - -The ``enumtype`` attribute is used in the enumerated_list_ element. - - -``id`` -====== - -`Attribute type`_: ``ID``. Default value: none. - -The ``id`` attribute contains a unique identifier key. ``id`` is one -of the `common attributes`_, shared by all Docutils elements. - - -``name`` -======== - -`Attribute type`_: ``NMTOKENS``. Default value: none. - -The ``name`` attribute contains the name of an element, typically -originating from the element's title or content. ``name`` must be -unique; if there are name conflicts (two or more elements want to the -same name), the contents will be transferred to the `dupname`_ -attribute on the duplicate elements. An element may have at most one -of the ``name`` or ``dupname`` attributes, but not both. ``name`` is -one of the `common attributes`_, shared by all Docutils elements. - - -``prefix`` -========== - -`Attribute type`_: ``CDATA``. Default value: none. - -The ``prefix`` attribute is used in the enumerated_list_ element. - - -``refid`` -========= - -`Attribute type`_: ``IDREF``. Default value: none. - -The ``refid`` attribute contains references to `id`_ attributes in -other elements. It is used by the target_, reference_, -footnote_reference_, citation_reference_, title_ and problematic_ -elements (via the `%refid.att;`_ and `%reference.atts;`_ parameter -entities). - - -``refname`` -=========== - -`Attribute type`_: ``NMTOKENS``. Default value: none. - -The ``refname`` attribute contains an internal reference to the -`name`_ attribute of another element. On a `target`_ element, -``refname`` indicates an indirect target which may resolve to either -an internal or external reference. ``refname`` is used by the -target_, reference_, footnote_reference_, citation_reference_, and -substitution_reference_ elements (via the `%refname.att;`_ and -`%reference.atts;`_ parameter entities). - - -``refuri`` -========== - -`Attribute type`_: ``CDATA``. Default value: none. - -The ``refuri`` attribute contains an external reference to a URI/URL. -It is used by the target_, reference_, footnote_reference_, and -citation_reference_ elements (via the `%reference.atts;`_ parameter -entity). - - -``source`` -========== - -`Attribute type`_: ``CDATA``. Default value: none. - -The ``source`` attribute is used to store the path or URL to the -source text that was used to produce the document tree. It is one of -the `common attributes`_, shared by all Docutils elements. - - -``start`` -========= - -`Attribute type`_: ``%number;``. Default value: none. - -The ``start`` attribute is used in the enumerated_list_ element. - - -``suffix`` -========== - -`Attribute type`_: ``CDATA``. Default value: none. - -The ``suffix`` attribute is used in the enumerated_list_ element. - - -``xml:space`` -============= - -`Attribute type`_: one of "default" or "preserve". Default value: -"preserve" (fixed). - -The ``xml:space`` attribute is a standard XML attribute for -whitespace-preserving elements. It is used by the literal_block_, -line_block_, doctest_block_, comment_, and raw_ elements (via the -`%fixedspace.att;`_ parameter entity). It is a fixed attribute, meant -to communicate to an XML parser that the element contains significant -whitespace. The attribute value should not be set in a document -instance. - - ----------------------------- - Parameter Entity Reference ----------------------------- - -.. contents:: :local: - :depth: 1 - -Parameter entities are used to simplify the DTD (to share definitions -and reduce duplication) and to allow the DTD to be customized by -wrapper DTDs (external client DTDs that use or import the Docutils -DTD). Parameter entities may be overridden by wrapper DTDs, replacing -the definitions below with custom definitions. Parameter entities -whose names begin with "additional" are meant to allow easy extension -by wrapper DTDs. - - -``%anonymous.att;`` -=================== - -The ``%anonymous.att;`` parameter entity contains the anonymous_ -attribute, used for unnamed hyperlinks. - -Entity definition: - -.. parsed-literal:: - - anonymous_ %yesorno; #IMPLIED - -The reference_ and target_ elements directly employ the -``%anonymous.att;`` parameter entity in their attribute lists. - - -``%auto.att;`` -============== - -The ``%auto.att;`` parameter entity contains the auto_ attribute, used -to indicate an automatically-numbered footnote or title. - -Entity definition: - -.. parsed-literal:: - - auto_ CDATA #IMPLIED - -The footnote_, footnote_reference_, and title_ elements directly -employ the ``%auto.att;`` parameter entity in their attribute lists. - - -``%backrefs.att;`` -================== - -The ``%backrefs.att;`` parameter entity contains the backrefs_ -attribute, a space-separated list of id references, for backlinks. - -Entity definition: - -.. parsed-literal:: - - backrefs_ IDREFS #IMPLIED - -The citation_, footnote_, and system_message_ elements directly employ -the ``%backrefs.att;`` parameter entity in their attribute lists. - - -``%basic.atts;`` -================ - -The ``%basic.atts;`` parameter entity lists attributes common to all -Docutils elements. See `Common Attributes`_. - -Entity definition: - -.. parsed-literal:: - - id_ ID #IMPLIED - name_ NMTOKENS #IMPLIED - dupname_ NMTOKENS #IMPLIED - source_ CDATA #IMPLIED - class_ NMTOKENS #IMPLIED - %additional.basic.atts; - -The ``%additional.basic.atts;`` parameter entity can be used by -wrapper DTDs to extend ``%basic.atts;``. - - -``%bibliographic.elements;`` -============================ - -The ``%bibliographic.elements;`` parameter entity contains an OR-list of all -`bibliographic elements`_. - -Entity definition: - -.. parsed-literal:: - - author_ | authors_ | organization_ | contact_ | address_ - | version_ | revision_ | status_ | date_ | copyright_ - | field_ - %additional.bibliographic.elements; - -The ``%additional.bibliographic.elements;`` parameter entity can be used by -wrapper DTDs to extend ``%bibliographic.elements;``. - -Only the docinfo_ element directly employs the -``%bibliographic.elements;`` parameter entity in its content model. - - -``%body.elements;`` -=================== - -The ``%body.elements;`` parameter entity contains an OR-list of all -`body elements`_. ``%body.elements;`` is itself contained within the -`%structure.model;`_ parameter entity. - -Entity definition: - -.. parsed-literal:: - - paragraph_ | literal_block_ | doctest_block_ | line_block_ - | block_quote_ | table_ | figure_ | image_ | footnote_ | citation_ - | rubric_ - | bullet_list_ | enumerated_list_ | definition_list_ | field_list_ - | option_list_ - | attention_ | caution_ | danger_ | error_ | hint_ | important_ - | note_ | tip_ | warning_ | admonition_ - | target_ | substitution_definition_ | comment_ | pending_ - | system_message_ | raw_ - %additional.body.elements; - -The ``%additional.body.elements;`` parameter entity can be used by -wrapper DTDs to extend ``%body.elements;``. - -The ``%body.elements;`` parameter entity is directly employed in the -content models of the following elements: admonition_, attention_, -block_quote_, caution_, citation_, danger_, definition_, description_, -entry_, error_, field_body_, footer_, footnote_, header_, hint_, -important_, legend_, list_item_, note_, sidebar_, system_message_, -tip_, topic_, warning_ - -Via `%structure.model;`_, the ``%body.elements;`` parameter entity is -indirectly employed in the content models of the document_ and -section_ elements. - - -``%fixedspace.att;`` -==================== - -The ``%fixedspace.att;`` parameter entity contains the `xml:space`_ -attribute, a standard XML attribute for whitespace-preserving -elements. - -Entity definition: - -.. parsed-literal:: - - `xml:space`_ (default | preserve) #FIXED 'preserve' - -The ``%fixedspace.att;`` parameter entity is directly employed in the -attribute lists of the following elements: address_, comment_, -doctest_block_, line_block_, literal_block_, raw_ - - -``%inline.elements;`` -===================== - -The ``%inline.elements;`` parameter entity contains an OR-list of all -`inline elements`_. - -Entity definition: - -.. parsed-literal:: - - emphasis_ | strong_ | literal_ - | reference_ | footnote_reference_ | citation_reference_ - | substitution_reference_ | title_reference_ - | abbreviation_ | acronym_ | subscript_ | superscript_ - | inline_ | problematic_ | generated_ - | target_ | image_ | raw_ - %additional.inline.elements; - -The ``%additional.inline.elements;`` parameter entity can be used by -wrapper DTDs to extend ``%inline.elements;``. - -Via `%text.model;`_, the ``%inline.elements;`` parameter entity is -indirectly employed in the content models of the following elements: -abbreviation_, acronym_, address_, attribution_, author_, caption_, -classifier_, contact_, copyright_, date_, doctest_block_, emphasis_, -generated_, inline_, line_block_, literal_block_, organization_, -paragraph_, problematic_, raw_, reference_, revision_, rubric_, -status_, strong_, subscript_, substitution_definition_, -substitution_reference_, subtitle_, superscript_, target_, term_, -title_, title_reference_, version_ - - -``%reference.atts;`` -==================== - -The ``%reference.atts;`` parameter entity groups together the refuri_, -refid_, and refname_ attributes. - -Entity definition: - -.. parsed-literal:: - - `%refuri.att;`_ - `%refid.att;`_ - `%refname.att;`_ - %additional.reference.atts; - -The ``%additional.reference.atts;`` parameter entity can be used by -wrapper DTDs to extend ``%additional.reference.atts;``. - -The citation_reference_, footnote_reference_, reference_, and target_ -elements directly employ the ``%reference.att;`` parameter entity in -their attribute lists. - - -``%refid.att;`` -================ - -The ``%refid.att;`` parameter entity contains the refid_ attribute, an -internal reference to the `id`_ attribute of another element. - -Entity definition: - -.. parsed-literal:: - - refid_ CDATA #IMPLIED - -The title_ and problematic_ elements directly employ the -``%refid.att;`` parameter entity in their attribute lists. - -Via `%reference.atts;`_, the ``%refid.att;`` parameter entity is -indirectly employed in the attribute lists of the citation_reference_, -footnote_reference_, reference_, and target_ elements. - - -``%refname.att;`` -================= - -The ``%refname.att;`` parameter entity contains the refname_ -attribute, an internal reference to the `name`_ attribute of another -element. On a `target`_ element, ``refname`` indicates an indirect -target which may resolve to either an internal or external -reference. - -Entity definition: - -.. parsed-literal:: - - refname_ NMTOKENS #IMPLIED - -The substitution_reference_ element directly employs the -``%refname.att;`` parameter entity in its attribute list. - -Via `%reference.atts;`_, the ``%refname.att;`` parameter entity is -indirectly employed in the attribute lists of the citation_reference_, -footnote_reference_, reference_, and target_ elements. - - -``%refuri.att;`` -================ - -The ``%refuri.att;`` parameter entity contains the refuri_ attribute, -an external reference to a URI/URL. - -Entity definition: - -.. parsed-literal:: - - refuri_ CDATA #IMPLIED - -Via `%reference.atts;`_, the ``%refuri.att;`` parameter entity is -indirectly employed in the attribute lists of the citation_reference_, -footnote_reference_, reference_, and target_ elements. - - -``%section.elements;`` -====================== - -The ``%section.elements;`` parameter entity contains an OR-list of all -section_-equivalent elements. ``%section.elements;`` is itself -contained within the `%structure.model;`_ parameter entity. - -Entity definition: - -.. parsed-literal:: - - section_ - %additional.section.elements; - -The ``%additional.section.elements;`` parameter entity can be used -by wrapper DTDs to extend ``%section.elements;``. - -Via `%structure.model;`_, the ``%section.elements;`` parameter entity -is indirectly employed in the content models of the document_ and -section_ elements. - - -``%structure.model;`` -===================== - -The ``%structure.model;`` parameter entity encapsulates the -hierarchical structure of a document and of its constituent parts. -See the discussion of the `element hierarchy`_ above. - -Entity definition: - -.. parsed-literal:: - - ( ( (`%body.elements;`_ | topic_ | sidebar_)+, - (transition_, (`%body.elements;`_ | topic_ | sidebar_)+ )*, - (`%section.elements;`_)* ) - | (`%section.elements;`_)+ ) - -Each document_ or section_ contains either: - -- multiple body elements, topics, and/or sidebars, optionally - interspersed with transitions (but transitions cannot occur at the - beginning or end, nor may there be two transitions in a row), - followed by zero or more sections; or - -- one or more sections (whose contents are recursively the same as this - model). - -The `%structure.model;`_ parameter entity is directly employed in the -content models of the document_ and section_ elements. - - -``%text.model;`` -================ - -The ``%text.model;`` parameter entity is used by many elements to -represent text data mixed with `inline elements`_. - -Entity definition: - -.. parsed-literal:: - - (#PCDATA | `%inline.elements;`_)* - -The ``%text.model;`` parameter entity is directly employed in the -content models of the following elements: abbreviation_, acronym_, -address_, author_, caption_, classifier_, contact_, copyright_, date_, -doctest_block_, emphasis_, generated_, line_block_, literal_block_, -organization_, paragraph_, problematic_, raw_, reference_, revision_, -status_, strong_, substitution_definition_, substitution_reference_, -subtitle_, target_, term_, title_, version_ - - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: diff --git a/docutils/docs/ref/docutils.dtd b/docutils/docs/ref/docutils.dtd deleted file mode 100644 index 06fe4bf55..000000000 --- a/docutils/docs/ref/docutils.dtd +++ /dev/null @@ -1,571 +0,0 @@ -<!-- -====================================================================== - Docutils Generic DTD -====================================================================== -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This DTD has been placed in the public domain. -:Filename: docutils.dtd - -More information about this DTD (document type definition) and the -Docutils project can be found at http://docutils.sourceforge.net/. -The latest version of this DTD is available from -http://docutils.sourceforge.net/spec/docutils.dtd. - -The formal public identifier for this DTD is:: - - +//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML ---> - -<!-- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Parameter Entities -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Parameter entities are used to simplify the DTD (reduce duplication) -and to allow the DTD to be customized by wrapper DTDs. Parameter -entities beginning with "additional" are meant to allow easy extension -by wrapper DTDs. ---> - -<!-- Attributes -================================================================== --> - -<!-- Boolean: no if zero(s), yes if any other value. --> -<!ENTITY % yesorno "NMTOKEN"> - -<!-- Emphasize that the attribute value must be a number. --> -<!ENTITY % number "NMTOKEN"> - -<!ENTITY % additional.basic.atts ""> -<!-- -Attributes shared by all elements in this DTD: - -- `id` is a unique identifier, typically assigned by the system. -- `name` is an identifier assigned in the markup. -- `dupname` is the same as `name`, used when it's a duplicate. -- `source` is the name of the source of this document or fragment. -- `class` is used to transmit individuality information forward. ---> -<!ENTITY % basic.atts - " id ID #IMPLIED - name NMTOKENS #IMPLIED - dupname NMTOKENS #IMPLIED - source CDATA #IMPLIED - class NMTOKENS #IMPLIED - %additional.basic.atts; "> - -<!-- External reference to a URI/URL. --> -<!ENTITY % refuri.att - " refuri CDATA #IMPLIED "> - -<!-- Internal reference to the `id` attribute of an element. --> -<!ENTITY % refid.att - " refid IDREF #IMPLIED "> - -<!-- Space-separated list of id references, for backlinks. --> -<!ENTITY % backrefs.att - " backrefs IDREFS #IMPLIED "> - -<!-- -Internal reference to the `name` attribute of an element. On a -'target' element, 'refname' indicates an indirect target which may -resolve to either an internal or external reference. ---> -<!ENTITY % refname.att - " refname NMTOKENS #IMPLIED "> - -<!ENTITY % additional.reference.atts ""> -<!-- Collected hyperlink reference attributes. --> -<!ENTITY % reference.atts - " %refuri.att; - %refid.att; - %refname.att; - %additional.reference.atts; "> - -<!-- Unnamed hyperlink. --> -<!ENTITY % anonymous.att - " anonymous %yesorno; #IMPLIED "> - -<!-- Auto-numbered footnote or title. --> -<!ENTITY % auto.att - " auto CDATA #IMPLIED "> - -<!-- XML standard attribute for whitespace-preserving elements. --> -<!ENTITY % fixedspace.att - " xml:space (default | preserve) #FIXED 'preserve' "> - - -<!-- Element OR-Lists -============================================================= --> - -<!ENTITY % additional.bibliographic.elements ""> -<!ENTITY % bibliographic.elements - " author | authors | organization | address | contact - | version | revision | status | date | copyright - | field - %additional.bibliographic.elements; "> - -<!ENTITY % additional.section.elements ""> -<!ENTITY % section.elements - " section - %additional.section.elements; "> - -<!ENTITY % additional.body.elements ""> -<!ENTITY % body.elements - " paragraph | literal_block | doctest_block | line_block | block_quote - | table | figure | image | footnote | citation | rubric - | bullet_list | enumerated_list | definition_list | field_list - | option_list - | attention | caution | danger | error | hint | important | note - | tip | warning | admonition - | target | substitution_definition | comment | pending - | system_message | raw - %additional.body.elements; "> - -<!ENTITY % additional.inline.elements ""> -<!ENTITY % inline.elements - " emphasis | strong | literal - | reference | footnote_reference | citation_reference - | substitution_reference | title_reference - | abbreviation | acronym | subscript | superscript - | inline | problematic | generated - | target | image | raw - %additional.inline.elements; "> - - -<!-- Element Content Models -================================================================== --> - -<!ENTITY % structure.model - " ( ( (%body.elements; | topic | sidebar)+, - (transition, (%body.elements; | topic | sidebar)+ )*, - (%section.elements;)* ) - | (%section.elements;)+ ) "> - -<!ENTITY % text.model - " (#PCDATA | %inline.elements;)* "> - - -<!-- Table Model -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -This DTD uses the Exchange subset of the CALS-table model (OASIS -Technical Memorandum 9901:1999 "XML Exchange Table Model DTD", -http://www.oasis-open.org/html/tm9901.htm). ---> - -<!ENTITY % calstblx PUBLIC - "-//OASIS//DTD XML Exchange Table Model 19990315//EN" - "soextblx.dtd"> - -<!-- These parameter entities customize the table model DTD. --> -<!ENTITY % bodyatt " %basic.atts; "> <!-- table elt --> -<!ENTITY % tbl.tgroup.att " %basic.atts; "> -<!ENTITY % tbl.thead.att " %basic.atts; "> -<!ENTITY % tbl.tbody.att " %basic.atts; "> -<!ENTITY % tbl.colspec.att " %basic.atts; "> -<!ENTITY % tbl.row.att " %basic.atts; "> -<!ENTITY % tbl.entry.mdl " (%body.elements;)* "> -<!ENTITY % tbl.entry.att - " %basic.atts; - morecols %number; #IMPLIED "> - -<!-- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Root Element -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ---> - -<!-- Optional elements may be generated by internal processing. --> -<!ELEMENT document - ((title, subtitle?)?, docinfo?, decoration?, %structure.model;)> -<!ATTLIST document %basic.atts;> - -<!-- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Title Elements -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ---> - -<!ELEMENT title %text.model;> -<!ATTLIST title - %basic.atts; - %refid.att; - %auto.att;> - -<!ELEMENT subtitle %text.model;> -<!ATTLIST subtitle %basic.atts;> - -<!-- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Bibliographic Elements -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ---> - -<!-- Container for bibliographic elements. May not be empty. --> -<!ELEMENT docinfo (%bibliographic.elements;)+> -<!ATTLIST docinfo %basic.atts;> - -<!ELEMENT author %text.model;> -<!ATTLIST author %basic.atts;> - -<!ELEMENT authors ((author, organization?, address?, contact?)+)> -<!ATTLIST authors %basic.atts;> - -<!ELEMENT organization %text.model;> -<!ATTLIST organization %basic.atts;> - -<!ELEMENT address %text.model;> -<!ATTLIST address - %basic.atts; - %fixedspace.att;> - -<!ELEMENT contact %text.model;> -<!ATTLIST contact %basic.atts;> - -<!ELEMENT version %text.model;> -<!ATTLIST version %basic.atts;> - -<!ELEMENT revision %text.model;> -<!ATTLIST revision %basic.atts;> - -<!ELEMENT status %text.model;> -<!ATTLIST status %basic.atts;> - -<!ELEMENT date %text.model;> -<!ATTLIST date %basic.atts;> - -<!ELEMENT copyright %text.model;> -<!ATTLIST copyright %basic.atts;> - -<!-- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Decoration Elements -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ---> - -<!ELEMENT decoration (header?, footer?)> -<!ATTLIST decoration %basic.atts;> - -<!ELEMENT header (%body.elements;)+> -<!ATTLIST header %basic.atts;> - -<!ELEMENT footer (%body.elements;)+> -<!ATTLIST footer %basic.atts;> - -<!-- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Structural Elements -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ---> - -<!ELEMENT section (title, %structure.model;)> -<!ATTLIST section %basic.atts;> - -<!ELEMENT topic (title?, (%body.elements;)+)> -<!ATTLIST topic %basic.atts;> - -<!ELEMENT sidebar (title, subtitle?, (%body.elements;)+)> -<!ATTLIST sidebar %basic.atts;> - -<!ELEMENT transition EMPTY> -<!ATTLIST transition %basic.atts;> - -<!-- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Body Elements -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ---> - -<!ELEMENT paragraph %text.model;> -<!ATTLIST paragraph %basic.atts;> - -<!ELEMENT bullet_list (list_item+)> -<!ATTLIST bullet_list - %basic.atts; - bullet CDATA #IMPLIED> - -<!ELEMENT enumerated_list (list_item+)> -<!ATTLIST enumerated_list - %basic.atts; - enumtype (arabic | loweralpha | upperalpha - | lowerroman | upperroman) - #IMPLIED - prefix CDATA #IMPLIED - suffix CDATA #IMPLIED - start %number; #IMPLIED> - -<!ELEMENT list_item (%body.elements;)+> -<!ATTLIST list_item %basic.atts;> - -<!ELEMENT definition_list (definition_list_item+)> -<!ATTLIST definition_list %basic.atts;> - -<!ELEMENT definition_list_item (term, classifier?, definition)> -<!ATTLIST definition_list_item %basic.atts;> - -<!ELEMENT term %text.model;> -<!ATTLIST term %basic.atts;> - -<!ELEMENT classifier %text.model;> -<!ATTLIST classifier %basic.atts;> - -<!ELEMENT definition (%body.elements;)+> -<!ATTLIST definition %basic.atts;> - -<!ELEMENT field_list (field+)> -<!ATTLIST field_list %basic.atts;> - -<!ELEMENT field (field_name, field_body)> -<!ATTLIST field %basic.atts;> - -<!ELEMENT field_name (#PCDATA)> -<!ATTLIST field_name %basic.atts;> - -<!-- May be empty. --> -<!ELEMENT field_body (%body.elements;)*> -<!ATTLIST field_body %basic.atts;> - -<!ELEMENT option_list (option_list_item+)> -<!ATTLIST option_list %basic.atts;> - -<!ELEMENT option_list_item (option_group, description)> -<!ATTLIST option_list_item %basic.atts;> - -<!ELEMENT option_group (option+)> -<!ATTLIST option_group %basic.atts;> - -<!ELEMENT option (option_string, option_argument*)> -<!ATTLIST option %basic.atts;> - -<!ELEMENT option_string (#PCDATA)> -<!ATTLIST option_string %basic.atts;> - -<!-- -`delimiter` contains the text preceding the `option_argument`: either -the text separating it from the `option_string` (typically either "=" -or " ") or the text between option arguments (typically either "," or -" "). ---> -<!ELEMENT option_argument (#PCDATA)> -<!ATTLIST option_argument - %basic.atts; - delimiter CDATA #IMPLIED> - -<!ELEMENT description (%body.elements;)+> -<!ATTLIST description %basic.atts;> - -<!ELEMENT literal_block %text.model;> -<!ATTLIST literal_block - %basic.atts; - %fixedspace.att;> - -<!ELEMENT line_block %text.model;> -<!ATTLIST line_block - %basic.atts; - %fixedspace.att;> - -<!ELEMENT block_quote ((%body.elements;)+, attribution?)> -<!ATTLIST block_quote %basic.atts;> - -<!ELEMENT attribution %text.model;> -<!ATTLIST attribution %basic.atts;> - -<!ELEMENT doctest_block %text.model;> -<!ATTLIST doctest_block - %basic.atts; - %fixedspace.att;> - -<!ELEMENT attention (%body.elements;)+> -<!ATTLIST attention %basic.atts;> - -<!ELEMENT caution (%body.elements;)+> -<!ATTLIST caution %basic.atts;> - -<!ELEMENT danger (%body.elements;)+> -<!ATTLIST danger %basic.atts;> - -<!ELEMENT error (%body.elements;)+> -<!ATTLIST error %basic.atts;> - -<!ELEMENT hint (%body.elements;)+> -<!ATTLIST hint %basic.atts;> - -<!ELEMENT important (%body.elements;)+> -<!ATTLIST important %basic.atts;> - -<!ELEMENT note (%body.elements;)+> -<!ATTLIST note %basic.atts;> - -<!ELEMENT tip (%body.elements;)+> -<!ATTLIST tip %basic.atts;> - -<!ELEMENT warning (%body.elements;)+> -<!ATTLIST warning %basic.atts;> - -<!ELEMENT admonition (title, (%body.elements;)+)> -<!ATTLIST admonition %basic.atts;> - -<!ELEMENT footnote (label?, (%body.elements;)+)> -<!ATTLIST footnote - %basic.atts; - %backrefs.att; - %auto.att;> - -<!ELEMENT citation (label, (%body.elements;)+)> -<!ATTLIST citation - %basic.atts; - %backrefs.att;> - -<!ELEMENT label (#PCDATA)> -<!ATTLIST label %basic.atts;> - -<!ELEMENT rubric %text.model;> -<!ATTLIST rubric %basic.atts;> - -<!-- Empty except when used as an inline element. --> -<!ELEMENT target %text.model;> -<!ATTLIST target - %basic.atts; - %reference.atts; - %anonymous.att;> - -<!ELEMENT substitution_definition %text.model;> -<!ATTLIST substitution_definition %basic.atts;> - -<!ELEMENT comment (#PCDATA)> -<!ATTLIST comment - %basic.atts; - %fixedspace.att;> - -<!ELEMENT pending EMPTY> -<!ATTLIST pending %basic.atts;> - -<!ELEMENT figure (image, ((caption, legend?) | legend)) > -<!ATTLIST figure - %basic.atts; - width %number; #IMPLIED> - -<!-- Also an inline element. --> -<!ELEMENT image EMPTY> -<!ATTLIST image - %basic.atts; - uri CDATA #REQUIRED - alt CDATA #IMPLIED - height %number; #IMPLIED - width %number; #IMPLIED - scale %number; #IMPLIED> - -<!ELEMENT caption %text.model;> -<!ATTLIST caption %basic.atts;> - -<!ELEMENT legend (%body.elements;)+> -<!ATTLIST legend %basic.atts;> - -<!-- -Table elements: table, tgroup, colspec, thead, tbody, row, entry. ---> -%calstblx; - -<!-- Used to record processing information. --> -<!ELEMENT system_message (%body.elements;)+> -<!ATTLIST system_message - %basic.atts; - %backrefs.att; - level %number; #IMPLIED - line %number; #IMPLIED - type NMTOKEN #IMPLIED> - -<!-- Used to pass raw data through the system. Also inline. --> -<!ELEMENT raw %text.model;> -<!ATTLIST raw - %basic.atts; - %fixedspace.att; - format NMTOKEN #IMPLIED> - -<!-- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Inline Elements -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Inline elements occur within the text contents of body elements. Some -nesting of inline elements is allowed by these definitions, with the -following caveats: - -- An inline element may not contain a nested element of the same type - (e.g. <strong> may not contain another <strong>). -- Nested inline elements may or may not be supported by individual - applications using this DTD. -- The inline elements <footnote_reference>, <citation_reference>, - <literal>, and <image> do not support nesting. ---> - -<!ELEMENT emphasis %text.model;> -<!ATTLIST emphasis %basic.atts;> - -<!ELEMENT strong %text.model;> -<!ATTLIST strong %basic.atts;> - -<!ELEMENT literal (#PCDATA)> -<!ATTLIST literal %basic.atts;> - -<!ELEMENT reference %text.model;> -<!ATTLIST reference - %basic.atts; - %reference.atts; - %anonymous.att;> - -<!ELEMENT footnote_reference (#PCDATA)> -<!ATTLIST footnote_reference - %basic.atts; - %refid.att; - %refname.att; - %auto.att;> - -<!ELEMENT citation_reference (#PCDATA)> -<!ATTLIST citation_reference - %basic.atts; - %refid.att; - %refname.att;> - -<!ELEMENT substitution_reference %text.model;> -<!ATTLIST substitution_reference - %basic.atts; - %refname.att;> - -<!ELEMENT title_reference %text.model;> -<!ATTLIST title_reference %basic.atts;> - -<!ELEMENT abbreviation %text.model;> -<!ATTLIST abbreviation %basic.atts;> - -<!ELEMENT acronym %text.model;> -<!ATTLIST acronym %basic.atts;> - -<!ELEMENT superscript %text.model;> -<!ATTLIST superscript %basic.atts;> - -<!ELEMENT subscript %text.model;> -<!ATTLIST subscript %basic.atts;> - -<!ELEMENT inline %text.model;> -<!ATTLIST inline %basic.atts;> - -<!ELEMENT problematic %text.model;> -<!ATTLIST problematic - %basic.atts; - %refid.att;> - -<!ELEMENT generated %text.model;> -<!ATTLIST generated %basic.atts;> - -<!-- -Local Variables: -mode: sgml -indent-tabs-mode: nil -fill-column: 70 -End: ---> diff --git a/docutils/docs/ref/rst/directives.txt b/docutils/docs/ref/rst/directives.txt deleted file mode 100644 index 5fc316a99..000000000 --- a/docutils/docs/ref/rst/directives.txt +++ /dev/null @@ -1,979 +0,0 @@ -============================= - reStructuredText Directives -============================= -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This document has been placed in the public domain. - -.. contents:: - -This document describes the directives implemented in the reference -reStructuredText parser. - -Directives have the following syntax:: - - +-------+-------------------------------+ - | ".. " | directive type "::" directive | - +-------+ block | - | | - +-------------------------------+ - -Directives begin with an explicit markup start (two periods and a -space), followed by the directive type and two colons (collectively, -the "directive marker"). The directive block begins immediately after -the directive marker, and includes all subsequent indented lines. The -directive block is divided into arguments, options (a field list), and -content (in that order), any of which may appear. See the Directives_ -section in the `reStructuredText Markup Specification`_ for syntax -details. - -Descriptions below list "doctree elements" (document tree element -names; XML DTD generic identifiers) corresponding to individual -directives. For details on the hierarchy of elements, please see `The -Docutils Document Tree`_ and the `Docutils Generic DTD`_ XML document -type definition. - -.. _Directives: ./reStructuredText.html#directives -.. _reStructuredText Markup Specification: ./reStructuredText.html -.. _The Docutils Document Tree: ../doctree.html -.. _Docutils Generic DTD: ../gpdi.dtd - - -------------- - Admonitions -------------- - -.. _attention: -.. _caution: -.. _danger: -.. _error: -.. _hint: -.. _important: -.. _note: -.. _tip: -.. _warning: - -Specific Admonitions -==================== - -:Directive Types: "attention", "caution", "danger", "error", "hint", - "important", "note", "tip", "warning", "admonition" -:Doctree Elements: attention, caution, danger, error, hint, important, - note, tip, warning, admonition, title -:Directive Arguments: None. -:Directive Options: None. -:Directive Content: Interpreted as body elements. - -Admonitions are specially marked "topics" that can appear anywhere an -ordinary body element can. They contain arbitrary body elements. -Typically, an admonition is rendered as an offset block in a document, -sometimes outlined or shaded, with a title matching the admonition -type. For example:: - - .. DANGER:: - Beware killer rabbits! - -This directive might be rendered something like this:: - - +------------------------+ - | !DANGER! | - | | - | Beware killer rabbits! | - +------------------------+ - -The following admonition directives have been implemented: - -- attention -- caution -- danger -- error -- hint -- important -- note -- tip -- warning - -Any text immediately following the directive indicator (on the same -line and/or indented on following lines) is interpreted as a directive -block and is parsed for normal body elements. For example, the -following "note" admonition directive contains one paragraph and a -bullet list consisting of two list items:: - - .. note:: This is a note admonition. - This is the second line of the first paragraph. - - - The note contains all indented body elements - following. - - It includes this bullet list. - - -.. _admonition: - -Generic Admonition -================== - -:Directive Type: "admonition" -:Doctree Elements: admonition, title -:Directive Arguments: One, required (admonition title) -:Directive Options: Possible. -:Directive Content: Interpreted as body elements. - -This is a generic, titled admonition. The title may be anything the -author desires. - -The author-supplied title is also used as a "class" attribute value -after being converted into a valid identifier form (down-cased; -non-alphanumeric characters converted to single hyphens; "admonition-" -prefixed). For example, this admonition:: - - .. admonition:: And, by the way... - - You can make up your own admonition too. - -becomes the following document tree (pseudo-XML):: - - <document source="test data"> - <admonition class="admonition-and-by-the-way"> - <title> - And, by the way... - <paragraph> - You can make up your own admonition too. - -The following option is recognized: - -``class`` : text - Override the computed "class" attribute value. See the class_ - directive below. - - --------- - Images --------- - -There are two image directives: "image" and "figure". - - -Image -===== - -:Directive Type: "image" -:Doctree Element: image -:Directive Arguments: One, required (image URI). -:Directive Options: Possible. -:Directive Content: None. - -An "image" is a simple picture:: - - .. image:: picture.png - -The URI for the image source file is specified in the directive -argument. As with hyperlink targets, the image URI may begin on the -same line as the explicit markup start and target name, or it may -begin in an indented text block immediately following, with no -intervening blank lines. If there are multiple lines in the link -block, they are stripped of leading and trailing whitespace and joined -together. - -Optionally, the image link block may contain a flat field list, the -_`image options`. For example:: - - .. image:: picture.jpeg - :height: 100 - :width: 200 - :scale: 50 - :alt: alternate text - :align: right - -The following options are recognized: - -``alt`` : text - Alternate text: a short description of the image, displayed by - applications that cannot display images, or spoken by applications - for visually impaired users. - -``height`` : integer - The height of the image in pixels, used to reserve space or scale - the image vertically. - -``width`` : integer - The width of the image in pixels, used to reserve space or scale - the image horizontally. - -``scale`` : integer - The uniform scaling factor of the image, a percentage (but no "%" - symbol is required or allowed). "100" means full-size. - -``align`` : "top", "middle", "bottom", "left", "center", or "right" - The alignment of the image, equivalent to the HTML ``<img>`` tag's - "align" attribute. The values "top", "middle", and "bottom" - control an image's vertical alignment (relative to the text - baseline); they are only useful for inline images (substitutions). - The values "left", "center", and "right" control an image's - horizontal alignment, allowing the image to float and have the - text flow around it. The specific behavior depends upon the - browser or rendering software used. - -``class`` : text - Set a "class" attribute value on the image element. See the - class_ directive below. - - -Figure -====== - -:Directive Type: "figure" -:Doctree Elements: figure, image, caption, legend -:Directive Arguments: One, required (image URI). -:Directive Options: Possible. -:Directive Content: Interpreted as the figure caption and an optional - legend. - -A "figure" consists of image_ data (including `image options`_), an -optional caption (a single paragraph), and an optional legend -(arbitrary body elements):: - - .. figure:: picture.png - :scale: 50 - :alt: map to buried treasure - - This is the caption of the figure (a simple paragraph). - - The legend consists of all elements after the caption. In this - case, the legend consists of this paragraph and the following - table: - - +-----------------------+-----------------------+ - | Symbol | Meaning | - +=======================+=======================+ - | .. image:: tent.png | Campground | - +-----------------------+-----------------------+ - | .. image:: waves.png | Lake | - +-----------------------+-----------------------+ - | .. image:: peak.png | Mountain | - +-----------------------+-----------------------+ - -There must be blank lines before the caption paragraph and before the -legend. To specify a legend without a caption, use an empty comment -("..") in place of the caption. - -The "figure" directive supports all of the options of the "image" -directive (see `image options`_ above). In addition, the following -options are recognized: - -``figwidth`` : integer or "image" - The width of the figure in pixels, to limit the horizontal space - used. A special value of "image" is allowed, in which case the - included image's actual width is used (requires PIL_ [#]_). If the - image file is not found or the required software is unavailable, - this option is ignored. - - Sets the "width" attribute of the "figure" doctree element. - - This option does not scale the included image; use the "width" - `image`_ option for that. :: - - +---------------------------+ - | figure | - | | - |<------ figwidth --------->| - | | - | +---------------------+ | - | | image | | - | | | | - | |<--- width --------->| | - | +---------------------+ | - | | - |The figure's caption should| - |wrap at this width. | - +---------------------------+ - -``figclass`` : text - Set a "class" attribute value on the figure element. See the - class_ directive below. - -.. [#] `Python Imaging Library`_. - -.. _PIL: -.. _Python Imaging Library: http://www.pythonware.com/products/pil/ - - ---------------- - Body Elements ---------------- - -Topic -===== - -:Directive Type: "topic" -:Doctree Element: topic -:Directive Arguments: 1, required (topic title). -:Directive Options: Possible. -:Directive Content: Interpreted as the topic body. - -A topic is like a block quote with a title, or a self-contained -section with no subsections. Use the "topic" directive to indicate a -self-contained idea that is separate from the flow of the document. -Topics may occur anywhere a section or transition may occur. Body -elements (including topics) may not contain nested topics. - -The directive's sole argument is interpreted as the topic title; the -next line must be blank. All subsequent lines make up the topic body, -interpreted as body elements. For example:: - - .. topic:: Topic Title - - Subsequent indented lines comprise - the body of the topic, and are - interpreted as body elements. - -The following option is recognized: - -``class`` : text - Set a "class" attribute value on the topic element. See the - class_ directive below. - - -Sidebar -======= - -:Directive Type: "sidebar" -:Doctree Element: sidebar -:Directive Arguments: One, required (sidebar title). -:Directive Options: Possible. -:Directive Content: Interpreted as the sidebar body. - -Sidebars are like miniature, parallel documents that occur inside -other documents, providing related or reference material. A sidebar -is typically offset by a border and "floats" to the side of the page; -the document's main text may flow around it. Sidebars can also be -likened to super-footnotes; their content is outside of the flow of -the document's main text. - -Sidebars may occur anywhere a section or transition may occur. Body -elements (including sidebars) may not contain nested sidebars. - -The directive's sole argument is interpreted as the sidebar title, -which may be followed by a subtitle option (see below); the next line -must be blank. All subsequent lines make up the sidebar body, -interpreted as body elements. For example:: - - .. sidebar:: Sidebar Title - :subtitle: Optional Sidebar Subtitle - - Subsequent indented lines comprise - the body of the sidebar, and are - interpreted as body elements. - -The following options are recognized: - -``subtitle`` : text - The sidebar's subtitle. - -``class`` : text - Set a "class" attribute value on the sidebar element. See the - class_ directive below. - - -Line Block -========== - -:Directive Type: "line-block" -:Doctree Element: line_block -:Directive Arguments: None. -:Directive Options: Possible. -:Directive Content: Becomes the body of the line block. - -The "line-block" directive constructs an element where whitespace -(including linebreaks) is significant and inline markup is supported. -It is equivalent to a `parsed literal block`_ with different -rendering: typically in an ordinary serif typeface instead of a -typewriter/monospaced face, and not automatically indented. (Have the -line-block directive begin a block quote to get an indented line -block.) Line blocks are useful for address blocks and verse (poetry, -song lyrics), where the structure of lines is significant. For -example, here's a classic:: - - "To Ma Own Beloved Lassie: A Poem on her 17th Birthday", by - Ewan McTeagle (for Lassie O'Shea): - - .. line-block:: - - Lend us a couple of bob till Thursday. - I'm absolutely skint. - But I'm expecting a postal order and I can pay you back - as soon as it comes. - Love, Ewan. - -The following option is recognized: - -``class`` : text - Set a "class" attribute value on the line_block element. See the - class_ directive below. - - -.. _parsed-literal: - -Parsed Literal Block -==================== - -:Directive Type: "parsed-literal" -:Doctree Element: literal_block -:Directive Arguments: None. -:Directive Options: Possible. -:Directive Content: Becomes the body of the literal block. - -Unlike an ordinary literal block, the "parsed-literal" directive -constructs a literal block where the text is parsed for inline markup. -It is equivalent to a `line block`_ with different rendering: -typically in a typewriter/monospaced typeface, like an ordinary -literal block. Parsed literal blocks are useful for adding hyperlinks -to code examples. However, care must be taken with the text, because -inline markup is recognized; there is no protection from parsing. -Backslash-escapes may be necessary in places. - -For example, all the element names in this content model are links:: - - .. parsed-literal:: - - ((title_, - subtitle_?)?, - docinfo_?, - decoration_?, - `%structure.model;`_) - -The following option is recognized: - -``class`` : text - Set a "class" attribute value on the literal_block element. See - the class_ directive below. - - -Rubric -====== - -:Directive Type: "rubric" -:Doctree Element: rubric -:Directive Arguments: 1, required (rubric text). -:Directive Options: Possible. -:Directive Content: None. - - rubric n. 1. a title, heading, or the like, in a manuscript, - book, statute, etc., written or printed in red or otherwise - distinguished from the rest of the text. ... - - -- Random House Webster's College Dictionary, 1991 - -The "rubric" directive inserts a "rubric" element into the document -tree. A rubric is like an informal heading that doesn't correspond to -the document's structure. - -The following option is recognized: - -``class`` : text - Set a "class" attribute value on the rubric element. See the - class_ directive below. - - -Epigraph -======== - -:Directive Type: "epigraph" -:Doctree Element: block_quote -:Directive Arguments: None. -:Directive Options: None. -:Directive Content: Interpreted as the body of the block quote. - -Produces an epigraph-class block quote. For example, this input:: - - .. epigraph:: - - No matter where you go, there you are. - - -- Buckaroo Banzai - -becomes this document tree fragment:: - - <block_quote class="epigraph"> - <paragraph> - No matter where you go, there you are. - <attribution> - Buckaroo Banzai - - -Highlights -========== - -:Directive Type: "highlights" -:Doctree Element: block_quote -:Directive Arguments: None. -:Directive Options: None. -:Directive Content: Interpreted as the body of the block quote. - -Produces a highlights-class block quote. See Epigraph_ above. - - -Pull-Quote -========== - -:Directive Type: "pull-quote" -:Doctree Element: block_quote -:Directive Arguments: None. -:Directive Options: None. -:Directive Content: Interpreted as the body of the block quote. - -Produces a pull-quote-class block quote. See Epigraph_ above. - - ----------------- - Document Parts ----------------- - -.. _contents: - -Table of Contents -================= - -:Directive Type: "contents" -:Doctree Elements: pending, topic -:Directive Arguments: One, optional: title. -:Directive Options: Possible. -:Directive Content: None. - -The "contents" directive inserts a table of contents (TOC) in two -passes: initial parse and transform. During the initial parse, a -"pending" element is generated which acts as a placeholder, storing -the TOC title and any options internally. At a later stage in the -processing, the "pending" element is replaced by a "topic" element, a -title and the table of contents proper. - -The directive in its simplest form:: - - .. contents:: - -Language-dependent boilerplate text will be used for the title. The -English default title text is "Contents". - -An explicit title, may be specified:: - - .. contents:: Table of Contents - -The title may span lines, although it is not recommended:: - - .. contents:: Here's a very long Table of - Contents title - -Options may be specified for the directive, using a field list:: - - .. contents:: Table of Contents - :depth: 2 - -If the default title is to be used, the options field list may begin -on the same line as the directive marker:: - - .. contents:: :depth: 2 - -The following options are recognized: - -``depth`` : integer - The number of section levels that are collected in the table of - contents. The default is unlimited depth. - -``local`` : flag (empty) - Generate a local table of contents. Entries will only include - subsections of the section in which the directive is given. If no - explicit title is given, the table of contents will not be titled. - -``backlinks`` : "entry" or "top" or "none" - Generate links from section headers back to the table of contents - entries, the table of contents itself, or generate no backlinks. - -``class`` : text - Set a "class" attribute value on the topic element. See the - class_ directive below. - - -.. _sectnum: -.. _section-autonumbering: - -Automatic Section Numbering -=========================== - -:Directive Type: "sectnum" or "section-autonumbering" (synonyms) -:Doctree Elements: pending, generated -:Directive Arguments: None. -:Directive Options: Possible. -:Directive Content: None. - -The "sectnum" (or "section-autonumbering") directive automatically -numbers sections and subsections in a document. Section numbers are -of the "multiple enumeration" form, where each level has a number, -separated by periods. For example, the title of section 1, subsection -2, subsubsection 3 would have "1.2.3" prefixed. - -The "sectnum" directive does its work in two passes: the initial parse -and a transform. During the initial parse, a "pending" element is -generated which acts as a placeholder, storing any options internally. -At a later stage in the processing, the "pending" element triggers a -transform, which adds section numbers to titles. Section numbers are -enclosed in a "generated" element, and titles have their "auto" -attribute set to "1". - -The following options are recognized: - -``depth`` : integer - The number of section levels that are numbered by this directive. - The default is unlimited depth. - - ------------- - References ------------- - -.. _target-notes: - -Target Footnotes -================ - -:Directive Type: "target-notes" -:Doctree Elements: pending, footnote, footnote_reference -:Directive Arguments: None. -:Directive Options: None. -:Directive Content: None. - -The "target-notes" directive creates a footnote for each external -target in the text, and corresponding footnote references after each -reference. For every explicit target (of the form, ``.. _target name: -URL``) in the text, a footnote will be generated containing the -visible URL as content. - - -Footnotes -========= - -**NOT IMPLEMENTED YET** - -:Directive Type: "footnotes" -:Doctree Elements: pending, topic -:Directive Arguments: None? -:Directive Options: Possible? -:Directive Content: None. - -@@@ - - -Citations -========= - -**NOT IMPLEMENTED YET** - -:Directive Type: "citations" -:Doctree Elements: pending, topic -:Directive Arguments: None? -:Directive Options: Possible? -:Directive Content: None. - -@@@ - - ---------------- - HTML-Specific ---------------- - -Meta -==== - -:Directive Type: "meta" -:Doctree Element: meta (non-standard) -:Directive Arguments: None. -:Directive Options: None. -:Directive Content: Must contain a flat field list. - -The "meta" directive is used to specify HTML metadata stored in HTML -META tags. "Metadata" is data about data, in this case data about web -pages. Metadata is used to describe and classify web pages in the -World Wide Web, in a form that is easy for search engines to extract -and collate. - -Within the directive block, a flat field list provides the syntax for -metadata. The field name becomes the contents of the "name" attribute -of the META tag, and the field body (interpreted as a single string -without inline markup) becomes the contents of the "content" -attribute. For example:: - - .. meta:: - :description: The reStructuredText plaintext markup language - :keywords: plaintext, markup language - -This would be converted to the following HTML:: - - <meta name="description" - content="The reStructuredText plaintext markup language"> - <meta name="keywords" content="plaintext, markup language"> - -Support for other META attributes ("http-equiv", "scheme", "lang", -"dir") are provided through field arguments, which must be of the form -"attr=value":: - - .. meta:: - :description lang=en: An amusing story - :description lang=fr: Un histoire amusant - -And their HTML equivalents:: - - <meta name="description" lang="en" content="An amusing story"> - <meta name="description" lang="fr" content="Un histoire amusant"> - -Some META tags use an "http-equiv" attribute instead of the "name" -attribute. To specify "http-equiv" META tags, simply omit the name:: - - .. meta:: - :http-equiv=Content-Type: text/html; charset=ISO-8859-1 - -HTML equivalent:: - - <meta http-equiv="Content-Type" - content="text/html; charset=ISO-8859-1"> - - -Imagemap -======== - -**NOT IMPLEMENTED YET** - -Non-standard element: imagemap. - - ---------------- - Miscellaneous ---------------- - -.. _include: - -Including an External Document Fragment -======================================= - -:Directive Type: "include" -:Doctree Elements: depend on data being included -:Directive Arguments: One, required (path to include file). -:Directive Options: Possible. -:Directive Content: None. - -The "include" directive reads a reStructuredText-formatted text file -and parses it in the current document's context at the point of the -directive. For example:: - - This first example will be parsed at the document level, and can - thus contain any construct, including section headers. - - .. include:: inclusion.txt - - Back in the main document. - - This second example will be parsed in a block quote context. - Therefore it may only contain body elements. It may not - contain section headers. - - .. include:: inclusion.txt - -If an included document fragment contains section structure, the title -adornments must match those of the master document. - -The text encoding of the master input source is used for included -files. - -The following options are recognized: - -``literal`` : flag (empty) - The entire included text is inserted into the document as a single - literal block (useful for program listings). - - -.. _raw: - -Raw Data Pass-Through -===================== - -:Directive Type: "raw" -:Doctree Element: raw -:Directive Arguments: One, required (output format type). -:Directive Options: Possible. -:Directive Content: Stored verbatim, uninterpreted. None (empty) if a - "file" or "url" option given. - -The "raw" directive indicates non-reStructuredText data that is to be -passed untouched to the Writer. The name of the output format is -given in the first argument. The interpretation of the raw data is up -to the Writer. A Writer may ignore any raw output not matching its -format. - -For example, the following input would be passed untouched by an HTML -Writer:: - - .. raw:: html - - <hr width=50 size=10> - -A LaTeX Writer could insert the following raw content into its -output stream:: - - .. raw:: latex - - \documentclass[twocolumn]{article} - -Raw data can also be read from an external file, specified in a -directive option. In this case, the content block must be empty. For -example:: - - .. raw:: html - :file: inclusion.html - -The following options are recognized: - -``file`` : string - The local filesystem path of a raw data file to be included. -``url`` : string - An Internet URL reference to a raw data file to be included. - - -.. _replace: - -Replacement Text -================ - -:Directive Type: "replace" -:Doctree Element: Text & inline elements -:Directive Arguments: None. -:Directive Options: None. -:Directive Content: A single paragraph; may contain inline markup. - -The "replace" directive is used to indicate replacement text for a -substitution reference. It may be used within substitution -definitions only. For example, this directive can be used to expand -abbreviations:: - - .. |reST| replace:: reStructuredText - - Yes, |reST| is a long word, so I can't blame anyone for wanting to - abbreviate it. - -As reStructuredText doesn't support nested inline markup, the only way -to create a reference with styled text is to use substitutions with -the "replace" directive:: - - I recommend you try |Python|_. - - .. |Python| replace:: Python, *the* best language around - .. _Python: http://www.python.org/ - - -.. _unicode: - -Unicode Character Codes -======================= - -:Directive Type: "unicode" -:Doctree Element: Text -:Directive Arguments: One or more, required (Unicode character codes, - optional text, and comments). -:Directive Options: None. -:Directive Content: None. - -The "unicode" directive converts Unicode character codes (numerical -values) to characters, and may be used in substitution definitions -only. Codes may be decimal numbers, hexadecimal numbers (prefixed by -``0x``, ``x``, ``\x``, ``u``, or ``\u``), or XML-style numeric -character entities (e.g. ``ᨫ``). Codes are case-insensitive. - -Text following " .. " is a comment and is ignored. Spaces are -ignored, and any other text remains as-is. - -Example:: - - Copyright |copy| 2003, |BogusMegaCorp (TM)|. - - .. |copy| unicode:: 0xA9 .. copyright sign - .. |BogusMegaCorp (TM)| unicode:: BogusMegaCorp U+2122 - .. with trademark sign - - -Class -===== - -:Directive Type: "class" -:Doctree Element: pending -:Directive Arguments: One, required (class name / attribute value). -:Directive Options: None. -:Directive Content: None. - -The "class" directive sets a "class" attribute value on the first -immediately following non-comment element [#]_. For details of the -"class" attribute, see `its entry`__ in `The Docutils Document Tree`_. -The "class" attribute value is converted to lowercase and all -non-alphanumeric characters are converted to hyphens in order to match -this regular expression: ``[a-z](-?[a-z0-9]+)*``. See the docstring -from ``docutils.nodes.make_id`` for the rationale. - -Examples:: - - .. class:: special - - This is a "special" paragraph. - - .. class:: exceptional - - An Exceptional Section - ====================== - - This is an ordinary paragraph. - -The text above is parsed and transformed into this doctree fragment:: - - <paragraph class="special"> - This is a "special" paragraph. - <section class="exceptional"> - <title> - An Exceptional Section - <paragraph> - This is an ordinary paragraph. - -.. [#] To set a "class" attribute value on a block quote, the "class" - directive must be followed by an empty comment:: - - .. class:: highlights - .. - - Block quote text. - - The directive doesn't allow content, therefore an empty comment is - required to terminate the directive. Without the empty comment, - the block quote text would be interpreted as the "class" - directive's content, and the parser would complain. - -__ ../doctree.html#class - - -Restructuredtext-Test-Directive -=============================== - -:Directive Type: "restructuredtext-test-directive" -:Doctree Element: system_warning -:Directive Arguments: None. -:Directive Options: None. -:Directive Content: Interpreted as a literal block. - -This directive is provided for test purposes only. (Nobody is -expected to type in a name *that* long!) It is converted into a -level-1 (info) system message showing the directive data, possibly -followed by a literal block containing the rest of the directive -block. - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: diff --git a/docutils/docs/ref/rst/introduction.txt b/docutils/docs/ref/rst/introduction.txt deleted file mode 100644 index 13823b5b7..000000000 --- a/docutils/docs/ref/rst/introduction.txt +++ /dev/null @@ -1,315 +0,0 @@ -===================================== - An Introduction to reStructuredText -===================================== -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This document has been placed in the public domain. - -reStructuredText_ is an easy-to-read, what-you-see-is-what-you-get -plaintext markup syntax and parser system. It is useful for inline -program documentation (such as Python docstrings), for quickly -creating simple web pages, and for standalone documents. -reStructuredText_ is a proposed revision and reinterpretation of the -StructuredText_ and Setext_ lightweight markup systems. - -reStructuredText is designed for extensibility for specific -application domains. Its parser is a component of Docutils_. - -This document defines the goals_ of reStructuredText and provides a -history_ of the project. It is written using the reStructuredText -markup, and therefore serves as an example of its use. For a gentle -introduction to using reStructuredText, please read `A -ReStructuredText Primer`_. The `Quick reStructuredText`_ user -reference is also useful. The `reStructuredText Markup -Specification`_ is the definitive reference. There is also an -analysis of the `Problems With StructuredText`_. - -ReStructuredText's web page is -http://docutils.sourceforge.net/rst.html. - -.. _reStructuredText: http://docutils.sourceforge.net/rst.html -.. _StructuredText: - http://dev.zope.org/Members/jim/StructuredTextWiki/FrontPage -.. _Setext: http://docutils.sourceforge.net/mirror/setext.html -.. _Docutils: http://docutils.sourceforge.net/ -.. _A ReStructuredText Primer: ../../docs/rst/quickstart.html -.. _Quick reStructuredText: ../../docs/rst/quickref.html -.. _reStructuredText Markup Specification: reStructuredText.html -.. _Problems with StructuredText: problems.html - - -Goals -===== - -The primary goal of reStructuredText_ is to define a markup syntax for -use in Python docstrings and other documentation domains, that is -readable and simple, yet powerful enough for non-trivial use. The -intended purpose of the reStructuredText markup is twofold: - -- the establishment of a set of standard conventions allowing the - expression of structure within plaintext, and - -- the conversion of such documents into useful structured data - formats. - -The secondary goal of reStructuredText is to be accepted by the Python -community (by way of being blessed by PythonLabs and the BDFL [#]_) as -a standard for Python inline documentation (possibly one of several -standards, to account for taste). - -.. [#] Python's creator and "Benevolent Dictator For Life", - Guido van Rossum. - -To clarify the primary goal, here are specific design goals, in order, -beginning with the most important: - -1. Readable. The marked-up text must be easy to read without any - prior knowledge of the markup language. It should be as easily - read in raw form as in processed form. - -2. Unobtrusive. The markup that is used should be as simple and - unobtrusive as possible. The simplicity of markup constructs - should be roughly proportional to their frequency of use. The most - common constructs, with natural and obvious markup, should be the - simplest and most unobtrusive. Less common constructs, for which - there is no natural or obvious markup, should be distinctive. - -3. Unambiguous. The rules for markup must not be open for - interpretation. For any given input, there should be one and only - one possible output (including error output). - -4. Unsurprising. Markup constructs should not cause unexpected output - upon processing. As a fallback, there must be a way to prevent - unwanted markup processing when a markup construct is used in a - non-markup context (for example, when documenting the markup syntax - itself). - -5. Intuitive. Markup should be as obvious and easily remembered as - possible, for the author as well as for the reader. Constructs - should take their cues from such naturally occurring sources as - plaintext email messages, newsgroup postings, and text - documentation such as README.txt files. - -6. Easy. It should be easy to mark up text using any ordinary text - editor. - -7. Scalable. The markup should be applicable regardless of the length - of the text. - -8. Powerful. The markup should provide enough constructs to produce a - reasonably rich structured document. - -9. Language-neutral. The markup should apply to multiple natural (as - well as artificial) languages, not only English. - -10. Extensible. The markup should provide a simple syntax and - interface for adding more complex general markup, and custom - markup. - -11. Output-format-neutral. The markup will be appropriate for - processing to multiple output formats, and will not be biased - toward any particular format. - -The design goals above were used as criteria for accepting or -rejecting syntax, or selecting between alternatives. - -It is emphatically *not* the goal of reStructuredText to define -docstring semantics, such as docstring contents or docstring length. -These issues are orthogonal to the markup syntax and beyond the scope -of this specification. - -Also, it is not the goal of reStructuredText to maintain compatibility -with StructuredText_ or Setext_. reStructuredText shamelessly steals -their great ideas and ignores the not-so-great. - -Author's note: - - Due to the nature of the problem we're trying to solve (or, - perhaps, due to the nature of the proposed solution), the above - goals unavoidably conflict. I have tried to extract and distill - the wisdom accumulated over the years in the Python Doc-SIG_ - mailing list and elsewhere, to come up with a coherent and - consistent set of syntax rules, and the above goals by which to - measure them. - - There will inevitably be people who disagree with my particular - choices. Some desire finer control over their markup, others - prefer less. Some are concerned with very short docstrings, - others with full-length documents. This specification is an - effort to provide a reasonably rich set of markup constructs in a - reasonably simple form, that should satisfy a reasonably large - group of reasonable people. - - David Goodger (goodger@users.sourceforge.net), 2001-04-20 - -.. _Doc-SIG: http://www.python.org/sigs/doc-sig/ - - -History -======= - -reStructuredText_, the specification, is based on StructuredText_ and -Setext_. StructuredText was developed by Jim Fulton of `Zope -Corporation`_ (formerly Digital Creations) and first released in 1996. -It is now released as a part of the open-source "Z Object Publishing -Environment" (ZOPE_). Ian Feldman's and Tony Sanders' earlier Setext_ -specification was either an influence on StructuredText or, by their -similarities, at least evidence of the correctness of this approach. - -I discovered StructuredText_ in late 1999 while searching for a way to -document the Python modules in one of my projects. Version 1.1 of -StructuredText was included in Daniel Larsson's pythondoc_. Although -I was not able to get pythondoc to work for me, I found StructuredText -to be almost ideal for my needs. I joined the Python Doc-SIG_ -(Documentation Special Interest Group) mailing list and found an -ongoing discussion of the shortcomings of the StructuredText -"standard". This discussion has been going on since the inception of -the mailing list in 1996, and possibly predates it. - -I decided to modify the original module with my own extensions and -some suggested by the Doc-SIG members. I soon realized that the -module was not written with extension in mind, so I embarked upon a -general reworking, including adapting it to the "re" regular -expression module (the original inspiration for the name of this -project). Soon after I completed the modifications, I discovered that -StructuredText.py was up to version 1.23 in the ZOPE distribution. -Implementing the new syntax extensions from version 1.23 proved to be -an exercise in frustration, as the complexity of the module had become -overwhelming. - -In 2000, development on StructuredTextNG_ ("Next Generation") began at -`Zope Corporation`_ (then Digital Creations). It seems to have many -improvements, but still suffers from many of the problems of classic -StructuredText. - -I decided that a complete rewrite was in order, and even started a -`reStructuredText SourceForge project`_ (now inactive). My -motivations (the "itches" I aim to "scratch") are as follows: - -- I need a standard format for inline documentation of the programs I - write. This inline documentation has to be convertible to other - useful formats, such as HTML. I believe many others have the same - need. - -- I believe in the Setext/StructuredText idea and want to help - formalize the standard. However, I feel the current specifications - and implementations have flaws that desperately need fixing. - -- reStructuredText could form part of the foundation for a - documentation extraction and processing system, greatly benefitting - Python. But it is only a part, not the whole. reStructuredText is - a markup language specification and a reference parser - implementation, but it does not aspire to be the entire system. I - don't want reStructuredText or a hypothetical Python documentation - processor to die stillborn because of over-ambition. - -- Most of all, I want to help ease the documentation chore, the bane - of many a programmer. - -Unfortunately I was sidetracked and stopped working on this project. -In November 2000 I made the time to enumerate the problems of -StructuredText and possible solutions, and complete the first draft of -a specification. This first draft was posted to the Doc-SIG in three -parts: - -- `A Plan for Structured Text`__ -- `Problems With StructuredText`__ -- `reStructuredText: Revised Structured Text Specification`__ - -__ http://mail.python.org/pipermail/doc-sig/2000-November/001239.html -__ http://mail.python.org/pipermail/doc-sig/2000-November/001240.html -__ http://mail.python.org/pipermail/doc-sig/2000-November/001241.html - -In March 2001 a flurry of activity on the Doc-SIG spurred me to -further revise and refine my specification, the result of which you -are now reading. An offshoot of the reStructuredText project has been -the realization that a single markup scheme, no matter how well -thought out, may not be enough. In order to tame the endless debates -on Doc-SIG, a flexible `Docstring Processing System framework`_ needed -to be constructed. This framework has become the more important of -the two projects; reStructuredText_ has found its place as one -possible choice for a single component of the larger framework. - -The project web site and the first project release were rolled out in -June 2001, including posting the second draft of the spec [#spec-2]_ -and the first draft of PEPs 256, 257, and 258 [#peps-1]_ to the -Doc-SIG. These documents and the project implementation proceeded to -evolve at a rapid pace. Implementation history details can be found -in the `project history file`_. - -In November 2001, the reStructuredText parser was nearing completion. -Development of the parser continued with the addition of small -convenience features, improvements to the syntax, the filling in of -gaps, and bug fixes. After a long holiday break, in early 2002 most -development moved over to the other Docutils components, the -"Readers", "Writers", and "Transforms". A "standalone" reader -(processes standalone text file documents) was completed in February, -and a basic HTML writer (producing HTML 4.01, using CSS-1) was -completed in early March. - -`PEP 287`_, "reStructuredText Standard Docstring Format", was created -to formally propose reStructuredText as a standard format for Python -docstrings, PEPs, and other files. It was first posted to -comp.lang.python_ and the Python-dev_ mailing list on 2002-04-02. - -Version 0.4 of the reStructuredText__ and `Docstring Processing -System`_ projects were released in April 2002. The two projects were -immediately merged, renamed to "Docutils_", and a 0.1 release soon -followed. - -.. __: `reStructuredText SourceForge project`_ - -.. [#spec-2] The second draft of the spec: - - - `An Introduction to reStructuredText`__ - - `Problems With StructuredText`__ - - `reStructuredText Markup Specification`__ - - `Python Extensions to the reStructuredText Markup - Specification`__ - - __ http://mail.python.org/pipermail/doc-sig/2001-June/001858.html - __ http://mail.python.org/pipermail/doc-sig/2001-June/001859.html - __ http://mail.python.org/pipermail/doc-sig/2001-June/001860.html - __ http://mail.python.org/pipermail/doc-sig/2001-June/001861.html - -.. [#peps-1] First drafts of the PEPs: - - - `PEP 256: Docstring Processing System Framework`__ - - `PEP 258: DPS Generic Implementation Details`__ - - `PEP 257: Docstring Conventions`__ - - Current working versions of the PEPs can be found in - http://docutils.sourceforge.net/spec/, and official versions can be - found in the `master PEP repository`_. - - __ http://mail.python.org/pipermail/doc-sig/2001-June/001855.html - __ http://mail.python.org/pipermail/doc-sig/2001-June/001856.html - __ http://mail.python.org/pipermail/doc-sig/2001-June/001857.html - - -.. _Zope Corporation: http://www.zope.com -.. _ZOPE: http://www.zope.org -.. _reStructuredText SourceForge project: - http://structuredtext.sourceforge.net/ -.. _pythondoc: http://starship.python.net/crew/danilo/pythondoc/ -.. _StructuredTextNG: - http://dev.zope.org/Members/jim/StructuredTextWiki/StructuredTextNG -.. _project history file: http://docutils.sourceforge.net/HISTORY.html -.. _PEP 287: http://docutils.sourceforge.net/spec/pep-0287.html -.. _Docstring Processing System framework: - http://docutils.sourceforge.net/spec/pep-0256.html -.. _comp.lang.python: news:comp.lang.python -.. _Python-dev: http://mail.python.org/pipermail/python-dev/ -.. _Docstring Processing System: http://docstring.sourceforge.net/ -.. _master PEP repository: http://www.python.org/peps/ - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: diff --git a/docutils/docs/ref/rst/restructuredtext.txt b/docutils/docs/ref/rst/restructuredtext.txt deleted file mode 100644 index 1ad25ff35..000000000 --- a/docutils/docs/ref/rst/restructuredtext.txt +++ /dev/null @@ -1,2679 +0,0 @@ -======================================= - reStructuredText Markup Specification -======================================= -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This document has been placed in the public domain. - -.. Note:: - - This document is a detailed technical specification; it is not a - tutorial or a primer. If this is your first exposure to - reStructuredText, please read `A ReStructuredText Primer`_ and the - `Quick reStructuredText`_ user reference first. - -.. _A ReStructuredText Primer: ../../docs/rst/quickstart.html -.. _Quick reStructuredText: ../../docs/rst/quickref.html - - -reStructuredText_ is plaintext that uses simple and intuitive -constructs to indicate the structure of a document. These constructs -are equally easy to read in raw and processed forms. This document is -itself an example of reStructuredText (raw, if you are reading the -text file, or processed, if you are reading an HTML document, for -example). The reStructuredText parser is a component of Docutils_. - -Simple, implicit markup is used to indicate special constructs, such -as section headings, bullet lists, and emphasis. The markup used is -as minimal and unobtrusive as possible. Less often-used constructs -and extensions to the basic reStructuredText syntax may have more -elaborate or explicit markup. - -reStructuredText is applicable to documents of any length, from the -very small (such as inline program documentation fragments, e.g. -Python docstrings) to the quite large (this document). - -The first section gives a quick overview of the syntax of the -reStructuredText markup by example. A complete specification is given -in the `Syntax Details`_ section. - -`Literal blocks`_ (in which no markup processing is done) are used for -examples throughout this document, to illustrate the plaintext markup. - - -.. contents:: - - ------------------------ - Quick Syntax Overview ------------------------ - -A reStructuredText document is made up of body or block-level -elements, and may be structured into sections. Sections_ are -indicated through title style (underlines & optional overlines). -Sections contain body elements and/or subsections. Some body elements -contain further elements, such as lists containing list items, which -in turn may contain paragraphs and other body elements. Others, such -as paragraphs, contain text and `inline markup`_ elements. - -Here are examples of `body elements`_: - -- Paragraphs_ (and `inline markup`_):: - - Paragraphs contain text and may contain inline markup: - *emphasis*, **strong emphasis**, `interpreted text`, ``inline - literals``, standalone hyperlinks (http://www.python.org), - external hyperlinks (Python_), internal cross-references - (example_), footnote references ([1]_), citation references - ([CIT2002]_), substitution references (|example|), and _`inline - internal targets`. - - Paragraphs are separated by blank lines and are left-aligned. - -- Five types of lists: - - 1. `Bullet lists`_:: - - - This is a bullet list. - - - Bullets can be "-", "*", or "+". - - 2. `Enumerated lists`_:: - - 1. This is an enumerated list. - - 2. Enumerators may be arabic numbers, letters, or roman - numerals. - - 3. `Definition lists`_:: - - what - Definition lists associate a term with a definition. - - how - The term is a one-line phrase, and the definition is one - or more paragraphs or body elements, indented relative to - the term. - - 4. `Field lists`_:: - - :what: Field lists map field names to field bodies, like - database records. They are often part of an extension - syntax. - - :how: The field marker is a colon, the field name, and a - colon. - - The field body may contain one or more body elements, - indented relative to the field marker. - - 5. `Option lists`_, for listing command-line options:: - - -a command-line option "a" - -b file options can have arguments - and long descriptions - --long options can be long also - --input=file long options can also have - arguments - /V DOS/VMS-style options too - - There must be at least two spaces between the option and the - description. - -- `Literal blocks`_:: - - Literal blocks are indented, and indicated with a double-colon - ("::") at the end of the preceding paragraph (right here -->):: - - if literal_block: - text = 'is left as-is' - spaces_and_linebreaks = 'are preserved' - markup_processing = None - -- `Block quotes`_:: - - Block quotes consist of indented body elements: - - This theory, that is mine, is mine. - - -- Anne Elk (Miss) - -- `Doctest blocks`_:: - - >>> print 'Python-specific usage examples; begun with ">>>"' - Python-specific usage examples; begun with ">>>" - >>> print '(cut and pasted from interactive Python sessions)' - (cut and pasted from interactive Python sessions) - -- Two syntaxes for tables_: - - 1. `Grid tables`_; complete, but complex and verbose:: - - +------------------------+------------+----------+ - | Header row, column 1 | Header 2 | Header 3 | - +========================+============+==========+ - | body row 1, column 1 | column 2 | column 3 | - +------------------------+------------+----------+ - | body row 2 | Cells may span | - +------------------------+-----------------------+ - - 2. `Simple tables`_; easy and compact, but limited:: - - ==================== ========== ========== - Header row, column 1 Header 2 Header 3 - ==================== ========== ========== - body row 1, column 1 column 2 column 3 - body row 2 Cells may span columns - ==================== ====================== - -- `Explicit markup blocks`_ all begin with an explicit block marker, - two periods and a space: - - - Footnotes_:: - - .. [1] A footnote contains body elements, consistently - indented by at least 3 spaces. - - - Citations_:: - - .. [CIT2002] Just like a footnote, except the label is - textual. - - - `Hyperlink targets`_:: - - .. _Python: http://www.python.org - - .. _example: - - The "_example" target above points to this paragraph. - - - Directives_:: - - .. image:: mylogo.png - - - `Substitution definitions`_:: - - .. |symbol here| image:: symbol.png - - - Comments_:: - - .. Comments begin with two dots and a space. Anything may - follow, except for the syntax of footnotes/citations, - hyperlink targets, directives, or substitution definitions. - - ----------------- - Syntax Details ----------------- - -Descriptions below list "doctree elements" (document tree element -names; XML DTD generic identifiers) corresponding to syntax -constructs. For details on the hierarchy of elements, please see `The -Docutils Document Tree`_ and the `Docutils Generic DTD`_ XML document -type definition. - - -Whitespace -========== - -Spaces are recommended for indentation_, but tabs may also be used. -Tabs will be converted to spaces. Tab stops are at every 8th column. - -Other whitespace characters (form feeds [chr(12)] and vertical tabs -[chr(11)]) are converted to single spaces before processing. - - -Blank Lines ------------ - -Blank lines are used to separate paragraphs and other elements. -Multiple successive blank lines are equivalent to a single blank line, -except within literal blocks (where all whitespace is preserved). -Blank lines may be omitted when the markup makes element separation -unambiguous, in conjunction with indentation. The first line of a -document is treated as if it is preceded by a blank line, and the last -line of a document is treated as if it is followed by a blank line. - - -Indentation ------------ - -Indentation is used to indicate, and is only significant in -indicating: - -- multi-line contents of list items, -- multiple body elements within a list item (including nested lists), -- the definition part of a definition list item, -- block quotes, -- the extent of literal blocks, and -- the extent of explicit markup blocks. - -Any text whose indentation is less than that of the current level -(i.e., unindented text or "dedents") ends the current level of -indentation. - -Since all indentation is significant, the level of indentation must be -consistent. For example, indentation is the sole markup indicator for -`block quotes`_:: - - This is a top-level paragraph. - - This paragraph belongs to a first-level block quote. - - Paragraph 2 of the first-level block quote. - -Multiple levels of indentation within a block quote will result in -more complex structures:: - - This is a top-level paragraph. - - This paragraph belongs to a first-level block quote. - - This paragraph belongs to a second-level block quote. - - Another top-level paragraph. - - This paragraph belongs to a second-level block quote. - - This paragraph belongs to a first-level block quote. The - second-level block quote above is inside this first-level - block quote. - -When a paragraph or other construct consists of more than one line of -text, the lines must be left-aligned:: - - This is a paragraph. The lines of - this paragraph are aligned at the left. - - This paragraph has problems. The - lines are not left-aligned. In addition - to potential misinterpretation, warning - and/or error messages will be generated - by the parser. - -Several constructs begin with a marker, and the body of the construct -must be indented relative to the marker. For constructs using simple -markers (`bullet lists`_, `enumerated lists`_, footnotes_, citations_, -`hyperlink targets`_, directives_, and comments_), the level of -indentation of the body is determined by the position of the first -line of text, which begins on the same line as the marker. For -example, bullet list bodies must be indented by at least two columns -relative to the left edge of the bullet:: - - - This is the first line of a bullet list - item's paragraph. All lines must align - relative to the first line. [1]_ - - This indented paragraph is interpreted - as a block quote. - - Because it is not sufficiently indented, - this paragraph does not belong to the list - item. - - .. [1] Here's a footnote. The second line is aligned - with the beginning of the footnote label. The ".." - marker is what determines the indentation. - -For constructs using complex markers (`field lists`_ and `option -lists`_), where the marker may contain arbitrary text, the indentation -of the first line *after* the marker determines the left edge of the -body. For example, field lists may have very long markers (containing -the field names):: - - :Hello: This field has a short field name, so aligning the field - body with the first line is feasible. - - :Number-of-African-swallows-required-to-carry-a-coconut: It would - be very difficult to align the field body with the left edge - of the first line. It may even be preferable not to begin the - body on the same line as the marker. - - -Escaping Mechanism -================== - -The character set universally available to plaintext documents, 7-bit -ASCII, is limited. No matter what characters are used for markup, -they will already have multiple meanings in written text. Therefore -markup characters *will* sometimes appear in text **without being -intended as markup**. Any serious markup system requires an escaping -mechanism to override the default meaning of the characters used for -the markup. In reStructuredText we use the backslash, commonly used -as an escaping character in other domains. - -A backslash followed by any character (except whitespace characters) -escapes that character. The escaped character represents the -character itself, and is prevented from playing a role in any markup -interpretation. The backslash is removed from the output. A literal -backslash is represented by two backslashes in a row (the first -backslash "escapes" the second, preventing it being interpreted in an -"escaping" role). - -Backslash-escaped whitespace characters are removed from the document. -This allows for character-level `inline markup`_. - -There are two contexts in which backslashes have no special meaning: -literal blocks and inline literals. In these contexts, a single -backslash represents a literal backslash, without having to double up. - -Please note that the reStructuredText specification and parser do not -address the issue of the representation or extraction of text input -(how and in what form the text actually *reaches* the parser). -Backslashes and other characters may serve a character-escaping -purpose in certain contexts and must be dealt with appropriately. For -example, Python uses backslashes in strings to escape certain -characters, but not others. The simplest solution when backslashes -appear in Python docstrings is to use raw docstrings:: - - r"""This is a raw docstring. Backslashes (\) are not touched.""" - - -Reference Names -=============== - -Simple reference names are single words consisting of alphanumerics -plus isolated (no two adjacent) internal hyphens, underscores, and -periods; no whitespace or other characters are allowed. Footnote -labels (Footnotes_ & `Footnote References`_), citation labels -(Citations_ & `Citation References`_), `interpreted text`_ roles, and -some `hyperlink references`_ use the simple reference name syntax. - -Reference names using punctuation or whose names are phrases (two or -more space-separated words) are called "phrase-references". -Phrase-references are expressed by enclosing the phrase in backquotes -and treating the backquoted text as a reference name:: - - Want to learn about `my favorite programming language`_? - - .. _my favorite programming language: http://www.python.org - -Simple reference names may also optionally use backquotes. - -Reference names are whitespace-neutral and case-insensitive. When -resolving reference names internally: - -- whitespace is normalized (one or more spaces, horizontal or vertical - tabs, newlines, carriage returns, or form feeds, are interpreted as - a single space), and - -- case is normalized (all alphabetic characters are converted to - lowercase). - -For example, the following `hyperlink references`_ are equivalent:: - - - `A HYPERLINK`_ - - `a hyperlink`_ - - `A - Hyperlink`_ - -Hyperlinks_, footnotes_, and citations_ all share the same namespace -for reference names. The labels of citations (simple reference names) -and manually-numbered footnotes (numbers) are entered into the same -database as other hyperlink names. This means that a footnote -(defined as "``.. [1]``") which can be referred to by a footnote -reference (``[1]_``), can also be referred to by a plain hyperlink -reference (1_). Of course, each type of reference (hyperlink, -footnote, citation) may be processed and rendered differently. Some -care should be taken to avoid reference name conflicts. - - -Document Structure -================== - -Document --------- - -Doctree element: document. - -The top-level element of a parsed reStructuredText document is the -"document" element. After initial parsing, the document element is a -simple container for a document fragment, consisting of `body -elements`_, transitions_, and sections_, but lacking a document title -or other bibliographic elements. The code that calls the parser may -choose to run one or more optional post-parse transforms_, -rearranging the document fragment into a complete document with a -title and possibly other metadata elements (author, date, etc.; see -`Bibliographic Fields`_). - -Specifically, there is no way to indicate a document title and -subtitle explicitly in reStructuredText. Instead, a lone top-level -section title (see Sections_ below) can be treated as the document -title. Similarly, a lone second-level section title immediately after -the "document title" can become the document subtitle. See the -`DocTitle transform`_ for details. - - -Sections --------- - -Doctree elements: section, title. - -Sections are identified through their titles, which are marked up with -adornment: "underlines" below the title text, or underlines and -matching "overlines" above the title. An underline/overline is a -single repeated punctuation character that begins in column 1 and -forms a line extending at least as far as the right edge of the title -text. Specifically, an underline/overline character may be any -non-alphanumeric printable 7-bit ASCII character [#]_. When an -overline is used, the length and character used must match the -underline. Underline-only adornment styles are distinct from -overline-and-underline styles that use the same character. There may -be any number of levels of section titles, although some output -formats may have limits (HTML has 6 levels). - -.. [#] The following are all valid section title adornment - characters:: - - ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ - - Some characters are more suitable than others. The following are - recommended:: - - = - ` : . ' " ~ ^ _ * + # - -Rather than imposing a fixed number and order of section title -adornment styles, the order enforced will be the order as encountered. -The first style encountered will be an outermost title (like HTML H1), -the second style will be a subtitle, the third will be a subsubtitle, -and so on. - -Below are examples of section title styles:: - - =============== - Section Title - =============== - - --------------- - Section Title - --------------- - - Section Title - ============= - - Section Title - ------------- - - Section Title - ````````````` - - Section Title - ''''''''''''' - - Section Title - ............. - - Section Title - ~~~~~~~~~~~~~ - - Section Title - ************* - - Section Title - +++++++++++++ - - Section Title - ^^^^^^^^^^^^^ - -When a title has both an underline and an overline, the title text may -be inset, as in the first two examples above. This is merely -aesthetic and not significant. Underline-only title text may *not* be -inset. - -A blank line after a title is optional. All text blocks up to the -next title of the same or higher level are included in a section (or -subsection, etc.). - -All section title styles need not be used, nor need any specific -section title style be used. However, a document must be consistent -in its use of section titles: once a hierarchy of title styles is -established, sections must use that hierarchy. - -Each section title automatically generates a hyperlink target pointing -to the section. The text of the hyperlink target (the "reference -name") is the same as that of the section title. See `Implicit -Hyperlink Targets`_ for a complete description. - -Sections may contain `body elements`_, transitions_, and nested -sections. - - -Transitions ------------ - -Doctree element: transition. - - Instead of subheads, extra space or a type ornament between - paragraphs may be used to mark text divisions or to signal - changes in subject or emphasis. - - (The Chicago Manual of Style, 14th edition, section 1.80) - -Transitions are commonly seen in novels and short fiction, as a gap -spanning one or more lines, with or without a type ornament such as a -row of asterisks. Transitions separate other body elements. A -transition should not begin or end a section or document, nor should -two transitions be immediately adjacent. - -The syntax for a transition marker is a horizontal line of 4 or more -repeated punctuation characters. The syntax is the same as section -title underlines without title text. Transition markers require blank -lines before and after:: - - Para. - - ---------- - - Para. - -Unlike section title underlines, no hierarchy of transition markers is -enforced, nor do differences in transition markers accomplish -anything. It is recommended that a single consistent style be used. - -The processing system is free to render transitions in output in any -way it likes. For example, horizontal rules (``<hr>``) in HTML output -would be an obvious choice. - - -Body Elements -============= - -Paragraphs ----------- - -Doctree element: paragraph. - -Paragraphs consist of blocks of left-aligned text with no markup -indicating any other body element. Blank lines separate paragraphs -from each other and from other body elements. Paragraphs may contain -`inline markup`_. - -Syntax diagram:: - - +------------------------------+ - | paragraph | - | | - +------------------------------+ - - +------------------------------+ - | paragraph | - | | - +------------------------------+ - - -Bullet Lists ------------- - -Doctree elements: bullet_list, list_item. - -A text block which begins with a "-", "*", or "+", followed by -whitespace, is a bullet list item (a.k.a. "unordered" list item). -List item bodies must be left-aligned and indented relative to the -bullet; the text immediately after the bullet determines the -indentation. For example:: - - - This is the first bullet list item. The blank line above the - first list item is required; blank lines between list items - (such as below this paragraph) are optional. - - - This is the first paragraph in the second item in the list. - - This is the second paragraph in the second item in the list. - The blank line above this paragraph is required. The left edge - of this paragraph lines up with the paragraph above, both - indented relative to the bullet. - - - This is a sublist. The bullet lines up with the left edge of - the text blocks above. A sublist is a new list so requires a - blank line above and below. - - - This is the third item of the main list. - - This paragraph is not part of the list. - -Here are examples of **incorrectly** formatted bullet lists:: - - - This first line is fine. - A blank line is required between list items and paragraphs. - (Warning) - - - The following line appears to be a new sublist, but it is not: - - This is a paragraph continuation, not a sublist (since there's - no blank line). This line is also incorrectly indented. - - Warnings may be issued by the implementation. - -Syntax diagram:: - - +------+-----------------------+ - | "- " | list item | - +------| (body elements)+ | - +-----------------------+ - - -Enumerated Lists ----------------- - -Doctree elements: enumerated_list, list_item. - -Enumerated lists (a.k.a. "ordered" lists) are similar to bullet lists, -but use enumerators instead of bullets. An enumerator consists of an -enumeration sequence member and formatting, followed by whitespace. -The following enumeration sequences are recognized: - -- arabic numerals: 1, 2, 3, ... (no upper limit). -- uppercase alphabet characters: A, B, C, ..., Z. -- lower-case alphabet characters: a, b, c, ..., z. -- uppercase Roman numerals: I, II, III, IV, ..., MMMMCMXCIX (4999). -- lowercase Roman numerals: i, ii, iii, iv, ..., mmmmcmxcix (4999). - -The following formatting types are recognized: - -- suffixed with a period: "1.", "A.", "a.", "I.", "i.". -- surrounded by parentheses: "(1)", "(A)", "(a)", "(I)", "(i)". -- suffixed with a right-parenthesis: "1)", "A)", "a)", "I)", "i)". - -While parsing an enumerated list, a new list will be started whenever: - -- An enumerator is encountered which does not have the same format and - sequence type as the current list (e.g. "1.", "(a)" produces two - separate lists). - -- The enumerators are not in sequence (e.g., "1.", "3." produces two - separate lists). - -It is recommended that the enumerator of the first list item be -ordinal-1 ("1", "A", "a", "I", or "i"). Although other start-values -will be recognized, they may not be supported by the output format. A -level-1 [info] system message will be generated for any list beginning -with a non-ordinal-1 enumerator. - -Lists using Roman numerals must begin with "I"/"i" or a -multi-character value, such as "II" or "XV". Any other -single-character Roman numeral ("V", "X", "L", "C", "D", "M") will be -interpreted as a letter of the alphabet, not as a Roman numeral. -Likewise, lists using letters of the alphabet may not begin with -"I"/"i", since these are recognized as Roman numeral 1. - -The second line of each enumerated list item is checked for validity. -This is to prevent ordinary paragraphs from being mistakenly -interpreted as list items, when they happen to begin with text -identical to enumerators. For example, this text is parsed as an -ordinary paragraph:: - - A. Einstein was a really - smart dude. - -However, ambiguity cannot be avoided if the paragraph consists of only -one line. This text is parsed as an enumerated list item:: - - A. Einstein was a really smart dude. - -If a single-line paragraph begins with text identical to an enumerator -("A.", "1.", "(b)", "I)", etc.), the first character will have to be -escaped in order to have the line parsed as an ordinary paragraph:: - - \A. Einstein was a really smart dude. - -Nested enumerated lists must be created with indentation. For -example:: - - 1. Item 1. - - a) Item 1a. - b) Item 1b. - -Example syntax diagram:: - - +-------+----------------------+ - | "1. " | list item | - +-------| (body elements)+ | - +----------------------+ - - -Definition Lists ----------------- - -Doctree elements: definition_list, definition_list_item, term, -classifier, definition. - -Each definition list item contains a term, an optional classifier, and -a definition. A term is a simple one-line word or phrase. An -optional classifier may follow the term on the same line, after an -inline " : " (space, colon, space). A definition is a block indented -relative to the term, and may contain multiple paragraphs and other -body elements. There may be no blank line between a term line and a -definition block (this distinguishes definition lists from `block -quotes`_). Blank lines are required before the first and after the -last definition list item, but are optional in-between. For example:: - - term 1 - Definition 1. - - term 2 - Definition 2, paragraph 1. - - Definition 2, paragraph 2. - - term 3 : classifier - Definition 3. - -Inline markup is parsed in the term line before the term/classifier -delimiter (" : ") is recognized. The delimiter will only be -recognized if it appears outside of any inline markup. - -A definition list may be used in various ways, including: - -- As a dictionary or glossary. The term is the word itself, a - classifier may be used to indicate the usage of the term (noun, - verb, etc.), and the definition follows. - -- To describe program variables. The term is the variable name, a - classifier may be used to indicate the type of the variable (string, - integer, etc.), and the definition describes the variable's use in - the program. This usage of definition lists supports the classifier - syntax of Grouch_, a system for describing and enforcing a Python - object schema. - -Syntax diagram:: - - +---------------------------+ - | term [ " : " classifier ] | - +--+------------------------+--+ - | definition | - | (body elements)+ | - +---------------------------+ - - -Field Lists ------------ - -Doctree elements: field_list, field, field_name, field_body. - -Field lists are used as part of an extension syntax, such as options -for directives_, or database-like records meant for further -processing. They may also be used for two-column table-like -structures resembling database records (label & data pairs). -Applications of reStructuredText may recognize field names and -transform fields or field bodies in certain contexts. For examples, -see `Bibliographic Fields`_ below, or the "image" and "meta" -directives in `reStructuredText Directives`_. - -Field lists are mappings from field names to field bodies, modeled on -RFC822_ headers. A field name is made up of one or more letters, -numbers, whitespace, and punctuation, except colons (":"). Field -names are case-insensitive. The field name, along with a single colon -prefix and suffix, together form the field marker. The field marker -is followed by whitespace and the field body. The field body may -contain multiple body elements, indented relative to the field marker. -The first line after the field name marker determines the indentation -of the field body. For example:: - - :Date: 2001-08-16 - :Version: 1 - :Authors: - Me - - Myself - - I - :Indentation: Since the field marker may be quite long, the second - and subsequent lines of the field body do not have to line up - with the first line, but they must be indented relative to the - field name marker, and they must line up with each other. - :Parameter i: integer - -The interpretation of individual words in a multi-word field name is -up to the application. The application may specify a syntax for the -field name. For example, second and subsequent words may be treated -as "arguments", quoted phrases may be treated as a single argument, -and direct support for the "name=value" syntax may be added. - -Standard RFC822_ headers cannot be used for this construct because -they are ambiguous. A word followed by a colon at the beginning of a -line is common in written text. However, in well-defined contexts -such as when a field list invariably occurs at the beginning of a -document (PEPs and email messages), standard RFC822 headers could be -used. - -Syntax diagram (simplified):: - - +--------------------+----------------------+ - | ":" field name ":" | field body | - +-------+------------+ | - | (body elements)+ | - +-----------------------------------+ - - -Bibliographic Fields -```````````````````` - -Doctree elements: docinfo, author, authors, organization, contact, -version, status, date, copyright, field, topic. - -When a field list is the first non-comment element in a document -(after the document title, if there is one), it may have its fields -transformed to document bibliographic data. This bibliographic data -corresponds to the front matter of a book, such as the title page and -copyright page. - -Certain registered field names (listed below) are recognized and -transformed to the corresponding doctree elements, most becoming child -elements of the "docinfo" element. No ordering is required of these -fields, although they may be rearranged to fit the document structure, -as noted. Unless otherwise indicated below, each of the bibliographic -elements' field bodies may contain a single paragraph only. Field -bodies may be checked for `RCS keywords`_ and cleaned up. Any -unrecognized fields will remain as generic fields in the docinfo -element. - -The registered bibliographic field names and their corresponding -doctree elements are as follows: - -- Field name "Author": author element. -- "Authors": authors. -- "Organization": organization. -- "Contact": contact. -- "Address": address. -- "Version": version. -- "Status": status. -- "Date": date. -- "Copyright": copyright. -- "Dedication": topic. -- "Abstract": topic. - -The "Authors" field may contain either: a single paragraph consisting -of a list of authors, separated by ";" or ","; or a bullet list whose -elements each contain a single paragraph per author. ";" is checked -first, so "Doe, Jane; Doe, John" will work. In some languages -(e.g. Swedish), there is no singular/plural distinction between -"Author" and "Authors", so only an "Authors" field is provided, and a -single name is interpreted as an "Author". If a single name contains -a comma, end it with a semicolon to disambiguate: ":Authors: Doe, -Jane;". - -The "Address" field is for a multi-line surface mailing address. A -specialized form of line block`_ (see `reStructuredText Directives`_), -newlines and whitespace will be preserved. - -The "Dedication" and "Abstract" fields may contain arbitrary body -elements. Only one of each is allowed. They become topic elements -with "Dedication" or "Abstract" titles (or language equivalents) -immediately following the docinfo element. - -This field-name-to-element mapping can be replaced for other -languages. See the `DocInfo transform`_ implementation documentation -for details. - -Unregistered/generic fields may contain one or more paragraphs or -arbitrary body elements. - - -RCS Keywords -```````````` - -`Bibliographic fields`_ recognized by the parser are normally checked -for RCS [#]_ keywords and cleaned up [#]_. RCS keywords may be -entered into source files as "$keyword$", and once stored under RCS or -CVS [#]_, they are expanded to "$keyword: expansion text $". For -example, a "Status" field will be transformed to a "status" element:: - - :Status: $keyword: expansion text $ - -.. [#] Revision Control System. -.. [#] RCS keyword processing can be turned off (unimplemented). -.. [#] Concurrent Versions System. CVS uses the same keywords as RCS. - -Processed, the "status" element's text will become simply "expansion -text". The dollar sign delimiters and leading RCS keyword name are -removed. - -The RCS keyword processing only kicks in when all of these conditions -hold: - -1. The field list is in bibliographic context (first non-comment - construct in the document, after a document title if there is - one). - -2. The field name is a recognized bibliographic field name. - -3. The sole contents of the field is an expanded RCS keyword, of the - form "$Keyword: data $". - - -Option Lists ------------- - -Doctree elements: option_list, option_list_item, option_group, option, -option_string, option_argument, description. - -Option lists are two-column lists of command-line options and -descriptions, documenting a program's options. For example:: - - -a Output all. - -b Output both (this description is - quite long). - -c arg Output just arg. - --long Output all day long. - - -p This option has two paragraphs in the description. - This is the first. - - This is the second. Blank lines may be omitted between - options (as above) or left in (as here and below). - - --very-long-option A VMS-style option. Note the adjustment for - the required two spaces. - - --an-even-longer-option - The description can also start on the next line. - - -2, --two This option has two variants. - - -f FILE, --file=FILE These two options are synonyms; both have - arguments. - - /V A VMS/DOS-style option. - -There are several types of options recognized by reStructuredText: - -- Short POSIX options consist of one dash and an option letter. -- Long POSIX options consist of two dashes and an option word; some - systems use a single dash. -- Old GNU-style "plus" options consist of one plus and an option - letter ("plus" options are deprecated now, their use discouraged). -- DOS/VMS options consist of a slash and an option letter or word. - -Please note that both POSIX-style and DOS/VMS-style options may be -used by DOS or Windows software. These and other variations are -sometimes used mixed together. The names above have been chosen for -convenience only. - -The syntax for short and long POSIX options is based on the syntax -supported by Python's getopt.py_ module, which implements an option -parser similar to the `GNU libc getopt_long()`_ function but with some -restrictions. There are many variant option systems, and -reStructuredText option lists do not support all of them. - -Although long POSIX and DOS/VMS option words may be allowed to be -truncated by the operating system or the application when used on the -command line, reStructuredText option lists do not show or support -this with any special syntax. The complete option word should be -given, supported by notes about truncation if and when applicable. - -Options may be followed by an argument placeholder, whose role and -syntax should be explained in the description text. Either a space or -an equals sign may be used as a delimiter between options and option -argument placeholders. - -Multiple option "synonyms" may be listed, sharing a single -description. They must be separated by comma-space. - -There must be at least two spaces between the option(s) and the -description. The description may contain multiple body elements. The -first line after the option marker determines the indentation of the -description. As with other types of lists, blank lines are required -before the first option list item and after the last, but are optional -between option entries. - -Syntax diagram (simplified):: - - +----------------------------+-------------+ - | option [" " argument] " " | description | - +-------+--------------------+ | - | (body elements)+ | - +----------------------------------+ - - -Literal Blocks --------------- - -Doctree element: literal_block. - -A paragraph consisting of two colons ("::") signifies that all -following **indented** text blocks comprise a literal block. No -markup processing is done within a literal block. It is left as-is, -and is typically rendered in a monospaced typeface:: - - This is a typical paragraph. A literal block follows. - - :: - - for a in [5,4,3,2,1]: # this is program code, shown as-is - print a - print "it's..." - # a literal block continues until the indentation ends - - This text has returned to the indentation of the first paragraph, - is outside of the literal block, and is therefore treated as an - ordinary paragraph. - -The paragraph containing only "::" will be completely removed from the -output; no empty paragraph will remain. - -As a convenience, the "::" is recognized at the end of any paragraph. -If immediately preceded by whitespace, both colons will be removed -from the output (this is the "partially minimized" form). When text -immediately precedes the "::", *one* colon will be removed from the -output, leaving only one colon visible (i.e., "::" will be replaced by -":"; this is the "fully minimized" form). - -In other words, these are all equivalent (please pay attention to the -colons after "Paragraph"): - -1. Expanded form:: - - Paragraph: - - :: - - Literal block - -2. Partially minimized form:: - - Paragraph: :: - - Literal block - -3. Fully minimized form:: - - Paragraph:: - - Literal block - -The minimum leading whitespace will be removed from each line of the -literal block. Other than that, all whitespace (including line -breaks) is preserved. Blank lines are required before and after a -literal block, but these blank lines are not included as part of the -literal block. - -Syntax diagram:: - - +------------------------------+ - | paragraph | - | (ends with "::") | - +------------------------------+ - +---------------------------+ - | literal block | - +---------------------------+ - - -Block Quotes ------------- - -Doctree element: block_quote, attribution. - -A text block that is indented relative to the preceding text, without -markup indicating it to be a literal block, is a block quote. All -markup processing (for body elements and inline markup) continues -within the block quote:: - - This is an ordinary paragraph, introducing a block quote. - - "It is my business to know things. That is my trade." - - -- Sherlock Holmes - -If the final block of a block quote begins with "--" (flush left -within the block quote), it is interpreted as an attribution. If the -attribution consists of multiple lines, the left edges of the second -and subsequent lines must align. - -Blank lines are required before and after a block quote, but these -blank lines are not included as part of the block quote. - -Syntax diagram:: - - +------------------------------+ - | (current level of | - | indentation) | - +------------------------------+ - +---------------------------+ - | block quote | - | (body elements)+ | - | | - | -- attribution text | - | (optional) | - +---------------------------+ - - -Doctest Blocks --------------- - -Doctree element: doctest_block. - -Doctest blocks are interactive Python sessions cut-and-pasted into -docstrings. They are meant to illustrate usage by example, and -provide an elegant and powerful testing environment via the `doctest -module`_ in the Python standard library. - -Doctest blocks are text blocks which begin with ``">>> "``, the Python -interactive interpreter main prompt, and end with a blank line. -Doctest blocks are treated as a special case of literal blocks, -without requiring the literal block syntax. If both are present, the -literal block syntax takes priority over Doctest block syntax:: - - This is an ordinary paragraph. - - >>> print 'this is a Doctest block' - this is a Doctest block - - The following is a literal block:: - - >>> This is not recognized as a doctest block by - reStructuredText. It *will* be recognized by the doctest - module, though! - -Indentation is not required for doctest blocks. - - -Tables ------- - -Doctree elements: table, tgroup, colspec, thead, tbody, row, entry. - -ReStructuredText provides two syntaxes for delineating table cells: -`Grid Tables`_ and `Simple Tables`_. - -As with other body elements, blank lines are required before and after -tables. Tables' left edges should align with the left edge of -preceding text blocks; if indented, the table is considered to be part -of a block quote. - -Once isolated, each table cell is treated as a miniature document; the -top and bottom cell boundaries act as delimiting blank lines. Each -cell contains zero or more body elements. Cell contents may include -left and/or right margins, which are removed before processing. - - -Grid Tables -``````````` - -Grid tables provide a complete table representation via grid-like -"ASCII art". Grid tables allow arbitrary cell contents (body -elements), and both row and column spans. However, grid tables can be -cumbersome to produce, especially for simple data sets. The `Emacs -table mode`_ is a tool that allows easy editing of grid tables, in -Emacs. See `Simple Tables`_ for a simpler (but limited) -representation. - -Grid tables are described with a visual grid made up of the characters -"-", "=", "|", and "+". The hyphen ("-") is used for horizontal lines -(row separators). The equals sign ("=") may be used to separate -optional header rows from the table body (not supported by the `Emacs -table mode`_). The vertical bar ("|") is used for vertical lines -(column separators). The plus sign ("+") is used for intersections of -horizontal and vertical lines. Example:: - - +------------------------+------------+----------+----------+ - | Header row, column 1 | Header 2 | Header 3 | Header 4 | - | (header rows optional) | | | | - +========================+============+==========+==========+ - | body row 1, column 1 | column 2 | column 3 | column 4 | - +------------------------+------------+----------+----------+ - | body row 2 | Cells may span columns. | - +------------------------+------------+---------------------+ - | body row 3 | Cells may | - Table cells | - +------------------------+ span rows. | - contain | - | body row 4 | | - body elements. | - +------------------------+------------+---------------------+ - -Some care must be taken with grid tables to avoid undesired -interactions with cell text in rare cases. For example, the following -table contains a cell in row 2 spanning from column 2 to column 4:: - - +--------------+----------+-----------+-----------+ - | row 1, col 1 | column 2 | column 3 | column 4 | - +--------------+----------+-----------+-----------+ - | row 2 | | - +--------------+----------+-----------+-----------+ - | row 3 | | | | - +--------------+----------+-----------+-----------+ - -If a vertical bar is used in the text of that cell, it could have -unintended effects if accidentally aligned with column boundaries:: - - +--------------+----------+-----------+-----------+ - | row 1, col 1 | column 2 | column 3 | column 4 | - +--------------+----------+-----------+-----------+ - | row 2 | Use the command ``ls | more``. | - +--------------+----------+-----------+-----------+ - | row 3 | | | | - +--------------+----------+-----------+-----------+ - -Several solutions are possible. All that is needed is to break the -continuity of the cell outline rectangle. One possibility is to shift -the text by adding an extra space before:: - - +--------------+----------+-----------+-----------+ - | row 1, col 1 | column 2 | column 3 | column 4 | - +--------------+----------+-----------+-----------+ - | row 2 | Use the command ``ls | more``. | - +--------------+----------+-----------+-----------+ - | row 3 | | | | - +--------------+----------+-----------+-----------+ - -Another possibility is to add an extra line to row 2:: - - +--------------+----------+-----------+-----------+ - | row 1, col 1 | column 2 | column 3 | column 4 | - +--------------+----------+-----------+-----------+ - | row 2 | Use the command ``ls | more``. | - | | | - +--------------+----------+-----------+-----------+ - | row 3 | | | | - +--------------+----------+-----------+-----------+ - - -Simple Tables -````````````` - -Simple tables provide a compact and easy to type but limited -row-oriented table representation for simple data sets. Cell contents -are typically single paragraphs, although arbitrary body elements may -be represented in most cells. Simple tables allow multi-line rows (in -all but the first column) and column spans, but not row spans. See -`Grid Tables`_ above for a complete table representation. - -Simple tables are described with horizontal borders made up of "=" and -"-" characters. The equals sign ("=") is used for top and bottom -table borders, and to separate optional header rows from the table -body. The hyphen ("-") is used to indicate column spans in a single -row by underlining the joined columns. - -A simple table begins with a top border of equals signs with one or -more spaces at each column boundary (two or more spaces recommended). -Regardless of spans, the top border *must* fully describe all table -columns. There must be at least two columns in the table (to -differentiate it from section headers). The last of the optional -header rows is underlined with '=', again with spaces at column -boundaries. There may not be a blank line below the header row -separator; it would be interpreted as the bottom border of the table. -The bottom boundary of the table consists of '=' underlines, also with -spaces at column boundaries. For example, here is a truth table, a -three-column table with one header row and four body rows:: - - ===== ===== ======= - A B A and B - ===== ===== ======= - False False False - True False False - False True False - True True True - ===== ===== ======= - -Underlines of '-' may be used to indicate column spans by "filling in" -column margins to join adjacent columns. Column span underlines must -be complete (they must cover all columns) and align with established -column boundaries. Text lines containing column span underlines may -not contain any other text. A column span underline applies only to -one row immediately above it. For example, here is a table with a -column span in the header:: - - ===== ===== ====== - Inputs Output - ------------ ------ - A B A or B - ===== ===== ====== - False False False - True False True - False True True - True True True - ===== ===== ====== - -Each line of text must contain spaces at column boundaries, except -where cells have been joined by column spans. Each line of text -starts a new row, except when there is a blank cell in the first -column. In that case, that line of text is parsed as a continuation -line. For this reason, cells in the first column of new rows (*not* -continuation lines) *must* contain some text; blank cells would lead -to a misinterpretation. An empty comment ("..") is sufficient and -will be omitted from the processed output (see Comments_ below). -Also, this mechanism limits cells in the first column to only one line -of text. Use `grid tables`_ if this limitation is unacceptable. - -Underlines of '-' may also be used to visually separate rows, even if -there are no column spans. This is especially useful in long tables, -where rows are many lines long. - -Blank lines are permitted within simple tables. Their interpretation -depends on the context. Blank lines *between* rows are ignored. -Blank lines *within* multi-line rows may separate paragraphs or other -body elements within cells. - -The rightmost column is unbounded; text may continue past the edge of -the table (as indicated by the table borders). However, it is -recommended that borders be made long enough to contain the entire -text. - -The following example illustrates continuation lines (row 2 consists -of two lines of text, and four lines for row 3), a blank line -separating paragraphs (row 3, column 2), and text extending past the -right edge of the table:: - - ===== ===== - col 1 col 2 - ===== ===== - 1 Second column of row 1. - 2 Second column of row 2. - Second line of paragraph. - 3 - Second column of row 3. - - - Second item in bullet - list (row 3, column 2). - ===== ===== - - -Explicit Markup Blocks ----------------------- - -An explicit markup block is a text block: - -- whose first line begins with ".." followed by whitespace (the - "explicit markup start"), -- whose second and subsequent lines (if any) are indented relative to - the first, and -- which ends before an unindented line. - -Explicit markup blocks are analogous to bullet list items, with ".." -as the bullet. The text immediately after the explicit markup start -determines the indentation of the block body. Blank lines are -required between explicit markup blocks and other elements, but are -optional between explicit markup blocks where unambiguous. - -The explicit markup syntax is used for footnotes, citations, hyperlink -targets, directives, substitution definitions, and comments. - - -Footnotes -````````` - -Doctree elements: footnote, label. - -Each footnote consists of an explicit markup start (".. "), a left -square bracket, the footnote label, a right square bracket, and -whitespace, followed by indented body elements. A footnote label can -be: - -- a whole decimal number consisting of one or more digits, - -- a single "#" (denoting `auto-numbered footnotes`_), - -- a "#" followed by a simple reference name (an `autonumber label`_), - or - -- a single "*" (denoting `auto-symbol footnotes`_). - -If the first body element within a footnote is a simple paragraph, it -may begin on the same line as the footnote label. Other elements must -begin on a new line, consistently indented (by at least 3 spaces) and -left-aligned. - -Footnotes may occur anywhere in the document, not only at the end. -Where or how they appear in the processed output depends on the -processing system. - -Here is a manually numbered footnote:: - - .. [1] Body elements go here. - -Each footnote automatically generates a hyperlink target pointing to -itself. The text of the hyperlink target name is the same as that of -the footnote label. `Auto-numbered footnotes`_ generate a number as -their footnote label and reference name. See `Implicit Hyperlink -Targets`_ for a complete description of the mechanism. - -Syntax diagram:: - - +-------+-------------------------+ - | ".. " | "[" label "]" footnote | - +-------+ | - | (body elements)+ | - +-------------------------+ - - -Auto-Numbered Footnotes -....................... - -A number sign ("#") may be used as the first character of a footnote -label to request automatic numbering of the footnote or footnote -reference. - -The first footnote to request automatic numbering is assigned the -label "1", the second is assigned the label "2", and so on (assuming -there are no manually numbered footnotes present; see `Mixed Manual -and Auto-Numbered Footnotes`_ below). A footnote which has -automatically received a label "1" generates an implicit hyperlink -target with name "1", just as if the label was explicitly specified. - -.. _autonumber label: `autonumber labels`_ - -A footnote may specify a label explicitly while at the same time -requesting automatic numbering: ``[#label]``. These labels are called -_`autonumber labels`. Autonumber labels do two things: - -- On the footnote itself, they generate a hyperlink target whose name - is the autonumber label (doesn't include the "#"). - -- They allow an automatically numbered footnote to be referred to more - than once, as a footnote reference or hyperlink reference. For - example:: - - If [#note]_ is the first footnote reference, it will show up as - "[1]". We can refer to it again as [#note]_ and again see - "[1]". We can also refer to it as note_ (an ordinary internal - hyperlink reference). - - .. [#note] This is the footnote labeled "note". - -The numbering is determined by the order of the footnotes, not by the -order of the references. For footnote references without autonumber -labels (``[#]_``), the footnotes and footnote references must be in -the same relative order but need not alternate in lock-step. For -example:: - - [#]_ is a reference to footnote 1, and [#]_ is a reference to - footnote 2. - - .. [#] This is footnote 1. - .. [#] This is footnote 2. - .. [#] This is footnote 3. - - [#]_ is a reference to footnote 3. - -Special care must be taken if footnotes themselves contain -auto-numbered footnote references, or if multiple references are made -in close proximity. Footnotes and references are noted in the order -they are encountered in the document, which is not necessarily the -same as the order in which a person would read them. - - -Auto-Symbol Footnotes -..................... - -An asterisk ("*") may be used for footnote labels to request automatic -symbol generation for footnotes and footnote references. The asterisk -may be the only character in the label. For example:: - - Here is a symbolic footnote reference: [*]_. - - .. [*] This is the footnote. - -A transform will insert symbols as labels into corresponding footnotes -and footnote references. The number of references must be equal to -the number of footnotes. One symbol footnote cannot have multiple -references. - -The standard Docutils system uses the following symbols for footnote -marks [#]_: - -- asterisk/star ("*") -- dagger (HTML character entity "†") -- double dagger ("‡") -- section mark ("§") -- pilcrow or paragraph mark ("¶") -- number sign ("#") -- spade suit ("♠") -- heart suit ("♥") -- diamond suit ("♦") -- club suit ("♣") - -.. [#] This list was inspired by the list of symbols for "Note - Reference Marks" in The Chicago Manual of Style, 14th edition, - section 12.51. "Parallels" ("||") were given in CMoS instead of - the pilcrow. The last four symbols (the card suits) were added - arbitrarily. - -If more than ten symbols are required, the same sequence will be -reused, doubled and then tripled, and so on ("**" etc.). - - -Mixed Manual and Auto-Numbered Footnotes -........................................ - -Manual and automatic footnote numbering may both be used within a -single document, although the results may not be expected. Manual -numbering takes priority. Only unused footnote numbers are assigned -to auto-numbered footnotes. The following example should be -illustrative:: - - [2]_ will be "2" (manually numbered), - [#]_ will be "3" (anonymous auto-numbered), and - [#label]_ will be "1" (labeled auto-numbered). - - .. [2] This footnote is labeled manually, so its number is fixed. - - .. [#label] This autonumber-labeled footnote will be labeled "1". - It is the first auto-numbered footnote and no other footnote - with label "1" exists. The order of the footnotes is used to - determine numbering, not the order of the footnote references. - - .. [#] This footnote will be labeled "3". It is the second - auto-numbered footnote, but footnote label "2" is already used. - - -Citations -````````` - -Citations are identical to footnotes except that they use only -non-numeric labels such as ``[note]`` or ``[GVR2001]``. Citation -labels are simple `reference names`_ (case-insensitive single words -consisting of alphanumerics plus internal hyphens, underscores, and -periods; no whitespace). Citations may be rendered separately and -differently from footnotes. For example:: - - Here is a citation reference: [CIT2002]_. - - .. [CIT2002] This is the citation. It's just like a footnote, - except the label is textual. - - -.. _hyperlinks: - -Hyperlink Targets -````````````````` - -Doctree element: target. - -These are also called _`explicit hyperlink targets`, to differentiate -them from `implicit hyperlink targets`_ defined below. - -Hyperlink targets identify a location within or outside of a document, -which may be linked to by `hyperlink references`_. - -Hyperlink targets may be named or anonymous. Named hyperlink targets -consist of an explicit markup start (".. "), an underscore, the -reference name (no trailing underscore), a colon, whitespace, and a -link block:: - - .. _hyperlink-name: link-block - -Reference names are whitespace-neutral and case-insensitive. See -`Reference Names`_ for details and examples. - -Anonymous hyperlink targets consist of an explicit markup start -(".. "), two underscores, a colon, whitespace, and a link block; there -is no reference name:: - - .. __: anonymous-hyperlink-target-link-block - -An alternate syntax for anonymous hyperlinks consists of two -underscores, a space, and a link block:: - - __ anonymous-hyperlink-target-link-block - -See `Anonymous Hyperlinks`_ below. - -There are three types of hyperlink targets: internal, external, and -indirect. - -1. _`Internal hyperlink targets` have empty link blocks. They provide - an end point allowing a hyperlink to connect one place to another - within a document. An internal hyperlink target points to the - element following the target. For example:: - - Clicking on this internal hyperlink will take us to the target_ - below. - - .. _target: - - The hyperlink target above points to this paragraph. - - Internal hyperlink targets may be "chained". Multiple adjacent - internal hyperlink targets all point to the same element:: - - .. _target1: - .. _target2: - - The targets "target1" and "target2" are synonyms; they both - point to this paragraph. - - If the element "pointed to" is an external hyperlink target (with a - URI in its link block; see #2 below) the URI from the external - hyperlink target is propagated to the internal hyperlink targets; - they will all "point to" the same URI. There is no need to - duplicate a URI. For example, all three of the following hyperlink - targets refer to the same URI:: - - .. _Python DOC-SIG mailing list archive: - .. _archive: - .. _Doc-SIG: http://mail.python.org/pipermail/doc-sig/ - - An inline form of internal hyperlink target is available; see - `Inline Internal Targets`_. - -2. _`External hyperlink targets` have an absolute or relative URI or - email address in their link blocks. For example, take the - following input:: - - See the Python_ home page for info. - - `Write to me`_ with your questions. - - .. _Python: http://www.python.org - .. _Write to me: jdoe@example.com - - After processing into HTML, the hyperlinks might be expressed as:: - - See the <a href="http://www.python.org">Python</a> home page - for info. - - <a href="mailto:jdoe@example.com">Write to me</a> with your - questions. - - An external hyperlink's URI may begin on the same line as the - explicit markup start and target name, or it may begin in an - indented text block immediately following, with no intervening - blank lines. If there are multiple lines in the link block, they - are stripped of leading and trailing whitespace and concatenated. - The following external hyperlink targets are equivalent:: - - .. _one-liner: http://docutils.sourceforge.net/rst.html - - .. _starts-on-this-line: http:// - docutils.sourceforge.net/rst.html - - .. _entirely-below: - http://docutils. - sourceforge.net/rst.html - - If an external hyperlink target's URI contains an underscore as its - last character, it must be escaped to avoid being mistaken for an - indirect hyperlink target:: - - This link_ refers to a file called ``underscore_``. - - .. _link: underscore\_ - - It is possible (although not generally recommended) to include URIs - directly within hyperlink references. See `Embedded URIs`_ below. - -3. _`Indirect hyperlink targets` have a hyperlink reference in their - link blocks. In the following example, target "one" indirectly - references whatever target "two" references, and target "two" - references target "three", an internal hyperlink target. In - effect, all three reference the same thing:: - - .. _one: two_ - .. _two: three_ - .. _three: - - Just as with `hyperlink references`_ anywhere else in a document, - if a phrase-reference is used in the link block it must be enclosed - in backquotes. As with `external hyperlink targets`_, the link - block of an indirect hyperlink target may begin on the same line as - the explicit markup start or the next line. It may also be split - over multiple lines, in which case the lines are joined with - whitespace before being normalized. - - For example, the following indirect hyperlink targets are - equivalent:: - - .. _one-liner: `A HYPERLINK`_ - .. _entirely-below: - `a hyperlink`_ - .. _split: `A - Hyperlink`_ - -If a reference name contains a colon followed by whitespace, either: - -- the phrase must be enclosed in backquotes:: - - .. _`FAQTS: Computers: Programming: Languages: Python`: - http://python.faqts.com/ - -- or the colon(s) must be backslash-escaped in the link target:: - - .. _Chapter One\: "Tadpole Days": - - It's not easy being green... - -See `Implicit Hyperlink Targets`_ below for the resolution of -duplicate reference names. - -Syntax diagram:: - - +-------+----------------------+ - | ".. " | "_" name ":" link | - +-------+ block | - | | - +----------------------+ - - -Anonymous Hyperlinks -.................... - -The `World Wide Web Consortium`_ recommends in its `HTML Techniques -for Web Content Accessibility Guidelines`_ that authors should -"clearly identify the target of each link." Hyperlink references -should be as verbose as possible, but duplicating a verbose hyperlink -name in the target is onerous and error-prone. Anonymous hyperlinks -are designed to allow convenient verbose hyperlink references, and are -analogous to `Auto-Numbered Footnotes`_. They are particularly useful -in short or one-off documents. However, this feature is easily abused -and can result in unreadable plaintext and/or unmaintainable -documents. Caution is advised. - -Anonymous `hyperlink references`_ are specified with two underscores -instead of one:: - - See `the web site of my favorite programming language`__. - -Anonymous targets begin with ".. __:"; no reference name is required -or allowed:: - - .. __: http://www.python.org - -As a convenient alternative, anonymous targets may begin with "__" -only:: - - __ http://www.python.org - -The reference name of the reference is not used to match the reference -to its target. Instead, the order of anonymous hyperlink references -and targets within the document is significant: the first anonymous -reference will link to the first anonymous target. The number of -anonymous hyperlink references in a document must match the number of -anonymous targets. For readability, it is recommended that targets be -kept close to references. Take care when editing text containing -anonymous references; adding, removing, and rearranging references -require attention to the order of corresponding targets. - - -Directives -`````````` - -Doctree elements: depend on the directive. - -Directives are an extension mechanism for reStructuredText, a way of -adding support for new constructs without adding new syntax. All -standard directives (those implemented and registered in the reference -reStructuredText parser) are described in the `reStructuredText -Directives`_ document, and are always available. Any other directives -are domain-specific, and may require special action to make them -available when processing the document. - -For example, here's how an image may be placed:: - - .. image:: mylogo.jpeg - -A figure (a graphic with a caption) may placed like this:: - - .. figure:: larch.png - - The larch. - -An admonition (note, caution, etc.) contains other body elements:: - - .. note:: This is a paragraph - - - Here is a bullet list. - -Directives are indicated by an explicit markup start (".. ") followed -by the directive type, two colons, and whitespace (together called the -"directive marker"). Directive types are case-insensitive single -words (alphanumerics plus internal hyphens, underscores, and periods; -no whitespace). Two colons are used after the directive type for -these reasons: - -- To avoid clashes with common comment text like:: - - .. Danger: modify at your own risk! - -- If an implementation of reStructuredText does not recognize a - directive (i.e., the directive-handler is not installed), the entire - directive block (including the directive itself) will be treated as - a literal block, and a level-3 (error) system message generated. - Thus "::" is a natural choice. - -The directive block is consists of any text on the first line of the -directive after the directive marker, and any subsequent indented -text. The interpretation of the directive block is up to the -directive code. There are three logical parts to the directive block: - -1. Directive arguments. -2. Directive options. -3. Directive content. - -Individual directives can employ any combination of these parts. -Directive arguments can be filesystem paths, URLs, title text, etc. -Directive options are indicated using `field lists`_; the field names -and contents are directive-specific. Arguments and options must form -a contiguous block beginning on the first or second line of the -directive; a blank line indicates the beginning of the directive -content block. If either arguments and/or options are employed by the -directive, a blank line must separate them from the directive content. -The "figure" directive employs all three parts:: - - .. figure:: larch.png - :scale: 50 - - The larch. - -Simple directives may not require any content. If a directive that -does not employ a content block is followed by indented text anyway, -it is an error. If a block quote should immediately follow a -directive, use an empty comment in-between (see Comments_ below). - -Actions taken in response to directives and the interpretation of text -in the directive content block or subsequent text block(s) are -directive-dependent. See `reStructuredText Directives`_ for details. - -Directives are meant for the arbitrary processing of their contents, -which can be transformed into something possibly unrelated to the -original text. It may also be possible for directives to be used as -pragmas, to modify the behavior of the parser, such as to experiment -with alternate syntax. There is no parser support for this -functionality at present; if a reasonable need for pragma directives -is found, they may be supported. - -Directives do not generate "directive" elements; they are a *parser -construct* only, and have no intrinsic meaning outside of -reStructuredText. Instead, the parser will transform recognized -directives into (possibly specialized) document elements. Unknown -directives will trigger level-3 (error) system messages. - -Syntax diagram:: - - +-------+-------------------------------+ - | ".. " | directive type "::" directive | - +-------+ block | - | | - +-------------------------------+ - - -Substitution Definitions -```````````````````````` - -Doctree element: substitution_definition. - -Substitution definitions are indicated by an explicit markup start -(".. ") followed by a vertical bar, the substitution text, another -vertical bar, whitespace, and the definition block. Substitution text -may not begin or end with whitespace. A substitution definition block -contains an embedded inline-compatible directive (without the leading -".. "), such as an image. For example:: - - The |biohazard| symbol must be used on containers used to - dispose of medical waste. - - .. |biohazard| image:: biohazard.png - -It is an error for a substitution definition block to directly or -indirectly contain a circular substitution reference. - -`Substitution references`_ are replaced in-line by the processed -contents of the corresponding definition (linked by matching -substitution text). Matches are case-sensitive but forgiving; if no -exact match is found, a case-insensitive comparison is attempted. - -Substitution definitions allow the power and flexibility of -block-level directives_ to be shared by inline text. They are a way -to include arbitrarily complex inline structures within text, while -keeping the details out of the flow of text. They are the equivalent -of SGML/XML's named entities or programming language macros. - -Without the substitution mechanism, every time someone wants an -application-specific new inline structure, they would have to petition -for a syntax change. In combination with existing directive syntax, -any inline structure can be coded without new syntax (except possibly -a new directive). - -Syntax diagram:: - - +-------+-----------------------------------------------------+ - | ".. " | "|" substitution text "| " directive type "::" data | - +-------+ directive block | - | | - +-----------------------------------------------------+ - -Following are some use cases for the substitution mechanism. Please -note that most of the embedded directives shown are examples only and -have not been implemented. - -Objects - Substitution references may be used to associate ambiguous text - with a unique object identifier. - - For example, many sites may wish to implement an inline "user" - directive:: - - |Michael| and |Jon| are our widget-wranglers. - - .. |Michael| user:: mjones - .. |Jon| user:: jhl - - Depending on the needs of the site, this may be used to index the - document for later searching, to hyperlink the inline text in - various ways (mailto, homepage, mouseover Javascript with profile - and contact information, etc.), or to customize presentation of - the text (include username in the inline text, include an icon - image with a link next to the text, make the text bold or a - different color, etc.). - - The same approach can be used in documents which frequently refer - to a particular type of objects with unique identifiers but - ambiguous common names. Movies, albums, books, photos, court - cases, and laws are possible. For example:: - - |The Transparent Society| offers a fascinating alternate view - on privacy issues. - - .. |The Transparent Society| book:: isbn=0738201448 - - Classes or functions, in contexts where the module or class names - are unclear and/or interpreted text cannot be used, are another - possibility:: - - 4XSLT has the convenience method |runString|, so you don't - have to mess with DOM objects if all you want is the - transformed output. - - .. |runString| function:: module=xml.xslt class=Processor - -Images - Images are a common use for substitution references:: - - West led the |H| 3, covered by dummy's |H| Q, East's |H| K, - and trumped in hand with the |S| 2. - - .. |H| image:: /images/heart.png - :height: 11 - :width: 11 - .. |S| image:: /images/spade.png - :height: 11 - :width: 11 - - * |Red light| means stop. - * |Green light| means go. - * |Yellow light| means go really fast. - - .. |Red light| image:: red_light.png - .. |Green light| image:: green_light.png - .. |Yellow light| image:: yellow_light.png - - |-><-| is the official symbol of POEE_. - - .. |-><-| image:: discord.png - .. _POEE: http://www.poee.org/ - - The "image" directive has been implemented. - -Styles [#]_ - Substitution references may be used to associate inline text with - an externally defined presentation style:: - - Even |the text in Texas| is big. - - .. |the text in Texas| style:: big - - The style name may be meaningful in the context of some particular - output format (CSS class name for HTML output, LaTeX style name - for LaTeX, etc), or may be ignored for other output formats (such - as plaintext). - - .. @@@ This needs to be rethought & rewritten or removed: - - Interpreted text is unsuitable for this purpose because the set - of style names cannot be predefined - it is the domain of the - content author, not the author of the parser and output - formatter - and there is no way to associate a style name - argument with an interpreted text style role. Also, it may be - desirable to use the same mechanism for styling blocks:: - - .. style:: motto - At Bob's Underwear Shop, we'll do anything to get in - your pants. - - .. style:: disclaimer - All rights reversed. Reprint what you like. - - .. [#] There may be sufficient need for a "style" mechanism to - warrant simpler syntax such as an extension to the interpreted - text role syntax. The substitution mechanism is cumbersome for - simple text styling. - -Templates - Inline markup may be used for later processing by a template - engine. For example, a Zope_ author might write:: - - Welcome back, |name|! - - .. |name| tal:: replace user/getUserName - - After processing, this ZPT output would result:: - - Welcome back, - <span tal:replace="user/getUserName">name</span>! - - Zope would then transform this to something like "Welcome back, - David!" during a session with an actual user. - -Replacement text - The substitution mechanism may be used for simple macro - substitution. This may be appropriate when the replacement text - is repeated many times throughout one or more documents, - especially if it may need to change later. A short example is - unavoidably contrived:: - - |RST| is a little annoying to type over and over, especially - when writing about |RST| itself, and spelling out the - bicapitalized word |RST| every time isn't really necessary for - |RST| source readability. - - .. |RST| replace:: reStructuredText_ - .. _reStructuredText: http://docutils.sourceforge.net/rst.html - - Substitution is also appropriate when the replacement text cannot - be represented using other inline constructs, or is obtrusively - long:: - - But still, that's nothing compared to a name like - |j2ee-cas|__. - - .. |j2ee-cas| replace:: - the Java `TM`:super: 2 Platform, Enterprise Edition Client - Access Services - __ http://developer.java.sun.com/developer/earlyAccess/ - j2eecas/ - - -Comments -```````` - -Doctree element: comment. - -Arbitrary indented text may follow the explicit markup start and will -be processed as a comment element. No further processing is done on -the comment block text; a comment contains a single "text blob". -Depending on the output formatter, comments may be removed from the -processed output. The only restriction on comments is that they not -use the same syntax as any of the other explicit markup constructs: -substitution definitions, directives, footnotes, citations, or -hyperlink targets. To ensure that none of the other explicit markup -constructs is recognized, leave the ".." on a line by itself:: - - .. This is a comment - .. - _so: is this! - .. - [and] this! - .. - this:: too! - .. - |even| this:: ! - -A explicit markup start followed by a blank line and nothing else -(apart from whitespace) is an "empty comment". It serves to terminate -a preceding construct, and does **not** consume any indented text -following. To have a block quote follow a list or any indented -construct, insert an unindented empty comment in-between. - -Syntax diagram:: - - +-------+----------------------+ - | ".. " | comment | - +-------+ block | - | | - +----------------------+ - - -Implicit Hyperlink Targets -========================== - -Implicit hyperlink targets are generated by section titles, footnotes, -and citations, and may also be generated by extension constructs. -Implicit hyperlink targets otherwise behave identically to explicit -`hyperlink targets`_. - -Problems of ambiguity due to conflicting duplicate implicit and -explicit reference names are avoided by following this procedure: - -1. `Explicit hyperlink targets`_ override any implicit targets having - the same reference name. The implicit hyperlink targets are - removed, and level-1 (info) system messages are inserted. - -2. Duplicate implicit hyperlink targets are removed, and level-1 - (info) system messages inserted. For example, if two or more - sections have the same title (such as "Introduction" subsections of - a rigidly-structured document), there will be duplicate implicit - hyperlink targets. - -3. Duplicate explicit hyperlink targets are removed, and level-2 - (warning) system messages are inserted. Exception: duplicate - `external hyperlink targets`_ (identical hyperlink names and - referenced URIs) do not conflict, and are not removed. - -System messages are inserted where target links have been removed. -See "Error Handling" in `PEP 258`_. - -The parser must return a set of *unique* hyperlink targets. The -calling software (such as the Docutils_) can warn of unresolvable -links, giving reasons for the messages. - - -Inline Markup -============= - -In reStructuredText, inline markup applies to words or phrases within -a text block. The same whitespace and punctuation that serves to -delimit words in written text is used to delimit the inline markup -syntax constructs. The text within inline markup may not begin or end -with whitespace. Arbitrary `character-level inline markup`_ is -supported although not encouraged. Inline markup cannot be nested. - -There are nine inline markup constructs. Five of the constructs use -identical start-strings and end-strings to indicate the markup: - -- emphasis_: "*" -- `strong emphasis`_: "**" -- `interpreted text`_: "`" -- `inline literals`_: "``" -- `substitution references`_: "|" - -Three constructs use different start-strings and end-strings: - -- `inline internal targets`_: "_`" and "`" -- `footnote references`_: "[" and "]_" -- `hyperlink references`_: "`" and "\`_" (phrases), or just a - trailing "_" (single words) - -`Standalone hyperlinks`_ are recognized implicitly, and use no extra -markup. - -The inline markup start-string and end-string recognition rules are as -follows. If any of the conditions are not met, the start-string or -end-string will not be recognized or processed. - -1. Inline markup start-strings must start a text block or be - immediately preceded by whitespace or one of:: - - ' " ( [ { < - / : - -2. Inline markup start-strings must be immediately followed by - non-whitespace. - -3. Inline markup end-strings must be immediately preceded by - non-whitespace. - -4. Inline markup end-strings must end a text block or be immediately - followed by whitespace or one of:: - - ' " ) ] } > - / : . , ; ! ? \ - -5. If an inline markup start-string is immediately preceded by a - single or double quote, "(", "[", "{", or "<", it must not be - immediately followed by the corresponding single or double quote, - ")", "]", "}", or ">". - -6. An inline markup end-string must be separated by at least one - character from the start-string. - -7. An unescaped backslash preceding a start-string or end-string will - disable markup recognition, except for the end-string of `inline - literals`_. See `Escaping Mechanism`_ above for details. - -For example, none of the following are recognized as containing inline -markup start-strings: - -- asterisks: * "*" '*' (*) (* [*] {*} 1*x BOM32_* -- double asterisks: ** a**b O(N**2) etc. -- backquotes: ` `` etc. -- underscores: _ __ __init__ __init__() etc. -- vertical bars: | || etc. - -It may be desirable to use inline literals for some of these anyhow, -especially if they represent code snippets. It's a judgment call. - -These cases *do* require either literal-quoting or escaping to avoid -misinterpretation:: - - *4, class_, *args, **kwargs, `TeX-quoted', *ML, *.txt - -The inline markup recognition rules were devised intentionally to -allow 90% of non-markup uses of "*", "`", "_", and "|" *without* -resorting to backslashes. For 9 of the remaining 10%, use inline -literals or literal blocks:: - - "``\*``" -> "\*" (possibly in another font or quoted) - -Only those who understand the escaping and inline markup rules should -attempt the remaining 1%. ;-) - -Inline markup delimiter characters are used for multiple constructs, -so to avoid ambiguity there must be a specific recognition order for -each character. The inline markup recognition order is as follows: - -- Asterisks: `Strong emphasis`_ ("**") is recognized before emphasis_ - ("*"). - -- Backquotes: `Inline literals`_ ("``"), `inline internal targets`_ - (leading "_`", trailing "`"), are mutually independent, and are - recognized before phrase `hyperlink references`_ (leading "`", - trailing "\`_") and `interpreted text`_ ("`"). - -- Trailing underscores: Footnote references ("[" + label + "]_") and - simple `hyperlink references`_ (name + trailing "_") are mutually - independent. - -- Vertical bars: `Substitution references`_ ("|") are independently - recognized. - -- `Standalone hyperlinks`_ are the last to be recognized. - - -Character-Level Inline Markup ------------------------------ - -It is possible to mark up individual characters within a word with -backslash escapes (see `Escaping Mechanism`_ above). Backslash -escapes can be used to allow arbitrary text to immediately follow -inline markup:: - - Python ``list``\s use square bracket syntax. - -The backslash will disappear from the processed document. The word -"list" will appear as inline literal text, and the letter "s" will -immediately follow it as normal text, with no space in-between. - -Arbitrary text may immediately precede inline markup using -backslash-escaped whitespace:: - - Possible in *re*\ ``Structured``\ *Text*, though not encouraged. - -The backslashes and spaces separating "re", "Structured", and "Text" -above will disappear from the processed document. - -.. CAUTION:: - - The use of backslash-escapes for character-level inline markup is - not encouraged. Such use is ugly and detrimental to the - unprocessed document's readability. Please use this feature - sparingly and only where absolutely necessary. - - -Emphasis --------- - -Doctree element: emphasis. - -Start-string = end-string = "*". - -Text enclosed by single asterisk characters is emphasized:: - - This is *emphasized text*. - -Emphasized text is typically displayed in italics. - - -Strong Emphasis ---------------- - -Doctree element: strong. - -Start-string = end-string = "**". - -Text enclosed by double-asterisks is emphasized strongly:: - - This is **strong text**. - -Strongly emphasized text is typically displayed in boldface. - - -Interpreted Text ----------------- - -Doctree element: depends on the explicit or implicit role and -processing. - -Start-string = end-string = "`". - -Interpreted text is text that is meant to be related, indexed, linked, -summarized, or otherwise processed, but the text itself is typically -left alone. Interpreted text is enclosed by single backquote -characters:: - - This is `interpreted text`. - -The "role" of the interpreted text determines how the text is -interpreted. The role may be inferred implicitly (as above; the -"default role" is used) or indicated explicitly, using a role marker. -A role marker consists of a colon, the role name, and another colon. -A role name is a single word consisting of alphanumerics plus internal -hyphens, underscores, and periods; no whitespace or other characters -are allowed. A role marker is either a prefix or a suffix to the -interpreted text, whichever reads better; it's up to the author:: - - :role:`interpreted text` - - `interpreted text`:role: - -Interpreted text allows extensions to the available inline descriptive -markup constructs. To emphasis_, `strong emphasis`_, `inline -literals`_, and `hyperlink references`_, we can add "title reference", -"index entry", "acronym", "class", "red", "blinking" or anything else -we want. Only pre-determined roles are recognized; unknown roles will -generate errors. A core set of standard roles is implemented in the -reference parser; see `reStructuredText Interpreted Text Roles`_ for -individual descriptions. In addition, applications may support -specialized roles. - - -Inline Literals ---------------- - -Doctree element: literal. - -Start-string = end-string = "``". - -Text enclosed by double-backquotes is treated as inline literals:: - - This text is an example of ``inline literals``. - -Inline literals may contain any characters except two adjacent -backquotes in an end-string context (according to the recognition -rules above). No markup interpretation (including backslash-escape -interpretation) is done within inline literals. - -Line breaks are *not* preserved in inline literals. Although a -reStructuredText parser will preserve runs of spaces in its output, -the final representation of the processed document is dependent on the -output formatter, thus the preservation of whitespace cannot be -guaranteed. If the preservation of line breaks and/or other -whitespace is important, `literal blocks`_ should be used. - -Inline literals are useful for short code snippets. For example:: - - The regular expression ``[+-]?(\d+(\.\d*)?|\.\d+)`` matches - floating-point numbers (without exponents). - - -Hyperlink References --------------------- - -Doctree element: reference. - -- Named hyperlink references: - - - Start-string = "" (empty string), end-string = "_". - - Start-string = "`", end-string = "\`_". (Phrase references.) - -- Anonymous hyperlink references: - - - Start-string = "" (empty string), end-string = "__". - - Start-string = "`", end-string = "\`__". (Phrase references.) - -Hyperlink references are indicated by a trailing underscore, "_", -except for `standalone hyperlinks`_ which are recognized -independently. The underscore can be thought of as a right-pointing -arrow. The trailing underscores point away from hyperlink references, -and the leading underscores point toward `hyperlink targets`_. - -Hyperlinks consist of two parts. In the text body, there is a source -link, a reference name with a trailing underscore (or two underscores -for `anonymous hyperlinks`_):: - - See the Python_ home page for info. - -A target link with a matching reference name must exist somewhere else -in the document. See `Hyperlink Targets`_ for a full description). - -`Anonymous hyperlinks`_ (which see) do not use reference names to -match references to targets, but otherwise behave similarly to named -hyperlinks. - - -Embedded URIs -````````````` - -A hyperlink reference may directly embed a target URI inline, within -angle brackets ("<...>") as follows:: - - See the `Python home page <http://www.python.org>`_ for info. - -This is exactly equivalent to:: - - See the `Python home page`_ for info. - - .. _Python home page: http://www.python.org - -The bracketed URI must be preceded by whitespace and be the last text -before the end string. With a single trailing underscore, the -reference is named and the same target URI may be referred to again. - -With two trailing underscores, the reference and target are both -anonymous, and the target cannot be referred to again. These are -"one-off" hyperlinks. For example:: - - `RFC 2396 <http://www.rfc-editor.org/rfc/rfc2396.txt>`__ and `RFC - 2732 <http://www.rfc-editor.org/rfc/rfc2732.txt>`__ together - define the syntax of URIs. - -Equivalent to:: - - `RFC 2396`__ and `RFC 2732`__ together define the syntax of URIs. - - __ http://www.rfc-editor.org/rfc/rfc2396.txt - __ http://www.rfc-editor.org/rfc/rfc2732.txt - -If reference text happens to end with angle-bracketed text that is -*not* a URI, the open-angle-bracket needs to be backslash-escaped. -For example, here is a reference to a title describing a tag:: - - See `HTML Element: \<a>`_ below. - -.. CAUTION:: - - This construct offers easy authoring and maintenance of hyperlinks - at the expense of general readability. Inline URIs, especially - long ones, inevitably interrupt the natural flow of text. For - documents meant to be read in source form, the use of independent - block-level `hyperlink targets`_ is **strongly recommended**. The - embedded URI construct is most suited to documents intended *only* - to be read in processed form. - - -Inline Internal Targets ------------------------- - -Doctree element: target. - -Start-string = "_`", end-string = "`". - -Inline internal targets are the equivalent of explicit `internal -hyperlink targets`_, but may appear within running text. The syntax -begins with an underscore and a backquote, is followed by a hyperlink -name or phrase, and ends with a backquote. Inline internal targets -may not be anonymous. - -For example, the following paragraph contains a hyperlink target named -"Norwegian Blue":: - - Oh yes, the _`Norwegian Blue`. What's, um, what's wrong with it? - -See `Implicit Hyperlink Targets`_ for the resolution of duplicate -reference names. - - -Footnote References -------------------- - -Doctree element: footnote_reference. - -Start-string = "[", end-string = "]_". - -Each footnote reference consists of a square-bracketed label followed -by a trailing underscore. Footnote labels are one of: - -- one or more digits (i.e., a number), - -- a single "#" (denoting `auto-numbered footnotes`_), - -- a "#" followed by a simple reference name (an `autonumber label`_), - or - -- a single "*" (denoting `auto-symbol footnotes`_). - -For example:: - - Please RTFM [1]_. - - .. [1] Read The Fine Manual - - -Citation References -------------------- - -Doctree element: citation_reference. - -Start-string = "[", end-string = "]_". - -Each citation reference consists of a square-bracketed label followed -by a trailing underscore. Citation labels are simple `reference -names`_ (case-insensitive single words, consisting of alphanumerics -plus internal hyphens, underscores, and periods; no whitespace). - -For example:: - - Here is a citation reference: [CIT2002]_. - -See Citations_ for the citation itself. - - -Substitution References ------------------------ - -Doctree element: substitution_reference, reference. - -Start-string = "|", end-string = "|" (optionally followed by "_" or -"__"). - -Vertical bars are used to bracket the substitution reference text. A -substitution reference may also be a hyperlink reference by appending -a "_" (named) or "__" (anonymous) suffix; the substitution text is -used for the reference text in the named case. - -The processing system replaces substitution references with the -processed contents of the corresponding `substitution definitions`_ -(which see for the definition of "correspond"). Substitution -definitions produce inline-compatible elements. - -Examples:: - - This is a simple |substitution reference|. It will be replaced by - the processing system. - - This is a combination |substitution and hyperlink reference|_. In - addition to being replaced, the replacement text or element will - refer to the "substitution and hyperlink reference" target. - - -Standalone Hyperlinks ---------------------- - -Doctree element: reference. - -Start-string = end-string = "" (empty string). - -A URI (absolute URI [#URI]_ or standalone email address) within a text -block is treated as a general external hyperlink with the URI itself -as the link's text. For example:: - - See http://www.python.org for info. - -would be marked up in HTML as:: - - See <a href="http://www.python.org">http://www.python.org</a> for - info. - -Two forms of URI are recognized: - -1. Absolute URIs. These consist of a scheme, a colon (":"), and a - scheme-specific part whose interpretation depends on the scheme. - - The scheme is the name of the protocol, such as "http", "ftp", - "mailto", or "telnet". The scheme consists of an initial letter, - followed by letters, numbers, and/or "+", "-", ".". Recognition is - limited to known schemes, per the W3C's `Index of WWW Addressing - Schemes`_. - - The scheme-specific part of the resource identifier may be either - hierarchical or opaque: - - - Hierarchical identifiers begin with one or two slashes and may - use slashes to separate hierarchical components of the path. - Examples are web pages and FTP sites:: - - http://www.python.org - - ftp://ftp.python.org/pub/python - - - Opaque identifiers do not begin with slashes. Examples are - email addresses and newsgroups:: - - mailto:someone@somewhere.com - - news:comp.lang.python - - With queries, fragments, and %-escape sequences, URIs can become - quite complicated. A reStructuredText parser must be able to - recognize any absolute URI, as defined in RFC2396_ and RFC2732_. - -2. Standalone email addresses, which are treated as if they were - absolute URIs with a "mailto:" scheme. Example:: - - someone@somewhere.com - -Punctuation at the end of a URI is not considered part of the URI. - -.. [#URI] Uniform Resource Identifier. URIs are a general form of - URLs (Uniform Resource Locators). For the syntax of URIs see - RFC2396_ and RFC2732_. - - ----------------- - Error Handling ----------------- - -Doctree element: system_message, problematic. - -Markup errors are handled according to the specification in `PEP -258`_. - - -.. _reStructuredText: http://docutils.sourceforge.net/rst.html -.. _Docutils: http://docutils.sourceforge.net/ -.. _The Docutils Document Tree: ../doctree.html -.. _Docutils Generic DTD: ../gpdi.dtd -.. _transforms: - http://docutils.sourceforge.net/docutils/transforms/ -.. _Grouch: http://www.mems-exchange.org/software/grouch/ -.. _RFC822: http://www.rfc-editor.org/rfc/rfc822.txt -.. _DocTitle transform: -.. _DocInfo transform: - http://docutils.sourceforge.net/docutils/transforms/frontmatter.py -.. _getopt.py: - http://www.python.org/doc/current/lib/module-getopt.html -.. _GNU libc getopt_long(): - http://www.gnu.org/manual/glibc-2.2.3/html_node/libc_516.html -.. _doctest module: - http://www.python.org/doc/current/lib/module-doctest.html -.. _Emacs table mode: http://table.sourceforge.net/ -.. _Index of WWW Addressing Schemes: - http://www.w3.org/Addressing/schemes.html -.. _World Wide Web Consortium: http://www.w3.org/ -.. _HTML Techniques for Web Content Accessibility Guidelines: - http://www.w3.org/TR/WCAG10-HTML-TECHS/#link-text -.. _reStructuredText Directives: directives.html -.. _reStructuredText Interpreted Text Roles: interpreted.html -.. _RFC2396: http://www.rfc-editor.org/rfc/rfc2396.txt -.. _RFC2732: http://www.rfc-editor.org/rfc/rfc2732.txt -.. _Zope: http://www.zope.com/ -.. _PEP 258: http://docutils.sourceforge.net/spec/pep-0258.txt - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: diff --git a/docutils/docs/ref/rst/roles.txt b/docutils/docs/ref/rst/roles.txt deleted file mode 100644 index a34c4a5ed..000000000 --- a/docutils/docs/ref/rst/roles.txt +++ /dev/null @@ -1,175 +0,0 @@ -========================================= - reStructuredText Interpreted Text Roles -========================================= -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This document has been placed in the public domain. - -This document describes the interpreted text roles implemented in the -reference reStructuredText parser. - -Interpreted text uses backquotes (`) around the text. An explicit -role marker may optionally appear before or after the text, delimited -with colons. For example:: - - This is `interpreted text` using the default role. - - This is :title:`interpreted text` using an explicit role. - -A default role may be defined by applications of reStructuredText; it -is used if no explicit ``:role:`` prefix or suffix is given. The -"default default role" is `:title-reference:`_. - -See the `Interpreted Text`_ section in the `reStructuredText Markup -Specification`_ for syntax details. - -.. _Interpreted Text: ./reStructuredText.html#interpreted-text -.. _reStructuredText Markup Specification: ./reStructuredText.html - - -.. contents:: - - -``:emphasis:`` -============== - -:Aliases: None -:DTD Element: emphasis - -Implements emphasis. These are equivalent:: - - *text* - :emphasis:`text` - - -``:literal:`` -============== - -:Aliases: None -:DTD Element: literal - -Implements inline literal text. These are equivalent:: - - ``text`` - :literal:`text` - -Care must be taken with backslash-escapes though. These are *not* -equivalent:: - - ``text \ and \ backslashes`` - :literal:`text \ and \ backslashes` - -The backslashes in the first line are preserved (and do nothing), -whereas the backslashes in the second line escape the following -spaces. - - -``:pep-reference:`` -=================== - -:Aliases: ``:PEP:`` -:DTD Element: reference - -The ``:pep-reference:`` role is used to create an HTTP reference to a -PEP (Python Enhancement Proposal). The ``:PEP:`` alias is usually -used. For example:: - - See :PEP:`287` for more information about reStructuredText. - -This is equivalent to:: - - See `PEP 287`__ for more information about reStructuredText. - - __ http://www.python.org/peps/pep-0287.html - - -``:rfc-reference:`` -=================== - -:Aliases: ``:RFC:`` -:DTD Element: reference - -The ``:rfc-reference:`` role is used to create an HTTP reference to an -RFC (Internet Request for Comments). The ``:RFC:`` alias is usually -used. For example:: - - See :RFC:`2822` for information about email headers. - -This is equivalent to:: - - See `RFC 2822`__ for information about email headers. - - __ http://www.faqs.org/rfcs/rfc2822.html - - -``:strong:`` -============ - -:Aliases: None -:DTD Element: strong - -Implements strong emphasis. These are equivalent:: - - **text** - :strong:`text` - - -``:subscript:`` -=============== - -:Aliases: ``:sub:`` -:DTD Element: subscript - -Implements subscripts. - - -``:superscript:`` -================= - -:Aliases: ``:sup:`` -:DTD Element: superscript - -Implements superscripts. - - -``:title-reference:`` -===================== - -:Aliases: ``:title:``, ``:t:``. -:DTD Element: title_reference - -The ``:title-reference:`` role is used to describe the titles of -books, periodicals, and other materials. It is the equivalent of the -HTML "cite" element, and it is expected that HTML writers will -typically render "title_reference" elements using "cite". - -Since title references are typically rendered with italics, they are -often marked up using ``*emphasis*``, which is misleading and vague. -The "title_reference" element provides accurate and unambiguous -descriptive markup. - -Let's assume ``:title-reference:`` is the default interpreted text -role (see below) for this example:: - - `Design Patterns` [GoF95]_ is an excellent read. - -The following document fragment (pseudo-XML_) will result from -processing:: - - <paragraph> - <title_reference> - Design Patterns - - <citation_reference refname="gof95"> - GoF95 - is an excellent read. - -``:title-reference:`` is the default interpreted text role in the -standard reStructuredText parser. This means that no explicit role is -required. Applications of reStructuredText may designate a different -default role, in which case the explicit role must be used. - - -.. _pseudo-XML: ../doctree.html#pseudo-xml diff --git a/docutils/docs/ref/soextblx.dtd b/docutils/docs/ref/soextblx.dtd deleted file mode 100644 index 56ba311ba..000000000 --- a/docutils/docs/ref/soextblx.dtd +++ /dev/null @@ -1,312 +0,0 @@ -<!-- -=========================================================================== - OASIS XML Exchange Table Model Declaration Module -=========================================================================== -:Date: 1999-03-15 ---> - -<!-- This set of declarations defines the XML version of the Exchange - Table Model as of the date shown in the Formal Public Identifier - (FPI) for this entity. - - This set of declarations may be referred to using a public external - entity declaration and reference as shown in the following three - lines: - - <!ENTITY % calstblx - PUBLIC "-//OASIS//DTD XML Exchange Table Model 19990315//EN"> - %calstblx; - - If various parameter entities used within this set of declarations - are to be given non-default values, the appropriate declarations - should be given before calling in this package (i.e., before the - "%calstblx;" reference). ---> - -<!-- The motivation for this XML version of the Exchange Table Model - is simply to create an XML version of the SGML Exchange Table - Model. By design, no effort has been made to "improve" the model. - - This XML version incorporates the logical bare minimum changes - necessary to make the Exchange Table Model a valid XML DTD. ---> - -<!-- The XML version of the Exchange Table Model differs from - the SGML version in the following ways: - - The following parameter entities have been removed: - - - tbl.table.excep, tbl.hdft.excep, tbl.row.excep, tbl.entry.excep - There are no exceptions in XML. The following normative statement - is made in lieu of exceptions: the exchange table model explicitly - forbids a table from occurring within another table. If the - content model of an entry includes a table element, then this - cannot be enforced by the DTD, but it is a deviation from the - exchange table model to include a table within a table. - - - tbl.hdft.name, tbl.hdft.mdl, tbl.hdft.excep, tbl.hdft.att - The motivation for these elements was to change the table - header/footer elements. Since XML does not allow element declarations - to contain name groups, and the exchange table model does not - allow a table to contain footers, the continued presence of these - attributes seems unnecessary. - - The following parameter entity has been added: - - - tbl.thead.att - This entity parameterizes the attributes on thead. It replaces - the tbl.hdft.att parameter entity. - - Other miscellaneous changes: - - - Tag ommission indicators have been removed - - Comments have been removed from declarations - - NUMBER attributes have been changed to NMTOKEN - - NUTOKEN attributes have been to changed to NMTOKEN - - Removed the grouping characters around the content model - parameter entry for the 'entry' element. This is necessary - so that an entry can contain #PCDATA and be defined as an - optional, repeatable OR group beginning with #PCDATA. ---> - -<!-- This entity includes a set of element and attribute declarations - that partially defines the Exchange table model. However, the model - is not well-defined without the accompanying natural language - description of the semantics (meanings) of these various elements, - attributes, and attribute values. The semantic writeup, also available - from SGML Open, should be used in conjunction with this entity. ---> - -<!-- In order to use the Exchange table model, various parameter entity - declarations are required. A brief description is as follows: - - ENTITY NAME WHERE USED WHAT IT IS - - %yesorno In ATTLIST of: An attribute declared value - almost all elements for a "boolean" attribute - - %paracon In content model of: The "text" (logical content) - <entry> of the model group for <entry> - - %titles In content model of: The "title" part of the model - table element group for the table element - - %tbl.table.name In declaration of: The name of the "table" - table element element - - %tbl.table-titles.mdl In content model of: The model group for the title - table elements part of the content model for - table element - - %tbl.table.mdl In content model of: The model group for the content - table elements model for table element, - often (and by default) defined - in terms of %tbl.table-titles.mdl - and tgroup - - %tbl.table.att In ATTLIST of: Additional attributes on the - table element table element - - %bodyatt In ATTLIST of: Additional attributes on the - table element table element (for backward - compatibility with the SGML - model) - - %tbl.tgroup.mdl In content model of: The model group for the content - <tgroup> model for <tgroup> - - %tbl.tgroup.att In ATTLIST of: Additional attributes on the -4 <tgroup> <tgroup> element - - %tbl.thead.att In ATTLIST of: Additional attributes on the - <thead> <thead> element - - %tbl.tbody.att In ATTLIST of: Additional attributes on the - <tbody> <tbody> element - - %tbl.colspec.att In ATTLIST of: Additional attributes on the - <colspec> <colspec> element - - %tbl.row.mdl In content model of: The model group for the content - <row> model for <row> - - %tbl.row.att In ATTLIST of: Additional attributes on the - <row> <row> element - - %tbl.entry.mdl In content model of: The model group for the content - <entry> model for <entry> - - %tbl.entry.att In ATTLIST of: Additional attributes on the - <entry> <entry> element - - This set of declarations will use the default definitions shown below - for any of these parameter entities that are not declared before this - set of declarations is referenced. ---> - -<!-- These definitions are not directly related to the table model, but are - used in the default CALS table model and may be defined elsewhere (and - prior to the inclusion of this table module) in the referencing DTD. --> - -<!ENTITY % yesorno 'NMTOKEN'> <!-- no if zero(s), yes if any other value --> -<!ENTITY % titles 'title?'> -<!ENTITY % paracon '#PCDATA'> <!-- default for use in entry content --> - -<!-- -The parameter entities as defined below change and simplify the CALS table -model as published (as part of the Example DTD) in MIL-HDBK-28001. The -resulting simplified DTD has support from the SGML Open vendors and is -therefore more interoperable among different systems. - -These following declarations provide the Exchange default definitions -for these entities. However, these entities can be redefined (by giving -the appropriate parameter entity declaration(s) prior to the reference -to this Table Model declaration set entity) to fit the needs of the -current application. - -Note, however, that changes may have significant effect on the ability to -interchange table information. These changes may manifest themselves -in useability, presentation, and possible structure information degradation. ---> - -<!ENTITY % tbl.table.name "table"> -<!ENTITY % tbl.table-titles.mdl "%titles;,"> -<!ENTITY % tbl.table-main.mdl "tgroup+"> -<!ENTITY % tbl.table.mdl "%tbl.table-titles.mdl; %tbl.table-main.mdl;"> -<!ENTITY % tbl.table.att " - pgwide %yesorno; #IMPLIED "> -<!ENTITY % bodyatt ""> -<!ENTITY % tbl.tgroup.mdl "colspec*,thead?,tbody"> -<!ENTITY % tbl.tgroup.att ""> -<!ENTITY % tbl.thead.att ""> -<!ENTITY % tbl.tbody.att ""> -<!ENTITY % tbl.colspec.att ""> -<!ENTITY % tbl.row.mdl "entry+"> -<!ENTITY % tbl.row.att ""> -<!ENTITY % tbl.entry.mdl "(%paracon;)*"> -<!ENTITY % tbl.entry.att ""> - -<!-- ===== Element and attribute declarations follow. ===== --> - -<!-- - Default declarations previously defined in this entity and - referenced below include: - ENTITY % tbl.table.name "table" - ENTITY % tbl.table-titles.mdl "%titles;," - ENTITY % tbl.table.mdl "%tbl.table-titles; tgroup+" - ENTITY % tbl.table.att " - pgwide %yesorno; #IMPLIED " ---> - -<!ELEMENT %tbl.table.name; (%tbl.table.mdl;)> - -<!ATTLIST %tbl.table.name; - frame (top|bottom|topbot|all|sides|none) #IMPLIED - colsep %yesorno; #IMPLIED - rowsep %yesorno; #IMPLIED - %tbl.table.att; - %bodyatt; -> - -<!-- - Default declarations previously defined in this entity and - referenced below include: - ENTITY % tbl.tgroup.mdl "colspec*,thead?,tbody" - ENTITY % tbl.tgroup.att "" ---> - -<!ELEMENT tgroup (%tbl.tgroup.mdl;) > - -<!ATTLIST tgroup - cols NMTOKEN #REQUIRED - colsep %yesorno; #IMPLIED - rowsep %yesorno; #IMPLIED - align (left|right|center|justify|char) #IMPLIED - %tbl.tgroup.att; -> - -<!-- - Default declarations previously defined in this entity and - referenced below include: - ENTITY % tbl.colspec.att "" ---> - -<!ELEMENT colspec EMPTY > - -<!ATTLIST colspec - colnum NMTOKEN #IMPLIED - colname NMTOKEN #IMPLIED - colwidth CDATA #IMPLIED - colsep %yesorno; #IMPLIED - rowsep %yesorno; #IMPLIED - align (left|right|center|justify|char) #IMPLIED - char CDATA #IMPLIED - charoff NMTOKEN #IMPLIED - %tbl.colspec.att; -> - -<!-- - Default declarations previously defined in this entity and - referenced below include: - ENTITY % tbl.thead.att "" ---> - -<!ELEMENT thead (row+)> - -<!ATTLIST thead - valign (top|middle|bottom) #IMPLIED - %tbl.thead.att; -> - -<!-- - Default declarations previously defined in this entity and - referenced below include: - ENTITY % tbl.tbody.att "" ---> - -<!ELEMENT tbody (row+)> - -<!ATTLIST tbody - valign (top|middle|bottom) #IMPLIED - %tbl.tbody.att; -> - -<!-- - Default declarations previously defined in this entity and - referenced below include: - ENTITY % tbl.row.mdl "entry+" - ENTITY % tbl.row.att "" ---> - -<!ELEMENT row (%tbl.row.mdl;)> - -<!ATTLIST row - rowsep %yesorno; #IMPLIED - valign (top|middle|bottom) #IMPLIED - %tbl.row.att; -> - - -<!-- - Default declarations previously defined in this entity and - referenced below include: - ENTITY % paracon "#PCDATA" - ENTITY % tbl.entry.mdl "(%paracon;)*" - ENTITY % tbl.entry.att "" ---> - -<!ELEMENT entry %tbl.entry.mdl;> - -<!ATTLIST entry - colname NMTOKEN #IMPLIED - namest NMTOKEN #IMPLIED - nameend NMTOKEN #IMPLIED - morerows NMTOKEN #IMPLIED - colsep %yesorno; #IMPLIED - rowsep %yesorno; #IMPLIED - align (left|right|center|justify|char) #IMPLIED - char CDATA #IMPLIED - charoff NMTOKEN #IMPLIED - valign (top|middle|bottom) #IMPLIED - %tbl.entry.att; -> diff --git a/docutils/docs/ref/transforms.txt b/docutils/docs/ref/transforms.txt deleted file mode 100644 index 4c5fe135a..000000000 --- a/docutils/docs/ref/transforms.txt +++ /dev/null @@ -1,103 +0,0 @@ -===================== - Docutils Transforms -===================== - -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This document has been placed in the public domain. - - -.. contents:: - - -For background about transforms and the Transformer object, see `PEP -258`_. - -.. _PEP 258: pep-0258.html#transformer - - -Transforms Listed in Priority Order -=================================== - -============================== ============================ ======== -Transform: module.Class Added By Priority -============================== ============================ ======== -misc.class "class" (d/p) 210 - -references.Substitutions standalone (r), pep (r) 220 - -frontmatter.DocTitle standalone (r) 320 - -frontmatter.DocInfo standalone (r) 340 - -peps.Headers pep (r) 360 - -peps.Contents pep (r) 380 - -references.ChainedTargets standalone (r), pep (r) 420 - -references.AnonymousHyperlinks standalone (r), pep (r) 440 - -references.IndirectHyperlinks standalone (r), pep (r) 460 - -peps.TargetNotes pep (r) 520 - -references.TargetNotes peps.TargetNotes (t/p) 0 - -misc.CallBack peps.TargetNotes (t/p) 1 - -references.TargetNotes "target-notes" (d/p) 540 - -references.Footnotes standalone (r), pep (r) 620 - -references.ExternalTargets standalone (r), pep (r) 640 - -references.InternalTargets standalone (r), pep (r) 660 - -parts.SectNum "sectnum" (d/p) 710 - -parts.Contents "contents" (d/p), 720 - peps.Contents (t/p) - -peps.PEPZero pep.Headers (t/p) 760 - -components.Filter "meta" (d/p) 780 - -universal.Decorations Transformer 820 - -universal.FinalChecks Transformer 840 - -universal.Messages Transformer 860 - -universal.TestMessages DocutilsTestSupport 890 - -misc.CallBack n/a 990 -============================== ============================ ======== - -Key: - -* (r): Reader -* (d): Directive -* (t): Transform -* (/p): Via a "pending" node - - -Transform Priority Range Categories -=================================== - -==== ==== ================================================ - Priority ----------- ------------------------------------------------ -From To Category -==== ==== ================================================ - 0 99 immediate execution (added by another transform) - 100 199 very early (non-standard) - 200 299 very early - 300 399 early - 400 699 main - 700 799 late - 800 899 very late - 900 999 very late (non-standard) -==== ==== ================================================ diff --git a/docutils/docs/user/latex.txt b/docutils/docs/user/latex.txt deleted file mode 100644 index 1b3d0b53b..000000000 --- a/docutils/docs/user/latex.txt +++ /dev/null @@ -1,263 +0,0 @@ -======================= - Docutils LaTex Writer -======================= - -:Author: Engelbert Gruber -:Contact: grubert@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This document has been placed in the public domain. - -.. contents:: - - -Introduction -============ - -Producing latex code from reST input could be done in at least two ways: - -a. Transform the internal markup into corresponding latex markup e.g. - a section title would be written as ```\section{this section ...}``. -b. Using latex as a typesetting system to produce desired paperwork - without caring about loosing document structure information. - -The former might be preferable, but limits to latexs capabilities, so -in reality it is a mix. - - -Options -======= - -Configuration can be done in two ways (again): - -1. Options to the docutils tool: e.g. language selection. -2. Options to latex via the stylesheet file. - -The generated latex documents should be kept processable by a standard -latex installation (if such a thing exists), therefore the document -contains default settings. To allow *overwriting defaults* the stylesheet -is included at last. - -Options on the Commandline --------------------------- - -===================== ================================================ -Setting/Config Entry Description -===================== ================================================ ---use-latex-toc To get pagenumbers in the table of contents the - table of contents must be generated by latex. - Usually latex must be run twice to get numbers - correct. ---------------------- ------------------------------------------------ ---hyperlink-color Color of any hyperlinks embedded in text - (default: "blue", "0" to disable). ---------------------- ------------------------------------------------ ---documentclass Specify latex documentclass, *but* beaware that - books have chapters articles not. - (default: "article"). ---------------------- ------------------------------------------------ ---stylesheet Specify a stylesheet file. The file will be - ``input`` by latex in the document header. - If this is set to "" disables generation of - input latex command. - (default: "style.tex"). ---------------------- ------------------------------------------------ ---footnote-references Format for footnote references: one of - "superscript" or "brackets". - Default is "brackets". ---------------------- ------------------------------------------------ ---attribution Format for block quote attributions: one of - "dash" (em-dash prefix), "parentheses"/"parens", - or "none". - - Default: "dash". Options: ``--attribution``. -===================== ================================================ - - -Options in the Stylesheet -------------------------- - -===================== ================================================ -Setting/Config Entry Description -===================== ================================================ -papersize Default: a4paper. Paper geometry can be changed - using ``\geometry{xxx}`` entries. - - Some possibilities: - - * a4paper, b3paper, letterpaper, executivepaper, - legalpaper - * landscape, portrait, twoside. - - and a ton of other option setting margins. - - An example:: - - \geometry{a5paper,landscape} ---------------------- ------------------------------------------------ -paragraph indent By default latex indents the forst line in a - paragraph. The following lines set indentation - to zero but add a vertical space between - paragraphs.:: - - \setlength{\parindent}{0pt} - \setlength{\parskip}{6pt plus 2pt minus 1pt} ---------------------- ------------------------------------------------ -admonitionwidth The width for admonitions. - Default: 0.9*textwidth, this can be changed - e.g.:: - - \setlength{\admonitionwidth}{0.7\textwidth} ---------------------- ------------------------------------------------ -docinfowidth The width for the docinfo table. - Default: 0.9*textwidth, changed to e.g.:: - - \setlength{\docinfowidth}{0.7\textwidth} ---------------------- ------------------------------------------------ -rubric style The header contains the definition of a new - LaTeX command rubric. Inserting:: - - \renewcommand{\rubric}[1]{\subsection*{ - ~\hfill {\color{red} #1} \hfill ~}} - - sets rubric to subsection style in red. - - Default: subsection style italic. ---------------------- ------------------------------------------------ -font selection see below -===================== ================================================ - -Missing options ---------------- - -* Selection of latex fontsize. -* Assumed reST linelength for table width setting. - -Font selection --------------- - -When generating pdf-files from LaTeX, use the pdflatex command, the files -are a lot smaller if postscript fonts are used. To do so put -``\usepackage{times}`` into the styleshee - -It is said that the typewriter font in computer modern font, the default -LaTeX font package, is too heavy compared to the others. There is a package -or some commands too fix this, which i currently cannot find. - -Some people diagnose a similar unbalance for the postscript fonts, the -package to fix this is ```\usepackage{pslatex}``. - - -Commands directly to LaTeX -========================== - -By means of the reST-raw directive one can give commands directly to -LaTeX, e.g. forcing a page break:: - - .. raw:: latex - - \newpage - - -Or setting formulas in LaTeX:: - - .. raw:: latex - - $$x^3 + 3x^2a + 3xa^2 + a^3,$$ - - -Or making a colorbox: If someone wants to get a red background for a textblock, -she/he can put \definecolor{bg}{rgb}{.9,0,0} into style.tex and in -reStructuredText do something like this:: - - |begincolorbox| - Nobody expects the spanish inquisition. - |endcolorbox| - - .. |begincolorbox| raw:: latex - - \\begin{center} - \\colorbox{bg}{ - \\parbox{0.985\\linewidth}{ - - .. |endcolorbox| raw:: latex - - }} - \\end{center} - - -Problems -======== - -Open to be fixed or open to discussion. - -Tables ------- - -:Tablewidth: reST-documents line length is assumed to be 80 characters. The - tablewidth is set relative to this value. If someone produces - documents with line length of 132 this will fail. - - Table width is tried to fit in page even if it is wider than - the assumed linewidth, still assumed linewidth is a hook. - -* In tools.txt the option tables right column, there should be some more spacing - between the description and the next paragraph "Default:". - - Paragraph separation in tables is hairy. - see http://www.tex.ac.uk/cgi-bin/texfaq2html?label=struttab - - - The strut solution did not work. - - setting extrarowheight added ad top of row not between paragraphs in - a cell. ALTHOUGH i set it to 2pt because, text is too close to the topline. - - baselineskip/stretch does not help. -* Should there be two hlines after table head and on table end ? -* Table: multicol cells are always {l}. -* Table heads and footer for longtable (firstpage lastpage ..). -* Longtable does not work with multirow -* Tabularx says "do not use any multicolmn which spans any X column. - maybe use ltxtable instead of tabularx (Longtable combined with tabularx). - but ltxtable disables longtable's multicolumn. -* Table cells with multirow and multicolumn -* Tables have borders, and the border is missing in empty cells. - - -Miscellaneous -------------- - -* recongize LaTeX (or even latex) and replace by ```\LaTeX``. -* Support embed-stylesheet. -* the ^-sign is problematic: using mathmode wedge is usually the wrong font. -* Sidebar handling. -* Maybe add end of line after term in definition list. see - http://roundup.sf.net/doc-0.5/features.pdf -* Pdfbookmark level 4 (and greater) does not work (might be settable but OTOH). -* center subsection{Abstract} gives a latex error here. - ``! LaTeX Error: Something's wrong--perhaps a missing \item.`` - Committed a HACK: centering by hfill. -* Document errors are also too silent. -* Use optionlist for docinfo, the table does only work for single page. -* Consider peter funk's hooks for TeXpert: - - * Define his own document preamble (including the choice to - choose his own documentclass. That would make the ``--documentclass`` - option superfluous). I suggest to call this option ``--preamble`` - * Use two additional hooks to put additional stuff just behind the - ``\begin{document}`` and just before the ``\end{document}`` macros. - Typical uses would be ``\tableofcontents``, ``\listoffigures`` and - ``\appendix``, ``\makeindex``, ``\makeglossary`` and some such - for larger documents. - -* Hyphens: co-developers should be co--developers ? -* The indentional problematic error in test.txt is not referring anywhere. -* Footnotes are not all on the same page (as in tools/test.txt) and do not link back - and forth. -* No link to system errors. -* Hyperlinks are not hyphenated this leads to bad spacing. see tools/test.txt - 2.14 directives directives -* Meta keywords into pdf ? -* Pagestyle headings does not work, when sections are starred. -* For additional docinfo items: the field_body is inserted as text, i.e. no - markup is done. -* Multiple author entries in docinfo (same thing as in html). - diff --git a/docutils/docs/user/rst/images/ball1.gif b/docutils/docs/user/rst/images/ball1.gif deleted file mode 100644 index 3e14441d9..000000000 Binary files a/docutils/docs/user/rst/images/ball1.gif and /dev/null differ diff --git a/docutils/docs/user/rst/images/biohazard.png b/docutils/docs/user/rst/images/biohazard.png deleted file mode 100644 index ae4629d8b..000000000 Binary files a/docutils/docs/user/rst/images/biohazard.png and /dev/null differ diff --git a/docutils/docs/user/rst/images/title.png b/docutils/docs/user/rst/images/title.png deleted file mode 100644 index cc6218efe..000000000 Binary files a/docutils/docs/user/rst/images/title.png and /dev/null differ diff --git a/docutils/docs/user/rst/quickref.html b/docutils/docs/user/rst/quickref.html deleted file mode 100644 index b60cbf1b0..000000000 --- a/docutils/docs/user/rst/quickref.html +++ /dev/null @@ -1,1243 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> -<html> - <head> - <title>Quick reStructuredText - - - - - - -

Quick reStructuredText

- - - - -

http://docutils.sourceforge.net/docs/rst/quickref.html -
Being a cheat-sheet for reStructuredText -
Updated 2003-06-10 - -

-

Copyright: This document has been placed in the public domain. -

- - -

The full details of the markup may be found on the - reStructuredText - page. This document is just intended as a reminder. - -

Links that look like "(details)" point - into the HTML version of the full reStructuredText - specification document. These are relative links; if they - don't work, please use the master "Quick reStructuredText" document. - -

Contents

- - - -

Inline Markup

- -

(details) - -

Inline markup allows words and phrases within text to have - character styles (like italics and boldface) and functionality - (like hyperlinks). - -

- - - - - - - - - - - - - - - - -
Plain text - Typical result - Notes -
*emphasis* - emphasis - Normally rendered as italics. - -
**strong emphasis** - strong emphasis - Normally rendered as boldface. - -
`interpreted text` - (see note at right) - The rendering and meaning of interpreted text is - domain- or application-dependent. It can be used for things - like index entries or explicit descriptive markup (like program - identifiers). - -
``inline literal`` - inline literal - Normally rendered as monospaced text. Spaces should be - preserved, but line breaks will not be. - -
reference_ - reference - A simple, one-word hyperlink reference. See Hyperlinks. - -
`phrase reference`_ - phrase reference - A hyperlink reference with spaces or punctuation needs to be - quoted with backquotes. See Hyperlinks. - -
anonymous__ - anonymous - With two underscores instead of one, both simple and phrase - references may be anonymous (the reference text is not repeated - at the target). See Hyperlinks. - -
_`inline internal target` - inline internal target - A crossreference target within text. - See Hyperlinks. - -
|substitution reference| - (see note at right) - The result is substituted in from the substitution - definition. It could be text, an image, a hyperlink, or a - combination of these and others. - -
footnote reference [1]_ - footnote reference 1 - See Footnotes. - -
citation reference [CIT2002]_ - citation reference [CIT2002] - See Citations. - -
http://docutils.sf.net/ - http://docutils.sf.net/ - A standalone hyperlink. - -
- -

Asterisk, backquote, vertical bar, and underscore are inline - delimiter characters. Asterisk, backquote, and vertical bar act - like quote marks; matching characters surround the marked-up word - or phrase, whitespace or other quoting is required outside them, - and there can't be whitespace just inside them. If you want to use - inline delimiter characters literally, escape - (with backslash) or quote them (with double backquotes; i.e. - use inline literals). - -

In detail, the reStructuredText specification says that in - inline markup, the following rules apply to start-strings and - end-strings (inline markup delimiters): - -

    -
  1. The start-string must start a text block or be - immediately preceded by whitespace or any of  - ' " ( [ { or <. -
  2. The start-string must be immediately followed by non-whitespace. -
  3. The end-string must be immediately preceded by non-whitespace. -
  4. The end-string must end a text block (end of document or - followed by a blank line) or be immediately followed by whitespace - or any of ' " . , : ; ! ? - ) ] } / \ - or >. -
  5. If a start-string is immediately preceded by one of  - ' " ( [ { or <, it must not be - immediately followed by the corresponding character from  - ' " ) ] } or >. -
  6. An end-string must be separated by at least one - character from the start-string. -
  7. An unescaped backslash preceding a - start-string or end-string will disable markup recognition, except - for the end-string of inline literals. -
- -

Also remember that inline markup may not be nested (well, - except that inline literals can contain any of the other inline - markup delimiter characters, but that doesn't count because - nothing is processed). - -

Escaping with Backslashes

- -

(details) - -

reStructuredText uses backslashes ("\") to override the special - meaning given to markup characters and get the literal characters - themselves. To get a literal backslash, use an escaped backslash - ("\\"). For example: - -

- - - - -
Raw reStructuredText - Typical result -
- *escape* ``with`` "\" - escape with "" -
- \*escape* \``with`` "\\" - *escape* ``with`` "\" -
- -

In Python strings it will, of course, be necessary - to escape any backslash characters so that they actually - reach reStructuredText. - The simplest way to do this is to use raw strings: - -

- - - - -
Python string - Typical result -
- r"""\*escape* \`with` "\\"""" - *escape* `with` "\" -
-  """\\*escape* \\`with` "\\\\"""" - *escape* `with` "\" -
-  """\*escape* \`with` "\\"""" - escape with "" -
- -

Section Structure

- -

(details) - -

- - - - - -
Plain text - Typical result -
-===== -
Title -
===== -
Subtitle -
-------- -
Titles are underlined (or over- -
and underlined) with a printing -
nonalphanumeric 7-bit ASCII -
character. Recommended choices -
are "``= - ` : ' " ~ ^ _ * + # < >``". -
The underline/overline must be at -
least as long as the title text. - -
- Title -

Subtitle -

Titles are underlined (or over- - and underlined) with a printing - nonalphanumeric 7-bit ASCII - character. Recommended choices - are "= - ` : ' " ~ ^ _ * + # < >". - The underline/overline must be at - least as long as the title text. -

- -

Paragraphs

- -

(details) - -

- - - - - -
Plain text - Typical result -
-

This is a paragraph. - -

Paragraphs line up at their left -
edges, and are normally separated -
by blank lines. - -

-

This is a paragraph. - -

Paragraphs line up at their left edges, and are normally - separated by blank lines. - -

- -

Bullet Lists

- -

(details) - -

- - - - - -
Plain text - Typical result -
-Bullet lists: - -

- This is item 1 -
- This is item 2 - -

- Bullets are "-", "*" or "+". -
  Continuing text must be aligned -
  after the bullet and whitespace. - -

Note that a blank line is required -
before the first item and after the -
last, but is optional between items. -

Bullet lists: -
    -
  • This is item 1 -
  • This is item 2 -
  • Bullets are "-", "*" or "+". - Continuing text must be aligned - after the bullet and whitespace. -
-

Note that a blank line is required before the first - item and after the last, but is optional between items. -

- -

Enumerated Lists

- -

(details) - -

- - - - - -
Plain text - Typical result -
-Enumerated lists: - -

3. This is the first item -
4. This is the second item -
5. Enumerators are arabic numbers, -
   single letters, or roman numerals -
6. List items should be sequentially -
   numbered, but need not start at 1 -
   (although not all formatters will -
   honour the first index). -

Enumerated lists: -
    -
  1. This is the first item -
  2. This is the second item -
  3. Enumerators are arabic numbers, single letters, - or roman numerals -
  4. List items should be sequentially numbered, - but need not start at 1 (although not all - formatters will honour the first index). -
-
- -

Definition Lists

- -

(details) - -

- - - - - -
Plain text - Typical result -
-Definition lists: -
-
what -
  Definition lists associate a term with -
  a definition. -
-
how -
  The term is a one-line phrase, and the -
  definition is one or more paragraphs or -
  body elements, indented relative to the -
  term. Blank lines are not allowed -
  between term and definition. -
Definition lists: -
-
what -
Definition lists associate a term with - a definition. - -
how -
The term is a one-line phrase, and the - definition is one or more paragraphs or - body elements, indented relative to the - term. Blank lines are not allowed - between term and definition. -
-
- -

Field Lists

- -

(details) - -

- - - - - -
Plain text - Typical result -
-:Authors: -
    Tony J. (Tibs) Ibbs, -
    David Goodger - -

    (and sundry other good-natured folks) - -

:Version: 1.0 of 2001/08/08 -
:Dedication: To my father. -

- - -
Authors: - Tony J. (Tibs) Ibbs, - David Goodger -
(and sundry other good-natured folks) -
Version:1.0 of 2001/08/08 -
Dedication:To my father. -
-
- -

Field lists are used as part of an extension syntax, such as - options for directives, or database-like - records meant for further processing. Field lists may also be - used as generic two-column table constructs in documents. - -

Option Lists

- -

(details) - -

- - - - - -
Plain text - Typical result -
-

--a            command-line option "a" -
-b file       options can have arguments -
              and long descriptions -
--long        options can be long also -
--input=file  long options can also have -
              arguments -
/V            DOS/VMS-style options too -
- -

- - - - - - - -

-a -

command-line option "a" -

-b file -

options can have arguments and long descriptions -

--long -

options can be long also -

--input=file -

long options can also have arguments -

/V -

DOS/VMS-style options too -

-
- -

There must be at least two spaces between the option and the - description. - -

Literal Blocks

- -

(details) - -

- - - - - -
Plain text - Typical result -
-A paragraph containing only two colons -
indicates that the following indented -
text is a literal block. -
-
:: -
-
  Whitespace, newlines, blank lines, and -
  all kinds of markup (like *this* or -
  \this) is preserved by literal blocks. -
-
  The paragraph containing only '::' -
  will be omitted from the result. -
-
The ``::`` may be tacked onto the very -
end of any paragraph. The ``::`` will be -
omitted if it is preceded by whitespace. -
The ``::`` will be converted to a single -
colon if preceded by text, like this:: -
-
  It's very convenient to use this form. -
-
Literal blocks end when text returns to -
the preceding paragraph's indentation. -
This means that something like:: -
-
      We start here -
    and continue here -
  and end here. -
-
is possible. - -
-

A paragraph containing only two colons -indicates that the following indented -text is a literal block. - -

-  Whitespace, newlines, blank lines, and
-  all kinds of markup (like *this* or
-  \this) is preserved by literal blocks.
-
-  The paragraph containing only '::'
-  will be omitted from the result.
- -

The :: may be tacked onto the very -end of any paragraph. The :: will be -omitted if it is preceded by whitespace. -The :: will be converted to a single -colon if preceded by text, like this: - -

-  It's very convenient to use this form.
- -

Literal blocks end when text returns to -the preceding paragraph's indentation. -This means that something like: - -

-      We start here
-    and continue here
-  and end here.
- -

is possible. -

- -

Block Quotes

- -

(details) - -

- - - - - -
Plain text - Typical result -
-Block quotes are just: - -

    Indented paragraphs, - -

        and they may nest. -

- Block quotes are just: -
-

Indented paragraphs, -

-

and they may nest. -

-
-
- -

Doctest Blocks

- -

(details) - -

- - - - - -
Plain text - Typical result -
-

Doctest blocks are interactive -
Python sessions. They begin with -
"``>>>``" and end with a blank line.
- -

>>> print "This is a doctest block." -
This is a doctest block.
- -

-

Doctest blocks are interactive - Python sessions. They begin with - ">>>" and end with a blank line. - -

>>> print "This is a doctest block." -
This is a doctest block.
-

- -

"The doctest - module searches a module's docstrings for text that looks like an - interactive Python session, then executes all such sessions to - verify they still work exactly as shown." (From the doctest docs.) - -

Tables

- -

(details) - -

There are two syntaxes for tables in reStructuredText. Grid - tables are complete but cumbersome to create. Simple tables are - easy to create but limited (no row spans, etc.).

- -

- - - - - - -
Plain text - Typical result -
-

Grid table:

- -

+------------+------------+-----------+ -
| Header 1   | Header 2   | Header 3  | -
+============+============+===========+ -
| body row 1 | column 2   | column 3  | -
+------------+------------+-----------+ -
| body row 2 | Cells may span columns.| -
+------------+------------+-----------+ -
| body row 3 | Cells may  | - Cells   | -
+------------+ span rows. | - contain | -
| body row 4 |            | - blocks. | -
+------------+------------+-----------+

-
-

Grid table:

- - - - - - -
Header 1 - Header 2 - Header 3 -
body row 1 - column 2 - column 3 -
body row 2 - Cells may span columns. -
body row 3 - Cells may
span rows. -
-
    -
  • Cells -
  • contain -
  • blocks. -
-
body row 4 -
-
-

Simple table:

- -

=====  =====  ====== -
   Inputs     Output -
------------  ------ -
  A      B    A or B -
=====  =====  ====== -
False  False  False -
True   False  True -
False  True   True -
True   True   True -
=====  =====  ======

- -
-

Simple table:

- - - - - - - - - - - - - - -
Inputs - Output -
A - B - A or B -
False - False - False -
True - False - True -
False - True - True -
True - True - True -
- -
- -

Transitions

- -

(details) - -

- - - - - -
Plain text - Typical result -
-

-A transition marker is a horizontal line -
of 4 or more repeated punctuation -
characters.
- -

------------ - -

A transition should not begin or end a -
section or document, nor should two -
transitions be immediately adjacent.
- -

-

A transition marker is a horizontal line - of 4 or more repeated punctuation - characters.

- -
- -

A transition should not begin or end a - section or document, nor should two - transitions be immediately adjacent. -

- -

Transitions are commonly seen in novels and short fiction, as a - gap spanning one or more lines, marking text divisions or - signaling changes in subject, time, point of view, or emphasis. - -

Explicit Markup

- -

Explicit markup blocks are used for constructs which float - (footnotes), have no direct paper-document representation - (hyperlink targets, comments), or require specialized processing - (directives). They all begin with two periods and whitespace, the - "explicit markup start". - -

Footnotes

- -

(details) - -

- - - - - - - - -
Plain text - Typical result -
- Footnote references, like [5]_. -
Note that footnotes may get -
rearranged, e.g., to the bottom of -
the "page". - -

.. [5] A numerical footnote. Note -
   there's no colon after the ``]``. - -

- Footnote references, like 5. - Note that footnotes may get rearranged, e.g., to the bottom of - the "page". - -

-

- -
[5] A numerical footnote. - Note there's no colon after the ]. -
- -

- Autonumbered footnotes are -
possible, like using [#]_ and [#]_. -

.. [#] This is the first one. -
.. [#] This is the second one. - -

They may be assigned 'autonumber -
labels' - for instance, -
[#fourth]_ and [#third]_.
- -

.. [#third] a.k.a. third_ -

.. [#fourth] a.k.a. fourth_ -

- Autonumbered footnotes are possible, like using 1 and 2. - -

They may be assigned 'autonumber labels' - for instance, - 4 and 3. - -

-

- -
[1] This is the first one. -
[2] This is the second one. -
[3] a.k.a. third -
[4] a.k.a. fourth -
- -

- Auto-symbol footnotes are also -
possible, like this: [*]_ and [*]_. -

.. [*] This is the first one. -
.. [*] This is the second one. - -

- Auto-symbol footnotes are also - possible, like this: * - and . - -

-

- -
[*] This is the first symbol footnote -
[†] This is the second one. -
- -

- -

The numbering of auto-numbered footnotes is determined by the - order of the footnotes, not of the references. For auto-numbered - footnote references without autonumber labels - ("[#]_"), the references and footnotes must be in the - same relative order. Similarly for auto-symbol footnotes - ("[*]_"). - -

Citations

- -

(details) - -

- - - - - - -
Plain text - Typical result -
- Citation references, like [CIT2002]_. -
Note that citations may get -
rearranged, e.g., to the bottom of -
the "page". - -

.. [CIT2002] A citation -
   (as often used in journals). - -

Citation labels contain alphanumerics, -
underlines, hyphens and fullstops. -
Case is not significant. - -

Given a citation like [this]_, one -
can also refer to it like this_. - -

.. [this] here. - -

- Citation references, like [CIT2002]. - Note that citations may get rearranged, e.g., to the bottom of - the "page". - -

Citation labels contain alphanumerics, underlines, hyphens - and fullstops. Case is not significant. - -

Given a citation like [this], one - can also refer to it like this. - -

-

- -
[CIT2002] A citation - (as often used in journals). -
[this] here. -
- -

- -

Hyperlink Targets

- -

(details) - -

External Hyperlink Targets

- -

- - - - - - -
Plain text - Typical result -
- External hyperlinks, like Python_. - -

.. _Python: http://www.python.org/ -

- -
Fold-in form -
Indirect hyperlinks, like - Python. -
Call-out form -
External hyperlinks, like - Python. - -

-

-
Python: - http://www.python.org/ -
-

-
- -

"Fold-in" is the representation typically used in HTML - documents (think of the indirect hyperlink being "folded in" like - ingredients into a cake), and "call-out" is more suitable for - printed documents, where the link needs to be presented explicitly, for - example as a footnote. - -

Internal Hyperlink Targets

- -

- - - - - - -
Plain text - Typical result -
Internal crossreferences, like example_. - -

.. _example: - -

This is an example crossreference target. -

- -
Fold-in form - - - - -
Internal crossreferences, like example -

This is an example - crossreference target. -

Call-out form -
Internal crossreferences, like example - -

example: -
This is an example crossreference target. -

- -
- -

Indirect Hyperlink Targets

- -

(details) - -

- - - - - - -
Plain text - Typical result -
- Python_ is `my favourite -
programming language`__.
- -

.. _Python: http://www.python.org/ - -

__ Python_ - -

-

Python is - my favourite - programming language. - -

- -

The second hyperlink target (the line beginning with - "__") is both an indirect hyperlink target - (indirectly pointing at the Python website via the - "Python_" reference) and an anonymous hyperlink - target. In the text, a double-underscore suffix is used to - indicate an anonymous hyperlink reference. In an anonymous - hyperlink target, the reference text is not repeated. This is - useful for references with long text or throw-away references, but - the target should be kept close to the reference to prevent them - going out of sync. - -

Implicit Hyperlink Targets

- -

(details) - -

Section titles, footnotes, and citations automatically generate - hyperlink targets (the title text or footnote/citation label is - used as the hyperlink name). - -

- - - -
Plain text - Typical result - -
- Titles are targets, too -
======================= -
Implict references, like `Titles are -
targets, too`_. -
- Titles are targets, too -

Implict references, like Titles are - targets, too. -

- -

Directives

- -

(details) - -

Directives are a general-purpose extension mechanism, a way of - adding support for new constructs without adding new syntax. For - a description of all standard directives, see reStructuredText - Directives. - -

- - - - - -
Plain text - Typical result -
For instance: - -

.. image:: images/ball1.gif - -

- For instance: -

ball1 -

- -

Substitution References and Definitions

- -

(details) - -

Substitutions are like inline directives, allowing graphics and - arbitrary constructs within text. - -

- - - - - -
Plain text - Typical result -
-The |biohazard| symbol must be -used on containers used to -dispose of medical waste. - -

-.. |biohazard| image:: biohazard.png - -

- -

The biohazard symbol - must be used on containers used to dispose of medical waste. - -

- -

Comments

- -

(details) - -

Any text which begins with an explicit markup start but doesn't - use the syntax of any of the constructs above, is a comment. - -

- - - - - - -
Plain text - Typical result -
.. This text will not be shown -
   (but, for instance, in HTML might be -
   rendered as an HTML comment) - -
  - - - - -
- An empty "comment" does not -
"consume" following blocks. -

.. -

        So this block is not "lost", -
        despite its indentation. -

- An empty "comment" does not - "consume" following blocks. -
- So this block is not "lost", - despite its indentation. -
-
- -

Getting Help

- -

Users who have questions or need assistance with Docutils or - reStructuredText should post a - message to the Docutils-Users mailing list. The Docutils project web - site has more information. - -


-
-

Authors: - Tibs - (tibs@tibsnjoan.co.uk) - and David Goodger - (goodger@users.sourceforge.net) -

- - - diff --git a/docutils/docs/user/rst/quickstart.txt b/docutils/docs/user/rst/quickstart.txt deleted file mode 100644 index d936147b0..000000000 --- a/docutils/docs/user/rst/quickstart.txt +++ /dev/null @@ -1,382 +0,0 @@ -A ReStructuredText Primer -========================= - -:Author: Richard Jones -:Version: $Revision$ -:Copyright: This document has been placed in the public domain. - -.. contents:: - - -The text below contains links that look like "(quickref__)". These -are relative links that point to the `Quick reStructuredText`_ user -reference. If these links don't work, please refer to the `master -quick reference`_ document. - -__ -.. _Quick reStructuredText: quickref.html -.. _master quick reference: - http://docutils.sourceforge.net/docs/rst/quickref.html - - -Structure ---------- - -From the outset, let me say that "Structured Text" is probably a bit -of a misnomer. It's more like "Relaxed Text" that uses certain -consistent patterns. These patterns are interpreted by a HTML -converter to produce "Very Structured Text" that can be used by a web -browser. - -The most basic pattern recognised is a **paragraph** (quickref__). -That's a chunk of text that is separated by blank lines (one is -enough). Paragraphs must have the same indentation -- that is, line -up at their left edge. Paragraphs that start indented will result in -indented quote paragraphs. For example:: - - This is a paragraph. It's quite - short. - - This paragraph will result in an indented block of - text, typically used for quoting other text. - - This is another one. - -Results in: - - This is a paragraph. It's quite - short. - - This paragraph will result in an indented block of - text, typically used for quoting other text. - - This is another one. - -__ quickref.html#paragraphs - -Text styles ------------ - -(quickref__) - -__ quickref.html#inline-markup - -Inside paragraphs and other bodies of text, you may additionally mark -text for *italics* with "``*italics*``" or **bold** with -"``**bold**``". - -If you want something to appear as a fixed-space literal, use -"````double back-quotes````". Note that no further fiddling is done -inside the double back-quotes -- so asterisks "``*``" etc. are left -alone. - -If you find that you want to use one of the "special" characters in -text, it will generally be OK -- reStructuredText is pretty smart. -For example, this * asterisk is handled just fine. If you actually -want text \*surrounded by asterisks* to **not** be italicised, then -you need to indicate that the asterisk is not special. You do this by -placing a backslash just before it, like so "``\*``" (quickref__), or -by enclosing it in double back-quotes (inline literals), like this:: - - ``\*`` - -__ quickref.html#escaping - -Lists ------ - -Lists of items come in three main flavours: **enumerated**, -**bulleted** and **definitions**. In all list cases, you may have as -many paragraphs, sublists, etc. as you want, as long as the left-hand -side of the paragraph or whatever aligns with the first line of text -in the list item. - -Lists must always start a new paragraph -- that is, they must appear -after a blank line. - -**enumerated** lists (numbers, letters or roman numerals; quickref__) - __ quickref.html#enumerated-lists - - Start a line off with a number or letter followed by a period ".", - right bracket ")" or surrounded by brackets "( )" -- whatever you're - comfortable with. All of the following forms are recognised:: - - 1. numbers - - A. upper-case letters - and it goes over many lines - - with two paragraphs and all! - - a. lower-case letters - - 3. with a sub-list starting at a different number - 4. make sure the numbers are in the correct sequence though! - - I. upper-case roman numerals - - i. lower-case roman numerals - - (1) numbers again - - 1) and again - - Results in (note: the different enumerated list styles are not - always supported by every web browser, so you may not get the full - effect here): - - 1. numbers - - A. upper-case letters - and it goes over many lines - - with two paragraphs and all! - - a. lower-case letters - - 3. with a sub-list starting at a different number - 4. make sure the numbers are in the correct sequence though! - - I. upper-case roman numerals - - i. lower-case roman numerals - - (1) numbers again - - 1) and again - -**bulleted** lists (quickref__) - __ quickref.html#bullet-lists - - Just like enumerated lists, start the line off with a bullet point - character - either "-", "+" or "*":: - - * a bullet point using "*" - - - a sub-list using "-" - - + yet another sub-list - - - another item - - Results in: - - * a bullet point using "*" - - - a sub-list using "-" - - + yet another sub-list - - - another item - -**definition** lists (quickref__) - __ quickref.html#definition-lists - - Unlike the other two, the definition lists consist of a term, and - the definition of that term. The format of a definition list is:: - - what - Definition lists associate a term with a definition. - - *how* - The term is a one-line phrase, and the definition is one or more - paragraphs or body elements, indented relative to the term. - Blank lines are not allowed between term and definition. - - Results in: - - what - Definition lists associate a term with a definition. - - *how* - The term is a one-line phrase, and the definition is one or more - paragraphs or body elements, indented relative to the term. - Blank lines are not allowed between term and definition. - -Preformatting (code samples) ----------------------------- -(quickref__) - -__ quickref.html#literal-blocks - -To just include a chunk of preformatted, never-to-be-fiddled-with -text, finish the prior paragraph with "``::``". The preformatted -block is finished when the text falls back to the same indentation -level as a paragraph prior to the preformatted block. For example:: - - An example:: - - Whitespace, newlines, blank lines, and all kinds of markup - (like *this* or \this) is preserved by literal blocks. - Lookie here, I've dropped an indentation level - (but not far enough) - - no more example - -Results in: - - An example:: - - Whitespace, newlines, blank lines, and all kinds of markup - (like *this* or \this) is preserved by literal blocks. - Lookie here, I've dropped an indentation level - (but not far enough) - - no more example - -Note that if a paragraph consists only of "``::``", then it's removed -from the output:: - - :: - - This is preformatted text, and the - last "::" paragraph is removed - -Results in: - -:: - - This is preformatted text, and the - last "::" paragraph is removed - -Sections --------- - -(quickref__) - -__ quickref.html#section-structure - -To break longer text up into sections, you use **section headers**. -These are a single line of text (one or more words) with adornment: an -underline alone, or an overline and an overline together, in dashes -"``-----``", equals "``======``", tildes "``~~~~~~``" or any of the -non-alphanumeric characters ``= - ` : ' " ~ ^ _ * + # < >`` that you -feel comfortable with. An underline-only adornment is distinct from -an overline-and-underline adornment using the same character. The -underline/overline must be at least as long as the title text. Be -consistent, since all sections marked with the same adornment style -are deemed to be at the same level:: - - Chapter 1 Title - =============== - - Section 1.1 Title - ----------------- - - Subsection 1.1.1 Title - ~~~~~~~~~~~~~~~~~~~~~~ - - Section 1.2 Title - ----------------- - - Chapter 2 Title - =============== - -This results in the following structure, illustrated by simplified -pseudo-XML:: - -
- - Chapter 1 Title - <section> - <title> - Section 1.1 Title - <section> - <title> - Subsection 1.1.1 Title - <section> - <title> - Section 1.2 Title - <section> - <title> - Chapter 2 Title - -(Pseudo-XML uses indentation for nesting and has no end-tags. It's -not possible to show actual processed output, as in the other -examples, because sections cannot exist inside block quotes. For a -concrete example, compare the section structure of this document's -source text and processed output.) - -Note that section headers are available as link targets, just using -their name. To link to the Lists_ heading, I write "``Lists_``". If -the heading has a space in it like `text styles`_, we need to quote -the heading "```text styles`_``". - -To indicate the document title, use a unique adornment style at the -beginning of the document. To indicate the document subtitle, use -another unique adornment style immediately after the document title. -For example:: - - ================ - Document Title - ================ - ---------- - Subtitle - ---------- - - Section Title - ============= - - ... - -Note that "Document Title" and "Section Title" both use equals signs, -but are distict and unrelated styles. The text of -overline-and-underlined titles (but not underlined-only) may be inset -for aesthetics. - - -Images ------- - -(quickref__) - -__ quickref.html#directives - -To include an image in your document, you use the the ``image`` directive__. -For example:: - - .. image:: images/biohazard.png - -results in: - -.. image:: images/biohazard.png - -The ``images/biohazard.png`` part indicates the filename of the image -you wish to appear in the document. There's no restriction placed on -the image (format, size etc). If the image is to appear in HTML and -you wish to supply additional information, you may:: - - .. image:: images/biohazard.png - :height: 100 - :width: 200 - :scale: 50 - :alt: alternate text - -See the full image directive documentation__ for more info. - -__ ../../spec/rst/directives.html -__ ../../spec/rst/directives.html#images - - -What Next? ----------- - -This primer introduces the most common features of reStructuredText, -but there are a lot more to explore. The `Quick reStructuredText`_ -user reference is a good place to go next. For complete details, the -`reStructuredText Markup Specification`_ is the place to go [#]_. - -Users who have questions or need assistance with Docutils or -reStructuredText should `post a message`_ to the `Docutils-Users -mailing list`_. The `Docutils project web site`_ has more -information. - -.. [#] If that relative link doesn't work, try the master document: - http://docutils.sourceforge.net/spec/rst/reStructuredText.html. - -.. _reStructuredText Markup Specification: - ../../spec/rst/reStructuredText.html -.. _post a message: mailto:docutils-users@lists.sourceforge.net -.. _Docutils-Users mailing list: - http://lists.sourceforge.net/lists/listinfo/docutils-users -.. _Docutils project web site: http://docutils.sourceforge.net/ diff --git a/docutils/docs/user/tools.txt b/docutils/docs/user/tools.txt deleted file mode 100644 index b9af291f6..000000000 --- a/docutils/docs/user/tools.txt +++ /dev/null @@ -1,724 +0,0 @@ -========================== - Docutils Front-End Tools -========================== - -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This document has been placed in the public domain. - -.. contents:: - - -Introduction -============ - -Once the Docutils package is unpacked, you will discover a "``tools``" -directory containing several front ends for common Docutils -processing. Rather than a single all-purpose program, Docutils has -many small front ends, each specialized for a specific "Reader" (which -knows how to interpret a file in context), a "Parser" (which -understands the syntax of the text), and a "Writer" (which knows how -to generate a specific data format). Most front ends have common -options and the same command-line usage pattern:: - - toolname [options] [<source> [<destination]] - -The exceptions are buildhtml.py_ and pep2html.py_. See html.py_ for -concrete examples. Each tool has a "``--help``" option which lists -the `command-line options`_ and arguments it supports. Processing can -also be customized with `configuration files`_. - -The two arguments, "source" and "destination", are optional. If only -one argument (source) is specified, the standard output (stdout) is -used for the destination. If no arguments are specified, the standard -input (stdin) is used for the source as well. - - -Getting Help ------------- - -First, try the "``--help``" option each front-end tool has. - -Users who have questions or need assistance with Docutils or -reStructuredText should `post a message`_ to the `Docutils-Users -mailing list`_. The `Docutils project web site`_ has more -information. - -.. _post a message: mailto:docutils-users@lists.sourceforge.net -.. _Docutils-Users mailing list: - http://lists.sourceforge.net/lists/listinfo/docutils-users -.. _Docutils project web site: http://docutils.sourceforge.net/ - - -The Tools -========= - -buildhtml.py ------------- - -:Readers: Standalone, PEP -:Parser: reStructuredText -:Writers: HTML, PEP/HTML - -Use ``buildhtml.py`` to generate .html from all the .txt files -(including PEPs) in each <directory> given, and their subdirectories -too. (Use the ``--local`` option to skip subdirectories.) - -Usage:: - - buildhtml.py [options] [<directory> ...] - -After unpacking the Docutils package, the following shell commands -will generate HTML for all included documentation:: - - cd docutils/tools - buildhtml.py .. - -For official releases, the directory may be called "docutils-X.Y", -where "X.Y" is the release version. Alternatively:: - - cd docutils - tools/buildhtml.py --config=tools/docutils.conf - -The current directory (and all subdirectories) is chosen by default if -no directory is named. Some files may generate system messages -(tools/test.txt contains intentional errors); use the ``--quiet`` -option to suppress all warnings. The ``--config`` option ensures that -the correct stylesheets, templates, and settings are in place -(``./docutils.conf`` is picked up automatically). Command-line -options may be used to override config file settings or replace them -altogether. - - -html.py -------- - -:Reader: Standalone -:Parser: reStructuredText -:Writer: HTML - -The ``html.py`` front end reads standalone reStructuredText source -files and produces HTML 4 (XHTML 1) output compatible with modern -browsers. For example, to process a reStructuredText file -"``test.txt``" into HTML:: - - html.py test.txt test.html - -In fact, there *is* a "``test.txt``" file in the "``tools``" -directory. It contains "at least one example of each reStructuredText -construct", including intentional errors. Use it to put the system -through its paces and compare input to output. - -Now open the "``test.html``" file in your favorite browser to see the -results. To get a footer with a link to the source file, date & time -of processing, and links to the Docutils projects, add some options:: - - html.py -stg test.txt test.html - - -Stylesheets -``````````` - -``html.py`` inserts into the generated HTML a link to a cascading -stylesheet, defaulting to "``default.css``" (override with a -"``--stylesheet``" or "``--stylesheet-path``" command-line option or -with configuration file settings). The -"``tools/stylesheets/default.css``" stylesheet is provided for basic -use. To experiment with styles, rather than editing the default -stylesheet (which will be updated as the project evolves), it is -recommended to use an "``@import``" statement to create a "wrapper" -stylesheet. For example, a "``my.css``" stylesheet could contain the -following:: - - @import url(default.css); - - h1, h2, h3, h4, h5, h6, p.topic-title { - font-family: sans-serif } - -Generate HTML with the following command:: - - html.py -stg --stylesheet my.css test.txt test.html - -When viewed in a browser, the new "wrapper" stylesheet will change the -typeface family of titles to "sans serif", typically Helvetica or -Arial. Other styles will not be affected. Styles in wrapper -stylesheets override styles in imported stylesheets, enabling -incremental experimentation. - - -pep.py ------- - -:Reader: PEP -:Parser: reStructuredText -:Writer: PEP/HTML - -``pep.py`` reads a new-style PEP (marked up with reStructuredText) and -produces HTML. It requires a template file and a stylesheet. By -default, it makes use of a "``pep-html-template``" file and a -"``default.css``" stylesheet in the current directory, but these can -be overridden by command-line options or configuration files. The -"``tools/stylesheets/pep.css``" stylesheet is intended specifically -for PEP use. - -The "``docutils.conf``" `configuration file`_ in the "``spec``" -directory of Docutils contains a default setup for use in processing -the PEP files there (``spec/pep-*.txt``) into HTML. It specifies a -default template (``tools/pep-html-template``) and a default -stylesheet (``tools/stylesheets/pep.css``). See Stylesheets_ above -for more information. - - -pep2html.py ------------ - -:Reader: PEP -:Parser: reStructuredText -:Writer: PEP/HTML - -``pep2html.py`` is a modified version of the original script by -Fredrik Lundh, with support for Docutils added. It reads the -beginning of a PEP text file to determine the format (old-style -indented or new-style reStructuredText) and processes accordingly. -Since it does not use the Docutils front end mechanism (the common -command-line options are not supported), it must be configured using -`configuration files`_. The template and stylesheet requirements of -``pep2html.py`` are the same as those of `pep.py`_ above. - -Arguments to ``pep2html.py`` may be a list of PEP numbers or .txt -files. If no arguments are given, all files of the form -"``pep-*.txt``" are processed. - - -rst2latex.py ------------- - -:Reader: Standalone -:Parser: reStructuredText -:Writer: LaTeX2e - -The ``rst2latex.py`` front end reads standalone reStructuredText -source files and produces LaTeX2e output. For example, to process a -reStructuredText file "``test.txt``" into LaTeX:: - - rst2latex.py test.txt test.tex - -The output file "``test.tex``" should then be processed with ``latex`` -or ``pdflatex`` to get a typeset document. - -Some limitations and difference apply: - -- Gif,jpg or png images are not handled, when processed with - ``latex``, use ``pdflatex`` instead. -- Only Latin-1 is tested up to now. -- The generated file includes a file ``style.tex``, which allows the - inclusion of special packages or changes to settings made in the - header. -- Not all constructs are possible (e.g. multirow/multicoumn entries in - tables are not). - - -docutils-xml.py ---------------- - -:Reader: Standalone -:Parser: reStructuredText -:Writer: XML (Docutils native) - -The ``docutils-xml.py`` front end produces Docutils-native XML output. -This can be transformed with standard XML tools such as XSLT -processors into arbitrary final forms. - - -publish.py ----------- - -:Reader: Standalone -:Parser: reStructuredText -:Writer: Pseudo-XML - -``publish.py`` is used for debugging the Docutils Reader to Transform -to Writer pipeline. It produces a compact pretty-printed -"pseudo-XML", where nesting is indicated by indentation (no end-tags). -External attributes for all elements are output, and internal -attributes for any leftover "pending" elements are also given. - - -quicktest.py ------------- - -:Reader: N/A -:Parser: reStructuredText -:Writer: N/A - -The ``quicktest.py`` tool is used for testing the reStructuredText -parser. It does not use a Docutils Reader or Writer or the standard -Docutils command-line options. Rather, it does its own I/O and calls -the parser directly. No transforms are applied to the parsed -document. Various forms output are possible: - -- Pretty-printed pseudo-XML (default) -- Test data (Python list of input and pseudo-XML output strings; - useful for creating new test cases) -- Pretty-printed native XML -- Raw native XML (with or without a stylesheet reference) - - - -Customization -============= - -Command-Line Options --------------------- - -Each front-end tool supports command-line options for one-off -customization. For persistent customization, use `configuration -files`_. - -Use the "--help" option on each of the front ends to list the -command-line options it supports. Command-line options and their -corresponding configuration file entry names are listed in -`Configuration File Entries`_ below. - - -.. _configuration file: - -Configuration Files -------------------- - -Configuration files are used for persistent customization; they can be -set once and take effect every time you use a front-end tool. - -By default, Docutils checks the following places for configuration -files, in the following order: - -1. ``/etc/docutils.conf``: This is a system-wide configuration file, - applicable to all Docutils processing on the system. - -2. ``./docutils.conf``: This is a project-specific configuration file, - located in the current directory. The Docutils front end has to be - executed from the directory containing this configuration file for - it to take effect (note that this may have nothing to do with the - location of the source files). Settings in the project-specific - configuration file will override corresponding settings in the - system-wide file. - -3. ``~/.docutils``: This is a user-specific configuration file, - located in the user's home directory. Settings in this file will - override corresponding settings in both the system-wide and - project-specific configuration files. - -If more than one configuration file is found, all will be read but -later entries will override earlier ones. For example, a "stylesheet" -entry in a user-specific configuration file will override a -"stylesheet" entry in the system-wide file. - -In addition, a configuration file may be explicitly specified with the -"--config" command-line option. This configuration file is read after -the three implicit ones listed above. - -Configuration files use the standard ConfigParser.py_ Python_ module. -From its documentation: - - The configuration file consists of sections, lead by a "[section]" - header and followed by "name: value" entries, with continuations - in the style of `RFC 822`_; "name=value" is also accepted. Note - that leading whitespace is removed from values. The optional - values can contain format strings which refer to other values in - the same section, or values in a special DEFAULT section. - Additional defaults can be provided upon initialization and - retrieval. Lines beginning with "#" or ";" are ignored and may be - used to provide comments. - -Docutils currently only uses an "[options]" section; all other -sections are ignored. - -.. Note:: The configuration file format may change in the future. - -Configuration entry names correspond to internal option attributes. -Underscores ("_") and hyphens ("-") can be used interchangably in -entry names. The correspondence between entry names and command-line -options is listed in `Configuration File Entries`_ below. - -.. _ConfigParser.py: - http://www.python.org/doc/current/lib/module-ConfigParser.html -.. _Python: http://www.python.org/ -.. _RFC 822: http://www.rfc-editor.org/rfc/rfc822.txt - - -Configuration File Entries --------------------------- - -Listed below are the Docutils runtime settings. Most may be specified -in `configuration files`_, where hyphens may be used in place of -underscores. Some knowledge of Python_ is assumed for some -attributes. - -attribution - (HTML Writer.) Format for block quote attributions: one of "dash" - (em-dash prefix), "parentheses"/"parens", or "none". - - Default: "dash". Options: ``--attribution``. - -compact_lists - (HTML Writer.) Remove extra vertical whitespace between items of - bullet lists and enumerated lists, when list items are "simple" - (i.e., all items each contain one paragraph and/or one "simple" - sublist only). - - Default: enabled (1). Options: ``--compact-lists, - --no-compact-lists``. - -config - Path to a configuration file to read (if it exists) - [#pwd]_. Settings may override defaults and earlier settings. - This is only effective as a command-line option; setting it in a - config file has no effect. - - Filesystem path settings contained within the config file will be - interpreted relative to the config file's location (*not* relative - to the current working directory). - - Default: None. Options: ``--config``. - -datestamp - Include a time/datestamp in the document footer. Contains a - format string for Python's ``time.strftime``. See the `time - module documentation`__. - - Default: None. Options: ``--date, -d, --time, -t, - --no-datestamp``. - - __ http://www.python.org/doc/current/lib/module-time.html - -debug - Report debug-level system messages. - - Default: don't (None). Options: ``--debug, --no-debug``. - -docinfo_xform - (Standalone Reader.) Enable or disable the bibliographic field - list transform (docutils.transforms.frontmatter.DocInfo). - - Default: enabled (1). Options: ``--no-doc-info``. - -doctitle_xform - - (Standalone Reader.) Enable or disable the promotion of a lone - top-level section title to document title (and subsequent section - title to document subtitle promotion; - docutils.transforms.frontmatter.DocTitle). - - Default: enabled (). Options: ``--no-doc-title``. - -doctype_declaration - (XML Writer.) Generate XML with a DOCTYPE declaration. - - Default: do (1). Options: ``--no-doctype``. - -dump_internals - At the end of processing, write all internal attributes of the - document (``document.__dict__``) to stderr. - - Default: don't (None). Options: ``--dump-internals`` (hidden, for - development use only). - -dump_pseudo_xml - At the end of processing, write the pseudo-XML representation of - the document to stderr. - - Default: don't (None). Options: ``--dump-pseudo-xml`` (hidden, - for development use only). - -dump_settings - At the end of processing, write all Docutils settings to stderr. - - Default: don't (None). Options: ``--dump-settings`` (hidden, for - development use only). - -dump_transforms - At the end of processing, write a list of all transforms applied - to the document to stderr. - - Default: don't (None). Options: ``--dump-transforms`` (hidden, - for development use only). - -embed_stylesheet - (HTML Writer.) Embed the stylesheet in the output HTML file. The - stylesheet file must be accessible during processing. The - stylesheet is embedded inside a comment, so it must not contain - the text "``--``" (two hyphens). - - Default: link, don't embed (None). Options: ``--embed-stylesheet, - --link-stylesheet``. - -error_encoding - The text encoding for error output. - - Default: "ascii". Options: ``--error-encoding, -e``. - -error_encoding_error_handler - The encoding error handler for unencodable characters in error - output. Acceptable values are the same as for the "error" - parameter of Python's ``encode`` string method. - - Default: "backslashreplace" for Python 2.3 and later; "replace" - otherwise. Options: ``--error-encoding-error-handler, - --error-encoding, -e``. - -exit_level - A system message level threshold; non-halting system messages at - or above this level will produce a non-zero exit status at normal - exit. Exit status is the maximum system message level plus 10 (11 - for INFO, etc.). - - Default: disabled (5). Options: ``--exit``. - -expose_internals - List of internal attribues to expose as external attributes (with - "internal:" namespace prefix). - - Default: don't (None). Options: ``--expose-internal-attribute`` - (hidden, for development use only). - -footnote_backlinks - Enable or disable backlinks from footnotes and citations to their - references. - - Default: enabled (1). Options: ``--footnote-backlinks, - --no-footnote-backlinks``. - -footnote_references - (HTML Writer.) Format for footnote references, one of - "superscript" or "brackets". - - Default: "superscript"; "brackets" in PEP/HTML Writer. Options: - ``--footnote-references``. - -generator - Include a "Generated by Docutils" credit and link in the document - footer. - - Default: off (None). Options: ``--generator, -g, - --no-generator``. - -halt_level - The threshold at or above which system messages are converted to - exceptions, halting execution immediately. - - Default: severe (4). Options: ``--halt, --strict``. - -indents - (XML Writer.) Generate XML with indents and newlines. - - Default: don't (None). Options: ``--indents``. - -input_encoding - The text encoding for input. - - Default: auto-detect (None). Options: ``--input-encoding, -i``. - -language_code - `ISO 639`_ 2-letter language code (3-letter codes used only if no - 2-letter code exists). - - Default: English ("en"). Options: ``--language, -l``. - -newlines - (XML Writer.) Generate XML with newlines before and after tags. - - Default: don't (None). Options: ``--newlines``. - -no_random - (PEP/HTML Writer.) Workaround for platforms which core-dump on - "``import random``". - - Default: random enabled (None). Options: ``--no-random`` - (hidden). - -output_encoding - The text encoding for output. - - Default: "UTF-8". Options: ``--output-encoding, -o``. - -output_encoding_error_handler - The encoding error handler for unencodable characters in output. - Acceptable values are the same as for the "error" parameter of - Python's ``encode`` string method. - - Default: "strict". Options: ``--output-encoding-error-handler, - --output-encoding, -o``. - -pep_home - (PEP/HTML Writer.) Home URL prefix for PEPs. - - Default: current directory ("."). Options: ``--pep-home``. - -pep_references - (reStructuredText Parser.) Recognize and link to PEP references - (like "PEP 258"). - - Default: disabled (None); enabled (1) in PEP Reader. Options: - ``--pep-references``. - -pep_stylesheet - (PEP/HTML Writer.) CSS stylesheet URL, used verbatim. Overrides - HTML stylesheet (``--stylesheet``). - - Default: None. Options: ``--pep-stylesheet``. - -pep_stylesheet_path - (PEP/HTML Writer.) Path to CSS stylesheet [#pwd]_. Path is - adjusted relative to the output HTML file. Overrides HTML - stylesheet (``--stylesheet``) and PEP stylesheet - (``--pep-stylesheet``). - - Default: None. Options: ``--pep-stylesheet-path``. - -pep_template - (PEP/HTML Writer.) Path to PEP template file [#pwd]_. - - Default: "pep-html-template" (in current directory). Options: - ``--pep-template``. - -python_home - (PEP/HTML Writer.) Python's home URL. - - Default: parent directory (".."). Options: ``--python-home``. - -recurse - (``buildhtml.py`` front end.) Recursively scan subdirectories. - - Default: recurse (1). Options: ``--recurse, --local``. - -report_level - Verbosity threshold at or above which system messages are - reported. - - Default: warning (2). Options: ``--report, -r, --verbose, -v, - --quiet, -q``. - -rfc_references - (reStructuredText Parser.) Recognize and link to RFC references - (like "RFC 822"). - - Default: disabled (None); enabled (1) in PEP Reader. Options: - ``--rfc-references``. - -silent - (``buildhtml.py`` front end.) Work silently (no progress - messages). Independent of "report_level". - - Default: show progress (None). Options: ``--silent``. - -source_link - Include a "View document source" link in the document footer. URL - will be relative to the destination. - - Default: don't (None). Options: ``--source-link, -s, - --no-source-link``. - -source_url - An explicit URL for a "View document source" link, used verbatim. - - Default: compute if source_link (None). Options: ``--source-uri, - --no-source-link``. - -stylesheet - (HTML Writer.) CSS stylesheet URL, used verbatim. Overridden by - "stylesheet_path" URL option (``--stylesheet-path``). - - Default: "default.css". Options: ``--stylesheet``. - -stylesheet_path - (HTML Writer.) Path to CSS stylesheet [#pwd]_. Overrides - "stylesheet" URL option (``--stylesheet``). Path is adjusted - relative to the output HTML file. - - Default: None. Options: ``--stylesheet``. - -tab_width - (reStructuredText Parser.) Number of spaces for hard tab - expansion. - - Default: 8. Options: ``--tab-width``. - -toc_backlinks - Enable backlinks from section titles to table of contents entries - ("entry"), to the top of the TOC ("top"), or disable ("none"). - - Default: "entry". Options: ``--toc-entry-backlinks, - --toc-top-backlinks, --no-toc-backlinks``. - -traceback - Enable Python tracebacks when an error occurs. - - Default: disabled (None). Options: ``--traceback, - --no-traceback``. - -trim-footnote-reference-space - (reStructuredText Parser.) Remove spaces before footnote - references. - - Default: don't (None). Options: - ``--trim-footnote-reference-space``. - -warning_stream - Path to a file for the output of system messages (warnings) - [#pwd]_. - - Default: stderr (None). Options: ``--warnings``. - -xml_declaration - (XML and HTML Writers.) Generate XML with an XML declaration. - - .. Caution:: The XML declaration carries text encoding - information, without which standard tools may be unable to read - the generated XML. - - Default: do (1). Options: ``--no-xml-declaration``. - - -For Internal Use Only -````````````````````` - -Setting these in a config file has no effect. - - -_directories - (``buildhtml.py`` front end.) List of paths to source - directories, set from positional arguments. - - Default: current working directory (None). No command-line - options. - -_disable_config - Prevent standard configuration files from being read. - - Default: config files enabled (None). No command-line options. - -_destination - Path to output destination, set from positional arguments. - - Default: stdout (None). No command-line options. - -_source - Path to input source, set from positional arguments. - - Default: stdin (None). No command-line options. - -.. _ISO 639: http://lcweb.loc.gov/standards/iso639-2/englangn.html - -.. [#pwd] Path relative to the working directory of the process at - launch. - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: diff --git a/docutils/docutils/__init__.py b/docutils/docutils/__init__.py deleted file mode 100644 index 188a3a711..000000000 --- a/docutils/docutils/__init__.py +++ /dev/null @@ -1,128 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -This is the Docutils (Python Documentation Utilities) package. - -Package Structure -================= - -Modules: - -- __init__.py: Contains the package docstring only (this text). - -- core.py: Contains the ``Publisher`` class and ``publish()`` convenience - function. - -- frontend.py: Command-line and common processing for Docutils front-ends. - -- io.py: Provides a uniform API for low-level input and output. - -- nodes.py: Docutils document tree (doctree) node class library. - -- statemachine.py: A finite state machine specialized for - regular-expression-based text filters. - -- urischemes.py: Contains a complete mapping of known URI addressing - scheme names to descriptions. - -- utils.py: Contains the ``Reporter`` system warning class and miscellaneous - utilities. - -Subpackages: - -- languages: Language-specific mappings of terms. - -- parsers: Syntax-specific input parser modules or packages. - -- readers: Context-specific input handlers which understand the data - source and manage a parser. - -- transforms: Modules used by readers and writers to modify DPS - doctrees. - -- writers: Format-specific output translators. -""" - -__docformat__ = 'reStructuredText' - -__version__ = '0.3.0' -"""``major.minor.micro`` version number. The micro number is bumped any time -there's a change in the API incompatible with one of the front ends. The -minor number is bumped whenever there is a project release. The major number -will be bumped when the project is feature-complete, and perhaps if there is a -major change in the design.""" - - -class ApplicationError(StandardError): pass -class DataError(ApplicationError): pass - - -class SettingsSpec: - - """ - Runtime setting specification base class. - - SettingsSpec subclass objects used by `docutils.frontend.OptionParser`. - """ - - settings_spec = () - """Runtime settings specification. Override in subclasses. - - Specifies runtime settings and associated command-line options, as used by - `docutils.frontend.OptionParser`. This tuple contains one or more sets of - option group title, description, and a list/tuple of tuples: ``('help - text', [list of option strings], {keyword arguments})``. Group title - and/or description may be `None`; no group title implies no group, just a - list of single options. Runtime settings names are derived implicitly - from long option names ("--a-setting" becomes ``settings.a_setting``) or - explicitly from the "dest" keyword argument.""" - - settings_defaults = None - """A dictionary of defaults for internal or inaccessible (by command-line - or config file) settings. Override in subclasses.""" - - settings_default_overrides = None - """A dictionary of auxiliary defaults, to override defaults for settings - defined in other components. Override in subclasses.""" - - relative_path_settings = () - """Settings containing filesystem paths. Override in subclasses. - - Settings listed here are to be interpreted relative to the current working - directory.""" - - -class TransformSpec: - - """ - Runtime transform specification base class. - - TransformSpec subclass objects used by `docutils.transforms.Transformer`. - """ - - default_transforms = () - """Transforms required by this class. Override in subclasses.""" - - -class Component(SettingsSpec, TransformSpec): - - """Base class for Docutils components.""" - - component_type = None - """Override in subclasses.""" - - supported = () - """Names for this component. Override in subclasses.""" - - def supports(self, format): - """ - Is `format` supported by this component? - - To be used by transforms to ask the dependent component if it supports - a certain input context or output format. - """ - return format in self.supported diff --git a/docutils/docutils/core.py b/docutils/docutils/core.py deleted file mode 100644 index 6d78ac57f..000000000 --- a/docutils/docutils/core.py +++ /dev/null @@ -1,360 +0,0 @@ -# Authors: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Calling the ``publish_*`` convenience functions (or instantiating a -`Publisher` object) with component names will result in default -behavior. For custom behavior (setting component options), create -custom component objects first, and pass *them* to -``publish_*``/`Publisher`. -""" - -__docformat__ = 'reStructuredText' - -import sys -from docutils import Component, __version__ -from docutils import frontend, io, utils, readers, parsers, writers -from docutils.frontend import OptionParser - - -class Publisher: - - """ - A facade encapsulating the high-level logic of a Docutils system. - """ - - def __init__(self, reader=None, parser=None, writer=None, - source=None, source_class=io.FileInput, - destination=None, destination_class=io.FileOutput, - settings=None): - """ - Initial setup. If any of `reader`, `parser`, or `writer` are not - specified, the corresponding ``set_...`` method should be called with - a component name (`set_reader` sets the parser as well). - """ - - self.reader = reader - """A `readers.Reader` instance.""" - - self.parser = parser - """A `parsers.Parser` instance.""" - - self.writer = writer - """A `writers.Writer` instance.""" - - self.source = source - """The source of input data, an `io.Input` instance.""" - - self.source_class = source_class - """The class for dynamically created source objects.""" - - self.destination = destination - """The destination for docutils output, an `io.Output` instance.""" - - self.destination_class = destination_class - """The class for dynamically created destination objects.""" - - self.settings = settings - """An object containing Docutils settings as instance attributes. - Set by `self.process_command_line()` or `self.get_settings()`.""" - - def set_reader(self, reader_name, parser, parser_name): - """Set `self.reader` by name.""" - reader_class = readers.get_reader_class(reader_name) - self.reader = reader_class(parser, parser_name) - self.parser = self.reader.parser - - def set_writer(self, writer_name): - """Set `self.writer` by name.""" - writer_class = writers.get_writer_class(writer_name) - self.writer = writer_class() - - def set_components(self, reader_name, parser_name, writer_name): - if self.reader is None: - self.set_reader(reader_name, self.parser, parser_name) - if self.parser is None: - if self.reader.parser is None: - self.reader.set_parser(parser_name) - self.parser = self.reader.parser - if self.writer is None: - self.set_writer(writer_name) - - def setup_option_parser(self, usage=None, description=None, - settings_spec=None, **defaults): - #@@@ Add self.source & self.destination to components in future? - option_parser = OptionParser( - components=(settings_spec, self.parser, self.reader, self.writer), - defaults=defaults, read_config_files=1, - usage=usage, description=description) - return option_parser - - def get_settings(self, usage=None, description=None, - settings_spec=None, **defaults): - """ - Set and return default settings (overrides in `defaults` keyword - argument). - - Set components first (`self.set_reader` & `self.set_writer`). - Explicitly setting `self.settings` disables command line option - processing from `self.publish()`. - """ - option_parser = self.setup_option_parser(usage, description, - settings_spec, **defaults) - self.settings = option_parser.get_default_values() - return self.settings - - def process_command_line(self, argv=None, usage=None, description=None, - settings_spec=None, **defaults): - """ - Pass an empty list to `argv` to avoid reading `sys.argv` (the - default). - - Set components first (`self.set_reader` & `self.set_writer`). - """ - option_parser = self.setup_option_parser(usage, description, - settings_spec, **defaults) - if argv is None: - argv = sys.argv[1:] - self.settings = option_parser.parse_args(argv) - - def set_io(self, source_path=None, destination_path=None): - if self.source is None: - self.set_source(source_path=source_path) - if self.destination is None: - self.set_destination(destination_path=destination_path) - - def set_source(self, source=None, source_path=None): - if source_path is None: - source_path = self.settings._source - else: - self.settings._source = source_path - self.source = self.source_class( - source=source, source_path=source_path, - encoding=self.settings.input_encoding) - - def set_destination(self, destination=None, destination_path=None): - if destination_path is None: - destination_path = self.settings._destination - else: - self.settings._destination = destination_path - self.destination = self.destination_class( - destination=destination, destination_path=destination_path, - encoding=self.settings.output_encoding, - error_handler=self.settings.output_encoding_error_handler) - - def apply_transforms(self, document): - document.transformer.populate_from_components( - (self.source, self.reader, self.reader.parser, self.writer, - self.destination)) - document.transformer.apply_transforms() - - def publish(self, argv=None, usage=None, description=None, - settings_spec=None, settings_overrides=None, - enable_exit=None): - """ - Process command line options and arguments (if `self.settings` not - already set), run `self.reader` and then `self.writer`. Return - `self.writer`'s output. - """ - if self.settings is None: - self.process_command_line(argv, usage, description, settings_spec, - **(settings_overrides or {})) - elif settings_overrides: - self.settings._update(settings_overrides, 'loose') - self.set_io() - exit = None - document = None - try: - document = self.reader.read(self.source, self.parser, - self.settings) - self.apply_transforms(document) - output = self.writer.write(document, self.destination) - except utils.SystemMessage, error: - if self.settings.traceback: - raise - print >>sys.stderr, ('Exiting due to level-%s (%s) system message.' - % (error.level, - utils.Reporter.levels[error.level])) - exit = 1 - except Exception, error: - if self.settings.traceback: - raise - print >>sys.stderr, error - print >>sys.stderr, ("""\ -Exiting due to error. Use "--traceback" to diagnose. -Please report errors to <docutils-users@lists.sf.net>. -Include "--traceback" output, Docutils version (%s), -Python version (%s), your OS type & version, and the -command line used.""" % (__version__, sys.version.split()[0])) - exit = 1 - if self.settings.dump_settings: - from pprint import pformat - print >>sys.stderr, '\n::: Runtime settings:' - print >>sys.stderr, pformat(self.settings.__dict__) - if self.settings.dump_internals and document: - from pprint import pformat - print >>sys.stderr, '\n::: Document internals:' - print >>sys.stderr, pformat(document.__dict__) - if self.settings.dump_transforms and document: - from pprint import pformat - print >>sys.stderr, '\n::: Transforms applied:' - print >>sys.stderr, pformat(document.transformer.applied) - if self.settings.dump_pseudo_xml and document: - print >>sys.stderr, '\n::: Pseudo-XML:' - print >>sys.stderr, document.pformat().encode( - 'raw_unicode_escape') - if enable_exit and document and (document.reporter.max_level - >= self.settings.exit_level): - sys.exit(document.reporter.max_level + 10) - elif exit: - sys.exit(1) - return output - - -default_usage = '%prog [options] [<source> [<destination>]]' -default_description = ('Reads from <source> (default is stdin) and writes to ' - '<destination> (default is stdout).') - -def publish_cmdline(reader=None, reader_name='standalone', - parser=None, parser_name='restructuredtext', - writer=None, writer_name='pseudoxml', - settings=None, settings_spec=None, - settings_overrides=None, enable_exit=1, argv=None, - usage=default_usage, description=default_description): - """ - Set up & run a `Publisher`. For command-line front ends. - - Parameters: - - - `reader`: A `docutils.readers.Reader` object. - - `reader_name`: Name or alias of the Reader class to be instantiated if - no `reader` supplied. - - `parser`: A `docutils.parsers.Parser` object. - - `parser_name`: Name or alias of the Parser class to be instantiated if - no `parser` supplied. - - `writer`: A `docutils.writers.Writer` object. - - `writer_name`: Name or alias of the Writer class to be instantiated if - no `writer` supplied. - - `settings`: Runtime settings object. - - `settings_spec`: Extra settings specification; a `docutils.SettingsSpec` - subclass. Used only if no `settings` specified. - - `settings_overrides`: A dictionary containing program-specific overrides - of component settings. - - `enable_exit`: Boolean; enable exit status at end of processing? - - `argv`: Command-line argument list to use instead of ``sys.argv[1:]``. - - `usage`: Usage string, output if there's a problem parsing the command - line. - - `description`: Program description, output for the "--help" option - (along with command-line option descriptions). - """ - pub = Publisher(reader, parser, writer, settings=settings) - pub.set_components(reader_name, parser_name, writer_name) - pub.publish(argv, usage, description, settings_spec, settings_overrides, - enable_exit=enable_exit) - -def publish_file(source=None, source_path=None, - destination=None, destination_path=None, - reader=None, reader_name='standalone', - parser=None, parser_name='restructuredtext', - writer=None, writer_name='pseudoxml', - settings=None, settings_spec=None, settings_overrides=None, - enable_exit=None): - """ - Set up & run a `Publisher`. For programmatic use with file-like I/O. - - Parameters: - - - `source`: A file-like object (must have "read" and "close" methods). - - `source_path`: Path to the input file. Opened if no `source` supplied. - If neither `source` nor `source_path` are supplied, `sys.stdin` is used. - - `destination`: A file-like object (must have "write" and "close" - methods). - - `destination_path`: Path to the input file. Opened if no `destination` - supplied. If neither `destination` nor `destination_path` are supplied, - `sys.stdout` is used. - - `reader`: A `docutils.readers.Reader` object. - - `reader_name`: Name or alias of the Reader class to be instantiated if - no `reader` supplied. - - `parser`: A `docutils.parsers.Parser` object. - - `parser_name`: Name or alias of the Parser class to be instantiated if - no `parser` supplied. - - `writer`: A `docutils.writers.Writer` object. - - `writer_name`: Name or alias of the Writer class to be instantiated if - no `writer` supplied. - - `settings`: Runtime settings object. - - `settings_spec`: Extra settings specification; a `docutils.SettingsSpec` - subclass. Used only if no `settings` specified. - - `settings_overrides`: A dictionary containing program-specific overrides - of component settings. - - `enable_exit`: Boolean; enable exit status at end of processing? - """ - pub = Publisher(reader, parser, writer, settings=settings) - pub.set_components(reader_name, parser_name, writer_name) - if settings is None: - settings = pub.get_settings(settings_spec=settings_spec) - if settings_overrides: - settings._update(settings_overrides, 'loose') - pub.set_source(source, source_path) - pub.set_destination(destination, destination_path) - pub.publish(enable_exit=enable_exit) - -def publish_string(source, source_path=None, destination_path=None, - reader=None, reader_name='standalone', - parser=None, parser_name='restructuredtext', - writer=None, writer_name='pseudoxml', - settings=None, settings_spec=None, - settings_overrides=None, enable_exit=None): - """ - Set up & run a `Publisher`, and return the string output. - For programmatic use with string I/O. - - For encoded string output, be sure to set the "output_encoding" setting to - the desired encoding. Set it to "unicode" for unencoded Unicode string - output. Here's how:: - - publish_string(..., settings_overrides={'output_encoding': 'unicode'}) - - Similarly for Unicode string input (`source`):: - - publish_string(..., settings_overrides={'input_encoding': 'unicode'}) - - Parameters: - - - `source`: An input string; required. This can be an encoded 8-bit - string (set the "input_encoding" setting to the correct encoding) or a - Unicode string (set the "input_encoding" setting to "unicode"). - - `source_path`: Path to the file or object that produced `source`; - optional. Only used for diagnostic output. - - `destination_path`: Path to the file or object which will receive the - output; optional. Used for determining relative paths (stylesheets, - source links, etc.). - - `reader`: A `docutils.readers.Reader` object. - - `reader_name`: Name or alias of the Reader class to be instantiated if - no `reader` supplied. - - `parser`: A `docutils.parsers.Parser` object. - - `parser_name`: Name or alias of the Parser class to be instantiated if - no `parser` supplied. - - `writer`: A `docutils.writers.Writer` object. - - `writer_name`: Name or alias of the Writer class to be instantiated if - no `writer` supplied. - - `settings`: Runtime settings object. - - `settings_spec`: Extra settings specification; a `docutils.SettingsSpec` - subclass. Used only if no `settings` specified. - - `settings_overrides`: A dictionary containing program-specific overrides - of component settings. - - `enable_exit`: Boolean; enable exit status at end of processing? - """ - pub = Publisher(reader, parser, writer, settings=settings, - source_class=io.StringInput, - destination_class=io.StringOutput) - pub.set_components(reader_name, parser_name, writer_name) - if settings is None: - settings = pub.get_settings(settings_spec=settings_spec) - if settings_overrides: - settings._update(settings_overrides, 'loose') - pub.set_source(source, source_path) - pub.set_destination(destination_path=destination_path) - return pub.publish(enable_exit=enable_exit) diff --git a/docutils/docutils/frontend.py b/docutils/docutils/frontend.py deleted file mode 100644 index 5952ec19e..000000000 --- a/docutils/docutils/frontend.py +++ /dev/null @@ -1,477 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Command-line and common processing for Docutils front-end tools. - -Exports the following classes: - -- `OptionParser`: Standard Docutils command-line processing. -- `Values`: Runtime settings; objects are simple structs - (``object.attribute``). -- `ConfigParser`: Standard Docutils config file processing. -""" - -__docformat__ = 'reStructuredText' - -import os -import os.path -import sys -import types -import ConfigParser as CP -import codecs -import docutils -import optparse -from optparse import Values, SUPPRESS_HELP - - -def store_multiple(option, opt, value, parser, *args, **kwargs): - """ - Store multiple values in `parser.values`. (Option callback.) - - Store `None` for each attribute named in `args`, and store the value for - each key (attribute name) in `kwargs`. - """ - for attribute in args: - setattr(parser.values, attribute, None) - for key, value in kwargs.items(): - setattr(parser.values, key, value) - -def read_config_file(option, opt, value, parser): - """ - Read a configuration file during option processing. (Option callback.) - """ - config_parser = ConfigParser() - config_parser.read(value, parser) - settings = config_parser.get_section('options') - make_paths_absolute(settings, parser.relative_path_settings, - os.path.dirname(value)) - parser.values.__dict__.update(settings) - -def set_encoding(option, opt, value, parser): - """ - Validate & set the encoding specified. (Option callback.) - """ - try: - value = validate_encoding(option.dest, value) - except LookupError, error: - raise (optparse.OptionValueError('option "%s": %s' % (opt, error)), - None, sys.exc_info()[2]) - setattr(parser.values, option.dest, value) - -def validate_encoding(name, value): - try: - codecs.lookup(value) - except LookupError: - raise (LookupError('unknown encoding: "%s"' % value), - None, sys.exc_info()[2]) - return value - -def set_encoding_error_handler(option, opt, value, parser): - """ - Validate & set the encoding error handler specified. (Option callback.) - """ - try: - value = validate_encoding_error_handler(option.dest, value) - except LookupError, error: - raise (optparse.OptionValueError('option "%s": %s' % (opt, error)), - None, sys.exc_info()[2]) - setattr(parser.values, option.dest, value) - -def validate_encoding_error_handler(name, value): - try: - codecs.lookup_error(value) - except AttributeError: # prior to Python 2.3 - if value not in ('strict', 'ignore', 'replace'): - raise (LookupError( - 'unknown encoding error handler: "%s" (choices: ' - '"strict", "ignore", or "replace")' % value), - None, sys.exc_info()[2]) - except LookupError: - raise (LookupError( - 'unknown encoding error handler: "%s" (choices: ' - '"strict", "ignore", "replace", "backslashreplace", ' - '"xmlcharrefreplace", and possibly others; see documentation for ' - 'the Python ``codecs`` module)' % value), - None, sys.exc_info()[2]) - return value - -def set_encoding_and_error_handler(option, opt, value, parser): - """ - Validate & set the encoding and error handler specified. (Option callback.) - """ - try: - value = validate_encoding_and_error_handler(option.dest, value) - except LookupError, error: - raise (optparse.OptionValueError('option "%s": %s' % (opt, error)), - None, sys.exc_info()[2]) - if ':' in value: - encoding, handler = value.split(':') - setattr(parser.values, option.dest + '_error_handler', handler) - else: - encoding = value - setattr(parser.values, option.dest, encoding) - -def validate_encoding_and_error_handler(name, value): - if ':' in value: - encoding, handler = value.split(':') - validate_encoding_error_handler(name + '_error_handler', handler) - else: - encoding = value - validate_encoding(name, encoding) - return value - -def make_paths_absolute(pathdict, keys, base_path=None): - """ - Interpret filesystem path settings relative to the `base_path` given. - - Paths are values in `pathdict` whose keys are in `keys`. Get `keys` from - `OptionParser.relative_path_settings`. - """ - if base_path is None: - base_path = os.getcwd() - for key in keys: - if pathdict.has_key(key) and pathdict[key]: - pathdict[key] = os.path.normpath( - os.path.abspath(os.path.join(base_path, pathdict[key]))) - - -class OptionParser(optparse.OptionParser, docutils.SettingsSpec): - - """ - Parser for command-line and library use. The `settings_spec` - specification here and in other Docutils components are merged to build - the set of command-line options and runtime settings for this process. - - Common settings (defined below) and component-specific settings must not - conflict. Short options are reserved for common settings, and components - are restrict to using long options. - """ - - threshold_choices = 'info 1 warning 2 error 3 severe 4 none 5'.split() - """Possible inputs for for --report and --halt threshold values.""" - - thresholds = {'info': 1, 'warning': 2, 'error': 3, 'severe': 4, 'none': 5} - """Lookup table for --report and --halt threshold values.""" - - if hasattr(codecs, 'backslashreplace_errors'): - default_error_encoding_error_handler = 'backslashreplace' - else: - default_error_encoding_error_handler = 'replace' - - settings_spec = ( - 'General Docutils Options', - None, - (('Include a "Generated by Docutils" credit and link at the end ' - 'of the document.', - ['--generator', '-g'], {'action': 'store_true'}), - ('Do not include a generator credit.', - ['--no-generator'], {'action': 'store_false', 'dest': 'generator'}), - ('Include the date at the end of the document (UTC).', - ['--date', '-d'], {'action': 'store_const', 'const': '%Y-%m-%d', - 'dest': 'datestamp'}), - ('Include the time & date at the end of the document (UTC).', - ['--time', '-t'], {'action': 'store_const', - 'const': '%Y-%m-%d %H:%M UTC', - 'dest': 'datestamp'}), - ('Do not include a datestamp of any kind.', - ['--no-datestamp'], {'action': 'store_const', 'const': None, - 'dest': 'datestamp'}), - ('Include a "View document source" link (relative to destination).', - ['--source-link', '-s'], {'action': 'store_true'}), - ('Use the supplied <URL> verbatim for a "View document source" ' - 'link; implies --source-link.', - ['--source-url'], {'metavar': '<URL>'}), - ('Do not include a "View document source" link.', - ['--no-source-link'], - {'action': 'callback', 'callback': store_multiple, - 'callback_args': ('source_link', 'source_url')}), - ('Enable backlinks from section headers to table of contents ' - 'entries. This is the default.', - ['--toc-entry-backlinks'], - {'dest': 'toc_backlinks', 'action': 'store_const', 'const': 'entry', - 'default': 'entry'}), - ('Enable backlinks from section headers to the top of the table of ' - 'contents.', - ['--toc-top-backlinks'], - {'dest': 'toc_backlinks', 'action': 'store_const', 'const': 'top'}), - ('Disable backlinks to the table of contents.', - ['--no-toc-backlinks'], - {'dest': 'toc_backlinks', 'action': 'store_false'}), - ('Enable backlinks from footnotes and citations to their ' - 'references. This is the default.', - ['--footnote-backlinks'], - {'action': 'store_true', 'default': 1}), - ('Disable backlinks from footnotes and citations.', - ['--no-footnote-backlinks'], - {'dest': 'footnote_backlinks', 'action': 'store_false'}), - ('Set verbosity threshold; report system messages at or higher than ' - '<level> (by name or number: "info" or "1", warning/2, error/3, ' - 'severe/4; also, "none" or "5"). Default is 2 (warning).', - ['--report', '-r'], {'choices': threshold_choices, 'default': 2, - 'dest': 'report_level', 'metavar': '<level>'}), - ('Report all system messages, info-level and higher. (Same as ' - '"--report=info".)', - ['--verbose', '-v'], {'action': 'store_const', 'const': 'info', - 'dest': 'report_level'}), - ('Do not report any system messages. (Same as "--report=none".)', - ['--quiet', '-q'], {'action': 'store_const', 'const': 'none', - 'dest': 'report_level'}), - ('Set the threshold (<level>) at or above which system messages are ' - 'converted to exceptions, halting execution immediately. Levels ' - 'as in --report. Default is 4 (severe).', - ['--halt'], {'choices': threshold_choices, 'dest': 'halt_level', - 'default': 4, 'metavar': '<level>'}), - ('Same as "--halt=info": halt processing at the slightest problem.', - ['--strict'], {'action': 'store_const', 'const': 'info', - 'dest': 'halt_level'}), - ('Enable a non-zero exit status for normal exit if non-halting ' - 'system messages (at or above <level>) were generated. Levels as ' - 'in --report. Default is 5 (disabled). Exit status is the maximum ' - 'system message level plus 10 (11 for INFO, etc.).', - ['--exit'], {'choices': threshold_choices, 'dest': 'exit_level', - 'default': 5, 'metavar': '<level>'}), - ('Report debug-level system messages and generate diagnostic output.', - ['--debug'], {'action': 'store_true'}), - ('Do not report debug-level system messages or generate diagnostic ' - 'output.', - ['--no-debug'], {'action': 'store_false', 'dest': 'debug'}), - ('Send the output of system messages (warnings) to <file>.', - ['--warnings'], {'dest': 'warning_stream', 'metavar': '<file>'}), - ('Enable Python tracebacks when an error occurs.', - ['--traceback'], {'action': 'store_true', 'default': None}), - ('Disable Python tracebacks when errors occur; report just the error ' - 'instead. This is the default.', - ['--no-traceback'], {'dest': 'traceback', 'action': 'store_false'}), - ('Specify the encoding of input text. Default is locale-dependent.', - ['--input-encoding', '-i'], - {'action': 'callback', 'callback': set_encoding, - 'metavar': '<name>', 'type': 'string', 'dest': 'input_encoding'}), - ('Specify the text encoding for output. Default is UTF-8. ' - 'Optionally also specify the encoding error handler for unencodable ' - 'characters (see "--error-encoding"); default is "strict".', - ['--output-encoding', '-o'], - {'action': 'callback', 'callback': set_encoding_and_error_handler, - 'metavar': '<name[:handler]>', 'type': 'string', - 'dest': 'output_encoding', 'default': 'utf-8'}), - (SUPPRESS_HELP, # usually handled by --output-encoding - ['--output_encoding_error_handler'], - {'action': 'callback', 'callback': set_encoding_error_handler, - 'type': 'string', 'dest': 'output_encoding_error_handler', - 'default': 'strict'}), - ('Specify the text encoding for error output. Default is ASCII. ' - 'Optionally also specify the encoding error handler for unencodable ' - 'characters, after a colon (":"). Acceptable values are the same ' - 'as for the "error" parameter of Python\'s ``encode`` string ' - 'method. Default is "%s".' % default_error_encoding_error_handler, - ['--error-encoding', '-e'], - {'action': 'callback', 'callback': set_encoding_and_error_handler, - 'metavar': '<name[:handler]>', 'type': 'string', - 'dest': 'error_encoding', 'default': 'ascii'}), - (SUPPRESS_HELP, # usually handled by --error-encoding - ['--error_encoding_error_handler'], - {'action': 'callback', 'callback': set_encoding_error_handler, - 'type': 'string', 'dest': 'error_encoding_error_handler', - 'default': default_error_encoding_error_handler}), - ('Specify the language of input text (ISO 639 2-letter identifier).' - ' Default is "en" (English).', - ['--language', '-l'], {'dest': 'language_code', 'default': 'en', - 'metavar': '<name>'}), - ('Read configuration settings from <file>, if it exists.', - ['--config'], {'metavar': '<file>', 'type': 'string', - 'action': 'callback', 'callback': read_config_file}), - ("Show this program's version number and exit.", - ['--version', '-V'], {'action': 'version'}), - ('Show this help message and exit.', - ['--help', '-h'], {'action': 'help'}), - # Hidden options, for development use only: - (SUPPRESS_HELP, ['--dump-settings'], {'action': 'store_true'}), - (SUPPRESS_HELP, ['--dump-internals'], {'action': 'store_true'}), - (SUPPRESS_HELP, ['--dump-transforms'], {'action': 'store_true'}), - (SUPPRESS_HELP, ['--dump-pseudo-xml'], {'action': 'store_true'}), - (SUPPRESS_HELP, ['--expose-internal-attribute'], - {'action': 'append', 'dest': 'expose_internals'}),)) - """Runtime settings and command-line options common to all Docutils front - ends. Setting specs specific to individual Docutils components are also - used (see `populate_from_components()`).""" - - settings_defaults = {'_disable_config': None} - """Defaults for settings that don't have command-line option equivalents.""" - - relative_path_settings = ('warning_stream',) - - version_template = '%%prog (Docutils %s)' % docutils.__version__ - """Default version message.""" - - def __init__(self, components=(), defaults=None, read_config_files=None, - *args, **kwargs): - """ - `components` is a list of Docutils components each containing a - ``.settings_spec`` attribute. `defaults` is a mapping of setting - default overrides. - """ - optparse.OptionParser.__init__( - self, add_help_option=None, - formatter=optparse.TitledHelpFormatter(width=78), - *args, **kwargs) - if not self.version: - self.version = self.version_template - # Make an instance copy (it will be modified): - self.relative_path_settings = list(self.relative_path_settings) - self.populate_from_components((self,) + tuple(components)) - defaults = defaults or {} - if read_config_files and not self.defaults['_disable_config']: - config = ConfigParser() - config.read_standard_files(self) - config_settings = config.get_section('options') - make_paths_absolute(config_settings, self.relative_path_settings) - defaults.update(config_settings) - # Internal settings with no defaults from settings specifications; - # initialize manually: - self.set_defaults(_source=None, _destination=None, **defaults) - - def populate_from_components(self, components): - """ - For each component, first populate from the `SettingsSpec.settings_spec` - structure, then from the `SettingsSpec.settings_defaults` dictionary. - After all components have been processed, check for and populate from - each component's `SettingsSpec.settings_default_overrides` dictionary. - """ - for component in components: - if component is None: - continue - i = 0 - settings_spec = component.settings_spec - self.relative_path_settings.extend( - component.relative_path_settings) - while i < len(settings_spec): - title, description, option_spec = settings_spec[i:i+3] - if title: - group = optparse.OptionGroup(self, title, description) - self.add_option_group(group) - else: - group = self # single options - for (help_text, option_strings, kwargs) in option_spec: - group.add_option(help=help_text, *option_strings, - **kwargs) - if component.settings_defaults: - self.defaults.update(component.settings_defaults) - i += 3 - for component in components: - if component and component.settings_default_overrides: - self.defaults.update(component.settings_default_overrides) - - def check_values(self, values, args): - if hasattr(values, 'report_level'): - values.report_level = self.check_threshold(values.report_level) - if hasattr(values, 'halt_level'): - values.halt_level = self.check_threshold(values.halt_level) - if hasattr(values, 'exit_level'): - values.exit_level = self.check_threshold(values.exit_level) - values._source, values._destination = self.check_args(args) - make_paths_absolute(values.__dict__, self.relative_path_settings, - os.getcwd()) - return values - - def check_threshold(self, level): - try: - return int(level) - except ValueError: - try: - return self.thresholds[level.lower()] - except (KeyError, AttributeError): - self.error('Unknown threshold: %r.' % level) - - def check_args(self, args): - source = destination = None - if args: - source = args.pop(0) - if source == '-': # means stdin - source = None - if args: - destination = args.pop(0) - if destination == '-': # means stdout - destination = None - if args: - self.error('Maximum 2 arguments allowed.') - if source and source == destination: - self.error('Do not specify the same file for both source and ' - 'destination. It will clobber the source file.') - return source, destination - - -class ConfigParser(CP.ConfigParser): - - standard_config_files = ( - '/etc/docutils.conf', # system-wide - './docutils.conf', # project-specific - os.path.expanduser('~/.docutils')) # user-specific - """Docutils configuration files, using ConfigParser syntax (section - 'options'). Later files override earlier ones.""" - - validation = { - 'options': - {'input_encoding': validate_encoding, - 'output_encoding': validate_encoding, - 'output_encoding_error_handler': validate_encoding_error_handler, - 'error_encoding': validate_encoding, - 'error_encoding_error_handler': validate_encoding_error_handler}} - """{section: {option: validation function}} mapping, used by - `validate_options`. Validation functions take two parameters: name and - value. They return a (possibly modified) value, or raise an exception.""" - - def read_standard_files(self, option_parser): - self.read(self.standard_config_files, option_parser) - - def read(self, filenames, option_parser): - if type(filenames) in types.StringTypes: - filenames = [filenames] - for filename in filenames: - CP.ConfigParser.read(self, filename) - self.validate_options(filename, option_parser) - - def validate_options(self, filename, option_parser): - for section in self.validation.keys(): - if not self.has_section(section): - continue - for option in self.validation[section].keys(): - if self.has_option(section, option): - value = self.get(section, option) - validator = self.validation[section][option] - try: - new_value = validator(option, value) - except Exception, error: - raise (ValueError( - 'Error in config file "%s", section "[%s]":\n' - ' %s: %s\n %s = %s' - % (filename, section, error.__class__.__name__, - error, option, value)), None, sys.exc_info()[2]) - self.set(section, option, new_value) - - def optionxform(self, optionstr): - """ - Transform '-' to '_' so the cmdline form of option names can be used. - """ - return optionstr.lower().replace('-', '_') - - def get_section(self, section, raw=0, vars=None): - """ - Return a given section as a dictionary (empty if the section - doesn't exist). - - All % interpolations are expanded in the return values, based on the - defaults passed into the constructor, unless the optional argument - `raw` is true. Additional substitutions may be provided using the - `vars` argument, which must be a dictionary whose contents overrides - any pre-existing defaults. - - The section DEFAULT is special. - """ - section_dict = {} - if self.has_section(section): - for option in self.options(section): - section_dict[option] = self.get(section, option, raw, vars) - return section_dict diff --git a/docutils/docutils/io.py b/docutils/docutils/io.py deleted file mode 100644 index 0ef4bdab6..000000000 --- a/docutils/docutils/io.py +++ /dev/null @@ -1,289 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -I/O classes provide a uniform API for low-level input and output. Subclasses -will exist for a variety of input/output mechanisms. -""" - -__docformat__ = 'reStructuredText' - -import sys -import locale -from types import UnicodeType -from docutils import TransformSpec - - -class Input(TransformSpec): - - """ - Abstract base class for input wrappers. - """ - - component_type = 'input' - - default_source_path = None - - def __init__(self, source=None, source_path=None, encoding=None): - self.encoding = encoding - """Text encoding for the input source.""" - - self.source = source - """The source of input data.""" - - self.source_path = source_path - """A text reference to the source.""" - - if not source_path: - self.source_path = self.default_source_path - - def __repr__(self): - return '%s: source=%r, source_path=%r' % (self.__class__, self.source, - self.source_path) - - def read(self): - raise NotImplementedError - - def decode(self, data): - """ - Decode a string, `data`, heuristically. - Raise UnicodeError if unsuccessful. - - The client application should call ``locale.setlocale`` at the - beginning of processing:: - - locale.setlocale(locale.LC_ALL, '') - """ - if (self.encoding and self.encoding.lower() == 'unicode' - or isinstance(data, UnicodeType)): - return unicode(data) - encodings = [self.encoding, 'utf-8'] - try: - encodings.append(locale.nl_langinfo(locale.CODESET)) - except: - pass - try: - encodings.append(locale.getlocale()[1]) - except: - pass - try: - encodings.append(locale.getdefaultlocale()[1]) - except: - pass - encodings.append('latin-1') - for enc in encodings: - if not enc: - continue - try: - return unicode(data, enc) - except (UnicodeError, LookupError): - pass - raise UnicodeError( - 'Unable to decode input data. Tried the following encodings: %s.' - % ', '.join([repr(enc) for enc in encodings if enc])) - - -class Output(TransformSpec): - - """ - Abstract base class for output wrappers. - """ - - component_type = 'output' - - default_destination_path = None - - def __init__(self, destination=None, destination_path=None, - encoding=None, error_handler='strict'): - self.encoding = encoding - """Text encoding for the output destination.""" - - self.error_handler = error_handler or 'strict' - """Text encoding error handler.""" - - self.destination = destination - """The destination for output data.""" - - self.destination_path = destination_path - """A text reference to the destination.""" - - if not destination_path: - self.destination_path = self.default_destination_path - - def __repr__(self): - return ('%s: destination=%r, destination_path=%r' - % (self.__class__, self.destination, self.destination_path)) - - def write(self, data): - raise NotImplementedError - - def encode(self, data): - if self.encoding and self.encoding.lower() == 'unicode': - return data - else: - return data.encode(self.encoding, self.error_handler) - - -class FileInput(Input): - - """ - Input for single, simple file-like objects. - """ - - def __init__(self, source=None, source_path=None, - encoding=None, autoclose=1): - """ - :Parameters: - - `source`: either a file-like object (which is read directly), or - `None` (which implies `sys.stdin` if no `source_path` given). - - `source_path`: a path to a file, which is opened and then read. - - `autoclose`: close automatically after read (boolean); always - false if `sys.stdin` is the source. - """ - Input.__init__(self, source, source_path, encoding) - self.autoclose = autoclose - if source is None: - if source_path: - try: - self.source = open(source_path) - except IOError, error: - print >>sys.stderr, '%s: %s' % (error.__class__.__name__, - error) - print >>sys.stderr, ( - 'Unable to open source file for reading (%s). Exiting.' - % source_path) - sys.exit(1) - else: - self.source = sys.stdin - self.autoclose = None - if not source_path: - try: - self.source_path = self.source.name - except AttributeError: - pass - - def read(self): - """Read and decode a single file and return the data.""" - data = self.source.read() - if self.autoclose: - self.close() - return self.decode(data) - - def close(self): - self.source.close() - - -class FileOutput(Output): - - """ - Output for single, simple file-like objects. - """ - - def __init__(self, destination=None, destination_path=None, - encoding=None, error_handler='strict', autoclose=1): - """ - :Parameters: - - `destination`: either a file-like object (which is written - directly) or `None` (which implies `sys.stdout` if no - `destination_path` given). - - `destination_path`: a path to a file, which is opened and then - written. - - `autoclose`: close automatically after write (boolean); always - false if `sys.stdout` is the destination. - """ - Output.__init__(self, destination, destination_path, - encoding, error_handler) - self.opened = 1 - self.autoclose = autoclose - if destination is None: - if destination_path: - self.opened = None - else: - self.destination = sys.stdout - self.autoclose = None - if not destination_path: - try: - self.destination_path = self.destination.name - except AttributeError: - pass - - def open(self): - try: - self.destination = open(self.destination_path, 'w') - except IOError, error: - print >>sys.stderr, '%s: %s' % (error.__class__.__name__, - error) - print >>sys.stderr, ('Unable to open destination file for writing ' - '(%s). Exiting.' % source_path) - sys.exit(1) - self.opened = 1 - - def write(self, data): - """Encode `data`, write it to a single file, and return it.""" - output = self.encode(data) - if not self.opened: - self.open() - self.destination.write(output) - if self.autoclose: - self.close() - return output - - def close(self): - self.destination.close() - self.opened = None - - -class StringInput(Input): - - """ - Direct string input. - """ - - default_source_path = '<string>' - - def read(self): - """Decode and return the source string.""" - return self.decode(self.source) - - -class StringOutput(Output): - - """ - Direct string output. - """ - - default_destination_path = '<string>' - - def write(self, data): - """Encode `data`, store it in `self.destination`, and return it.""" - self.destination = self.encode(data) - return self.destination - - -class NullInput(Input): - - """ - Degenerate input: read nothing. - """ - - default_source_path = 'null input' - - def read(self): - """Return a null string.""" - return u'' - - -class NullOutput(Output): - - """ - Degenerate output: write nothing. - """ - - default_destination_path = 'null output' - - def write(self, data): - """Do nothing ([don't even] send data to the bit bucket).""" - pass diff --git a/docutils/docutils/languages/__init__.py b/docutils/docutils/languages/__init__.py deleted file mode 100644 index a4d451156..000000000 --- a/docutils/docutils/languages/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -# Internationalization details are documented in -# <http://docutils.sf.net/spec/howto/i18n.html>. - -""" -This package contains modules for language-dependent features of Docutils. -""" - -__docformat__ = 'reStructuredText' - -_languages = {} - -def get_language(language_code): - if _languages.has_key(language_code): - return _languages[language_code] - module = __import__(language_code, globals(), locals()) - _languages[language_code] = module - return module diff --git a/docutils/docutils/languages/af.py b/docutils/docutils/languages/af.py deleted file mode 100644 index 6bfe4f162..000000000 --- a/docutils/docutils/languages/af.py +++ /dev/null @@ -1,60 +0,0 @@ -# Author: Jannie Hofmeyr -# Contact: jhsh@sun.ac.za -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -# New language mappings are welcome. Before doing a new translation, please -# read <http://docutils.sf.net/spec/howto/i18n.html>. Two files must be -# translated for each language: one in docutils/languages, the other in -# docutils/parsers/rst/languages. - -""" -Afrikaans-language mappings for language-dependent features of Docutils. -""" - -__docformat__ = 'reStructuredText' - -labels = { - 'author': 'Auteur', - 'authors': 'Auteurs', - 'organization': 'Organisasie', - 'address': 'Adres', - 'contact': 'Kontak', - 'version': 'Weergawe', - 'revision': 'Revisie', - 'status': 'Status', - 'date': 'Datum', - 'copyright': 'Kopiereg', - 'dedication': 'Opdrag', - 'abstract': 'Opsomming', - 'attention': 'Aandag!', - 'caution': 'Wees versigtig!', - 'danger': '!GEVAAR!', - 'error': 'Fout', - 'hint': 'Wenk', - 'important': 'Belangrik', - 'note': 'Nota', - 'tip': 'Tip', # hint and tip both have the same translation: wenk - 'warning': 'Waarskuwing', - 'contents': 'Inhoud'} -"""Mapping of node class name to label text.""" - -bibliographic_fields = { - 'auteur': 'author', - 'auteurs': 'authors', - 'organisasie': 'organization', - 'adres': 'address', - 'kontak': 'contact', - 'weergawe': 'version', - 'revisie': 'revision', - 'status': 'status', - 'datum': 'date', - 'kopiereg': 'copyright', - 'opdrag': 'dedication', - 'opsomming': 'abstract'} -"""Afrikaans (lowcased) to canonical name mapping for bibliographic fields.""" - -author_separators = [';', ','] -"""List of separator strings for the 'Authors' bibliographic field. Tried in -order.""" diff --git a/docutils/docutils/languages/de.py b/docutils/docutils/languages/de.py deleted file mode 100644 index ddffbda74..000000000 --- a/docutils/docutils/languages/de.py +++ /dev/null @@ -1,60 +0,0 @@ -# Authors: David Goodger; Gunnar Schwant -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -# New language mappings are welcome. Before doing a new translation, please -# read <http://docutils.sf.net/spec/howto/i18n.html>. Two files must be -# translated for each language: one in docutils/languages, the other in -# docutils/parsers/rst/languages. - -""" -German language mappings for language-dependent features of Docutils. -""" - -__docformat__ = 'reStructuredText' - -labels = { - 'author': 'Autor', - 'authors': 'Autoren', - 'organization': 'Organisation', - 'address': 'Adresse', - 'contact': 'Kontakt', - 'version': 'Version', - 'revision': 'Revision', - 'status': 'Status', - 'date': 'Datum', - 'dedication': 'Widmung', - 'copyright': 'Copyright', - 'abstract': 'Zusammenfassung', - 'attention': 'Achtung!', - 'caution': 'Vorsicht!', - 'danger': '!GEFAHR!', - 'error': 'Fehler', - 'hint': 'Hinweis', - 'important': 'Wichtig', - 'note': 'Bemerkung', - 'tip': 'Tipp', - 'warning': 'Warnung', - 'contents': 'Inhalt'} -"""Mapping of node class name to label text.""" - -bibliographic_fields = { - 'autor': 'author', - 'autoren': 'authors', - 'organisation': 'organization', - 'adresse': 'address', - 'kontakt': 'contact', - 'version': 'version', - 'revision': 'revision', - 'status': 'status', - 'datum': 'date', - 'copyright': 'copyright', - 'widmung': 'dedication', - 'zusammenfassung': 'abstract'} -"""German (lowcased) to canonical name mapping for bibliographic fields.""" - -author_separators = [';', ','] -"""List of separator strings for the 'Authors' bibliographic field. Tried in -order.""" diff --git a/docutils/docutils/languages/en.py b/docutils/docutils/languages/en.py deleted file mode 100644 index db578810b..000000000 --- a/docutils/docutils/languages/en.py +++ /dev/null @@ -1,62 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -# New language mappings are welcome. Before doing a new translation, please -# read <http://docutils.sf.net/spec/howto/i18n.html>. Two files must be -# translated for each language: one in docutils/languages, the other in -# docutils/parsers/rst/languages. - -""" -English-language mappings for language-dependent features of Docutils. -""" - -__docformat__ = 'reStructuredText' - -labels = { - # fixed: language-dependent - 'author': 'Author', - 'authors': 'Authors', - 'organization': 'Organization', - 'address': 'Address', - 'contact': 'Contact', - 'version': 'Version', - 'revision': 'Revision', - 'status': 'Status', - 'date': 'Date', - 'copyright': 'Copyright', - 'dedication': 'Dedication', - 'abstract': 'Abstract', - 'attention': 'Attention!', - 'caution': 'Caution!', - 'danger': '!DANGER!', - 'error': 'Error', - 'hint': 'Hint', - 'important': 'Important', - 'note': 'Note', - 'tip': 'Tip', - 'warning': 'Warning', - 'contents': 'Contents'} -"""Mapping of node class name to label text.""" - -bibliographic_fields = { - # language-dependent: fixed - 'author': 'author', - 'authors': 'authors', - 'organization': 'organization', - 'address': 'address', - 'contact': 'contact', - 'version': 'version', - 'revision': 'revision', - 'status': 'status', - 'date': 'date', - 'copyright': 'copyright', - 'dedication': 'dedication', - 'abstract': 'abstract'} -"""English (lowcased) to canonical name mapping for bibliographic fields.""" - -author_separators = [';', ','] -"""List of separator strings for the 'Authors' bibliographic field. Tried in -order.""" diff --git a/docutils/docutils/languages/es.py b/docutils/docutils/languages/es.py deleted file mode 100644 index 7505de5da..000000000 --- a/docutils/docutils/languages/es.py +++ /dev/null @@ -1,60 +0,0 @@ -# Author: Marcelo Huerta San Martín -# Contact: mghsm@uol.com.ar -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -# New language mappings are welcome. Before doing a new translation, please -# read <http://docutils.sf.net/spec/howto/i18n.html>. Two files must be -# translated for each language: one in docutils/languages, the other in -# docutils/parsers/rst/languages. - -""" -Spanish-language mappings for language-dependent features of Docutils. -""" - -__docformat__ = 'reStructuredText' - -labels = { - 'author': u'Autor', - 'authors': u'Autores', - 'organization': u'Organizaci\u00f3n', - 'address': u'Direcci\u00f3n', - 'contact': u'Contacto', - 'version': u'Versi\u00f3n', - 'revision': u'Revisi\u00f3n', - 'status': u'Estado', - 'date': u'Fecha', - 'copyright': u'Copyright', - 'dedication': u'Dedicatoria', - 'abstract': u'Resumen', - 'attention': u'\u00a1Atenci\u00f3n!', - 'caution': u'\u00a1Precauci\u00f3n!', - 'danger': u'\u00a1PELIGRO!', - 'error': u'Error', - 'hint': u'Sugerencia', - 'important': u'Importante', - 'note': u'Nota', - 'tip': u'Consejo', - 'warning': u'Advertencia', - 'contents': u'Contenido'} -"""Mapping of node class name to label text.""" - -bibliographic_fields = { - u'autor': 'author', - u'autores': 'authors', - u'organizaci\u00f3n': 'organization', - u'direcci\u00f3n': 'address', - u'contacto': 'contact', - u'versi\u00f3n': 'version', - u'revisi\u00f3n': 'revision', - u'estado': 'status', - u'fecha': 'date', - u'copyright': 'copyright', - u'dedicatoria': 'dedication', - u'resumen': 'abstract'} -"""Spanish (lowcased) to canonical name mapping for bibliographic fields.""" - -author_separators = [';', ','] -"""List of separator strings for the 'Authors' bibliographic field. Tried in -order.""" diff --git a/docutils/docutils/languages/fr.py b/docutils/docutils/languages/fr.py deleted file mode 100644 index 52317c174..000000000 --- a/docutils/docutils/languages/fr.py +++ /dev/null @@ -1,60 +0,0 @@ -# Author: Stefane Fermigier -# Contact: sf@fermigier.com -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -# New language mappings are welcome. Before doing a new translation, please -# read <http://docutils.sf.net/spec/howto/i18n.html>. Two files must be -# translated for each language: one in docutils/languages, the other in -# docutils/parsers/rst/languages. - -""" -French-language mappings for language-dependent features of Docutils. -""" - -__docformat__ = 'reStructuredText' - -labels = { - u'author': u'Auteur', - u'authors': u'Auteurs', - u'organization': u'Organisation', - u'address': u'Adresse', - u'contact': u'Contact', - u'version': u'Version', - u'revision': u'R\u00e9vision', - u'status': u'Statut', - u'date': u'Date', - u'copyright': u'Copyright', - u'dedication': u'D\u00e9dicace', - u'abstract': u'R\u00e9sum\u00e9', - u'attention': u'Attention!', - u'caution': u'Avertissement!', - u'danger': u'!DANGER!', - u'error': u'Erreur', - u'hint': u'Indication', - u'important': u'Important', - u'note': u'Note', - u'tip': u'Astuce', - u'warning': u'Avis', - u'contents': u'Sommaire'} -"""Mapping of node class name to label text.""" - -bibliographic_fields = { - u'auteur': u'author', - u'auteurs': u'authors', - u'organisation': u'organization', - u'adresse': u'address', - u'contact': u'contact', - u'version': u'version', - u'r\u00e9vision': u'revision', - u'statut': u'status', - u'date': u'date', - u'copyright': u'copyright', - u'd\u00e9dicace': u'dedication', - u'r\u00e9sum\u00e9': u'abstract'} -"""French (lowcased) to canonical name mapping for bibliographic fields.""" - -author_separators = [';', ','] -"""List of separator strings for the 'Authors' bibliographic field. Tried in -order.""" diff --git a/docutils/docutils/languages/it.py b/docutils/docutils/languages/it.py deleted file mode 100644 index d86a5b1ec..000000000 --- a/docutils/docutils/languages/it.py +++ /dev/null @@ -1,60 +0,0 @@ -# Author: Nicola Larosa -# Contact: docutils@tekNico.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -# New language mappings are welcome. Before doing a new translation, please -# read <http://docutils.sf.net/spec/howto/i18n.html>. Two files must be -# translated for each language: one in docutils/languages, the other in -# docutils/parsers/rst/languages. - -""" -Italian-language mappings for language-dependent features of Docutils. -""" - -__docformat__ = 'reStructuredText' - -labels = { - 'author': 'Autore', - 'authors': 'Autori', - 'organization': 'Organizzazione', - 'address': 'Indirizzo', - 'contact': 'Contatti', - 'version': 'Versione', - 'revision': 'Revisione', - 'status': 'Status', - 'date': 'Data', - 'copyright': 'Copyright', - 'dedication': 'Dedica', - 'abstract': 'Riassunto', - 'attention': 'Attenzione!', - 'caution': 'Cautela!', - 'danger': '!PERICOLO!', - 'error': 'Errore', - 'hint': 'Suggerimento', - 'important': 'Importante', - 'note': 'Nota', - 'tip': 'Consiglio', - 'warning': 'Avvertenza', - 'contents': 'Indice'} -"""Mapping of node class name to label text.""" - -bibliographic_fields = { - 'autore': 'author', - 'autori': 'authors', - 'organizzazione': 'organization', - 'indirizzo': 'address', - 'contatti': 'contact', - 'versione': 'version', - 'revisione': 'revision', - 'status': 'status', - 'data': 'date', - 'copyright': 'copyright', - 'dedica': 'dedication', - 'riassunto': 'abstract'} -"""Italian (lowcased) to canonical name mapping for bibliographic fields.""" - -author_separators = [';', ','] -"""List of separator strings for the 'Authors' bibliographic field. Tried in -order.""" diff --git a/docutils/docutils/languages/ru.py b/docutils/docutils/languages/ru.py deleted file mode 100644 index e3b24a0c6..000000000 --- a/docutils/docutils/languages/ru.py +++ /dev/null @@ -1,68 +0,0 @@ -# Author: Roman Suzi -# Contact: rnd@onego.ru -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -# New language mappings are welcome. Before doing a new translation, please -# read <http://docutils.sf.net/spec/howto/i18n.html>. Two files must be -# translated for each language: one in docutils/languages, the other in -# docutils/parsers/rst/languages. - -""" -Russian-language mappings for language-dependent features of Docutils. -""" - -__docformat__ = 'reStructuredText' - -labels = { - u'abstract': u'\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f', - u'address': u'\u0410\u0434\u0440\u0435\u0441', - u'attention': u'\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435!', - u'author': u'\u0410\u0432\u0442\u043e\u0440', - u'authors': u'\u0410\u0432\u0442\u043e\u0440\u044b', - u'caution': u'\u041e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e!', - u'contact': u'\u041a\u043e\u043d\u0442\u0430\u043a\u0442', - u'contents': - u'\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435', - u'copyright': u'\u041f\u0440\u0430\u0432\u0430 ' - u'\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f', - u'danger': u'\u041e\u041f\u0410\u0421\u041d\u041e!', - u'date': u'\u0414\u0430\u0442\u0430', - u'dedication': - u'\u041f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0438\u0435', - u'error': u'\u041e\u0448\u0438\u0431\u043a\u0430', - u'hint': u'\u0421\u043e\u0432\u0435\u0442', - u'important': u'\u0412\u0430\u0436\u043d\u043e', - u'note': u'\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435', - u'organization': - u'\u041e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f', - u'revision': u'\u0420\u0435\u0434\u0430\u043a\u0446\u0438\u044f', - u'status': u'\u0421\u0442\u0430\u0442\u0443\u0441', - u'tip': u'\u041f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430', - u'version': u'\u0412\u0435\u0440\u0441\u0438\u044f', - u'warning': u'\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436' - u'\u0434\u0435\u043d\u0438\u0435'} -"""Mapping of node class name to label text.""" - -bibliographic_fields = { - u'\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f': u'abstract', - u'\u0410\u0434\u0440\u0435\u0441': u'address', - u'\u0410\u0432\u0442\u043e\u0440': u'author', - u'\u0410\u0432\u0442\u043e\u0440\u044b': u'authors', - u'\u041a\u043e\u043d\u0442\u0430\u043a\u0442': u'contact', - u'\u041f\u0440\u0430\u0432\u0430 \u043a\u043e\u043f\u0438\u0440\u043e' - u'\u0432\u0430\u043d\u0438\u044f': u'copyright', - u'\u0414\u0430\u0442\u0430': u'date', - u'\u041f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0438\u0435': - u'dedication', - u'\u041e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f': - u'organization', - u'\u0420\u0435\u0434\u0430\u043a\u0446\u0438\u044f': u'revision', - u'\u0421\u0442\u0430\u0442\u0443\u0441': u'status', - u'\u0412\u0435\u0440\u0441\u0438\u044f': u'version'} -"""Russian (lowcased) to canonical name mapping for bibliographic fields.""" - -author_separators = [';', ','] -"""List of separator strings for the 'Authors' bibliographic field. Tried in -order.""" diff --git a/docutils/docutils/languages/sk.py b/docutils/docutils/languages/sk.py deleted file mode 100644 index 20fa645ad..000000000 --- a/docutils/docutils/languages/sk.py +++ /dev/null @@ -1,60 +0,0 @@ -# :Author: Miroslav Vasko -# :Contact: zemiak@zoznam.sk -# :Revision: $Revision$ -# :Date: $Date$ -# :Copyright: This module has been placed in the public domain. - -# New language mappings are welcome. Before doing a new translation, please -# read <http://docutils.sf.net/spec/howto/i18n.html>. Two files must be -# translated for each language: one in docutils/languages, the other in -# docutils/parsers/rst/languages. - -""" -Slovak-language mappings for language-dependent features of Docutils. -""" - -__docformat__ = 'reStructuredText' - -labels = { - 'author': u'Autor', - 'authors': u'Autori', - 'organization': u'Organiz\u00E1cia', - 'address': u'Adresa', - 'contact': u'Kontakt', - 'version': u'Verzia', - 'revision': u'Rev\u00EDzia', - 'status': u'Stav', - 'date': u'D\u00E1tum', - 'copyright': u'Copyright', - 'dedication': u'Venovanie', - 'abstract': u'Abstraktne', - 'attention': u'Pozor!', - 'caution': u'Opatrne!', - 'danger': u'!NEBEZPE\u010cENSTVO!', - 'error': u'Chyba', - 'hint': u'Rada', - 'important': u'D\u00F4le\u017Eit\u00E9', - 'note': u'Pozn\u00E1mka', - 'tip': u'Tip', - 'warning': u'Varovanie', - 'contents': u'Obsah'} -"""Mapping of node class name to label text.""" - -bibliographic_fields = { - u'autor': 'author', - u'autori': 'authors', - u'organiz\u00E1cia': 'organization', - u'adresa': 'address', - u'kontakt': 'contact', - u'verzia': 'version', - u'rev\u00EDzia': 'revision', - u'stav': 'status', - u'd\u00E1tum': 'date', - u'copyright': 'copyright', - u'venovanie': 'dedication', - u'abstraktne': 'abstract'} -"""Slovak (lowcased) to canonical name mapping for bibliographic fields.""" - -author_separators = [';', ','] -"""List of separator strings for the 'Authors' bibliographic field. Tried in -order.""" diff --git a/docutils/docutils/languages/sv.py b/docutils/docutils/languages/sv.py deleted file mode 100644 index 3454ca6c1..000000000 --- a/docutils/docutils/languages/sv.py +++ /dev/null @@ -1,61 +0,0 @@ -# Author: Adam Chodorowski -# Contact: chodorowski@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -# New language mappings are welcome. Before doing a new translation, please -# read <http://docutils.sf.net/spec/howto/i18n.html>. Two files must be -# translated for each language: one in docutils/languages, the other in -# docutils/parsers/rst/languages. - -""" -Swedish language mappings for language-dependent features of Docutils. -""" - -__docformat__ = 'reStructuredText' - -labels = { - 'author': u'F\u00f6rfattare', - 'authors': u'F\u00f6rfattare', - 'organization': u'Organisation', - 'address': u'Adress', - 'contact': u'Kontakt', - 'version': u'Version', - 'revision': u'Revision', - 'status': u'Status', - 'date': u'Datum', - 'copyright': u'Copyright', - 'dedication': u'Dedikation', - 'abstract': u'Sammanfattning', - 'attention': u'Observera!', - 'caution': u'Varning!', - 'danger': u'FARA!', - 'error': u'Fel', - 'hint': u'V\u00e4gledning', - 'important': u'Viktigt', - 'note': u'Notera', - 'tip': u'Tips', - 'warning': u'Varning', - 'contents': u'Inneh\u00e5ll' } -"""Mapping of node class name to label text.""" - -bibliographic_fields = { - # 'Author' and 'Authors' identical in Swedish; assume the plural: - u'f\u00f6rfattare': 'authors', - u' n/a': 'author', - u'organisation': 'organization', - u'adress': 'address', - u'kontakt': 'contact', - u'version': 'version', - u'revision': 'revision', - u'status': 'status', - u'datum': 'date', - u'copyright': 'copyright', - u'dedikation': 'dedication', - u'sammanfattning': 'abstract' } -"""Swedish (lowcased) to canonical name mapping for bibliographic fields.""" - -author_separators = [';', ','] -"""List of separator strings for the 'Authors' bibliographic field. Tried in -order.""" diff --git a/docutils/docutils/nodes.py b/docutils/docutils/nodes.py deleted file mode 100644 index b24f5f9fc..000000000 --- a/docutils/docutils/nodes.py +++ /dev/null @@ -1,1478 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Docutils document tree element class library. - -Classes in CamelCase are abstract base classes or auxiliary classes. The one -exception is `Text`, for a text (PCDATA) node; uppercase is used to -differentiate from element classes. Classes in lower_case_with_underscores -are element classes, matching the XML element generic identifiers in the DTD_. - -The position of each node (the level at which it can occur) is significant and -is represented by abstract base classes (`Root`, `Structural`, `Body`, -`Inline`, etc.). Certain transformations will be easier because we can use -``isinstance(node, base_class)`` to determine the position of the node in the -hierarchy. - -.. _DTD: http://docutils.sourceforge.net/spec/docutils.dtd -""" - -__docformat__ = 'reStructuredText' - -import sys -import os -import re -import xml.dom.minidom -from types import IntType, SliceType, StringType, UnicodeType, \ - TupleType, ListType -from UserString import UserString - - -# ============================== -# Functional Node Base Classes -# ============================== - -class Node: - - """Abstract base class of nodes in a document tree.""" - - parent = None - """Back-reference to the Node immediately containing this Node.""" - - document = None - """The `document` node at the root of the tree containing this Node.""" - - source = None - """Path or description of the input source which generated this Node.""" - - line = None - """The line number (1-based) of the beginning of this Node in `source`.""" - - def __nonzero__(self): - """ - Node instances are always true, even if they're empty. A node is more - than a simple container. Its boolean "truth" does not depend on - having one or more subnodes in the doctree. - - Use `len()` to check node length. Use `None` to represent a boolean - false value. - """ - return 1 - - def asdom(self, dom=xml.dom.minidom): - """Return a DOM **fragment** representation of this Node.""" - domroot = dom.Document() - return self._dom_node(domroot) - - def pformat(self, indent=' ', level=0): - """Return an indented pseudo-XML representation, for test purposes.""" - raise NotImplementedError - - def copy(self): - """Return a copy of self.""" - raise NotImplementedError - - def setup_child(self, child): - child.parent = self - if self.document: - child.document = self.document - if child.source is None: - child.source = self.document.current_source - if child.line is None: - child.line = self.document.current_line - - def walk(self, visitor): - """ - Traverse a tree of `Node` objects, calling ``visit_...`` methods of - `visitor` when entering each node. If there is no - ``visit_particular_node`` method for a node of type - ``particular_node``, the ``unknown_visit`` method is called. (The - `walkabout()` method is similar, except it also calls ``depart_...`` - methods before exiting each node.) - - This tree traversal supports limited in-place tree - modifications. Replacing one node with one or more nodes is - OK, as is removing an element. However, if the node removed - or replaced occurs after the current node, the old node will - still be traversed, and any new nodes will not. - - Within ``visit_...`` methods (and ``depart_...`` methods for - `walkabout()`), `TreePruningException` subclasses may be raised - (`SkipChildren`, `SkipSiblings`, `SkipNode`, `SkipDeparture`). - - Parameter `visitor`: A `NodeVisitor` object, containing a - ``visit_...`` method for each `Node` subclass encountered. - """ - name = 'visit_' + self.__class__.__name__ - method = getattr(visitor, name, visitor.unknown_visit) - visitor.document.reporter.debug(name, category='nodes.Node.walk') - try: - method(self) - except (SkipChildren, SkipNode): - return - except SkipDeparture: # not applicable; ignore - pass - children = self.get_children() - try: - for child in children[:]: - child.walk(visitor) - except SkipSiblings: - pass - - def walkabout(self, visitor): - """ - Perform a tree traversal similarly to `Node.walk()` (which see), - except also call ``depart_...`` methods before exiting each node. If - there is no ``depart_particular_node`` method for a node of type - ``particular_node``, the ``unknown_departure`` method is called. - - Parameter `visitor`: A `NodeVisitor` object, containing ``visit_...`` - and ``depart_...`` methods for each `Node` subclass encountered. - """ - call_depart = 1 - name = 'visit_' + self.__class__.__name__ - method = getattr(visitor, name, visitor.unknown_visit) - visitor.document.reporter.debug(name, category='nodes.Node.walkabout') - try: - try: - method(self) - except SkipNode: - return - except SkipDeparture: - call_depart = 0 - children = self.get_children() - try: - for child in children[:]: - child.walkabout(visitor) - except SkipSiblings: - pass - except SkipChildren: - pass - if call_depart: - name = 'depart_' + self.__class__.__name__ - method = getattr(visitor, name, visitor.unknown_departure) - visitor.document.reporter.debug( - name, category='nodes.Node.walkabout') - method(self) - - -class Text(Node, UserString): - - """ - Instances are terminal nodes (leaves) containing text only; no child - nodes or attributes. Initialize by passing a string to the constructor. - Access the text itself with the `astext` method. - """ - - tagname = '#text' - - def __init__(self, data, rawsource=''): - UserString.__init__(self, data) - - self.rawsource = rawsource - """The raw text from which this element was constructed.""" - - def __repr__(self): - data = repr(self.data) - if len(data) > 70: - data = repr(self.data[:64] + ' ...') - return '<%s: %s>' % (self.tagname, data) - - def __len__(self): - return len(self.data) - - def shortrepr(self): - data = repr(self.data) - if len(data) > 20: - data = repr(self.data[:16] + ' ...') - return '<%s: %s>' % (self.tagname, data) - - def _dom_node(self, domroot): - return domroot.createTextNode(self.data) - - def astext(self): - return self.data - - def copy(self): - return self.__class__(self.data) - - def pformat(self, indent=' ', level=0): - result = [] - indent = indent * level - for line in self.data.splitlines(): - result.append(indent + line + '\n') - return ''.join(result) - - def get_children(self): - """Text nodes have no children. Return [].""" - return [] - - -class Element(Node): - - """ - `Element` is the superclass to all specific elements. - - Elements contain attributes and child nodes. Elements emulate - dictionaries for attributes, indexing by attribute name (a string). To - set the attribute 'att' to 'value', do:: - - element['att'] = 'value' - - Elements also emulate lists for child nodes (element nodes and/or text - nodes), indexing by integer. To get the first child node, use:: - - element[0] - - Elements may be constructed using the ``+=`` operator. To add one new - child node to element, do:: - - element += node - - This is equivalent to ``element.append(node)``. - - To add a list of multiple child nodes at once, use the same ``+=`` - operator:: - - element += [node1, node2] - - This is equivalent to ``element.extend([node1, node2])``. - """ - - tagname = None - """The element generic identifier. If None, it is set as an instance - attribute to the name of the class.""" - - child_text_separator = '\n\n' - """Separator for child nodes, used by `astext()` method.""" - - def __init__(self, rawsource='', *children, **attributes): - self.rawsource = rawsource - """The raw text from which this element was constructed.""" - - self.children = [] - """List of child nodes (elements and/or `Text`).""" - - self.extend(children) # maintain parent info - - self.attributes = {} - """Dictionary of attribute {name: value}.""" - - for att, value in attributes.items(): - self.attributes[att.lower()] = value - - if self.tagname is None: - self.tagname = self.__class__.__name__ - - def _dom_node(self, domroot): - element = domroot.createElement(self.tagname) - for attribute, value in self.attributes.items(): - if isinstance(value, ListType): - value = ' '.join(['%s' % v for v in value]) - element.setAttribute(attribute, '%s' % value) - for child in self.children: - element.appendChild(child._dom_node(domroot)) - return element - - def __repr__(self): - data = '' - for c in self.children: - data += c.shortrepr() - if len(data) > 60: - data = data[:56] + ' ...' - break - if self.hasattr('name'): - return '<%s "%s": %s>' % (self.__class__.__name__, - self.attributes['name'], data) - else: - return '<%s: %s>' % (self.__class__.__name__, data) - - def shortrepr(self): - if self.hasattr('name'): - return '<%s "%s"...>' % (self.__class__.__name__, - self.attributes['name']) - else: - return '<%s...>' % self.tagname - - def __str__(self): - return unicode(self).encode('raw_unicode_escape') - - def __unicode__(self): - if self.children: - return u'%s%s%s' % (self.starttag(), - ''.join([str(c) for c in self.children]), - self.endtag()) - else: - return self.emptytag() - - def starttag(self): - parts = [self.tagname] - for name, value in self.attlist(): - if value is None: # boolean attribute - parts.append(name) - elif isinstance(value, ListType): - values = ['%s' % v for v in value] - parts.append('%s="%s"' % (name, ' '.join(values))) - else: - parts.append('%s="%s"' % (name, value)) - return '<%s>' % ' '.join(parts) - - def endtag(self): - return '</%s>' % self.tagname - - def emptytag(self): - return u'<%s/>' % ' '.join([self.tagname] + - ['%s="%s"' % (n, v) - for n, v in self.attlist()]) - - def __len__(self): - return len(self.children) - - def __getitem__(self, key): - if isinstance(key, UnicodeType) or isinstance(key, StringType): - return self.attributes[key] - elif isinstance(key, IntType): - return self.children[key] - elif isinstance(key, SliceType): - assert key.step in (None, 1), 'cannot handle slice with stride' - return self.children[key.start:key.stop] - else: - raise TypeError, ('element index must be an integer, a slice, or ' - 'an attribute name string') - - def __setitem__(self, key, item): - if isinstance(key, UnicodeType) or isinstance(key, StringType): - self.attributes[str(key)] = item - elif isinstance(key, IntType): - self.setup_child(item) - self.children[key] = item - elif isinstance(key, SliceType): - assert key.step in (None, 1), 'cannot handle slice with stride' - for node in item: - self.setup_child(node) - self.children[key.start:key.stop] = item - else: - raise TypeError, ('element index must be an integer, a slice, or ' - 'an attribute name string') - - def __delitem__(self, key): - if isinstance(key, UnicodeType) or isinstance(key, StringType): - del self.attributes[key] - elif isinstance(key, IntType): - del self.children[key] - elif isinstance(key, SliceType): - assert key.step in (None, 1), 'cannot handle slice with stride' - del self.children[key.start:key.stop] - else: - raise TypeError, ('element index must be an integer, a simple ' - 'slice, or an attribute name string') - - def __add__(self, other): - return self.children + other - - def __radd__(self, other): - return other + self.children - - def __iadd__(self, other): - """Append a node or a list of nodes to `self.children`.""" - if isinstance(other, Node): - self.setup_child(other) - self.children.append(other) - elif other is not None: - for node in other: - self.setup_child(node) - self.children.extend(other) - return self - - def astext(self): - return self.child_text_separator.join( - [child.astext() for child in self.children]) - - def attlist(self): - attlist = self.attributes.items() - attlist.sort() - return attlist - - def get(self, key, failobj=None): - return self.attributes.get(key, failobj) - - def hasattr(self, attr): - return self.attributes.has_key(attr) - - def delattr(self, attr): - if self.attributes.has_key(attr): - del self.attributes[attr] - - def setdefault(self, key, failobj=None): - return self.attributes.setdefault(key, failobj) - - has_key = hasattr - - def append(self, item): - self.setup_child(item) - self.children.append(item) - - def extend(self, item): - for node in item: - self.setup_child(node) - self.children.extend(item) - - def insert(self, index, item): - if isinstance(item, Node): - self.setup_child(item) - self.children.insert(index, item) - elif item is not None: - self[index:index] = item - - def pop(self, i=-1): - return self.children.pop(i) - - def remove(self, item): - self.children.remove(item) - - def index(self, item): - return self.children.index(item) - - def replace(self, old, new): - """Replace one child `Node` with another child or children.""" - index = self.index(old) - if isinstance(new, Node): - self.setup_child(new) - self[index] = new - elif new is not None: - self[index:index+1] = new - - def first_child_matching_class(self, childclass, start=0, end=sys.maxint): - """ - Return the index of the first child whose class exactly matches. - - Parameters: - - - `childclass`: A `Node` subclass to search for, or a tuple of `Node` - classes. If a tuple, any of the classes may match. - - `start`: Initial index to check. - - `end`: Initial index to *not* check. - """ - if not isinstance(childclass, TupleType): - childclass = (childclass,) - for index in range(start, min(len(self), end)): - for c in childclass: - if isinstance(self[index], c): - return index - return None - - def first_child_not_matching_class(self, childclass, start=0, - end=sys.maxint): - """ - Return the index of the first child whose class does *not* match. - - Parameters: - - - `childclass`: A `Node` subclass to skip, or a tuple of `Node` - classes. If a tuple, none of the classes may match. - - `start`: Initial index to check. - - `end`: Initial index to *not* check. - """ - if not isinstance(childclass, TupleType): - childclass = (childclass,) - for index in range(start, min(len(self), end)): - match = 0 - for c in childclass: - if isinstance(self.children[index], c): - match = 1 - break - if not match: - return index - return None - - def pformat(self, indent=' ', level=0): - return ''.join(['%s%s\n' % (indent * level, self.starttag())] + - [child.pformat(indent, level+1) - for child in self.children]) - - def get_children(self): - """Return this element's children.""" - return self.children - - def copy(self): - return self.__class__(**self.attributes) - - def set_class(self, name): - """Add a new name to the "class" attribute.""" - self.attributes['class'] = (self.attributes.get('class', '') + ' ' - + name.lower()).strip() - - -class TextElement(Element): - - """ - An element which directly contains text. - - Its children are all Text or TextElement nodes. - """ - - child_text_separator = '' - """Separator for child nodes, used by `astext()` method.""" - - def __init__(self, rawsource='', text='', *children, **attributes): - if text != '': - textnode = Text(text) - Element.__init__(self, rawsource, textnode, *children, - **attributes) - else: - Element.__init__(self, rawsource, *children, **attributes) - - -class FixedTextElement(TextElement): - - """An element which directly contains preformatted text.""" - - def __init__(self, rawsource='', text='', *children, **attributes): - TextElement.__init__(self, rawsource, text, *children, **attributes) - self.attributes['xml:space'] = 'preserve' - - -# ======== -# Mixins -# ======== - -class Resolvable: - - resolved = 0 - - -class BackLinkable: - - def add_backref(self, refid): - self.setdefault('backrefs', []).append(refid) - - -# ==================== -# Element Categories -# ==================== - -class Root: pass - -class Titular: pass - -class PreDecorative: - """Category of Node which may occur before Decorative Nodes.""" - -class PreBibliographic(PreDecorative): - """Category of Node which may occur before Bibliographic Nodes.""" - -class Bibliographic(PreDecorative): pass - -class Decorative: pass - -class Structural: pass - -class Body: pass - -class General(Body): pass - -class Sequential(Body): pass - -class Admonition(Body): pass - -class Special(Body): - """Special internal body elements.""" - -class Invisible: - """Internal elements that don't appear in output.""" - -class Part: pass - -class Inline: pass - -class Referential(Resolvable): pass - -class Targetable(Resolvable): - - referenced = 0 - -class Labeled: - """Contains a `label` as its first element.""" - - -# ============== -# Root Element -# ============== - -class document(Root, Structural, Element): - - def __init__(self, settings, reporter, *args, **kwargs): - Element.__init__(self, *args, **kwargs) - - self.current_source = None - """Path to or description of the input source being processed.""" - - self.current_line = None - """Line number (1-based) of `current_source`.""" - - self.settings = settings - """Runtime settings data record.""" - - self.reporter = reporter - """System message generator.""" - - self.external_targets = [] - """List of external target nodes.""" - - self.internal_targets = [] - """List of internal target nodes.""" - - self.indirect_targets = [] - """List of indirect target nodes.""" - - self.substitution_defs = {} - """Mapping of substitution names to substitution_definition nodes.""" - - self.substitution_names = {} - """Mapping of case-normalized substitution names to case-sensitive - names.""" - - self.refnames = {} - """Mapping of names to lists of referencing nodes.""" - - self.refids = {} - """Mapping of ids to lists of referencing nodes.""" - - self.nameids = {} - """Mapping of names to unique id's.""" - - self.nametypes = {} - """Mapping of names to hyperlink type (boolean: True => explicit, - False => implicit.""" - - self.ids = {} - """Mapping of ids to nodes.""" - - self.substitution_refs = {} - """Mapping of substitution names to lists of substitution_reference - nodes.""" - - self.footnote_refs = {} - """Mapping of footnote labels to lists of footnote_reference nodes.""" - - self.citation_refs = {} - """Mapping of citation labels to lists of citation_reference nodes.""" - - self.anonymous_targets = [] - """List of anonymous target nodes.""" - - self.anonymous_refs = [] - """List of anonymous reference nodes.""" - - self.autofootnotes = [] - """List of auto-numbered footnote nodes.""" - - self.autofootnote_refs = [] - """List of auto-numbered footnote_reference nodes.""" - - self.symbol_footnotes = [] - """List of symbol footnote nodes.""" - - self.symbol_footnote_refs = [] - """List of symbol footnote_reference nodes.""" - - self.footnotes = [] - """List of manually-numbered footnote nodes.""" - - self.citations = [] - """List of citation nodes.""" - - self.autofootnote_start = 1 - """Initial auto-numbered footnote number.""" - - self.symbol_footnote_start = 0 - """Initial symbol footnote symbol index.""" - - self.id_start = 1 - """Initial ID number.""" - - self.parse_messages = [] - """System messages generated while parsing.""" - - self.transform_messages = [] - """System messages generated while applying transforms.""" - - import docutils.transforms - self.transformer = docutils.transforms.Transformer(self) - """Storage for transforms to be applied to this document.""" - - self.document = self - - def asdom(self, dom=xml.dom.minidom): - """Return a DOM representation of this document.""" - domroot = dom.Document() - domroot.appendChild(self._dom_node(domroot)) - return domroot - - def set_id(self, node, msgnode=None): - if node.has_key('id'): - id = node['id'] - if self.ids.has_key(id) and self.ids[id] is not node: - msg = self.reporter.severe('Duplicate ID: "%s".' % id) - if msgnode != None: - msgnode += msg - else: - if node.has_key('name'): - id = make_id(node['name']) - else: - id = '' - while not id or self.ids.has_key(id): - id = 'id%s' % self.id_start - self.id_start += 1 - node['id'] = id - self.ids[id] = node - return id - - def set_name_id_map(self, node, id, msgnode=None, explicit=None): - """ - `self.nameids` maps names to IDs, while `self.nametypes` maps names to - booleans representing hyperlink type (True==explicit, - False==implicit). This method updates the mappings. - - The following state transition table shows how `self.nameids` ("ids") - and `self.nametypes` ("types") change with new input (a call to this - method), and what actions are performed: - - ==== ===== ======== ======== ======= ==== ===== ===== - Old State Input Action New State Notes - ----------- -------- ----------------- ----------- ----- - ids types new type sys.msg. dupname ids types - ==== ===== ======== ======== ======= ==== ===== ===== - -- -- explicit -- -- new True - -- -- implicit -- -- new False - None False explicit -- -- new True - old False explicit implicit old new True - None True explicit explicit new None True - old True explicit explicit new,old None True [#]_ - None False implicit implicit new None False - old False implicit implicit new,old None False - None True implicit implicit new None True - old True implicit implicit new old True - ==== ===== ======== ======== ======= ==== ===== ===== - - .. [#] Do not clear the name-to-id map or invalidate the old target if - both old and new targets are external and refer to identical URIs. - The new target is invalidated regardless. - """ - if node.has_key('name'): - name = node['name'] - if self.nameids.has_key(name): - self.set_duplicate_name_id(node, id, name, msgnode, explicit) - else: - self.nameids[name] = id - self.nametypes[name] = explicit - - def set_duplicate_name_id(self, node, id, name, msgnode, explicit): - old_id = self.nameids[name] - old_explicit = self.nametypes[name] - self.nametypes[name] = old_explicit or explicit - if explicit: - if old_explicit: - level = 2 - if old_id is not None: - old_node = self.ids[old_id] - if node.has_key('refuri'): - refuri = node['refuri'] - if old_node.has_key('name') \ - and old_node.has_key('refuri') \ - and old_node['refuri'] == refuri: - level = 1 # just inform if refuri's identical - if level > 1: - dupname(old_node) - self.nameids[name] = None - msg = self.reporter.system_message( - level, 'Duplicate explicit target name: "%s".' % name, - backrefs=[id], base_node=node) - if msgnode != None: - msgnode += msg - dupname(node) - else: - self.nameids[name] = id - if old_id is not None: - old_node = self.ids[old_id] - dupname(old_node) - else: - if old_id is not None and not old_explicit: - self.nameids[name] = None - old_node = self.ids[old_id] - dupname(old_node) - dupname(node) - if not explicit or (not old_explicit and old_id is not None): - msg = self.reporter.info( - 'Duplicate implicit target name: "%s".' % name, - backrefs=[id], base_node=node) - if msgnode != None: - msgnode += msg - - def has_name(self, name): - return self.nameids.has_key(name) - - def note_implicit_target(self, target, msgnode=None): - id = self.set_id(target, msgnode) - self.set_name_id_map(target, id, msgnode, explicit=None) - - def note_explicit_target(self, target, msgnode=None): - id = self.set_id(target, msgnode) - self.set_name_id_map(target, id, msgnode, explicit=1) - - def note_refname(self, node): - self.refnames.setdefault(node['refname'], []).append(node) - - def note_refid(self, node): - self.refids.setdefault(node['refid'], []).append(node) - - def note_external_target(self, target): - self.external_targets.append(target) - - def note_internal_target(self, target): - self.internal_targets.append(target) - - def note_indirect_target(self, target): - self.indirect_targets.append(target) - if target.has_key('name'): - self.note_refname(target) - - def note_anonymous_target(self, target): - self.set_id(target) - self.anonymous_targets.append(target) - - def note_anonymous_ref(self, ref): - self.anonymous_refs.append(ref) - - def note_autofootnote(self, footnote): - self.set_id(footnote) - self.autofootnotes.append(footnote) - - def note_autofootnote_ref(self, ref): - self.set_id(ref) - self.autofootnote_refs.append(ref) - - def note_symbol_footnote(self, footnote): - self.set_id(footnote) - self.symbol_footnotes.append(footnote) - - def note_symbol_footnote_ref(self, ref): - self.set_id(ref) - self.symbol_footnote_refs.append(ref) - - def note_footnote(self, footnote): - self.set_id(footnote) - self.footnotes.append(footnote) - - def note_footnote_ref(self, ref): - self.set_id(ref) - self.footnote_refs.setdefault(ref['refname'], []).append(ref) - self.note_refname(ref) - - def note_citation(self, citation): - self.citations.append(citation) - - def note_citation_ref(self, ref): - self.set_id(ref) - self.citation_refs.setdefault(ref['refname'], []).append(ref) - self.note_refname(ref) - - def note_substitution_def(self, subdef, def_name, msgnode=None): - name = subdef['name'] = whitespace_normalize_name(def_name) - if self.substitution_defs.has_key(name): - msg = self.reporter.error( - 'Duplicate substitution definition name: "%s".' % name, - base_node=subdef) - if msgnode != None: - msgnode += msg - oldnode = self.substitution_defs[name] - dupname(oldnode) - # keep only the last definition: - self.substitution_defs[name] = subdef - # case-insensitive mapping: - self.substitution_names[fully_normalize_name(name)] = name - - def note_substitution_ref(self, subref, refname): - name = subref['refname'] = whitespace_normalize_name(refname) - self.substitution_refs.setdefault(name, []).append(subref) - - def note_pending(self, pending, priority=None): - self.transformer.add_pending(pending, priority) - - def note_parse_message(self, message): - self.parse_messages.append(message) - - def note_transform_message(self, message): - self.transform_messages.append(message) - - def note_source(self, source, offset): - self.current_source = source - if offset is None: - self.current_line = offset - else: - self.current_line = offset + 1 - - def copy(self): - return self.__class__(self.settings, self.reporter, - **self.attributes) - - -# ================ -# Title Elements -# ================ - -class title(Titular, PreBibliographic, TextElement): pass -class subtitle(Titular, PreBibliographic, TextElement): pass -class rubric(Titular, TextElement): pass - - -# ======================== -# Bibliographic Elements -# ======================== - -class docinfo(Bibliographic, Element): pass -class author(Bibliographic, TextElement): pass -class authors(Bibliographic, Element): pass -class organization(Bibliographic, TextElement): pass -class address(Bibliographic, FixedTextElement): pass -class contact(Bibliographic, TextElement): pass -class version(Bibliographic, TextElement): pass -class revision(Bibliographic, TextElement): pass -class status(Bibliographic, TextElement): pass -class date(Bibliographic, TextElement): pass -class copyright(Bibliographic, TextElement): pass - - -# ===================== -# Decorative Elements -# ===================== - -class decoration(Decorative, Element): pass -class header(Decorative, Element): pass -class footer(Decorative, Element): pass - - -# ===================== -# Structural Elements -# ===================== - -class section(Structural, Element): pass - - -class topic(Structural, Element): - - """ - Topics are terminal, "leaf" mini-sections, like block quotes with titles, - or textual figures. A topic is just like a section, except that it has no - subsections, and it doesn't have to conform to section placement rules. - - Topics are allowed wherever body elements (list, table, etc.) are allowed, - but only at the top level of a section or document. Topics cannot nest - inside topics, sidebars, or body elements; you can't have a topic inside a - table, list, block quote, etc. - """ - - -class sidebar(Structural, Element): - - """ - Sidebars are like miniature, parallel documents that occur inside other - documents, providing related or reference material. A sidebar is - typically offset by a border and "floats" to the side of the page; the - document's main text may flow around it. Sidebars can also be likened to - super-footnotes; their content is outside of the flow of the document's - main text. - - Sidebars are allowed wherever body elements (list, table, etc.) are - allowed, but only at the top level of a section or document. Sidebars - cannot nest inside sidebars, topics, or body elements; you can't have a - sidebar inside a table, list, block quote, etc. - """ - - -class transition(Structural, Element): pass - - -# =============== -# Body Elements -# =============== - -class paragraph(General, TextElement): pass -class bullet_list(Sequential, Element): pass -class enumerated_list(Sequential, Element): pass -class list_item(Part, Element): pass -class definition_list(Sequential, Element): pass -class definition_list_item(Part, Element): pass -class term(Part, TextElement): pass -class classifier(Part, TextElement): pass -class definition(Part, Element): pass -class field_list(Sequential, Element): pass -class field(Part, Element): pass -class field_name(Part, TextElement): pass -class field_body(Part, Element): pass - - -class option(Part, Element): - - child_text_separator = '' - - -class option_argument(Part, TextElement): - - def astext(self): - return self.get('delimiter', ' ') + TextElement.astext(self) - - -class option_group(Part, Element): - - child_text_separator = ', ' - - -class option_list(Sequential, Element): pass - - -class option_list_item(Part, Element): - - child_text_separator = ' ' - - -class option_string(Part, TextElement): pass -class description(Part, Element): pass -class literal_block(General, FixedTextElement): pass -class doctest_block(General, FixedTextElement): pass -class line_block(General, FixedTextElement): pass -class block_quote(General, Element): pass -class attribution(Part, TextElement): pass -class attention(Admonition, Element): pass -class caution(Admonition, Element): pass -class danger(Admonition, Element): pass -class error(Admonition, Element): pass -class important(Admonition, Element): pass -class note(Admonition, Element): pass -class tip(Admonition, Element): pass -class hint(Admonition, Element): pass -class warning(Admonition, Element): pass -class admonition(Admonition, Element): pass -class comment(Special, Invisible, PreBibliographic, FixedTextElement): pass -class substitution_definition(Special, Invisible, TextElement): pass -class target(Special, Invisible, Inline, TextElement, Targetable): pass -class footnote(General, Element, Labeled, BackLinkable): pass -class citation(General, Element, Labeled, BackLinkable): pass -class label(Part, TextElement): pass -class figure(General, Element): pass -class caption(Part, TextElement): pass -class legend(Part, Element): pass -class table(General, Element): pass -class tgroup(Part, Element): pass -class colspec(Part, Element): pass -class thead(Part, Element): pass -class tbody(Part, Element): pass -class row(Part, Element): pass -class entry(Part, Element): pass - - -class system_message(Special, PreBibliographic, Element, BackLinkable): - - def __init__(self, message=None, *children, **attributes): - if message: - p = paragraph('', message) - children = (p,) + children - try: - Element.__init__(self, '', *children, **attributes) - except: - print 'system_message: children=%r' % (children,) - raise - - def astext(self): - line = self.get('line', '') - return u'%s:%s: (%s/%s) %s' % (self['source'], line, self['type'], - self['level'], Element.astext(self)) - - -class pending(Special, Invisible, PreBibliographic, Element): - - """ - The "pending" element is used to encapsulate a pending operation: the - operation (transform), the point at which to apply it, and any data it - requires. Only the pending operation's location within the document is - stored in the public document tree (by the "pending" object itself); the - operation and its data are stored in the "pending" object's internal - instance attributes. - - For example, say you want a table of contents in your reStructuredText - document. The easiest way to specify where to put it is from within the - document, with a directive:: - - .. contents:: - - But the "contents" directive can't do its work until the entire document - has been parsed and possibly transformed to some extent. So the directive - code leaves a placeholder behind that will trigger the second phase of the - its processing, something like this:: - - <pending ...public attributes...> + internal attributes - - Use `document.note_pending()` so that the - `docutils.transforms.Transformer` stage of processing can run all pending - transforms. - """ - - def __init__(self, transform, details=None, - rawsource='', *children, **attributes): - Element.__init__(self, rawsource, *children, **attributes) - - self.transform = transform - """The `docutils.transforms.Transform` class implementing the pending - operation.""" - - self.details = details or {} - """Detail data (dictionary) required by the pending operation.""" - - def pformat(self, indent=' ', level=0): - internals = [ - '.. internal attributes:', - ' .transform: %s.%s' % (self.transform.__module__, - self.transform.__name__), - ' .details:'] - details = self.details.items() - details.sort() - for key, value in details: - if isinstance(value, Node): - internals.append('%7s%s:' % ('', key)) - internals.extend(['%9s%s' % ('', line) - for line in value.pformat().splitlines()]) - elif value and isinstance(value, ListType) \ - and isinstance(value[0], Node): - internals.append('%7s%s:' % ('', key)) - for v in value: - internals.extend(['%9s%s' % ('', line) - for line in v.pformat().splitlines()]) - else: - internals.append('%7s%s: %r' % ('', key, value)) - return (Element.pformat(self, indent, level) - + ''.join([(' %s%s\n' % (indent * level, line)) - for line in internals])) - - def copy(self): - return self.__class__(self.transform, self.details, self.rawsource, - **self.attribuates) - - -class raw(Special, Inline, PreBibliographic, FixedTextElement): - - """ - Raw data that is to be passed untouched to the Writer. - """ - - pass - - -# ================= -# Inline Elements -# ================= - -class emphasis(Inline, TextElement): pass -class strong(Inline, TextElement): pass -class literal(Inline, TextElement): pass -class reference(Inline, Referential, TextElement): pass -class footnote_reference(Inline, Referential, TextElement): pass -class citation_reference(Inline, Referential, TextElement): pass -class substitution_reference(Inline, TextElement): pass -class title_reference(Inline, TextElement): pass -class abbreviation(Inline, TextElement): pass -class acronym(Inline, TextElement): pass -class superscript(Inline, TextElement): pass -class subscript(Inline, TextElement): pass - - -class image(General, Inline, TextElement): - - def astext(self): - return self.get('alt', '') - - -class inline(Inline, TextElement): pass -class problematic(Inline, TextElement): pass -class generated(Inline, TextElement): pass - - -# ======================================== -# Auxiliary Classes, Functions, and Data -# ======================================== - -node_class_names = """ - Text - abbreviation acronym address admonition attention attribution author - authors - block_quote bullet_list - caption caution citation citation_reference classifier colspec comment - contact copyright - danger date decoration definition definition_list definition_list_item - description docinfo doctest_block document - emphasis entry enumerated_list error - field field_body field_list field_name figure footer - footnote footnote_reference - generated - header hint - image important inline - label legend line_block list_item literal literal_block - note - option option_argument option_group option_list option_list_item - option_string organization - paragraph pending problematic - raw reference revision row rubric - section sidebar status strong subscript substitution_definition - substitution_reference subtitle superscript system_message - table target tbody term tgroup thead tip title title_reference topic - transition - version - warning""".split() -"""A list of names of all concrete Node subclasses.""" - - -class NodeVisitor: - - """ - "Visitor" pattern [GoF95]_ abstract superclass implementation for document - tree traversals. - - Each node class has corresponding methods, doing nothing by default; - override individual methods for specific and useful behaviour. The - "``visit_`` + node class name" method is called by `Node.walk()` upon - entering a node. `Node.walkabout()` also calls the "``depart_`` + node - class name" method before exiting a node. - - This is a base class for visitors whose ``visit_...`` & ``depart_...`` - methods should be implemented for *all* node types encountered (such as - for `docutils.writers.Writer` subclasses). Unimplemented methods will - raise exceptions. - - For sparse traversals, where only certain node types are of interest, - subclass `SparseNodeVisitor` instead. When (mostly or entirely) uniform - processing is desired, subclass `GenericNodeVisitor`. - - .. [GoF95] Gamma, Helm, Johnson, Vlissides. *Design Patterns: Elements of - Reusable Object-Oriented Software*. Addison-Wesley, Reading, MA, USA, - 1995. - """ - - def __init__(self, document): - self.document = document - - def unknown_visit(self, node): - """ - Called when entering unknown `Node` types. - - Raise an exception unless overridden. - """ - raise NotImplementedError('visiting unknown node type: %s' - % node.__class__.__name__) - - def unknown_departure(self, node): - """ - Called before exiting unknown `Node` types. - - Raise exception unless overridden. - """ - raise NotImplementedError('departing unknown node type: %s' - % node.__class__.__name__) - - -class SparseNodeVisitor(NodeVisitor): - - """ - Base class for sparse traversals, where only certain node types are of - interest. When ``visit_...`` & ``depart_...`` methods should be - implemented for *all* node types (such as for `docutils.writers.Writer` - subclasses), subclass `NodeVisitor` instead. - """ - - # Save typing with dynamic definitions. - for name in node_class_names: - exec """def visit_%s(self, node): pass\n""" % name - exec """def depart_%s(self, node): pass\n""" % name - del name - - -class GenericNodeVisitor(NodeVisitor): - - """ - Generic "Visitor" abstract superclass, for simple traversals. - - Unless overridden, each ``visit_...`` method calls `default_visit()`, and - each ``depart_...`` method (when using `Node.walkabout()`) calls - `default_departure()`. `default_visit()` (and `default_departure()`) must - be overridden in subclasses. - - Define fully generic visitors by overriding `default_visit()` (and - `default_departure()`) only. Define semi-generic visitors by overriding - individual ``visit_...()`` (and ``depart_...()``) methods also. - - `NodeVisitor.unknown_visit()` (`NodeVisitor.unknown_departure()`) should - be overridden for default behavior. - """ - - def default_visit(self, node): - """Override for generic, uniform traversals.""" - raise NotImplementedError - - def default_departure(self, node): - """Override for generic, uniform traversals.""" - raise NotImplementedError - - # Save typing with dynamic definitions. - for name in node_class_names: - exec """def visit_%s(self, node): - self.default_visit(node)\n""" % name - exec """def depart_%s(self, node): - self.default_departure(node)\n""" % name - del name - - -class TreeCopyVisitor(GenericNodeVisitor): - - """ - Make a complete copy of a tree or branch, including element attributes. - """ - - def __init__(self, document): - GenericNodeVisitor.__init__(self, document) - self.parent_stack = [] - self.parent = [] - - def get_tree_copy(self): - return self.parent[0] - - def default_visit(self, node): - """Copy the current node, and make it the new acting parent.""" - newnode = node.copy() - self.parent.append(newnode) - self.parent_stack.append(self.parent) - self.parent = newnode - - def default_departure(self, node): - """Restore the previous acting parent.""" - self.parent = self.parent_stack.pop() - - -class TreePruningException(Exception): - - """ - Base class for `NodeVisitor`-related tree pruning exceptions. - - Raise subclasses from within ``visit_...`` or ``depart_...`` methods - called from `Node.walk()` and `Node.walkabout()` tree traversals to prune - the tree traversed. - """ - - pass - - -class SkipChildren(TreePruningException): - - """ - Do not visit any children of the current node. The current node's - siblings and ``depart_...`` method are not affected. - """ - - pass - - -class SkipSiblings(TreePruningException): - - """ - Do not visit any more siblings (to the right) of the current node. The - current node's children and its ``depart_...`` method are not affected. - """ - - pass - - -class SkipNode(TreePruningException): - - """ - Do not visit the current node's children, and do not call the current - node's ``depart_...`` method. - """ - - pass - - -class SkipDeparture(TreePruningException): - - """ - Do not call the current node's ``depart_...`` method. The current node's - children and siblings are not affected. - """ - - pass - - -class NodeFound(TreePruningException): - - """ - Raise to indicate that the target of a search has been found. This - exception must be caught by the client; it is not caught by the traversal - code. - """ - - pass - - -def make_id(string): - """ - Convert `string` into an identifier and return it. - - Docutils identifiers will conform to the regular expression - ``[a-z](-?[a-z0-9]+)*``. For CSS compatibility, identifiers (the "class" - and "id" attributes) should have no underscores, colons, or periods. - Hyphens may be used. - - - The `HTML 4.01 spec`_ defines identifiers based on SGML tokens: - - ID and NAME tokens must begin with a letter ([A-Za-z]) and may be - followed by any number of letters, digits ([0-9]), hyphens ("-"), - underscores ("_"), colons (":"), and periods ("."). - - - However the `CSS1 spec`_ defines identifiers based on the "name" token, - a tighter interpretation ("flex" tokenizer notation; "latin1" and - "escape" 8-bit characters have been replaced with entities):: - - unicode \\[0-9a-f]{1,4} - latin1 [¡-ÿ] - escape {unicode}|\\[ -~¡-ÿ] - nmchar [-a-z0-9]|{latin1}|{escape} - name {nmchar}+ - - The CSS1 "nmchar" rule does not include underscores ("_"), colons (":"), - or periods ("."), therefore "class" and "id" attributes should not contain - these characters. They should be replaced with hyphens ("-"). Combined - with HTML's requirements (the first character must be a letter; no - "unicode", "latin1", or "escape" characters), this results in the - ``[a-z](-?[a-z0-9]+)*`` pattern. - - .. _HTML 4.01 spec: http://www.w3.org/TR/html401 - .. _CSS1 spec: http://www.w3.org/TR/REC-CSS1 - """ - id = _non_id_chars.sub('-', ' '.join(string.lower().split())) - id = _non_id_at_ends.sub('', id) - return str(id) - -_non_id_chars = re.compile('[^a-z0-9]+') -_non_id_at_ends = re.compile('^[-0-9]+|-+$') - -def dupname(node): - node['dupname'] = node['name'] - del node['name'] - -def fully_normalize_name(name): - """Return a case- and whitespace-normalized name.""" - return ' '.join(name.lower().split()) - -def whitespace_normalize_name(name): - """Return a whitespace-normalized name.""" - return ' '.join(name.split()) diff --git a/docutils/docutils/parsers/__init__.py b/docutils/docutils/parsers/__init__.py deleted file mode 100644 index 5b1e964be..000000000 --- a/docutils/docutils/parsers/__init__.py +++ /dev/null @@ -1,48 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -This package contains Docutils parser modules. -""" - -__docformat__ = 'reStructuredText' - -from docutils import Component - - -class Parser(Component): - - component_type = 'parser' - - def parse(self, inputstring, document): - """Override to parse `inputstring` into document tree `document`.""" - raise NotImplementedError('subclass must override this method') - - def setup_parse(self, inputstring, document): - """Initial parse setup. Call at start of `self.parse()`.""" - self.inputstring = inputstring - self.document = document - document.reporter.attach_observer(document.note_parse_message) - - def finish_parse(self): - """Finalize parse details. Call at end of `self.parse()`.""" - self.document.reporter.detach_observer( - self.document.note_parse_message) - - -_parser_aliases = { - 'restructuredtext': 'rst', - 'rest': 'rst', - 'restx': 'rst', - 'rtxt': 'rst',} - -def get_parser_class(parser_name): - """Return the Parser class from the `parser_name` module.""" - parser_name = parser_name.lower() - if _parser_aliases.has_key(parser_name): - parser_name = _parser_aliases[parser_name] - module = __import__(parser_name, globals(), locals()) - return module.Parser diff --git a/docutils/docutils/parsers/rst/__init__.py b/docutils/docutils/parsers/rst/__init__.py deleted file mode 100644 index 899a49bc8..000000000 --- a/docutils/docutils/parsers/rst/__init__.py +++ /dev/null @@ -1,123 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -This is ``docutils.parsers.rst`` package. It exports a single class, `Parser`, -the reStructuredText parser. - - -Usage -===== - -1. Create a parser:: - - parser = docutils.parsers.rst.Parser() - - Several optional arguments may be passed to modify the parser's behavior. - Please see `Customizing the Parser`_ below for details. - -2. Gather input (a multi-line string), by reading a file or the standard - input:: - - input = sys.stdin.read() - -3. Create a new empty `docutils.nodes.document` tree:: - - document = docutils.utils.new_document(source, settings) - - See `docutils.utils.new_document()` for parameter details. - -4. Run the parser, populating the document tree:: - - parser.parse(input, document) - - -Parser Overview -=============== - -The reStructuredText parser is implemented as a state machine, examining its -input one line at a time. To understand how the parser works, please first -become familiar with the `docutils.statemachine` module, then see the -`states` module. - - -Customizing the Parser ----------------------- - -Anything that isn't already customizable is that way simply because that type -of customizability hasn't been implemented yet. Patches welcome! - -When instantiating an object of the `Parser` class, two parameters may be -passed: ``rfc2822`` and ``inliner``. Pass ``rfc2822=1`` to enable an initial -RFC-2822 style header block, parsed as a "field_list" element (with "class" -attribute set to "rfc2822"). Currently this is the only body-level element -which is customizable without subclassing. (Tip: subclass `Parser` and change -its "state_classes" and "initial_state" attributes to refer to new classes. -Contact the author if you need more details.) - -The ``inliner`` parameter takes an instance of `states.Inliner` or a subclass. -It handles inline markup recognition. A common extension is the addition of -further implicit hyperlinks, like "RFC 2822". This can be done by subclassing -`states.Inliner`, adding a new method for the implicit markup, and adding a -``(pattern, method)`` pair to the "implicit_dispatch" attribute of the -subclass. See `states.Inliner.implicit_inline()` for details. Explicit -inline markup can be customized in a `states.Inliner` subclass via the -``patterns.initial`` and ``dispatch`` attributes (and new methods as -appropriate). -""" - -__docformat__ = 'reStructuredText' - - -import docutils.parsers -import docutils.statemachine -from docutils.parsers.rst import states - - -class Parser(docutils.parsers.Parser): - - """The reStructuredText parser.""" - - supported = ('restructuredtext', 'rst', 'rest', 'restx', 'rtxt', 'rstx') - """Aliases this parser supports.""" - - settings_spec = ( - 'reStructuredText Parser Options', - None, - (('Recognize and link to PEP references (like "PEP 258").', - ['--pep-references'], - {'action': 'store_true'}), - ('Recognize and link to RFC references (like "RFC 822").', - ['--rfc-references'], - {'action': 'store_true'}), - ('Set number of spaces for tab expansion (default 8).', - ['--tab-width'], - {'metavar': '<width>', 'type': 'int', 'default': 8}), - ('Remove spaces before footnote references.', - ['--trim-footnote-reference-space'], - {'action': 'store_true'}),)) - - def __init__(self, rfc2822=None, inliner=None): - if rfc2822: - self.initial_state = 'RFC2822Body' - else: - self.initial_state = 'Body' - self.state_classes = states.state_classes - self.inliner = inliner - - def parse(self, inputstring, document): - """Parse `inputstring` and populate `document`, a document tree.""" - self.setup_parse(inputstring, document) - debug = document.reporter[''].debug - self.statemachine = states.RSTStateMachine( - state_classes=self.state_classes, - initial_state=self.initial_state, - debug=debug) - inputlines = docutils.statemachine.string2lines( - inputstring, tab_width=document.settings.tab_width, - convert_whitespace=1) - self.statemachine.run(inputlines, document, inliner=self.inliner) - self.finish_parse() diff --git a/docutils/docutils/parsers/rst/directives/__init__.py b/docutils/docutils/parsers/rst/directives/__init__.py deleted file mode 100644 index 1a113db2d..000000000 --- a/docutils/docutils/parsers/rst/directives/__init__.py +++ /dev/null @@ -1,252 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -This package contains directive implementation modules. - -The interface for directive functions is as follows:: - - def directive_fn(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - code... - - # Set function attributes: - directive_fn.arguments = ... - directive_fn.options = ... - direcitve_fn.content = ... - -Parameters: - -- ``name`` is the directive type or name. - -- ``arguments`` is a list of positional arguments. - -- ``options`` is a dictionary mapping option names to values. - -- ``content`` is a list of strings, the directive content. - -- ``lineno`` is the line number of the first line of the directive. - -- ``content_offset`` is the line offset of the first line of the content from - the beginning of the current input. Used when initiating a nested parse. - -- ``block_text`` is a string containing the entire directive. Include it as - the content of a literal block in a system message if there is a problem. - -- ``state`` is the state which called the directive function. - -- ``state_machine`` is the state machine which controls the state which called - the directive function. - -Function attributes, interpreted by the directive parser (which calls the -directive function): - -- ``arguments``: A 3-tuple specifying the expected positional arguments, or - ``None`` if the directive has no arguments. The 3 items in the tuple are - ``(required, optional, whitespace OK in last argument)``: - - 1. The number of required arguments. - 2. The number of optional arguments. - 3. A boolean, indicating if the final argument may contain whitespace. - - Arguments are normally single whitespace-separated words. The final - argument may contain whitespace if the third item in the argument spec tuple - is 1/True. If the form of the arguments is more complex, specify only one - argument (either required or optional) and indicate that final whitespace is - OK; the client code must do any context-sensitive parsing. - -- ``options``: A dictionary, mapping known option names to conversion - functions such as `int` or `float`. ``None`` or an empty dict implies no - options to parse. - -- ``content``: A boolean; true if content is allowed. Client code must handle - the case where content is required but not supplied (an empty content list - will be supplied). - -Directive functions return a list of nodes which will be inserted into the -document tree at the point where the directive was encountered (can be an -empty list). - -See `Creating reStructuredText Directives`_ for more information. - -.. _Creating reStructuredText Directives: - http://docutils.sourceforge.net/spec/howto/rst-directives.html -""" - -__docformat__ = 'reStructuredText' - -from docutils import nodes -from docutils.parsers.rst.languages import en as _fallback_language_module - - -_directive_registry = { - 'attention': ('admonitions', 'attention'), - 'caution': ('admonitions', 'caution'), - 'danger': ('admonitions', 'danger'), - 'error': ('admonitions', 'error'), - 'important': ('admonitions', 'important'), - 'note': ('admonitions', 'note'), - 'tip': ('admonitions', 'tip'), - 'hint': ('admonitions', 'hint'), - 'warning': ('admonitions', 'warning'), - 'admonition': ('admonitions', 'admonition'), - 'sidebar': ('body', 'sidebar'), - 'topic': ('body', 'topic'), - 'line-block': ('body', 'line_block'), - 'parsed-literal': ('body', 'parsed_literal'), - 'rubric': ('body', 'rubric'), - 'epigraph': ('body', 'epigraph'), - 'highlights': ('body', 'highlights'), - 'pull-quote': ('body', 'pull_quote'), - #'questions': ('body', 'question_list'), - 'image': ('images', 'image'), - 'figure': ('images', 'figure'), - 'contents': ('parts', 'contents'), - 'sectnum': ('parts', 'sectnum'), - #'footnotes': ('parts', 'footnotes'), - #'citations': ('parts', 'citations'), - 'target-notes': ('references', 'target_notes'), - 'meta': ('html', 'meta'), - #'imagemap': ('html', 'imagemap'), - 'raw': ('misc', 'raw'), - 'include': ('misc', 'include'), - 'replace': ('misc', 'replace'), - 'unicode': ('misc', 'unicode_directive'), - 'class': ('misc', 'class_directive'), - 'restructuredtext-test-directive': ('misc', 'directive_test_function'),} -"""Mapping of directive name to (module name, function name). The directive -name is canonical & must be lowercase. Language-dependent names are defined -in the ``language`` subpackage.""" - -_modules = {} -"""Cache of imported directive modules.""" - -_directives = {} -"""Cache of imported directive functions.""" - -def directive(directive_name, language_module, document): - """ - Locate and return a directive function from its language-dependent name. - If not found in the current language, check English. Return None if the - named directive cannot be found. - """ - normname = directive_name.lower() - messages = [] - msg_text = [] - if _directives.has_key(normname): - return _directives[normname], messages - canonicalname = None - try: - canonicalname = language_module.directives[normname] - except AttributeError, error: - msg_text.append('Problem retrieving directive entry from language ' - 'module %r: %s.' % (language_module, error)) - except KeyError: - msg_text.append('No directive entry for "%s" in module "%s".' - % (directive_name, language_module.__name__)) - if not canonicalname: - try: - canonicalname = _fallback_language_module.directives[normname] - msg_text.append('Using English fallback for directive "%s".' - % directive_name) - except KeyError: - msg_text.append('Trying "%s" as canonical directive name.' - % directive_name) - # The canonical name should be an English name, but just in case: - canonicalname = normname - if msg_text: - message = document.reporter.info( - '\n'.join(msg_text), line=document.current_line) - messages.append(message) - try: - modulename, functionname = _directive_registry[canonicalname] - except KeyError: - return None, messages - if _modules.has_key(modulename): - module = _modules[modulename] - else: - try: - module = __import__(modulename, globals(), locals()) - except ImportError: - return None, messages - try: - function = getattr(module, functionname) - _directives[normname] = function - except AttributeError: - return None, messages - return function, messages - -def register_directive(name, directive): - """Register a nonstandard application-defined directive function.""" - _directives[name] = directive - -def flag(argument): - """ - Check for a valid flag option (no argument) and return ``None``. - - Raise ``ValueError`` if an argument is found. - """ - if argument and argument.strip(): - raise ValueError('no argument is allowed; "%s" supplied' % argument) - else: - return None - -def unchanged(argument): - """ - Return the argument, unchanged. - - Raise ``ValueError`` if no argument is found. - """ - if argument is None: - raise ValueError('argument required but none supplied') - else: - return argument # unchanged! - -def path(argument): - """ - Return the path argument unwrapped (with newlines removed). - - Raise ``ValueError`` if no argument is found or if the path contains - internal whitespace. - """ - if argument is None: - raise ValueError('argument required but none supplied') - else: - path = ''.join([s.strip() for s in argument.splitlines()]) - if path.find(' ') == -1: - return path - else: - raise ValueError('path contains whitespace') - -def nonnegative_int(argument): - """ - Check for a nonnegative integer argument; raise ``ValueError`` if not. - """ - value = int(argument) - if value < 0: - raise ValueError('negative value; must be positive or zero') - return value - -def format_values(values): - return '%s, or "%s"' % (', '.join(['"%s"' % s for s in values[:-1]]), - values[-1]) - -def choice(argument, values): - try: - value = argument.lower().strip() - except AttributeError: - raise ValueError('must supply an argument; choose from %s' - % format_values(values)) - if value in values: - return value - else: - raise ValueError('"%s" unknown; choose from %s' - % (argument, format_values(values))) - -def class_option(argument): - if argument is None: - raise ValueError('argument required but none supplied') - return nodes.make_id(argument) diff --git a/docutils/docutils/parsers/rst/directives/admonitions.py b/docutils/docutils/parsers/rst/directives/admonitions.py deleted file mode 100644 index 8e3a92895..000000000 --- a/docutils/docutils/parsers/rst/directives/admonitions.py +++ /dev/null @@ -1,90 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Admonition directives. -""" - -__docformat__ = 'reStructuredText' - - -from docutils.parsers.rst import states, directives -from docutils import nodes - - -def make_admonition(node_class, name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - if not content: - error = state_machine.reporter.error( - 'The "%s" admonition is empty; content required.' % (name), - nodes.literal_block(block_text, block_text), line=lineno) - return [error] - text = '\n'.join(content) - admonition_node = node_class(text) - if arguments: - title_text = arguments[0] - textnodes, messages = state.inline_text(title_text, lineno) - admonition_node += nodes.title(title_text, '', *textnodes) - admonition_node += messages - if options.has_key('class'): - class_value = options['class'] - else: - class_value = 'admonition-' + nodes.make_id(title_text) - admonition_node.set_class(class_value) - state.nested_parse(content, content_offset, admonition_node) - return [admonition_node] - -def admonition(*args): - return make_admonition(nodes.admonition, *args) - -admonition.arguments = (1, 0, 1) -admonition.options = {'class': directives.class_option} -admonition.content = 1 - -def attention(*args): - return make_admonition(nodes.attention, *args) - -attention.content = 1 - -def caution(*args): - return make_admonition(nodes.caution, *args) - -caution.content = 1 - -def danger(*args): - return make_admonition(nodes.danger, *args) - -danger.content = 1 - -def error(*args): - return make_admonition(nodes.error, *args) - -error.content = 1 - -def hint(*args): - return make_admonition(nodes.hint, *args) - -hint.content = 1 - -def important(*args): - return make_admonition(nodes.important, *args) - -important.content = 1 - -def note(*args): - return make_admonition(nodes.note, *args) - -note.content = 1 - -def tip(*args): - return make_admonition(nodes.tip, *args) - -tip.content = 1 - -def warning(*args): - return make_admonition(nodes.warning, *args) - -warning.content = 1 diff --git a/docutils/docutils/parsers/rst/directives/body.py b/docutils/docutils/parsers/rst/directives/body.py deleted file mode 100644 index c2fd6b99d..000000000 --- a/docutils/docutils/parsers/rst/directives/body.py +++ /dev/null @@ -1,122 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Directives for additional body elements. -""" - -__docformat__ = 'reStructuredText' - - -import sys -from docutils import nodes -from docutils.parsers.rst import directives - - -def topic(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine, - node_class=nodes.topic): - if not state_machine.match_titles: - error = state_machine.reporter.error( - 'The "%s" directive may not be used within topics, sidebars, ' - 'or body elements.' % name, - nodes.literal_block(block_text, block_text), line=lineno) - return [error] - if not content: - warning = state_machine.reporter.warning( - 'Content block expected for the "%s" directive; none found.' - % name, nodes.literal_block(block_text, block_text), - line=lineno) - return [warning] - title_text = arguments[0] - textnodes, messages = state.inline_text(title_text, lineno) - titles = [nodes.title(title_text, '', *textnodes)] - if options.has_key('subtitle'): - textnodes, more_messages = state.inline_text(options['subtitle'], - lineno) - titles.append(nodes.subtitle(options['subtitle'], '', *textnodes)) - messages.extend(more_messages) - text = '\n'.join(content) - node = node_class(text, *(titles + messages)) - if options.has_key('class'): - node.set_class(options['class']) - if text: - state.nested_parse(content, content_offset, node) - return [node] - -topic.arguments = (1, 0, 1) -topic.options = {'class': directives.class_option} -topic.content = 1 - -def sidebar(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - return topic(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine, - node_class=nodes.sidebar) - -sidebar.arguments = (1, 0, 1) -sidebar.options = {'subtitle': directives.unchanged, - 'class': directives.class_option} -sidebar.content = 1 - -def line_block(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine, - node_class=nodes.line_block): - if not content: - warning = state_machine.reporter.warning( - 'Content block expected for the "%s" directive; none found.' - % name, nodes.literal_block(block_text, block_text), line=lineno) - return [warning] - text = '\n'.join(content) - text_nodes, messages = state.inline_text(text, lineno) - node = node_class(text, '', *text_nodes, **options) - return [node] + messages - -line_block.options = {'class': directives.class_option} -line_block.content = 1 - -def parsed_literal(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - return line_block(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine, - node_class=nodes.literal_block) - -parsed_literal.options = {'class': directives.class_option} -parsed_literal.content = 1 - -def rubric(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - rubric_text = arguments[0] - textnodes, messages = state.inline_text(rubric_text, lineno) - rubric = nodes.rubric(rubric_text, '', *textnodes, **options) - return [rubric] + messages - -rubric.arguments = (1, 0, 1) -rubric.options = {'class': directives.class_option} - -def epigraph(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - block_quote, messages = state.block_quote(content, content_offset) - block_quote.set_class('epigraph') - return [block_quote] + messages - -epigraph.content = 1 - -def highlights(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - block_quote, messages = state.block_quote(content, content_offset) - block_quote.set_class('highlights') - return [block_quote] + messages - -highlights.content = 1 - -def pull_quote(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - block_quote, messages = state.block_quote(content, content_offset) - block_quote.set_class('pull-quote') - return [block_quote] + messages - -pull_quote.content = 1 diff --git a/docutils/docutils/parsers/rst/directives/html.py b/docutils/docutils/parsers/rst/directives/html.py deleted file mode 100644 index a6e656994..000000000 --- a/docutils/docutils/parsers/rst/directives/html.py +++ /dev/null @@ -1,96 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Directives for typically HTML-specific constructs. -""" - -__docformat__ = 'reStructuredText' - -import sys -from docutils import nodes, utils -from docutils.parsers.rst import states -from docutils.transforms import components - - -def meta(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - node = nodes.Element() - if content: - new_line_offset, blank_finish = state.nested_list_parse( - content, content_offset, node, initial_state='MetaBody', - blank_finish=1, state_machine_kwargs=metaSMkwargs) - if (new_line_offset - content_offset) != len(content): - # incomplete parse of block? - error = state_machine.reporter.error( - 'Invalid meta directive.', - nodes.literal_block(block_text, block_text), line=lineno) - node += error - else: - error = state_machine.reporter.error( - 'Empty meta directive.', - nodes.literal_block(block_text, block_text), line=lineno) - node += error - return node.get_children() - -meta.content = 1 - -def imagemap(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - return [] - - -class MetaBody(states.SpecializedBody): - - class meta(nodes.Special, nodes.PreBibliographic, nodes.Element): - """HTML-specific "meta" element.""" - pass - - def field_marker(self, match, context, next_state): - """Meta element.""" - node, blank_finish = self.parsemeta(match) - self.parent += node - return [], next_state, [] - - def parsemeta(self, match): - name = self.parse_field_marker(match) - indented, indent, line_offset, blank_finish = \ - self.state_machine.get_first_known_indented(match.end()) - node = self.meta() - pending = nodes.pending(components.Filter, - {'component': 'writer', - 'format': 'html', - 'nodes': [node]}) - node['content'] = ' '.join(indented) - if not indented: - line = self.state_machine.line - msg = self.reporter.info( - 'No content for meta tag "%s".' % name, - nodes.literal_block(line, line), - line=self.state_machine.abs_line_number()) - return msg, blank_finish - tokens = name.split() - try: - attname, val = utils.extract_name_value(tokens[0])[0] - node[attname.lower()] = val - except utils.NameValueError: - node['name'] = tokens[0] - for token in tokens[1:]: - try: - attname, val = utils.extract_name_value(token)[0] - node[attname.lower()] = val - except utils.NameValueError, detail: - line = self.state_machine.line - msg = self.reporter.error( - 'Error parsing meta tag attribute "%s": %s.' - % (token, detail), nodes.literal_block(line, line), - line=self.state_machine.abs_line_number()) - return msg, blank_finish - self.document.note_pending(pending) - return pending, blank_finish - - -metaSMkwargs = {'state_classes': (MetaBody,)} diff --git a/docutils/docutils/parsers/rst/directives/images.py b/docutils/docutils/parsers/rst/directives/images.py deleted file mode 100644 index d193edffd..000000000 --- a/docutils/docutils/parsers/rst/directives/images.py +++ /dev/null @@ -1,100 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Directives for figures and simple images. -""" - -__docformat__ = 'reStructuredText' - - -import sys -from docutils import nodes, utils -from docutils.parsers.rst import directives - -try: - import Image # PIL -except ImportError: - Image = None - -align_values = ('top', 'middle', 'bottom', 'left', 'center', 'right') - -def align(argument): - return directives.choice(argument, align_values) - -def image(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - reference = ''.join(arguments[0].split('\n')) - if reference.find(' ') != -1: - error = state_machine.reporter.error( - 'Image URI contains whitespace.', - nodes.literal_block(block_text, block_text), line=lineno) - return [error] - options['uri'] = reference - image_node = nodes.image(block_text, **options) - return [image_node] - -image.arguments = (1, 0, 1) -image.options = {'alt': directives.unchanged, - 'height': directives.nonnegative_int, - 'width': directives.nonnegative_int, - 'scale': directives.nonnegative_int, - 'align': align, - 'class': directives.class_option} - -def figure(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - figwidth = options.setdefault('figwidth') - figclass = options.setdefault('figclass') - del options['figwidth'] - del options['figclass'] - (image_node,) = image(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine) - if isinstance(image_node, nodes.system_message): - return [image_node] - figure_node = nodes.figure('', image_node) - if figwidth == 'image': - if Image: - # PIL doesn't like Unicode paths: - try: - i = Image.open(str(image_node['uri'])) - except (IOError, UnicodeError): - pass - else: - figure_node['width'] = i.size[0] - elif figwidth is not None: - figure_node['width'] = figwidth - if figclass: - figure_node.set_class(figclass) - if content: - node = nodes.Element() # anonymous container for parsing - state.nested_parse(content, content_offset, node) - first_node = node[0] - if isinstance(first_node, nodes.paragraph): - caption = nodes.caption(first_node.rawsource, '', - *first_node.children) - figure_node += caption - elif not (isinstance(first_node, nodes.comment) - and len(first_node) == 0): - error = state_machine.reporter.error( - 'Figure caption must be a paragraph or empty comment.', - nodes.literal_block(block_text, block_text), line=lineno) - return [figure_node, error] - if len(node) > 1: - figure_node += nodes.legend('', *node[1:]) - return [figure_node] - -def figwidth_value(argument): - if argument.lower() == 'image': - return 'image' - else: - return directives.nonnegative_int(argument) - -figure.arguments = (1, 0, 1) -figure.options = {'figwidth': figwidth_value, - 'figclass': directives.class_option} -figure.options.update(image.options) -figure.content = 1 diff --git a/docutils/docutils/parsers/rst/directives/misc.py b/docutils/docutils/parsers/rst/directives/misc.py deleted file mode 100644 index 581c10269..000000000 --- a/docutils/docutils/parsers/rst/directives/misc.py +++ /dev/null @@ -1,231 +0,0 @@ -# Authors: David Goodger, Dethe Elza -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -"""Miscellaneous directives.""" - -__docformat__ = 'reStructuredText' - -import sys -import os.path -import re -from urllib2 import urlopen, URLError -from docutils import io, nodes, statemachine, utils -from docutils.parsers.rst import directives, states -from docutils.transforms import misc - - -def include(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - """Include a reST file as part of the content of this reST file.""" - source = state_machine.input_lines.source( - lineno - state_machine.input_offset - 1) - source_dir = os.path.dirname(os.path.abspath(source)) - path = ''.join(arguments[0].splitlines()) - if path.find(' ') != -1: - error = state_machine.reporter.error( - '"%s" directive path contains whitespace.' % name, - nodes.literal_block(block_text, block_text), line=lineno) - return [error] - path = os.path.normpath(os.path.join(source_dir, path)) - path = utils.relative_path(None, path) - try: - include_file = io.FileInput( - source_path=path, encoding=state.document.settings.input_encoding) - except IOError, error: - severe = state_machine.reporter.severe( - 'Problems with "%s" directive path:\n%s.' % (name, error), - nodes.literal_block(block_text, block_text), line=lineno) - return [severe] - include_text = include_file.read() - if options.has_key('literal'): - literal_block = nodes.literal_block(include_text, include_text, - source=path) - literal_block.line = 1 - return literal_block - else: - include_lines = statemachine.string2lines(include_text, - convert_whitespace=1) - state_machine.insert_input(include_lines, path) - return [] - -include.arguments = (1, 0, 1) -include.options = {'literal': directives.flag} - -def raw(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - """ - Pass through content unchanged - - Content is included in output based on type argument - - Content may be included inline (content section of directive) or - imported from a file or url. - """ - attributes = {'format': arguments[0]} - if content: - if options.has_key('file') or options.has_key('url'): - error = state_machine.reporter.error( - '"%s" directive may not both specify an external file and ' - 'have content.' % name, - nodes.literal_block(block_text, block_text), line=lineno) - return [error] - text = '\n'.join(content) - elif options.has_key('file'): - if options.has_key('url'): - error = state_machine.reporter.error( - 'The "file" and "url" options may not be simultaneously ' - 'specified for the "%s" directive.' % name, - nodes.literal_block(block_text, block_text), line=lineno) - return [error] - source_dir = os.path.dirname( - os.path.abspath(state.document.current_source)) - path = os.path.normpath(os.path.join(source_dir, options['file'])) - path = utils.relative_path(None, path) - try: - raw_file = open(path) - except IOError, error: - severe = state_machine.reporter.severe( - 'Problems with "%s" directive path:\n%s.' % (name, error), - nodes.literal_block(block_text, block_text), line=lineno) - return [severe] - text = raw_file.read() - raw_file.close() - attributes['source'] = path - elif options.has_key('url'): - try: - raw_file = urlopen(options['url']) - except (URLError, IOError, OSError), error: - severe = state_machine.reporter.severe( - 'Problems with "%s" directive URL "%s":\n%s.' - % (name, options['url'], error), - nodes.literal_block(block_text, block_text), line=lineno) - return [severe] - text = raw_file.read() - raw_file.close() - attributes['source'] = options['file'] - else: - error = state_machine.reporter.warning( - 'The "%s" directive requires content; none supplied.' % (name), - nodes.literal_block(block_text, block_text), line=lineno) - return [error] - raw_node = nodes.raw('', text, **attributes) - return [raw_node] - -raw.arguments = (1, 0, 1) -raw.options = {'file': directives.path, - 'url': directives.path} -raw.content = 1 - -def replace(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - if not isinstance(state, states.SubstitutionDef): - error = state_machine.reporter.error( - 'Invalid context: the "%s" directive can only be used within a ' - 'substitution definition.' % (name), - nodes.literal_block(block_text, block_text), line=lineno) - return [error] - text = '\n'.join(content) - element = nodes.Element(text) - if text: - state.nested_parse(content, content_offset, element) - if len(element) != 1 or not isinstance(element[0], nodes.paragraph): - messages = [] - for node in element: - if isinstance(node, nodes.system_message): - if node.has_key('backrefs'): - del node['backrefs'] - messages.append(node) - error = state_machine.reporter.error( - 'Error in "%s" directive: may contain a single paragraph ' - 'only.' % (name), line=lineno) - messages.append(error) - return messages - else: - return element[0].children - else: - error = state_machine.reporter.error( - 'The "%s" directive is empty; content required.' % (name), - line=lineno) - return [error] - -replace.content = 1 - -def unicode_directive(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - r""" - Convert Unicode character codes (numbers) to characters. Codes may be - decimal numbers, hexadecimal numbers (prefixed by ``0x``, ``x``, ``\x``, - ``U+``, ``u``, or ``\u``; e.g. ``U+262E``), or XML-style numeric character - entities (e.g. ``☮``). Text following ".." is a comment and is - ignored. Spaces are ignored, and any other text remains as-is. - """ - if not isinstance(state, states.SubstitutionDef): - error = state_machine.reporter.error( - 'Invalid context: the "%s" directive can only be used within a ' - 'substitution definition.' % (name), - nodes.literal_block(block_text, block_text), line=lineno) - return [error] - codes = arguments[0].split('.. ')[0].split() - element = nodes.Element() - for code in codes: - try: - if code.isdigit(): - element += nodes.Text(unichr(int(code))) - else: - match = unicode_pattern.match(code) - if match: - value = match.group(1) or match.group(2) - element += nodes.Text(unichr(int(value, 16))) - else: - element += nodes.Text(code) - except ValueError, err: - error = state_machine.reporter.error( - 'Invalid character code: %s\n%s' % (code, err), - nodes.literal_block(block_text, block_text), line=lineno) - return [error] - return element.children - -unicode_directive.arguments = (1, 0, 1) -unicode_pattern = re.compile( - r'(?:0x|x|\x00x|U\+?|\x00u)([0-9a-f]+)$|&#x([0-9a-f]+);$', re.IGNORECASE) - -def class_directive(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - """""" - class_value = nodes.make_id(arguments[0]) - if class_value: - pending = nodes.pending(misc.ClassAttribute, - {'class': class_value, 'directive': name}, - block_text) - state_machine.document.note_pending(pending) - return [pending] - else: - error = state_machine.reporter.error( - 'Invalid class attribute value for "%s" directive: %s' - % (name, arguments[0]), - nodes.literal_block(block_text, block_text), line=lineno) - return [error] - -class_directive.arguments = (1, 0, 0) -class_directive.content = 1 - -def directive_test_function(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - if content: - text = '\n'.join(content) - info = state_machine.reporter.info( - 'Directive processed. Type="%s", arguments=%r, options=%r, ' - 'content:' % (name, arguments, options), - nodes.literal_block(text, text), line=lineno) - else: - info = state_machine.reporter.info( - 'Directive processed. Type="%s", arguments=%r, options=%r, ' - 'content: None' % (name, arguments, options), line=lineno) - return [info] - -directive_test_function.arguments = (0, 1, 1) -directive_test_function.options = {'option': directives.unchanged} -directive_test_function.content = 1 diff --git a/docutils/docutils/parsers/rst/directives/parts.py b/docutils/docutils/parsers/rst/directives/parts.py deleted file mode 100644 index 2faaca44b..000000000 --- a/docutils/docutils/parsers/rst/directives/parts.py +++ /dev/null @@ -1,56 +0,0 @@ -# Author: David Goodger, Dmitry Jemerov -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Directives for document parts. -""" - -__docformat__ = 'reStructuredText' - -from docutils import nodes -from docutils.transforms import parts -from docutils.parsers.rst import directives - - -backlinks_values = ('top', 'entry', 'none') - -def backlinks(arg): - value = directives.choice(arg, backlinks_values) - if value == 'none': - return None - else: - return value - -def contents(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - """Table of contents.""" - if arguments: - title_text = arguments[0] - text_nodes, messages = state.inline_text(title_text, lineno) - title = nodes.title(title_text, '', *text_nodes) - else: - messages = [] - title = None - pending = nodes.pending(parts.Contents, {'title': title}, block_text) - pending.details.update(options) - state_machine.document.note_pending(pending) - return [pending] + messages - -contents.arguments = (0, 1, 1) -contents.options = {'depth': directives.nonnegative_int, - 'local': directives.flag, - 'backlinks': backlinks, - 'class': directives.class_option} - -def sectnum(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - """Automatic section numbering.""" - pending = nodes.pending(parts.SectNum) - pending.details.update(options) - state_machine.document.note_pending(pending) - return [pending] - -sectnum.options = {'depth': int} diff --git a/docutils/docutils/parsers/rst/directives/references.py b/docutils/docutils/parsers/rst/directives/references.py deleted file mode 100644 index 92966140f..000000000 --- a/docutils/docutils/parsers/rst/directives/references.py +++ /dev/null @@ -1,23 +0,0 @@ -# Author: David Goodger, Dmitry Jemerov -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Directives for references and targets. -""" - -__docformat__ = 'reStructuredText' - -from docutils import nodes -from docutils.transforms import references - - -def target_notes(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - """Target footnote generation.""" - pending = nodes.pending(references.TargetNotes) - state_machine.document.note_pending(pending) - nodelist = [pending] - return nodelist diff --git a/docutils/docutils/parsers/rst/languages/__init__.py b/docutils/docutils/parsers/rst/languages/__init__.py deleted file mode 100644 index ea4218657..000000000 --- a/docutils/docutils/parsers/rst/languages/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -# Internationalization details are documented in -# <http://docutils.sf.net/spec/howto/i18n.html>. - -""" -This package contains modules for language-dependent features of -reStructuredText. -""" - -__docformat__ = 'reStructuredText' - -_languages = {} - -def get_language(language_code): - if _languages.has_key(language_code): - return _languages[language_code] - try: - module = __import__(language_code, globals(), locals()) - except ImportError: - return None - _languages[language_code] = module - return module diff --git a/docutils/docutils/parsers/rst/languages/af.py b/docutils/docutils/parsers/rst/languages/af.py deleted file mode 100644 index 8ad023ed1..000000000 --- a/docutils/docutils/parsers/rst/languages/af.py +++ /dev/null @@ -1,92 +0,0 @@ -# Author: Jannie Hofmeyr -# Contact: jhsh@sun.ac.za -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -# New language mappings are welcome. Before doing a new translation, please -# read <http://docutils.sf.net/spec/howto/i18n.html>. Two files must be -# translated for each language: one in docutils/languages, the other in -# docutils/parsers/rst/languages. - -""" -Afrikaans-language mappings for language-dependent features of -reStructuredText. -""" - -__docformat__ = 'reStructuredText' - - -directives = { - 'aandag': 'attention', - 'versigtig': 'caution', - 'gevaar': 'danger', - 'fout': 'error', - 'wenk': 'hint', - 'belangrik': 'important', - 'nota': 'note', - 'tip': 'tip', # hint and tip both have the same translation: wenk - 'waarskuwing': 'warning', - 'vermaning': 'admonition', - 'kantstreep': 'sidebar', - 'onderwerp': 'topic', - 'lynblok': 'line-block', - 'parsed-literal (translation required)': 'parsed-literal', - 'rubriek': 'rubric', - 'epigraaf': 'epigraph', - 'hoogtepunte': 'highlights', - 'pull-quote (translation required)': 'pull-quote', - #'vrae': 'questions', - #'qa': 'questions', - #'faq': 'questions', - 'meta': 'meta', - #'beeldkaart': 'imagemap', - 'beeld': 'image', - 'figuur': 'figure', - 'insluiting': 'include', - 'rou': 'raw', - 'vervang': 'replace', - 'unicode': 'unicode', # should this be translated? unikode - 'klas': 'class', - 'inhoud': 'contents', - 'sectnum': 'sectnum', - 'section-numbering': 'sectnum', - #'voetnote': 'footnotes', - #'aanhalings': 'citations', - 'teikennotas': 'target-notes', - 'restructuredtext-test-directive': 'restructuredtext-test-directive'} -"""Afrikaans name to registered (in directives/__init__.py) directive name -mapping.""" - -roles = { - 'afkorting': 'abbreviation', - 'ab': 'abbreviation', - 'akroniem': 'acronym', - 'ac': 'acronym', - 'indeks': 'index', - 'i': 'index', - 'voetskrif': 'subscript', - 'sub': 'subscript', - 'boskrif': 'superscript', - 'sup': 'superscript', - 'titelverwysing': 'title-reference', - 'titel': 'title-reference', - 't': 'title-reference', - 'pep-verwysing': 'pep-reference', - 'pep': 'pep-reference', - 'rfc-verwysing': 'rfc-reference', - 'rfc': 'rfc-reference', - 'nadruk': 'emphasis', - 'sterk': 'strong', - 'literal (translation required)': 'literal', - 'benoemde verwysing': 'named-reference', - 'anonieme verwysing': 'anonymous-reference', - 'voetnootverwysing': 'footnote-reference', - 'aanhalingverwysing': 'citation-reference', - 'vervangingsverwysing': 'substitution-reference', - 'teiken': 'target', - 'uri-verwysing': 'uri-reference', - 'uri': 'uri-reference', - 'url': 'uri-reference',} -"""Mapping of Afrikaans role names to canonical role names for interpreted text. -""" diff --git a/docutils/docutils/parsers/rst/languages/de.py b/docutils/docutils/parsers/rst/languages/de.py deleted file mode 100644 index 017a2e851..000000000 --- a/docutils/docutils/parsers/rst/languages/de.py +++ /dev/null @@ -1,83 +0,0 @@ -# -*- coding: iso-8859-1 -*- -# Author: Engelbert Gruber -# Contact: grubert@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -# New language mappings are welcome. Before doing a new translation, please -# read <http://docutils.sf.net/spec/howto/i18n.html>. Two files must be -# translated for each language: one in docutils/languages, the other in -# docutils/parsers/rst/languages. - -""" -German-language mappings for language-dependent features of -reStructuredText. -""" - -__docformat__ = 'reStructuredText' - - -directives = { - 'achtung': 'attention', - 'vorsicht': 'caution', - 'gefahr': 'danger', - 'fehler': 'error', - 'hinweis': 'hint', - 'wichtig': 'important', - 'notiz': 'note', - 'tip': 'tip', - 'warnung': 'warning', - 'ermahnung': 'admonition', - 'kasten': 'sidebar', # seitenkasten ? - 'thema': 'topic', - 'line-block': 'line-block', - 'parsed-literal': 'parsed-literal', - 'rubrik': 'rubric', - 'epigraph (translation required)': 'epigraph', - 'highlights (translation required)': 'highlights', - 'pull-quote (translation required)': 'pull-quote', # kasten too ? - #'questions': 'questions', - #'qa': 'questions', - #'faq': 'questions', - 'meta': 'meta', - #'imagemap': 'imagemap', - 'bild': 'image', - 'abbildung': 'figure', - 'raw': 'raw', # unbearbeitet - 'include': 'include', # einfügen, "füge ein" would be more like a command. - # einfügung would be the noun. - 'ersetzung': 'replace', # ersetzen, ersetze - 'unicode': 'unicode', - 'klasse': 'class', # offer class too ? - 'inhalt': 'contents', - 'sectnum': 'sectnum', - 'section-numbering': 'sectnum', - 'target-notes': 'target-notes', - #'footnotes': 'footnotes', - #'citations': 'citations', - 'restructuredtext-test-directive': 'restructuredtext-test-directive'} -"""German name to registered (in directives/__init__.py) directive name -mapping.""" - -roles = { - 'abbreviation (translation required)': 'abbreviation', - 'acronym (translation required)': 'acronym', - 'index (translation required)': 'index', - 'subscript (translation required)': 'subscript', - 'superscript (translation required)': 'superscript', - 'title-reference (translation required)': 'title-reference', - 'pep-reference (translation required)': 'pep-reference', - 'rfc-reference (translation required)': 'rfc-reference', - 'emphasis (translation required)': 'emphasis', - 'strong (translation required)': 'strong', - 'literal (translation required)': 'literal', - 'named-reference (translation required)': 'named-reference', - 'anonymous-reference (translation required)': 'anonymous-reference', - 'footnote-reference (translation required)': 'footnote-reference', - 'citation-reference (translation required)': 'citation-reference', - 'substitution-reference (translation required)': 'substitution-reference', - 'target (translation required)': 'target', - 'uri-reference (translation required)': 'uri-reference',} -"""Mapping of German role names to canonical role names for interpreted text. -""" diff --git a/docutils/docutils/parsers/rst/languages/en.py b/docutils/docutils/parsers/rst/languages/en.py deleted file mode 100644 index a9b060f82..000000000 --- a/docutils/docutils/parsers/rst/languages/en.py +++ /dev/null @@ -1,94 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -# New language mappings are welcome. Before doing a new translation, please -# read <http://docutils.sf.net/spec/howto/i18n.html>. Two files must be -# translated for each language: one in docutils/languages, the other in -# docutils/parsers/rst/languages. - -""" -English-language mappings for language-dependent features of -reStructuredText. -""" - -__docformat__ = 'reStructuredText' - - -directives = { - # language-dependent: fixed - 'attention': 'attention', - 'caution': 'caution', - 'danger': 'danger', - 'error': 'error', - 'hint': 'hint', - 'important': 'important', - 'note': 'note', - 'tip': 'tip', - 'warning': 'warning', - 'admonition': 'admonition', - 'sidebar': 'sidebar', - 'topic': 'topic', - 'line-block': 'line-block', - 'parsed-literal': 'parsed-literal', - 'rubric': 'rubric', - 'epigraph': 'epigraph', - 'highlights': 'highlights', - 'pull-quote': 'pull-quote', - #'questions': 'questions', - #'qa': 'questions', - #'faq': 'questions', - 'meta': 'meta', - #'imagemap': 'imagemap', - 'image': 'image', - 'figure': 'figure', - 'include': 'include', - 'raw': 'raw', - 'replace': 'replace', - 'unicode': 'unicode', - 'class': 'class', - 'contents': 'contents', - 'sectnum': 'sectnum', - 'section-numbering': 'sectnum', - #'footnotes': 'footnotes', - #'citations': 'citations', - 'target-notes': 'target-notes', - 'restructuredtext-test-directive': 'restructuredtext-test-directive'} -"""English name to registered (in directives/__init__.py) directive name -mapping.""" - -roles = { - # language-dependent: fixed - 'abbreviation': 'abbreviation', - 'ab': 'abbreviation', - 'acronym': 'acronym', - 'ac': 'acronym', - 'index': 'index', - 'i': 'index', - 'subscript': 'subscript', - 'sub': 'subscript', - 'superscript': 'superscript', - 'sup': 'superscript', - 'title-reference': 'title-reference', - 'title': 'title-reference', - 't': 'title-reference', - 'pep-reference': 'pep-reference', - 'pep': 'pep-reference', - 'rfc-reference': 'rfc-reference', - 'rfc': 'rfc-reference', - 'emphasis': 'emphasis', - 'strong': 'strong', - 'literal': 'literal', - 'named-reference': 'named-reference', - 'anonymous-reference': 'anonymous-reference', - 'footnote-reference': 'footnote-reference', - 'citation-reference': 'citation-reference', - 'substitution-reference': 'substitution-reference', - 'target': 'target', - 'uri-reference': 'uri-reference', - 'uri': 'uri-reference', - 'url': 'uri-reference',} -"""Mapping of English role names to canonical role names for interpreted text. -""" diff --git a/docutils/docutils/parsers/rst/languages/es.py b/docutils/docutils/parsers/rst/languages/es.py deleted file mode 100644 index 53bb9ff77..000000000 --- a/docutils/docutils/parsers/rst/languages/es.py +++ /dev/null @@ -1,102 +0,0 @@ -# Author: Marcelo Huerta San Martín -# Contact: mghsm@uol.com.ar -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -# New language mappings are welcome. Before doing a new translation, please -# read <http://docutils.sf.net/spec/howto/i18n.html>. Two files must be -# translated for each language: one in docutils/languages, the other in -# docutils/parsers/rst/languages. - -""" -Spanish-language mappings for language-dependent features of -reStructuredText. -""" - -__docformat__ = 'reStructuredText' - - -directives = { - u'atenci\u00f3n': 'attention', - u'atencion': 'attention', - u'precauci\u00f3n': 'caution', - u'precaucion': 'caution', - u'peligro': 'danger', - u'error': 'error', - u'sugerencia': 'hint', - u'importante': 'important', - u'nota': 'note', - u'consejo': 'tip', - u'advertencia': 'warning', - u'exhortacion': 'admonition', - u'exhortaci\u00f3n': 'admonition', - u'nota-al-margen': 'sidebar', - u'tema': 'topic', - u'bloque-de-lineas': 'line-block', - u'bloque-de-l\u00edneas': 'line-block', - u'literal-evaluado': 'parsed-literal', - u'firma': 'rubric', - u'ep\u00edgrafe': 'epigraph', - u'epigrafe': 'epigraph', - u'destacado': 'highlights', - u'cita-destacada': 'pull-quote', - #'questions': 'questions', - #'qa': 'questions', - #'faq': 'questions', - u'meta': 'meta', - #'imagemap': 'imagemap', - u'imagen': 'image', - u'figura': 'figure', - u'incluir': 'include', - u'raw': 'raw', - u'reemplazar': 'replace', - u'unicode': 'unicode', - u'clase': 'class', - u'contenido': 'contents', - u'numseccion': 'sectnum', - u'numsecci\u00f3n': 'sectnum', - u'numeracion-seccion': 'sectnum', - u'numeraci\u00f3n-secci\u00f3n': 'sectnum', - u'notas-destino': 'target-notes', - #'footnotes': 'footnotes', - #'citations': 'citations', - u'restructuredtext-test-directive': 'restructuredtext-test-directive'} -"""Spanish name to registered (in directives/__init__.py) directive name -mapping.""" - -roles = { - u'abreviatura': 'abbreviation', - u'ab': 'abbreviation', - u'acronimo': 'acronym', - u'acronimo': 'acronym', - u'ac': 'acronym', - u'indice': 'index', - u'i': 'index', - u'subscript (translation required)': 'subscript', - u'superscript (translation required)': 'superscript', - u'referencia-titulo': 'title-reference', - u'titulo': 'title-reference', - u't': 'title-reference', - u'referencia-pep': 'pep-reference', - u'pep': 'pep-reference', - u'referencia-rfc': 'rfc-reference', - u'rfc': 'rfc-reference', - u'enfasis': 'emphasis', - u'\u00e9nfasis': 'emphasis', - u'destacado': 'strong', - u'literal': 'literal', - u'referencia-con-nombre': 'named-reference', - u'referencia-anonima': 'anonymous-reference', - u'referencia-an\u00f3nima': 'anonymous-reference', - u'referencia-nota-al-pie': 'footnote-reference', - u'referencia-cita': 'citation-reference', - u'referencia-sustitucion': 'substitution-reference', - u'referencia-sustituci\u00f3n': 'substitution-reference', - u'destino': 'target', - u'referencia-uri': 'uri-reference', - u'uri': 'uri-reference', - u'url': 'uri-reference', - } -"""Mapping of Spanish role names to canonical role names for interpreted text. -""" diff --git a/docutils/docutils/parsers/rst/languages/fr.py b/docutils/docutils/parsers/rst/languages/fr.py deleted file mode 100644 index ba0bcb014..000000000 --- a/docutils/docutils/parsers/rst/languages/fr.py +++ /dev/null @@ -1,89 +0,0 @@ -# Authors: David Goodger; William Dode -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -# New language mappings are welcome. Before doing a new translation, please -# read <http://docutils.sf.net/spec/howto/i18n.html>. Two files must be -# translated for each language: one in docutils/languages, the other in -# docutils/parsers/rst/languages. - -""" -French-language mappings for language-dependent features of -reStructuredText. -""" - -__docformat__ = 'reStructuredText' - - -directives = { - u'attention': 'attention', - u'pr\u00E9caution': 'caution', - u'danger': 'danger', - u'erreur': 'error', - u'conseil': 'hint', - u'important': 'important', - u'note': 'note', - u'astuce': 'tip', - u'avertissement': 'warning', - u'admonition': 'admonition', - u'encadr\u00E9': 'sidebar', - u'sujet': 'topic', - u'bloc-textuel': 'line-block', - u'bloc-interpr\u00E9t\u00E9': 'parsed-literal', - u'code-interpr\u00E9t\u00E9': 'parsed-literal', - u'intertitre': 'rubric', - u'exergue': 'epigraph', - u'\u00E9pigraphe': 'epigraph', - u'chapeau': 'highlights', - u'accroche': 'pull-quote', - #u'questions': 'questions', - #u'qr': 'questions', - #u'faq': 'questions', - u'm\u00E9ta': 'meta', - #u'imagemap (translation required)': 'imagemap', - u'image': 'image', - u'figure': 'figure', - u'inclure': 'include', - u'brut': 'raw', - u'remplacer': 'replace', - u'remplace': 'replace', - u'unicode': 'unicode', - u'classe': 'class', - u'sommaire': 'contents', - u'table-des-mati\u00E8res': 'contents', - u'sectnum': 'sectnum', - u'section-num\u00E9rot\u00E9e': 'sectnum', - u'liens': 'target-notes', - #u'footnotes (translation required)': 'footnotes', - #u'citations (translation required)': 'citations', - } -"""French name to registered (in directives/__init__.py) directive name -mapping.""" - -roles = { - u'abr\u00E9viation': 'abbreviation', - u'acronyme': 'acronym', - u'sigle': 'acronym', - u'index': 'index', - u'indice': 'subscript', - u'ind': 'subscript', - u'exposant': 'superscript', - u'exp': 'superscript', - u'titre-r\u00E9f\u00E9rence': 'title-reference', - u'titre': 'title-reference', - u'pep-r\u00E9f\u00E9rence': 'pep-reference', - u'rfc-r\u00E9f\u00E9rence': 'rfc-reference', - u'emphase': 'emphasis', - u'fort': 'strong', - u'litt\u00E9ral': 'literal', - u'nomm\u00E9e-r\u00E9f\u00E9rence': 'named-reference', - u'anonyme-r\u00E9f\u00E9rence': 'anonymous-reference', - u'note-r\u00E9f\u00E9rence': 'footnote-reference', - u'citation-r\u00E9f\u00E9rence': 'citation-reference', - u'substitution-r\u00E9f\u00E9rence': 'substitution-reference', - u'lien': 'target', - u'uri-r\u00E9f\u00E9rence': 'uri-reference',} -"""Mapping of French role names to canonical role names for interpreted text. -""" diff --git a/docutils/docutils/parsers/rst/languages/it.py b/docutils/docutils/parsers/rst/languages/it.py deleted file mode 100644 index 911c69a66..000000000 --- a/docutils/docutils/parsers/rst/languages/it.py +++ /dev/null @@ -1,81 +0,0 @@ -# Author: Nicola Larosa -# Contact: docutils@tekNico.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -# New language mappings are welcome. Before doing a new translation, please -# read <http://docutils.sf.net/spec/howto/i18n.html>. Two files must be -# translated for each language: one in docutils/languages, the other in -# docutils/parsers/rst/languages. - -""" -Italian-language mappings for language-dependent features of -reStructuredText. -""" - -__docformat__ = 'reStructuredText' - - -directives = { - 'attenzione': 'attention', - 'cautela': 'caution', - 'pericolo': 'danger', - 'errore': 'error', - 'suggerimento': 'hint', - 'importante': 'important', - 'nota': 'note', - 'consiglio': 'tip', - 'avvertenza': 'warning', - 'admonition (translation required)': 'admonition', - 'sidebar (translation required)': 'sidebar', - 'argomento': 'topic', - 'blocco di linee': 'line-block', - 'parsed-literal': 'parsed-literal', - 'rubric (translation required)': 'rubric', - 'epigraph (translation required)': 'epigraph', - 'highlights (translation required)': 'highlights', - 'pull-quote (translation required)': 'pull-quote', - #'questions': 'questions', - #'qa': 'questions', - #'faq': 'questions', - 'meta': 'meta', - #'imagemap': 'imagemap', - 'immagine': 'image', - 'figura': 'figure', - 'includi': 'include', - 'grezzo': 'raw', - 'sostituisci': 'replace', - 'unicode': 'unicode', - 'class (translation required)': 'class', - 'indice': 'contents', - 'seznum': 'sectnum', - 'section-numbering': 'sectnum', - 'target-notes': 'target-notes', - #'footnotes': 'footnotes', - #'citations': 'citations', - 'restructuredtext-test-directive': 'restructuredtext-test-directive'} -"""Italian name to registered (in directives/__init__.py) directive name -mapping.""" - -roles = { - 'abbreviation (translation required)': 'abbreviation', - 'acronym (translation required)': 'acronym', - 'index (translation required)': 'index', - 'subscript (translation required)': 'subscript', - 'superscript (translation required)': 'superscript', - 'title-reference (translation required)': 'title-reference', - 'pep-reference (translation required)': 'pep-reference', - 'rfc-reference (translation required)': 'rfc-reference', - 'emphasis (translation required)': 'emphasis', - 'strong (translation required)': 'strong', - 'literal (translation required)': 'literal', - 'named-reference (translation required)': 'named-reference', - 'anonymous-reference (translation required)': 'anonymous-reference', - 'footnote-reference (translation required)': 'footnote-reference', - 'citation-reference (translation required)': 'citation-reference', - 'substitution-reference (translation required)': 'substitution-reference', - 'target (translation required)': 'target', - 'uri-reference (translation required)': 'uri-reference',} -"""Mapping of Italian role names to canonical role names for interpreted text. -""" diff --git a/docutils/docutils/parsers/rst/languages/ru.py b/docutils/docutils/parsers/rst/languages/ru.py deleted file mode 100644 index 366f4505f..000000000 --- a/docutils/docutils/parsers/rst/languages/ru.py +++ /dev/null @@ -1,93 +0,0 @@ -# Author: Roman Suzi -# Contact: rnd@onego.ru -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -# New language mappings are welcome. Before doing a new translation, please -# read <http://docutils.sf.net/spec/howto/i18n.html>. Two files must be -# translated for each language: one in docutils/languages, the other in -# docutils/parsers/rst/languages. - -""" -Russian-language mappings for language-dependent features of -reStructuredText. -""" - -__docformat__ = 'reStructuredText' - -directives = { - u'\u0431\u043b\u043e\u043a-\u0441\u0442\u0440\u043e\u043a': u'line-block', - u'meta': u'meta', - u'\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439-\u043b\u0438\u0442\u0435\u0440\u0430\u043b': - u'parsed-literal', - u'\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f-\u0446\u0438\u0442\u0430\u0442\u0430': - u'pull-quote', - u'\u0441\u044b\u0440\u043e\u0439': u'raw', - u'\u0437\u0430\u043c\u0435\u043d\u0430': u'replace', - u'\u0442\u0435\u0441\u0442\u043e\u0432\u0430\u044f-\u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430-restructuredtext': - u'restructuredtext-test-directive', - u'\u0446\u0435\u043b\u0435\u0432\u044b\u0435-\u0441\u043d\u043e\u0441\u043a\u0438': - u'target-notes', - u'unicode': u'unicode', - u'\u0431\u043e\u043a\u043e\u0432\u0430\u044f-\u043f\u043e\u043b\u043e\u0441\u0430': - u'sidebar', - u'\u0432\u0430\u0436\u043d\u043e': u'important', - u'\u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c': u'include', - u'\u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435': u'attention', - u'\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435': u'highlights', - u'\u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435': u'admonition', - u'\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435': - u'image', - u'\u043a\u043b\u0430\u0441\u0441': u'class', - u'\u043d\u043e\u043c\u0435\u0440-\u0440\u0430\u0437\u0434\u0435\u043b\u0430': - u'sectnum', - u'\u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u044f-\u0440\u0430\u0437' - u'\u0434\u0435\u043b\u043e\u0432': u'sectnum', - u'\u043e\u043f\u0430\u0441\u043d\u043e': u'danger', - u'\u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e': u'caution', - u'\u043e\u0448\u0438\u0431\u043a\u0430': u'error', - u'\u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430': u'tip', - u'\u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d' - u'\u0438\u0435': u'warning', - u'\u043f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435': u'note', - u'\u0440\u0438\u0441\u0443\u043d\u043e\u043a': u'figure', - u'\u0440\u0443\u0431\u0440\u0438\u043a\u0430': u'rubric', - u'\u0441\u043e\u0432\u0435\u0442': u'hint', - u'\u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435': u'contents', - u'\u0442\u0435\u043c\u0430': u'topic', - u'\u044d\u043f\u0438\u0433\u0440\u0430\u0444': u'epigraph'} -"""Russian name to registered (in directives/__init__.py) directive name -mapping.""" - -roles = { - u'\u0430\u043a\u0440\u043e\u043d\u0438\u043c': 'acronym', - u'\u0430\u043d\u043e\u043d\u0438\u043c\u043d\u0430\u044f-\u0441\u0441\u044b\u043b\u043a\u0430': - 'anonymous-reference', - u'\u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e': 'literal', - u'\u0432\u0435\u0440\u0445\u043d\u0438\u0439-\u0438\u043d\u0434\u0435\u043a\u0441': - 'superscript', - u'\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435': 'emphasis', - u'\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u0430\u044f-\u0441\u0441\u044b\u043b\u043a\u0430': - 'named-reference', - u'\u0438\u043d\u0434\u0435\u043a\u0441': 'index', - u'\u043d\u0438\u0436\u043d\u0438\u0439-\u0438\u043d\u0434\u0435\u043a\u0441': - 'subscript', - u'\u0441\u0438\u043b\u044c\u043d\u043e\u0435-\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435': - 'strong', - u'\u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435': - 'abbreviation', - u'\u0441\u0441\u044b\u043b\u043a\u0430-\u0437\u0430\u043c\u0435\u043d\u0430': - 'substitution-reference', - u'\u0441\u0441\u044b\u043b\u043a\u0430-\u043d\u0430-pep': 'pep-reference', - u'\u0441\u0441\u044b\u043b\u043a\u0430-\u043d\u0430-rfc': 'rfc-reference', - u'\u0441\u0441\u044b\u043b\u043a\u0430-\u043d\u0430-uri': 'uri-reference', - u'\u0441\u0441\u044b\u043b\u043a\u0430-\u043d\u0430-\u0437\u0430\u0433\u043b\u0430\u0432\u0438\u0435': - 'title-reference', - u'\u0441\u0441\u044b\u043b\u043a\u0430-\u043d\u0430-\u0441\u043d\u043e\u0441\u043a\u0443': - 'footnote-reference', - u'\u0446\u0438\u0442\u0430\u0442\u043d\u0430\u044f-\u0441\u0441\u044b\u043b\u043a\u0430': - 'citation-reference', - u'\u0446\u0435\u043b\u044c': 'target'} -"""Mapping of Russian role names to canonical role names for interpreted text. -""" diff --git a/docutils/docutils/parsers/rst/languages/sk.py b/docutils/docutils/parsers/rst/languages/sk.py deleted file mode 100644 index caf3ed5c4..000000000 --- a/docutils/docutils/parsers/rst/languages/sk.py +++ /dev/null @@ -1,81 +0,0 @@ -# Author: Miroslav Vasko -# Contact: zemiak@zoznam.sk -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -# New language mappings are welcome. Before doing a new translation, please -# read <http://docutils.sf.net/spec/howto/i18n.html>. Two files must be -# translated for each language: one in docutils/languages, the other in -# docutils/parsers/rst/languages. - -""" -Slovak-language mappings for language-dependent features of -reStructuredText. -""" - -__docformat__ = 'reStructuredText' - - -directives = { - u'pozor': 'attention', - u'opatrne': 'caution', - u'nebezpe\xe8enstvo': 'danger', - u'chyba': 'error', - u'rada': 'hint', - u'd\xf4le\x9eit\xe9': 'important', - u'pozn\xe1mka': 'note', - u'tip': 'tip', - u'varovanie': 'warning', - u'admonition (translation required)': 'admonition', - u'sidebar (translation required)': 'sidebar', - u't\xe9ma': 'topic', - u'blok-riadkov': 'line-block', - u'parsed-literal': 'parsed-literal', - u'rubric (translation required)': 'rubric', - u'epigraph (translation required)': 'epigraph', - u'highlights (translation required)': 'highlights', - u'pull-quote (translation required)': 'pull-quote', - #u'questions': 'questions', - #u'qa': 'questions', - #u'faq': 'questions', - u'meta': 'meta', - #u'imagemap': 'imagemap', - u'obr\xe1zok': 'image', - u'tvar': 'figure', - u'vlo\x9ei\x9d': 'include', - u'raw': 'raw', - u'nahradi\x9d': 'replace', - u'unicode': 'unicode', - u'class (translation required)': 'class', - u'obsah': 'contents', - u'\xe8as\x9d': 'sectnum', - u'\xe8as\x9d-\xe8\xedslovanie': 'sectnum', - u'cie\xbeov\xe9-pozn\xe1mky': 'target-notes', - #u'footnotes': 'footnotes', - #u'citations': 'citations', - } -"""Slovak name to registered (in directives/__init__.py) directive name -mapping.""" - -roles = { - u'abbreviation (translation required)': 'abbreviation', - u'acronym (translation required)': 'acronym', - u'index (translation required)': 'index', - u'subscript (translation required)': 'subscript', - u'superscript (translation required)': 'superscript', - u'title-reference (translation required)': 'title-reference', - u'pep-reference (translation required)': 'pep-reference', - u'rfc-reference (translation required)': 'rfc-reference', - u'emphasis (translation required)': 'emphasis', - u'strong (translation required)': 'strong', - u'literal (translation required)': 'literal', - u'named-reference (translation required)': 'named-reference', - u'anonymous-reference (translation required)': 'anonymous-reference', - u'footnote-reference (translation required)': 'footnote-reference', - u'citation-reference (translation required)': 'citation-reference', - u'substitution-reference (translation required)': 'substitution-reference', - u'target (translation required)': 'target', - u'uri-reference (translation required)': 'uri-reference',} -"""Mapping of Slovak role names to canonical role names for interpreted text. -""" diff --git a/docutils/docutils/parsers/rst/languages/sv.py b/docutils/docutils/parsers/rst/languages/sv.py deleted file mode 100644 index 04d105f90..000000000 --- a/docutils/docutils/parsers/rst/languages/sv.py +++ /dev/null @@ -1,80 +0,0 @@ -# Author: Adam Chodorowski -# Contact: chodorowski@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -# New language mappings are welcome. Before doing a new translation, please -# read <http://docutils.sf.net/spec/howto/i18n.html>. Two files must be -# translated for each language: one in docutils/languages, the other in -# docutils/parsers/rst/languages. - -""" -Swedish language mappings for language-dependent features of reStructuredText. -""" - -__docformat__ = 'reStructuredText' - - -directives = { - u'observera': 'attention', - u'caution (translation required)': 'caution', - u'fara': 'danger', - u'fel': 'error', - u'v\u00e4gledning': 'hint', - u'viktigt': 'important', - u'notera': 'note', - u'tips': 'tip', - u'varning': 'warning', - u'admonition (translation required)': 'admonition', - u'sidebar (translation required)': 'sidebar', - u'\u00e4mne': 'topic', - u'line-block (translation required)': 'line-block', - u'parsed-literal (translation required)': 'parsed-literal', - u'mellanrubrik': 'rubric', - u'epigraph (translation required)': 'epigraph', - u'highlights (translation required)': 'highlights', - u'pull-quote (translation required)': 'pull-quote', - # u'fr\u00e5gor': 'questions', - # NOTE: A bit long, but recommended by http://www.nada.kth.se/dataterm/: - # u'fr\u00e5gor-och-svar': 'questions', - # u'vanliga-fr\u00e5gor': 'questions', - u'meta': 'meta', - # u'bildkarta': 'imagemap', # FIXME: Translation might be too literal. - u'bild': 'image', - u'figur': 'figure', - u'inkludera': 'include', - u'r\u00e5': 'raw', # FIXME: Translation might be too literal. - u'ers\u00e4tt': 'replace', - u'unicode': 'unicode', - u'class (translation required)': 'class', - u'inneh\u00e5ll': 'contents', - u'sektionsnumrering': 'sectnum', - u'target-notes (translation required)': 'target-notes', - # u'fotnoter': 'footnotes', - # u'citeringar': 'citations', - } -"""Swedish name to registered (in directives/__init__.py) directive name -mapping.""" - -roles = { - u'abbreviation (translation required)': 'abbreviation', - u'acronym (translation required)': 'acronym', - u'index (translation required)': 'index', - u'subscript (translation required)': 'subscript', - u'superscript (translation required)': 'superscript', - u'title-reference (translation required)': 'title-reference', - u'pep-reference (translation required)': 'pep-reference', - u'rfc-reference (translation required)': 'rfc-reference', - u'emphasis (translation required)': 'emphasis', - u'strong (translation required)': 'strong', - u'literal (translation required)': 'literal', - u'named-reference (translation required)': 'named-reference', - u'anonymous-reference (translation required)': 'anonymous-reference', - u'footnote-reference (translation required)': 'footnote-reference', - u'citation-reference (translation required)': 'citation-reference', - u'substitution-reference (translation required)': 'substitution-reference', - u'target (translation required)': 'target', - u'uri-reference (translation required)': 'uri-reference',} -"""Mapping of Swedish role names to canonical role names for interpreted text. -""" diff --git a/docutils/docutils/parsers/rst/states.py b/docutils/docutils/parsers/rst/states.py deleted file mode 100644 index c8d04325f..000000000 --- a/docutils/docutils/parsers/rst/states.py +++ /dev/null @@ -1,2913 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -This is the ``docutils.parsers.restructuredtext.states`` module, the core of -the reStructuredText parser. It defines the following: - -:Classes: - - `RSTStateMachine`: reStructuredText parser's entry point. - - `NestedStateMachine`: recursive StateMachine. - - `RSTState`: reStructuredText State superclass. - - `Inliner`: For parsing inline markup. - - `Body`: Generic classifier of the first line of a block. - - `SpecializedBody`: Superclass for compound element members. - - `BulletList`: Second and subsequent bullet_list list_items - - `DefinitionList`: Second+ definition_list_items. - - `EnumeratedList`: Second+ enumerated_list list_items. - - `FieldList`: Second+ fields. - - `OptionList`: Second+ option_list_items. - - `RFC2822List`: Second+ RFC2822-style fields. - - `ExtensionOptions`: Parses directive option fields. - - `Explicit`: Second+ explicit markup constructs. - - `SubstitutionDef`: For embedded directives in substitution definitions. - - `Text`: Classifier of second line of a text block. - - `SpecializedText`: Superclass for continuation lines of Text-variants. - - `Definition`: Second line of potential definition_list_item. - - `Line`: Second line of overlined section title or transition marker. - - `Struct`: An auxiliary collection class. - -:Exception classes: - - `MarkupError` - - `ParserError` - - `MarkupMismatch` - -:Functions: - - `escape2null()`: Return a string, escape-backslashes converted to nulls. - - `unescape()`: Return a string, nulls removed or restored to backslashes. - -:Attributes: - - `state_classes`: set of State classes used with `RSTStateMachine`. - -Parser Overview -=============== - -The reStructuredText parser is implemented as a recursive state machine, -examining its input one line at a time. To understand how the parser works, -please first become familiar with the `docutils.statemachine` module. In the -description below, references are made to classes defined in this module; -please see the individual classes for details. - -Parsing proceeds as follows: - -1. The state machine examines each line of input, checking each of the - transition patterns of the state `Body`, in order, looking for a match. - The implicit transitions (blank lines and indentation) are checked before - any others. The 'text' transition is a catch-all (matches anything). - -2. The method associated with the matched transition pattern is called. - - A. Some transition methods are self-contained, appending elements to the - document tree (`Body.doctest` parses a doctest block). The parser's - current line index is advanced to the end of the element, and parsing - continues with step 1. - - B. Other transition methods trigger the creation of a nested state machine, - whose job is to parse a compound construct ('indent' does a block quote, - 'bullet' does a bullet list, 'overline' does a section [first checking - for a valid section header], etc.). - - - In the case of lists and explicit markup, a one-off state machine is - created and run to parse contents of the first item. - - - A new state machine is created and its initial state is set to the - appropriate specialized state (`BulletList` in the case of the - 'bullet' transition; see `SpecializedBody` for more detail). This - state machine is run to parse the compound element (or series of - explicit markup elements), and returns as soon as a non-member element - is encountered. For example, the `BulletList` state machine ends as - soon as it encounters an element which is not a list item of that - bullet list. The optional omission of inter-element blank lines is - enabled by this nested state machine. - - - The current line index is advanced to the end of the elements parsed, - and parsing continues with step 1. - - C. The result of the 'text' transition depends on the next line of text. - The current state is changed to `Text`, under which the second line is - examined. If the second line is: - - - Indented: The element is a definition list item, and parsing proceeds - similarly to step 2.B, using the `DefinitionList` state. - - - A line of uniform punctuation characters: The element is a section - header; again, parsing proceeds as in step 2.B, and `Body` is still - used. - - - Anything else: The element is a paragraph, which is examined for - inline markup and appended to the parent element. Processing - continues with step 1. -""" - -__docformat__ = 'reStructuredText' - - -import sys -import re -import roman -from types import TupleType -from docutils import nodes, statemachine, utils, urischemes -from docutils import ApplicationError, DataError -from docutils.statemachine import StateMachineWS, StateWS -from docutils.nodes import fully_normalize_name as normalize_name -from docutils.parsers.rst import directives, languages, tableparser -from docutils.parsers.rst.languages import en as _fallback_language_module - - -class MarkupError(DataError): pass -class UnknownInterpretedRoleError(DataError): pass -class InterpretedRoleNotImplementedError(DataError): pass -class ParserError(ApplicationError): pass -class MarkupMismatch(Exception): pass - - -class Struct: - - """Stores data attributes for dotted-attribute access.""" - - def __init__(self, **keywordargs): - self.__dict__.update(keywordargs) - - -class RSTStateMachine(StateMachineWS): - - """ - reStructuredText's master StateMachine. - - The entry point to reStructuredText parsing is the `run()` method. - """ - - def run(self, input_lines, document, input_offset=0, match_titles=1, - inliner=None): - """ - Parse `input_lines` and return a `docutils.nodes.document` instance. - - Extend `StateMachineWS.run()`: set up parse-global data, run the - StateMachine, and return the resulting - document. - """ - self.language = languages.get_language( - document.settings.language_code) - self.match_titles = match_titles - if inliner is None: - inliner = Inliner() - inliner.init_customizations(document.settings) - self.memo = Struct(document=document, - reporter=document.reporter, - language=self.language, - title_styles=[], - section_level=0, - section_bubble_up_kludge=0, - inliner=inliner) - self.document = document - self.attach_observer(document.note_source) - self.reporter = self.memo.reporter - self.node = document - results = StateMachineWS.run(self, input_lines, input_offset, - input_source=document['source']) - assert results == [], 'RSTStateMachine.run() results should be empty!' - self.check_document() - self.node = self.memo = None # remove unneeded references - - def check_document(self): - """Check for illegal structure: empty document.""" - if len(self.document) == 0: - error = self.reporter.error( - 'Document empty; must have contents.', line=0) - self.document += error - - -class NestedStateMachine(StateMachineWS): - - """ - StateMachine run from within other StateMachine runs, to parse nested - document structures. - """ - - def run(self, input_lines, input_offset, memo, node, match_titles=1): - """ - Parse `input_lines` and populate a `docutils.nodes.document` instance. - - Extend `StateMachineWS.run()`: set up document-wide data. - """ - self.match_titles = match_titles - self.memo = memo - self.document = memo.document - self.attach_observer(self.document.note_source) - self.reporter = memo.reporter - self.node = node - results = StateMachineWS.run(self, input_lines, input_offset) - assert results == [], ('NestedStateMachine.run() results should be ' - 'empty!') - return results - - -class RSTState(StateWS): - - """ - reStructuredText State superclass. - - Contains methods used by all State subclasses. - """ - - nested_sm = NestedStateMachine - - def __init__(self, state_machine, debug=0): - self.nested_sm_kwargs = {'state_classes': state_classes, - 'initial_state': 'Body'} - StateWS.__init__(self, state_machine, debug) - - def runtime_init(self): - StateWS.runtime_init(self) - memo = self.state_machine.memo - self.memo = memo - self.reporter = memo.reporter - self.inliner = memo.inliner - self.document = memo.document - self.parent = self.state_machine.node - - def goto_line(self, abs_line_offset): - """ - Jump to input line `abs_line_offset`, ignoring jumps past the end. - """ - try: - self.state_machine.goto_line(abs_line_offset) - except EOFError: - pass - - def no_match(self, context, transitions): - """ - Override `StateWS.no_match` to generate a system message. - - This code should never be run. - """ - self.reporter.severe( - 'Internal error: no transition pattern match. State: "%s"; ' - 'transitions: %s; context: %s; current line: %r.' - % (self.__class__.__name__, transitions, context, - self.state_machine.line), - line=self.state_machine.abs_line_number()) - return context, None, [] - - def bof(self, context): - """Called at beginning of file.""" - return [], [] - - def nested_parse(self, block, input_offset, node, match_titles=0, - state_machine_class=None, state_machine_kwargs=None): - """ - Create a new StateMachine rooted at `node` and run it over the input - `block`. - """ - if state_machine_class is None: - state_machine_class = self.nested_sm - if state_machine_kwargs is None: - state_machine_kwargs = self.nested_sm_kwargs - block_length = len(block) - state_machine = state_machine_class(debug=self.debug, - **state_machine_kwargs) - state_machine.run(block, input_offset, memo=self.memo, - node=node, match_titles=match_titles) - state_machine.unlink() - new_offset = state_machine.abs_line_offset() - # Adjustment for block if modified in nested parse: - self.state_machine.next_line(len(block) - block_length) - return new_offset - - def nested_list_parse(self, block, input_offset, node, initial_state, - blank_finish, - blank_finish_state=None, - extra_settings={}, - match_titles=0, - state_machine_class=None, - state_machine_kwargs=None): - """ - Create a new StateMachine rooted at `node` and run it over the input - `block`. Also keep track of optional intermdediate blank lines and the - required final one. - """ - if state_machine_class is None: - state_machine_class = self.nested_sm - if state_machine_kwargs is None: - state_machine_kwargs = self.nested_sm_kwargs.copy() - state_machine_kwargs['initial_state'] = initial_state - state_machine = state_machine_class(debug=self.debug, - **state_machine_kwargs) - if blank_finish_state is None: - blank_finish_state = initial_state - state_machine.states[blank_finish_state].blank_finish = blank_finish - for key, value in extra_settings.items(): - setattr(state_machine.states[initial_state], key, value) - state_machine.run(block, input_offset, memo=self.memo, - node=node, match_titles=match_titles) - blank_finish = state_machine.states[blank_finish_state].blank_finish - state_machine.unlink() - return state_machine.abs_line_offset(), blank_finish - - def section(self, title, source, style, lineno, messages): - """Check for a valid subsection and create one if it checks out.""" - if self.check_subsection(source, style, lineno): - self.new_subsection(title, lineno, messages) - - def check_subsection(self, source, style, lineno): - """ - Check for a valid subsection header. Return 1 (true) or None (false). - - When a new section is reached that isn't a subsection of the current - section, back up the line count (use ``previous_line(-x)``), then - ``raise EOFError``. The current StateMachine will finish, then the - calling StateMachine can re-examine the title. This will work its way - back up the calling chain until the correct section level isreached. - - @@@ Alternative: Evaluate the title, store the title info & level, and - back up the chain until that level is reached. Store in memo? Or - return in results? - - :Exception: `EOFError` when a sibling or supersection encountered. - """ - memo = self.memo - title_styles = memo.title_styles - mylevel = memo.section_level - try: # check for existing title style - level = title_styles.index(style) + 1 - except ValueError: # new title style - if len(title_styles) == memo.section_level: # new subsection - title_styles.append(style) - return 1 - else: # not at lowest level - self.parent += self.title_inconsistent(source, lineno) - return None - if level <= mylevel: # sibling or supersection - memo.section_level = level # bubble up to parent section - if len(style) == 2: - memo.section_bubble_up_kludge = 1 - # back up 2 lines for underline title, 3 for overline title - self.state_machine.previous_line(len(style) + 1) - raise EOFError # let parent section re-evaluate - if level == mylevel + 1: # immediate subsection - return 1 - else: # invalid subsection - self.parent += self.title_inconsistent(source, lineno) - return None - - def title_inconsistent(self, sourcetext, lineno): - error = self.reporter.severe( - 'Title level inconsistent:', nodes.literal_block('', sourcetext), - line=lineno) - return error - - def new_subsection(self, title, lineno, messages): - """Append new subsection to document tree. On return, check level.""" - memo = self.memo - mylevel = memo.section_level - memo.section_level += 1 - section_node = nodes.section() - self.parent += section_node - textnodes, title_messages = self.inline_text(title, lineno) - titlenode = nodes.title(title, '', *textnodes) - name = normalize_name(titlenode.astext()) - section_node['name'] = name - section_node += titlenode - section_node += messages - section_node += title_messages - self.document.note_implicit_target(section_node, section_node) - offset = self.state_machine.line_offset + 1 - absoffset = self.state_machine.abs_line_offset() + 1 - newabsoffset = self.nested_parse( - self.state_machine.input_lines[offset:], input_offset=absoffset, - node=section_node, match_titles=1) - self.goto_line(newabsoffset) - self.check_section(section_node) - if memo.section_level <= mylevel: # can't handle next section? - raise EOFError # bubble up to supersection - # reset section_level; next pass will detect it properly - memo.section_level = mylevel - - def check_section(self, section): - """ - Check for illegal structure: empty section, misplaced transitions. - """ - lineno = section.line - if len(section) <= 1: - error = self.reporter.error( - 'Section empty; must have contents.', line=lineno) - section += error - return - if not isinstance(section[0], nodes.title): # shouldn't ever happen - error = self.reporter.error( - 'First element of section must be a title.', line=lineno) - section.insert(0, error) - if isinstance(section[1], nodes.transition): - error = self.reporter.error( - 'Section may not begin with a transition.', - line=section[1].line) - section.insert(1, error) - if len(section) > 2 and isinstance(section[-1], nodes.transition): - error = self.reporter.error( - 'Section may not end with a transition.', - line=section[-1].line) - section += error - - def paragraph(self, lines, lineno): - """ - Return a list (paragraph & messages) & a boolean: literal_block next? - """ - data = '\n'.join(lines).rstrip() - if data[-2:] == '::': - if len(data) == 2: - return [], 1 - elif data[-3] in ' \n': - text = data[:-3].rstrip() - else: - text = data[:-1] - literalnext = 1 - else: - text = data - literalnext = 0 - textnodes, messages = self.inline_text(text, lineno) - p = nodes.paragraph(data, '', *textnodes) - p.line = lineno - return [p] + messages, literalnext - - def inline_text(self, text, lineno): - """ - Return 2 lists: nodes (text and inline elements), and system_messages. - """ - return self.inliner.parse(text, lineno, self.memo, self.parent) - - def unindent_warning(self, node_name): - return self.reporter.warning( - '%s ends without a blank line; unexpected unindent.' % node_name, - line=(self.state_machine.abs_line_number() + 1)) - - -def build_regexp(definition, compile=1): - """ - Build, compile and return a regular expression based on `definition`. - - :Parameter: `definition`: a 4-tuple (group name, prefix, suffix, parts), - where "parts" is a list of regular expressions and/or regular - expression definitions to be joined into an or-group. - """ - name, prefix, suffix, parts = definition - part_strings = [] - for part in parts: - if type(part) is TupleType: - part_strings.append(build_regexp(part, None)) - else: - part_strings.append(part) - or_group = '|'.join(part_strings) - regexp = '%(prefix)s(?P<%(name)s>%(or_group)s)%(suffix)s' % locals() - if compile: - return re.compile(regexp, re.UNICODE) - else: - return regexp - - -class Inliner: - - """ - Parse inline markup; call the `parse()` method. - """ - - _interpreted_roles = { - # Values of ``None`` mean "not implemented yet": - 'title-reference': 'generic_interpreted_role', - 'abbreviation': 'generic_interpreted_role', - 'acronym': 'generic_interpreted_role', - 'index': None, - 'subscript': 'generic_interpreted_role', - 'superscript': 'generic_interpreted_role', - 'emphasis': 'generic_interpreted_role', - 'strong': 'generic_interpreted_role', - 'literal': 'generic_interpreted_role', - 'named-reference': None, - 'anonymous-reference': None, - 'uri-reference': None, - 'pep-reference': 'pep_reference_role', - 'rfc-reference': 'rfc_reference_role', - 'footnote-reference': None, - 'citation-reference': None, - 'substitution-reference': None, - 'target': None, - 'restructuredtext-unimplemented-role': None} - """Mapping of canonical interpreted text role name to method name. - Initializes a name to bound-method mapping in `__init__`.""" - - default_interpreted_role = 'title-reference' - """The role to use when no explicit role is given. - Override in subclasses.""" - - generic_roles = {'abbreviation': nodes.abbreviation, - 'acronym': nodes.acronym, - 'emphasis': nodes.emphasis, - 'literal': nodes.literal, - 'strong': nodes.strong, - 'subscript': nodes.subscript, - 'superscript': nodes.superscript, - 'title-reference': nodes.title_reference,} - """Mapping of canonical interpreted text role name to node class. - Used by the `generic_interpreted_role` method for simple, straightforward - roles (simple wrapping; no extra processing).""" - - def __init__(self, roles=None): - """ - `roles` is a mapping of canonical role name to role function or bound - method, which enables additional interpreted text roles. - """ - - self.implicit_dispatch = [(self.patterns.uri, self.standalone_uri),] - """List of (pattern, bound method) tuples, used by - `self.implicit_inline`.""" - - self.interpreted_roles = {} - """Mapping of canonical role name to role function or bound method. - Items removed from this mapping will be disabled.""" - - for canonical, method in self._interpreted_roles.items(): - if method: - self.interpreted_roles[canonical] = getattr(self, method) - else: - self.interpreted_roles[canonical] = None - self.interpreted_roles.update(roles or {}) - - def init_customizations(self, settings): - """Setting-based customizations; run when parsing begins.""" - if settings.pep_references: - self.implicit_dispatch.append((self.patterns.pep, - self.pep_reference)) - if settings.rfc_references: - self.implicit_dispatch.append((self.patterns.rfc, - self.rfc_reference)) - - def parse(self, text, lineno, memo, parent): - """ - Return 2 lists: nodes (text and inline elements), and system_messages. - - Using `self.patterns.initial`, a pattern which matches start-strings - (emphasis, strong, interpreted, phrase reference, literal, - substitution reference, and inline target) and complete constructs - (simple reference, footnote reference), search for a candidate. When - one is found, check for validity (e.g., not a quoted '*' character). - If valid, search for the corresponding end string if applicable, and - check it for validity. If not found or invalid, generate a warning - and ignore the start-string. Implicit inline markup (e.g. standalone - URIs) is found last. - """ - self.reporter = memo.reporter - self.document = memo.document - self.language = memo.language - self.parent = parent - pattern_search = self.patterns.initial.search - dispatch = self.dispatch - remaining = escape2null(text) - processed = [] - unprocessed = [] - messages = [] - while remaining: - match = pattern_search(remaining) - if match: - groups = match.groupdict() - method = dispatch[groups['start'] or groups['backquote'] - or groups['refend'] or groups['fnend']] - before, inlines, remaining, sysmessages = method(self, match, - lineno) - unprocessed.append(before) - messages += sysmessages - if inlines: - processed += self.implicit_inline(''.join(unprocessed), - lineno) - processed += inlines - unprocessed = [] - else: - break - remaining = ''.join(unprocessed) + remaining - if remaining: - processed += self.implicit_inline(remaining, lineno) - return processed, messages - - openers = '\'"([{<' - closers = '\'")]}>' - start_string_prefix = (r'((?<=^)|(?<=[-/: \n%s]))' % re.escape(openers)) - end_string_suffix = (r'((?=$)|(?=[-/:.,;!? \n\x00%s]))' - % re.escape(closers)) - non_whitespace_before = r'(?<![ \n])' - non_whitespace_escape_before = r'(?<![ \n\x00])' - non_whitespace_after = r'(?![ \n])' - # Alphanumerics with isolated internal [-._] chars (i.e. not 2 together): - simplename = r'(?:(?!_)\w)+(?:[-._](?:(?!_)\w)+)*' - # Valid URI characters (see RFC 2396 & RFC 2732): - uric = r"""[-_.!~*'()[\];/:@&=+$,%a-zA-Z0-9]""" - # Last URI character; same as uric but no punctuation: - urilast = r"""[_~/a-zA-Z0-9]""" - emailc = r"""[-_!~*'{|}/#?^`&=+$%a-zA-Z0-9]""" - email_pattern = r""" - %(emailc)s+(?:\.%(emailc)s+)* # name - @ # at - %(emailc)s+(?:\.%(emailc)s*)* # host - %(urilast)s # final URI char - """ - parts = ('initial_inline', start_string_prefix, '', - [('start', '', non_whitespace_after, # simple start-strings - [r'\*\*', # strong - r'\*(?!\*)', # emphasis but not strong - r'``', # literal - r'_`', # inline internal target - r'\|(?!\|)'] # substitution reference - ), - ('whole', '', end_string_suffix, # whole constructs - [# reference name & end-string - r'(?P<refname>%s)(?P<refend>__?)' % simplename, - ('footnotelabel', r'\[', r'(?P<fnend>\]_)', - [r'[0-9]+', # manually numbered - r'\#(%s)?' % simplename, # auto-numbered (w/ label?) - r'\*', # auto-symbol - r'(?P<citationlabel>%s)' % simplename] # citation reference - ) - ] - ), - ('backquote', # interpreted text or phrase reference - '(?P<role>(:%s:)?)' % simplename, # optional role - non_whitespace_after, - ['`(?!`)'] # but not literal - ) - ] - ) - patterns = Struct( - initial=build_regexp(parts), - emphasis=re.compile(non_whitespace_escape_before - + r'(\*)' + end_string_suffix), - strong=re.compile(non_whitespace_escape_before - + r'(\*\*)' + end_string_suffix), - interpreted_or_phrase_ref=re.compile( - r""" - %(non_whitespace_escape_before)s - ( - ` - (?P<suffix> - (?P<role>:%(simplename)s:)? - (?P<refend>__?)? - ) - ) - %(end_string_suffix)s - """ % locals(), re.VERBOSE | re.UNICODE), - embedded_uri=re.compile( - r""" - ( - [ \n]+ # spaces or beginning of line - < # open bracket - %(non_whitespace_after)s - ([^<>\0]+) # anything but angle brackets & nulls - %(non_whitespace_before)s - > # close bracket w/o whitespace before - ) - $ # end of string - """ % locals(), re.VERBOSE), - literal=re.compile(non_whitespace_before + '(``)' - + end_string_suffix), - target=re.compile(non_whitespace_escape_before - + r'(`)' + end_string_suffix), - substitution_ref=re.compile(non_whitespace_escape_before - + r'(\|_{0,2})' - + end_string_suffix), - email=re.compile(email_pattern % locals() + '$', re.VERBOSE), - uri=re.compile( - (r""" - %(start_string_prefix)s - (?P<whole> - (?P<absolute> # absolute URI - (?P<scheme> # scheme (http, ftp, mailto) - [a-zA-Z][a-zA-Z0-9.+-]* - ) - : - ( - ( # either: - (//?)? # hierarchical URI - %(uric)s* # URI characters - %(urilast)s # final URI char - ) - ( # optional query - \?%(uric)s* - %(urilast)s - )? - ( # optional fragment - \#%(uric)s* - %(urilast)s - )? - ) - ) - | # *OR* - (?P<email> # email address - """ + email_pattern + r""" - ) - ) - %(end_string_suffix)s - """) % locals(), re.VERBOSE), - pep=re.compile( - r""" - %(start_string_prefix)s - ( - (pep-(?P<pepnum1>\d+)(.txt)?) # reference to source file - | - (PEP\s+(?P<pepnum2>\d+)) # reference by name - ) - %(end_string_suffix)s""" % locals(), re.VERBOSE), - rfc=re.compile( - r""" - %(start_string_prefix)s - (RFC(-|\s+)?(?P<rfcnum>\d+)) - %(end_string_suffix)s""" % locals(), re.VERBOSE)) - - def quoted_start(self, match): - """Return 1 if inline markup start-string is 'quoted', 0 if not.""" - string = match.string - start = match.start() - end = match.end() - if start == 0: # start-string at beginning of text - return 0 - prestart = string[start - 1] - try: - poststart = string[end] - if self.openers.index(prestart) \ - == self.closers.index(poststart): # quoted - return 1 - except IndexError: # start-string at end of text - return 1 - except ValueError: # not quoted - pass - return 0 - - def inline_obj(self, match, lineno, end_pattern, nodeclass, - restore_backslashes=0): - string = match.string - matchstart = match.start('start') - matchend = match.end('start') - if self.quoted_start(match): - return (string[:matchend], [], string[matchend:], [], '') - endmatch = end_pattern.search(string[matchend:]) - if endmatch and endmatch.start(1): # 1 or more chars - text = unescape(endmatch.string[:endmatch.start(1)], - restore_backslashes) - textend = matchend + endmatch.end(1) - rawsource = unescape(string[matchstart:textend], 1) - return (string[:matchstart], [nodeclass(rawsource, text)], - string[textend:], [], endmatch.group(1)) - msg = self.reporter.warning( - 'Inline %s start-string without end-string.' - % nodeclass.__name__, line=lineno) - text = unescape(string[matchstart:matchend], 1) - rawsource = unescape(string[matchstart:matchend], 1) - prb = self.problematic(text, rawsource, msg) - return string[:matchstart], [prb], string[matchend:], [msg], '' - - def problematic(self, text, rawsource, message): - msgid = self.document.set_id(message, self.parent) - problematic = nodes.problematic(rawsource, text, refid=msgid) - prbid = self.document.set_id(problematic) - message.add_backref(prbid) - return problematic - - def emphasis(self, match, lineno): - before, inlines, remaining, sysmessages, endstring = self.inline_obj( - match, lineno, self.patterns.emphasis, nodes.emphasis) - return before, inlines, remaining, sysmessages - - def strong(self, match, lineno): - before, inlines, remaining, sysmessages, endstring = self.inline_obj( - match, lineno, self.patterns.strong, nodes.strong) - return before, inlines, remaining, sysmessages - - def interpreted_or_phrase_ref(self, match, lineno): - end_pattern = self.patterns.interpreted_or_phrase_ref - string = match.string - matchstart = match.start('backquote') - matchend = match.end('backquote') - rolestart = match.start('role') - role = match.group('role') - position = '' - if role: - role = role[1:-1] - position = 'prefix' - elif self.quoted_start(match): - return (string[:matchend], [], string[matchend:], []) - endmatch = end_pattern.search(string[matchend:]) - if endmatch and endmatch.start(1): # 1 or more chars - textend = matchend + endmatch.end() - if endmatch.group('role'): - if role: - msg = self.reporter.warning( - 'Multiple roles in interpreted text (both ' - 'prefix and suffix present; only one allowed).', - line=lineno) - text = unescape(string[rolestart:textend], 1) - prb = self.problematic(text, text, msg) - return string[:rolestart], [prb], string[textend:], [msg] - role = endmatch.group('suffix')[1:-1] - position = 'suffix' - escaped = endmatch.string[:endmatch.start(1)] - text = unescape(escaped, 0) - rawsource = unescape(string[matchstart:textend], 1) - if rawsource[-1:] == '_': - if role: - msg = self.reporter.warning( - 'Mismatch: both interpreted text role %s and ' - 'reference suffix.' % position, line=lineno) - text = unescape(string[rolestart:textend], 1) - prb = self.problematic(text, text, msg) - return string[:rolestart], [prb], string[textend:], [msg] - return self.phrase_ref(string[:matchstart], string[textend:], - rawsource, escaped, text) - else: - try: - return self.interpreted( - string[:rolestart], string[textend:], - rawsource, text, role, lineno) - except UnknownInterpretedRoleError, detail: - msg = self.reporter.error( - 'Unknown interpreted text role "%s".' % role, - line=lineno) - text = unescape(string[rolestart:textend], 1) - prb = self.problematic(text, text, msg) - return (string[:rolestart], [prb], string[textend:], - detail.args[0] + [msg]) - except InterpretedRoleNotImplementedError, detail: - msg = self.reporter.error( - 'Interpreted text role "%s" not implemented.' % role, - line=lineno) - text = unescape(string[rolestart:textend], 1) - prb = self.problematic(text, text, msg) - return (string[:rolestart], [prb], string[textend:], - detail.args[0] + [msg]) - msg = self.reporter.warning( - 'Inline interpreted text or phrase reference start-string ' - 'without end-string.', line=lineno) - text = unescape(string[matchstart:matchend], 1) - prb = self.problematic(text, text, msg) - return string[:matchstart], [prb], string[matchend:], [msg] - - def phrase_ref(self, before, after, rawsource, escaped, text): - match = self.patterns.embedded_uri.search(escaped) - if match: - text = unescape(escaped[:match.start(0)]) - uri_text = match.group(2) - uri = ''.join(uri_text.split()) - uri = self.adjust_uri(uri) - if uri: - target = nodes.target(match.group(1), refuri=uri) - else: - raise ApplicationError('problem with URI: %r' % uri_text) - else: - target = None - refname = normalize_name(text) - reference = nodes.reference(rawsource, text) - node_list = [reference] - if rawsource[-2:] == '__': - if target: - reference['refuri'] = uri - else: - reference['anonymous'] = 1 - self.document.note_anonymous_ref(reference) - else: - if target: - reference['refuri'] = uri - target['name'] = refname - self.document.note_external_target(target) - self.document.note_explicit_target(target, self.parent) - node_list.append(target) - else: - reference['refname'] = refname - self.document.note_refname(reference) - return before, node_list, after, [] - - def adjust_uri(self, uri): - match = self.patterns.email.match(uri) - if match: - return 'mailto:' + uri - else: - return uri - - def interpreted(self, before, after, rawsource, text, role, lineno): - role_function, canonical, messages = self.get_role_function(role, - lineno) - if role_function: - nodelist, messages2 = role_function(canonical, rawsource, text, - lineno) - messages.extend(messages2) - return before, nodelist, after, messages - else: - raise InterpretedRoleNotImplementedError(messages) - - def get_role_function(self, role, lineno): - messages = [] - msg_text = [] - if role: - name = role.lower() - else: - name = self.default_interpreted_role - canonical = None - try: - canonical = self.language.roles[name] - except AttributeError, error: - msg_text.append('Problem retrieving role entry from language ' - 'module %r: %s.' % (self.language, error)) - except KeyError: - msg_text.append('No role entry for "%s" in module "%s".' - % (name, self.language.__name__)) - if not canonical: - try: - canonical = _fallback_language_module.roles[name] - msg_text.append('Using English fallback for role "%s".' - % name) - except KeyError: - msg_text.append('Trying "%s" as canonical role name.' - % name) - # Should be an English name, but just in case: - canonical = name - if msg_text: - message = self.reporter.info('\n'.join(msg_text), line=lineno) - messages.append(message) - try: - return self.interpreted_roles[canonical], canonical, messages - except KeyError: - raise UnknownInterpretedRoleError(messages) - - def literal(self, match, lineno): - before, inlines, remaining, sysmessages, endstring = self.inline_obj( - match, lineno, self.patterns.literal, nodes.literal, - restore_backslashes=1) - return before, inlines, remaining, sysmessages - - def inline_internal_target(self, match, lineno): - before, inlines, remaining, sysmessages, endstring = self.inline_obj( - match, lineno, self.patterns.target, nodes.target) - if inlines and isinstance(inlines[0], nodes.target): - assert len(inlines) == 1 - target = inlines[0] - name = normalize_name(target.astext()) - target['name'] = name - self.document.note_explicit_target(target, self.parent) - return before, inlines, remaining, sysmessages - - def substitution_reference(self, match, lineno): - before, inlines, remaining, sysmessages, endstring = self.inline_obj( - match, lineno, self.patterns.substitution_ref, - nodes.substitution_reference) - if len(inlines) == 1: - subref_node = inlines[0] - if isinstance(subref_node, nodes.substitution_reference): - subref_text = subref_node.astext() - self.document.note_substitution_ref(subref_node, subref_text) - if endstring[-1:] == '_': - reference_node = nodes.reference( - '|%s%s' % (subref_text, endstring), '') - if endstring[-2:] == '__': - reference_node['anonymous'] = 1 - self.document.note_anonymous_ref( - reference_node) - else: - reference_node['refname'] = normalize_name(subref_text) - self.document.note_refname(reference_node) - reference_node += subref_node - inlines = [reference_node] - return before, inlines, remaining, sysmessages - - def footnote_reference(self, match, lineno): - """ - Handles `nodes.footnote_reference` and `nodes.citation_reference` - elements. - """ - label = match.group('footnotelabel') - refname = normalize_name(label) - string = match.string - before = string[:match.start('whole')] - remaining = string[match.end('whole'):] - if match.group('citationlabel'): - refnode = nodes.citation_reference('[%s]_' % label, - refname=refname) - refnode += nodes.Text(label) - self.document.note_citation_ref(refnode) - else: - refnode = nodes.footnote_reference('[%s]_' % label) - if refname[0] == '#': - refname = refname[1:] - refnode['auto'] = 1 - self.document.note_autofootnote_ref(refnode) - elif refname == '*': - refname = '' - refnode['auto'] = '*' - self.document.note_symbol_footnote_ref( - refnode) - else: - refnode += nodes.Text(label) - if refname: - refnode['refname'] = refname - self.document.note_footnote_ref(refnode) - if self.document.settings.trim_footnote_reference_space: - before = before.rstrip() - return (before, [refnode], remaining, []) - - def reference(self, match, lineno, anonymous=None): - referencename = match.group('refname') - refname = normalize_name(referencename) - referencenode = nodes.reference(referencename + match.group('refend'), - referencename) - if anonymous: - referencenode['anonymous'] = 1 - self.document.note_anonymous_ref(referencenode) - else: - referencenode['refname'] = refname - self.document.note_refname(referencenode) - string = match.string - matchstart = match.start('whole') - matchend = match.end('whole') - return (string[:matchstart], [referencenode], string[matchend:], []) - - def anonymous_reference(self, match, lineno): - return self.reference(match, lineno, anonymous=1) - - def standalone_uri(self, match, lineno): - if not match.group('scheme') or urischemes.schemes.has_key( - match.group('scheme').lower()): - if match.group('email'): - addscheme = 'mailto:' - else: - addscheme = '' - text = match.group('whole') - unescaped = unescape(text, 0) - return [nodes.reference(unescape(text, 1), unescaped, - refuri=addscheme + unescaped)] - else: # not a valid scheme - raise MarkupMismatch - - pep_url_local = 'pep-%04d.html' - pep_url_absolute = 'http://www.python.org/peps/pep-%04d.html' - pep_url = pep_url_absolute - - def pep_reference(self, match, lineno): - text = match.group(0) - if text.startswith('pep-'): - pepnum = int(match.group('pepnum1')) - elif text.startswith('PEP'): - pepnum = int(match.group('pepnum2')) - else: - raise MarkupMismatch - ref = self.pep_url % pepnum - unescaped = unescape(text, 0) - return [nodes.reference(unescape(text, 1), unescaped, refuri=ref)] - - rfc_url = 'http://www.faqs.org/rfcs/rfc%d.html' - - def rfc_reference(self, match, lineno): - text = match.group(0) - if text.startswith('RFC'): - rfcnum = int(match.group('rfcnum')) - ref = self.rfc_url % rfcnum - else: - raise MarkupMismatch - unescaped = unescape(text, 0) - return [nodes.reference(unescape(text, 1), unescaped, refuri=ref)] - - def implicit_inline(self, text, lineno): - """ - Check each of the patterns in `self.implicit_dispatch` for a match, - and dispatch to the stored method for the pattern. Recursively check - the text before and after the match. Return a list of `nodes.Text` - and inline element nodes. - """ - if not text: - return [] - for pattern, method in self.implicit_dispatch: - match = pattern.search(text) - if match: - try: - # Must recurse on strings before *and* after the match; - # there may be multiple patterns. - return (self.implicit_inline(text[:match.start()], lineno) - + method(match, lineno) + - self.implicit_inline(text[match.end():], lineno)) - except MarkupMismatch: - pass - return [nodes.Text(unescape(text), rawsource=unescape(text, 1))] - - dispatch = {'*': emphasis, - '**': strong, - '`': interpreted_or_phrase_ref, - '``': literal, - '_`': inline_internal_target, - ']_': footnote_reference, - '|': substitution_reference, - '_': reference, - '__': anonymous_reference} - - def generic_interpreted_role(self, role, rawtext, text, lineno): - try: - role_class = self.generic_roles[role] - except KeyError: - msg = self.reporter.error('Unknown interpreted text role: "%s".' - % role, line=lineno) - prb = self.problematic(text, text, msg) - return [prb], [msg] - return [role_class(rawtext, text)], [] - - def pep_reference_role(self, role, rawtext, text, lineno): - try: - pepnum = int(text) - if pepnum < 0 or pepnum > 9999: - raise ValueError - except ValueError: - msg = self.reporter.error( - 'PEP number must be a number from 0 to 9999; "%s" is invalid.' - % text, line=lineno) - prb = self.problematic(text, text, msg) - return [prb], [msg] - ref = self.pep_url % pepnum - return [nodes.reference(rawtext, 'PEP ' + text, refuri=ref)], [] - - def rfc_reference_role(self, role, rawtext, text, lineno): - try: - rfcnum = int(text) - if rfcnum <= 0: - raise ValueError - except ValueError: - msg = self.reporter.error( - 'RFC number must be a number greater than or equal to 1; ' - '"%s" is invalid.' % text, line=lineno) - prb = self.problematic(text, text, msg) - return [prb], [msg] - ref = self.rfc_url % rfcnum - return [nodes.reference(rawtext, 'RFC ' + text, refuri=ref)], [] - - -class Body(RSTState): - - """ - Generic classifier of the first line of a block. - """ - - enum = Struct() - """Enumerated list parsing information.""" - - enum.formatinfo = { - 'parens': Struct(prefix='(', suffix=')', start=1, end=-1), - 'rparen': Struct(prefix='', suffix=')', start=0, end=-1), - 'period': Struct(prefix='', suffix='.', start=0, end=-1)} - enum.formats = enum.formatinfo.keys() - enum.sequences = ['arabic', 'loweralpha', 'upperalpha', - 'lowerroman', 'upperroman'] # ORDERED! - enum.sequencepats = {'arabic': '[0-9]+', - 'loweralpha': '[a-z]', - 'upperalpha': '[A-Z]', - 'lowerroman': '[ivxlcdm]+', - 'upperroman': '[IVXLCDM]+',} - enum.converters = {'arabic': int, - 'loweralpha': - lambda s, zero=(ord('a')-1): ord(s) - zero, - 'upperalpha': - lambda s, zero=(ord('A')-1): ord(s) - zero, - 'lowerroman': - lambda s: roman.fromRoman(s.upper()), - 'upperroman': roman.fromRoman} - - enum.sequenceregexps = {} - for sequence in enum.sequences: - enum.sequenceregexps[sequence] = re.compile( - enum.sequencepats[sequence] + '$') - - grid_table_top_pat = re.compile(r'\+-[-+]+-\+ *$') - """Matches the top (& bottom) of a full table).""" - - simple_table_top_pat = re.compile('=+( +=+)+ *$') - """Matches the top of a simple table.""" - - simple_table_border_pat = re.compile('=+[ =]*$') - """Matches the bottom & header bottom of a simple table.""" - - pats = {} - """Fragments of patterns used by transitions.""" - - pats['nonalphanum7bit'] = '[!-/:-@[-`{-~]' - pats['alpha'] = '[a-zA-Z]' - pats['alphanum'] = '[a-zA-Z0-9]' - pats['alphanumplus'] = '[a-zA-Z0-9_-]' - pats['enum'] = ('(%(arabic)s|%(loweralpha)s|%(upperalpha)s|%(lowerroman)s' - '|%(upperroman)s)' % enum.sequencepats) - pats['optname'] = '%(alphanum)s%(alphanumplus)s*' % pats - # @@@ Loosen up the pattern? Allow Unicode? - pats['optarg'] = '%(alpha)s%(alphanumplus)s*' % pats - pats['option'] = r'(--?|\+|/)%(optname)s([ =]%(optarg)s)?' % pats - - for format in enum.formats: - pats[format] = '(?P<%s>%s%s%s)' % ( - format, re.escape(enum.formatinfo[format].prefix), - pats['enum'], re.escape(enum.formatinfo[format].suffix)) - - patterns = { - 'bullet': r'[-+*]( +|$)', - 'enumerator': r'(%(parens)s|%(rparen)s|%(period)s)( +|$)' % pats, - 'field_marker': r':[^: ]([^:]*[^: ])?:( +|$)', - 'option_marker': r'%(option)s(, %(option)s)*( +| ?$)' % pats, - 'doctest': r'>>>( +|$)', - 'grid_table_top': grid_table_top_pat, - 'simple_table_top': simple_table_top_pat, - 'explicit_markup': r'\.\.( +|$)', - 'anonymous': r'__( +|$)', - 'line': r'(%(nonalphanum7bit)s)\1* *$' % pats, - 'text': r''} - initial_transitions = ( - 'bullet', - 'enumerator', - 'field_marker', - 'option_marker', - 'doctest', - 'grid_table_top', - 'simple_table_top', - 'explicit_markup', - 'anonymous', - 'line', - 'text') - - def indent(self, match, context, next_state): - """Block quote.""" - indented, indent, line_offset, blank_finish = \ - self.state_machine.get_indented() - blockquote, messages = self.block_quote(indented, line_offset) - self.parent += blockquote - self.parent += messages - if not blank_finish: - self.parent += self.unindent_warning('Block quote') - return context, next_state, [] - - def block_quote(self, indented, line_offset): - blockquote_lines, attribution_lines, attribution_offset = \ - self.check_attribution(indented, line_offset) - blockquote = nodes.block_quote() - self.nested_parse(blockquote_lines, line_offset, blockquote) - messages = [] - if attribution_lines: - attribution, messages = self.parse_attribution(attribution_lines, - attribution_offset) - blockquote += attribution - return blockquote, messages - - attribution_pattern = re.compile(r'--(?![-\n]) *(?=[^ \n])') - - def check_attribution(self, indented, line_offset): - """ - Check for an attribution in the last contiguous block of `indented`. - - * First line after last blank line must begin with "--" (etc.). - * Every line after that must have consistent indentation. - - Return a 3-tuple: (block quote lines, attribution lines, - attribution offset). - """ - blank = None - nonblank_seen = None - indent = 0 - for i in range(len(indented) - 1, 0, -1): # don't check first line - this_line_blank = not indented[i].strip() - if nonblank_seen and this_line_blank: - match = self.attribution_pattern.match(indented[i + 1]) - if match: - blank = i - break - elif not this_line_blank: - nonblank_seen = 1 - if blank and len(indented) - blank > 2: # multi-line attribution - indent = (len(indented[blank + 2]) - - len(indented[blank + 2].lstrip())) - for j in range(blank + 3, len(indented)): - if indent != (len(indented[j]) - - len(indented[j].lstrip())): # bad shape - blank = None - break - if blank: - a_lines = indented[blank + 1:] - a_lines.strip_indent(match.end(), end=1) - a_lines.strip_indent(indent, start=1) - return (indented[:blank], a_lines, line_offset + blank + 1) - else: - return (indented, None, None) - - def parse_attribution(self, indented, line_offset): - text = '\n'.join(indented).rstrip() - lineno = self.state_machine.abs_line_number() + line_offset - textnodes, messages = self.inline_text(text, lineno) - node = nodes.attribution(text, '', *textnodes) - node.line = lineno - return node, messages - - def bullet(self, match, context, next_state): - """Bullet list item.""" - bulletlist = nodes.bullet_list() - self.parent += bulletlist - bulletlist['bullet'] = match.string[0] - i, blank_finish = self.list_item(match.end()) - bulletlist += i - offset = self.state_machine.line_offset + 1 # next line - newline_offset, blank_finish = self.nested_list_parse( - self.state_machine.input_lines[offset:], - input_offset=self.state_machine.abs_line_offset() + 1, - node=bulletlist, initial_state='BulletList', - blank_finish=blank_finish) - self.goto_line(newline_offset) - if not blank_finish: - self.parent += self.unindent_warning('Bullet list') - return [], next_state, [] - - def list_item(self, indent): - indented, line_offset, blank_finish = \ - self.state_machine.get_known_indented(indent) - listitem = nodes.list_item('\n'.join(indented)) - if indented: - self.nested_parse(indented, input_offset=line_offset, - node=listitem) - return listitem, blank_finish - - def enumerator(self, match, context, next_state): - """Enumerated List Item""" - format, sequence, text, ordinal = self.parse_enumerator(match) - if not self.is_enumerated_list_item(ordinal, sequence, format): - raise statemachine.TransitionCorrection('text') - if ordinal != 1: - msg = self.reporter.info( - 'Enumerated list start value not ordinal-1: "%s" (ordinal %s)' - % (text, ordinal), line=self.state_machine.abs_line_number()) - self.parent += msg - enumlist = nodes.enumerated_list() - self.parent += enumlist - enumlist['enumtype'] = sequence - if ordinal != 1: - enumlist['start'] = ordinal - enumlist['prefix'] = self.enum.formatinfo[format].prefix - enumlist['suffix'] = self.enum.formatinfo[format].suffix - listitem, blank_finish = self.list_item(match.end()) - enumlist += listitem - offset = self.state_machine.line_offset + 1 # next line - newline_offset, blank_finish = self.nested_list_parse( - self.state_machine.input_lines[offset:], - input_offset=self.state_machine.abs_line_offset() + 1, - node=enumlist, initial_state='EnumeratedList', - blank_finish=blank_finish, - extra_settings={'lastordinal': ordinal, 'format': format}) - self.goto_line(newline_offset) - if not blank_finish: - self.parent += self.unindent_warning('Enumerated list') - return [], next_state, [] - - def parse_enumerator(self, match, expected_sequence=None): - """ - Analyze an enumerator and return the results. - - :Return: - - the enumerator format ('period', 'parens', or 'rparen'), - - the sequence used ('arabic', 'loweralpha', 'upperroman', etc.), - - the text of the enumerator, stripped of formatting, and - - the ordinal value of the enumerator ('a' -> 1, 'ii' -> 2, etc.; - ``None`` is returned for invalid enumerator text). - - The enumerator format has already been determined by the regular - expression match. If `expected_sequence` is given, that sequence is - tried first. If not, we check for Roman numeral 1. This way, - single-character Roman numerals (which are also alphabetical) can be - matched. If no sequence has been matched, all sequences are checked in - order. - """ - groupdict = match.groupdict() - sequence = '' - for format in self.enum.formats: - if groupdict[format]: # was this the format matched? - break # yes; keep `format` - else: # shouldn't happen - raise ParserError('enumerator format not matched') - text = groupdict[format][self.enum.formatinfo[format].start - :self.enum.formatinfo[format].end] - if expected_sequence: - try: - if self.enum.sequenceregexps[expected_sequence].match(text): - sequence = expected_sequence - except KeyError: # shouldn't happen - raise ParserError('unknown enumerator sequence: %s' - % sequence) - elif text == 'i': - sequence = 'lowerroman' - elif text == 'I': - sequence = 'upperroman' - if not sequence: - for sequence in self.enum.sequences: - if self.enum.sequenceregexps[sequence].match(text): - break - else: # shouldn't happen - raise ParserError('enumerator sequence not matched') - try: - ordinal = self.enum.converters[sequence](text) - except roman.InvalidRomanNumeralError: - ordinal = None - return format, sequence, text, ordinal - - def is_enumerated_list_item(self, ordinal, sequence, format): - """ - Check validity based on the ordinal value and the second line. - - Return true iff the ordinal is valid and the second line is blank, - indented, or starts with the next enumerator. - """ - if ordinal is None: - return None - try: - next_line = self.state_machine.next_line() - except EOFError: # end of input lines - self.state_machine.previous_line() - return 1 - else: - self.state_machine.previous_line() - if not next_line[:1].strip(): # blank or indented - return 1 - next_enumerator = self.make_enumerator(ordinal + 1, sequence, format) - try: - if next_line.startswith(next_enumerator): - return 1 - except TypeError: - pass - return None - - def make_enumerator(self, ordinal, sequence, format): - """ - Construct and return an enumerated list item marker. - - Return ``None`` for invalid (out of range) ordinals. - """ - if sequence == 'arabic': - enumerator = str(ordinal) - else: - if sequence.endswith('alpha'): - if ordinal > 26: - return None - enumerator = chr(ordinal + ord('a') - 1) - elif sequence.endswith('roman'): - try: - enumerator = roman.toRoman(ordinal) - except roman.RomanError: - return None - else: # shouldn't happen - raise ParserError('unknown enumerator sequence: "%s"' - % sequence) - if sequence.startswith('lower'): - enumerator = enumerator.lower() - elif sequence.startswith('upper'): - enumerator = enumerator.upper() - else: # shouldn't happen - raise ParserError('unknown enumerator sequence: "%s"' - % sequence) - formatinfo = self.enum.formatinfo[format] - return formatinfo.prefix + enumerator + formatinfo.suffix + ' ' - - def field_marker(self, match, context, next_state): - """Field list item.""" - fieldlist = nodes.field_list() - self.parent += fieldlist - field, blank_finish = self.field(match) - fieldlist += field - offset = self.state_machine.line_offset + 1 # next line - newline_offset, blank_finish = self.nested_list_parse( - self.state_machine.input_lines[offset:], - input_offset=self.state_machine.abs_line_offset() + 1, - node=fieldlist, initial_state='FieldList', - blank_finish=blank_finish) - self.goto_line(newline_offset) - if not blank_finish: - self.parent += self.unindent_warning('Field list') - return [], next_state, [] - - def field(self, match): - name = self.parse_field_marker(match) - lineno = self.state_machine.abs_line_number() - indented, indent, line_offset, blank_finish = \ - self.state_machine.get_first_known_indented(match.end()) - fieldnode = nodes.field() - fieldnode.line = lineno - fieldnode += nodes.field_name(name, name) - fieldbody = nodes.field_body('\n'.join(indented)) - fieldnode += fieldbody - if indented: - self.parse_field_body(indented, line_offset, fieldbody) - return fieldnode, blank_finish - - def parse_field_marker(self, match): - """Extract & return field name from a field marker match.""" - field = match.string[1:] # strip off leading ':' - field = field[:field.find(':')] # strip off trailing ':' etc. - return field - - def parse_field_body(self, indented, offset, node): - self.nested_parse(indented, input_offset=offset, node=node) - - def option_marker(self, match, context, next_state): - """Option list item.""" - optionlist = nodes.option_list() - try: - listitem, blank_finish = self.option_list_item(match) - except MarkupError, (message, lineno): - # This shouldn't happen; pattern won't match. - msg = self.reporter.error( - 'Invalid option list marker: %s' % message, line=lineno) - self.parent += msg - indented, indent, line_offset, blank_finish = \ - self.state_machine.get_first_known_indented(match.end()) - blockquote, messages = self.block_quote(indented, line_offset) - self.parent += blockquote - self.parent += messages - if not blank_finish: - self.parent += self.unindent_warning('Option list') - return [], next_state, [] - self.parent += optionlist - optionlist += listitem - offset = self.state_machine.line_offset + 1 # next line - newline_offset, blank_finish = self.nested_list_parse( - self.state_machine.input_lines[offset:], - input_offset=self.state_machine.abs_line_offset() + 1, - node=optionlist, initial_state='OptionList', - blank_finish=blank_finish) - self.goto_line(newline_offset) - if not blank_finish: - self.parent += self.unindent_warning('Option list') - return [], next_state, [] - - def option_list_item(self, match): - offset = self.state_machine.abs_line_offset() - options = self.parse_option_marker(match) - indented, indent, line_offset, blank_finish = \ - self.state_machine.get_first_known_indented(match.end()) - if not indented: # not an option list item - self.goto_line(offset) - raise statemachine.TransitionCorrection('text') - option_group = nodes.option_group('', *options) - description = nodes.description('\n'.join(indented)) - option_list_item = nodes.option_list_item('', option_group, - description) - if indented: - self.nested_parse(indented, input_offset=line_offset, - node=description) - return option_list_item, blank_finish - - def parse_option_marker(self, match): - """ - Return a list of `node.option` and `node.option_argument` objects, - parsed from an option marker match. - - :Exception: `MarkupError` for invalid option markers. - """ - optlist = [] - optionstrings = match.group().rstrip().split(', ') - for optionstring in optionstrings: - tokens = optionstring.split() - delimiter = ' ' - firstopt = tokens[0].split('=') - if len(firstopt) > 1: - tokens[:1] = firstopt - delimiter = '=' - if 0 < len(tokens) <= 2: - option = nodes.option(optionstring) - option += nodes.option_string(tokens[0], tokens[0]) - if len(tokens) > 1: - option += nodes.option_argument(tokens[1], tokens[1], - delimiter=delimiter) - optlist.append(option) - else: - raise MarkupError( - 'wrong numer of option tokens (=%s), should be 1 or 2: ' - '"%s"' % (len(tokens), optionstring), - self.state_machine.abs_line_number() + 1) - return optlist - - def doctest(self, match, context, next_state): - data = '\n'.join(self.state_machine.get_text_block()) - self.parent += nodes.doctest_block(data, data) - return [], next_state, [] - - def grid_table_top(self, match, context, next_state): - """Top border of a full table.""" - return self.table_top(match, context, next_state, - self.isolate_grid_table, - tableparser.GridTableParser) - - def simple_table_top(self, match, context, next_state): - """Top border of a simple table.""" - return self.table_top(match, context, next_state, - self.isolate_simple_table, - tableparser.SimpleTableParser) - - def table_top(self, match, context, next_state, - isolate_function, parser_class): - """Top border of a generic table.""" - nodelist, blank_finish = self.table(isolate_function, parser_class) - self.parent += nodelist - if not blank_finish: - msg = self.reporter.warning( - 'Blank line required after table.', - line=self.state_machine.abs_line_number() + 1) - self.parent += msg - return [], next_state, [] - - def table(self, isolate_function, parser_class): - """Parse a table.""" - block, messages, blank_finish = isolate_function() - if block: - try: - parser = parser_class() - tabledata = parser.parse(block) - tableline = (self.state_machine.abs_line_number() - len(block) - + 1) - table = self.build_table(tabledata, tableline) - nodelist = [table] + messages - except tableparser.TableMarkupError, detail: - nodelist = self.malformed_table(block, str(detail)) + messages - else: - nodelist = messages - return nodelist, blank_finish - - def isolate_grid_table(self): - messages = [] - blank_finish = 1 - try: - block = self.state_machine.get_text_block(flush_left=1) - except statemachine.UnexpectedIndentationError, instance: - block, source, lineno = instance.args - messages.append(self.reporter.error('Unexpected indentation.', - source=source, line=lineno)) - blank_finish = 0 - block.disconnect() - width = len(block[0].strip()) - for i in range(len(block)): - block[i] = block[i].strip() - if block[i][0] not in '+|': # check left edge - blank_finish = 0 - self.state_machine.previous_line(len(block) - i) - del block[i:] - break - if not self.grid_table_top_pat.match(block[-1]): # find bottom - blank_finish = 0 - # from second-last to third line of table: - for i in range(len(block) - 2, 1, -1): - if self.grid_table_top_pat.match(block[i]): - self.state_machine.previous_line(len(block) - i + 1) - del block[i+1:] - break - else: - messages.extend(self.malformed_table(block)) - return [], messages, blank_finish - for i in range(len(block)): # check right edge - if len(block[i]) != width or block[i][-1] not in '+|': - messages.extend(self.malformed_table(block)) - return [], messages, blank_finish - return block, messages, blank_finish - - def isolate_simple_table(self): - start = self.state_machine.line_offset - lines = self.state_machine.input_lines - limit = len(lines) - 1 - toplen = len(lines[start].strip()) - pattern_match = self.simple_table_border_pat.match - found = 0 - found_at = None - i = start + 1 - while i <= limit: - line = lines[i] - match = pattern_match(line) - if match: - if len(line.strip()) != toplen: - self.state_machine.next_line(i - start) - messages = self.malformed_table( - lines[start:i+1], 'Bottom/header table border does ' - 'not match top border.') - return [], messages, i == limit or not lines[i+1].strip() - found += 1 - found_at = i - if found == 2 or i == limit or not lines[i+1].strip(): - end = i - break - i += 1 - else: # reached end of input_lines - if found: - extra = ' or no blank line after table bottom' - self.state_machine.next_line(found_at - start) - block = lines[start:found_at+1] - else: - extra = '' - self.state_machine.next_line(i - start - 1) - block = lines[start:] - messages = self.malformed_table( - block, 'No bottom table border found%s.' % extra) - return [], messages, not extra - self.state_machine.next_line(end - start) - block = lines[start:end+1] - return block, [], end == limit or not lines[end+1].strip() - - def malformed_table(self, block, detail=''): - data = '\n'.join(block) - message = 'Malformed table.' - lineno = self.state_machine.abs_line_number() - len(block) + 1 - if detail: - message += '\n' + detail - error = self.reporter.error(message, nodes.literal_block(data, data), - line=lineno) - return [error] - - def build_table(self, tabledata, tableline): - colspecs, headrows, bodyrows = tabledata - table = nodes.table() - tgroup = nodes.tgroup(cols=len(colspecs)) - table += tgroup - for colspec in colspecs: - tgroup += nodes.colspec(colwidth=colspec) - if headrows: - thead = nodes.thead() - tgroup += thead - for row in headrows: - thead += self.build_table_row(row, tableline) - tbody = nodes.tbody() - tgroup += tbody - for row in bodyrows: - tbody += self.build_table_row(row, tableline) - return table - - def build_table_row(self, rowdata, tableline): - row = nodes.row() - for cell in rowdata: - if cell is None: - continue - morerows, morecols, offset, cellblock = cell - attributes = {} - if morerows: - attributes['morerows'] = morerows - if morecols: - attributes['morecols'] = morecols - entry = nodes.entry(**attributes) - row += entry - if ''.join(cellblock): - self.nested_parse(cellblock, input_offset=tableline+offset, - node=entry) - return row - - - explicit = Struct() - """Patterns and constants used for explicit markup recognition.""" - - explicit.patterns = Struct( - target=re.compile(r""" - ( - _ # anonymous target - | # *OR* - (?P<quote>`?) # optional open quote - (?![ `]) # first char. not space or - # backquote - (?P<name> # reference name - .+? - ) - %(non_whitespace_escape_before)s - (?P=quote) # close quote if open quote used - ) - %(non_whitespace_escape_before)s - [ ]? # optional space - : # end of reference name - ([ ]+|$) # followed by whitespace - """ % vars(Inliner), re.VERBOSE), - reference=re.compile(r""" - ( - (?P<simple>%(simplename)s)_ - | # *OR* - ` # open backquote - (?![ ]) # not space - (?P<phrase>.+?) # hyperlink phrase - %(non_whitespace_escape_before)s - `_ # close backquote, - # reference mark - ) - $ # end of string - """ % vars(Inliner), re.VERBOSE | re.UNICODE), - substitution=re.compile(r""" - ( - (?![ ]) # first char. not space - (?P<name>.+?) # substitution text - %(non_whitespace_escape_before)s - \| # close delimiter - ) - ([ ]+|$) # followed by whitespace - """ % vars(Inliner), re.VERBOSE),) - - def footnote(self, match): - lineno = self.state_machine.abs_line_number() - indented, indent, offset, blank_finish = \ - self.state_machine.get_first_known_indented(match.end()) - label = match.group(1) - name = normalize_name(label) - footnote = nodes.footnote('\n'.join(indented)) - footnote.line = lineno - if name[0] == '#': # auto-numbered - name = name[1:] # autonumber label - footnote['auto'] = 1 - if name: - footnote['name'] = name - self.document.note_autofootnote(footnote) - elif name == '*': # auto-symbol - name = '' - footnote['auto'] = '*' - self.document.note_symbol_footnote(footnote) - else: # manually numbered - footnote += nodes.label('', label) - footnote['name'] = name - self.document.note_footnote(footnote) - if name: - self.document.note_explicit_target(footnote, footnote) - else: - self.document.set_id(footnote, footnote) - if indented: - self.nested_parse(indented, input_offset=offset, node=footnote) - return [footnote], blank_finish - - def citation(self, match): - lineno = self.state_machine.abs_line_number() - indented, indent, offset, blank_finish = \ - self.state_machine.get_first_known_indented(match.end()) - label = match.group(1) - name = normalize_name(label) - citation = nodes.citation('\n'.join(indented)) - citation.line = lineno - citation += nodes.label('', label) - citation['name'] = name - self.document.note_citation(citation) - self.document.note_explicit_target(citation, citation) - if indented: - self.nested_parse(indented, input_offset=offset, node=citation) - return [citation], blank_finish - - def hyperlink_target(self, match): - pattern = self.explicit.patterns.target - lineno = self.state_machine.abs_line_number() - block, indent, offset, blank_finish = \ - self.state_machine.get_first_known_indented( - match.end(), until_blank=1, strip_indent=0) - blocktext = match.string[:match.end()] + '\n'.join(block) - block = [escape2null(line) for line in block] - escaped = block[0] - blockindex = 0 - while 1: - targetmatch = pattern.match(escaped) - if targetmatch: - break - blockindex += 1 - try: - escaped += block[blockindex] - except IndexError: - raise MarkupError('malformed hyperlink target.', lineno) - del block[:blockindex] - block[0] = (block[0] + ' ')[targetmatch.end()-len(escaped)-1:].strip() - if block and block[-1].strip()[-1:] == '_': # possible indirect target - reference = ' '.join([line.strip() for line in block]) - refname = self.is_reference(reference) - if refname: - target = nodes.target(blocktext, '', refname=refname) - target.line = lineno - self.add_target(targetmatch.group('name'), '', target) - self.document.note_indirect_target(target) - return [target], blank_finish - nodelist = [] - reference = ''.join([line.strip() for line in block]) - if reference.find(' ') != -1: - warning = self.reporter.warning( - 'Hyperlink target contains whitespace. Perhaps a footnote ' - 'was intended?', - nodes.literal_block(blocktext, blocktext), line=lineno) - nodelist.append(warning) - else: - unescaped = unescape(reference) - target = nodes.target(blocktext, '') - target.line = lineno - self.add_target(targetmatch.group('name'), unescaped, target) - nodelist.append(target) - return nodelist, blank_finish - - def is_reference(self, reference): - match = self.explicit.patterns.reference.match( - normalize_name(reference)) - if not match: - return None - return unescape(match.group('simple') or match.group('phrase')) - - def add_target(self, targetname, refuri, target): - if targetname: - name = normalize_name(unescape(targetname)) - target['name'] = name - if refuri: - uri = self.inliner.adjust_uri(refuri) - if uri: - target['refuri'] = uri - self.document.note_external_target(target) - else: - raise ApplicationError('problem with URI: %r' % refuri) - else: - self.document.note_internal_target(target) - self.document.note_explicit_target(target, self.parent) - else: # anonymous target - if refuri: - target['refuri'] = refuri - target['anonymous'] = 1 - self.document.note_anonymous_target(target) - - def substitution_def(self, match): - pattern = self.explicit.patterns.substitution - lineno = self.state_machine.abs_line_number() - block, indent, offset, blank_finish = \ - self.state_machine.get_first_known_indented(match.end(), - strip_indent=0) - blocktext = (match.string[:match.end()] + '\n'.join(block)) - block.disconnect() - for i in range(len(block)): - block[i] = escape2null(block[i]) - escaped = block[0].rstrip() - blockindex = 0 - while 1: - subdefmatch = pattern.match(escaped) - if subdefmatch: - break - blockindex += 1 - try: - escaped = escaped + ' ' + block[blockindex].strip() - except IndexError: - raise MarkupError('malformed substitution definition.', - lineno) - del block[:blockindex] # strip out the substitution marker - block[0] = (block[0] + ' ')[subdefmatch.end()-len(escaped)-1:].strip() - if not block[0]: - del block[0] - offset += 1 - while block and not block[-1].strip(): - block.pop() - subname = subdefmatch.group('name') - substitution_node = nodes.substitution_definition(blocktext) - substitution_node.line = lineno - self.document.note_substitution_def( - substitution_node,subname, self.parent) - if block: - block[0] = block[0].strip() - new_abs_offset, blank_finish = self.nested_list_parse( - block, input_offset=offset, node=substitution_node, - initial_state='SubstitutionDef', blank_finish=blank_finish) - i = 0 - for node in substitution_node[:]: - if not (isinstance(node, nodes.Inline) or - isinstance(node, nodes.Text)): - self.parent += substitution_node[i] - del substitution_node[i] - else: - i += 1 - if len(substitution_node) == 0: - msg = self.reporter.warning( - 'Substitution definition "%s" empty or invalid.' - % subname, - nodes.literal_block(blocktext, blocktext), line=lineno) - return [msg], blank_finish - else: - return [substitution_node], blank_finish - else: - msg = self.reporter.warning( - 'Substitution definition "%s" missing contents.' % subname, - nodes.literal_block(blocktext, blocktext), line=lineno) - return [msg], blank_finish - - def directive(self, match, **option_presets): - type_name = match.group(1) - directive_function, messages = directives.directive( - type_name, self.memo.language, self.document) - self.parent += messages - if directive_function: - return self.parse_directive( - directive_function, match, type_name, option_presets) - else: - return self.unknown_directive(type_name) - - def parse_directive(self, directive_fn, match, type_name, option_presets): - """ - Parse a directive then run its directive function. - - Parameters: - - - `directive_fn`: The function implementing the directive. Uses - function attributes ``arguments``, ``options``, and/or ``content`` - if present. - - - `match`: A regular expression match object which matched the first - line of the directive. - - - `type_name`: The directive name, as used in the source text. - - - `option_presets`: A dictionary of preset options, defaults for the - directive options. Currently, only an "alt" option is passed by - substitution definitions (value: the substitution name), which may - be used by an embedded image directive. - - Returns a 2-tuple: list of nodes, and a "blank finish" boolean. - """ - arguments = [] - options = {} - argument_spec = getattr(directive_fn, 'arguments', None) - if argument_spec and argument_spec[:2] == (0, 0): - argument_spec = None - option_spec = getattr(directive_fn, 'options', None) - content_spec = getattr(directive_fn, 'content', None) - lineno = self.state_machine.abs_line_number() - initial_line_offset = self.state_machine.line_offset - indented, indent, line_offset, blank_finish \ - = self.state_machine.get_first_known_indented(match.end(), - strip_top=0) - block_text = '\n'.join(self.state_machine.input_lines[ - initial_line_offset : self.state_machine.line_offset + 1]) - if indented and not indented[0].strip(): - indented.trim_start() - line_offset += 1 - while indented and not indented[-1].strip(): - indented.trim_end() - if indented and (argument_spec or option_spec): - for i in range(len(indented)): - if not indented[i].strip(): - break - else: - i += 1 - arg_block = indented[:i] - content = indented[i+1:] - content_offset = line_offset + i + 1 - else: - content = indented - content_offset = line_offset - arg_block = [] - while content and not content[0].strip(): - content.trim_start() - content_offset += 1 - try: - if option_spec: - options, arg_block = self.parse_directive_options( - option_presets, option_spec, arg_block) - if argument_spec: - arguments = self.parse_directive_arguments(argument_spec, - arg_block) - if content and not content_spec: - raise MarkupError('no content permitted') - except MarkupError, detail: - error = self.reporter.error( - 'Error in "%s" directive:\n%s.' % (type_name, detail), - nodes.literal_block(block_text, block_text), line=lineno) - return [error], blank_finish - result = directive_fn( - type_name, arguments, options, content, lineno, content_offset, - block_text, self, self.state_machine) - return result, blank_finish or self.state_machine.is_next_line_blank() - - def parse_directive_options(self, option_presets, option_spec, arg_block): - options = option_presets.copy() - for i in range(len(arg_block)): - if arg_block[i][:1] == ':': - opt_block = arg_block[i:] - arg_block = arg_block[:i] - break - else: - opt_block = [] - if opt_block: - success, data = self.parse_extension_options(option_spec, - opt_block) - if success: # data is a dict of options - options.update(data) - else: # data is an error string - raise MarkupError(data) - return options, arg_block - - def parse_directive_arguments(self, argument_spec, arg_block): - required, optional, last_whitespace = argument_spec - arg_text = '\n'.join(arg_block) - arguments = arg_text.split() - if len(arguments) < required: - raise MarkupError('%s argument(s) required, %s supplied' - % (required, len(arguments))) - elif len(arguments) > required + optional: - if last_whitespace: - arguments = arg_text.split(None, required + optional - 1) - else: - raise MarkupError( - 'maximum %s argument(s) allowed, %s supplied' - % (required + optional, len(arguments))) - return arguments - - def parse_extension_options(self, option_spec, datalines): - """ - Parse `datalines` for a field list containing extension options - matching `option_spec`. - - :Parameters: - - `option_spec`: a mapping of option name to conversion - function, which should raise an exception on bad input. - - `datalines`: a list of input strings. - - :Return: - - Success value, 1 or 0. - - An option dictionary on success, an error string on failure. - """ - node = nodes.field_list() - newline_offset, blank_finish = self.nested_list_parse( - datalines, 0, node, initial_state='ExtensionOptions', - blank_finish=1) - if newline_offset != len(datalines): # incomplete parse of block - return 0, 'invalid option block' - try: - options = utils.extract_extension_options(node, option_spec) - except KeyError, detail: - return 0, ('unknown option: "%s"' % detail.args[0]) - except (ValueError, TypeError), detail: - return 0, ('invalid option value: %s' % detail) - except utils.ExtensionOptionError, detail: - return 0, ('invalid option data: %s' % detail) - if blank_finish: - return 1, options - else: - return 0, 'option data incompletely parsed' - - def unknown_directive(self, type_name): - lineno = self.state_machine.abs_line_number() - indented, indent, offset, blank_finish = \ - self.state_machine.get_first_known_indented(0, strip_indent=0) - text = '\n'.join(indented) - error = self.reporter.error( - 'Unknown directive type "%s".' % type_name, - nodes.literal_block(text, text), line=lineno) - return [error], blank_finish - - def comment(self, match): - if not match.string[match.end():].strip() \ - and self.state_machine.is_next_line_blank(): # an empty comment? - return [nodes.comment()], 1 # "A tiny but practical wart." - indented, indent, offset, blank_finish = \ - self.state_machine.get_first_known_indented(match.end()) - while indented and not indented[-1].strip(): - indented.trim_end() - text = '\n'.join(indented) - return [nodes.comment(text, text)], blank_finish - - explicit.constructs = [ - (footnote, - re.compile(r""" - \.\.[ ]+ # explicit markup start - \[ - ( # footnote label: - [0-9]+ # manually numbered footnote - | # *OR* - \# # anonymous auto-numbered footnote - | # *OR* - \#%s # auto-number ed?) footnote label - | # *OR* - \* # auto-symbol footnote - ) - \] - ([ ]+|$) # whitespace or end of line - """ % Inliner.simplename, re.VERBOSE | re.UNICODE)), - (citation, - re.compile(r""" - \.\.[ ]+ # explicit markup start - \[(%s)\] # citation label - ([ ]+|$) # whitespace or end of line - """ % Inliner.simplename, re.VERBOSE | re.UNICODE)), - (hyperlink_target, - re.compile(r""" - \.\.[ ]+ # explicit markup start - _ # target indicator - (?![ ]) # first char. not space - """, re.VERBOSE)), - (substitution_def, - re.compile(r""" - \.\.[ ]+ # explicit markup start - \| # substitution indicator - (?![ ]) # first char. not space - """, re.VERBOSE)), - (directive, - re.compile(r""" - \.\.[ ]+ # explicit markup start - (%s) # directive name - [ ]? # optional space - :: # directive delimiter - ([ ]+|$) # whitespace or end of line - """ % Inliner.simplename, re.VERBOSE | re.UNICODE))] - - def explicit_markup(self, match, context, next_state): - """Footnotes, hyperlink targets, directives, comments.""" - nodelist, blank_finish = self.explicit_construct(match) - self.parent += nodelist - self.explicit_list(blank_finish) - return [], next_state, [] - - def explicit_construct(self, match): - """Determine which explicit construct this is, parse & return it.""" - errors = [] - for method, pattern in self.explicit.constructs: - expmatch = pattern.match(match.string) - if expmatch: - try: - return method(self, expmatch) - except MarkupError, (message, lineno): # never reached? - errors.append(self.reporter.warning(message, line=lineno)) - break - nodelist, blank_finish = self.comment(match) - return nodelist + errors, blank_finish - - def explicit_list(self, blank_finish): - """ - Create a nested state machine for a series of explicit markup - constructs (including anonymous hyperlink targets). - """ - offset = self.state_machine.line_offset + 1 # next line - newline_offset, blank_finish = self.nested_list_parse( - self.state_machine.input_lines[offset:], - input_offset=self.state_machine.abs_line_offset() + 1, - node=self.parent, initial_state='Explicit', - blank_finish=blank_finish, - match_titles=self.state_machine.match_titles) - self.goto_line(newline_offset) - if not blank_finish: - self.parent += self.unindent_warning('Explicit markup') - - def anonymous(self, match, context, next_state): - """Anonymous hyperlink targets.""" - nodelist, blank_finish = self.anonymous_target(match) - self.parent += nodelist - self.explicit_list(blank_finish) - return [], next_state, [] - - def anonymous_target(self, match): - block, indent, offset, blank_finish \ - = self.state_machine.get_first_known_indented(match.end(), - until_blank=1) - blocktext = match.string[:match.end()] + '\n'.join(block) - if block and block[-1].strip()[-1:] == '_': # possible indirect target - reference = escape2null(' '.join([line.strip() - for line in block])) - refname = self.is_reference(reference) - if refname: - target = nodes.target(blocktext, '', refname=refname, - anonymous=1) - self.document.note_anonymous_target(target) - self.document.note_indirect_target(target) - return [target], blank_finish - nodelist = [] - reference = escape2null(''.join([line.strip() for line in block])) - if reference.find(' ') != -1: - lineno = self.state_machine.abs_line_number() - len(block) + 1 - warning = self.reporter.warning( - 'Anonymous hyperlink target contains whitespace. Perhaps a ' - 'footnote was intended?', - nodes.literal_block(blocktext, blocktext), - line=lineno) - nodelist.append(warning) - else: - target = nodes.target(blocktext, '', anonymous=1) - if reference: - unescaped = unescape(reference) - target['refuri'] = unescaped - self.document.note_anonymous_target(target) - nodelist.append(target) - return nodelist, blank_finish - - def line(self, match, context, next_state): - """Section title overline or transition marker.""" - if self.state_machine.match_titles: - return [match.string], 'Line', [] - elif match.string.strip() == '::': - raise statemachine.TransitionCorrection('text') - elif len(match.string.strip()) < 4: - msg = self.reporter.info( - 'Unexpected possible title overline or transition.\n' - "Treating it as ordinary text because it's so short.", - line=self.state_machine.abs_line_number()) - self.parent += msg - raise statemachine.TransitionCorrection('text') - else: - blocktext = self.state_machine.line - msg = self.reporter.severe( - 'Unexpected section title or transition.', - nodes.literal_block(blocktext, blocktext), - line=self.state_machine.abs_line_number()) - self.parent += msg - return [], next_state, [] - - def text(self, match, context, next_state): - """Titles, definition lists, paragraphs.""" - return [match.string], 'Text', [] - - -class RFC2822Body(Body): - - """ - RFC2822 headers are only valid as the first constructs in documents. As - soon as anything else appears, the `Body` state should take over. - """ - - patterns = Body.patterns.copy() # can't modify the original - patterns['rfc2822'] = r'[!-9;-~]+:( +|$)' - initial_transitions = [(name, 'Body') - for name in Body.initial_transitions] - initial_transitions.insert(-1, ('rfc2822', 'Body')) # just before 'text' - - def rfc2822(self, match, context, next_state): - """RFC2822-style field list item.""" - fieldlist = nodes.field_list(CLASS='rfc2822') - self.parent += fieldlist - field, blank_finish = self.rfc2822_field(match) - fieldlist += field - offset = self.state_machine.line_offset + 1 # next line - newline_offset, blank_finish = self.nested_list_parse( - self.state_machine.input_lines[offset:], - input_offset=self.state_machine.abs_line_offset() + 1, - node=fieldlist, initial_state='RFC2822List', - blank_finish=blank_finish) - self.goto_line(newline_offset) - if not blank_finish: - self.parent += self.unindent_warning( - 'RFC2822-style field list') - return [], next_state, [] - - def rfc2822_field(self, match): - name = match.string[:match.string.find(':')] - indented, indent, line_offset, blank_finish = \ - self.state_machine.get_first_known_indented(match.end(), - until_blank=1) - fieldnode = nodes.field() - fieldnode += nodes.field_name(name, name) - fieldbody = nodes.field_body('\n'.join(indented)) - fieldnode += fieldbody - if indented: - self.nested_parse(indented, input_offset=line_offset, - node=fieldbody) - return fieldnode, blank_finish - - -class SpecializedBody(Body): - - """ - Superclass for second and subsequent compound element members. Compound - elements are lists and list-like constructs. - - All transition methods are disabled (redefined as `invalid_input`). - Override individual methods in subclasses to re-enable. - - For example, once an initial bullet list item, say, is recognized, the - `BulletList` subclass takes over, with a "bullet_list" node as its - container. Upon encountering the initial bullet list item, `Body.bullet` - calls its ``self.nested_list_parse`` (`RSTState.nested_list_parse`), which - starts up a nested parsing session with `BulletList` as the initial state. - Only the ``bullet`` transition method is enabled in `BulletList`; as long - as only bullet list items are encountered, they are parsed and inserted - into the container. The first construct which is *not* a bullet list item - triggers the `invalid_input` method, which ends the nested parse and - closes the container. `BulletList` needs to recognize input that is - invalid in the context of a bullet list, which means everything *other - than* bullet list items, so it inherits the transition list created in - `Body`. - """ - - def invalid_input(self, match=None, context=None, next_state=None): - """Not a compound element member. Abort this state machine.""" - self.state_machine.previous_line() # back up so parent SM can reassess - raise EOFError - - indent = invalid_input - bullet = invalid_input - enumerator = invalid_input - field_marker = invalid_input - option_marker = invalid_input - doctest = invalid_input - grid_table_top = invalid_input - simple_table_top = invalid_input - explicit_markup = invalid_input - anonymous = invalid_input - line = invalid_input - text = invalid_input - - -class BulletList(SpecializedBody): - - """Second and subsequent bullet_list list_items.""" - - def bullet(self, match, context, next_state): - """Bullet list item.""" - if match.string[0] != self.parent['bullet']: - # different bullet: new list - self.invalid_input() - listitem, blank_finish = self.list_item(match.end()) - self.parent += listitem - self.blank_finish = blank_finish - return [], next_state, [] - - -class DefinitionList(SpecializedBody): - - """Second and subsequent definition_list_items.""" - - def text(self, match, context, next_state): - """Definition lists.""" - return [match.string], 'Definition', [] - - -class EnumeratedList(SpecializedBody): - - """Second and subsequent enumerated_list list_items.""" - - def enumerator(self, match, context, next_state): - """Enumerated list item.""" - format, sequence, text, ordinal = self.parse_enumerator( - match, self.parent['enumtype']) - if (sequence != self.parent['enumtype'] or - format != self.format or - ordinal != (self.lastordinal + 1) or - not self.is_enumerated_list_item(ordinal, sequence, format)): - # different enumeration: new list - self.invalid_input() - listitem, blank_finish = self.list_item(match.end()) - self.parent += listitem - self.blank_finish = blank_finish - self.lastordinal = ordinal - return [], next_state, [] - - -class FieldList(SpecializedBody): - - """Second and subsequent field_list fields.""" - - def field_marker(self, match, context, next_state): - """Field list field.""" - field, blank_finish = self.field(match) - self.parent += field - self.blank_finish = blank_finish - return [], next_state, [] - - -class OptionList(SpecializedBody): - - """Second and subsequent option_list option_list_items.""" - - def option_marker(self, match, context, next_state): - """Option list item.""" - try: - option_list_item, blank_finish = self.option_list_item(match) - except MarkupError, (message, lineno): - self.invalid_input() - self.parent += option_list_item - self.blank_finish = blank_finish - return [], next_state, [] - - -class RFC2822List(SpecializedBody, RFC2822Body): - - """Second and subsequent RFC2822-style field_list fields.""" - - patterns = RFC2822Body.patterns - initial_transitions = RFC2822Body.initial_transitions - - def rfc2822(self, match, context, next_state): - """RFC2822-style field list item.""" - field, blank_finish = self.rfc2822_field(match) - self.parent += field - self.blank_finish = blank_finish - return [], 'RFC2822List', [] - - blank = SpecializedBody.invalid_input - - -class ExtensionOptions(FieldList): - - """ - Parse field_list fields for extension options. - - No nested parsing is done (including inline markup parsing). - """ - - def parse_field_body(self, indented, offset, node): - """Override `Body.parse_field_body` for simpler parsing.""" - lines = [] - for line in list(indented) + ['']: - if line.strip(): - lines.append(line) - elif lines: - text = '\n'.join(lines) - node += nodes.paragraph(text, text) - lines = [] - - -class Explicit(SpecializedBody): - - """Second and subsequent explicit markup construct.""" - - def explicit_markup(self, match, context, next_state): - """Footnotes, hyperlink targets, directives, comments.""" - nodelist, blank_finish = self.explicit_construct(match) - self.parent += nodelist - self.blank_finish = blank_finish - return [], next_state, [] - - def anonymous(self, match, context, next_state): - """Anonymous hyperlink targets.""" - nodelist, blank_finish = self.anonymous_target(match) - self.parent += nodelist - self.blank_finish = blank_finish - return [], next_state, [] - - blank = SpecializedBody.invalid_input - - -class SubstitutionDef(Body): - - """ - Parser for the contents of a substitution_definition element. - """ - - patterns = { - 'embedded_directive': re.compile(r'(%s)::( +|$)' - % Inliner.simplename, re.UNICODE), - 'text': r''} - initial_transitions = ['embedded_directive', 'text'] - - def embedded_directive(self, match, context, next_state): - nodelist, blank_finish = self.directive(match, - alt=self.parent['name']) - self.parent += nodelist - if not self.state_machine.at_eof(): - self.blank_finish = blank_finish - raise EOFError - - def text(self, match, context, next_state): - if not self.state_machine.at_eof(): - self.blank_finish = self.state_machine.is_next_line_blank() - raise EOFError - - -class Text(RSTState): - - """ - Classifier of second line of a text block. - - Could be a paragraph, a definition list item, or a title. - """ - - patterns = {'underline': Body.patterns['line'], - 'text': r''} - initial_transitions = [('underline', 'Body'), ('text', 'Body')] - - def blank(self, match, context, next_state): - """End of paragraph.""" - paragraph, literalnext = self.paragraph( - context, self.state_machine.abs_line_number() - 1) - self.parent += paragraph - if literalnext: - self.parent += self.literal_block() - return [], 'Body', [] - - def eof(self, context): - if context: - self.blank(None, context, None) - return [] - - def indent(self, match, context, next_state): - """Definition list item.""" - definitionlist = nodes.definition_list() - definitionlistitem, blank_finish = self.definition_list_item(context) - definitionlist += definitionlistitem - self.parent += definitionlist - offset = self.state_machine.line_offset + 1 # next line - newline_offset, blank_finish = self.nested_list_parse( - self.state_machine.input_lines[offset:], - input_offset=self.state_machine.abs_line_offset() + 1, - node=definitionlist, initial_state='DefinitionList', - blank_finish=blank_finish, blank_finish_state='Definition') - self.goto_line(newline_offset) - if not blank_finish: - self.parent += self.unindent_warning('Definition list') - return [], 'Body', [] - - def underline(self, match, context, next_state): - """Section title.""" - lineno = self.state_machine.abs_line_number() - title = context[0].rstrip() - underline = match.string.rstrip() - source = title + '\n' + underline - messages = [] - if len(title) > len(underline): - if len(underline) < 4: - if self.state_machine.match_titles: - msg = self.reporter.info( - 'Possible title underline, too short for the title.\n' - "Treating it as ordinary text because it's so short.", - line=lineno) - self.parent += msg - raise statemachine.TransitionCorrection('text') - else: - blocktext = context[0] + '\n' + self.state_machine.line - msg = self.reporter.warning( - 'Title underline too short.', - nodes.literal_block(blocktext, blocktext), line=lineno) - messages.append(msg) - if not self.state_machine.match_titles: - blocktext = context[0] + '\n' + self.state_machine.line - msg = self.reporter.severe( - 'Unexpected section title.', - nodes.literal_block(blocktext, blocktext), line=lineno) - self.parent += messages - self.parent += msg - return [], next_state, [] - style = underline[0] - context[:] = [] - self.section(title, source, style, lineno - 1, messages) - return [], next_state, [] - - def text(self, match, context, next_state): - """Paragraph.""" - startline = self.state_machine.abs_line_number() - 1 - msg = None - try: - block = self.state_machine.get_text_block(flush_left=1) - except statemachine.UnexpectedIndentationError, instance: - block, source, lineno = instance.args - msg = self.reporter.error('Unexpected indentation.', - source=source, line=lineno) - lines = context + list(block) - paragraph, literalnext = self.paragraph(lines, startline) - self.parent += paragraph - self.parent += msg - if literalnext: - try: - self.state_machine.next_line() - except EOFError: - pass - self.parent += self.literal_block() - return [], next_state, [] - - def literal_block(self): - """Return a list of nodes.""" - indented, indent, offset, blank_finish = \ - self.state_machine.get_indented() - nodelist = [] - while indented and not indented[-1].strip(): - indented.trim_end() - if indented: - data = '\n'.join(indented) - nodelist.append(nodes.literal_block(data, data)) - if not blank_finish: - nodelist.append(self.unindent_warning('Literal block')) - else: - nodelist.append(self.reporter.warning( - 'Literal block expected; none found.', - line=self.state_machine.abs_line_number())) - return nodelist - - def definition_list_item(self, termline): - indented, indent, line_offset, blank_finish = \ - self.state_machine.get_indented() - definitionlistitem = nodes.definition_list_item( - '\n'.join(termline + list(indented))) - lineno = self.state_machine.abs_line_number() - 1 - definitionlistitem.line = lineno - termlist, messages = self.term(termline, lineno) - definitionlistitem += termlist - definition = nodes.definition('', *messages) - definitionlistitem += definition - if termline[0][-2:] == '::': - definition += self.reporter.info( - 'Blank line missing before literal block? Interpreted as a ' - 'definition list item.', line=line_offset + 1) - self.nested_parse(indented, input_offset=line_offset, node=definition) - return definitionlistitem, blank_finish - - def term(self, lines, lineno): - """Return a definition_list's term and optional classifier.""" - assert len(lines) == 1 - text_nodes, messages = self.inline_text(lines[0], lineno) - term_node = nodes.term() - node_list = [term_node] - for i in range(len(text_nodes)): - node = text_nodes[i] - if isinstance(node, nodes.Text): - parts = node.rawsource.split(' : ', 1) - if len(parts) == 1: - term_node += node - else: - term_node += nodes.Text(parts[0].rstrip()) - classifier_node = nodes.classifier('', parts[1]) - classifier_node += text_nodes[i+1:] - node_list.append(classifier_node) - break - else: - term_node += node - return node_list, messages - - -class SpecializedText(Text): - - """ - Superclass for second and subsequent lines of Text-variants. - - All transition methods are disabled. Override individual methods in - subclasses to re-enable. - """ - - def eof(self, context): - """Incomplete construct.""" - return [] - - def invalid_input(self, match=None, context=None, next_state=None): - """Not a compound element member. Abort this state machine.""" - raise EOFError - - blank = invalid_input - indent = invalid_input - underline = invalid_input - text = invalid_input - - -class Definition(SpecializedText): - - """Second line of potential definition_list_item.""" - - def eof(self, context): - """Not a definition.""" - self.state_machine.previous_line(2) # so parent SM can reassess - return [] - - def indent(self, match, context, next_state): - """Definition list item.""" - definitionlistitem, blank_finish = self.definition_list_item(context) - self.parent += definitionlistitem - self.blank_finish = blank_finish - return [], 'DefinitionList', [] - - -class Line(SpecializedText): - - """ - Second line of over- & underlined section title or transition marker. - """ - - eofcheck = 1 # @@@ ??? - """Set to 0 while parsing sections, so that we don't catch the EOF.""" - - def eof(self, context): - """Transition marker at end of section or document.""" - marker = context[0].strip() - if self.memo.section_bubble_up_kludge: - self.memo.section_bubble_up_kludge = 0 - elif len(marker) < 4: - self.state_correction(context) - if self.eofcheck: # ignore EOFError with sections - lineno = self.state_machine.abs_line_number() - 1 - transition = nodes.transition(context[0]) - transition.line = lineno - self.parent += transition - msg = self.reporter.error( - 'Document or section may not end with a transition.', - line=lineno) - self.parent += msg - self.eofcheck = 1 - return [] - - def blank(self, match, context, next_state): - """Transition marker.""" - lineno = self.state_machine.abs_line_number() - 1 - marker = context[0].strip() - if len(marker) < 4: - self.state_correction(context) - transition = nodes.transition(marker) - transition.line = lineno - if len(self.parent) == 0: - msg = self.reporter.error( - 'Document or section may not begin with a transition.', - line=lineno) - self.parent += msg - elif isinstance(self.parent[-1], nodes.transition): - msg = self.reporter.error( - 'At least one body element must separate transitions; ' - 'adjacent transitions not allowed.', - line=lineno) - self.parent += msg - self.parent += transition - return [], 'Body', [] - - def text(self, match, context, next_state): - """Potential over- & underlined title.""" - lineno = self.state_machine.abs_line_number() - 1 - overline = context[0] - title = match.string - underline = '' - try: - underline = self.state_machine.next_line() - except EOFError: - blocktext = overline + '\n' + title - if len(overline.rstrip()) < 4: - self.short_overline(context, blocktext, lineno, 2) - else: - msg = self.reporter.severe( - 'Incomplete section title.', - nodes.literal_block(blocktext, blocktext), line=lineno) - self.parent += msg - return [], 'Body', [] - source = '%s\n%s\n%s' % (overline, title, underline) - overline = overline.rstrip() - underline = underline.rstrip() - if not self.transitions['underline'][0].match(underline): - blocktext = overline + '\n' + title + '\n' + underline - if len(overline.rstrip()) < 4: - self.short_overline(context, blocktext, lineno, 2) - else: - msg = self.reporter.severe( - 'Missing matching underline for section title overline.', - nodes.literal_block(source, source), line=lineno) - self.parent += msg - return [], 'Body', [] - elif overline != underline: - blocktext = overline + '\n' + title + '\n' + underline - if len(overline.rstrip()) < 4: - self.short_overline(context, blocktext, lineno, 2) - else: - msg = self.reporter.severe( - 'Title overline & underline mismatch.', - nodes.literal_block(source, source), line=lineno) - self.parent += msg - return [], 'Body', [] - title = title.rstrip() - messages = [] - if len(title) > len(overline): - blocktext = overline + '\n' + title + '\n' + underline - if len(overline.rstrip()) < 4: - self.short_overline(context, blocktext, lineno, 2) - else: - msg = self.reporter.warning( - 'Title overline too short.', - nodes.literal_block(source, source), line=lineno) - messages.append(msg) - style = (overline[0], underline[0]) - self.eofcheck = 0 # @@@ not sure this is correct - self.section(title.lstrip(), source, style, lineno + 1, messages) - self.eofcheck = 1 - return [], 'Body', [] - - indent = text # indented title - - def underline(self, match, context, next_state): - overline = context[0] - blocktext = overline + '\n' + self.state_machine.line - lineno = self.state_machine.abs_line_number() - 1 - if len(overline.rstrip()) < 4: - self.short_overline(context, blocktext, lineno, 1) - msg = self.reporter.error( - 'Invalid section title or transition marker.', - nodes.literal_block(blocktext, blocktext), line=lineno) - self.parent += msg - return [], 'Body', [] - - def short_overline(self, context, blocktext, lineno, lines=1): - msg = self.reporter.info( - 'Possible incomplete section title.\nTreating the overline as ' - "ordinary text because it's so short.", line=lineno) - self.parent += msg - self.state_correction(context, lines) - - def state_correction(self, context, lines=1): - self.state_machine.previous_line(lines) - context[:] = [] - raise statemachine.StateCorrection('Body', 'text') - - -state_classes = (Body, BulletList, DefinitionList, EnumeratedList, FieldList, - OptionList, ExtensionOptions, Explicit, Text, Definition, - Line, SubstitutionDef, RFC2822Body, RFC2822List) -"""Standard set of State classes used to start `RSTStateMachine`.""" - - -def escape2null(text): - """Return a string with escape-backslashes converted to nulls.""" - parts = [] - start = 0 - while 1: - found = text.find('\\', start) - if found == -1: - parts.append(text[start:]) - return ''.join(parts) - parts.append(text[start:found]) - parts.append('\x00' + text[found+1:found+2]) - start = found + 2 # skip character after escape - -def unescape(text, restore_backslashes=0): - """ - Return a string with nulls removed or restored to backslashes. - Backslash-escaped spaces are also removed. - """ - if restore_backslashes: - return text.replace('\x00', '\\') - else: - for sep in ['\x00 ', '\x00\n', '\x00']: - text = ''.join(text.split(sep)) - return text diff --git a/docutils/docutils/parsers/rst/tableparser.py b/docutils/docutils/parsers/rst/tableparser.py deleted file mode 100644 index 35b52e578..000000000 --- a/docutils/docutils/parsers/rst/tableparser.py +++ /dev/null @@ -1,530 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -This module defines table parser classes,which parse plaintext-graphic tables -and produce a well-formed data structure suitable for building a CALS table. - -:Classes: - - `GridTableParser`: Parse fully-formed tables represented with a grid. - - `SimpleTableParser`: Parse simple tables, delimited by top & bottom - borders. - -:Exception class: `TableMarkupError` - -:Function: - `update_dict_of_lists()`: Merge two dictionaries containing list values. -""" - -__docformat__ = 'reStructuredText' - - -import re -import sys -from docutils import DataError - - -class TableMarkupError(DataError): pass - - -class TableParser: - - """ - Abstract superclass for the common parts of the syntax-specific parsers. - """ - - head_body_separator_pat = None - """Matches the row separator between head rows and body rows.""" - - def parse(self, block): - """ - Analyze the text `block` and return a table data structure. - - Given a plaintext-graphic table in `block` (list of lines of text; no - whitespace padding), parse the table, construct and return the data - necessary to construct a CALS table or equivalent. - - Raise `TableMarkupError` if there is any problem with the markup. - """ - self.setup(block) - self.find_head_body_sep() - self.parse_table() - structure = self.structure_from_cells() - return structure - - def find_head_body_sep(self): - """Look for a head/body row separator line; store the line index.""" - for i in range(len(self.block)): - line = self.block[i] - if self.head_body_separator_pat.match(line): - if self.head_body_sep: - raise TableMarkupError( - 'Multiple head/body row separators in table (at line ' - 'offset %s and %s); only one allowed.' - % (self.head_body_sep, i)) - else: - self.head_body_sep = i - self.block[i] = line.replace('=', '-') - if self.head_body_sep == 0 or self.head_body_sep == (len(self.block) - - 1): - raise TableMarkupError('The head/body row separator may not be ' - 'the first or last line of the table.') - - -class GridTableParser(TableParser): - - """ - Parse a grid table using `parse()`. - - Here's an example of a grid table:: - - +------------------------+------------+----------+----------+ - | Header row, column 1 | Header 2 | Header 3 | Header 4 | - +========================+============+==========+==========+ - | body row 1, column 1 | column 2 | column 3 | column 4 | - +------------------------+------------+----------+----------+ - | body row 2 | Cells may span columns. | - +------------------------+------------+---------------------+ - | body row 3 | Cells may | - Table cells | - +------------------------+ span rows. | - contain | - | body row 4 | | - body elements. | - +------------------------+------------+---------------------+ - - Intersections use '+', row separators use '-' (except for one optional - head/body row separator, which uses '='), and column separators use '|'. - - Passing the above table to the `parse()` method will result in the - following data structure:: - - ([24, 12, 10, 10], - [[(0, 0, 1, ['Header row, column 1']), - (0, 0, 1, ['Header 2']), - (0, 0, 1, ['Header 3']), - (0, 0, 1, ['Header 4'])]], - [[(0, 0, 3, ['body row 1, column 1']), - (0, 0, 3, ['column 2']), - (0, 0, 3, ['column 3']), - (0, 0, 3, ['column 4'])], - [(0, 0, 5, ['body row 2']), - (0, 2, 5, ['Cells may span columns.']), - None, - None], - [(0, 0, 7, ['body row 3']), - (1, 0, 7, ['Cells may', 'span rows.', '']), - (1, 1, 7, ['- Table cells', '- contain', '- body elements.']), - None], - [(0, 0, 9, ['body row 4']), None, None, None]]) - - The first item is a list containing column widths (colspecs). The second - item is a list of head rows, and the third is a list of body rows. Each - row contains a list of cells. Each cell is either None (for a cell unused - because of another cell's span), or a tuple. A cell tuple contains four - items: the number of extra rows used by the cell in a vertical span - (morerows); the number of extra columns used by the cell in a horizontal - span (morecols); the line offset of the first line of the cell contents; - and the cell contents, a list of lines of text. - """ - - head_body_separator_pat = re.compile(r'\+=[=+]+=\+ *$') - - def setup(self, block): - self.block = list(block) # make a copy; it may be modified - self.bottom = len(block) - 1 - self.right = len(block[0]) - 1 - self.head_body_sep = None - self.done = [-1] * len(block[0]) - self.cells = [] - self.rowseps = {0: [0]} - self.colseps = {0: [0]} - - def parse_table(self): - """ - Start with a queue of upper-left corners, containing the upper-left - corner of the table itself. Trace out one rectangular cell, remember - it, and add its upper-right and lower-left corners to the queue of - potential upper-left corners of further cells. Process the queue in - top-to-bottom order, keeping track of how much of each text column has - been seen. - - We'll end up knowing all the row and column boundaries, cell positions - and their dimensions. - """ - corners = [(0, 0)] - while corners: - top, left = corners.pop(0) - if top == self.bottom or left == self.right \ - or top <= self.done[left]: - continue - result = self.scan_cell(top, left) - if not result: - continue - bottom, right, rowseps, colseps = result - update_dict_of_lists(self.rowseps, rowseps) - update_dict_of_lists(self.colseps, colseps) - self.mark_done(top, left, bottom, right) - cellblock = self.get_cell_block(top, left, bottom, right) - self.cells.append((top, left, bottom, right, cellblock)) - corners.extend([(top, right), (bottom, left)]) - corners.sort() - if not self.check_parse_complete(): - raise TableMarkupError('Malformed table; parse incomplete.') - - def mark_done(self, top, left, bottom, right): - """For keeping track of how much of each text column has been seen.""" - before = top - 1 - after = bottom - 1 - for col in range(left, right): - assert self.done[col] == before - self.done[col] = after - - def check_parse_complete(self): - """Each text column should have been completely seen.""" - last = self.bottom - 1 - for col in range(self.right): - if self.done[col] != last: - return None - return 1 - - def get_cell_block(self, top, left, bottom, right): - """Given the corners, extract the text of a cell.""" - cellblock = [] - margin = right - for lineno in range(top + 1, bottom): - line = self.block[lineno][left + 1 : right].rstrip() - cellblock.append(line) - if line: - margin = min(margin, len(line) - len(line.lstrip())) - if 0 < margin < right: - cellblock = [line[margin:] for line in cellblock] - return cellblock - - def scan_cell(self, top, left): - """Starting at the top-left corner, start tracing out a cell.""" - assert self.block[top][left] == '+' - result = self.scan_right(top, left) - return result - - def scan_right(self, top, left): - """ - Look for the top-right corner of the cell, and make note of all column - boundaries ('+'). - """ - colseps = {} - line = self.block[top] - for i in range(left + 1, self.right + 1): - if line[i] == '+': - colseps[i] = [top] - result = self.scan_down(top, left, i) - if result: - bottom, rowseps, newcolseps = result - update_dict_of_lists(colseps, newcolseps) - return bottom, i, rowseps, colseps - elif line[i] != '-': - return None - return None - - def scan_down(self, top, left, right): - """ - Look for the bottom-right corner of the cell, making note of all row - boundaries. - """ - rowseps = {} - for i in range(top + 1, self.bottom + 1): - if self.block[i][right] == '+': - rowseps[i] = [right] - result = self.scan_left(top, left, i, right) - if result: - newrowseps, colseps = result - update_dict_of_lists(rowseps, newrowseps) - return i, rowseps, colseps - elif self.block[i][right] != '|': - return None - return None - - def scan_left(self, top, left, bottom, right): - """ - Noting column boundaries, look for the bottom-left corner of the cell. - It must line up with the starting point. - """ - colseps = {} - line = self.block[bottom] - for i in range(right - 1, left, -1): - if line[i] == '+': - colseps[i] = [bottom] - elif line[i] != '-': - return None - if line[left] != '+': - return None - result = self.scan_up(top, left, bottom, right) - if result is not None: - rowseps = result - return rowseps, colseps - return None - - def scan_up(self, top, left, bottom, right): - """ - Noting row boundaries, see if we can return to the starting point. - """ - rowseps = {} - for i in range(bottom - 1, top, -1): - if self.block[i][left] == '+': - rowseps[i] = [left] - elif self.block[i][left] != '|': - return None - return rowseps - - def structure_from_cells(self): - """ - From the data colledted by `scan_cell()`, convert to the final data - structure. - """ - rowseps = self.rowseps.keys() # list of row boundaries - rowseps.sort() - rowindex = {} - for i in range(len(rowseps)): - rowindex[rowseps[i]] = i # row boundary -> row number mapping - colseps = self.colseps.keys() # list of column boundaries - colseps.sort() - colindex = {} - for i in range(len(colseps)): - colindex[colseps[i]] = i # column boundary -> col number map - colspecs = [(colseps[i] - colseps[i - 1] - 1) - for i in range(1, len(colseps))] # list of column widths - # prepare an empty table with the correct number of rows & columns - onerow = [None for i in range(len(colseps) - 1)] - rows = [onerow[:] for i in range(len(rowseps) - 1)] - # keep track of # of cells remaining; should reduce to zero - remaining = (len(rowseps) - 1) * (len(colseps) - 1) - for top, left, bottom, right, block in self.cells: - rownum = rowindex[top] - colnum = colindex[left] - assert rows[rownum][colnum] is None, ( - 'Cell (row %s, column %s) already used.' - % (rownum + 1, colnum + 1)) - morerows = rowindex[bottom] - rownum - 1 - morecols = colindex[right] - colnum - 1 - remaining -= (morerows + 1) * (morecols + 1) - # write the cell into the table - rows[rownum][colnum] = (morerows, morecols, top + 1, block) - assert remaining == 0, 'Unused cells remaining.' - if self.head_body_sep: # separate head rows from body rows - numheadrows = rowindex[self.head_body_sep] - headrows = rows[:numheadrows] - bodyrows = rows[numheadrows:] - else: - headrows = [] - bodyrows = rows - return (colspecs, headrows, bodyrows) - - -class SimpleTableParser(TableParser): - - """ - Parse a simple table using `parse()`. - - Here's an example of a simple table:: - - ===== ===== - col 1 col 2 - ===== ===== - 1 Second column of row 1. - 2 Second column of row 2. - Second line of paragraph. - 3 - Second column of row 3. - - - Second item in bullet - list (row 3, column 2). - 4 is a span - ------------ - 5 - ===== ===== - - Top and bottom borders use '=', column span underlines use '-', column - separation is indicated with spaces. - - Passing the above table to the `parse()` method will result in the - following data structure, whose interpretation is the same as for - `GridTableParser`:: - - ([5, 25], - [[(0, 0, 1, ['col 1']), - (0, 0, 1, ['col 2'])]], - [[(0, 0, 3, ['1']), - (0, 0, 3, ['Second column of row 1.'])], - [(0, 0, 4, ['2']), - (0, 0, 4, ['Second column of row 2.', - 'Second line of paragraph.'])], - [(0, 0, 6, ['3']), - (0, 0, 6, ['- Second column of row 3.', - '', - '- Second item in bullet', - ' list (row 3, column 2).'])], - [(0, 1, 10, ['4 is a span'])], - [(0, 0, 12, ['5']), - (0, 0, 12, [''])]]) - """ - - head_body_separator_pat = re.compile('=[ =]*$') - span_pat = re.compile('-[ -]*$') - - def setup(self, block): - self.block = list(block) # make a copy; it will be modified - # Convert top & bottom borders to column span underlines: - self.block[0] = self.block[0].replace('=', '-') - self.block[-1] = self.block[-1].replace('=', '-') - self.head_body_sep = None - self.columns = [] - self.border_end = None - self.table = [] - self.done = [-1] * len(block[0]) - self.rowseps = {0: [0]} - self.colseps = {0: [0]} - - def parse_table(self): - """ - First determine the column boundaries from the top border, then - process rows. Each row may consist of multiple lines; accumulate - lines until a row is complete. Call `self.parse_row` to finish the - job. - """ - # Top border must fully describe all table columns. - self.columns = self.parse_columns(self.block[0], 0) - self.border_end = self.columns[-1][1] - firststart, firstend = self.columns[0] - block = self.block[1:] - offset = 0 - # Container for accumulating text lines until a row is complete: - rowlines = [] - while block: - line = block.pop(0) - offset += 1 - if self.span_pat.match(line): - # Column span underline or border; row is complete. - self.parse_row(rowlines, (line.rstrip(), offset)) - rowlines = [] - elif line[firststart:firstend].strip(): - # First column not blank, therefore it's a new row. - if rowlines: - self.parse_row(rowlines) - rowlines = [(line.rstrip(), offset)] - else: - # Accumulate lines of incomplete row. - rowlines.append((line.rstrip(), offset)) - - def parse_columns(self, line, offset): - """ - Given a column span underline, return a list of (begin, end) pairs. - """ - cols = [] - end = 0 - while 1: - begin = line.find('-', end) - end = line.find(' ', begin) - if begin < 0: - break - if end < 0: - end = len(line) - cols.append((begin, end)) - if self.columns: - if cols[-1][1] != self.border_end: - raise TableMarkupError('Column span incomplete at line ' - 'offset %s.' % offset) - # Allow for an unbounded rightmost column: - cols[-1] = (cols[-1][0], self.columns[-1][1]) - return cols - - def init_row(self, colspec, offset): - i = 0 - cells = [] - for start, end in colspec: - morecols = 0 - try: - assert start == self.columns[i][0] - while end != self.columns[i][1]: - i += 1 - morecols += 1 - except (AssertionError, IndexError): - raise TableMarkupError('Column span alignment problem at ' - 'line offset %s.' % offset) - cells.append((0, morecols, offset, [])) - i += 1 - return cells - - def parse_row(self, lines, spanline=None): - """ - Given the text `lines` of a row, parse it and append to `self.table`. - - The row is parsed according to the current column spec (either - `spanline` if provided or `self.columns`). For each column, extract - text from each line, and check for text in column margins. Finally, - adjust for insigificant whitespace. - """ - while lines and not lines[-1][0]: - lines.pop() # Remove blank trailing lines. - if lines: - offset = lines[0][1] - elif spanline: - offset = spanline[1] - else: - # No new row, just blank lines. - return - if spanline: - columns = self.parse_columns(*spanline) - else: - columns = self.columns[:] - row = self.init_row(columns, offset) - # "Infinite" value for a dummy last column's beginning, used to - # check for text overflow: - columns.append((sys.maxint, None)) - lastcol = len(columns) - 2 - for i in range(len(columns) - 1): - start, end = columns[i] - nextstart = columns[i+1][0] - block = [] - margin = sys.maxint - for line, offset in lines: - if i == lastcol and line[end:].strip(): - text = line[start:].rstrip() - columns[lastcol] = (start, start + len(text)) - self.adjust_last_column(start + len(text)) - elif line[end:nextstart].strip(): - raise TableMarkupError('Text in column margin at line ' - 'offset %s.' % offset) - else: - text = line[start:end].rstrip() - block.append(text) - if text: - margin = min(margin, len(text) - len(text.lstrip())) - if 0 < margin < sys.maxint: - block = [line[margin:] for line in block] - row[i][3].extend(block) - self.table.append(row) - - def adjust_last_column(self, new_end): - start, end = self.columns[-1] - if new_end > end: - self.columns[-1] = (start, new_end) - - def structure_from_cells(self): - colspecs = [end - start for start, end in self.columns] - first_body_row = 0 - if self.head_body_sep: - for i in range(len(self.table)): - if self.table[i][0][2] > self.head_body_sep: - first_body_row = i - break - return (colspecs, self.table[:first_body_row], - self.table[first_body_row:]) - - -def update_dict_of_lists(master, newdata): - """ - Extend the list values of `master` with those from `newdata`. - - Both parameters must be dictionaries containing list values. - """ - for key, values in newdata.items(): - master.setdefault(key, []).extend(values) diff --git a/docutils/docutils/readers/__init__.py b/docutils/docutils/readers/__init__.py deleted file mode 100644 index f12401ff0..000000000 --- a/docutils/docutils/readers/__init__.py +++ /dev/null @@ -1,88 +0,0 @@ -# Authors: David Goodger; Ueli Schlaepfer -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -This package contains Docutils Reader modules. -""" - -__docformat__ = 'reStructuredText' - - -import sys -from docutils import utils, parsers, Component -from docutils.transforms import universal - - -class Reader(Component): - - """ - Abstract base class for docutils Readers. - - Each reader module or package must export a subclass also called 'Reader'. - - The three steps of a Reader's responsibility are defined: `scan()`, - `parse()`, and `transform()`. Call `read()` to process a document. - """ - - component_type = 'reader' - - def __init__(self, parser=None, parser_name='restructuredtext'): - """ - Initialize the Reader instance. - - Several instance attributes are defined with dummy initial values. - Subclasses may use these attributes as they wish. - """ - - self.parser = parser - """A `parsers.Parser` instance shared by all doctrees. May be left - unspecified if the document source determines the parser.""" - - if parser is None and parser_name: - self.set_parser(parser_name) - - self.source = None - """`docutils.io` IO object, source of input data.""" - - self.input = None - """Raw text input; either a single string or, for more complex cases, - a collection of strings.""" - - def set_parser(self, parser_name): - """Set `self.parser` by name.""" - parser_class = parsers.get_parser_class(parser_name) - self.parser = parser_class() - - def read(self, source, parser, settings): - self.source = source - if not self.parser: - self.parser = parser - self.settings = settings - self.input = self.source.read() - self.parse() - return self.document - - def parse(self): - """Parse `self.input` into a document tree.""" - self.document = document = self.new_document() - self.parser.parse(self.input, document) - document.current_source = document.current_line = None - - def new_document(self): - """Create and return a new empty document tree (root node).""" - document = utils.new_document(self.source.source_path, self.settings) - return document - - -_reader_aliases = {} - -def get_reader_class(reader_name): - """Return the Reader class from the `reader_name` module.""" - reader_name = reader_name.lower() - if _reader_aliases.has_key(reader_name): - reader_name = _reader_aliases[reader_name] - module = __import__(reader_name, globals(), locals()) - return module.Reader diff --git a/docutils/docutils/readers/pep.py b/docutils/docutils/readers/pep.py deleted file mode 100644 index e21d8f213..000000000 --- a/docutils/docutils/readers/pep.py +++ /dev/null @@ -1,58 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Python Enhancement Proposal (PEP) Reader. -""" - -__docformat__ = 'reStructuredText' - - -from docutils.readers import standalone -from docutils.transforms import peps, references -from docutils.parsers import rst - - -class Inliner(rst.states.Inliner): - - """ - Extend `rst.Inliner` for local PEP references. - """ - - pep_url = rst.states.Inliner.pep_url_local - - -class Reader(standalone.Reader): - - supported = ('pep',) - """Contexts this reader supports.""" - - settings_spec = ( - 'PEP Reader Option Defaults', - 'The --pep-references and --rfc-references options (for the ' - 'reStructuredText parser) are on by default.', - ()) - - default_transforms = (references.Substitutions, - peps.Headers, - peps.Contents, - references.ChainedTargets, - references.AnonymousHyperlinks, - references.IndirectHyperlinks, - peps.TargetNotes, - references.Footnotes, - references.ExternalTargets, - references.InternalTargets,) - - settings_default_overrides = {'pep_references': 1, 'rfc_references': 1} - - inliner_class = Inliner - - def __init__(self, parser=None, parser_name=None): - """`parser` should be ``None``.""" - if parser is None: - parser = rst.Parser(rfc2822=1, inliner=self.inliner_class()) - standalone.Reader.__init__(self, parser, '') diff --git a/docutils/docutils/readers/python/__init__.py b/docutils/docutils/readers/python/__init__.py deleted file mode 100644 index a346ce32a..000000000 --- a/docutils/docutils/readers/python/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -This package contains the Python Source Reader modules. -""" - -__docformat__ = 'reStructuredText' - - -import sys -import docutils.readers - - -class Reader(docutils.readers.Reader): - pass diff --git a/docutils/docutils/readers/python/moduleparser.py b/docutils/docutils/readers/python/moduleparser.py deleted file mode 100644 index 9fcd1ec07..000000000 --- a/docutils/docutils/readers/python/moduleparser.py +++ /dev/null @@ -1,784 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Parser for Python modules. - -The `parse_module()` function takes a module's text and file name, runs it -through the module parser (using compiler.py and tokenize.py) and produces a -"module documentation tree": a high-level AST full of nodes that are -interesting from an auto-documentation standpoint. For example, given this -module (x.py):: - - # comment - - '''Docstring''' - - '''Additional docstring''' - - __docformat__ = 'reStructuredText' - - a = 1 - '''Attribute docstring''' - - class C(Super): - - '''C's docstring''' - - class_attribute = 1 - '''class_attribute's docstring''' - - def __init__(self, text=None): - '''__init__'s docstring''' - - self.instance_attribute = (text * 7 - + ' whaddyaknow') - '''instance_attribute's docstring''' - - - def f(x, # parameter x - y=a*5, # parameter y - *args): # parameter args - '''f's docstring''' - return [x + item for item in args] - - f.function_attribute = 1 - '''f.function_attribute's docstring''' - -The module parser will produce this module documentation tree:: - - <Module filename="test data"> - <Comment lineno=1> - comment - <Docstring> - Docstring - <Docstring lineno="5"> - Additional docstring - <Attribute lineno="7" name="__docformat__"> - <Expression lineno="7"> - 'reStructuredText' - <Attribute lineno="9" name="a"> - <Expression lineno="9"> - 1 - <Docstring lineno="10"> - Attribute docstring - <Class bases="Super" lineno="12" name="C"> - <Docstring lineno="12"> - C's docstring - <Attribute lineno="16" name="class_attribute"> - <Expression lineno="16"> - 1 - <Docstring lineno="17"> - class_attribute's docstring - <Method lineno="19" name="__init__"> - <Docstring lineno="19"> - __init__'s docstring - <ParameterList lineno="19"> - <Parameter lineno="19" name="self"> - <Parameter lineno="19" name="text"> - <Default lineno="19"> - None - <Attribute lineno="22" name="self.instance_attribute"> - <Expression lineno="22"> - (text * 7 + ' whaddyaknow') - <Docstring lineno="24"> - instance_attribute's docstring - <Function lineno="27" name="f"> - <Docstring lineno="27"> - f's docstring - <ParameterList lineno="27"> - <Parameter lineno="27" name="x"> - <Comment> - # parameter x - <Parameter lineno="27" name="y"> - <Default lineno="27"> - a * 5 - <Comment> - # parameter y - <ExcessPositionalArguments lineno="27" name="args"> - <Comment> - # parameter args - <Attribute lineno="33" name="f.function_attribute"> - <Expression lineno="33"> - 1 - <Docstring lineno="34"> - f.function_attribute's docstring - -(Comments are not implemented yet.) - -compiler.parse() provides most of what's needed for this doctree, and -"tokenize" can be used to get the rest. We can determine the line number from -the compiler.parse() AST, and the TokenParser.rhs(lineno) method provides the -rest. - -The Docutils Python reader component will transform this module doctree into a -Python-specific Docutils doctree, and then a `stylist transform`_ will -further transform it into a generic doctree. Namespaces will have to be -compiled for each of the scopes, but I'm not certain at what stage of -processing. - -It's very important to keep all docstring processing out of this, so that it's -a completely generic and not tool-specific. - -> Why perform all of those transformations? Why not go from the AST to a -> generic doctree? Or, even from the AST to the final output? - -I want the docutils.readers.python.moduleparser.parse_module() function to -produce a standard documentation-oriented tree that can be used by any tool. -We can develop it together without having to compromise on the rest of our -design (i.e., HappyDoc doesn't have to be made to work like Docutils, and -vice-versa). It would be a higher-level version of what compiler.py provides. - -The Python reader component transforms this generic AST into a Python-specific -doctree (it knows about modules, classes, functions, etc.), but this is -specific to Docutils and cannot be used by HappyDoc or others. The stylist -transform does the final layout, converting Python-specific structures -("class" sections, etc.) into a generic doctree using primitives (tables, -sections, lists, etc.). This generic doctree does *not* know about Python -structures any more. The advantage is that this doctree can be handed off to -any of the output writers to create any output format we like. - -The latter two transforms are separate because I want to be able to have -multiple independent layout styles (multiple runtime-selectable "stylist -transforms"). Each of the existing tools (HappyDoc, pydoc, epydoc, Crystal, -etc.) has its own fixed format. I personally don't like the tables-based -format produced by these tools, and I'd like to be able to customize the -format easily. That's the goal of stylist transforms, which are independent -from the Reader component itself. One stylist transform could produce -HappyDoc-like output, another could produce output similar to module docs in -the Python library reference manual, and so on. - -It's for exactly this reason: - ->> It's very important to keep all docstring processing out of this, so that ->> it's a completely generic and not tool-specific. - -... but it goes past docstring processing. It's also important to keep style -decisions and tool-specific data transforms out of this module parser. - - -Issues -====== - -* At what point should namespaces be computed? Should they be part of the - basic AST produced by the ASTVisitor walk, or generated by another tree - traversal? - -* At what point should a distinction be made between local variables & - instance attributes in __init__ methods? - -* Docstrings are getting their lineno from their parents. Should the - TokenParser find the real line no's? - -* Comments: include them? How and when? Only full-line comments, or - parameter comments too? (See function "f" above for an example.) - -* Module could use more docstrings & refactoring in places. - -""" - -__docformat__ = 'reStructuredText' - -import sys -import compiler -import compiler.ast -import tokenize -import token -from compiler.consts import OP_ASSIGN -from compiler.visitor import ASTVisitor -from types import StringType, UnicodeType, TupleType - - -def parse_module(module_text, filename): - """Return a module documentation tree from `module_text`.""" - ast = compiler.parse(module_text) - token_parser = TokenParser(module_text) - visitor = ModuleVisitor(filename, token_parser) - compiler.walk(ast, visitor, walker=visitor) - return visitor.module - - -class Node: - - """ - Base class for module documentation tree nodes. - """ - - def __init__(self, node): - self.children = [] - """List of child nodes.""" - - self.lineno = node.lineno - """Line number of this node (or ``None``).""" - - def __str__(self, indent=' ', level=0): - return ''.join(['%s%s\n' % (indent * level, repr(self))] + - [child.__str__(indent, level+1) - for child in self.children]) - - def __repr__(self): - parts = [self.__class__.__name__] - for name, value in self.attlist(): - parts.append('%s="%s"' % (name, value)) - return '<%s>' % ' '.join(parts) - - def attlist(self, **atts): - if self.lineno is not None: - atts['lineno'] = self.lineno - attlist = atts.items() - attlist.sort() - return attlist - - def append(self, node): - self.children.append(node) - - def extend(self, node_list): - self.children.extend(node_list) - - -class TextNode(Node): - - def __init__(self, node, text): - Node.__init__(self, node) - self.text = trim_docstring(text) - - def __str__(self, indent=' ', level=0): - prefix = indent * (level + 1) - text = '\n'.join([prefix + line for line in self.text.splitlines()]) - return Node.__str__(self, indent, level) + text + '\n' - - -class Module(Node): - - def __init__(self, node, filename): - Node.__init__(self, node) - self.filename = filename - - def attlist(self): - return Node.attlist(self, filename=self.filename) - - -class Docstring(TextNode): pass - - -class Comment(TextNode): pass - - -class Import(Node): - - def __init__(self, node, names, from_name=None): - Node.__init__(self, node) - self.names = names - self.from_name = from_name - - def __str__(self, indent=' ', level=0): - prefix = indent * (level + 1) - lines = [] - for name, as in self.names: - if as: - lines.append('%s%s as %s' % (prefix, name, as)) - else: - lines.append('%s%s' % (prefix, name)) - text = '\n'.join(lines) - return Node.__str__(self, indent, level) + text + '\n' - - def attlist(self): - if self.from_name: - atts = {'from': self.from_name} - else: - atts = {} - return Node.attlist(self, **atts) - - -class Attribute(Node): - - def __init__(self, node, name): - Node.__init__(self, node) - self.name = name - - def attlist(self): - return Node.attlist(self, name=self.name) - - -class AttributeTuple(Node): - - def __init__(self, node, names): - Node.__init__(self, node) - self.names = names - - def attlist(self): - return Node.attlist(self, names=' '.join(self.names)) - - -class Expression(TextNode): - - def __str__(self, indent=' ', level=0): - prefix = indent * (level + 1) - return '%s%s%s\n' % (Node.__str__(self, indent, level), - prefix, self.text.encode('unicode-escape')) - - -class Function(Attribute): pass - - -class ParameterList(Node): pass - - -class Parameter(Attribute): pass - - -class ParameterTuple(AttributeTuple): - - def attlist(self): - return Node.attlist(self, names=normalize_parameter_name(self.names)) - - -class ExcessPositionalArguments(Parameter): pass - - -class ExcessKeywordArguments(Parameter): pass - - -class Default(Expression): pass - - -class Class(Node): - - def __init__(self, node, name, bases=None): - Node.__init__(self, node) - self.name = name - self.bases = bases or [] - - def attlist(self): - atts = {'name': self.name} - if self.bases: - atts['bases'] = ' '.join(self.bases) - return Node.attlist(self, **atts) - - -class Method(Function): pass - - -class BaseVisitor(ASTVisitor): - - def __init__(self, token_parser): - ASTVisitor.__init__(self) - self.token_parser = token_parser - self.context = [] - self.documentable = None - - def default(self, node, *args): - self.documentable = None - #print 'in default (%s)' % node.__class__.__name__ - #ASTVisitor.default(self, node, *args) - - def default_visit(self, node, *args): - #print 'in default_visit (%s)' % node.__class__.__name__ - ASTVisitor.default(self, node, *args) - - -class DocstringVisitor(BaseVisitor): - - def visitDiscard(self, node): - if self.documentable: - self.visit(node.expr) - - def visitConst(self, node): - if self.documentable: - if type(node.value) in (StringType, UnicodeType): - self.documentable.append(Docstring(node, node.value)) - else: - self.documentable = None - - def visitStmt(self, node): - self.default_visit(node) - - -class AssignmentVisitor(DocstringVisitor): - - def visitAssign(self, node): - visitor = AttributeVisitor(self.token_parser) - compiler.walk(node, visitor, walker=visitor) - if visitor.attributes: - self.context[-1].extend(visitor.attributes) - if len(visitor.attributes) == 1: - self.documentable = visitor.attributes[0] - else: - self.documentable = None - - -class ModuleVisitor(AssignmentVisitor): - - def __init__(self, filename, token_parser): - AssignmentVisitor.__init__(self, token_parser) - self.filename = filename - self.module = None - - def visitModule(self, node): - self.module = module = Module(node, self.filename) - if node.doc is not None: - module.append(Docstring(node, node.doc)) - self.context.append(module) - self.documentable = module - self.visit(node.node) - self.context.pop() - - def visitImport(self, node): - self.context[-1].append(Import(node, node.names)) - self.documentable = None - - def visitFrom(self, node): - self.context[-1].append( - Import(node, node.names, from_name=node.modname)) - self.documentable = None - - def visitFunction(self, node): - visitor = FunctionVisitor(self.token_parser) - compiler.walk(node, visitor, walker=visitor) - self.context[-1].append(visitor.function) - - def visitClass(self, node): - visitor = ClassVisitor(self.token_parser) - compiler.walk(node, visitor, walker=visitor) - self.context[-1].append(visitor.klass) - - -class AttributeVisitor(BaseVisitor): - - def __init__(self, token_parser): - BaseVisitor.__init__(self, token_parser) - self.attributes = [] - - def visitAssign(self, node): - # Don't visit the expression itself, just the attribute nodes: - for child in node.nodes: - self.dispatch(child) - expression_text = self.token_parser.rhs(node.lineno) - expression = Expression(node, expression_text) - for attribute in self.attributes: - attribute.append(expression) - - def visitAssName(self, node): - self.attributes.append(Attribute(node, node.name)) - - def visitAssTuple(self, node): - attributes = self.attributes - self.attributes = [] - self.default_visit(node) - names = [attribute.name for attribute in self.attributes] - att_tuple = AttributeTuple(node, names) - att_tuple.lineno = self.attributes[0].lineno - self.attributes = attributes - self.attributes.append(att_tuple) - - def visitAssAttr(self, node): - self.default_visit(node, node.attrname) - - def visitGetattr(self, node, suffix): - self.default_visit(node, node.attrname + '.' + suffix) - - def visitName(self, node, suffix): - self.attributes.append(Attribute(node, node.name + '.' + suffix)) - - -class FunctionVisitor(DocstringVisitor): - - in_function = 0 - function_class = Function - - def visitFunction(self, node): - if self.in_function: - self.documentable = None - # Don't bother with nested function definitions. - return - self.in_function = 1 - self.function = function = self.function_class(node, node.name) - if node.doc is not None: - function.append(Docstring(node, node.doc)) - self.context.append(function) - self.documentable = function - self.parse_parameter_list(node) - self.visit(node.code) - self.context.pop() - - def parse_parameter_list(self, node): - parameters = [] - special = [] - argnames = list(node.argnames) - if node.kwargs: - special.append(ExcessKeywordArguments(node, argnames[-1])) - argnames.pop() - if node.varargs: - special.append(ExcessPositionalArguments(node, argnames[-1])) - argnames.pop() - defaults = list(node.defaults) - defaults = [None] * (len(argnames) - len(defaults)) + defaults - function_parameters = self.token_parser.function_parameters( - node.lineno) - #print >>sys.stderr, function_parameters - for argname, default in zip(argnames, defaults): - if type(argname) is TupleType: - parameter = ParameterTuple(node, argname) - argname = normalize_parameter_name(argname) - else: - parameter = Parameter(node, argname) - if default: - parameter.append(Default(node, function_parameters[argname])) - parameters.append(parameter) - if parameters or special: - special.reverse() - parameters.extend(special) - parameter_list = ParameterList(node) - parameter_list.extend(parameters) - self.function.append(parameter_list) - - -class ClassVisitor(AssignmentVisitor): - - in_class = 0 - - def __init__(self, token_parser): - AssignmentVisitor.__init__(self, token_parser) - self.bases = [] - - def visitClass(self, node): - if self.in_class: - self.documentable = None - # Don't bother with nested class definitions. - return - self.in_class = 1 - #import mypdb as pdb - #pdb.set_trace() - for base in node.bases: - self.visit(base) - self.klass = klass = Class(node, node.name, self.bases) - if node.doc is not None: - klass.append(Docstring(node, node.doc)) - self.context.append(klass) - self.documentable = klass - self.visit(node.code) - self.context.pop() - - def visitGetattr(self, node, suffix=None): - if suffix: - name = node.attrname + '.' + suffix - else: - name = node.attrname - self.default_visit(node, name) - - def visitName(self, node, suffix=None): - if suffix: - name = node.name + '.' + suffix - else: - name = node.name - self.bases.append(name) - - def visitFunction(self, node): - if node.name == '__init__': - visitor = InitMethodVisitor(self.token_parser) - else: - visitor = MethodVisitor(self.token_parser) - compiler.walk(node, visitor, walker=visitor) - self.context[-1].append(visitor.function) - - -class MethodVisitor(FunctionVisitor): - - function_class = Method - - -class InitMethodVisitor(MethodVisitor, AssignmentVisitor): pass - - -class TokenParser: - - def __init__(self, text): - self.text = text + '\n\n' - self.lines = self.text.splitlines(1) - self.generator = tokenize.generate_tokens(iter(self.lines).next) - self.next() - - def __iter__(self): - return self - - def next(self): - self.token = self.generator.next() - self.type, self.string, self.start, self.end, self.line = self.token - return self.token - - def goto_line(self, lineno): - while self.start[0] < lineno: - self.next() - return token - - def rhs(self, lineno): - """ - Return a whitespace-normalized expression string from the right-hand - side of an assignment at line `lineno`. - """ - self.goto_line(lineno) - while self.string != '=': - self.next() - self.stack = None - while self.type != token.NEWLINE and self.string != ';': - if self.string == '=' and not self.stack: - self.tokens = [] - self.stack = [] - self._type = None - self._string = None - self._backquote = 0 - else: - self.note_token() - self.next() - self.next() - text = ''.join(self.tokens) - return text.strip() - - closers = {')': '(', ']': '[', '}': '{'} - openers = {'(': 1, '[': 1, '{': 1} - del_ws_prefix = {'.': 1, '=': 1, ')': 1, ']': 1, '}': 1, ':': 1, ',': 1} - no_ws_suffix = {'.': 1, '=': 1, '(': 1, '[': 1, '{': 1} - - def note_token(self): - if self.type == tokenize.NL: - return - del_ws = self.del_ws_prefix.has_key(self.string) - append_ws = not self.no_ws_suffix.has_key(self.string) - if self.openers.has_key(self.string): - self.stack.append(self.string) - if (self._type == token.NAME - or self.closers.has_key(self._string)): - del_ws = 1 - elif self.closers.has_key(self.string): - assert self.stack[-1] == self.closers[self.string] - self.stack.pop() - elif self.string == '`': - if self._backquote: - del_ws = 1 - assert self.stack[-1] == '`' - self.stack.pop() - else: - append_ws = 0 - self.stack.append('`') - self._backquote = not self._backquote - if del_ws and self.tokens and self.tokens[-1] == ' ': - del self.tokens[-1] - self.tokens.append(self.string) - self._type = self.type - self._string = self.string - if append_ws: - self.tokens.append(' ') - - def function_parameters(self, lineno): - """ - Return a dictionary mapping parameters to defaults - (whitespace-normalized strings). - """ - self.goto_line(lineno) - while self.string != 'def': - self.next() - while self.string != '(': - self.next() - name = None - default = None - parameter_tuple = None - self.tokens = [] - parameters = {} - self.stack = [self.string] - self.next() - while 1: - if len(self.stack) == 1: - if parameter_tuple: - # Just encountered ")". - #print >>sys.stderr, 'parameter_tuple: %r' % self.tokens - name = ''.join(self.tokens).strip() - self.tokens = [] - parameter_tuple = None - if self.string in (')', ','): - if name: - if self.tokens: - default_text = ''.join(self.tokens).strip() - else: - default_text = None - parameters[name] = default_text - self.tokens = [] - name = None - default = None - if self.string == ')': - break - elif self.type == token.NAME: - if name and default: - self.note_token() - else: - assert name is None, ( - 'token=%r name=%r parameters=%r stack=%r' - % (self.token, name, parameters, self.stack)) - name = self.string - #print >>sys.stderr, 'name=%r' % name - elif self.string == '=': - assert name is not None, 'token=%r' % (self.token,) - assert default is None, 'token=%r' % (self.token,) - assert self.tokens == [], 'token=%r' % (self.token,) - default = 1 - self._type = None - self._string = None - self._backquote = 0 - elif name: - self.note_token() - elif self.string == '(': - parameter_tuple = 1 - self._type = None - self._string = None - self._backquote = 0 - self.note_token() - else: # ignore these tokens: - assert (self.string in ('*', '**', '\n') - or self.type == tokenize.COMMENT), ( - 'token=%r' % (self.token,)) - else: - self.note_token() - self.next() - return parameters - - -def trim_docstring(text): - """ - Trim indentation and blank lines from docstring text & return it. - - See PEP 257. - """ - if not text: - return text - # Convert tabs to spaces (following the normal Python rules) - # and split into a list of lines: - lines = text.expandtabs().splitlines() - # Determine minimum indentation (first line doesn't count): - indent = sys.maxint - for line in lines[1:]: - stripped = line.lstrip() - if stripped: - indent = min(indent, len(line) - len(stripped)) - # Remove indentation (first line is special): - trimmed = [lines[0].strip()] - if indent < sys.maxint: - for line in lines[1:]: - trimmed.append(line[indent:].rstrip()) - # Strip off trailing and leading blank lines: - while trimmed and not trimmed[-1]: - trimmed.pop() - while trimmed and not trimmed[0]: - trimmed.pop(0) - # Return a single string: - return '\n'.join(trimmed) - -def normalize_parameter_name(name): - """ - Converts a tuple like ``('a', ('b', 'c'), 'd')`` into ``'(a, (b, c), d)'`` - """ - if type(name) is TupleType: - return '(%s)' % ', '.join([normalize_parameter_name(n) for n in name]) - else: - return name diff --git a/docutils/docutils/readers/standalone.py b/docutils/docutils/readers/standalone.py deleted file mode 100644 index 14b75e3d7..000000000 --- a/docutils/docutils/readers/standalone.py +++ /dev/null @@ -1,49 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Standalone file Reader for the reStructuredText markup syntax. -""" - -__docformat__ = 'reStructuredText' - - -import sys -from docutils import readers -from docutils.transforms import frontmatter, references -from docutils.parsers.rst import Parser - - -class Reader(readers.Reader): - - supported = ('standalone',) - """Contexts this reader supports.""" - - document = None - """A single document tree.""" - - settings_spec = ( - 'Standalone Reader', - None, - (('Disable the promotion of a lone top-level section title to ' - 'document title (and subsequent section title to document ' - 'subtitle promotion; enabled by default).', - ['--no-doc-title'], - {'dest': 'doctitle_xform', 'action': 'store_false', 'default': 1}), - ('Disable the bibliographic field list transform (enabled by ' - 'default).', - ['--no-doc-info'], - {'dest': 'docinfo_xform', 'action': 'store_false', 'default': 1}),)) - - default_transforms = (references.Substitutions, - frontmatter.DocTitle, - frontmatter.DocInfo, - references.ChainedTargets, - references.AnonymousHyperlinks, - references.IndirectHyperlinks, - references.Footnotes, - references.ExternalTargets, - references.InternalTargets,) diff --git a/docutils/docutils/statemachine.py b/docutils/docutils/statemachine.py deleted file mode 100644 index 060347ade..000000000 --- a/docutils/docutils/statemachine.py +++ /dev/null @@ -1,1451 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -A finite state machine specialized for regular-expression-based text filters, -this module defines the following classes: - -- `StateMachine`, a state machine -- `State`, a state superclass -- `StateMachineWS`, a whitespace-sensitive version of `StateMachine` -- `StateWS`, a state superclass for use with `StateMachineWS` -- `SearchStateMachine`, uses `re.search()` instead of `re.match()` -- `SearchStateMachineWS`, uses `re.search()` instead of `re.match()` -- `ViewList`, extends standard Python lists. -- `StringList`, string-specific ViewList. - -Exception classes: - -- `StateMachineError` -- `UnknownStateError` -- `DuplicateStateError` -- `UnknownTransitionError` -- `DuplicateTransitionError` -- `TransitionPatternNotFound` -- `TransitionMethodNotFound` -- `UnexpectedIndentationError` -- `TransitionCorrection`: Raised to switch to another transition. -- `StateCorrection`: Raised to switch to another state & transition. - -Functions: - -- `string2lines()`: split a multi-line string into a list of one-line strings - - -How To Use This Module -====================== -(See the individual classes, methods, and attributes for details.) - -1. Import it: ``import statemachine`` or ``from statemachine import ...``. - You will also need to ``import re``. - -2. Derive a subclass of `State` (or `StateWS`) for each state in your state - machine:: - - class MyState(statemachine.State): - - Within the state's class definition: - - a) Include a pattern for each transition, in `State.patterns`:: - - patterns = {'atransition': r'pattern', ...} - - b) Include a list of initial transitions to be set up automatically, in - `State.initial_transitions`:: - - initial_transitions = ['atransition', ...] - - c) Define a method for each transition, with the same name as the - transition pattern:: - - def atransition(self, match, context, next_state): - # do something - result = [...] # a list - return context, next_state, result - # context, next_state may be altered - - Transition methods may raise an `EOFError` to cut processing short. - - d) You may wish to override the `State.bof()` and/or `State.eof()` implicit - transition methods, which handle the beginning- and end-of-file. - - e) In order to handle nested processing, you may wish to override the - attributes `State.nested_sm` and/or `State.nested_sm_kwargs`. - - If you are using `StateWS` as a base class, in order to handle nested - indented blocks, you may wish to: - - - override the attributes `StateWS.indent_sm`, - `StateWS.indent_sm_kwargs`, `StateWS.known_indent_sm`, and/or - `StateWS.known_indent_sm_kwargs`; - - override the `StateWS.blank()` method; and/or - - override or extend the `StateWS.indent()`, `StateWS.known_indent()`, - and/or `StateWS.firstknown_indent()` methods. - -3. Create a state machine object:: - - sm = StateMachine(state_classes=[MyState, ...], - initial_state='MyState') - -4. Obtain the input text, which needs to be converted into a tab-free list of - one-line strings. For example, to read text from a file called - 'inputfile':: - - input_string = open('inputfile').read() - input_lines = statemachine.string2lines(input_string) - -5. Run the state machine on the input text and collect the results, a list:: - - results = sm.run(input_lines) - -6. Remove any lingering circular references:: - - sm.unlink() -""" - -__docformat__ = 'restructuredtext' - -import sys -import re -from types import SliceType as _SliceType - - -class StateMachine: - - """ - A finite state machine for text filters using regular expressions. - - The input is provided in the form of a list of one-line strings (no - newlines). States are subclasses of the `State` class. Transitions consist - of regular expression patterns and transition methods, and are defined in - each state. - - The state machine is started with the `run()` method, which returns the - results of processing in a list. - """ - - def __init__(self, state_classes, initial_state, debug=0): - """ - Initialize a `StateMachine` object; add state objects. - - Parameters: - - - `state_classes`: a list of `State` (sub)classes. - - `initial_state`: a string, the class name of the initial state. - - `debug`: a boolean; produce verbose output if true (nonzero). - """ - - self.input_lines = None - """`StringList` of input lines (without newlines). - Filled by `self.run()`.""" - - self.input_offset = 0 - """Offset of `self.input_lines` from the beginning of the file.""" - - self.line = None - """Current input line.""" - - self.line_offset = -1 - """Current input line offset from beginning of `self.input_lines`.""" - - self.debug = debug - """Debugging mode on/off.""" - - self.initial_state = initial_state - """The name of the initial state (key to `self.states`).""" - - self.current_state = initial_state - """The name of the current state (key to `self.states`).""" - - self.states = {} - """Mapping of {state_name: State_object}.""" - - self.add_states(state_classes) - - self.observers = [] - """List of bound methods or functions to call whenever the current - line changes. Observers are called with one argument, ``self``. - Cleared at the end of `run()`.""" - - def unlink(self): - """Remove circular references to objects no longer required.""" - for state in self.states.values(): - state.unlink() - self.states = None - - def run(self, input_lines, input_offset=0, context=None, - input_source=None): - """ - Run the state machine on `input_lines`. Return results (a list). - - Reset `self.line_offset` and `self.current_state`. Run the - beginning-of-file transition. Input one line at a time and check for a - matching transition. If a match is found, call the transition method - and possibly change the state. Store the context returned by the - transition method to be passed on to the next transition matched. - Accumulate the results returned by the transition methods in a list. - Run the end-of-file transition. Finally, return the accumulated - results. - - Parameters: - - - `input_lines`: a list of strings without newlines, or `StringList`. - - `input_offset`: the line offset of `input_lines` from the beginning - of the file. - - `context`: application-specific storage. - - `input_source`: name or path of source of `input_lines`. - """ - self.runtime_init() - if isinstance(input_lines, StringList): - self.input_lines = input_lines - else: - self.input_lines = StringList(input_lines, source=input_source) - self.input_offset = input_offset - self.line_offset = -1 - self.current_state = self.initial_state - if self.debug: - print >>sys.stderr, ( - '\nStateMachine.run: input_lines (line_offset=%s):\n| %s' - % (self.line_offset, '\n| '.join(self.input_lines))) - transitions = None - results = [] - state = self.get_state() - try: - if self.debug: - print >>sys.stderr, ('\nStateMachine.run: bof transition') - context, result = state.bof(context) - results.extend(result) - while 1: - try: - try: - self.next_line() - if self.debug: - source, offset = self.input_lines.info( - self.line_offset) - print >>sys.stderr, ( - '\nStateMachine.run: line (source=%r, ' - 'offset=%r):\n| %s' - % (source, offset, self.line)) - context, next_state, result = self.check_line( - context, state, transitions) - except EOFError: - if self.debug: - print >>sys.stderr, ( - '\nStateMachine.run: %s.eof transition' - % state.__class__.__name__) - result = state.eof(context) - results.extend(result) - break - else: - results.extend(result) - except TransitionCorrection, exception: - self.previous_line() # back up for another try - transitions = (exception.args[0],) - if self.debug: - print >>sys.stderr, ( - '\nStateMachine.run: TransitionCorrection to ' - 'state "%s", transition %s.' - % (state.__class__.__name__, transitions[0])) - continue - except StateCorrection, exception: - self.previous_line() # back up for another try - next_state = exception.args[0] - if len(exception.args) == 1: - transitions = None - else: - transitions = (exception.args[1],) - if self.debug: - print >>sys.stderr, ( - '\nStateMachine.run: StateCorrection to state ' - '"%s", transition %s.' - % (next_state, transitions[0])) - else: - transitions = None - state = self.get_state(next_state) - except: - if self.debug: - self.error() - raise - self.observers = [] - return results - - def get_state(self, next_state=None): - """ - Return current state object; set it first if `next_state` given. - - Parameter `next_state`: a string, the name of the next state. - - Exception: `UnknownStateError` raised if `next_state` unknown. - """ - if next_state: - if self.debug and next_state != self.current_state: - print >>sys.stderr, \ - ('\nStateMachine.get_state: Changing state from ' - '"%s" to "%s" (input line %s).' - % (self.current_state, next_state, - self.abs_line_number())) - self.current_state = next_state - try: - return self.states[self.current_state] - except KeyError: - raise UnknownStateError(self.current_state) - - def next_line(self, n=1): - """Load `self.line` with the `n`'th next line and return it.""" - try: - try: - self.line_offset += n - self.line = self.input_lines[self.line_offset] - except IndexError: - self.line = None - raise EOFError - return self.line - finally: - self.notify_observers() - - def is_next_line_blank(self): - """Return 1 if the next line is blank or non-existant.""" - try: - return not self.input_lines[self.line_offset + 1].strip() - except IndexError: - return 1 - - def at_eof(self): - """Return 1 if the input is at or past end-of-file.""" - return self.line_offset >= len(self.input_lines) - 1 - - def at_bof(self): - """Return 1 if the input is at or before beginning-of-file.""" - return self.line_offset <= 0 - - def previous_line(self, n=1): - """Load `self.line` with the `n`'th previous line and return it.""" - self.line_offset -= n - if self.line_offset < 0: - self.line = None - else: - self.line = self.input_lines[self.line_offset] - self.notify_observers() - return self.line - - def goto_line(self, line_offset): - """Jump to absolute line offset `line_offset`, load and return it.""" - try: - try: - self.line_offset = line_offset - self.input_offset - self.line = self.input_lines[self.line_offset] - except IndexError: - self.line = None - raise EOFError - return self.line - finally: - self.notify_observers() - - def abs_line_offset(self): - """Return line offset of current line, from beginning of file.""" - return self.line_offset + self.input_offset - - def abs_line_number(self): - """Return line number of current line (counting from 1).""" - return self.line_offset + self.input_offset + 1 - - def insert_input(self, input_lines, source): - self.input_lines.insert(self.line_offset + 1, '', - source='internal padding') - self.input_lines.insert(self.line_offset + 1, '', - source='internal padding') - self.input_lines.insert(self.line_offset + 2, - StringList(input_lines, source)) - - def get_text_block(self, flush_left=0): - """ - Return a contiguous block of text. - - If `flush_left` is true, raise `UnexpectedIndentationError` if an - indented line is encountered before the text block ends (with a blank - line). - """ - try: - block = self.input_lines.get_text_block(self.line_offset, - flush_left) - self.next_line(len(block) - 1) - return block - except UnexpectedIndentationError, error: - block, source, lineno = error - self.next_line(len(block) - 1) # advance to last line of block - raise - - def check_line(self, context, state, transitions=None): - """ - Examine one line of input for a transition match & execute its method. - - Parameters: - - - `context`: application-dependent storage. - - `state`: a `State` object, the current state. - - `transitions`: an optional ordered list of transition names to try, - instead of ``state.transition_order``. - - Return the values returned by the transition method: - - - context: possibly modified from the parameter `context`; - - next state name (`State` subclass name); - - the result output of the transition, a list. - - When there is no match, ``state.no_match()`` is called and its return - value is returned. - """ - if transitions is None: - transitions = state.transition_order - state_correction = None - if self.debug: - print >>sys.stderr, ( - '\nStateMachine.check_line: state="%s", transitions=%r.' - % (state.__class__.__name__, transitions)) - for name in transitions: - pattern, method, next_state = state.transitions[name] - match = self.match(pattern) - if match: - if self.debug: - print >>sys.stderr, ( - '\nStateMachine.check_line: Matched transition ' - '"%s" in state "%s".' - % (name, state.__class__.__name__)) - return method(match, context, next_state) - else: - if self.debug: - print >>sys.stderr, ( - '\nStateMachine.check_line: No match in state "%s".' - % state.__class__.__name__) - return state.no_match(context, transitions) - - def match(self, pattern): - """ - Return the result of a regular expression match. - - Parameter `pattern`: an `re` compiled regular expression. - """ - return pattern.match(self.line) - - def add_state(self, state_class): - """ - Initialize & add a `state_class` (`State` subclass) object. - - Exception: `DuplicateStateError` raised if `state_class` was already - added. - """ - statename = state_class.__name__ - if self.states.has_key(statename): - raise DuplicateStateError(statename) - self.states[statename] = state_class(self, self.debug) - - def add_states(self, state_classes): - """ - Add `state_classes` (a list of `State` subclasses). - """ - for state_class in state_classes: - self.add_state(state_class) - - def runtime_init(self): - """ - Initialize `self.states`. - """ - for state in self.states.values(): - state.runtime_init() - - def error(self): - """Report error details.""" - type, value, module, line, function = _exception_data() - print >>sys.stderr, '%s: %s' % (type, value) - print >>sys.stderr, 'input line %s' % (self.abs_line_number()) - print >>sys.stderr, ('module %s, line %s, function %s' - % (module, line, function)) - - def attach_observer(self, observer): - """ - The `observer` parameter is a function or bound method which takes two - arguments, the source and offset of the current line. - """ - self.observers.append(observer) - - def detach_observer(self, observer): - self.observers.remove(observer) - - def notify_observers(self): - for observer in self.observers: - try: - info = self.input_lines.info(self.line_offset) - except IndexError: - info = (None, None) - observer(*info) - - -class State: - - """ - State superclass. Contains a list of transitions, and transition methods. - - Transition methods all have the same signature. They take 3 parameters: - - - An `re` match object. ``match.string`` contains the matched input line, - ``match.start()`` gives the start index of the match, and - ``match.end()`` gives the end index. - - A context object, whose meaning is application-defined (initial value - ``None``). It can be used to store any information required by the state - machine, and the retured context is passed on to the next transition - method unchanged. - - The name of the next state, a string, taken from the transitions list; - normally it is returned unchanged, but it may be altered by the - transition method if necessary. - - Transition methods all return a 3-tuple: - - - A context object, as (potentially) modified by the transition method. - - The next state name (a return value of ``None`` means no state change). - - The processing result, a list, which is accumulated by the state - machine. - - Transition methods may raise an `EOFError` to cut processing short. - - There are two implicit transitions, and corresponding transition methods - are defined: `bof()` handles the beginning-of-file, and `eof()` handles - the end-of-file. These methods have non-standard signatures and return - values. `bof()` returns the initial context and results, and may be used - to return a header string, or do any other processing needed. `eof()` - should handle any remaining context and wrap things up; it returns the - final processing result. - - Typical applications need only subclass `State` (or a subclass), set the - `patterns` and `initial_transitions` class attributes, and provide - corresponding transition methods. The default object initialization will - take care of constructing the list of transitions. - """ - - patterns = None - """ - {Name: pattern} mapping, used by `make_transition()`. Each pattern may - be a string or a compiled `re` pattern. Override in subclasses. - """ - - initial_transitions = None - """ - A list of transitions to initialize when a `State` is instantiated. - Each entry is either a transition name string, or a (transition name, next - state name) pair. See `make_transitions()`. Override in subclasses. - """ - - nested_sm = None - """ - The `StateMachine` class for handling nested processing. - - If left as ``None``, `nested_sm` defaults to the class of the state's - controlling state machine. Override it in subclasses to avoid the default. - """ - - nested_sm_kwargs = None - """ - Keyword arguments dictionary, passed to the `nested_sm` constructor. - - Two keys must have entries in the dictionary: - - - Key 'state_classes' must be set to a list of `State` classes. - - Key 'initial_state' must be set to the name of the initial state class. - - If `nested_sm_kwargs` is left as ``None``, 'state_classes' defaults to the - class of the current state, and 'initial_state' defaults to the name of - the class of the current state. Override in subclasses to avoid the - defaults. - """ - - def __init__(self, state_machine, debug=0): - """ - Initialize a `State` object; make & add initial transitions. - - Parameters: - - - `statemachine`: the controlling `StateMachine` object. - - `debug`: a boolean; produce verbose output if true (nonzero). - """ - - self.transition_order = [] - """A list of transition names in search order.""" - - self.transitions = {} - """ - A mapping of transition names to 3-tuples containing - (compiled_pattern, transition_method, next_state_name). Initialized as - an instance attribute dynamically (instead of as a class attribute) - because it may make forward references to patterns and methods in this - or other classes. - """ - - self.add_initial_transitions() - - self.state_machine = state_machine - """A reference to the controlling `StateMachine` object.""" - - self.debug = debug - """Debugging mode on/off.""" - - if self.nested_sm is None: - self.nested_sm = self.state_machine.__class__ - if self.nested_sm_kwargs is None: - self.nested_sm_kwargs = {'state_classes': [self.__class__], - 'initial_state': self.__class__.__name__} - - def runtime_init(self): - """ - Initialize this `State` before running the state machine; called from - `self.state_machine.run()`. - """ - pass - - def unlink(self): - """Remove circular references to objects no longer required.""" - self.state_machine = None - - def add_initial_transitions(self): - """Make and add transitions listed in `self.initial_transitions`.""" - if self.initial_transitions: - names, transitions = self.make_transitions( - self.initial_transitions) - self.add_transitions(names, transitions) - - def add_transitions(self, names, transitions): - """ - Add a list of transitions to the start of the transition list. - - Parameters: - - - `names`: a list of transition names. - - `transitions`: a mapping of names to transition tuples. - - Exceptions: `DuplicateTransitionError`, `UnknownTransitionError`. - """ - for name in names: - if self.transitions.has_key(name): - raise DuplicateTransitionError(name) - if not transitions.has_key(name): - raise UnknownTransitionError(name) - self.transition_order[:0] = names - self.transitions.update(transitions) - - def add_transition(self, name, transition): - """ - Add a transition to the start of the transition list. - - Parameter `transition`: a ready-made transition 3-tuple. - - Exception: `DuplicateTransitionError`. - """ - if self.transitions.has_key(name): - raise DuplicateTransitionError(name) - self.transition_order[:0] = [name] - self.transitions[name] = transition - - def remove_transition(self, name): - """ - Remove a transition by `name`. - - Exception: `UnknownTransitionError`. - """ - try: - del self.transitions[name] - self.transition_order.remove(name) - except: - raise UnknownTransitionError(name) - - def make_transition(self, name, next_state=None): - """ - Make & return a transition tuple based on `name`. - - This is a convenience function to simplify transition creation. - - Parameters: - - - `name`: a string, the name of the transition pattern & method. This - `State` object must have a method called '`name`', and a dictionary - `self.patterns` containing a key '`name`'. - - `next_state`: a string, the name of the next `State` object for this - transition. A value of ``None`` (or absent) implies no state change - (i.e., continue with the same state). - - Exceptions: `TransitionPatternNotFound`, `TransitionMethodNotFound`. - """ - if next_state is None: - next_state = self.__class__.__name__ - try: - pattern = self.patterns[name] - if not hasattr(pattern, 'match'): - pattern = re.compile(pattern) - except KeyError: - raise TransitionPatternNotFound( - '%s.patterns[%r]' % (self.__class__.__name__, name)) - try: - method = getattr(self, name) - except AttributeError: - raise TransitionMethodNotFound( - '%s.%s' % (self.__class__.__name__, name)) - return (pattern, method, next_state) - - def make_transitions(self, name_list): - """ - Return a list of transition names and a transition mapping. - - Parameter `name_list`: a list, where each entry is either a transition - name string, or a 1- or 2-tuple (transition name, optional next state - name). - """ - stringtype = type('') - names = [] - transitions = {} - for namestate in name_list: - if type(namestate) is stringtype: - transitions[namestate] = self.make_transition(namestate) - names.append(namestate) - else: - transitions[namestate[0]] = self.make_transition(*namestate) - names.append(namestate[0]) - return names, transitions - - def no_match(self, context, transitions): - """ - Called when there is no match from `StateMachine.check_line()`. - - Return the same values returned by transition methods: - - - context: unchanged; - - next state name: ``None``; - - empty result list. - - Override in subclasses to catch this event. - """ - return context, None, [] - - def bof(self, context): - """ - Handle beginning-of-file. Return unchanged `context`, empty result. - - Override in subclasses. - - Parameter `context`: application-defined storage. - """ - return context, [] - - def eof(self, context): - """ - Handle end-of-file. Return empty result. - - Override in subclasses. - - Parameter `context`: application-defined storage. - """ - return [] - - def nop(self, match, context, next_state): - """ - A "do nothing" transition method. - - Return unchanged `context` & `next_state`, empty result. Useful for - simple state changes (actionless transitions). - """ - return context, next_state, [] - - -class StateMachineWS(StateMachine): - - """ - `StateMachine` subclass specialized for whitespace recognition. - - There are three methods provided for extracting indented text blocks: - - - `get_indented()`: use when the indent is unknown. - - `get_known_indented()`: use when the indent is known for all lines. - - `get_first_known_indented()`: use when only the first line's indent is - known. - """ - - def get_indented(self, until_blank=0, strip_indent=1): - """ - Return a block of indented lines of text, and info. - - Extract an indented block where the indent is unknown for all lines. - - :Parameters: - - `until_blank`: Stop collecting at the first blank line if true - (1). - - `strip_indent`: Strip common leading indent if true (1, - default). - - :Return: - - the indented block (a list of lines of text), - - its indent, - - its first line offset from BOF, and - - whether or not it finished with a blank line. - """ - offset = self.abs_line_offset() - indented, indent, blank_finish = self.input_lines.get_indented( - self.line_offset, until_blank, strip_indent) - if indented: - self.next_line(len(indented) - 1) # advance to last indented line - while indented and not indented[0].strip(): - indented.trim_start() - offset += 1 - return indented, indent, offset, blank_finish - - def get_known_indented(self, indent, until_blank=0, strip_indent=1): - """ - Return an indented block and info. - - Extract an indented block where the indent is known for all lines. - Starting with the current line, extract the entire text block with at - least `indent` indentation (which must be whitespace, except for the - first line). - - :Parameters: - - `indent`: The number of indent columns/characters. - - `until_blank`: Stop collecting at the first blank line if true - (1). - - `strip_indent`: Strip `indent` characters of indentation if true - (1, default). - - :Return: - - the indented block, - - its first line offset from BOF, and - - whether or not it finished with a blank line. - """ - offset = self.abs_line_offset() - indented, indent, blank_finish = self.input_lines.get_indented( - self.line_offset, until_blank, strip_indent, - block_indent=indent) - self.next_line(len(indented) - 1) # advance to last indented line - while indented and not indented[0].strip(): - indented.trim_start() - offset += 1 - return indented, offset, blank_finish - - def get_first_known_indented(self, indent, until_blank=0, strip_indent=1, - strip_top=1): - """ - Return an indented block and info. - - Extract an indented block where the indent is known for the first line - and unknown for all other lines. - - :Parameters: - - `indent`: The first line's indent (# of columns/characters). - - `until_blank`: Stop collecting at the first blank line if true - (1). - - `strip_indent`: Strip `indent` characters of indentation if true - (1, default). - - `strip_top`: Strip blank lines from the beginning of the block. - - :Return: - - the indented block, - - its indent, - - its first line offset from BOF, and - - whether or not it finished with a blank line. - """ - offset = self.abs_line_offset() - indented, indent, blank_finish = self.input_lines.get_indented( - self.line_offset, until_blank, strip_indent, - first_indent=indent) - self.next_line(len(indented) - 1) # advance to last indented line - if strip_top: - while indented and not indented[0].strip(): - indented.trim_start() - offset += 1 - return indented, indent, offset, blank_finish - - -class StateWS(State): - - """ - State superclass specialized for whitespace (blank lines & indents). - - Use this class with `StateMachineWS`. The transitions 'blank' (for blank - lines) and 'indent' (for indented text blocks) are added automatically, - before any other transitions. The transition method `blank()` handles - blank lines and `indent()` handles nested indented blocks. Indented - blocks trigger a new state machine to be created by `indent()` and run. - The class of the state machine to be created is in `indent_sm`, and the - constructor keyword arguments are in the dictionary `indent_sm_kwargs`. - - The methods `known_indent()` and `firstknown_indent()` are provided for - indented blocks where the indent (all lines' and first line's only, - respectively) is known to the transition method, along with the attributes - `known_indent_sm` and `known_indent_sm_kwargs`. Neither transition method - is triggered automatically. - """ - - indent_sm = None - """ - The `StateMachine` class handling indented text blocks. - - If left as ``None``, `indent_sm` defaults to the value of - `State.nested_sm`. Override it in subclasses to avoid the default. - """ - - indent_sm_kwargs = None - """ - Keyword arguments dictionary, passed to the `indent_sm` constructor. - - If left as ``None``, `indent_sm_kwargs` defaults to the value of - `State.nested_sm_kwargs`. Override it in subclasses to avoid the default. - """ - - known_indent_sm = None - """ - The `StateMachine` class handling known-indented text blocks. - - If left as ``None``, `known_indent_sm` defaults to the value of - `indent_sm`. Override it in subclasses to avoid the default. - """ - - known_indent_sm_kwargs = None - """ - Keyword arguments dictionary, passed to the `known_indent_sm` constructor. - - If left as ``None``, `known_indent_sm_kwargs` defaults to the value of - `indent_sm_kwargs`. Override it in subclasses to avoid the default. - """ - - ws_patterns = {'blank': ' *$', - 'indent': ' +'} - """Patterns for default whitespace transitions. May be overridden in - subclasses.""" - - ws_initial_transitions = ('blank', 'indent') - """Default initial whitespace transitions, added before those listed in - `State.initial_transitions`. May be overridden in subclasses.""" - - def __init__(self, state_machine, debug=0): - """ - Initialize a `StateSM` object; extends `State.__init__()`. - - Check for indent state machine attributes, set defaults if not set. - """ - State.__init__(self, state_machine, debug) - if self.indent_sm is None: - self.indent_sm = self.nested_sm - if self.indent_sm_kwargs is None: - self.indent_sm_kwargs = self.nested_sm_kwargs - if self.known_indent_sm is None: - self.known_indent_sm = self.indent_sm - if self.known_indent_sm_kwargs is None: - self.known_indent_sm_kwargs = self.indent_sm_kwargs - - def add_initial_transitions(self): - """ - Add whitespace-specific transitions before those defined in subclass. - - Extends `State.add_initial_transitions()`. - """ - State.add_initial_transitions(self) - if self.patterns is None: - self.patterns = {} - self.patterns.update(self.ws_patterns) - names, transitions = self.make_transitions( - self.ws_initial_transitions) - self.add_transitions(names, transitions) - - def blank(self, match, context, next_state): - """Handle blank lines. Does nothing. Override in subclasses.""" - return self.nop(match, context, next_state) - - def indent(self, match, context, next_state): - """ - Handle an indented text block. Extend or override in subclasses. - - Recursively run the registered state machine for indented blocks - (`self.indent_sm`). - """ - indented, indent, line_offset, blank_finish = \ - self.state_machine.get_indented() - sm = self.indent_sm(debug=self.debug, **self.indent_sm_kwargs) - results = sm.run(indented, input_offset=line_offset) - return context, next_state, results - - def known_indent(self, match, context, next_state): - """ - Handle a known-indent text block. Extend or override in subclasses. - - Recursively run the registered state machine for known-indent indented - blocks (`self.known_indent_sm`). The indent is the length of the - match, ``match.end()``. - """ - indented, line_offset, blank_finish = \ - self.state_machine.get_known_indented(match.end()) - sm = self.known_indent_sm(debug=self.debug, - **self.known_indent_sm_kwargs) - results = sm.run(indented, input_offset=line_offset) - return context, next_state, results - - def first_known_indent(self, match, context, next_state): - """ - Handle an indented text block (first line's indent known). - - Extend or override in subclasses. - - Recursively run the registered state machine for known-indent indented - blocks (`self.known_indent_sm`). The indent is the length of the - match, ``match.end()``. - """ - indented, line_offset, blank_finish = \ - self.state_machine.get_first_known_indented(match.end()) - sm = self.known_indent_sm(debug=self.debug, - **self.known_indent_sm_kwargs) - results = sm.run(indented, input_offset=line_offset) - return context, next_state, results - - -class _SearchOverride: - - """ - Mix-in class to override `StateMachine` regular expression behavior. - - Changes regular expression matching, from the default `re.match()` - (succeeds only if the pattern matches at the start of `self.line`) to - `re.search()` (succeeds if the pattern matches anywhere in `self.line`). - When subclassing a `StateMachine`, list this class **first** in the - inheritance list of the class definition. - """ - - def match(self, pattern): - """ - Return the result of a regular expression search. - - Overrides `StateMachine.match()`. - - Parameter `pattern`: `re` compiled regular expression. - """ - return pattern.search(self.line) - - -class SearchStateMachine(_SearchOverride, StateMachine): - """`StateMachine` which uses `re.search()` instead of `re.match()`.""" - pass - - -class SearchStateMachineWS(_SearchOverride, StateMachineWS): - """`StateMachineWS` which uses `re.search()` instead of `re.match()`.""" - pass - - -class ViewList: - - """ - List with extended functionality: slices of ViewList objects are child - lists, linked to their parents. Changes made to a child list also affect - the parent list. A child list is effectively a "view" (in the SQL sense) - of the parent list. Changes to parent lists, however, do *not* affect - active child lists. If a parent list is changed, any active child lists - should be recreated. - - The start and end of the slice can be trimmed using the `trim_start()` and - `trim_end()` methods, without affecting the parent list. The link between - child and parent lists can be broken by calling `disconnect()` on the - child list. - - Also, ViewList objects keep track of the source & offset of each item. - This information is accessible via the `source()`, `offset()`, and - `info()` methods. - """ - - def __init__(self, initlist=None, source=None, items=None, - parent=None, parent_offset=None): - self.data = [] - """The actual list of data, flattened from various sources.""" - - self.items = [] - """A list of (source, offset) pairs, same length as `self.data`: the - source of each line and the offset of each line from the beginning of - its source.""" - - self.parent = parent - """The parent list.""" - - self.parent_offset = parent_offset - """Offset of this list from the beginning of the parent list.""" - - if isinstance(initlist, ViewList): - self.data = initlist.data[:] - self.items = initlist.items[:] - elif initlist is not None: - self.data = list(initlist) - if items: - self.items = items - else: - self.items = [(source, i) for i in range(len(initlist))] - assert len(self.data) == len(self.items), 'data mismatch' - - def __str__(self): - return str(self.data) - - def __repr__(self): - return '%s(%s, items=%s)' % (self.__class__.__name__, - self.data, self.items) - - def __lt__(self, other): return self.data < self.__cast(other) - def __le__(self, other): return self.data <= self.__cast(other) - def __eq__(self, other): return self.data == self.__cast(other) - def __ne__(self, other): return self.data != self.__cast(other) - def __gt__(self, other): return self.data > self.__cast(other) - def __ge__(self, other): return self.data >= self.__cast(other) - def __cmp__(self, other): return cmp(self.data, self.__cast(other)) - - def __cast(self, other): - if isinstance(other, ViewList): - return other.data - else: - return other - - def __contains__(self, item): return item in self.data - def __len__(self): return len(self.data) - - # The __getitem__()/__setitem__() methods check whether the index - # is a slice first, since native list objects start supporting - # them directly in Python 2.3 (no exception is raised when - # indexing a list with a slice object; they just work). - - def __getitem__(self, i): - if isinstance(i, _SliceType): - assert i.step in (None, 1), 'cannot handle slice with stride' - return self.__class__(self.data[i.start:i.stop], - items=self.items[i.start:i.stop], - parent=self, parent_offset=i.start) - else: - return self.data[i] - - def __setitem__(self, i, item): - if isinstance(i, _SliceType): - assert i.step in (None, 1), 'cannot handle slice with stride' - if not isinstance(item, ViewList): - raise TypeError('assigning non-ViewList to ViewList slice') - self.data[i.start:i.stop] = item.data - self.items[i.start:i.stop] = item.items - assert len(self.data) == len(self.items), 'data mismatch' - if self.parent: - self.parent[i.start + self.parent_offset - : i.stop + self.parent_offset] = item - else: - self.data[i] = item - if self.parent: - self.parent[i + self.parent_offset] = item - - def __delitem__(self, i): - try: - del self.data[i] - del self.items[i] - if self.parent: - del self.parent[i + self.parent_offset] - except TypeError: - assert i.step is None, 'cannot handle slice with stride' - del self.data[i.start:i.stop] - del self.items[i.start:i.stop] - if self.parent: - del self.parent[i.start + self.parent_offset - : i.stop + self.parent_offset] - - def __add__(self, other): - if isinstance(other, ViewList): - return self.__class__(self.data + other.data, - items=(self.items + other.items)) - else: - raise TypeError('adding non-ViewList to a ViewList') - - def __radd__(self, other): - if isinstance(other, ViewList): - return self.__class__(other.data + self.data, - items=(other.items + self.items)) - else: - raise TypeError('adding ViewList to a non-ViewList') - - def __iadd__(self, other): - if isinstance(other, ViewList): - self.data += other.data - else: - raise TypeError('argument to += must be a ViewList') - return self - - def __mul__(self, n): - return self.__class__(self.data * n, items=(self.items * n)) - - __rmul__ = __mul__ - - def __imul__(self, n): - self.data *= n - self.items *= n - return self - - def extend(self, other): - if not isinstance(other, ViewList): - raise TypeError('extending a ViewList with a non-ViewList') - if self.parent: - self.parent.insert(len(self.data) + self.parent_offset, other) - self.data.extend(other.data) - self.items.extend(other.items) - - def append(self, item, source=None, offset=0): - if source is None: - self.extend(item) - else: - if self.parent: - self.parent.insert(len(self.data) + self.parent_offset, item, - source, offset) - self.data.append(item) - self.items.append((source, offset)) - - def insert(self, i, item, source=None, offset=0): - if source is None: - if not isinstance(item, ViewList): - raise TypeError('inserting non-ViewList with no source given') - self.data[i:i] = item.data - self.items[i:i] = item.items - if self.parent: - index = (len(self.data) + i) % len(self.data) - self.parent.insert(index + self.parent_offset, item) - else: - self.data.insert(i, item) - self.items.insert(i, (source, offset)) - if self.parent: - index = (len(self.data) + i) % len(self.data) - self.parent.insert(index + self.parent_offset, item, - source, offset) - - def pop(self, i=-1): - if self.parent: - index = (len(self.data) + i) % len(self.data) - self.parent.pop(index + self.parent_offset) - self.items.pop(i) - return self.data.pop(i) - - def trim_start(self, n=1): - """ - Remove items from the start of the list, without touching the parent. - """ - if n > len(self.data): - raise IndexError("Size of trim too large; can't trim %s items " - "from a list of size %s." % (n, len(self.data))) - elif n < 0: - raise IndexError('Trim size must be >= 0.') - del self.data[:n] - del self.items[:n] - if self.parent: - self.parent_offset += n - - def trim_end(self, n=1): - """ - Remove items from the end of the list, without touching the parent. - """ - if n > len(self.data): - raise IndexError("Size of trim too large; can't trim %s items " - "from a list of size %s." % (n, len(self.data))) - elif n < 0: - raise IndexError('Trim size must be >= 0.') - del self.data[-n:] - del self.items[-n:] - - def remove(self, item): - index = self.index(item) - del self[index] - - def count(self, item): return self.data.count(item) - def index(self, item): return self.data.index(item) - - def reverse(self): - self.data.reverse() - self.items.reverse() - self.parent = None - - def sort(self, *args): - tmp = zip(self.data, self.items) - tmp.sort(*args) - self.data = [entry[0] for entry in tmp] - self.items = [entry[1] for entry in tmp] - self.parent = None - - def info(self, i): - """Return source & offset for index `i`.""" - try: - return self.items[i] - except IndexError: - if i == len(self.data): # Just past the end - return self.items[i - 1][0], None - else: - raise - - def source(self, i): - """Return source for index `i`.""" - return self.info(i)[0] - - def offset(self, i): - """Return offset for index `i`.""" - return self.info(i)[1] - - def disconnect(self): - """Break link between this list and parent list.""" - self.parent = None - - -class StringList(ViewList): - - """A `ViewList` with string-specific methods.""" - - def strip_indent(self, length, start=0, end=sys.maxint): - """ - Strip `length` characters off the beginning of each item, in-place, - from index `start` to `end`. No whitespace-checking is done on the - stripped text. Does not affect slice parent. - """ - self.data[start:end] = [line[length:] - for line in self.data[start:end]] - - def get_text_block(self, start, flush_left=0): - """ - Return a contiguous block of text. - - If `flush_left` is true, raise `UnexpectedIndentationError` if an - indented line is encountered before the text block ends (with a blank - line). - """ - end = start - last = len(self.data) - while end < last: - line = self.data[end] - if not line.strip(): - break - if flush_left and (line[0] == ' '): - source, offset = self.info(end) - raise UnexpectedIndentationError(self[start:end], source, - offset + 1) - end += 1 - return self[start:end] - - def get_indented(self, start=0, until_blank=0, strip_indent=1, - block_indent=None, first_indent=None): - """ - Extract and return a StringList of indented lines of text. - - Collect all lines with indentation, determine the minimum indentation, - remove the minimum indentation from all indented lines (unless - `strip_indent` is false), and return them. All lines up to but not - including the first unindented line will be returned. - - :Parameters: - - `start`: The index of the first line to examine. - - `until_blank`: Stop collecting at the first blank line if true. - - `strip_indent`: Strip common leading indent if true (default). - - `block_indent`: The indent of the entire block, if known. - - `first_indent`: The indent of the first line, if known. - - :Return: - - a StringList of indented lines with mininum indent removed; - - the amount of the indent; - - a boolean: did the indented block finish with a blank line or EOF? - """ - indent = block_indent # start with None if unknown - end = start - if block_indent is not None and first_indent is None: - first_indent = block_indent - if first_indent is not None: - end += 1 - last = len(self.data) - while end < last: - line = self.data[end] - if line and (line[0] != ' ' - or (block_indent is not None - and line[:block_indent].strip())): - # Line not indented or insufficiently indented. - # Block finished properly iff the last indented line blank: - blank_finish = ((end > start) - and not self.data[end - 1].strip()) - break - stripped = line.lstrip() - if not stripped: # blank line - if until_blank: - blank_finish = 1 - break - elif block_indent is None: - line_indent = len(line) - len(stripped) - if indent is None: - indent = line_indent - else: - indent = min(indent, line_indent) - end += 1 - else: - blank_finish = 1 # block ends at end of lines - block = self[start:end] - if first_indent is not None and block: - block.data[0] = block.data[0][first_indent:] - if indent and strip_indent: - block.strip_indent(indent, start=(first_indent is not None)) - return block, indent or 0, blank_finish - - -class StateMachineError(Exception): pass -class UnknownStateError(StateMachineError): pass -class DuplicateStateError(StateMachineError): pass -class UnknownTransitionError(StateMachineError): pass -class DuplicateTransitionError(StateMachineError): pass -class TransitionPatternNotFound(StateMachineError): pass -class TransitionMethodNotFound(StateMachineError): pass -class UnexpectedIndentationError(StateMachineError): pass - - -class TransitionCorrection(Exception): - - """ - Raise from within a transition method to switch to another transition. - - Raise with one argument, the new transition name. - """ - - -class StateCorrection(Exception): - - """ - Raise from within a transition method to switch to another state. - - Raise with one or two arguments: new state name, and an optional new - transition name. - """ - - -def string2lines(astring, tab_width=8, convert_whitespace=0, - whitespace=re.compile('[\v\f]')): - """ - Return a list of one-line strings with tabs expanded and no newlines. - - Each tab is expanded with between 1 and `tab_width` spaces, so that the - next character's index becomes a multiple of `tab_width` (8 by default). - - Parameters: - - - `astring`: a multi-line string. - - `tab_width`: the number of columns between tab stops. - - `convert_whitespace`: convert form feeds and vertical tabs to spaces? - """ - if convert_whitespace: - astring = whitespace.sub(' ', astring) - return [s.expandtabs(tab_width) for s in astring.splitlines()] - -def _exception_data(): - """ - Return exception information: - - - the exception's class name; - - the exception object; - - the name of the file containing the offending code; - - the line number of the offending code; - - the function name of the offending code. - """ - type, value, traceback = sys.exc_info() - while traceback.tb_next: - traceback = traceback.tb_next - code = traceback.tb_frame.f_code - return (type.__name__, value, code.co_filename, traceback.tb_lineno, - code.co_name) diff --git a/docutils/docutils/transforms/__init__.py b/docutils/docutils/transforms/__init__.py deleted file mode 100644 index 24cc4771f..000000000 --- a/docutils/docutils/transforms/__init__.py +++ /dev/null @@ -1,166 +0,0 @@ -# Authors: David Goodger, Ueli Schlaepfer -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -This package contains modules for standard tree transforms available -to Docutils components. Tree transforms serve a variety of purposes: - -- To tie up certain syntax-specific "loose ends" that remain after the - initial parsing of the input plaintext. These transforms are used to - supplement a limited syntax. - -- To automate the internal linking of the document tree (hyperlink - references, footnote references, etc.). - -- To extract useful information from the document tree. These - transforms may be used to construct (for example) indexes and tables - of contents. - -Each transform is an optional step that a Docutils Reader may choose to -perform on the parsed document, depending on the input context. A Docutils -Reader may also perform Reader-specific transforms before or after performing -these standard transforms. -""" - -__docformat__ = 'reStructuredText' - - -from docutils import languages, ApplicationError, TransformSpec - - -class TransformError(ApplicationError): pass - - -class Transform: - - """ - Docutils transform component abstract base class. - """ - - default_priority = None - """Numerical priority of this transform, 0 through 999 (override).""" - - def __init__(self, document, startnode=None): - """ - Initial setup for in-place document transforms. - """ - - self.document = document - """The document tree to transform.""" - - self.startnode = startnode - """Node from which to begin the transform. For many transforms which - apply to the document as a whole, `startnode` is not set (i.e. its - value is `None`).""" - - self.language = languages.get_language( - document.settings.language_code) - """Language module local to this document.""" - - def apply(self): - """Override to apply the transform to the document tree.""" - raise NotImplementedError('subclass must override this method') - - -class Transformer(TransformSpec): - - """ - Stores transforms (`Transform` classes) and applies them to document - trees. Also keeps track of components by component type name. - """ - - from docutils.transforms import universal - - default_transforms = (universal.Decorations, - universal.FinalChecks, - universal.Messages) - """These transforms are applied to all document trees.""" - - def __init__(self, document): - self.transforms = [] - """List of transforms to apply. Each item is a 3-tuple: - ``(priority string, transform class, pending node or None)``.""" - - self.document = document - """The `nodes.document` object this Transformer is attached to.""" - - self.applied = [] - """Transforms already applied, in order.""" - - self.sorted = 0 - """Boolean: is `self.tranforms` sorted?""" - - self.components = {} - """Mapping of component type name to component object. Set by - `self.populate_from_components()`.""" - - self.serialno = 0 - """Internal serial number to keep track of the add order of - transforms.""" - - def add_transform(self, transform_class, priority=None): - """ - Store a single transform. Use `priority` to override the default. - """ - if priority is None: - priority = transform_class.default_priority - priority_string = self.get_priority_string(priority) - self.transforms.append((priority_string, transform_class, None)) - self.sorted = 0 - - def add_transforms(self, transform_list): - """Store multiple transforms, with default priorities.""" - for transform_class in transform_list: - priority_string = self.get_priority_string( - transform_class.default_priority) - self.transforms.append((priority_string, transform_class, None)) - self.sorted = 0 - - def add_pending(self, pending, priority=None): - """Store a transform with an associated `pending` node.""" - transform_class = pending.transform - if priority is None: - priority = transform_class.default_priority - priority_string = self.get_priority_string(priority) - self.transforms.append((priority_string, transform_class, pending)) - self.sorted = 0 - - def get_priority_string(self, priority): - """ - Return a string, `priority` combined with `self.serialno`. - - This ensures FIFO order on transforms with identical priority. - """ - self.serialno += 1 - return '%03d-%03d' % (priority, self.serialno) - - def populate_from_components(self, components): - """ - Store each component's default transforms, with default priorities. - Also, store components by type name in a mapping for later lookup. - """ - self.add_transforms(self.default_transforms) - for component in components: - if component is None: - continue - self.add_transforms(component.default_transforms) - self.components[component.component_type] = component - self.sorted = 0 - - def apply_transforms(self): - """Apply all of the stored transforms, in priority order.""" - self.document.reporter.attach_observer( - self.document.note_transform_message) - while self.transforms: - if not self.sorted: - # Unsorted initially, and whenever a transform is added. - self.transforms.sort() - self.transforms.reverse() - self.sorted = 1 - priority, transform_class, pending = self.transforms.pop() - transform = transform_class(self.document, startnode=pending) - transform.apply() - self.applied.append((priority, transform_class, pending)) diff --git a/docutils/docutils/transforms/components.py b/docutils/docutils/transforms/components.py deleted file mode 100644 index 8f4a267e1..000000000 --- a/docutils/docutils/transforms/components.py +++ /dev/null @@ -1,54 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Docutils component-related transforms. -""" - -__docformat__ = 'reStructuredText' - -import sys -import os -import re -import time -from docutils import nodes, utils -from docutils import ApplicationError, DataError -from docutils.transforms import Transform, TransformError - - -class Filter(Transform): - - """ - Include or exclude elements which depend on a specific Docutils component. - - For use with `nodes.pending` elements. A "pending" element's dictionary - attribute ``details`` must contain the keys "component" and "format". The - value of ``details['component']`` must match the type name of the - component the elements depend on (e.g. "writer"). The value of - ``details['format']`` is the name of a specific format or context of that - component (e.g. "html"). If the matching Docutils component supports that - format or context, the "pending" element is replaced by the contents of - ``details['nodes']`` (a list of nodes); otherwise, the "pending" element - is removed. - - For example, the reStructuredText "meta" directive creates a "pending" - element containing a "meta" element (in ``pending.details['nodes']``). - Only writers (``pending.details['component'] == 'writer'``) supporting the - "html" format (``pending.details['format'] == 'html'``) will include the - "meta" element; it will be deleted from the output of all other writers. - """ - - default_priority = 780 - - def apply(self): - pending = self.startnode - component_type = pending.details['component'] # 'reader' or 'writer' - format = pending.details['format'] - component = self.document.transformer.components[component_type] - if component.supports(format): - pending.parent.replace(pending, pending.details['nodes']) - else: - pending.parent.remove(pending) diff --git a/docutils/docutils/transforms/frontmatter.py b/docutils/docutils/transforms/frontmatter.py deleted file mode 100644 index 00afc6fd2..000000000 --- a/docutils/docutils/transforms/frontmatter.py +++ /dev/null @@ -1,399 +0,0 @@ -# Authors: David Goodger, Ueli Schlaepfer -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Transforms related to the front matter of a document (information -found before the main text): - -- `DocTitle`: Used to transform a lone top level section's title to - the document title, and promote a remaining lone top-level section's - title to the document subtitle. - -- `DocInfo`: Used to transform a bibliographic field list into docinfo - elements. -""" - -__docformat__ = 'reStructuredText' - -import re -from docutils import nodes, utils -from docutils.transforms import TransformError, Transform - - -class DocTitle(Transform): - - """ - In reStructuredText_, there is no way to specify a document title - and subtitle explicitly. Instead, we can supply the document title - (and possibly the subtitle as well) implicitly, and use this - two-step transform to "raise" or "promote" the title(s) (and their - corresponding section contents) to the document level. - - 1. If the document contains a single top-level section as its - first non-comment element, the top-level section's title - becomes the document's title, and the top-level section's - contents become the document's immediate contents. The lone - top-level section header must be the first non-comment element - in the document. - - For example, take this input text:: - - ================= - Top-Level Title - ================= - - A paragraph. - - Once parsed, it looks like this:: - - <document> - <section name="top-level title"> - <title> - Top-Level Title - <paragraph> - A paragraph. - - After running the DocTitle transform, we have:: - - <document name="top-level title"> - <title> - Top-Level Title - <paragraph> - A paragraph. - - 2. If step 1 successfully determines the document title, we - continue by checking for a subtitle. - - If the lone top-level section itself contains a single - second-level section as its first non-comment element, that - section's title is promoted to the document's subtitle, and - that section's contents become the document's immediate - contents. Given this input text:: - - ================= - Top-Level Title - ================= - - Second-Level Title - ~~~~~~~~~~~~~~~~~~ - - A paragraph. - - After parsing and running the Section Promotion transform, the - result is:: - - <document name="top-level title"> - <title> - Top-Level Title - <subtitle name="second-level title"> - Second-Level Title - <paragraph> - A paragraph. - - (Note that the implicit hyperlink target generated by the - "Second-Level Title" is preserved on the "subtitle" element - itself.) - - Any comment elements occurring before the document title or - subtitle are accumulated and inserted as the first body elements - after the title(s). - """ - - default_priority = 320 - - def apply(self): - if not getattr(self.document.settings, 'doctitle_xform', 1): - return - if self.promote_document_title(): - self.promote_document_subtitle() - - def promote_document_title(self): - section, index = self.candidate_index() - if index is None: - return None - document = self.document - # Transfer the section's attributes to the document element (at root): - document.attributes.update(section.attributes) - document[:] = (section[:1] # section title - + document[:index] # everything that was in the - # document before the section - + section[1:]) # everything that was in the section - return 1 - - def promote_document_subtitle(self): - subsection, index = self.candidate_index() - if index is None: - return None - subtitle = nodes.subtitle() - # Transfer the subsection's attributes to the new subtitle: - subtitle.attributes.update(subsection.attributes) - # Transfer the contents of the subsection's title to the subtitle: - subtitle[:] = subsection[0][:] - document = self.document - document[:] = (document[:1] # document title - + [subtitle] - # everything that was before the section: - + document[1:index] - # everything that was in the subsection: - + subsection[1:]) - return 1 - - def candidate_index(self): - """ - Find and return the promotion candidate and its index. - - Return (None, None) if no valid candidate was found. - """ - document = self.document - index = document.first_child_not_matching_class( - nodes.PreBibliographic) - if index is None or len(document) > (index + 1) or \ - not isinstance(document[index], nodes.section): - return None, None - else: - return document[index], index - - -class DocInfo(Transform): - - """ - This transform is specific to the reStructuredText_ markup syntax; - see "Bibliographic Fields" in the `reStructuredText Markup - Specification`_ for a high-level description. This transform - should be run *after* the `DocTitle` transform. - - Given a field list as the first non-comment element after the - document title and subtitle (if present), registered bibliographic - field names are transformed to the corresponding DTD elements, - becoming child elements of the "docinfo" element (except for a - dedication and/or an abstract, which become "topic" elements after - "docinfo"). - - For example, given this document fragment after parsing:: - - <document> - <title> - Document Title - <field_list> - <field> - <field_name> - Author - <field_body> - <paragraph> - A. Name - <field> - <field_name> - Status - <field_body> - <paragraph> - $RCSfile$ - ... - - After running the bibliographic field list transform, the - resulting document tree would look like this:: - - <document> - <title> - Document Title - <docinfo> - <author> - A. Name - <status> - frontmatter.py - ... - - The "Status" field contained an expanded RCS keyword, which is - normally (but optionally) cleaned up by the transform. The sole - contents of the field body must be a paragraph containing an - expanded RCS keyword of the form "$keyword: expansion text $". Any - RCS keyword can be processed in any bibliographic field. The - dollar signs and leading RCS keyword name are removed. Extra - processing is done for the following RCS keywords: - - - "RCSfile" expands to the name of the file in the RCS or CVS - repository, which is the name of the source file with a ",v" - suffix appended. The transform will remove the ",v" suffix. - - - "Date" expands to the format "YYYY/MM/DD hh:mm:ss" (in the UTC - time zone). The RCS Keywords transform will extract just the - date itself and transform it to an ISO 8601 format date, as in - "2000-12-31". - - (Since the source file for this text is itself stored under CVS, - we can't show an example of the "Date" RCS keyword because we - can't prevent any RCS keywords used in this explanation from - being expanded. Only the "RCSfile" keyword is stable; its - expansion text changes only if the file name changes.) - """ - - default_priority = 340 - - biblio_nodes = { - 'author': nodes.author, - 'authors': nodes.authors, - 'organization': nodes.organization, - 'address': nodes.address, - 'contact': nodes.contact, - 'version': nodes.version, - 'revision': nodes.revision, - 'status': nodes.status, - 'date': nodes.date, - 'copyright': nodes.copyright, - 'dedication': nodes.topic, - 'abstract': nodes.topic} - """Canonical field name (lowcased) to node class name mapping for - bibliographic fields (field_list).""" - - def apply(self): - if not getattr(self.document.settings, 'docinfo_xform', 1): - return - document = self.document - index = document.first_child_not_matching_class( - nodes.PreBibliographic) - if index is None: - return - candidate = document[index] - if isinstance(candidate, nodes.field_list): - biblioindex = document.first_child_not_matching_class( - nodes.Titular) - nodelist = self.extract_bibliographic(candidate) - del document[index] # untransformed field list (candidate) - document[biblioindex:biblioindex] = nodelist - return - - def extract_bibliographic(self, field_list): - docinfo = nodes.docinfo() - bibliofields = self.language.bibliographic_fields - labels = self.language.labels - topics = {'dedication': None, 'abstract': None} - for field in field_list: - try: - name = field[0][0].astext() - normedname = nodes.fully_normalize_name(name) - if not (len(field) == 2 and bibliofields.has_key(normedname) - and self.check_empty_biblio_field(field, name)): - raise TransformError - canonical = bibliofields[normedname] - biblioclass = self.biblio_nodes[canonical] - if issubclass(biblioclass, nodes.TextElement): - if not self.check_compound_biblio_field(field, name): - raise TransformError - utils.clean_rcs_keywords( - field[1][0], self.rcs_keyword_substitutions) - docinfo.append(biblioclass('', '', *field[1][0])) - elif issubclass(biblioclass, nodes.authors): - self.extract_authors(field, name, docinfo) - elif issubclass(biblioclass, nodes.topic): - if topics[canonical]: - field[-1] += self.document.reporter.warning( - 'There can only be one "%s" field.' % name, - base_node=field) - raise TransformError - title = nodes.title(name, labels[canonical]) - topics[canonical] = biblioclass( - '', title, CLASS=canonical, *field[1].children) - else: - docinfo.append(biblioclass('', *field[1].children)) - except TransformError: - if len(field[-1]) == 1 \ - and isinstance(field[-1][0], nodes.paragraph): - utils.clean_rcs_keywords( - field[-1][0], self.rcs_keyword_substitutions) - docinfo.append(field) - nodelist = [] - if len(docinfo) != 0: - nodelist.append(docinfo) - for name in ('dedication', 'abstract'): - if topics[name]: - nodelist.append(topics[name]) - return nodelist - - def check_empty_biblio_field(self, field, name): - if len(field[-1]) < 1: - field[-1] += self.document.reporter.warning( - 'Cannot extract empty bibliographic field "%s".' % name, - base_node=field) - return None - return 1 - - def check_compound_biblio_field(self, field, name): - if len(field[-1]) > 1: - field[-1] += self.document.reporter.warning( - 'Cannot extract compound bibliographic field "%s".' % name, - base_node=field) - return None - if not isinstance(field[-1][0], nodes.paragraph): - field[-1] += self.document.reporter.warning( - 'Cannot extract bibliographic field "%s" containing ' - 'anything other than a single paragraph.' % name, - base_node=field) - return None - return 1 - - rcs_keyword_substitutions = [ - (re.compile(r'\$' r'Date: (\d\d\d\d)/(\d\d)/(\d\d) [\d:]+ \$$', - re.IGNORECASE), r'\1-\2-\3'), - (re.compile(r'\$' r'RCSfile: (.+),v \$$', re.IGNORECASE), r'\1'), - (re.compile(r'\$[a-zA-Z]+: (.+) \$$'), r'\1'),] - - def extract_authors(self, field, name, docinfo): - try: - if len(field[1]) == 1: - if isinstance(field[1][0], nodes.paragraph): - authors = self.authors_from_one_paragraph(field) - elif isinstance(field[1][0], nodes.bullet_list): - authors = self.authors_from_bullet_list(field) - else: - raise TransformError - else: - authors = self.authors_from_paragraphs(field) - authornodes = [nodes.author('', '', *author) - for author in authors if author] - if len(authornodes) > 1: - docinfo.append(nodes.authors('', *authornodes)) - elif len(authornodes) == 1: - docinfo.append(authornodes[0]) - else: - raise TransformError - except TransformError: - field[-1] += self.document.reporter.warning( - 'Bibliographic field "%s" incompatible with extraction: ' - 'it must contain either a single paragraph (with authors ' - 'separated by one of "%s"), multiple paragraphs (one per ' - 'author), or a bullet list with one paragraph (one author) ' - 'per item.' - % (name, ''.join(self.language.author_separators)), - base_node=field) - raise - - def authors_from_one_paragraph(self, field): - text = field[1][0].astext().strip() - if not text: - raise TransformError - for authorsep in self.language.author_separators: - authornames = text.split(authorsep) - if len(authornames) > 1: - break - authornames = [author.strip() for author in authornames] - authors = [[nodes.Text(author)] for author in authornames if author] - return authors - - def authors_from_bullet_list(self, field): - authors = [] - for item in field[1][0]: - if len(item) != 1 or not isinstance(item[0], nodes.paragraph): - raise TransformError - authors.append(item[0].children) - if not authors: - raise TransformError - return authors - - def authors_from_paragraphs(self, field): - for item in field[1]: - if not isinstance(item, nodes.paragraph): - raise TransformError - authors = [item.children for item in field[1]] - return authors diff --git a/docutils/docutils/transforms/misc.py b/docutils/docutils/transforms/misc.py deleted file mode 100644 index 4f6e2670b..000000000 --- a/docutils/docutils/transforms/misc.py +++ /dev/null @@ -1,62 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Miscellaneous transforms. -""" - -__docformat__ = 'reStructuredText' - -from docutils import nodes -from docutils.transforms import Transform, TransformError - - -class CallBack(Transform): - - """ - Inserts a callback into a document. The callback is called when the - transform is applied, which is determined by its priority. - - For use with `nodes.pending` elements. Requires a ``details['callback']`` - entry, a bound method or function which takes one parameter: the pending - node. Other data can be stored in the ``details`` attribute or in the - object hosting the callback method. - """ - - default_priority = 990 - - def apply(self): - pending = self.startnode - pending.details['callback'](pending) - pending.parent.remove(pending) - - -class ClassAttribute(Transform): - - default_priority = 210 - - def apply(self): - pending = self.startnode - class_value = pending.details['class'] - parent = pending.parent - child = pending - while parent: - for index in range(parent.index(child) + 1, len(parent)): - element = parent[index] - if isinstance(element, nodes.comment): - continue - element.set_class(class_value) - pending.parent.remove(pending) - return - else: - child = parent - parent = parent.parent - error = self.document.reporter.error( - 'No suitable element following "%s" directive' - % pending.details['directive'], - nodes.literal_block(pending.rawsource, pending.rawsource), - line=pending.line) - pending.parent.replace(pending, error) diff --git a/docutils/docutils/transforms/parts.py b/docutils/docutils/transforms/parts.py deleted file mode 100644 index 016f4e1d8..000000000 --- a/docutils/docutils/transforms/parts.py +++ /dev/null @@ -1,176 +0,0 @@ -# Authors: David Goodger, Ueli Schlaepfer, Dmitry Jemerov -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Transforms related to document parts. -""" - -__docformat__ = 'reStructuredText' - - -import re -import sys -from docutils import nodes, utils -from docutils.transforms import TransformError, Transform - - -class SectNum(Transform): - - """ - Automatically assigns numbers to the titles of document sections. - - It is possible to limit the maximum section level for which the numbers - are added. For those sections that are auto-numbered, the "autonum" - attribute is set, informing the contents table generator that a different - form of the TOC should be used. - """ - - default_priority = 710 - """Should be applied before `Contents`.""" - - def apply(self): - self.maxdepth = self.startnode.details.get('depth', sys.maxint) - self.startnode.parent.remove(self.startnode) - self.update_section_numbers(self.document) - - def update_section_numbers(self, node, prefix=(), depth=0): - depth += 1 - sectnum = 1 - for child in node: - if isinstance(child, nodes.section): - numbers = prefix + (str(sectnum),) - title = child[0] - # Use   for spacing: - generated = nodes.generated( - '', '.'.join(numbers) + u'\u00a0' * 3, CLASS='sectnum') - title.insert(0, generated) - title['auto'] = 1 - if depth < self.maxdepth: - self.update_section_numbers(child, numbers, depth) - sectnum += 1 - - -class Contents(Transform): - - """ - This transform generates a table of contents from the entire document tree - or from a single branch. It locates "section" elements and builds them - into a nested bullet list, which is placed within a "topic". A title is - either explicitly specified, taken from the appropriate language module, - or omitted (local table of contents). The depth may be specified. - Two-way references between the table of contents and section titles are - generated (requires Writer support). - - This transform requires a startnode, which which contains generation - options and provides the location for the generated table of contents (the - startnode is replaced by the table of contents "topic"). - """ - - default_priority = 720 - - def apply(self): - topic = nodes.topic(CLASS='contents') - details = self.startnode.details - if details.has_key('class'): - topic.set_class(details['class']) - title = details['title'] - if details.has_key('local'): - startnode = self.startnode.parent - # @@@ generate an error if the startnode (directive) not at - # section/document top-level? Drag it up until it is? - while not isinstance(startnode, nodes.Structural): - startnode = startnode.parent - else: - startnode = self.document - if not title: - title = nodes.title('', self.language.labels['contents']) - if title: - name = title.astext() - topic += title - else: - name = self.language.labels['contents'] - name = nodes.fully_normalize_name(name) - if not self.document.has_name(name): - topic['name'] = name - self.document.note_implicit_target(topic) - self.toc_id = topic['id'] - if details.has_key('backlinks'): - self.backlinks = details['backlinks'] - else: - self.backlinks = self.document.settings.toc_backlinks - contents = self.build_contents(startnode) - if len(contents): - topic += contents - self.startnode.parent.replace(self.startnode, topic) - else: - self.startnode.parent.remove(self.startnode) - - def build_contents(self, node, level=0): - level += 1 - sections = [] - i = len(node) - 1 - while i >= 0 and isinstance(node[i], nodes.section): - sections.append(node[i]) - i -= 1 - sections.reverse() - entries = [] - autonum = 0 - depth = self.startnode.details.get('depth', sys.maxint) - for section in sections: - title = section[0] - auto = title.get('auto') # May be set by SectNum. - entrytext = self.copy_and_filter(title) - reference = nodes.reference('', '', refid=section['id'], - *entrytext) - ref_id = self.document.set_id(reference) - entry = nodes.paragraph('', '', reference) - item = nodes.list_item('', entry) - if self.backlinks == 'entry': - title['refid'] = ref_id - elif self.backlinks == 'top': - title['refid'] = self.toc_id - if level < depth: - subsects = self.build_contents(section, level) - item += subsects - entries.append(item) - if entries: - contents = nodes.bullet_list('', *entries) - if auto: - contents.set_class('auto-toc') - return contents - else: - return [] - - def copy_and_filter(self, node): - """Return a copy of a title, with references, images, etc. removed.""" - visitor = ContentsFilter(self.document) - node.walkabout(visitor) - return visitor.get_entry_text() - - -class ContentsFilter(nodes.TreeCopyVisitor): - - def get_entry_text(self): - return self.get_tree_copy().get_children() - - def visit_citation_reference(self, node): - raise nodes.SkipNode - - def visit_footnote_reference(self, node): - raise nodes.SkipNode - - def visit_image(self, node): - if node.hasattr('alt'): - self.parent.append(nodes.Text(node['alt'])) - raise nodes.SkipNode - - def ignore_node_but_process_children(self, node): - raise nodes.SkipDeparture - - visit_interpreted = ignore_node_but_process_children - visit_problematic = ignore_node_but_process_children - visit_reference = ignore_node_but_process_children - visit_target = ignore_node_but_process_children diff --git a/docutils/docutils/transforms/peps.py b/docutils/docutils/transforms/peps.py deleted file mode 100644 index 9ae7fa80b..000000000 --- a/docutils/docutils/transforms/peps.py +++ /dev/null @@ -1,294 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Transforms for PEP processing. - -- `Headers`: Used to transform a PEP's initial RFC-2822 header. It remains a - field list, but some entries get processed. -- `Contents`: Auto-inserts a table of contents. -- `PEPZero`: Special processing for PEP 0. -""" - -__docformat__ = 'reStructuredText' - -import sys -import os -import re -import time -from docutils import nodes, utils -from docutils import ApplicationError, DataError -from docutils.transforms import Transform, TransformError -from docutils.transforms import parts, references, misc - - -class Headers(Transform): - - """ - Process fields in a PEP's initial RFC-2822 header. - """ - - default_priority = 360 - - pep_url = 'pep-%04d.html' - pep_cvs_url = ('http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/' - 'python/nondist/peps/pep-%04d.txt') - rcs_keyword_substitutions = ( - (re.compile(r'\$' r'RCSfile: (.+),v \$$', re.IGNORECASE), r'\1'), - (re.compile(r'\$[a-zA-Z]+: (.+) \$$'), r'\1'),) - - def apply(self): - if not len(self.document): - # @@@ replace these DataErrors with proper system messages - raise DataError('Document tree is empty.') - header = self.document[0] - if not isinstance(header, nodes.field_list) or \ - header.get('class') != 'rfc2822': - raise DataError('Document does not begin with an RFC-2822 ' - 'header; it is not a PEP.') - pep = None - for field in header: - if field[0].astext().lower() == 'pep': # should be the first field - value = field[1].astext() - try: - pep = int(value) - cvs_url = self.pep_cvs_url % pep - except ValueError: - pep = value - cvs_url = None - msg = self.document.reporter.warning( - '"PEP" header must contain an integer; "%s" is an ' - 'invalid value.' % pep, base_node=field) - msgid = self.document.set_id(msg) - prb = nodes.problematic(value, value or '(none)', - refid=msgid) - prbid = self.document.set_id(prb) - msg.add_backref(prbid) - if len(field[1]): - field[1][0][:] = [prb] - else: - field[1] += nodes.paragraph('', '', prb) - break - if pep is None: - raise DataError('Document does not contain an RFC-2822 "PEP" ' - 'header.') - if pep == 0: - # Special processing for PEP 0. - pending = nodes.pending(PEPZero) - self.document.insert(1, pending) - self.document.note_pending(pending) - if len(header) < 2 or header[1][0].astext().lower() != 'title': - raise DataError('No title!') - for field in header: - name = field[0].astext().lower() - body = field[1] - if len(body) > 1: - raise DataError('PEP header field body contains multiple ' - 'elements:\n%s' % field.pformat(level=1)) - elif len(body) == 1: - if not isinstance(body[0], nodes.paragraph): - raise DataError('PEP header field body may only contain ' - 'a single paragraph:\n%s' - % field.pformat(level=1)) - elif name == 'last-modified': - date = time.strftime( - '%d-%b-%Y', - time.localtime(os.stat(self.document['source'])[8])) - if cvs_url: - body += nodes.paragraph( - '', '', nodes.reference('', date, refuri=cvs_url)) - else: - # empty - continue - para = body[0] - if name == 'author': - for node in para: - if isinstance(node, nodes.reference): - node.parent.replace(node, mask_email(node)) - elif name == 'discussions-to': - for node in para: - if isinstance(node, nodes.reference): - node.parent.replace(node, mask_email(node, pep)) - elif name in ('replaces', 'replaced-by', 'requires'): - newbody = [] - space = nodes.Text(' ') - for refpep in re.split(',?\s+', body.astext()): - pepno = int(refpep) - newbody.append(nodes.reference( - refpep, refpep, refuri=self.pep_url % pepno)) - newbody.append(space) - para[:] = newbody[:-1] # drop trailing space - elif name == 'last-modified': - utils.clean_rcs_keywords(para, self.rcs_keyword_substitutions) - if cvs_url: - date = para.astext() - para[:] = [nodes.reference('', date, refuri=cvs_url)] - elif name == 'content-type': - pep_type = para.astext() - uri = self.pep_url % 12 - para[:] = [nodes.reference('', pep_type, refuri=uri)] - elif name == 'version' and len(body): - utils.clean_rcs_keywords(para, self.rcs_keyword_substitutions) - - -class Contents(Transform): - - """ - Insert a table of contents transform placeholder into the document after - the RFC 2822 header. - """ - - default_priority = 380 - - def apply(self): - pending = nodes.pending(parts.Contents, {'title': None}) - self.document.insert(1, pending) - self.document.note_pending(pending) - - -class TargetNotes(Transform): - - """ - Locate the "References" section, insert a placeholder for an external - target footnote insertion transform at the end, and schedule the - transform to run immediately. - """ - - default_priority = 520 - - def apply(self): - doc = self.document - i = len(doc) - 1 - refsect = copyright = None - while i >= 0 and isinstance(doc[i], nodes.section): - title_words = doc[i][0].astext().lower().split() - if 'references' in title_words: - refsect = doc[i] - break - elif 'copyright' in title_words: - copyright = i - i -= 1 - if not refsect: - refsect = nodes.section() - refsect += nodes.title('', 'References') - doc.set_id(refsect) - if copyright: - # Put the new "References" section before "Copyright": - doc.insert(copyright, refsect) - else: - # Put the new "References" section at end of doc: - doc.append(refsect) - pending = nodes.pending(references.TargetNotes) - refsect.append(pending) - self.document.note_pending(pending, 0) - pending = nodes.pending(misc.CallBack, - details={'callback': self.cleanup_callback}) - refsect.append(pending) - self.document.note_pending(pending, 1) - - def cleanup_callback(self, pending): - """ - Remove an empty "References" section. - - Called after the `references.TargetNotes` transform is complete. - """ - if len(pending.parent) == 2: # <title> and <pending> - pending.parent.parent.remove(pending.parent) - - -class PEPZero(Transform): - - """ - Special processing for PEP 0. - """ - - default_priority =760 - - def apply(self): - visitor = PEPZeroSpecial(self.document) - self.document.walk(visitor) - self.startnode.parent.remove(self.startnode) - - -class PEPZeroSpecial(nodes.SparseNodeVisitor): - - """ - Perform the special processing needed by PEP 0: - - - Mask email addresses. - - - Link PEP numbers in the second column of 4-column tables to the PEPs - themselves. - """ - - pep_url = Headers.pep_url - - def unknown_visit(self, node): - pass - - def visit_reference(self, node): - node.parent.replace(node, mask_email(node)) - - def visit_field_list(self, node): - if node.hasattr('class') and node['class'] == 'rfc2822': - raise nodes.SkipNode - - def visit_tgroup(self, node): - self.pep_table = node['cols'] == 4 - self.entry = 0 - - def visit_colspec(self, node): - self.entry += 1 - if self.pep_table and self.entry == 2: - node['class'] = 'num' - - def visit_row(self, node): - self.entry = 0 - - def visit_entry(self, node): - self.entry += 1 - if self.pep_table and self.entry == 2 and len(node) == 1: - node['class'] = 'num' - p = node[0] - if isinstance(p, nodes.paragraph) and len(p) == 1: - text = p.astext() - try: - pep = int(text) - ref = self.pep_url % pep - p[0] = nodes.reference(text, text, refuri=ref) - except ValueError: - pass - - -non_masked_addresses = ('peps@python.org', - 'python-list@python.org', - 'python-dev@python.org') - -def mask_email(ref, pepno=None): - """ - Mask the email address in `ref` and return a replacement node. - - `ref` is returned unchanged if it contains no email address. - - For email addresses such as "user@host", mask the address as "user at - host" (text) to thwart simple email address harvesters (except for those - listed in `non_masked_addresses`). If a PEP number (`pepno`) is given, - return a reference including a default email subject. - """ - if ref.hasattr('refuri') and ref['refuri'].startswith('mailto:'): - if ref['refuri'][8:] in non_masked_addresses: - replacement = ref[0] - else: - replacement_text = ref.astext().replace('@', ' at ') - replacement = nodes.raw('', replacement_text, format='html') - if pepno is None: - return replacement - else: - ref['refuri'] += '?subject=PEP%%20%s' % pepno - ref[:] = [replacement] - return ref - else: - return ref diff --git a/docutils/docutils/transforms/references.py b/docutils/docutils/transforms/references.py deleted file mode 100644 index c754ee05c..000000000 --- a/docutils/docutils/transforms/references.py +++ /dev/null @@ -1,762 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Transforms for resolving references. -""" - -__docformat__ = 'reStructuredText' - -import sys -import re -from docutils import nodes, utils -from docutils.transforms import TransformError, Transform - - -indices = xrange(sys.maxint) - - -class ChainedTargets(Transform): - - """ - Attributes "refuri" and "refname" are migrated from the final direct - target up the chain of contiguous adjacent internal targets, using - `ChainedTargetResolver`. - """ - - default_priority = 420 - - def apply(self): - visitor = ChainedTargetResolver(self.document) - self.document.walk(visitor) - - -class ChainedTargetResolver(nodes.SparseNodeVisitor): - - """ - Copy reference attributes up the length of a hyperlink target chain. - - "Chained targets" are multiple adjacent internal hyperlink targets which - "point to" an external or indirect target. After the transform, all - chained targets will effectively point to the same place. - - Given the following ``document`` as input:: - - <document> - <target id="a" name="a"> - <target id="b" name="b"> - <target id="c" name="c" refuri="http://chained.external.targets"> - <target id="d" name="d"> - <paragraph> - I'm known as "d". - <target id="e" name="e"> - <target id="id1"> - <target id="f" name="f" refname="d"> - - ``ChainedTargetResolver(document).walk()`` will transform the above into:: - - <document> - <target id="a" name="a" refuri="http://chained.external.targets"> - <target id="b" name="b" refuri="http://chained.external.targets"> - <target id="c" name="c" refuri="http://chained.external.targets"> - <target id="d" name="d"> - <paragraph> - I'm known as "d". - <target id="e" name="e" refname="d"> - <target id="id1" refname="d"> - <target id="f" name="f" refname="d"> - """ - - def unknown_visit(self, node): - pass - - def visit_target(self, node): - if node.hasattr('refuri'): - attname = 'refuri' - call_if_named = self.document.note_external_target - elif node.hasattr('refname'): - attname = 'refname' - call_if_named = self.document.note_indirect_target - elif node.hasattr('refid'): - attname = 'refid' - call_if_named = None - else: - return - attval = node[attname] - index = node.parent.index(node) - for i in range(index - 1, -1, -1): - sibling = node.parent[i] - if not isinstance(sibling, nodes.target) \ - or sibling.hasattr('refuri') \ - or sibling.hasattr('refname') \ - or sibling.hasattr('refid'): - break - sibling[attname] = attval - if sibling.hasattr('name') and call_if_named: - call_if_named(sibling) - - -class AnonymousHyperlinks(Transform): - - """ - Link anonymous references to targets. Given:: - - <paragraph> - <reference anonymous="1"> - internal - <reference anonymous="1"> - external - <target anonymous="1" id="id1"> - <target anonymous="1" id="id2" refuri="http://external"> - - Corresponding references are linked via "refid" or resolved via "refuri":: - - <paragraph> - <reference anonymous="1" refid="id1"> - text - <reference anonymous="1" refuri="http://external"> - external - <target anonymous="1" id="id1"> - <target anonymous="1" id="id2" refuri="http://external"> - """ - - default_priority = 440 - - def apply(self): - if len(self.document.anonymous_refs) \ - != len(self.document.anonymous_targets): - msg = self.document.reporter.error( - 'Anonymous hyperlink mismatch: %s references but %s ' - 'targets.\nSee "backrefs" attribute for IDs.' - % (len(self.document.anonymous_refs), - len(self.document.anonymous_targets))) - msgid = self.document.set_id(msg) - for ref in self.document.anonymous_refs: - prb = nodes.problematic( - ref.rawsource, ref.rawsource, refid=msgid) - prbid = self.document.set_id(prb) - msg.add_backref(prbid) - ref.parent.replace(ref, prb) - return - for ref, target in zip(self.document.anonymous_refs, - self.document.anonymous_targets): - if target.hasattr('refuri'): - ref['refuri'] = target['refuri'] - ref.resolved = 1 - else: - ref['refid'] = target['id'] - self.document.note_refid(ref) - target.referenced = 1 - - -class IndirectHyperlinks(Transform): - - """ - a) Indirect external references:: - - <paragraph> - <reference refname="indirect external"> - indirect external - <target id="id1" name="direct external" - refuri="http://indirect"> - <target id="id2" name="indirect external" - refname="direct external"> - - The "refuri" attribute is migrated back to all indirect targets - from the final direct target (i.e. a target not referring to - another indirect target):: - - <paragraph> - <reference refname="indirect external"> - indirect external - <target id="id1" name="direct external" - refuri="http://indirect"> - <target id="id2" name="indirect external" - refuri="http://indirect"> - - Once the attribute is migrated, the preexisting "refname" attribute - is dropped. - - b) Indirect internal references:: - - <target id="id1" name="final target"> - <paragraph> - <reference refname="indirect internal"> - indirect internal - <target id="id2" name="indirect internal 2" - refname="final target"> - <target id="id3" name="indirect internal" - refname="indirect internal 2"> - - Targets which indirectly refer to an internal target become one-hop - indirect (their "refid" attributes are directly set to the internal - target's "id"). References which indirectly refer to an internal - target become direct internal references:: - - <target id="id1" name="final target"> - <paragraph> - <reference refid="id1"> - indirect internal - <target id="id2" name="indirect internal 2" refid="id1"> - <target id="id3" name="indirect internal" refid="id1"> - """ - - default_priority = 460 - - def apply(self): - for target in self.document.indirect_targets: - if not target.resolved: - self.resolve_indirect_target(target) - self.resolve_indirect_references(target) - - def resolve_indirect_target(self, target): - refname = target['refname'] - reftarget_id = self.document.nameids.get(refname) - if not reftarget_id: - self.nonexistent_indirect_target(target) - return - reftarget = self.document.ids[reftarget_id] - if isinstance(reftarget, nodes.target) \ - and not reftarget.resolved and reftarget.hasattr('refname'): - if hasattr(target, 'multiply_indirect'): - #and target.multiply_indirect): - #del target.multiply_indirect - self.circular_indirect_reference(target) - return - target.multiply_indirect = 1 - self.resolve_indirect_target(reftarget) # multiply indirect - del target.multiply_indirect - if reftarget.hasattr('refuri'): - target['refuri'] = reftarget['refuri'] - if target.hasattr('name'): - self.document.note_external_target(target) - elif reftarget.hasattr('refid'): - target['refid'] = reftarget['refid'] - self.document.note_refid(target) - else: - try: - target['refid'] = reftarget['id'] - self.document.note_refid(target) - except KeyError: - self.nonexistent_indirect_target(target) - return - del target['refname'] - target.resolved = 1 - reftarget.referenced = 1 - - def nonexistent_indirect_target(self, target): - self.indirect_target_error(target, 'which does not exist') - - def circular_indirect_reference(self, target): - self.indirect_target_error(target, 'forming a circular reference') - - def indirect_target_error(self, target, explanation): - naming = '' - if target.hasattr('name'): - naming = '"%s" ' % target['name'] - reflist = self.document.refnames.get(target['name'], []) - else: - reflist = self.document.refids.get(target['id'], []) - naming += '(id="%s")' % target['id'] - msg = self.document.reporter.error( - 'Indirect hyperlink target %s refers to target "%s", %s.' - % (naming, target['refname'], explanation), - base_node=target) - msgid = self.document.set_id(msg) - for ref in reflist: - prb = nodes.problematic( - ref.rawsource, ref.rawsource, refid=msgid) - prbid = self.document.set_id(prb) - msg.add_backref(prbid) - ref.parent.replace(ref, prb) - target.resolved = 1 - - def resolve_indirect_references(self, target): - if target.hasattr('refid'): - attname = 'refid' - call_if_named = 0 - call_method = self.document.note_refid - elif target.hasattr('refuri'): - attname = 'refuri' - call_if_named = 1 - call_method = self.document.note_external_target - else: - return - attval = target[attname] - if target.hasattr('name'): - name = target['name'] - try: - reflist = self.document.refnames[name] - except KeyError, instance: - if target.referenced: - return - msg = self.document.reporter.info( - 'Indirect hyperlink target "%s" is not referenced.' - % name, base_node=target) - target.referenced = 1 - return - delatt = 'refname' - else: - id = target['id'] - try: - reflist = self.document.refids[id] - except KeyError, instance: - if target.referenced: - return - msg = self.document.reporter.info( - 'Indirect hyperlink target id="%s" is not referenced.' - % id, base_node=target) - target.referenced = 1 - return - delatt = 'refid' - for ref in reflist: - if ref.resolved: - continue - del ref[delatt] - ref[attname] = attval - if not call_if_named or ref.hasattr('name'): - call_method(ref) - ref.resolved = 1 - if isinstance(ref, nodes.target): - self.resolve_indirect_references(ref) - target.referenced = 1 - - -class ExternalTargets(Transform): - - """ - Given:: - - <paragraph> - <reference refname="direct external"> - direct external - <target id="id1" name="direct external" refuri="http://direct"> - - The "refname" attribute is replaced by the direct "refuri" attribute:: - - <paragraph> - <reference refuri="http://direct"> - direct external - <target id="id1" name="direct external" refuri="http://direct"> - """ - - default_priority = 640 - - def apply(self): - for target in self.document.external_targets: - if target.hasattr('refuri') and target.hasattr('name'): - name = target['name'] - refuri = target['refuri'] - try: - reflist = self.document.refnames[name] - except KeyError, instance: - if target.referenced: - continue - msg = self.document.reporter.info( - 'External hyperlink target "%s" is not referenced.' - % name, base_node=target) - target.referenced = 1 - continue - for ref in reflist: - if ref.resolved: - continue - del ref['refname'] - ref['refuri'] = refuri - ref.resolved = 1 - target.referenced = 1 - - -class InternalTargets(Transform): - - """ - Given:: - - <paragraph> - <reference refname="direct internal"> - direct internal - <target id="id1" name="direct internal"> - - The "refname" attribute is replaced by "refid" linking to the target's - "id":: - - <paragraph> - <reference refid="id1"> - direct internal - <target id="id1" name="direct internal"> - """ - - default_priority = 660 - - def apply(self): - for target in self.document.internal_targets: - if target.hasattr('refuri') or target.hasattr('refid') \ - or not target.hasattr('name'): - continue - name = target['name'] - refid = target['id'] - try: - reflist = self.document.refnames[name] - except KeyError, instance: - if target.referenced: - continue - msg = self.document.reporter.info( - 'Internal hyperlink target "%s" is not referenced.' - % name, base_node=target) - target.referenced = 1 - continue - for ref in reflist: - if ref.resolved: - continue - del ref['refname'] - ref['refid'] = refid - ref.resolved = 1 - target.referenced = 1 - - -class Footnotes(Transform): - - """ - Assign numbers to autonumbered footnotes, and resolve links to footnotes, - citations, and their references. - - Given the following ``document`` as input:: - - <document> - <paragraph> - A labeled autonumbered footnote referece: - <footnote_reference auto="1" id="id1" refname="footnote"> - <paragraph> - An unlabeled autonumbered footnote referece: - <footnote_reference auto="1" id="id2"> - <footnote auto="1" id="id3"> - <paragraph> - Unlabeled autonumbered footnote. - <footnote auto="1" id="footnote" name="footnote"> - <paragraph> - Labeled autonumbered footnote. - - Auto-numbered footnotes have attribute ``auto="1"`` and no label. - Auto-numbered footnote_references have no reference text (they're - empty elements). When resolving the numbering, a ``label`` element - is added to the beginning of the ``footnote``, and reference text - to the ``footnote_reference``. - - The transformed result will be:: - - <document> - <paragraph> - A labeled autonumbered footnote referece: - <footnote_reference auto="1" id="id1" refid="footnote"> - 2 - <paragraph> - An unlabeled autonumbered footnote referece: - <footnote_reference auto="1" id="id2" refid="id3"> - 1 - <footnote auto="1" id="id3" backrefs="id2"> - <label> - 1 - <paragraph> - Unlabeled autonumbered footnote. - <footnote auto="1" id="footnote" name="footnote" backrefs="id1"> - <label> - 2 - <paragraph> - Labeled autonumbered footnote. - - Note that the footnotes are not in the same order as the references. - - The labels and reference text are added to the auto-numbered ``footnote`` - and ``footnote_reference`` elements. Footnote elements are backlinked to - their references via "refids" attributes. References are assigned "id" - and "refid" attributes. - - After adding labels and reference text, the "auto" attributes can be - ignored. - """ - - default_priority = 620 - - autofootnote_labels = None - """Keep track of unlabeled autonumbered footnotes.""" - - symbols = [ - # Entries 1-4 and 6 below are from section 12.51 of - # The Chicago Manual of Style, 14th edition. - '*', # asterisk/star - u'\u2020', # dagger † - u'\u2021', # double dagger ‡ - u'\u00A7', # section mark § - u'\u00B6', # paragraph mark (pilcrow) ¶ - # (parallels ['||'] in CMoS) - '#', # number sign - # The entries below were chosen arbitrarily. - u'\u2660', # spade suit ♠ - u'\u2665', # heart suit ♥ - u'\u2666', # diamond suit ♦ - u'\u2663', # club suit ♣ - ] - - def apply(self): - self.autofootnote_labels = [] - startnum = self.document.autofootnote_start - self.document.autofootnote_start = self.number_footnotes(startnum) - self.number_footnote_references(startnum) - self.symbolize_footnotes() - self.resolve_footnotes_and_citations() - - def number_footnotes(self, startnum): - """ - Assign numbers to autonumbered footnotes. - - For labeled autonumbered footnotes, copy the number over to - corresponding footnote references. - """ - for footnote in self.document.autofootnotes: - while 1: - label = str(startnum) - startnum += 1 - if not self.document.nameids.has_key(label): - break - footnote.insert(0, nodes.label('', label)) - if footnote.hasattr('dupname'): - continue - if footnote.hasattr('name'): - name = footnote['name'] - for ref in self.document.footnote_refs.get(name, []): - ref += nodes.Text(label) - ref.delattr('refname') - ref['refid'] = footnote['id'] - footnote.add_backref(ref['id']) - self.document.note_refid(ref) - ref.resolved = 1 - else: - footnote['name'] = label - self.document.note_explicit_target(footnote, footnote) - self.autofootnote_labels.append(label) - return startnum - - def number_footnote_references(self, startnum): - """Assign numbers to autonumbered footnote references.""" - i = 0 - for ref in self.document.autofootnote_refs: - if ref.resolved or ref.hasattr('refid'): - continue - try: - label = self.autofootnote_labels[i] - except IndexError: - msg = self.document.reporter.error( - 'Too many autonumbered footnote references: only %s ' - 'corresponding footnotes available.' - % len(self.autofootnote_labels), base_node=ref) - msgid = self.document.set_id(msg) - for ref in self.document.autofootnote_refs[i:]: - if ref.resolved or ref.hasattr('refname'): - continue - prb = nodes.problematic( - ref.rawsource, ref.rawsource, refid=msgid) - prbid = self.document.set_id(prb) - msg.add_backref(prbid) - ref.parent.replace(ref, prb) - break - ref += nodes.Text(label) - id = self.document.nameids[label] - footnote = self.document.ids[id] - ref['refid'] = id - self.document.note_refid(ref) - footnote.add_backref(ref['id']) - ref.resolved = 1 - i += 1 - - def symbolize_footnotes(self): - """Add symbols indexes to "[*]"-style footnotes and references.""" - labels = [] - for footnote in self.document.symbol_footnotes: - reps, index = divmod(self.document.symbol_footnote_start, - len(self.symbols)) - labeltext = self.symbols[index] * (reps + 1) - labels.append(labeltext) - footnote.insert(0, nodes.label('', labeltext)) - self.document.symbol_footnote_start += 1 - self.document.set_id(footnote) - i = 0 - for ref in self.document.symbol_footnote_refs: - try: - ref += nodes.Text(labels[i]) - except IndexError: - msg = self.document.reporter.error( - 'Too many symbol footnote references: only %s ' - 'corresponding footnotes available.' % len(labels), - base_node=ref) - msgid = self.document.set_id(msg) - for ref in self.document.symbol_footnote_refs[i:]: - if ref.resolved or ref.hasattr('refid'): - continue - prb = nodes.problematic( - ref.rawsource, ref.rawsource, refid=msgid) - prbid = self.document.set_id(prb) - msg.add_backref(prbid) - ref.parent.replace(ref, prb) - break - footnote = self.document.symbol_footnotes[i] - ref['refid'] = footnote['id'] - self.document.note_refid(ref) - footnote.add_backref(ref['id']) - i += 1 - - def resolve_footnotes_and_citations(self): - """ - Link manually-labeled footnotes and citations to/from their - references. - """ - for footnote in self.document.footnotes: - label = footnote['name'] - if self.document.footnote_refs.has_key(label): - reflist = self.document.footnote_refs[label] - self.resolve_references(footnote, reflist) - for citation in self.document.citations: - label = citation['name'] - if self.document.citation_refs.has_key(label): - reflist = self.document.citation_refs[label] - self.resolve_references(citation, reflist) - - def resolve_references(self, note, reflist): - id = note['id'] - for ref in reflist: - if ref.resolved: - continue - ref.delattr('refname') - ref['refid'] = id - note.add_backref(ref['id']) - ref.resolved = 1 - note.resolved = 1 - - -class Substitutions(Transform): - - """ - Given the following ``document`` as input:: - - <document> - <paragraph> - The - <substitution_reference refname="biohazard"> - biohazard - symbol is deservedly scary-looking. - <substitution_definition name="biohazard"> - <image alt="biohazard" uri="biohazard.png"> - - The ``substitution_reference`` will simply be replaced by the - contents of the corresponding ``substitution_definition``. - - The transformed result will be:: - - <document> - <paragraph> - The - <image alt="biohazard" uri="biohazard.png"> - symbol is deservedly scary-looking. - <substitution_definition name="biohazard"> - <image alt="biohazard" uri="biohazard.png"> - """ - - default_priority = 220 - """The Substitutions transform has to be applied very early, before - `docutils.tranforms.frontmatter.DocTitle` and others.""" - - def apply(self): - defs = self.document.substitution_defs - normed = self.document.substitution_names - for refname, refs in self.document.substitution_refs.items(): - for ref in refs: - key = None - if defs.has_key(refname): - key = refname - else: - normed_name = refname.lower() - if normed.has_key(normed_name): - key = normed[normed_name] - if key is None: - msg = self.document.reporter.error( - 'Undefined substitution referenced: "%s".' - % refname, base_node=ref) - msgid = self.document.set_id(msg) - prb = nodes.problematic( - ref.rawsource, ref.rawsource, refid=msgid) - prbid = self.document.set_id(prb) - msg.add_backref(prbid) - ref.parent.replace(ref, prb) - else: - ref.parent.replace(ref, defs[key].get_children()) - self.document.substitution_refs = None # release replaced references - - -class TargetNotes(Transform): - - """ - Creates a footnote for each external target in the text, and corresponding - footnote references after each reference. - """ - - default_priority = 540 - """The TargetNotes transform has to be applied after `IndirectHyperlinks` - but before `Footnotes`.""" - - def apply(self): - notes = {} - nodelist = [] - for target in self.document.external_targets: - name = target.get('name') - if not name: - print >>sys.stderr, 'no name on target: %r' % target - continue - refs = self.document.refnames.get(name, []) - if not refs: - continue - footnote = self.make_target_footnote(target, refs, notes) - if not notes.has_key(target['refuri']): - notes[target['refuri']] = footnote - nodelist.append(footnote) - if len(self.document.anonymous_targets) \ - == len(self.document.anonymous_refs): - for target, ref in zip(self.document.anonymous_targets, - self.document.anonymous_refs): - if target.hasattr('refuri'): - footnote = self.make_target_footnote(target, [ref], notes) - if not notes.has_key(target['refuri']): - notes[target['refuri']] = footnote - nodelist.append(footnote) - self.startnode.parent.replace(self.startnode, nodelist) - - def make_target_footnote(self, target, refs, notes): - refuri = target['refuri'] - if notes.has_key(refuri): # duplicate? - footnote = notes[refuri] - footnote_name = footnote['name'] - else: # original - footnote = nodes.footnote() - footnote_id = self.document.set_id(footnote) - # Use a colon; they can't be produced inside names by the parser: - footnote_name = 'target_note: ' + footnote_id - footnote['auto'] = 1 - footnote['name'] = footnote_name - footnote_paragraph = nodes.paragraph() - footnote_paragraph += nodes.reference('', refuri, refuri=refuri) - footnote += footnote_paragraph - self.document.note_autofootnote(footnote) - self.document.note_explicit_target(footnote, footnote) - for ref in refs: - if isinstance(ref, nodes.target): - continue - refnode = nodes.footnote_reference( - refname=footnote_name, auto=1) - self.document.note_autofootnote_ref(refnode) - self.document.note_footnote_ref(refnode) - index = ref.parent.index(ref) + 1 - reflist = [refnode] - if not self.document.settings.trim_footnote_reference_space: - reflist.insert(0, nodes.Text(' ')) - ref.parent.insert(index, reflist) - return footnote diff --git a/docutils/docutils/transforms/universal.py b/docutils/docutils/transforms/universal.py deleted file mode 100644 index 4523304f2..000000000 --- a/docutils/docutils/transforms/universal.py +++ /dev/null @@ -1,185 +0,0 @@ -# Authors: David Goodger, Ueli Schlaepfer -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Transforms needed by most or all documents: - -- `Decorations`: Generate a document's header & footer. -- `Messages`: Placement of system messages stored in - `nodes.document.transform_messages`. -- `TestMessages`: Like `Messages`, used on test runs. -- `FinalReferences`: Resolve remaining references. -""" - -__docformat__ = 'reStructuredText' - -import re -import sys -import time -from docutils import nodes, utils -from docutils.transforms import TransformError, Transform - - -class Decorations(Transform): - - """ - Populate a document's decoration element (header, footer). - """ - - default_priority = 820 - - def apply(self): - header = self.generate_header() - footer = self.generate_footer() - if header or footer: - decoration = nodes.decoration() - decoration += header - decoration += footer - document = self.document - index = document.first_child_not_matching_class( - nodes.PreDecorative) - if index is None: - document += decoration - else: - document[index:index] = [decoration] - - def generate_header(self): - return None - - def generate_footer(self): - # @@@ Text is hard-coded for now. - # Should be made dynamic (language-dependent). - settings = self.document.settings - if settings.generator or settings.datestamp or settings.source_link \ - or settings.source_url: - text = [] - if settings.source_link and settings._source \ - or settings.source_url: - if settings.source_url: - source = settings.source_url - else: - source = utils.relative_path(settings._destination, - settings._source) - text.extend([ - nodes.reference('', 'View document source', - refuri=source), - nodes.Text('.\n')]) - if settings.datestamp: - datestamp = time.strftime(settings.datestamp, time.gmtime()) - text.append(nodes.Text('Generated on: ' + datestamp + '.\n')) - if settings.generator: - text.extend([ - nodes.Text('Generated by '), - nodes.reference('', 'Docutils', refuri= - 'http://docutils.sourceforge.net/'), - nodes.Text(' from '), - nodes.reference('', 'reStructuredText', refuri='http://' - 'docutils.sourceforge.net/rst.html'), - nodes.Text(' source.\n')]) - footer = nodes.footer() - footer += nodes.paragraph('', '', *text) - return footer - else: - return None - - -class Messages(Transform): - - """ - Place any system messages generated after parsing into a dedicated section - of the document. - """ - - default_priority = 860 - - def apply(self): - unfiltered = self.document.transform_messages - threshold = self.document.reporter['writer'].report_level - messages = [] - for msg in unfiltered: - if msg['level'] >= threshold and not msg.parent: - messages.append(msg) - if messages: - section = nodes.section(CLASS='system-messages') - # @@@ get this from the language module? - section += nodes.title('', 'Docutils System Messages') - section += messages - self.document.transform_messages[:] = [] - self.document += section - - -class TestMessages(Transform): - - """ - Append all post-parse system messages to the end of the document. - """ - - default_priority = 890 - - def apply(self): - for msg in self.document.transform_messages: - if not msg.parent: - self.document += msg - - -class FinalChecks(Transform): - - """ - Perform last-minute checks. - - - Check for dangling references (incl. footnote & citation). - """ - - default_priority = 840 - - def apply(self): - visitor = FinalCheckVisitor(self.document) - self.document.walk(visitor) - if self.document.settings.expose_internals: - visitor = InternalAttributeExposer(self.document) - self.document.walk(visitor) - - -class FinalCheckVisitor(nodes.SparseNodeVisitor): - - def unknown_visit(self, node): - pass - - def visit_reference(self, node): - if node.resolved or not node.hasattr('refname'): - return - refname = node['refname'] - id = self.document.nameids.get(refname) - if id is None: - msg = self.document.reporter.error( - 'Unknown target name: "%s".' % (node['refname']), - base_node=node) - msgid = self.document.set_id(msg) - prb = nodes.problematic( - node.rawsource, node.rawsource, refid=msgid) - prbid = self.document.set_id(prb) - msg.add_backref(prbid) - node.parent.replace(node, prb) - else: - del node['refname'] - node['refid'] = id - self.document.ids[id].referenced = 1 - node.resolved = 1 - - visit_footnote_reference = visit_citation_reference = visit_reference - - -class InternalAttributeExposer(nodes.GenericNodeVisitor): - - def __init__(self, document): - nodes.GenericNodeVisitor.__init__(self, document) - self.internal_attributes = document.settings.expose_internals - - def default_visit(self, node): - for att in self.internal_attributes: - value = getattr(node, att, None) - if value is not None: - node['internal:' + att] = value diff --git a/docutils/docutils/urischemes.py b/docutils/docutils/urischemes.py deleted file mode 100644 index 6eb45820a..000000000 --- a/docutils/docutils/urischemes.py +++ /dev/null @@ -1,105 +0,0 @@ -""" -`schemes` is a dictionary with lowercase URI addressing schemes as -keys and descriptions as values. It was compiled from the index at -http://www.w3.org/Addressing/schemes.html (revised 2001-08-20). -""" - -# Many values are blank and should be filled in with useful descriptions. - -schemes = { - 'about': 'provides information on Navigator', - 'acap': 'Application Configuration Access Protocol', - 'addbook': "To add vCard entries to Communicator's Address Book", - 'afp': 'Apple Filing Protocol', - 'afs': 'Andrew File System global file names', - 'aim': 'AOL Instant Messenger', - 'callto': 'for NetMeeting links', - 'castanet': 'Castanet Tuner URLs for Netcaster', - 'chttp': 'cached HTTP supported by RealPlayer', - 'cid': 'content identifier', - 'data': ('allows inclusion of small data items as "immediate" data; ' - 'RFC 2397'), - 'dav': 'Distributed Authoring and Versioning Protocol; RFC 2518', - 'dns': 'Domain Name System resources', - 'eid': ('External ID; non-URL data; general escape mechanism to allow ' - 'access to information for applications that are too ' - 'specialized to justify their own schemes'), - 'fax': ('a connection to a terminal that can handle telefaxes ' - '(facsimiles); RFC 2806'), - 'file': 'Host-specific file names', - 'finger': '', - 'freenet': '', - 'ftp': 'File Transfer Protocol', - 'gopher': 'The Gopher Protocol', - 'gsm-sms': ('Global System for Mobile Communications Short Message ' - 'Service'), - 'h323': 'video (audiovisual) communication on local area networks', - 'h324': ('video and audio communications over low bitrate connections ' - 'such as POTS modem connections'), - 'hdl': 'CNRI handle system', - 'hnews': 'an HTTP-tunneling variant of the NNTP news protocol', - 'http': 'Hypertext Transfer Protocol', - 'https': 'HTTP over SSL', - 'iioploc': 'Internet Inter-ORB Protocol Location?', - 'ilu': 'Inter-Language Unification', - 'imap': 'Internet Message Access Protocol', - 'ior': 'CORBA interoperable object reference', - 'ipp': 'Internet Printing Protocol', - 'irc': 'Internet Relay Chat', - 'jar': 'Java archive', - 'javascript': ('JavaScript code; evaluates the expression after the ' - 'colon'), - 'jdbc': '', - 'ldap': 'Lightweight Directory Access Protocol', - 'lifn': '', - 'livescript': '', - 'lrq': '', - 'mailbox': 'Mail folder access', - 'mailserver': 'Access to data available from mail servers', - 'mailto': 'Electronic mail address', - 'md5': '', - 'mid': 'message identifier', - 'mocha': '', - 'modem': ('a connection to a terminal that can handle incoming data ' - 'calls; RFC 2806'), - 'news': 'USENET news', - 'nfs': 'Network File System protocol', - 'nntp': 'USENET news using NNTP access', - 'opaquelocktoken': '', - 'phone': '', - 'pop': 'Post Office Protocol', - 'pop3': 'Post Office Protocol v3', - 'printer': '', - 'prospero': 'Prospero Directory Service', - 'res': '', - 'rtsp': 'real time streaming protocol', - 'rvp': '', - 'rwhois': '', - 'rx': 'Remote Execution', - 'sdp': '', - 'service': 'service location', - 'shttp': 'secure hypertext transfer protocol', - 'sip': 'Session Initiation Protocol', - 'smb': '', - 'snews': 'For NNTP postings via SSL', - 't120': 'real time data conferencing (audiographics)', - 'tcp': '', - 'tel': ('a connection to a terminal that handles normal voice ' - 'telephone calls, a voice mailbox or another voice messaging ' - 'system or a service that can be operated using DTMF tones; ' - 'RFC 2806.'), - 'telephone': 'telephone', - 'telnet': 'Reference to interactive sessions', - 'tip': 'Transaction Internet Protocol', - 'tn3270': 'Interactive 3270 emulation sessions', - 'tv': '', - 'urn': 'Uniform Resource Name', - 'uuid': '', - 'vemmi': 'versatile multimedia interface', - 'videotex': '', - 'view-source': 'displays HTML code that was generated with JavaScript', - 'wais': 'Wide Area Information Servers', - 'whodp': '', - 'whois++': 'Distributed directory service.', - 'z39.50r': 'Z39.50 Retrieval', - 'z39.50s': 'Z39.50 Session',} diff --git a/docutils/docutils/utils.py b/docutils/docutils/utils.py deleted file mode 100644 index 2e60a6c6f..000000000 --- a/docutils/docutils/utils.py +++ /dev/null @@ -1,447 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Miscellaneous utilities for the documentation utilities. -""" - -__docformat__ = 'reStructuredText' - -import sys -import os -import os.path -from types import StringType, UnicodeType -from docutils import ApplicationError, DataError -from docutils import frontend, nodes - - -class SystemMessage(ApplicationError): - - def __init__(self, system_message, level): - Exception.__init__(self, system_message.astext()) - self.level = level - - -class Reporter: - - """ - Info/warning/error reporter and ``system_message`` element generator. - - Five levels of system messages are defined, along with corresponding - methods: `debug()`, `info()`, `warning()`, `error()`, and `severe()`. - - There is typically one Reporter object per process. A Reporter object is - instantiated with thresholds for reporting (generating warnings) and - halting processing (raising exceptions), a switch to turn debug output on - or off, and an I/O stream for warnings. These are stored in the default - reporting category, '' (zero-length string). - - Multiple reporting categories [#]_ may be set, each with its own reporting - and halting thresholds, debugging switch, and warning stream - (collectively a `ConditionSet`). Categories are hierarchical dotted-name - strings that look like attribute references: 'spam', 'spam.eggs', - 'neeeow.wum.ping'. The 'spam' category is the ancestor of - 'spam.bacon.eggs'. Unset categories inherit stored conditions from their - closest ancestor category that has been set. - - When a system message is generated, the stored conditions from its - category (or ancestor if unset) are retrieved. The system message level - is compared to the thresholds stored in the category, and a warning or - error is generated as appropriate. Debug messages are produced iff the - stored debug switch is on. Message output is sent to the stored warning - stream. - - The default category is '' (empty string). By convention, Writers should - retrieve reporting conditions from the 'writer' category (which, unless - explicitly set, defaults to the conditions of the default category). - - The Reporter class also employs a modified form of the "Observer" pattern - [GoF95]_ to track system messages generated. The `attach_observer` method - should be called before parsing, with a bound method or function which - accepts system messages. The observer can be removed with - `detach_observer`, and another added in its place. - - .. [#] The concept of "categories" was inspired by the log4j project: - http://jakarta.apache.org/log4j/. - - .. [GoF95] Gamma, Helm, Johnson, Vlissides. *Design Patterns: Elements of - Reusable Object-Oriented Software*. Addison-Wesley, Reading, MA, USA, - 1995. - """ - - levels = 'DEBUG INFO WARNING ERROR SEVERE'.split() - """List of names for system message levels, indexed by level.""" - - def __init__(self, source, report_level, halt_level, stream=None, - debug=0, encoding='ascii', error_handler='replace'): - """ - Initialize the `ConditionSet` forthe `Reporter`'s default category. - - :Parameters: - - - `source`: The path to or description of the source data. - - `report_level`: The level at or above which warning output will - be sent to `stream`. - - `halt_level`: The level at or above which `SystemMessage` - exceptions will be raised, halting execution. - - `debug`: Show debug (level=0) system messages? - - `stream`: Where warning output is sent. Can be file-like (has a - ``.write`` method), a string (file name, opened for writing), or - `None` (implies `sys.stderr`; default). - - `encoding`: The encoding for stderr output. - - `error_handler`: The error handler for stderr output encoding. - """ - self.source = source - """The path to or description of the source data.""" - - if stream is None: - stream = sys.stderr - elif type(stream) in (StringType, UnicodeType): - raise NotImplementedError('This should open a file for writing.') - - self.encoding = encoding - """The character encoding for the stderr output.""" - - self.error_handler = error_handler - """The character encoding error handler.""" - - self.categories = {'': ConditionSet(debug, report_level, halt_level, - stream)} - """Mapping of category names to conditions. Default category is ''.""" - - self.observers = [] - """List of bound methods or functions to call with each system_message - created.""" - - self.max_level = -1 - """The highest level system message generated so far.""" - - def set_conditions(self, category, report_level, halt_level, - stream=None, debug=0): - if stream is None: - stream = sys.stderr - self.categories[category] = ConditionSet(debug, report_level, - halt_level, stream) - - def unset_conditions(self, category): - if category and self.categories.has_key(category): - del self.categories[category] - - __delitem__ = unset_conditions - - def get_conditions(self, category): - while not self.categories.has_key(category): - category = category[:category.rfind('.') + 1][:-1] - return self.categories[category] - - __getitem__ = get_conditions - - def attach_observer(self, observer): - """ - The `observer` parameter is a function or bound method which takes one - argument, a `nodes.system_message` instance. - """ - self.observers.append(observer) - - def detach_observer(self, observer): - self.observers.remove(observer) - - def notify_observers(self, message): - for observer in self.observers: - observer(message) - - def system_message(self, level, message, *children, **kwargs): - """ - Return a system_message object. - - Raise an exception or generate a warning if appropriate. - """ - attributes = kwargs.copy() - category = kwargs.get('category', '') - if kwargs.has_key('category'): - del attributes['category'] - if kwargs.has_key('base_node'): - source, line = get_source_line(kwargs['base_node']) - del attributes['base_node'] - if source is not None: - attributes.setdefault('source', source) - if line is not None: - attributes.setdefault('line', line) - attributes.setdefault('source', self.source) - msg = nodes.system_message(message, level=level, - type=self.levels[level], - *children, **attributes) - debug, report_level, halt_level, stream = self[category].astuple() - if level >= report_level or debug and level == 0: - msgtext = msg.astext().encode(self.encoding, self.error_handler) - if category: - print >>stream, msgtext, '[%s]' % category - else: - print >>stream, msgtext - if level >= halt_level: - raise SystemMessage(msg, level) - if level > 0 or debug: - self.notify_observers(msg) - self.max_level = max(level, self.max_level) - return msg - - def debug(self, *args, **kwargs): - """ - Level-0, "DEBUG": an internal reporting issue. Typically, there is no - effect on the processing. Level-0 system messages are handled - separately from the others. - """ - return self.system_message(0, *args, **kwargs) - - def info(self, *args, **kwargs): - """ - Level-1, "INFO": a minor issue that can be ignored. Typically there is - no effect on processing, and level-1 system messages are not reported. - """ - return self.system_message(1, *args, **kwargs) - - def warning(self, *args, **kwargs): - """ - Level-2, "WARNING": an issue that should be addressed. If ignored, - there may be unpredictable problems with the output. - """ - return self.system_message(2, *args, **kwargs) - - def error(self, *args, **kwargs): - """ - Level-3, "ERROR": an error that should be addressed. If ignored, the - output will contain errors. - """ - return self.system_message(3, *args, **kwargs) - - def severe(self, *args, **kwargs): - """ - Level-4, "SEVERE": a severe error that must be addressed. If ignored, - the output will contain severe errors. Typically level-4 system - messages are turned into exceptions which halt processing. - """ - return self.system_message(4, *args, **kwargs) - - -class ConditionSet: - - """ - A set of two thresholds (`report_level` & `halt_level`), a switch - (`debug`), and an I/O stream (`stream`), corresponding to one `Reporter` - category. - """ - - def __init__(self, debug, report_level, halt_level, stream): - self.debug = debug - self.report_level = report_level - self.halt_level = halt_level - self.stream = stream - - def astuple(self): - return (self.debug, self.report_level, self.halt_level, - self.stream) - - -class ExtensionOptionError(DataError): pass -class BadOptionError(ExtensionOptionError): pass -class BadOptionDataError(ExtensionOptionError): pass -class DuplicateOptionError(ExtensionOptionError): pass - - -def extract_extension_options(field_list, options_spec): - """ - Return a dictionary mapping extension option names to converted values. - - :Parameters: - - `field_list`: A flat field list without field arguments, where each - field body consists of a single paragraph only. - - `options_spec`: Dictionary mapping known option names to a - conversion function such as `int` or `float`. - - :Exceptions: - - `KeyError` for unknown option names. - - `ValueError` for invalid option values (raised by the conversion - function). - - `DuplicateOptionError` for duplicate options. - - `BadOptionError` for invalid fields. - - `BadOptionDataError` for invalid option data (missing name, - missing data, bad quotes, etc.). - """ - option_list = extract_options(field_list) - option_dict = assemble_option_dict(option_list, options_spec) - return option_dict - -def extract_options(field_list): - """ - Return a list of option (name, value) pairs from field names & bodies. - - :Parameter: - `field_list`: A flat field list, where each field name is a single - word and each field body consists of a single paragraph only. - - :Exceptions: - - `BadOptionError` for invalid fields. - - `BadOptionDataError` for invalid option data (missing name, - missing data, bad quotes, etc.). - """ - option_list = [] - for field in field_list: - if len(field[0].astext().split()) != 1: - raise BadOptionError( - 'extension option field name may not contain multiple words') - name = str(field[0].astext().lower()) - body = field[1] - if len(body) == 0: - data = None - elif len(body) > 1 or not isinstance(body[0], nodes.paragraph) \ - or len(body[0]) != 1 or not isinstance(body[0][0], nodes.Text): - raise BadOptionDataError( - 'extension option field body may contain\n' - 'a single paragraph only (option "%s")' % name) - else: - data = body[0][0].astext() - option_list.append((name, data)) - return option_list - -def assemble_option_dict(option_list, options_spec): - """ - Return a mapping of option names to values. - - :Parameters: - - `option_list`: A list of (name, value) pairs (the output of - `extract_options()`). - - `options_spec`: Dictionary mapping known option names to a - conversion function such as `int` or `float`. - - :Exceptions: - - `KeyError` for unknown option names. - - `DuplicateOptionError` for duplicate options. - - `ValueError` for invalid option values (raised by conversion - function). - """ - options = {} - for name, value in option_list: - convertor = options_spec[name] # raises KeyError if unknown - if options.has_key(name): - raise DuplicateOptionError('duplicate option "%s"' % name) - try: - options[name] = convertor(value) - except (ValueError, TypeError), detail: - raise detail.__class__('(option: "%s"; value: %r)\n%s' - % (name, value, detail)) - return options - - -class NameValueError(DataError): pass - - -def extract_name_value(line): - """ - Return a list of (name, value) from a line of the form "name=value ...". - - :Exception: - `NameValueError` for invalid input (missing name, missing data, bad - quotes, etc.). - """ - attlist = [] - while line: - equals = line.find('=') - if equals == -1: - raise NameValueError('missing "="') - attname = line[:equals].strip() - if equals == 0 or not attname: - raise NameValueError( - 'missing attribute name before "="') - line = line[equals+1:].lstrip() - if not line: - raise NameValueError( - 'missing value after "%s="' % attname) - if line[0] in '\'"': - endquote = line.find(line[0], 1) - if endquote == -1: - raise NameValueError( - 'attribute "%s" missing end quote (%s)' - % (attname, line[0])) - if len(line) > endquote + 1 and line[endquote + 1].strip(): - raise NameValueError( - 'attribute "%s" end quote (%s) not followed by ' - 'whitespace' % (attname, line[0])) - data = line[1:endquote] - line = line[endquote+1:].lstrip() - else: - space = line.find(' ') - if space == -1: - data = line - line = '' - else: - data = line[:space] - line = line[space+1:].lstrip() - attlist.append((attname.lower(), data)) - return attlist - -def new_document(source, settings=None): - """ - Return a new empty document object. - - :Parameters: - `source` : string - The path to or description of the source text of the document. - `settings` : optparse.Values object - Runtime settings. If none provided, a default set will be used. - """ - if settings is None: - settings = frontend.OptionParser().get_default_values() - reporter = Reporter(source, settings.report_level, settings.halt_level, - stream=settings.warning_stream, debug=settings.debug, - encoding=settings.error_encoding, - error_handler=settings.error_encoding_error_handler) - document = nodes.document(settings, reporter, source=source) - document.note_source(source, -1) - return document - -def clean_rcs_keywords(paragraph, keyword_substitutions): - if len(paragraph) == 1 and isinstance(paragraph[0], nodes.Text): - textnode = paragraph[0] - for pattern, substitution in keyword_substitutions: - match = pattern.match(textnode.data) - if match: - textnode.data = pattern.sub(substitution, textnode.data) - return - -def relative_path(source, target): - """ - Build and return a path to `target`, relative to `source` (both files). - - If there is no common prefix, return the absolute path to `target`. - """ - source_parts = os.path.abspath(source or 'dummy_file').split(os.sep) - target_parts = os.path.abspath(target).split(os.sep) - # Check first 2 parts because '/dir'.split('/') == ['', 'dir']: - if source_parts[:2] != target_parts[:2]: - # Nothing in common between paths. - # Return absolute path, using '/' for URLs: - return '/'.join(target_parts) - source_parts.reverse() - target_parts.reverse() - while (source_parts and target_parts - and source_parts[-1] == target_parts[-1]): - # Remove path components in common: - source_parts.pop() - target_parts.pop() - target_parts.reverse() - parts = ['..'] * (len(source_parts) - 1) + target_parts - return '/'.join(parts) - -def get_source_line(node): - """ - Return the "source" and "line" attributes from the `node` given or from - its closest ancestor. - """ - while node: - if node.source or node.line: - return node.source, node.line - node = node.parent - return None, None diff --git a/docutils/docutils/writers/__init__.py b/docutils/docutils/writers/__init__.py deleted file mode 100644 index d8183dc37..000000000 --- a/docutils/docutils/writers/__init__.py +++ /dev/null @@ -1,83 +0,0 @@ -# Authors: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -This package contains Docutils Writer modules. -""" - -__docformat__ = 'reStructuredText' - - -import sys -import docutils -from docutils import languages, Component -from docutils.transforms import universal - - -class Writer(Component): - - """ - Abstract base class for docutils Writers. - - Each writer module or package must export a subclass also called 'Writer'. - Each writer must support all standard node types listed in - `docutils.nodes.node_class_names`. - - Call `write()` to process a document. - """ - - component_type = 'writer' - - document = None - """The document to write.""" - - language = None - """Language module for the document.""" - - destination = None - """`docutils.io` IO object; where to write the document.""" - - def __init__(self): - """Initialize the Writer instance.""" - - def write(self, document, destination): - self.document = document - self.language = languages.get_language( - document.settings.language_code) - self.destination = destination - self.translate() - output = self.destination.write(self.output) - return output - - def translate(self): - """ - Override to do final document tree translation. - - This is usually done with a `docutils.nodes.NodeVisitor` subclass, in - combination with a call to `docutils.nodes.Node.walk()` or - `docutils.nodes.Node.walkabout()`. The ``NodeVisitor`` subclass must - support all standard elements (listed in - `docutils.nodes.node_class_names`) and possibly non-standard elements - used by the current Reader as well. - """ - raise NotImplementedError('subclass must override this method') - - -_writer_aliases = { - 'html': 'html4css1', - 'latex': 'latex2e', - 'pprint': 'pseudoxml', - 'pformat': 'pseudoxml', - 'pdf': 'rlpdf', - 'xml': 'docutils_xml',} - -def get_writer_class(writer_name): - """Return the Writer class from the `writer_name` module.""" - writer_name = writer_name.lower() - if _writer_aliases.has_key(writer_name): - writer_name = _writer_aliases[writer_name] - module = __import__(writer_name, globals(), locals()) - return module.Writer diff --git a/docutils/docutils/writers/docutils_xml.py b/docutils/docutils/writers/docutils_xml.py deleted file mode 100644 index 4ecbfb6c2..000000000 --- a/docutils/docutils/writers/docutils_xml.py +++ /dev/null @@ -1,66 +0,0 @@ -# Authors: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Simple internal document tree Writer, writes Docutils XML. -""" - -__docformat__ = 'reStructuredText' - - -import docutils -from docutils import writers - - -class Writer(writers.Writer): - - supported = ('xml',) - """Formats this writer supports.""" - - settings_spec = ( - '"Docutils XML" Writer Options', - 'Warning: the --newlines and --indents options may adversely affect ' - 'whitespace; use them only for reading convenience.', - (('Generate XML with newlines before and after tags.', - ['--newlines'], {'action': 'store_true'}), - ('Generate XML with indents and newlines.', - ['--indents'], {'action': 'store_true'}), - ('Omit the XML declaration. Use with caution.', - ['--no-xml-declaration'], {'dest': 'xml_declaration', 'default': 1, - 'action': 'store_false'}), - ('Omit the DOCTYPE declaration.', - ['--no-doctype'], {'dest': 'doctype_declaration', 'default': 1, - 'action': 'store_false'}),)) - - output = None - """Final translated form of `document`.""" - - xml_declaration = '<?xml version="1.0" encoding="%s"?>\n' - #xml_stylesheet = '<?xml-stylesheet type="text/xsl" href="%s"?>\n' - doctype = ( - '<!DOCTYPE document PUBLIC' - ' "+//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML"' - ' "http://docutils.sourceforge.net/spec/docutils.dtd">\n') - generator = '<!-- Generated by Docutils %s -->\n' - - def translate(self): - settings = self.document.settings - indent = newline = '' - if settings.newlines: - newline = '\n' - if settings.indents: - newline = '\n' - indent = ' ' - output_prefix = [] - if settings.xml_declaration: - output_prefix.append( - self.xml_declaration % settings.output_encoding) - if settings.doctype_declaration: - output_prefix.append(self.doctype) - output_prefix.append(self.generator % docutils.__version__) - docnode = self.document.asdom().childNodes[0] - self.output = (''.join(output_prefix) - + docnode.toprettyxml(indent, newline)) diff --git a/docutils/docutils/writers/html4css1.py b/docutils/docutils/writers/html4css1.py deleted file mode 100644 index b73a622ad..000000000 --- a/docutils/docutils/writers/html4css1.py +++ /dev/null @@ -1,1244 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Simple HyperText Markup Language document tree Writer. - -The output conforms to the HTML 4.01 Transitional DTD and to the Extensible -HTML version 1.0 Transitional DTD (*almost* strict). The output contains a -minimum of formatting information. A cascading style sheet ("default.css" by -default) is required for proper viewing with a modern graphical browser. -""" - -__docformat__ = 'reStructuredText' - - -import sys -import os -import os.path -import time -import re -from types import ListType -import docutils -from docutils import nodes, utils, writers, languages - - -class Writer(writers.Writer): - - supported = ('html', 'html4css1', 'xhtml') - """Formats this writer supports.""" - - settings_spec = ( - 'HTML-Specific Options', - None, - (('Specify a stylesheet URL, used verbatim. Default is ' - '"default.css". Overridden by --stylesheet-path.', - ['--stylesheet'], - {'default': 'default.css', 'metavar': '<URL>'}), - ('Specify a stylesheet file, relative to the current working ' - 'directory. The path is adjusted relative to the output HTML ' - 'file. Overrides --stylesheet.', - ['--stylesheet-path'], - {'metavar': '<file>'}), - ('Link to the stylesheet in the output HTML file. This is the ' - 'default.', - ['--link-stylesheet'], - {'dest': 'embed_stylesheet', 'action': 'store_false'}), - ('Embed the stylesheet in the output HTML file. The stylesheet ' - 'file must be accessible during processing (--stylesheet-path is ' - 'recommended). The stylesheet is embedded inside a comment, so it ' - 'must not contain the text "--" (two hyphens). Default: link the ' - 'stylesheet, do not embed it.', - ['--embed-stylesheet'], - {'action': 'store_true'}), - ('Format for footnote references: one of "superscript" or ' - '"brackets". Default is "superscript".', - ['--footnote-references'], - {'choices': ['superscript', 'brackets'], 'default': 'superscript', - 'metavar': '<format>'}), - ('Format for block quote attributions: one of "dash" (em-dash ' - 'prefix), "parentheses"/"parens", or "none". Default is "dash".', - ['--attribution'], - {'choices': ['dash', 'parentheses', 'parens', 'none'], - 'default': 'dash', 'metavar': '<format>'}), - ('Remove extra vertical whitespace between items of bullet lists ' - 'and enumerated lists, when list items are "simple" (i.e., all ' - 'items each contain one paragraph and/or one "simple" sublist ' - 'only). Default: enabled.', - ['--compact-lists'], - {'default': 1, 'action': 'store_true'}), - ('Disable compact simple bullet and enumerated lists.', - ['--no-compact-lists'], - {'dest': 'compact_lists', 'action': 'store_false'}), - ('Omit the XML declaration. Use with caution.', - ['--no-xml-declaration'], {'dest': 'xml_declaration', 'default': 1, - 'action': 'store_false'}),)) - - relative_path_settings = ('stylesheet_path',) - - output = None - """Final translated form of `document`.""" - - def __init__(self): - writers.Writer.__init__(self) - self.translator_class = HTMLTranslator - - def translate(self): - visitor = self.translator_class(self.document) - self.document.walkabout(visitor) - self.output = visitor.astext() - self.head_prefix = visitor.head_prefix - self.stylesheet = visitor.stylesheet - self.head = visitor.head - self.body_prefix = visitor.body_prefix - self.body_pre_docinfo = visitor.body_pre_docinfo - self.docinfo = visitor.docinfo - self.body = visitor.body - self.body_suffix = visitor.body_suffix - - -class HTMLTranslator(nodes.NodeVisitor): - - """ - This HTML writer has been optimized to produce visually compact - lists (less vertical whitespace). HTML's mixed content models - allow list items to contain "<li><p>body elements</p></li>" or - "<li>just text</li>" or even "<li>text<p>and body - elements</p>combined</li>", each with different effects. It would - be best to stick with strict body elements in list items, but they - affect vertical spacing in browsers (although they really - shouldn't). - - Here is an outline of the optimization: - - - Check for and omit <p> tags in "simple" lists: list items - contain either a single paragraph, a nested simple list, or a - paragraph followed by a nested simple list. This means that - this list can be compact: - - - Item 1. - - Item 2. - - But this list cannot be compact: - - - Item 1. - - This second paragraph forces space between list items. - - - Item 2. - - - In non-list contexts, omit <p> tags on a paragraph if that - paragraph is the only child of its parent (footnotes & citations - are allowed a label first). - - - Regardless of the above, in definitions, table cells, field bodies, - option descriptions, and list items, mark the first child with - 'class="first"' and the last child with 'class="last"'. The stylesheet - sets the margins (top & bottom respecively) to 0 for these elements. - - The ``no_compact_lists`` setting (``--no-compact-lists`` command-line - option) disables list whitespace optimization. - """ - - xml_declaration = '<?xml version="1.0" encoding="%s" ?>\n' - doctype = ('<!DOCTYPE html' - ' PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"' - ' "http://www.w3.org/TR/xhtml1/DTD/' - 'xhtml1-transitional.dtd">\n') - html_head = ('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="%s" ' - 'lang="%s">\n<head>\n') - content_type = ('<meta http-equiv="Content-Type" content="text/html; ' - 'charset=%s" />\n') - generator = ('<meta name="generator" content="Docutils %s: ' - 'http://docutils.sourceforge.net/" />\n') - stylesheet_link = '<link rel="stylesheet" href="%s" type="text/css" />\n' - embedded_stylesheet = '<style type="text/css"><!--\n\n%s\n--></style>\n' - named_tags = {'a': 1, 'applet': 1, 'form': 1, 'frame': 1, 'iframe': 1, - 'img': 1, 'map': 1} - words_and_spaces = re.compile(r'\S+| +|\n') - - def __init__(self, document): - nodes.NodeVisitor.__init__(self, document) - self.settings = settings = document.settings - lcode = settings.language_code - self.language = languages.get_language(lcode) - self.head_prefix = [ - self.doctype, - self.html_head % (lcode, lcode), - self.content_type % settings.output_encoding, - self.generator % docutils.__version__] - if settings.xml_declaration: - self.head_prefix.insert(0, self.xml_declaration - % settings.output_encoding) - self.head = [] - if settings.embed_stylesheet: - stylesheet = self.get_stylesheet_reference( - os.path.join(os.getcwd(), 'dummy')) - stylesheet_text = open(stylesheet).read() - self.stylesheet = [self.embedded_stylesheet % stylesheet_text] - else: - stylesheet = self.get_stylesheet_reference() - if stylesheet: - self.stylesheet = [self.stylesheet_link % stylesheet] - else: - self.stylesheet = [] - self.body_prefix = ['</head>\n<body>\n'] - self.body_pre_docinfo = [] - self.docinfo = [] - self.body = [] - self.body_suffix = ['</body>\n</html>\n'] - self.section_level = 0 - self.context = [] - self.topic_class = '' - self.colspecs = [] - self.compact_p = 1 - self.compact_simple = None - self.in_docinfo = None - self.in_sidebar = None - - def get_stylesheet_reference(self, relative_to=None): - settings = self.settings - if settings.stylesheet_path: - if relative_to == None: - relative_to = settings._destination - return utils.relative_path(relative_to, settings.stylesheet_path) - else: - return settings.stylesheet - - def astext(self): - return ''.join(self.head_prefix + self.head - + self.stylesheet + self.body_prefix - + self.body_pre_docinfo + self.docinfo - + self.body + self.body_suffix) - - def encode(self, text): - """Encode special characters in `text` & return.""" - # @@@ A codec to do these and all other HTML entities would be nice. - text = text.replace("&", "&") - text = text.replace("<", "<") - text = text.replace('"', """) - text = text.replace(">", ">") - text = text.replace("@", "@") # may thwart some address harvesters - return text - - def attval(self, text, - whitespace=re.compile('[\n\r\t\v\f]')): - """Cleanse, HTML encode, and return attribute value text.""" - return self.encode(whitespace.sub(' ', text)) - - def starttag(self, node, tagname, suffix='\n', infix='', **attributes): - """ - Construct and return a start tag given a node (id & class attributes - are extracted), tag name, and optional attributes. - """ - tagname = tagname.lower() - atts = {} - for (name, value) in attributes.items(): - atts[name.lower()] = value - for att in ('class',): # append to node attribute - if node.has_key(att) or atts.has_key(att): - atts[att] = \ - (node.get(att, '') + ' ' + atts.get(att, '')).strip() - for att in ('id',): # node attribute overrides - if node.has_key(att): - atts[att] = node[att] - if atts.has_key('id') and self.named_tags.has_key(tagname): - atts['name'] = atts['id'] # for compatibility with old browsers - attlist = atts.items() - attlist.sort() - parts = [tagname] - for name, value in attlist: - if value is None: # boolean attribute - # According to the HTML spec, ``<element boolean>`` is good, - # ``<element boolean="boolean">`` is bad. - # (But the XHTML (XML) spec says the opposite. <sigh>) - parts.append(name.lower()) - elif isinstance(value, ListType): - values = [unicode(v) for v in value] - parts.append('%s="%s"' % (name.lower(), - self.attval(' '.join(values)))) - else: - parts.append('%s="%s"' % (name.lower(), - self.attval(unicode(value)))) - return '<%s%s>%s' % (' '.join(parts), infix, suffix) - - def emptytag(self, node, tagname, suffix='\n', **attributes): - """Construct and return an XML-compatible empty tag.""" - return self.starttag(node, tagname, suffix, infix=' /', **attributes) - - def visit_Text(self, node): - self.body.append(self.encode(node.astext())) - - def depart_Text(self, node): - pass - - def visit_abbreviation(self, node): - # @@@ implementation incomplete ("title" attribute) - self.body.append(self.starttag(node, 'abbr', '')) - - def depart_abbreviation(self, node): - self.body.append('</abbr>') - - def visit_acronym(self, node): - # @@@ implementation incomplete ("title" attribute) - self.body.append(self.starttag(node, 'acronym', '')) - - def depart_acronym(self, node): - self.body.append('</acronym>') - - def visit_address(self, node): - self.visit_docinfo_item(node, 'address', meta=None) - self.body.append(self.starttag(node, 'pre', CLASS='address')) - - def depart_address(self, node): - self.body.append('\n</pre>\n') - self.depart_docinfo_item() - - def visit_admonition(self, node, name=''): - self.body.append(self.starttag(node, 'div', - CLASS=(name or 'admonition'))) - if name: - self.body.append('<p class="admonition-title">' - + self.language.labels[name] + '</p>\n') - - def depart_admonition(self, node=None): - self.body.append('</div>\n') - - def visit_attention(self, node): - self.visit_admonition(node, 'attention') - - def depart_attention(self, node): - self.depart_admonition() - - attribution_formats = {'dash': ('—', ''), - 'parentheses': ('(', ')'), - 'parens': ('(', ')'), - 'none': ('', '')} - - def visit_attribution(self, node): - prefix, suffix = self.attribution_formats[self.settings.attribution] - self.context.append(suffix) - self.body.append( - self.starttag(node, 'p', prefix, CLASS='attribution')) - - def depart_attribution(self, node): - self.body.append(self.context.pop() + '</p>\n') - - def visit_author(self, node): - self.visit_docinfo_item(node, 'author') - - def depart_author(self, node): - self.depart_docinfo_item() - - def visit_authors(self, node): - pass - - def depart_authors(self, node): - pass - - def visit_block_quote(self, node): - self.body.append(self.starttag(node, 'blockquote')) - - def depart_block_quote(self, node): - self.body.append('</blockquote>\n') - - def check_simple_list(self, node): - """Check for a simple list that can be rendered compactly.""" - visitor = SimpleListChecker(self.document) - try: - node.walk(visitor) - except nodes.NodeFound: - return None - else: - return 1 - - def visit_bullet_list(self, node): - atts = {} - old_compact_simple = self.compact_simple - self.context.append((self.compact_simple, self.compact_p)) - self.compact_p = None - self.compact_simple = (self.settings.compact_lists and - (self.compact_simple - or self.topic_class == 'contents' - or self.check_simple_list(node))) - if self.compact_simple and not old_compact_simple: - atts['class'] = 'simple' - self.body.append(self.starttag(node, 'ul', **atts)) - - def depart_bullet_list(self, node): - self.compact_simple, self.compact_p = self.context.pop() - self.body.append('</ul>\n') - - def visit_caption(self, node): - self.body.append(self.starttag(node, 'p', '', CLASS='caption')) - - def depart_caption(self, node): - self.body.append('</p>\n') - - def visit_caution(self, node): - self.visit_admonition(node, 'caution') - - def depart_caution(self, node): - self.depart_admonition() - - def visit_citation(self, node): - self.body.append(self.starttag(node, 'table', CLASS='citation', - frame="void", rules="none")) - self.body.append('<colgroup><col class="label" /><col /></colgroup>\n' - '<col />\n' - '<tbody valign="top">\n' - '<tr>') - self.footnote_backrefs(node) - - def depart_citation(self, node): - self.body.append('</td></tr>\n' - '</tbody>\n</table>\n') - - def visit_citation_reference(self, node): - href = '' - if node.has_key('refid'): - href = '#' + node['refid'] - elif node.has_key('refname'): - href = '#' + self.document.nameids[node['refname']] - self.body.append(self.starttag(node, 'a', '[', href=href, - CLASS='citation-reference')) - - def depart_citation_reference(self, node): - self.body.append(']</a>') - - def visit_classifier(self, node): - self.body.append(' <span class="classifier-delimiter">:</span> ') - self.body.append(self.starttag(node, 'span', '', CLASS='classifier')) - - def depart_classifier(self, node): - self.body.append('</span>') - - def visit_colspec(self, node): - self.colspecs.append(node) - - def depart_colspec(self, node): - pass - - def write_colspecs(self): - width = 0 - for node in self.colspecs: - width += node['colwidth'] - for node in self.colspecs: - colwidth = int(node['colwidth'] * 100.0 / width + 0.5) - self.body.append(self.emptytag(node, 'col', - width='%i%%' % colwidth)) - self.colspecs = [] - - def visit_comment(self, node, - sub=re.compile('-(?=-)').sub): - """Escape double-dashes in comment text.""" - self.body.append('<!-- %s -->\n' % sub('- ', node.astext())) - # Content already processed: - raise nodes.SkipNode - - def visit_contact(self, node): - self.visit_docinfo_item(node, 'contact', meta=None) - - def depart_contact(self, node): - self.depart_docinfo_item() - - def visit_copyright(self, node): - self.visit_docinfo_item(node, 'copyright') - - def depart_copyright(self, node): - self.depart_docinfo_item() - - def visit_danger(self, node): - self.visit_admonition(node, 'danger') - - def depart_danger(self, node): - self.depart_admonition() - - def visit_date(self, node): - self.visit_docinfo_item(node, 'date') - - def depart_date(self, node): - self.depart_docinfo_item() - - def visit_decoration(self, node): - pass - - def depart_decoration(self, node): - pass - - def visit_definition(self, node): - self.body.append('</dt>\n') - self.body.append(self.starttag(node, 'dd', '')) - if len(node): - node[0].set_class('first') - node[-1].set_class('last') - - def depart_definition(self, node): - self.body.append('</dd>\n') - - def visit_definition_list(self, node): - self.body.append(self.starttag(node, 'dl')) - - def depart_definition_list(self, node): - self.body.append('</dl>\n') - - def visit_definition_list_item(self, node): - pass - - def depart_definition_list_item(self, node): - pass - - def visit_description(self, node): - self.body.append(self.starttag(node, 'td', '')) - if len(node): - node[0].set_class('first') - node[-1].set_class('last') - - def depart_description(self, node): - self.body.append('</td>') - - def visit_docinfo(self, node): - self.context.append(len(self.body)) - self.body.append(self.starttag(node, 'table', CLASS='docinfo', - frame="void", rules="none")) - self.body.append('<col class="docinfo-name" />\n' - '<col class="docinfo-content" />\n' - '<tbody valign="top">\n') - self.in_docinfo = 1 - - def depart_docinfo(self, node): - self.body.append('</tbody>\n</table>\n') - self.in_docinfo = None - start = self.context.pop() - self.body_pre_docinfo = self.body[:start] - self.docinfo = self.body[start:] - self.body = [] - - def visit_docinfo_item(self, node, name, meta=1): - if meta: - self.head.append('<meta name="%s" content="%s" />\n' - % (name, self.attval(node.astext()))) - self.body.append(self.starttag(node, 'tr', '')) - self.body.append('<th class="docinfo-name">%s:</th>\n<td>' - % self.language.labels[name]) - if len(node): - if isinstance(node[0], nodes.Element): - node[0].set_class('first') - if isinstance(node[-1], nodes.Element): - node[-1].set_class('last') - - def depart_docinfo_item(self): - self.body.append('</td></tr>\n') - - def visit_doctest_block(self, node): - self.body.append(self.starttag(node, 'pre', CLASS='doctest-block')) - - def depart_doctest_block(self, node): - self.body.append('\n</pre>\n') - - def visit_document(self, node): - self.body.append(self.starttag(node, 'div', CLASS='document')) - - def depart_document(self, node): - self.body.append('</div>\n') - - def visit_emphasis(self, node): - self.body.append('<em>') - - def depart_emphasis(self, node): - self.body.append('</em>') - - def visit_entry(self, node): - if isinstance(node.parent.parent, nodes.thead): - tagname = 'th' - else: - tagname = 'td' - atts = {} - if node.has_key('morerows'): - atts['rowspan'] = node['morerows'] + 1 - if node.has_key('morecols'): - atts['colspan'] = node['morecols'] + 1 - self.body.append(self.starttag(node, tagname, '', **atts)) - self.context.append('</%s>\n' % tagname.lower()) - if len(node) == 0: # empty cell - self.body.append(' ') - else: - node[0].set_class('first') - node[-1].set_class('last') - - def depart_entry(self, node): - self.body.append(self.context.pop()) - - def visit_enumerated_list(self, node): - """ - The 'start' attribute does not conform to HTML 4.01's strict.dtd, but - CSS1 doesn't help. CSS2 isn't widely enough supported yet to be - usable. - """ - atts = {} - if node.has_key('start'): - atts['start'] = node['start'] - if node.has_key('enumtype'): - atts['class'] = node['enumtype'] - # @@@ To do: prefix, suffix. How? Change prefix/suffix to a - # single "format" attribute? Use CSS2? - old_compact_simple = self.compact_simple - self.context.append((self.compact_simple, self.compact_p)) - self.compact_p = None - self.compact_simple = (self.settings.compact_lists and - (self.compact_simple - or self.topic_class == 'contents' - or self.check_simple_list(node))) - if self.compact_simple and not old_compact_simple: - atts['class'] = (atts.get('class', '') + ' simple').strip() - self.body.append(self.starttag(node, 'ol', **atts)) - - def depart_enumerated_list(self, node): - self.compact_simple, self.compact_p = self.context.pop() - self.body.append('</ol>\n') - - def visit_error(self, node): - self.visit_admonition(node, 'error') - - def depart_error(self, node): - self.depart_admonition() - - def visit_field(self, node): - self.body.append(self.starttag(node, 'tr', '', CLASS='field')) - - def depart_field(self, node): - self.body.append('</tr>\n') - - def visit_field_body(self, node): - self.body.append(self.starttag(node, 'td', '', CLASS='field-body')) - if len(node): - node[0].set_class('first') - node[-1].set_class('last') - - def depart_field_body(self, node): - self.body.append('</td>\n') - - def visit_field_list(self, node): - self.body.append(self.starttag(node, 'table', frame='void', - rules='none', CLASS='field-list')) - self.body.append('<col class="field-name" />\n' - '<col class="field-body" />\n' - '<tbody valign="top">\n') - - def depart_field_list(self, node): - self.body.append('</tbody>\n</table>\n') - - def visit_field_name(self, node): - atts = {} - if self.in_docinfo: - atts['class'] = 'docinfo-name' - else: - atts['class'] = 'field-name' - if len(node.astext()) > 14: - atts['colspan'] = 2 - self.context.append('</tr>\n<tr><td> </td>') - else: - self.context.append('') - self.body.append(self.starttag(node, 'th', '', **atts)) - - def depart_field_name(self, node): - self.body.append(':</th>') - self.body.append(self.context.pop()) - - def visit_figure(self, node): - atts = {'class': 'figure'} - if node.get('width'): - atts['style'] = 'width: %spx' % node['width'] - self.body.append(self.starttag(node, 'div', **atts)) - - def depart_figure(self, node): - self.body.append('</div>\n') - - def visit_footer(self, node): - self.context.append(len(self.body)) - - def depart_footer(self, node): - start = self.context.pop() - footer = (['<hr class="footer"/>\n', - self.starttag(node, 'div', CLASS='footer')] - + self.body[start:] + ['</div>\n']) - self.body_suffix[:0] = footer - del self.body[start:] - - def visit_footnote(self, node): - self.body.append(self.starttag(node, 'table', CLASS='footnote', - frame="void", rules="none")) - self.body.append('<colgroup><col class="label" /><col /></colgroup>\n' - '<tbody valign="top">\n' - '<tr>') - self.footnote_backrefs(node) - - def footnote_backrefs(self, node): - if self.settings.footnote_backlinks and node.hasattr('backrefs'): - backrefs = node['backrefs'] - if len(backrefs) == 1: - self.context.append('') - self.context.append('<a class="fn-backref" href="#%s" ' - 'name="%s">' % (backrefs[0], node['id'])) - else: - i = 1 - backlinks = [] - for backref in backrefs: - backlinks.append('<a class="fn-backref" href="#%s">%s</a>' - % (backref, i)) - i += 1 - self.context.append('<em>(%s)</em> ' % ', '.join(backlinks)) - self.context.append('<a name="%s">' % node['id']) - else: - self.context.append('') - self.context.append('<a name="%s">' % node['id']) - - def depart_footnote(self, node): - self.body.append('</td></tr>\n' - '</tbody>\n</table>\n') - - def visit_footnote_reference(self, node): - href = '' - if node.has_key('refid'): - href = '#' + node['refid'] - elif node.has_key('refname'): - href = '#' + self.document.nameids[node['refname']] - format = self.settings.footnote_references - if format == 'brackets': - suffix = '[' - self.context.append(']') - elif format == 'superscript': - suffix = '<sup>' - self.context.append('</sup>') - else: # shouldn't happen - suffix = '???' - self.content.append('???') - self.body.append(self.starttag(node, 'a', suffix, href=href, - CLASS='footnote-reference')) - - def depart_footnote_reference(self, node): - self.body.append(self.context.pop() + '</a>') - - def visit_generated(self, node): - pass - - def depart_generated(self, node): - pass - - def visit_header(self, node): - self.context.append(len(self.body)) - - def depart_header(self, node): - start = self.context.pop() - self.body_prefix.append(self.starttag(node, 'div', CLASS='header')) - self.body_prefix.extend(self.body[start:]) - self.body_prefix.append('<hr />\n</div>\n') - del self.body[start:] - - def visit_hint(self, node): - self.visit_admonition(node, 'hint') - - def depart_hint(self, node): - self.depart_admonition() - - def visit_image(self, node): - atts = node.attributes.copy() - atts['src'] = atts['uri'] - del atts['uri'] - if not atts.has_key('alt'): - atts['alt'] = atts['src'] - if isinstance(node.parent, nodes.TextElement): - self.context.append('') - else: - self.body.append('<p>') - self.context.append('</p>\n') - self.body.append(self.emptytag(node, 'img', '', **atts)) - - def depart_image(self, node): - self.body.append(self.context.pop()) - - def visit_important(self, node): - self.visit_admonition(node, 'important') - - def depart_important(self, node): - self.depart_admonition() - - def visit_inline(self, node): - self.body.append(self.starttag(node, 'span', '')) - - def depart_inline(self, node): - self.body.append('</span>') - - def visit_label(self, node): - self.body.append(self.starttag(node, 'td', '%s[' % self.context.pop(), - CLASS='label')) - - def depart_label(self, node): - self.body.append(']</a></td><td>%s' % self.context.pop()) - - def visit_legend(self, node): - self.body.append(self.starttag(node, 'div', CLASS='legend')) - - def depart_legend(self, node): - self.body.append('</div>\n') - - def visit_line_block(self, node): - self.body.append(self.starttag(node, 'pre', CLASS='line-block')) - - def depart_line_block(self, node): - self.body.append('\n</pre>\n') - - def visit_list_item(self, node): - self.body.append(self.starttag(node, 'li', '')) - if len(node): - node[0].set_class('first') - - def depart_list_item(self, node): - self.body.append('</li>\n') - - def visit_literal(self, node): - """Process text to prevent tokens from wrapping.""" - self.body.append(self.starttag(node, 'tt', '', CLASS='literal')) - text = node.astext() - for token in self.words_and_spaces.findall(text): - if token.strip(): - # Protect text like "--an-option" from bad line wrapping: - self.body.append('<span class="pre">%s</span>' - % self.encode(token)) - elif token in ('\n', ' '): - # Allow breaks at whitespace: - self.body.append(token) - else: - # Protect runs of multiple spaces; the last space can wrap: - self.body.append(' ' * (len(token) - 1) + ' ') - self.body.append('</tt>') - # Content already processed: - raise nodes.SkipNode - - def visit_literal_block(self, node): - self.body.append(self.starttag(node, 'pre', CLASS='literal-block')) - - def depart_literal_block(self, node): - self.body.append('\n</pre>\n') - - def visit_meta(self, node): - self.head.append(self.emptytag(node, 'meta', **node.attributes)) - - def depart_meta(self, node): - pass - - def visit_note(self, node): - self.visit_admonition(node, 'note') - - def depart_note(self, node): - self.depart_admonition() - - def visit_option(self, node): - if self.context[-1]: - self.body.append(', ') - - def depart_option(self, node): - self.context[-1] += 1 - - def visit_option_argument(self, node): - self.body.append(node.get('delimiter', ' ')) - self.body.append(self.starttag(node, 'var', '')) - - def depart_option_argument(self, node): - self.body.append('</var>') - - def visit_option_group(self, node): - atts = {} - if len(node.astext()) > 14: - atts['colspan'] = 2 - self.context.append('</tr>\n<tr><td> </td>') - else: - self.context.append('') - self.body.append(self.starttag(node, 'td', **atts)) - self.body.append('<kbd>') - self.context.append(0) # count number of options - - def depart_option_group(self, node): - self.context.pop() - self.body.append('</kbd></td>\n') - self.body.append(self.context.pop()) - - def visit_option_list(self, node): - self.body.append( - self.starttag(node, 'table', CLASS='option-list', - frame="void", rules="none")) - self.body.append('<col class="option" />\n' - '<col class="description" />\n' - '<tbody valign="top">\n') - - def depart_option_list(self, node): - self.body.append('</tbody>\n</table>\n') - - def visit_option_list_item(self, node): - self.body.append(self.starttag(node, 'tr', '')) - - def depart_option_list_item(self, node): - self.body.append('</tr>\n') - - def visit_option_string(self, node): - self.body.append(self.starttag(node, 'span', '', CLASS='option')) - - def depart_option_string(self, node): - self.body.append('</span>') - - def visit_organization(self, node): - self.visit_docinfo_item(node, 'organization') - - def depart_organization(self, node): - self.depart_docinfo_item() - - def visit_paragraph(self, node): - # Omit <p> tags if this is an only child and optimizable. - if (self.compact_simple or - self.compact_p and (len(node.parent) == 1 or - len(node.parent) == 2 and - isinstance(node.parent[0], nodes.label))): - self.context.append('') - else: - self.body.append(self.starttag(node, 'p', '')) - self.context.append('</p>\n') - - def depart_paragraph(self, node): - self.body.append(self.context.pop()) - - def visit_problematic(self, node): - if node.hasattr('refid'): - self.body.append('<a href="#%s" name="%s">' % (node['refid'], - node['id'])) - self.context.append('</a>') - else: - self.context.append('') - self.body.append(self.starttag(node, 'span', '', CLASS='problematic')) - - def depart_problematic(self, node): - self.body.append('</span>') - self.body.append(self.context.pop()) - - def visit_raw(self, node): - if node.get('format') == 'html': - self.body.append(node.astext()) - # Keep non-HTML raw text out of output: - raise nodes.SkipNode - - def visit_reference(self, node): - if node.has_key('refuri'): - href = node['refuri'] - elif node.has_key('refid'): - href = '#' + node['refid'] - elif node.has_key('refname'): - href = '#' + self.document.nameids[node['refname']] - self.body.append(self.starttag(node, 'a', '', href=href, - CLASS='reference')) - - def depart_reference(self, node): - self.body.append('</a>') - - def visit_revision(self, node): - self.visit_docinfo_item(node, 'revision', meta=None) - - def depart_revision(self, node): - self.depart_docinfo_item() - - def visit_row(self, node): - self.body.append(self.starttag(node, 'tr', '')) - - def depart_row(self, node): - self.body.append('</tr>\n') - - def visit_rubric(self, node): - self.body.append(self.starttag(node, 'p', '', CLASS='rubric')) - - def depart_rubric(self, node): - self.body.append('</p>\n') - - def visit_section(self, node): - self.section_level += 1 - self.body.append(self.starttag(node, 'div', CLASS='section')) - - def depart_section(self, node): - self.section_level -= 1 - self.body.append('</div>\n') - - def visit_sidebar(self, node): - self.body.append(self.starttag(node, 'div', CLASS='sidebar')) - self.in_sidebar = 1 - - def depart_sidebar(self, node): - self.body.append('</div>\n') - self.in_sidebar = None - - def visit_status(self, node): - self.visit_docinfo_item(node, 'status', meta=None) - - def depart_status(self, node): - self.depart_docinfo_item() - - def visit_strong(self, node): - self.body.append('<strong>') - - def depart_strong(self, node): - self.body.append('</strong>') - - def visit_subscript(self, node): - self.body.append(self.starttag(node, 'sub', '')) - - def depart_subscript(self, node): - self.body.append('</sub>') - - def visit_substitution_definition(self, node): - """Internal only.""" - raise nodes.SkipNode - - def visit_substitution_reference(self, node): - self.unimplemented_visit(node) - - def visit_subtitle(self, node): - if isinstance(node.parent, nodes.sidebar): - self.body.append(self.starttag(node, 'p', '', - CLASS='sidebar-subtitle')) - self.context.append('</p>\n') - else: - self.body.append(self.starttag(node, 'h2', '', CLASS='subtitle')) - self.context.append('</h2>\n') - - def depart_subtitle(self, node): - self.body.append(self.context.pop()) - - def visit_superscript(self, node): - self.body.append(self.starttag(node, 'sup', '')) - - def depart_superscript(self, node): - self.body.append('</sup>') - - def visit_system_message(self, node): - if node['level'] < self.document.reporter['writer'].report_level: - # Level is too low to display: - raise nodes.SkipNode - self.body.append(self.starttag(node, 'div', CLASS='system-message')) - self.body.append('<p class="system-message-title">') - attr = {} - backref_text = '' - if node.hasattr('id'): - attr['name'] = node['id'] - if node.hasattr('backrefs'): - backrefs = node['backrefs'] - if len(backrefs) == 1: - backref_text = ('; <em><a href="#%s">backlink</a></em>' - % backrefs[0]) - else: - i = 1 - backlinks = [] - for backref in backrefs: - backlinks.append('<a href="#%s">%s</a>' % (backref, i)) - i += 1 - backref_text = ('; <em>backlinks: %s</em>' - % ', '.join(backlinks)) - if node.hasattr('line'): - line = ', line %s' % node['line'] - else: - line = '' - if attr: - a_start = self.starttag({}, 'a', '', **attr) - a_end = '</a>' - else: - a_start = a_end = '' - self.body.append('System Message: %s%s/%s%s (<tt>%s</tt>%s)%s</p>\n' - % (a_start, node['type'], node['level'], a_end, - self.encode(node['source']), line, backref_text)) - - def depart_system_message(self, node): - self.body.append('</div>\n') - - def visit_table(self, node): - self.body.append( - self.starttag(node, 'table', CLASS="table", - frame='border', rules='all')) - - def depart_table(self, node): - self.body.append('</table>\n') - - def visit_target(self, node): - if not (node.has_key('refuri') or node.has_key('refid') - or node.has_key('refname')): - self.body.append(self.starttag(node, 'a', '', CLASS='target')) - self.context.append('</a>') - else: - self.context.append('') - - def depart_target(self, node): - self.body.append(self.context.pop()) - - def visit_tbody(self, node): - self.write_colspecs() - self.body.append(self.context.pop()) # '</colgroup>\n' or '' - self.body.append(self.starttag(node, 'tbody', valign='top')) - - def depart_tbody(self, node): - self.body.append('</tbody>\n') - - def visit_term(self, node): - self.body.append(self.starttag(node, 'dt', '')) - - def depart_term(self, node): - """ - Leave the end tag to `self.visit_definition()`, in case there's a - classifier. - """ - pass - - def visit_tgroup(self, node): - # Mozilla needs <colgroup>: - self.body.append(self.starttag(node, 'colgroup')) - # Appended by thead or tbody: - self.context.append('</colgroup>\n') - - def depart_tgroup(self, node): - pass - - def visit_thead(self, node): - self.write_colspecs() - self.body.append(self.context.pop()) # '</colgroup>\n' - # There may or may not be a <thead>; this is for <tbody> to use: - self.context.append('') - self.body.append(self.starttag(node, 'thead', valign='bottom')) - - def depart_thead(self, node): - self.body.append('</thead>\n') - - def visit_tip(self, node): - self.visit_admonition(node, 'tip') - - def depart_tip(self, node): - self.depart_admonition() - - def visit_title(self, node): - """Only 6 section levels are supported by HTML.""" - check_id = 0 - if isinstance(node.parent, nodes.topic): - self.body.append( - self.starttag(node, 'p', '', CLASS='topic-title')) - check_id = 1 - elif isinstance(node.parent, nodes.sidebar): - self.body.append( - self.starttag(node, 'p', '', CLASS='sidebar-title')) - check_id = 1 - elif isinstance(node.parent, nodes.admonition): - self.body.append( - self.starttag(node, 'p', '', CLASS='admonition-title')) - check_id = 1 - elif self.section_level == 0: - # document title - self.head.append('<title>%s\n' - % self.encode(node.astext())) - self.body.append(self.starttag(node, 'h1', '', CLASS='title')) - self.context.append('

\n') - else: - self.body.append( - self.starttag(node, 'h%s' % self.section_level, '')) - atts = {} - if node.parent.hasattr('id'): - atts['name'] = node.parent['id'] - if node.hasattr('refid'): - atts['class'] = 'toc-backref' - atts['href'] = '#' + node['refid'] - self.body.append(self.starttag({}, 'a', '', **atts)) - self.context.append('\n' % (self.section_level)) - if check_id: - if node.parent.hasattr('id'): - self.body.append( - self.starttag({}, 'a', '', name=node.parent['id'])) - self.context.append('

\n') - else: - self.context.append('

\n') - - def depart_title(self, node): - self.body.append(self.context.pop()) - - def visit_title_reference(self, node): - self.body.append(self.starttag(node, 'cite', '')) - - def depart_title_reference(self, node): - self.body.append('') - - def visit_topic(self, node): - self.body.append(self.starttag(node, 'div', CLASS='topic')) - self.topic_class = node.get('class') - - def depart_topic(self, node): - self.body.append('
\n') - self.topic_class = '' - - def visit_transition(self, node): - self.body.append(self.emptytag(node, 'hr')) - - def depart_transition(self, node): - pass - - def visit_version(self, node): - self.visit_docinfo_item(node, 'version', meta=None) - - def depart_version(self, node): - self.depart_docinfo_item() - - def visit_warning(self, node): - self.visit_admonition(node, 'warning') - - def depart_warning(self, node): - self.depart_admonition() - - def unimplemented_visit(self, node): - raise NotImplementedError('visiting unimplemented node type: %s' - % node.__class__.__name__) - - -class SimpleListChecker(nodes.GenericNodeVisitor): - - """ - Raise `nodes.SkipNode` if non-simple list item is encountered. - - Here "simple" means a list item containing nothing other than a single - paragraph, a simple list, or a paragraph followed by a simple list. - """ - - def default_visit(self, node): - raise nodes.NodeFound - - def visit_bullet_list(self, node): - pass - - def visit_enumerated_list(self, node): - pass - - def visit_list_item(self, node): - children = [] - for child in node.get_children(): - if not isinstance(child, nodes.Invisible): - children.append(child) - if (children and isinstance(children[0], nodes.paragraph) - and (isinstance(children[-1], nodes.bullet_list) - or isinstance(children[-1], nodes.enumerated_list))): - children.pop() - if len(children) <= 1: - return - else: - raise nodes.NodeFound - - def visit_paragraph(self, node): - raise nodes.SkipNode - - def invisible_visit(self, node): - """Invisible nodes should be ignored.""" - pass - - visit_comment = invisible_visit - visit_substitution_definition = invisible_visit - visit_target = invisible_visit - visit_pending = invisible_visit diff --git a/docutils/docutils/writers/latex2e.py b/docutils/docutils/writers/latex2e.py deleted file mode 100644 index 619d168b7..000000000 --- a/docutils/docutils/writers/latex2e.py +++ /dev/null @@ -1,1472 +0,0 @@ -""" -:Author: Engelbert Gruber -:Contact: grubert@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This module has been placed in the public domain. - -LaTeX2e document tree Writer. -""" - -__docformat__ = 'reStructuredText' - -# code contributions from several people included, thanks too all. -# some named: David Abrahams, Julien Letessier, who is missing. -# -# convention deactivate code by two # e.g. ##. - -import sys -import time -import re -import string -from types import ListType -from docutils import writers, nodes, languages - -class Writer(writers.Writer): - - supported = ('latex','latex2e') - """Formats this writer supports.""" - - settings_spec = ( - 'LaTeX-Specific Options', - 'The LaTeX "--output-encoding" default is "latin-1:strict".', - (('Specify documentclass. Default is "article".', - ['--documentclass'], - {'default': 'article', }), - ('Format for footnote references: one of "superscript" or ' - '"brackets". Default is "brackets".', - ['--footnote-references'], - {'choices': ['superscript', 'brackets'], 'default': 'brackets', - 'metavar': ''}), - ('Format for block quote attributions: one of "dash" (em-dash ' - 'prefix), "parentheses"/"parens", or "none". Default is "dash".', - ['--attribution'], - {'choices': ['dash', 'parentheses', 'parens', 'none'], - 'default': 'dash', 'metavar': ''}), - ('Specify a stylesheet file. The file will be "input" by latex ' - 'in the document header. Default is "style.tex". ' - 'If this is set to "" disables input.' - 'Overridden by --stylesheet-path.', - ['--stylesheet'], - {'default': 'style.tex', 'metavar': ''}), - ('Specify a stylesheet file, relative to the current working ' - 'directory.' - 'Overrides --stylesheet.', - ['--stylesheet-path'], - {'metavar': ''}), - ('Link to the stylesheet in the output LaTeX file. This is the ' - 'default.', - ['--link-stylesheet'], - {'dest': 'embed_stylesheet', 'action': 'store_false'}), - ('Embed the stylesheet in the output LaTeX file. The stylesheet ' - 'file must be accessible during processing (--stylesheet-path is ' - 'recommended).', - ['--embed-stylesheet'], - {'action': 'store_true'}), - ('Table of contents by docutils (default) or latex. Latex(writer) ' - 'supports only one ToC per document, but docutils does not write ' - 'pagenumbers.', - ['--use-latex-toc'], {'default': 0}), - ('Color of any hyperlinks embedded in text ' - '(default: "blue", "0" to disable).', - ['--hyperlink-color'], {'default': 'blue'}),)) - - settings_defaults = {'output_encoding': 'latin-1'} - - output = None - """Final translated form of `document`.""" - - def translate(self): - visitor = LaTeXTranslator(self.document) - self.document.walkabout(visitor) - self.output = visitor.astext() - self.head_prefix = visitor.head_prefix - self.head = visitor.head - self.body_prefix = visitor.body_prefix - self.body = visitor.body - self.body_suffix = visitor.body_suffix - -""" -Notes on LaTeX --------------- - -* latex does not support multiple tocs in one document. - (might be no limitation except for docutils documentation) - -* width - - * linewidth - width of a line in the local environment - * textwidth - the width of text on the page - - Maybe always use linewidth ? -""" - -class Babel: - """Language specifics for LaTeX.""" - # country code by a.schlock. - # partly manually converted from iso and babel stuff, dialects and some - _ISO639_TO_BABEL = { - 'no': 'norsk', #XXX added by hand ( forget about nynorsk?) - 'gd': 'scottish', #XXX added by hand - 'hu': 'magyar', #XXX added by hand - 'pt': 'portuguese',#XXX added by hand - 'sl': 'slovenian', - 'af': 'afrikaans', - 'bg': 'bulgarian', - 'br': 'breton', - 'ca': 'catalan', - 'cs': 'czech', - 'cy': 'welsh', - 'da': 'danish', - 'fr': 'french', - # french, francais, canadien, acadian - 'de': 'ngerman', #XXX rather than german - # ngerman, naustrian, german, germanb, austrian - 'el': 'greek', - 'en': 'english', - # english, USenglish, american, UKenglish, british, canadian - 'eo': 'esperanto', - 'es': 'spanish', - 'et': 'estonian', - 'eu': 'basque', - 'fi': 'finnish', - 'ga': 'irish', - 'gl': 'galician', - 'he': 'hebrew', - 'hr': 'croatian', - 'hu': 'hungarian', - 'is': 'icelandic', - 'it': 'italian', - 'la': 'latin', - 'nl': 'dutch', - 'pl': 'polish', - 'pt': 'portuguese', - 'ro': 'romanian', - 'ru': 'russian', - 'sk': 'slovak', - 'sr': 'serbian', - 'sv': 'swedish', - 'tr': 'turkish', - 'uk': 'ukrainian' - } - - def __init__(self,lang): - self.language = lang - # pdflatex does not produce double quotes for ngerman in tt. - self.double_quote_replacment = None - if re.search('^de',self.language): - # maybe use: {\glqq} {\grqq}. - self.quotes = ("\"`", "\"'") - self.double_quote_replacment = "{\\dq}" - else: - self.quotes = ("``", "''") - self.quote_index = 0 - - def next_quote(self): - q = self.quotes[self.quote_index] - self.quote_index = (self.quote_index+1)%2 - return q - - def quote_quotes(self,text): - t = None - for part in text.split('"'): - if t == None: - t = part - else: - t += self.next_quote() + part - return t - - def double_quotes_in_tt (self,text): - if not self.double_quote_replacment: - return text - return text.replace('"', self.double_quote_replacment) - - def get_language(self): - if self._ISO639_TO_BABEL.has_key(self.language): - return self._ISO639_TO_BABEL[self.language] - else: - # support dialects. - l = self.language.split("_")[0] - if self._ISO639_TO_BABEL.has_key(l): - return self._ISO639_TO_BABEL[l] - return None - - -latex_headings = { - 'optionlist_environment' : [ - '\\newcommand{\\optionlistlabel}[1]{\\bf #1 \\hfill}\n' - '\\newenvironment{optionlist}[1]\n' - '{\\begin{list}{}\n' - ' {\\setlength{\\labelwidth}{#1}\n' - ' \\setlength{\\rightmargin}{1cm}\n' - ' \\setlength{\\leftmargin}{\\rightmargin}\n' - ' \\addtolength{\\leftmargin}{\\labelwidth}\n' - ' \\addtolength{\\leftmargin}{\\labelsep}\n' - ' \\renewcommand{\\makelabel}{\\optionlistlabel}}\n' - '}{\\end{list}}\n', - ], - 'footnote_floats' : [ - '% begin: floats for footnotes tweaking.\n', - '\\setlength{\\floatsep}{0.5em}\n', - '\\setlength{\\textfloatsep}{\\fill}\n', - '\\addtolength{\\textfloatsep}{3em}\n', - '\\renewcommand{\\textfraction}{0.5}\n', - '\\renewcommand{\\topfraction}{0.5}\n', - '\\renewcommand{\\bottomfraction}{0.5}\n', - '\\setcounter{totalnumber}{50}\n', - '\\setcounter{topnumber}{50}\n', - '\\setcounter{bottomnumber}{50}\n', - '% end floats for footnotes\n', - ], - 'some_commands' : [ - '% some commands, that could be overwritten in the style file.\n' - '\\newcommand{\\rubric}[1]' - '{\\subsection*{~\\hfill {\\it #1} \\hfill ~}}\n' - '% end of "some commands"\n', - ] - } - - -class LaTeXTranslator(nodes.NodeVisitor): - # When options are given to the documentclass, latex will pass them - # to other packages, as done with babel. - # Dummy settings might be taken from document settings - - d_options = '10pt' # papersize, fontsize - d_paper = 'a4paper' - d_margins = '2cm' - - latex_head = '\\documentclass[%s]{%s}\n' - encoding = '\\usepackage[%s]{inputenc}\n' - linking = '\\usepackage[colorlinks=%s,linkcolor=%s,urlcolor=%s]{hyperref}\n' - geometry = '\\usepackage[%s,margin=%s,nohead]{geometry}\n' - stylesheet = '\\input{%s}\n' - # add a generated on day , machine by user using docutils version. - generator = '%% generator Docutils: http://docutils.sourceforge.net/\n' - - # use latex tableofcontents or let docutils do it. - use_latex_toc = 0 - # table kind: if 0 tabularx (single page), 1 longtable - # maybe should be decided on row count. - use_longtable = 1 - # TODO: use mixins for different implementations. - # list environment for option-list. else tabularx - use_optionlist_for_option_list = 1 - # list environment for docinfo. else tabularx - use_optionlist_for_docinfo = 0 # NOT YET IN USE - - # default link color - hyperlink_color = "blue" - - def __init__(self, document): - nodes.NodeVisitor.__init__(self, document) - self.settings = settings = document.settings - self.use_latex_toc = settings.use_latex_toc - self.hyperlink_color = settings.hyperlink_color - if self.hyperlink_color == '0': - self.hyperlink_color = 'black' - self.colorlinks = 'false' - else: - self.colorlinks = 'true' - - # language: labels, bibliographic_fields, and author_separators. - # to allow writing labes for specific languages. - self.language = languages.get_language(settings.language_code) - self.babel = Babel(settings.language_code) - self.author_separator = self.language.author_separators[0] - if self.babel.get_language(): - self.d_options += ',%s' % \ - self.babel.get_language() - self.head_prefix = [ - self.latex_head % (self.d_options,self.settings.documentclass), - '\\usepackage{babel}\n', # language is in documents settings. - '\\usepackage{shortvrb}\n', # allows verb in footnotes. - self.encoding % self.to_latex_encoding(settings.output_encoding), - # * tabularx: for docinfo, automatic width of columns, always on one page. - '\\usepackage{tabularx}\n', - '\\usepackage{longtable}\n', - # possible other packages. - # * fancyhdr - # * ltxtable is a combination of tabularx and longtable (pagebreaks). - # but ?? - # - # extra space between text in tables and the line above them - '\\setlength{\\extrarowheight}{2pt}\n', - '\\usepackage{amsmath}\n', # what fore amsmath. - '\\usepackage{graphicx}\n', - '\\usepackage{color}\n', - '\\usepackage{multirow}\n', - self.linking % (self.colorlinks, self.hyperlink_color, self.hyperlink_color), - # geometry and fonts might go into style.tex. - self.geometry % (self.d_paper, self.d_margins), - # - self.generator, - # latex lengths - '\\newlength{\\admonitionwidth}\n', - '\\setlength{\\admonitionwidth}{0.9\\textwidth}\n' - # width for docinfo tablewidth - '\\newlength{\\docinfowidth}\n', - '\\setlength{\\docinfowidth}{0.9\\textwidth}\n' - ] - self.head_prefix.extend( latex_headings['optionlist_environment'] ) - self.head_prefix.extend( latex_headings['footnote_floats'] ) - self.head_prefix.extend( latex_headings['some_commands'] ) - ## stylesheet is last: so it might be possible to overwrite defaults. - stylesheet = self.get_stylesheet_reference() - if stylesheet: - self.head_prefix.append(self.stylesheet % (stylesheet)) - - if self.linking: # and maybe check for pdf - self.pdfinfo = [ ] - self.pdfauthor = None - # pdftitle, pdfsubject, pdfauthor, pdfkeywords, pdfcreator, pdfproducer - else: - self.pdfinfo = None - # NOTE: Latex wants a date and an author, rst puts this into - # docinfo, so normally we donot want latex author/date handling. - # latex article has its own handling of date and author, deactivate. - self.latex_docinfo = 0 - self.head = [ ] - if not self.latex_docinfo: - self.head.extend( [ '\\author{}\n', '\\date{}\n' ] ) - self.body_prefix = ['\\raggedbottom\n'] - # separate title, so we can appen subtitle. - self.title = "" - self.body = [] - self.body_suffix = ['\n'] - self.section_level = 0 - self.context = [] - self.topic_class = '' - # column specification for tables - self.colspecs = [] - # Flags to encode - # --------------- - # verbatim: to tell encode not to encode. - self.verbatim = 0 - # insert_newline: to tell encode to replace blanks by "~". - self.insert_none_breaking_blanks = 0 - # insert_newline: to tell encode to add latex newline. - self.insert_newline = 0 - # mbox_newline: to tell encode to add mbox and newline. - self.mbox_newline = 0 - - # enumeration is done by list environment. - self._enum_cnt = 0 - # docinfo. - self.docinfo = None - # inside literal block: no quote mangling. - self.literal_block = 0 - self.literal = 0 - - def get_stylesheet_reference(self): - if self.settings.stylesheet_path: - return self.settings.stylesheet_path - else: - return self.settings.stylesheet - - def to_latex_encoding(self,docutils_encoding): - """ - Translate docutils encoding name into latex's. - - Default fallback method is remove "-" and "_" chars from docutils_encoding. - - """ - tr = { "iso-8859-1": "latin1", # west european - "iso-8859-2": "latin2", # east european - "iso-8859-3": "latin3", # esperanto, maltese - "iso-8859-4": "latin4", # north european,scandinavian, baltic - "iso-8859-5": "iso88595", # cyrillic (ISO) - "iso-8859-9": "latin5", # turkish - "iso-8859-15": "latin9", # latin9, update to latin1. - "mac_cyrillic": "maccyr", # cyrillic (on Mac) - "windows-1251": "cp1251", # cyrillic (on Windows) - "koi8-r": "koi8-r", # cyrillic (Russian) - "koi8-u": "koi8-u", # cyrillic (Ukrainian) - "windows-1250": "cp1250", # - "windows-1252": "cp1252", # - "us-ascii": "ascii", # ASCII (US) - # unmatched encodings - #"": "applemac", - #"": "ansinew", # windows 3.1 ansi - #"": "ascii", # ASCII encoding for the range 32--127. - #"": "cp437", # dos latine us - #"": "cp850", # dos latin 1 - #"": "cp852", # dos latin 2 - #"": "decmulti", - #"": "latin10", - #"iso-8859-6": "" # arabic - #"iso-8859-7": "" # greek - #"iso-8859-8": "" # hebrew - #"iso-8859-10": "" # latin6, more complete iso-8859-4 - } - if tr.has_key(docutils_encoding.lower()): - return tr[docutils_encoding.lower()] - return docutils_encoding.translate(string.maketrans("",""),"_-").lower() - - def language_label(self, docutil_label): - return self.language.labels[docutil_label] - - def encode(self, text): - """ - Encode special characters in `text` & return. - # $ % & ~ _ ^ \ { } - Escaping with a backslash does not help with backslashes, ~ and ^. - - < > are only available in math-mode (really ?) - $ starts math- mode. - AND quotes: - - """ - if self.verbatim: - return text - # compile the regexps once. do it here so one can see them. - # - # first the braces. - if not self.__dict__.has_key('encode_re_braces'): - self.encode_re_braces = re.compile(r'([{}])') - text = self.encode_re_braces.sub(r'{\\\1}',text) - if not self.__dict__.has_key('encode_re_bslash'): - # find backslash: except in the form '{\{}' or '{\}}'. - self.encode_re_bslash = re.compile(r'(?", '{$>$}') - # then - text = text.replace("&", '{\\&}') - text = text.replace("_", '{\\_}') - # the ^: - # * verb|^| does not work in mbox. - # * mathmode has wedge. hat{~} would also work. - text = text.replace("^", '{\\ensuremath{^\\wedge}}') - text = text.replace("%", '{\\%}') - text = text.replace("#", '{\\#}') - text = text.replace("~", '{\\~{ }}') - if self.literal_block or self.literal: - # pdflatex does not produce doublequotes for ngerman. - text = self.babel.double_quotes_in_tt(text) - else: - text = self.babel.quote_quotes(text) - if self.insert_newline: - # HACK: insert a blank before the newline, to avoid - # ! LaTeX Error: There's no line here to end. - text = text.replace("\n", '~\\\\\n') - elif self.mbox_newline: - text = text.replace("\n", '}\\\\\n\\mbox{') - if self.insert_none_breaking_blanks: - text = text.replace(' ', '~') - # unicode !!! - text = text.replace(u'\u2020', '{$\\dagger$}') - return text - - def attval(self, text, - whitespace=re.compile('[\n\r\t\v\f]')): - """Cleanse, encode, and return attribute value text.""" - return self.encode(whitespace.sub(' ', text)) - - def astext(self): - if self.pdfinfo: - if self.pdfauthor: - self.pdfinfo.append('pdfauthor={%s}' % self.pdfauthor) - pdfinfo = '\\hypersetup{\n' + ',\n'.join(self.pdfinfo) + '\n}\n' - else: - pdfinfo = '' - title = '\\title{%s}\n' % self.title - return ''.join(self.head_prefix + [title] - + self.head + [pdfinfo] - + self.body_prefix + self.body + self.body_suffix) - - def visit_Text(self, node): - self.body.append(self.encode(node.astext())) - - def depart_Text(self, node): - pass - - def visit_address(self, node): - self.visit_docinfo_item(node, 'address') - - def depart_address(self, node): - self.depart_docinfo_item(node) - - def visit_admonition(self, node, name): - self.body.append('\\begin{center}\\begin{sffamily}\n') - self.body.append('\\fbox{\\parbox{\\admonitionwidth}{\n') - self.body.append('\\textbf{\\large '+ self.language.labels[name] + '}\n'); - self.body.append('\\vspace{2mm}\n') - - - def depart_admonition(self): - self.body.append('}}\n') # end parbox fbox - self.body.append('\\end{sffamily}\n\\end{center}\n'); - - def visit_attention(self, node): - self.visit_admonition(node, 'attention') - - def depart_attention(self, node): - self.depart_admonition() - - def visit_author(self, node): - self.visit_docinfo_item(node, 'author') - - def depart_author(self, node): - self.depart_docinfo_item(node) - - def visit_authors(self, node): - # ignore. visit_author is called for each one - # self.visit_docinfo_item(node, 'author') - pass - - def depart_authors(self, node): - # self.depart_docinfo_item(node) - pass - - def visit_block_quote(self, node): - self.body.append( '\\begin{quote}\n') - - def depart_block_quote(self, node): - self.body.append( '\\end{quote}\n') - - def visit_bullet_list(self, node): - if not self.use_latex_toc and self.topic_class == 'contents': - self.body.append( '\\begin{list}{}{}\n' ) - else: - self.body.append( '\\begin{itemize}\n' ) - - def depart_bullet_list(self, node): - if not self.use_latex_toc and self.topic_class == 'contents': - self.body.append( '\\end{list}\n' ) - else: - self.body.append( '\\end{itemize}\n' ) - - def visit_caption(self, node): - self.body.append( '\\caption{' ) - - def depart_caption(self, node): - self.body.append('}') - - def visit_caution(self, node): - self.visit_admonition(node, 'caution') - - def depart_caution(self, node): - self.depart_admonition() - - def visit_citation(self, node): - self.visit_footnote(node) - - def depart_citation(self, node): - self.depart_footnote(node) - - def visit_title_reference(self, node): - # BUG title-references are what? - pass - - def depart_title_reference(self, node): - pass - - def visit_citation_reference(self, node): - href = '' - if node.has_key('refid'): - href = node['refid'] - elif node.has_key('refname'): - href = self.document.nameids[node['refname']] - self.body.append('[\\hyperlink{%s}{' % href) - - def depart_citation_reference(self, node): - self.body.append('}]') - - def visit_classifier(self, node): - self.body.append( '(\\textbf{' ) - - def depart_classifier(self, node): - self.body.append( '})\n' ) - - def visit_colspec(self, node): - if self.use_longtable: - self.colspecs.append(node) - else: - self.context[-1] += 1 - - def depart_colspec(self, node): - pass - - def visit_comment(self, node, - sub=re.compile('\n').sub): - """Escape end of line by a ne comment start in comment text.""" - self.body.append('%% %s \n' % sub('\n% ', node.astext())) - raise nodes.SkipNode - - def visit_contact(self, node): - self.visit_docinfo_item(node, 'contact') - - def depart_contact(self, node): - self.depart_docinfo_item(node) - - def visit_copyright(self, node): - self.visit_docinfo_item(node, 'copyright') - - def depart_copyright(self, node): - self.depart_docinfo_item(node) - - def visit_danger(self, node): - self.visit_admonition(node, 'danger') - - def depart_danger(self, node): - self.depart_admonition() - - def visit_date(self, node): - self.visit_docinfo_item(node, 'date') - - def depart_date(self, node): - self.depart_docinfo_item(node) - - def visit_decoration(self, node): - pass - - def depart_decoration(self, node): - pass - - def visit_definition(self, node): - self.body.append('%[visit_definition]\n') - - def depart_definition(self, node): - self.body.append('\n') - self.body.append('%[depart_definition]\n') - - def visit_definition_list(self, node): - self.body.append( '\\begin{description}\n' ) - - def depart_definition_list(self, node): - self.body.append( '\\end{description}\n' ) - - def visit_definition_list_item(self, node): - self.body.append('%[visit_definition_list_item]\n') - - def depart_definition_list_item(self, node): - self.body.append('%[depart_definition_list_item]\n') - - def visit_description(self, node): - if self.use_optionlist_for_option_list: - self.body.append( ' ' ) - else: - self.body.append( ' & ' ) - - def depart_description(self, node): - pass - - def visit_docinfo(self, node): - self.docinfo = [] - self.docinfo.append('%' + '_'*75 + '\n') - self.docinfo.append('\\begin{center}\n') - self.docinfo.append('\\begin{tabularx}{\\docinfowidth}{lX}\n') - - def depart_docinfo(self, node): - self.docinfo.append('\\end{tabularx}\n') - self.docinfo.append('\\end{center}\n') - self.body = self.docinfo + self.body - # clear docinfo, so field names are no longer appended. - self.docinfo = None - if self.use_latex_toc: - self.body.append('\\tableofcontents\n\n\\bigskip\n') - - def visit_docinfo_item(self, node, name): - if not self.latex_docinfo: - self.docinfo.append('\\textbf{%s}: &\n\t' % self.language_label(name)) - if name == 'author': - if not self.pdfinfo == None: - if not self.pdfauthor: - self.pdfauthor = self.attval(node.astext()) - else: - self.pdfauthor += self.author_separator + self.attval(node.astext()) - if self.latex_docinfo: - self.head.append('\\author{%s}\n' % self.attval(node.astext())) - raise nodes.SkipNode - elif name == 'date': - if self.latex_docinfo: - self.head.append('\\date{%s}\n' % self.attval(node.astext())) - raise nodes.SkipNode - if name == 'address': - # BUG will fail if latex_docinfo is set. - self.insert_newline = 1 - self.docinfo.append('{\\raggedright\n') - self.context.append(' } \\\\\n') - else: - self.context.append(' \\\\\n') - self.context.append(self.docinfo) - self.context.append(len(self.body)) - - def depart_docinfo_item(self, node): - size = self.context.pop() - dest = self.context.pop() - tail = self.context.pop() - tail = self.body[size:] + [tail] - del self.body[size:] - dest.extend(tail) - # for address we did set insert_newline - self.insert_newline = 0 - - def visit_doctest_block(self, node): - self.body.append( '\\begin{verbatim}' ) - self.verbatim = 1 - - def depart_doctest_block(self, node): - self.body.append( '\\end{verbatim}\n' ) - self.verbatim = 0 - - def visit_document(self, node): - self.body_prefix.append('\\begin{document}\n') - self.body_prefix.append('\\maketitle\n\n') - # alternative use titlepage environment. - # \begin{titlepage} - - def depart_document(self, node): - self.body_suffix.append('\\end{document}\n') - - def visit_emphasis(self, node): - self.body.append('\\emph{') - - def depart_emphasis(self, node): - self.body.append('}') - - def visit_entry(self, node): - # cell separation - column_one = 1 - if self.context[-1] > 0: - column_one = 0 - if not column_one: - self.body.append(' & ') - - # multi{row,column} - if node.has_key('morerows') and node.has_key('morecols'): - raise NotImplementedError('LaTeX can\'t handle cells that' - 'span multiple rows *and* columns, sorry.') - atts = {} - if node.has_key('morerows'): - count = node['morerows'] + 1 - self.body.append('\\multirow{%d}*{' % count) - self.context.append('}') - elif node.has_key('morecols'): - # the vertical bar before column is missing if it is the first column. - # the one after always. - if column_one: - bar = '|' - else: - bar = '' - count = node['morecols'] + 1 - self.body.append('\\multicolumn{%d}{%sl|}{' % (count, bar)) - self.context.append('}') - else: - self.context.append('') - - # header / not header - if isinstance(node.parent.parent, nodes.thead): - self.body.append('\\textbf{') - self.context.append('}') - else: - self.context.append('') - - def depart_entry(self, node): - self.body.append(self.context.pop()) # header / not header - self.body.append(self.context.pop()) # multirow/column - self.context[-1] += 1 - - def visit_enumerated_list(self, node): - # We create our own enumeration list environment. - # This allows to set the style and starting value - # and unlimited nesting. - self._enum_cnt += 1 - - enum_style = {'arabic':'arabic', - 'loweralpha':'alph', - 'upperalpha':'Alph', - 'lowerroman':'roman', - 'upperroman':'Roman' } - enum_suffix = "" - if node.has_key('suffix'): - enum_suffix = node['suffix'] - enum_prefix = "" - if node.has_key('prefix'): - enum_prefix = node['prefix'] - - enum_type = "arabic" - if node.has_key('enumtype'): - enum_type = node['enumtype'] - if enum_style.has_key(enum_type): - enum_type = enum_style[enum_type] - counter_name = "listcnt%d" % self._enum_cnt; - self.body.append('\\newcounter{%s}\n' % counter_name) - self.body.append('\\begin{list}{%s\\%s{%s}%s}\n' % \ - (enum_prefix,enum_type,counter_name,enum_suffix)) - self.body.append('{\n') - self.body.append('\\usecounter{%s}\n' % counter_name) - # set start after usecounter, because it initializes to zero. - if node.has_key('start'): - self.body.append('\\addtocounter{%s}{%d}\n' \ - % (counter_name,node['start']-1)) - ## set rightmargin equal to leftmargin - self.body.append('\\setlength{\\rightmargin}{\\leftmargin}\n') - self.body.append('}\n') - - def depart_enumerated_list(self, node): - self.body.append('\\end{list}\n') - - def visit_error(self, node): - self.visit_admonition(node, 'error') - - def depart_error(self, node): - self.depart_admonition() - - def visit_field(self, node): - # real output is done in siblings: _argument, _body, _name - pass - - def depart_field(self, node): - self.body.append('\n') - ##self.body.append('%[depart_field]\n') - - def visit_field_argument(self, node): - self.body.append('%[visit_field_argument]\n') - - def depart_field_argument(self, node): - self.body.append('%[depart_field_argument]\n') - - def visit_field_body(self, node): - # BUG by attach as text we loose references. - if self.docinfo: - self.docinfo.append('%s \\\\\n' % node.astext()) - raise nodes.SkipNode - # BUG: what happens if not docinfo - - def depart_field_body(self, node): - self.body.append( '\n' ) - - def visit_field_list(self, node): - if not self.docinfo: - self.body.append('\\begin{quote}\n') - self.body.append('\\begin{description}\n') - - def depart_field_list(self, node): - if not self.docinfo: - self.body.append('\\end{description}\n') - self.body.append('\\end{quote}\n') - - def visit_field_name(self, node): - # BUG this duplicates docinfo_item - if self.docinfo: - self.docinfo.append('\\textbf{%s}: &\n\t' % node.astext()) - raise nodes.SkipNode - else: - self.body.append('\\item [') - - def depart_field_name(self, node): - if not self.docinfo: - self.body.append(':]') - - def visit_figure(self, node): - self.body.append( '\\begin{figure}\n' ) - - def depart_figure(self, node): - self.body.append( '\\end{figure}\n' ) - - def visit_footer(self, node): - self.context.append(len(self.body)) - - def depart_footer(self, node): - start = self.context.pop() - footer = (['\n\\begin{center}\small\n'] - + self.body[start:] + ['\n\\end{center}\n']) - self.body_suffix[:0] = footer - del self.body[start:] - - def visit_footnote(self, node): - notename = node['id'] - self.body.append('\\begin{figure}[b]') - self.body.append('\\hypertarget{%s}' % notename) - - def depart_footnote(self, node): - self.body.append('\\end{figure}\n') - - def visit_footnote_reference(self, node): - href = '' - if node.has_key('refid'): - href = node['refid'] - elif node.has_key('refname'): - href = self.document.nameids[node['refname']] - format = self.settings.footnote_references - if format == 'brackets': - suffix = '[' - self.context.append(']') - elif format == 'superscript': - suffix = '\\raisebox{.5em}[0em]{\\scriptsize' - self.context.append('}') - else: # shouldn't happen - raise AssertionError('Illegal footnote reference format.') - self.body.append('%s\\hyperlink{%s}{' % (suffix,href)) - - def depart_footnote_reference(self, node): - self.body.append('}%s' % self.context.pop()) - - def visit_generated(self, node): - pass - - def depart_generated(self, node): - pass - - def visit_header(self, node): - self.context.append(len(self.body)) - - def depart_header(self, node): - start = self.context.pop() - self.body_prefix.append('\n\\verb|begin_header|\n') - self.body_prefix.extend(self.body[start:]) - self.body_prefix.append('\n\\verb|end_header|\n') - del self.body[start:] - - def visit_hint(self, node): - self.visit_admonition(node, 'hint') - - def depart_hint(self, node): - self.depart_admonition() - - def visit_image(self, node): - atts = node.attributes.copy() - href = atts['uri'] - ##self.body.append('\\begin{center}\n') - self.body.append('\n\\includegraphics{%s}\n' % href) - ##self.body.append('\\end{center}\n') - - def depart_image(self, node): - pass - - def visit_important(self, node): - self.visit_admonition(node, 'important') - - def depart_important(self, node): - self.depart_admonition() - - def visit_interpreted(self, node): - # @@@ Incomplete, pending a proper implementation on the - # Parser/Reader end. - self.visit_literal(node) - - def depart_interpreted(self, node): - self.depart_literal(node) - - def visit_label(self, node): - # footnote/citation label - self.body.append('[') - - def depart_label(self, node): - self.body.append(']') - - def visit_legend(self, node): - self.body.append('{\\small ') - - def depart_legend(self, node): - self.body.append('}') - - def visit_line_block(self, node): - """line-block: - * whitespace (including linebreaks) is significant - * inline markup is supported. - * serif typeface - """ - self.body.append('\\begin{flushleft}\n') - self.insert_none_breaking_blanks = 1 - self.line_block_without_mbox = 1 - if self.line_block_without_mbox: - self.insert_newline = 1 - else: - self.mbox_newline = 1 - self.body.append('\\mbox{') - - def depart_line_block(self, node): - if self.line_block_without_mbox: - self.insert_newline = 0 - else: - self.body.append('}') - self.mbox_newline = 0 - self.insert_none_breaking_blanks = 0 - self.body.append('\n\\end{flushleft}\n') - - def visit_list_item(self, node): - self.body.append('\\item ') - - def depart_list_item(self, node): - self.body.append('\n') - - def visit_literal(self, node): - self.literal = 1 - self.body.append('\\texttt{') - - def depart_literal(self, node): - self.body.append('}') - self.literal = 0 - - def visit_literal_block(self, node): - """ - .. parsed-literal:: - """ - # typically in a typewriter/monospaced typeface. - # care must be taken with the text, because inline markup is recognized. - # - # possibilities: - # * verbatim: is no possibility, as inline markup does not work. - # * obey..: is from julien and never worked for me (grubert). - self.use_for_literal_block = "mbox" - self.literal_block = 1 - if (self.use_for_literal_block == "mbox"): - self.mbox_newline = 1 - self.insert_none_breaking_blanks = 1 - self.body.append('\\begin{ttfamily}\\begin{flushleft}\n\\mbox{') - else: - self.body.append('{\\obeylines\\obeyspaces\\ttfamily\n') - - def depart_literal_block(self, node): - if (self.use_for_literal_block == "mbox"): - self.body.append('}\n\\end{flushleft}\\end{ttfamily}\n') - self.insert_none_breaking_blanks = 0 - self.mbox_newline = 0 - else: - self.body.append('}\n') - self.literal_block = 0 - - def visit_meta(self, node): - self.body.append('[visit_meta]\n') - # BUG maybe set keywords for pdf - ##self.head.append(self.starttag(node, 'meta', **node.attributes)) - - def depart_meta(self, node): - self.body.append('[depart_meta]\n') - - def visit_note(self, node): - self.visit_admonition(node, 'note') - - def depart_note(self, node): - self.depart_admonition() - - def visit_option(self, node): - if self.context[-1]: - # this is not the first option - self.body.append(', ') - - def depart_option(self, node): - # flag tha the first option is done. - self.context[-1] += 1 - - def visit_option_argument(self, node): - """The delimiter betweeen an option and its argument.""" - self.body.append(node.get('delimiter', ' ')) - - def depart_option_argument(self, node): - pass - - def visit_option_group(self, node): - if self.use_optionlist_for_option_list: - self.body.append('\\item [') - else: - atts = {} - if len(node.astext()) > 14: - self.body.append('\\multicolumn{2}{l}{') - self.context.append('} \\\\\n ') - else: - self.context.append('') - self.body.append('\\texttt{') - # flag for first option - self.context.append(0) - - def depart_option_group(self, node): - self.context.pop() # the flag - if self.use_optionlist_for_option_list: - self.body.append('] ') - else: - self.body.append('}') - self.body.append(self.context.pop()) - - def visit_option_list(self, node): - self.body.append('% [option list]\n') - if self.use_optionlist_for_option_list: - self.body.append('\\begin{optionlist}{3cm}\n') - else: - self.body.append('\\begin{center}\n') - # BUG: use admwidth or make it relative to textwidth ? - self.body.append('\\begin{tabularx}{.9\\linewidth}{lX}\n') - - def depart_option_list(self, node): - if self.use_optionlist_for_option_list: - self.body.append('\\end{optionlist}\n') - else: - self.body.append('\\end{tabularx}\n') - self.body.append('\\end{center}\n') - - def visit_option_list_item(self, node): - pass - - def depart_option_list_item(self, node): - if not self.use_optionlist_for_option_list: - self.body.append('\\\\\n') - - def visit_option_string(self, node): - ##self.body.append(self.starttag(node, 'span', '', CLASS='option')) - pass - - def depart_option_string(self, node): - ##self.body.append('') - pass - - def visit_organization(self, node): - self.visit_docinfo_item(node, 'organization') - - def depart_organization(self, node): - self.depart_docinfo_item(node) - - def visit_paragraph(self, node): - if not self.topic_class == 'contents': - self.body.append('\n') - - def depart_paragraph(self, node): - if self.topic_class == 'contents': - self.body.append('\n') - else: - self.body.append('\n') - - def visit_problematic(self, node): - self.body.append('{\\color{red}\\bfseries{}') - - def depart_problematic(self, node): - self.body.append('}') - - def visit_raw(self, node): - if node.has_key('format') and node['format'].lower() == 'latex': - self.body.append(node.astext()) - raise nodes.SkipNode - - def visit_reference(self, node): - # for pdflatex hyperrefs might be supported - if node.has_key('refuri'): - href = node['refuri'] - elif node.has_key('refid'): - href = '#' + node['refid'] - elif node.has_key('refname'): - href = '#' + self.document.nameids[node['refname']] - ##self.body.append('[visit_reference]') - self.body.append('\\href{%s}{' % href) - - def depart_reference(self, node): - self.body.append('}') - ##self.body.append('[depart_reference]') - - def visit_revision(self, node): - self.visit_docinfo_item(node, 'revision') - - def depart_revision(self, node): - self.depart_docinfo_item(node) - - def visit_row(self, node): - self.context.append(0) - - def depart_row(self, node): - self.context.pop() # remove cell counter - self.body.append(' \\\\ \\hline\n') - - def visit_section(self, node): - self.section_level += 1 - - def depart_section(self, node): - self.section_level -= 1 - - def visit_sidebar(self, node): - # BUG: this is just a hack to make sidebars render something - self.body.append('\\begin{center}\\begin{sffamily}\n') - self.body.append('\\fbox{\\colorbox[gray]{0.80}{\\parbox{\\admonitionwidth}{\n') - - def depart_sidebar(self, node): - self.body.append('}}}\n') # end parbox colorbox fbox - self.body.append('\\end{sffamily}\n\\end{center}\n'); - - - attribution_formats = {'dash': ('---', ''), - 'parentheses': ('(', ')'), - 'parens': ('(', ')'), - 'none': ('', '')} - - def visit_attribution(self, node): - prefix, suffix = self.attribution_formats[self.settings.attribution] - self.body.append('\n\\begin{flushright}\n') - self.body.append(prefix) - self.context.append(suffix) - - def depart_attribution(self, node): - self.body.append(self.context.pop() + '\n') - self.body.append('\\end{flushright}\n') - - def visit_status(self, node): - self.visit_docinfo_item(node, 'status') - - def depart_status(self, node): - self.depart_docinfo_item(node) - - def visit_strong(self, node): - self.body.append('\\textbf{') - - def depart_strong(self, node): - self.body.append('}') - - def visit_substitution_definition(self, node): - raise nodes.SkipNode - - def visit_substitution_reference(self, node): - self.unimplemented_visit(node) - - def visit_subtitle(self, node): - if isinstance(node.parent, nodes.sidebar): - self.body.append('~\\\\\n\\textbf{') - self.context.append('}\n\\smallskip\n') - else: - self.title = self.title + \ - '\\\\\n\\large{%s}\n' % self.encode(node.astext()) - raise nodes.SkipNode - - def depart_subtitle(self, node): - if isinstance(node.parent, nodes.sidebar): - self.body.append(self.context.pop()) - - def visit_system_message(self, node): - if node['level'] < self.document.reporter['writer'].report_level: - raise nodes.SkipNode - - - def depart_system_message(self, node): - self.body.append('\n') - - def get_colspecs(self): - """ - Return column specification for longtable. - - Assumes reST line length being 80 characters. - """ - width = 80 - - total_width = 0.0 - # first see if we get too wide. - for node in self.colspecs: - colwidth = float(node['colwidth']) / width - total_width += colwidth - # donot make it full linewidth - factor = 0.93 - if total_width > 1.0: - factor /= total_width - - latex_table_spec = "" - for node in self.colspecs: - colwidth = factor * float(node['colwidth']) / width - latex_table_spec += "|p{%.2f\\linewidth}" % colwidth - self.colspecs = [] - return latex_table_spec+"|" - - def visit_table(self, node): - if self.use_longtable: - self.body.append('\n\\begin{longtable}[c]') - else: - self.body.append('\n\\begin{tabularx}{\\linewidth}') - self.context.append('table_sentinel') # sentinel - self.context.append(0) # column counter - - def depart_table(self, node): - if self.use_longtable: - self.body.append('\\end{longtable}\n') - else: - self.body.append('\\end{tabularx}\n') - sentinel = self.context.pop() - if sentinel != 'table_sentinel': - print 'context:', self.context + [sentinel] - raise AssertionError - - def table_preamble(self): - if self.use_longtable: - self.body.append('{%s}\n' % self.get_colspecs()) - else: - if self.context[-1] != 'table_sentinel': - self.body.append('{%s}' % ('|X' * self.context.pop() + '|')) - self.body.append('\n\\hline') - - def visit_target(self, node): - if not (node.has_key('refuri') or node.has_key('refid') - or node.has_key('refname')): - self.body.append('\\hypertarget{%s}{' % node['name']) - self.context.append('}') - else: - self.context.append('') - - def depart_target(self, node): - self.body.append(self.context.pop()) - - def visit_tbody(self, node): - # BUG write preamble if not yet done (colspecs not []) - # for tables without heads. - if self.colspecs: - self.visit_thead(None) - self.depart_thead(None) - self.body.append('%[visit_tbody]\n') - - def depart_tbody(self, node): - self.body.append('%[depart_tbody]\n') - - def visit_term(self, node): - self.body.append('\\item[') - - def depart_term(self, node): - # definition list term. - self.body.append(':]\n') - - def visit_tgroup(self, node): - #self.body.append(self.starttag(node, 'colgroup')) - #self.context.append('\n') - pass - - def depart_tgroup(self, node): - pass - - def visit_thead(self, node): - # number_of_columns will be zero after get_colspecs. - # BUG ! push onto context for depart to pop it. - number_of_columns = len(self.colspecs) - self.table_preamble() - #BUG longtable needs firstpage and lastfooter too. - self.body.append('\\hline\n') - - def depart_thead(self, node): - if self.use_longtable: - # the table header written should be on every page - # => \endhead - self.body.append('\\endhead\n') - # and the firsthead => \endfirsthead - # BUG i want a "continued from previous page" on every not - # firsthead, but then we need the header twice. - # - # there is a \endfoot and \endlastfoot too. - # but we need the number of columns to - # self.body.append('\\multicolumn{%d}{c}{"..."}\n' % number_of_columns) - # self.body.append('\\hline\n\\endfoot\n') - # self.body.append('\\hline\n') - # self.body.append('\\endlastfoot\n') - - - def visit_tip(self, node): - self.visit_admonition(node, 'tip') - - def depart_tip(self, node): - self.depart_admonition() - - def visit_title(self, node): - """Only 3 section levels are supported by LaTeX article (AFAIR).""" - if isinstance(node.parent, nodes.topic): - # section titles before the table of contents. - if node.parent.hasattr('id'): - self.body.append('\\hypertarget{%s}{}' % node.parent['id']) - # BUG: latex chokes on center environment with "perhaps a missing item". - # so we use hfill. - self.body.append('\\subsection*{~\\hfill ') - # the closing brace for subsection. - self.context.append('\\hfill ~}\n') - elif isinstance(node.parent, nodes.sidebar): - self.body.append('\\textbf{\\large ') - self.context.append('}\n\\smallskip\n') - elif self.section_level == 0: - # document title - self.title = self.encode(node.astext()) - if not self.pdfinfo == None: - self.pdfinfo.append( 'pdftitle={%s}' % self.encode(node.astext()) ) - raise nodes.SkipNode - else: - self.body.append('\n\n') - self.body.append('%' + '_' * 75) - self.body.append('\n\n') - if node.parent.hasattr('id'): - self.body.append('\\hypertarget{%s}{}\n' % node.parent['id']) - # section_level 0 is title and handled above. - # BUG: latex has no deeper sections (actually paragrah is no section either). - if self.use_latex_toc: - section_star = "" - else: - section_star = "*" - if (self.section_level<=3): # 1,2,3 - self.body.append('\\%ssection%s{' % ('sub'*(self.section_level-1),section_star)) - elif (self.section_level==4): - #self.body.append('\\paragraph*{') - self.body.append('\\subsubsection%s{' % (section_star)) - else: - #self.body.append('\\subparagraph*{') - self.body.append('\\subsubsection%s{' % (section_star)) - # BUG: self.body.append( '\\label{%s}\n' % name) - self.context.append('}\n') - - def depart_title(self, node): - self.body.append(self.context.pop()) - if isinstance(node.parent, nodes.sidebar): - return - # BUG level depends on style. - elif node.parent.hasattr('id') and not self.use_latex_toc: - # pdflatex allows level 0 to 3 - # ToC would be the only on level 0 so i choose to decrement the rest. - # "Table of contents" bookmark to see the ToC. To avoid this - # we set all zeroes to one. - l = self.section_level - if l>0: - l = l-1 - self.body.append('\\pdfbookmark[%d]{%s}{%s}\n' % \ - (l,node.astext(),node.parent['id'])) - - def visit_topic(self, node): - self.topic_class = node.get('class') - if self.use_latex_toc: - self.topic_class = '' - raise nodes.SkipNode - - def depart_topic(self, node): - self.topic_class = '' - self.body.append('\n') - - def visit_rubric(self, node): -# self.body.append('\\hfill {\\color{red}\\bfseries{}') -# self.context.append('} \\hfill ~\n') - self.body.append('\\rubric{') - self.context.append('}\n') - - def depart_rubric(self, node): - self.body.append(self.context.pop()) - - def visit_transition(self, node): - self.body.append('\n\n') - self.body.append('%' + '_' * 75) - self.body.append('\n\\hspace*{\\fill}\\hrulefill\\hspace*{\\fill}') - self.body.append('\n\n') - - def depart_transition(self, node): - #self.body.append('[depart_transition]') - pass - - def visit_version(self, node): - self.visit_docinfo_item(node, 'version') - - def depart_version(self, node): - self.depart_docinfo_item(node) - - def visit_warning(self, node): - self.visit_admonition(node, 'warning') - - def depart_warning(self, node): - self.depart_admonition() - - def unimplemented_visit(self, node): - raise NotImplementedError('visiting unimplemented node type: %s' - % node.__class__.__name__) - -# def unknown_visit(self, node): -# def default_visit(self, node): - -# vim: set ts=4 et ai : diff --git a/docutils/docutils/writers/pep_html.py b/docutils/docutils/writers/pep_html.py deleted file mode 100644 index 85c065c3d..000000000 --- a/docutils/docutils/writers/pep_html.py +++ /dev/null @@ -1,113 +0,0 @@ -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -PEP HTML Writer. -""" - -__docformat__ = 'reStructuredText' - - -import sys -import docutils -from docutils import nodes, frontend, utils -from docutils.writers import html4css1 - - -class Writer(html4css1.Writer): - - settings_spec = html4css1.Writer.settings_spec + ( - 'PEP/HTML-Specific Options', - 'The HTML --footnote-references option is set to "brackets" by ' - 'default.', - (('Specify a PEP stylesheet URL, used verbatim. Default is ' - '--stylesheet\'s value. If given, --pep-stylesheet overrides ' - '--stylesheet.', - ['--pep-stylesheet'], - {'metavar': ''}), - ('Specify a PEP stylesheet file, relative to the current working ' - 'directory. The path is adjusted relative to the output HTML ' - 'file. Overrides --pep-stylesheet and --stylesheet-path.', - ['--pep-stylesheet-path'], - {'metavar': ''}), - ('Specify a template file. Default is "pep-html-template".', - ['--pep-template'], - {'default': 'pep-html-template', 'metavar': ''}), - ('Python\'s home URL. Default is ".." (parent directory).', - ['--python-home'], - {'default': '..', 'metavar': ''}), - ('Home URL prefix for PEPs. Default is "." (current directory).', - ['--pep-home'], - {'default': '.', 'metavar': ''}), - # Workaround for SourceForge's broken Python - # (``import random`` causes a segfault). - (frontend.SUPPRESS_HELP, - ['--no-random'], {'action': 'store_true'}),)) - - settings_default_overrides = {'footnote_references': 'brackets'} - - relative_path_settings = ('pep_stylesheet_path', 'pep_template') - - def __init__(self): - html4css1.Writer.__init__(self) - self.translator_class = HTMLTranslator - - def translate(self): - html4css1.Writer.translate(self) - settings = self.document.settings - template = open(settings.pep_template).read() - # Substitutions dict for template: - subs = {} - subs['encoding'] = settings.output_encoding - subs['version'] = docutils.__version__ - subs['stylesheet'] = ''.join(self.stylesheet) - pyhome = settings.python_home - subs['pyhome'] = pyhome - subs['pephome'] = settings.pep_home - if pyhome == '..': - subs['pepindex'] = '.' - else: - subs['pepindex'] = pyhome + '/peps/' - index = self.document.first_child_matching_class(nodes.field_list) - header = self.document[index] - pepnum = header[0][1].astext() - subs['pep'] = pepnum - if settings.no_random: - subs['banner'] = 0 - else: - import random - subs['banner'] = random.randrange(64) - try: - subs['pepnum'] = '%04i' % int(pepnum) - except: - subs['pepnum'] = pepnum - subs['title'] = header[1][1].astext() - subs['body'] = ''.join( - self.body_pre_docinfo + self.docinfo + self.body) - subs['body_suffix'] = ''.join(self.body_suffix) - self.output = template % subs - - -class HTMLTranslator(html4css1.HTMLTranslator): - - def get_stylesheet_reference(self, relative_to=None): - settings = self.settings - if relative_to == None: - relative_to = settings._destination - if settings.pep_stylesheet_path: - return utils.relative_path(relative_to, - settings.pep_stylesheet_path) - elif settings.pep_stylesheet: - return settings.pep_stylesheet - elif settings._stylesheet_path: - return utils.relative_path(relative_to, settings.stylesheet_path) - else: - return settings.stylesheet - - def depart_field_list(self, node): - html4css1.HTMLTranslator.depart_field_list(self, node) - if node.get('class') == 'rfc2822': - self.body.append('
\n') diff --git a/docutils/docutils/writers/pseudoxml.py b/docutils/docutils/writers/pseudoxml.py deleted file mode 100644 index 02dde58f3..000000000 --- a/docutils/docutils/writers/pseudoxml.py +++ /dev/null @@ -1,30 +0,0 @@ -# Authors: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Simple internal document tree Writer, writes indented pseudo-XML. -""" - -__docformat__ = 'reStructuredText' - - -from docutils import writers - - -class Writer(writers.Writer): - - supported = ('pprint', 'pformat', 'pseudoxml') - """Formats this writer supports.""" - - output = None - """Final translated form of `document`.""" - - def translate(self): - self.output = self.document.pformat() - - def supports(self, format): - """This writer supports all format-specific elements.""" - return 1 diff --git a/docutils/extras/optparse.py b/docutils/extras/optparse.py deleted file mode 100644 index 6e0381e4f..000000000 --- a/docutils/extras/optparse.py +++ /dev/null @@ -1,1401 +0,0 @@ -"""optparse - a powerful, extensible, and easy-to-use option parser. - -By Greg Ward - -Originally distributed as Optik; see http://optik.sourceforge.net/ . - -If you have problems with this module, please do not file bugs, -patches, or feature requests with Python; instead, use Optik's -SourceForge project page: - http://sourceforge.net/projects/optik - -For support, use the optik-users@lists.sourceforge.net mailing list -(http://lists.sourceforge.net/lists/listinfo/optik-users). -""" - -# Python developers: please do not make changes to this file, since -# it is automatically generated from the Optik source code. - -__version__ = "1.4.1+" - -__all__ = ['Option', - 'SUPPRESS_HELP', - 'SUPPRESS_USAGE', - 'STD_HELP_OPTION', - 'STD_VERSION_OPTION', - 'Values', - 'OptionContainer', - 'OptionGroup', - 'OptionParser', - 'HelpFormatter', - 'IndentedHelpFormatter', - 'TitledHelpFormatter', - 'OptParseError', - 'OptionError', - 'OptionConflictError', - 'OptionValueError', - 'BadOptionError'] - -__copyright__ = """ -Copyright (c) 2001-2003 Gregory P. Ward. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - * Neither the name of the author nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -""" - -import sys, os -import types -import textwrap - -class OptParseError (Exception): - def __init__ (self, msg): - self.msg = msg - - def __str__ (self): - return self.msg - - -class OptionError (OptParseError): - """ - Raised if an Option instance is created with invalid or - inconsistent arguments. - """ - - def __init__ (self, msg, option): - self.msg = msg - self.option_id = str(option) - - def __str__ (self): - if self.option_id: - return "option %s: %s" % (self.option_id, self.msg) - else: - return self.msg - -class OptionConflictError (OptionError): - """ - Raised if conflicting options are added to an OptionParser. - """ - -class OptionValueError (OptParseError): - """ - Raised if an invalid option value is encountered on the command - line. - """ - -class BadOptionError (OptParseError): - """ - Raised if an invalid or ambiguous option is seen on the command-line. - """ - - -class HelpFormatter: - - """ - Abstract base class for formatting option help. OptionParser - instances should use one of the HelpFormatter subclasses for - formatting help; by default IndentedHelpFormatter is used. - - Instance attributes: - indent_increment : int - the number of columns to indent per nesting level - max_help_position : int - the maximum starting column for option help text - help_position : int - the calculated starting column for option help text; - initially the same as the maximum - width : int - total number of columns for output - level : int - current indentation level - current_indent : int - current indentation level (in columns) - help_width : int - number of columns available for option help text (calculated) - """ - - def __init__ (self, - indent_increment, - max_help_position, - width, - short_first): - self.indent_increment = indent_increment - self.help_position = self.max_help_position = max_help_position - self.width = width - self.current_indent = 0 - self.level = 0 - self.help_width = width - max_help_position - self.short_first = short_first - - def indent (self): - self.current_indent += self.indent_increment - self.level += 1 - - def dedent (self): - self.current_indent -= self.indent_increment - assert self.current_indent >= 0, "Indent decreased below 0." - self.level -= 1 - - def format_usage (self, usage): - raise NotImplementedError, "subclasses must implement" - - def format_heading (self, heading): - raise NotImplementedError, "subclasses must implement" - - def format_description (self, description): - desc_width = self.width - self.current_indent - indent = " "*self.current_indent - return textwrap.fill(description, desc_width, - initial_indent=indent, - subsequent_indent=indent) - - def format_option (self, option): - # The help for each option consists of two parts: - # * the opt strings and metavars - # eg. ("-x", or "-fFILENAME, --file=FILENAME") - # * the user-supplied help string - # eg. ("turn on expert mode", "read data from FILENAME") - # - # If possible, we write both of these on the same line: - # -x turn on expert mode - # - # But if the opt string list is too long, we put the help - # string on a second line, indented to the same column it would - # start in if it fit on the first line. - # -fFILENAME, --file=FILENAME - # read data from FILENAME - result = [] - opts = option.option_strings - opt_width = self.help_position - self.current_indent - 2 - if len(opts) > opt_width: - opts = "%*s%s\n" % (self.current_indent, "", opts) - indent_first = self.help_position - else: # start help on same line as opts - opts = "%*s%-*s " % (self.current_indent, "", opt_width, opts) - indent_first = 0 - result.append(opts) - if option.help: - help_lines = textwrap.wrap(option.help, self.help_width) - result.append("%*s%s\n" % (indent_first, "", help_lines[0])) - result.extend(["%*s%s\n" % (self.help_position, "", line) - for line in help_lines[1:]]) - elif opts[-1] != "\n": - result.append("\n") - return "".join(result) - - def store_option_strings (self, parser): - self.indent() - max_len = 0 - for opt in parser.option_list: - strings = self.format_option_strings(opt) - opt.option_strings = strings - max_len = max(max_len, len(strings) + self.current_indent) - self.indent() - for group in parser.option_groups: - for opt in group.option_list: - strings = self.format_option_strings(opt) - opt.option_strings = strings - max_len = max(max_len, len(strings) + self.current_indent) - self.dedent() - self.dedent() - self.help_position = min(max_len + 2, self.max_help_position) - - def format_option_strings (self, option): - """Return a comma-separated list of option strings & metavariables.""" - if option.takes_value(): - metavar = option.metavar or option.dest.upper() - short_opts = [sopt + metavar for sopt in option._short_opts] - long_opts = [lopt + "=" + metavar for lopt in option._long_opts] - else: - short_opts = option._short_opts - long_opts = option._long_opts - - if self.short_first: - opts = short_opts + long_opts - else: - opts = long_opts + short_opts - - return ", ".join(opts) - -class IndentedHelpFormatter (HelpFormatter): - """Format help with indented section bodies. - """ - - def __init__ (self, - indent_increment=2, - max_help_position=24, - width=78, - short_first=1): - HelpFormatter.__init__( - self, indent_increment, max_help_position, width, short_first) - - def format_usage (self, usage): - return "usage: %s\n" % usage - - def format_heading (self, heading): - return "%*s%s:\n" % (self.current_indent, "", heading) - - -class TitledHelpFormatter (HelpFormatter): - """Format help with underlined section headers. - """ - - def __init__ (self, - indent_increment=0, - max_help_position=24, - width=78, - short_first=0): - HelpFormatter.__init__ ( - self, indent_increment, max_help_position, width, short_first) - - def format_usage (self, usage): - return "%s %s\n" % (self.format_heading("Usage"), usage) - - def format_heading (self, heading): - return "%s\n%s\n" % (heading, "=-"[self.level] * len(heading)) - - -_builtin_cvt = { "int" : (int, "integer"), - "long" : (long, "long integer"), - "float" : (float, "floating-point"), - "complex" : (complex, "complex") } - -def check_builtin (option, opt, value): - (cvt, what) = _builtin_cvt[option.type] - try: - return cvt(value) - except ValueError: - raise OptionValueError( - #"%s: invalid %s argument %r" % (opt, what, value)) - "option %s: invalid %s value: %r" % (opt, what, value)) - -def check_choice(option, opt, value): - if value in option.choices: - return value - else: - choices = ", ".join(map(repr, option.choices)) - raise OptionValueError( - "option %s: invalid choice: %r (choose from %s)" - % (opt, value, choices)) - -# Not supplying a default is different from a default of None, -# so we need an explicit "not supplied" value. -NO_DEFAULT = "NO"+"DEFAULT" - - -class Option: - """ - Instance attributes: - _short_opts : [string] - _long_opts : [string] - - action : string - type : string - dest : string - default : any - nargs : int - const : any - choices : [string] - callback : function - callback_args : (any*) - callback_kwargs : { string : any } - help : string - metavar : string - """ - - # The list of instance attributes that may be set through - # keyword args to the constructor. - ATTRS = ['action', - 'type', - 'dest', - 'default', - 'nargs', - 'const', - 'choices', - 'callback', - 'callback_args', - 'callback_kwargs', - 'help', - 'metavar'] - - # The set of actions allowed by option parsers. Explicitly listed - # here so the constructor can validate its arguments. - ACTIONS = ("store", - "store_const", - "store_true", - "store_false", - "append", - "count", - "callback", - "help", - "version") - - # The set of actions that involve storing a value somewhere; - # also listed just for constructor argument validation. (If - # the action is one of these, there must be a destination.) - STORE_ACTIONS = ("store", - "store_const", - "store_true", - "store_false", - "append", - "count") - - # The set of actions for which it makes sense to supply a value - # type, ie. where we expect an argument to this option. - TYPED_ACTIONS = ("store", - "append", - "callback") - - # The set of known types for option parsers. Again, listed here for - # constructor argument validation. - TYPES = ("string", "int", "long", "float", "complex", "choice") - - # Dictionary of argument checking functions, which convert and - # validate option arguments according to the option type. - # - # Signature of checking functions is: - # check(option : Option, opt : string, value : string) -> any - # where - # option is the Option instance calling the checker - # opt is the actual option seen on the command-line - # (eg. "-a", "--file") - # value is the option argument seen on the command-line - # - # The return value should be in the appropriate Python type - # for option.type -- eg. an integer if option.type == "int". - # - # If no checker is defined for a type, arguments will be - # unchecked and remain strings. - TYPE_CHECKER = { "int" : check_builtin, - "long" : check_builtin, - "float" : check_builtin, - "complex" : check_builtin, - "choice" : check_choice, - } - - - # CHECK_METHODS is a list of unbound method objects; they are called - # by the constructor, in order, after all attributes are - # initialized. The list is created and filled in later, after all - # the methods are actually defined. (I just put it here because I - # like to define and document all class attributes in the same - # place.) Subclasses that add another _check_*() method should - # define their own CHECK_METHODS list that adds their check method - # to those from this class. - CHECK_METHODS = None - - - # -- Constructor/initialization methods ---------------------------- - - def __init__ (self, *opts, **attrs): - # Set _short_opts, _long_opts attrs from 'opts' tuple. - # Have to be set now, in case no option strings are supplied. - self._short_opts = [] - self._long_opts = [] - opts = self._check_opt_strings(opts) - self._set_opt_strings(opts) - - # Set all other attrs (action, type, etc.) from 'attrs' dict - self._set_attrs(attrs) - - # Check all the attributes we just set. There are lots of - # complicated interdependencies, but luckily they can be farmed - # out to the _check_*() methods listed in CHECK_METHODS -- which - # could be handy for subclasses! The one thing these all share - # is that they raise OptionError if they discover a problem. - for checker in self.CHECK_METHODS: - checker(self) - - def _check_opt_strings (self, opts): - # Filter out None because early versions of Optik had exactly - # one short option and one long option, either of which - # could be None. - opts = filter(None, opts) - if not opts: - raise TypeError("at least one option string must be supplied") - return opts - - def _set_opt_strings (self, opts): - for opt in opts: - if len(opt) < 2: - raise OptionError( - "invalid option string %r: " - "must be at least two characters long" % opt, self) - elif len(opt) == 2: - if not (opt[0] == "-" and opt[1] != "-"): - raise OptionError( - "invalid short option string %r: " - "must be of the form -x, (x any non-dash char)" % opt, - self) - self._short_opts.append(opt) - else: - if not (opt[0:2] == "--" and opt[2] != "-"): - raise OptionError( - "invalid long option string %r: " - "must start with --, followed by non-dash" % opt, - self) - self._long_opts.append(opt) - - def _set_attrs (self, attrs): - for attr in self.ATTRS: - if attrs.has_key(attr): - setattr(self, attr, attrs[attr]) - del attrs[attr] - else: - if attr == 'default': - setattr(self, attr, NO_DEFAULT) - else: - setattr(self, attr, None) - if attrs: - raise OptionError( - "invalid keyword arguments: %s" % ", ".join(attrs.keys()), - self) - - - # -- Constructor validation methods -------------------------------- - - def _check_action (self): - if self.action is None: - self.action = "store" - elif self.action not in self.ACTIONS: - raise OptionError("invalid action: %r" % self.action, self) - - def _check_type (self): - if self.type is None: - # XXX should factor out another class attr here: list of - # actions that *require* a type - if self.action in ("store", "append"): - if self.choices is not None: - # The "choices" attribute implies "choice" type. - self.type = "choice" - else: - # No type given? "string" is the most sensible default. - self.type = "string" - else: - if self.type not in self.TYPES: - raise OptionError("invalid option type: %r" % self.type, self) - if self.action not in self.TYPED_ACTIONS: - raise OptionError( - "must not supply a type for action %r" % self.action, self) - - def _check_choice(self): - if self.type == "choice": - if self.choices is None: - raise OptionError( - "must supply a list of choices for type 'choice'", self) - elif type(self.choices) not in (types.TupleType, types.ListType): - raise OptionError( - "choices must be a list of strings ('%s' supplied)" - % str(type(self.choices)).split("'")[1], self) - elif self.choices is not None: - raise OptionError( - "must not supply choices for type %r" % self.type, self) - - def _check_dest (self): - if self.action in self.STORE_ACTIONS and self.dest is None: - # No destination given, and we need one for this action. - # Glean a destination from the first long option string, - # or from the first short option string if no long options. - if self._long_opts: - # eg. "--foo-bar" -> "foo_bar" - self.dest = self._long_opts[0][2:].replace('-', '_') - else: - self.dest = self._short_opts[0][1] - - def _check_const (self): - if self.action != "store_const" and self.const is not None: - raise OptionError( - "'const' must not be supplied for action %r" % self.action, - self) - - def _check_nargs (self): - if self.action in self.TYPED_ACTIONS: - if self.nargs is None: - self.nargs = 1 - elif self.nargs is not None: - raise OptionError( - "'nargs' must not be supplied for action %r" % self.action, - self) - - def _check_callback (self): - if self.action == "callback": - if not callable(self.callback): - raise OptionError( - "callback not callable: %r" % self.callback, self) - if (self.callback_args is not None and - type(self.callback_args) is not types.TupleType): - raise OptionError( - "callback_args, if supplied, must be a tuple: not %r" - % self.callback_args, self) - if (self.callback_kwargs is not None and - type(self.callback_kwargs) is not types.DictType): - raise OptionError( - "callback_kwargs, if supplied, must be a dict: not %r" - % self.callback_kwargs, self) - else: - if self.callback is not None: - raise OptionError( - "callback supplied (%r) for non-callback option" - % self.callback, self) - if self.callback_args is not None: - raise OptionError( - "callback_args supplied for non-callback option", self) - if self.callback_kwargs is not None: - raise OptionError( - "callback_kwargs supplied for non-callback option", self) - - - CHECK_METHODS = [_check_action, - _check_type, - _check_choice, - _check_dest, - _check_const, - _check_nargs, - _check_callback] - - - # -- Miscellaneous methods ----------------------------------------- - - def __str__ (self): - return "/".join(self._short_opts + self._long_opts) - - def takes_value (self): - return self.type is not None - - - # -- Processing methods -------------------------------------------- - - def check_value (self, opt, value): - checker = self.TYPE_CHECKER.get(self.type) - if checker is None: - return value - else: - return checker(self, opt, value) - - def process (self, opt, value, values, parser): - - # First, convert the value(s) to the right type. Howl if any - # value(s) are bogus. - if value is not None: - if self.nargs == 1: - value = self.check_value(opt, value) - else: - value = tuple([self.check_value(opt, v) for v in value]) - - # And then take whatever action is expected of us. - # This is a separate method to make life easier for - # subclasses to add new actions. - return self.take_action( - self.action, self.dest, opt, value, values, parser) - - def take_action (self, action, dest, opt, value, values, parser): - if action == "store": - setattr(values, dest, value) - elif action == "store_const": - setattr(values, dest, self.const) - elif action == "store_true": - setattr(values, dest, True) - elif action == "store_false": - setattr(values, dest, False) - elif action == "append": - values.ensure_value(dest, []).append(value) - elif action == "count": - setattr(values, dest, values.ensure_value(dest, 0) + 1) - elif action == "callback": - args = self.callback_args or () - kwargs = self.callback_kwargs or {} - self.callback(self, opt, value, parser, *args, **kwargs) - elif action == "help": - parser.print_help() - sys.exit(0) - elif action == "version": - parser.print_version() - sys.exit(0) - else: - raise RuntimeError, "unknown action %r" % self.action - - return 1 - -# class Option - - -SUPPRESS_HELP = "SUPPRESS"+"HELP" -SUPPRESS_USAGE = "SUPPRESS"+"USAGE" - -STD_HELP_OPTION = Option("-h", "--help", - action="help", - help="show this help message and exit") -STD_VERSION_OPTION = Option("--version", - action="version", - help="show program's version number and exit") - - -class Values: - - def __init__ (self, defaults=None): - if defaults: - for (attr, val) in defaults.items(): - setattr(self, attr, val) - - def __repr__ (self): - return ("<%s at 0x%x: %r>" - % (self.__class__.__name__, id(self), self.__dict__)) - - def _update_careful (self, dict): - """ - Update the option values from an arbitrary dictionary, but only - use keys from dict that already have a corresponding attribute - in self. Any keys in dict without a corresponding attribute - are silently ignored. - """ - for attr in dir(self): - if dict.has_key(attr): - dval = dict[attr] - if dval is not None: - setattr(self, attr, dval) - - def _update_loose (self, dict): - """ - Update the option values from an arbitrary dictionary, - using all keys from the dictionary regardless of whether - they have a corresponding attribute in self or not. - """ - self.__dict__.update(dict) - - def _update (self, dict, mode): - if mode == "careful": - self._update_careful(dict) - elif mode == "loose": - self._update_loose(dict) - else: - raise ValueError, "invalid update mode: %r" % mode - - def read_module (self, modname, mode="careful"): - __import__(modname) - mod = sys.modules[modname] - self._update(vars(mod), mode) - - def read_file (self, filename, mode="careful"): - vars = {} - execfile(filename, vars) - self._update(vars, mode) - - def ensure_value (self, attr, value): - if not hasattr(self, attr) or getattr(self, attr) is None: - setattr(self, attr, value) - return getattr(self, attr) - - -class OptionContainer: - - """ - Abstract base class. - - Class attributes: - standard_option_list : [Option] - list of standard options that will be accepted by all instances - of this parser class (intended to be overridden by subclasses). - - Instance attributes: - option_list : [Option] - the list of Option objects contained by this OptionContainer - _short_opt : { string : Option } - dictionary mapping short option strings, eg. "-f" or "-X", - to the Option instances that implement them. If an Option - has multiple short option strings, it will appears in this - dictionary multiple times. [1] - _long_opt : { string : Option } - dictionary mapping long option strings, eg. "--file" or - "--exclude", to the Option instances that implement them. - Again, a given Option can occur multiple times in this - dictionary. [1] - defaults : { string : any } - dictionary mapping option destination names to default - values for each destination [1] - - [1] These mappings are common to (shared by) all components of the - controlling OptionParser, where they are initially created. - - """ - - def __init__ (self, option_class, conflict_handler, description): - # Initialize the option list and related data structures. - # This method must be provided by subclasses, and it must - # initialize at least the following instance attributes: - # option_list, _short_opt, _long_opt, defaults. - self._create_option_list() - - self.option_class = option_class - self.set_conflict_handler(conflict_handler) - self.set_description(description) - - def _create_option_mappings (self): - # For use by OptionParser constructor -- create the master - # option mappings used by this OptionParser and all - # OptionGroups that it owns. - self._short_opt = {} # single letter -> Option instance - self._long_opt = {} # long option -> Option instance - self.defaults = {} # maps option dest -> default value - - - def _share_option_mappings (self, parser): - # For use by OptionGroup constructor -- use shared option - # mappings from the OptionParser that owns this OptionGroup. - self._short_opt = parser._short_opt - self._long_opt = parser._long_opt - self.defaults = parser.defaults - - def set_conflict_handler (self, handler): - if handler not in ("ignore", "error", "resolve"): - raise ValueError, "invalid conflict_resolution value %r" % handler - self.conflict_handler = handler - - def set_description (self, description): - self.description = description - - - # -- Option-adding methods ----------------------------------------- - - def _check_conflict (self, option): - conflict_opts = [] - for opt in option._short_opts: - if self._short_opt.has_key(opt): - conflict_opts.append((opt, self._short_opt[opt])) - for opt in option._long_opts: - if self._long_opt.has_key(opt): - conflict_opts.append((opt, self._long_opt[opt])) - - if conflict_opts: - handler = self.conflict_handler - if handler == "ignore": # behaviour for Optik 1.0, 1.1 - pass - elif handler == "error": # new in 1.2 - raise OptionConflictError( - "conflicting option string(s): %s" - % ", ".join([co[0] for co in conflict_opts]), - option) - elif handler == "resolve": # new in 1.2 - for (opt, c_option) in conflict_opts: - if opt.startswith("--"): - c_option._long_opts.remove(opt) - del self._long_opt[opt] - else: - c_option._short_opts.remove(opt) - del self._short_opt[opt] - if not (c_option._short_opts or c_option._long_opts): - c_option.container.option_list.remove(c_option) - - def add_option (self, *args, **kwargs): - """add_option(Option) - add_option(opt_str, ..., kwarg=val, ...) - """ - if type(args[0]) is types.StringType: - option = self.option_class(*args, **kwargs) - elif len(args) == 1 and not kwargs: - option = args[0] - if not isinstance(option, Option): - raise TypeError, "not an Option instance: %r" % option - else: - raise TypeError, "invalid arguments" - - self._check_conflict(option) - - self.option_list.append(option) - option.container = self - for opt in option._short_opts: - self._short_opt[opt] = option - for opt in option._long_opts: - self._long_opt[opt] = option - - if option.dest is not None: # option has a dest, we need a default - if option.default is not NO_DEFAULT: - self.defaults[option.dest] = option.default - elif not self.defaults.has_key(option.dest): - self.defaults[option.dest] = None - - return option - - def add_options (self, option_list): - for option in option_list: - self.add_option(option) - - # -- Option query/removal methods ---------------------------------- - - def get_option (self, opt_str): - return (self._short_opt.get(opt_str) or - self._long_opt.get(opt_str)) - - def has_option (self, opt_str): - return (self._short_opt.has_key(opt_str) or - self._long_opt.has_key(opt_str)) - - def remove_option (self, opt_str): - option = self._short_opt.get(opt_str) - if option is None: - option = self._long_opt.get(opt_str) - if option is None: - raise ValueError("no such option %r" % opt_str) - - for opt in option._short_opts: - del self._short_opt[opt] - for opt in option._long_opts: - del self._long_opt[opt] - option.container.option_list.remove(option) - - - # -- Help-formatting methods --------------------------------------- - - def format_option_help (self, formatter): - if not self.option_list: - return "" - result = [] - for option in self.option_list: - if not option.help is SUPPRESS_HELP: - result.append(formatter.format_option(option)) - return "".join(result) - - def format_description (self, formatter): - if self.description: - return formatter.format_description(self.description) - else: - return "" - - def format_help (self, formatter): - if self.description: - desc = self.format_description(formatter) + "\n" - else: - desc = "" - return desc + self.format_option_help(formatter) - - -class OptionGroup (OptionContainer): - - def __init__ (self, parser, title, description=None): - self.parser = parser - OptionContainer.__init__( - self, parser.option_class, parser.conflict_handler, description) - self.title = title - - def _create_option_list (self): - self.option_list = [] - self._share_option_mappings(self.parser) - - def set_title (self, title): - self.title = title - - # -- Help-formatting methods --------------------------------------- - - def format_help (self, formatter): - result = formatter.format_heading(self.title) - formatter.indent() - result += OptionContainer.format_help(self, formatter) - formatter.dedent() - return result - - -class OptionParser (OptionContainer): - - """ - Class attributes: - standard_option_list : [Option] - list of standard options that will be accepted by all instances - of this parser class (intended to be overridden by subclasses). - - Instance attributes: - usage : string - a usage string for your program. Before it is displayed - to the user, "%prog" will be expanded to the name of - your program (self.prog or os.path.basename(sys.argv[0])). - prog : string - the name of the current program (to override - os.path.basename(sys.argv[0])). - - allow_interspersed_args : boolean = true - if true, positional arguments may be interspersed with options. - Assuming -a and -b each take a single argument, the command-line - -ablah foo bar -bboo baz - will be interpreted the same as - -ablah -bboo -- foo bar baz - If this flag were false, that command line would be interpreted as - -ablah -- foo bar -bboo baz - -- ie. we stop processing options as soon as we see the first - non-option argument. (This is the tradition followed by - Python's getopt module, Perl's Getopt::Std, and other argument- - parsing libraries, but it is generally annoying to users.) - - rargs : [string] - the argument list currently being parsed. Only set when - parse_args() is active, and continually trimmed down as - we consume arguments. Mainly there for the benefit of - callback options. - largs : [string] - the list of leftover arguments that we have skipped while - parsing options. If allow_interspersed_args is false, this - list is always empty. - values : Values - the set of option values currently being accumulated. Only - set when parse_args() is active. Also mainly for callbacks. - - Because of the 'rargs', 'largs', and 'values' attributes, - OptionParser is not thread-safe. If, for some perverse reason, you - need to parse command-line arguments simultaneously in different - threads, use different OptionParser instances. - - """ - - standard_option_list = [] - - def __init__ (self, - usage=None, - option_list=None, - option_class=Option, - version=None, - conflict_handler="error", - description=None, - formatter=None, - add_help_option=1, - prog=None): - OptionContainer.__init__( - self, option_class, conflict_handler, description) - self.set_usage(usage) - self.prog = prog - self.version = version - self.allow_interspersed_args = 1 - if formatter is None: - formatter = IndentedHelpFormatter() - self.formatter = formatter - - # Populate the option list; initial sources are the - # standard_option_list class attribute, the 'option_list' - # argument, and the STD_VERSION_OPTION (if 'version' supplied) - # and STD_HELP_OPTION globals. - self._populate_option_list(option_list, - add_help=add_help_option) - - self._init_parsing_state() - - # -- Private methods ----------------------------------------------- - # (used by our or OptionContainer's constructor) - - def _create_option_list (self): - self.option_list = [] - self.option_groups = [] - self._create_option_mappings() - - def _populate_option_list (self, option_list, add_help=1): - if self.standard_option_list: - self.add_options(self.standard_option_list) - if option_list: - self.add_options(option_list) - if self.version: - self.add_option(STD_VERSION_OPTION) - if add_help: - self.add_option(STD_HELP_OPTION) - - def _init_parsing_state (self): - # These are set in parse_args() for the convenience of callbacks. - self.rargs = None - self.largs = None - self.values = None - - - # -- Simple modifier methods --------------------------------------- - - def set_usage (self, usage): - if usage is None: - self.usage = "%prog [options]" - elif usage is SUPPRESS_USAGE: - self.usage = None - elif usage.startswith("usage: "): - # for backwards compatibility with Optik 1.3 and earlier - self.usage = usage[7:] - else: - self.usage = usage - - def enable_interspersed_args (self): - self.allow_interspersed_args = 1 - - def disable_interspersed_args (self): - self.allow_interspersed_args = 0 - - def set_default (self, dest, value): - self.defaults[dest] = value - - def set_defaults (self, **kwargs): - self.defaults.update(kwargs) - - def get_default_values (self): - return Values(self.defaults) - - - # -- OptionGroup methods ------------------------------------------- - - def add_option_group (self, *args, **kwargs): - # XXX lots of overlap with OptionContainer.add_option() - if type(args[0]) is types.StringType: - group = OptionGroup(self, *args, **kwargs) - elif len(args) == 1 and not kwargs: - group = args[0] - if not isinstance(group, OptionGroup): - raise TypeError, "not an OptionGroup instance: %r" % group - if group.parser is not self: - raise ValueError, "invalid OptionGroup (wrong parser)" - else: - raise TypeError, "invalid arguments" - - self.option_groups.append(group) - return group - - def get_option_group (self, opt_str): - option = (self._short_opt.get(opt_str) or - self._long_opt.get(opt_str)) - if option and option.container is not self: - return option.container - return None - - - # -- Option-parsing methods ---------------------------------------- - - def _get_args (self, args): - if args is None: - return sys.argv[1:] - else: - return args[:] # don't modify caller's list - - def parse_args (self, args=None, values=None): - """ - parse_args(args : [string] = sys.argv[1:], - values : Values = None) - -> (values : Values, args : [string]) - - Parse the command-line options found in 'args' (default: - sys.argv[1:]). Any errors result in a call to 'error()', which - by default prints the usage message to stderr and calls - sys.exit() with an error message. On success returns a pair - (values, args) where 'values' is an Values instance (with all - your option values) and 'args' is the list of arguments left - over after parsing options. - """ - rargs = self._get_args(args) - if values is None: - values = self.get_default_values() - - # Store the halves of the argument list as attributes for the - # convenience of callbacks: - # rargs - # the rest of the command-line (the "r" stands for - # "remaining" or "right-hand") - # largs - # the leftover arguments -- ie. what's left after removing - # options and their arguments (the "l" stands for "leftover" - # or "left-hand") - self.rargs = rargs - self.largs = largs = [] - self.values = values - - try: - stop = self._process_args(largs, rargs, values) - except (BadOptionError, OptionValueError), err: - self.error(err.msg) - - args = largs + rargs - return self.check_values(values, args) - - def check_values (self, values, args): - """ - check_values(values : Values, args : [string]) - -> (values : Values, args : [string]) - - Check that the supplied option values and leftover arguments are - valid. Returns the option values and leftover arguments - (possibly adjusted, possibly completely new -- whatever you - like). Default implementation just returns the passed-in - values; subclasses may override as desired. - """ - return (values, args) - - def _process_args (self, largs, rargs, values): - """_process_args(largs : [string], - rargs : [string], - values : Values) - - Process command-line arguments and populate 'values', consuming - options and arguments from 'rargs'. If 'allow_interspersed_args' is - false, stop at the first non-option argument. If true, accumulate any - interspersed non-option arguments in 'largs'. - """ - while rargs: - arg = rargs[0] - # We handle bare "--" explicitly, and bare "-" is handled by the - # standard arg handler since the short arg case ensures that the - # len of the opt string is greater than 1. - if arg == "--": - del rargs[0] - return - elif arg[0:2] == "--": - # process a single long option (possibly with value(s)) - self._process_long_opt(rargs, values) - elif arg[:1] == "-" and len(arg) > 1: - # process a cluster of short options (possibly with - # value(s) for the last one only) - self._process_short_opts(rargs, values) - elif self.allow_interspersed_args: - largs.append(arg) - del rargs[0] - else: - return # stop now, leave this arg in rargs - - # Say this is the original argument list: - # [arg0, arg1, ..., arg(i-1), arg(i), arg(i+1), ..., arg(N-1)] - # ^ - # (we are about to process arg(i)). - # - # Then rargs is [arg(i), ..., arg(N-1)] and largs is a *subset* of - # [arg0, ..., arg(i-1)] (any options and their arguments will have - # been removed from largs). - # - # The while loop will usually consume 1 or more arguments per pass. - # If it consumes 1 (eg. arg is an option that takes no arguments), - # then after _process_arg() is done the situation is: - # - # largs = subset of [arg0, ..., arg(i)] - # rargs = [arg(i+1), ..., arg(N-1)] - # - # If allow_interspersed_args is false, largs will always be - # *empty* -- still a subset of [arg0, ..., arg(i-1)], but - # not a very interesting subset! - - def _match_long_opt (self, opt): - """_match_long_opt(opt : string) -> string - - Determine which long option string 'opt' matches, ie. which one - it is an unambiguous abbrevation for. Raises BadOptionError if - 'opt' doesn't unambiguously match any long option string. - """ - return _match_abbrev(opt, self._long_opt) - - def _process_long_opt (self, rargs, values): - arg = rargs.pop(0) - - # Value explicitly attached to arg? Pretend it's the next - # argument. - if "=" in arg: - (opt, next_arg) = arg.split("=", 1) - rargs.insert(0, next_arg) - had_explicit_value = 1 - else: - opt = arg - had_explicit_value = 0 - - opt = self._match_long_opt(opt) - option = self._long_opt[opt] - if option.takes_value(): - nargs = option.nargs - if len(rargs) < nargs: - if nargs == 1: - self.error("%s option requires a value" % opt) - else: - self.error("%s option requires %d values" - % (opt, nargs)) - elif nargs == 1: - value = rargs.pop(0) - else: - value = tuple(rargs[0:nargs]) - del rargs[0:nargs] - - elif had_explicit_value: - self.error("%s option does not take a value" % opt) - - else: - value = None - - option.process(opt, value, values, self) - - def _process_short_opts (self, rargs, values): - arg = rargs.pop(0) - stop = 0 - i = 1 - for ch in arg[1:]: - opt = "-" + ch - option = self._short_opt.get(opt) - i += 1 # we have consumed a character - - if not option: - self.error("no such option: %s" % opt) - if option.takes_value(): - # Any characters left in arg? Pretend they're the - # next arg, and stop consuming characters of arg. - if i < len(arg): - rargs.insert(0, arg[i:]) - stop = 1 - - nargs = option.nargs - if len(rargs) < nargs: - if nargs == 1: - self.error("%s option requires a value" % opt) - else: - self.error("%s option requires %s values" - % (opt, nargs)) - elif nargs == 1: - value = rargs.pop(0) - else: - value = tuple(rargs[0:nargs]) - del rargs[0:nargs] - - else: # option doesn't take a value - value = None - - option.process(opt, value, values, self) - - if stop: - break - - - # -- Feedback methods ---------------------------------------------- - - def get_prog_name (self): - if self.prog is None: - return os.path.basename(sys.argv[0]) - else: - return self.prog - - def error (self, msg): - """error(msg : string) - - Print a usage message incorporating 'msg' to stderr and exit. - If you override this in a subclass, it should not return -- it - should either exit or raise an exception. - """ - self.print_usage(sys.stderr) - sys.exit("%s: error: %s" % (self.get_prog_name(), msg)) - - def get_usage (self): - if self.usage: - return self.formatter.format_usage( - self.usage.replace("%prog", self.get_prog_name())) - else: - return "" - - def print_usage (self, file=None): - """print_usage(file : file = stdout) - - Print the usage message for the current program (self.usage) to - 'file' (default stdout). Any occurence of the string "%prog" in - self.usage is replaced with the name of the current program - (basename of sys.argv[0]). Does nothing if self.usage is empty - or not defined. - """ - if self.usage: - print >>file, self.get_usage() - - def get_version (self): - if self.version: - return self.version.replace("%prog", self.get_prog_name()) - else: - return "" - - def print_version (self, file=None): - """print_version(file : file = stdout) - - Print the version message for this program (self.version) to - 'file' (default stdout). As with print_usage(), any occurence - of "%prog" in self.version is replaced by the current program's - name. Does nothing if self.version is empty or undefined. - """ - if self.version: - print >>file, self.get_version() - - def format_option_help (self, formatter=None): - if formatter is None: - formatter = self.formatter - formatter.store_option_strings(self) - result = [] - result.append(formatter.format_heading("options")) - formatter.indent() - if self.option_list: - result.append(OptionContainer.format_option_help(self, formatter)) - result.append("\n") - for group in self.option_groups: - result.append(group.format_help(formatter)) - result.append("\n") - formatter.dedent() - # Drop the last "\n", or the header if no options or option groups: - return "".join(result[:-1]) - - def format_help (self, formatter=None): - if formatter is None: - formatter = self.formatter - result = [] - if self.usage: - result.append(self.get_usage() + "\n") - if self.description: - result.append(self.format_description(formatter) + "\n") - result.append(self.format_option_help(formatter)) - return "".join(result) - - def print_help (self, file=None): - """print_help(file : file = stdout) - - Print an extended help message, listing all options and any - help text provided with them, to 'file' (default stdout). - """ - if file is None: - file = sys.stdout - file.write(self.format_help()) - -# class OptionParser - - -def _match_abbrev (s, wordmap): - """_match_abbrev(s : string, wordmap : {string : Option}) -> string - - Return the string key in 'wordmap' for which 's' is an unambiguous - abbreviation. If 's' is found to be ambiguous or doesn't match any of - 'words', raise BadOptionError. - """ - # Is there an exact match? - if wordmap.has_key(s): - return s - else: - # Isolate all words with s as a prefix. - possibilities = [word for word in wordmap.keys() - if word.startswith(s)] - # No exact match, so there had better be just one possibility. - if len(possibilities) == 1: - return possibilities[0] - elif not possibilities: - raise BadOptionError("no such option: %s" % s) - else: - # More than one possible completion: ambiguous prefix. - raise BadOptionError("ambiguous option: %s (%s?)" - % (s, ", ".join(possibilities))) - - -# Some day, there might be many Option classes. As of Optik 1.3, the -# preferred way to instantiate Options is indirectly, via make_option(), -# which will become a factory function when there are many Option -# classes. -make_option = Option diff --git a/docutils/extras/roman.py b/docutils/extras/roman.py deleted file mode 100644 index ebe088308..000000000 --- a/docutils/extras/roman.py +++ /dev/null @@ -1,81 +0,0 @@ -"""Convert to and from Roman numerals""" - -__author__ = "Mark Pilgrim (f8dy@diveintopython.org)" -__version__ = "1.4" -__date__ = "8 August 2001" -__copyright__ = """Copyright (c) 2001 Mark Pilgrim - -This program is part of "Dive Into Python", a free Python tutorial for -experienced programmers. Visit http://diveintopython.org/ for the -latest version. - -This program is free software; you can redistribute it and/or modify -it under the terms of the Python 2.1.1 license, available at -http://www.python.org/2.1.1/license.html -""" - -import re - -#Define exceptions -class RomanError(Exception): pass -class OutOfRangeError(RomanError): pass -class NotIntegerError(RomanError): pass -class InvalidRomanNumeralError(RomanError): pass - -#Define digit mapping -romanNumeralMap = (('M', 1000), - ('CM', 900), - ('D', 500), - ('CD', 400), - ('C', 100), - ('XC', 90), - ('L', 50), - ('XL', 40), - ('X', 10), - ('IX', 9), - ('V', 5), - ('IV', 4), - ('I', 1)) - -def toRoman(n): - """convert integer to Roman numeral""" - if not (0 < n < 5000): - raise OutOfRangeError, "number out of range (must be 1..4999)" - if int(n) <> n: - raise NotIntegerError, "decimals can not be converted" - - result = "" - for numeral, integer in romanNumeralMap: - while n >= integer: - result += numeral - n -= integer - return result - -#Define pattern to detect valid Roman numerals -romanNumeralPattern = re.compile(""" - ^ # beginning of string - M{0,4} # thousands - 0 to 4 M's - (CM|CD|D?C{0,3}) # hundreds - 900 (CM), 400 (CD), 0-300 (0 to 3 C's), - # or 500-800 (D, followed by 0 to 3 C's) - (XC|XL|L?X{0,3}) # tens - 90 (XC), 40 (XL), 0-30 (0 to 3 X's), - # or 50-80 (L, followed by 0 to 3 X's) - (IX|IV|V?I{0,3}) # ones - 9 (IX), 4 (IV), 0-3 (0 to 3 I's), - # or 5-8 (V, followed by 0 to 3 I's) - $ # end of string - """ ,re.VERBOSE) - -def fromRoman(s): - """convert Roman numeral to integer""" - if not s: - raise InvalidRomanNumeralError, 'Input can not be blank' - if not romanNumeralPattern.search(s): - raise InvalidRomanNumeralError, 'Invalid Roman numeral: %s' % s - - result = 0 - index = 0 - for numeral, integer in romanNumeralMap: - while s[index:index+len(numeral)] == numeral: - result += integer - index += len(numeral) - return result - diff --git a/docutils/extras/textwrap.py b/docutils/extras/textwrap.py deleted file mode 100644 index a4a549848..000000000 --- a/docutils/extras/textwrap.py +++ /dev/null @@ -1,355 +0,0 @@ -"""Text wrapping and filling. -""" - -# Copyright (C) 1999-2001 Gregory P. Ward. -# Copyright (C) 2002, 2003 Python Software Foundation. -# Written by Greg Ward - -__revision__ = "$Id$" - -import string, re - -# Do the right thing with boolean values for all known Python versions -# (so this module can be copied to projects that don't depend on Python -# 2.3, e.g. Optik and Docutils). -try: - True, False -except NameError: - (True, False) = (1, 0) - -__all__ = ['TextWrapper', 'wrap', 'fill'] - -# Hardcode the recognized whitespace characters to the US-ASCII -# whitespace characters. The main reason for doing this is that in -# ISO-8859-1, 0xa0 is non-breaking whitespace, so in certain locales -# that character winds up in string.whitespace. Respecting -# string.whitespace in those cases would 1) make textwrap treat 0xa0 the -# same as any other whitespace char, which is clearly wrong (it's a -# *non-breaking* space), 2) possibly cause problems with Unicode, -# since 0xa0 is not in range(128). -_whitespace = '\t\n\x0b\x0c\r ' - -class TextWrapper: - """ - Object for wrapping/filling text. The public interface consists of - the wrap() and fill() methods; the other methods are just there for - subclasses to override in order to tweak the default behaviour. - If you want to completely replace the main wrapping algorithm, - you'll probably have to override _wrap_chunks(). - - Several instance attributes control various aspects of wrapping: - width (default: 70) - the maximum width of wrapped lines (unless break_long_words - is false) - initial_indent (default: "") - string that will be prepended to the first line of wrapped - output. Counts towards the line's width. - subsequent_indent (default: "") - string that will be prepended to all lines save the first - of wrapped output; also counts towards each line's width. - expand_tabs (default: true) - Expand tabs in input text to spaces before further processing. - Each tab will become 1 .. 8 spaces, depending on its position in - its line. If false, each tab is treated as a single character. - replace_whitespace (default: true) - Replace all whitespace characters in the input text by spaces - after tab expansion. Note that if expand_tabs is false and - replace_whitespace is true, every tab will be converted to a - single space! - fix_sentence_endings (default: false) - Ensure that sentence-ending punctuation is always followed - by two spaces. Off by default because the algorithm is - (unavoidably) imperfect. - break_long_words (default: true) - Break words longer than 'width'. If false, those words will not - be broken, and some lines might be longer than 'width'. - """ - - whitespace_trans = string.maketrans(_whitespace, ' ' * len(_whitespace)) - - unicode_whitespace_trans = {} - uspace = ord(u' ') - for x in map(ord, _whitespace): - unicode_whitespace_trans[x] = uspace - - # This funky little regex is just the trick for splitting - # text up into word-wrappable chunks. E.g. - # "Hello there -- you goof-ball, use the -b option!" - # splits into - # Hello/ /there/ /--/ /you/ /goof-/ball,/ /use/ /the/ /-b/ /option! - # (after stripping out empty strings). - wordsep_re = re.compile(r'(\s+|' # any whitespace - r'-*\w{2,}-(?=\w{2,})|' # hyphenated words - r'(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))') # em-dash - - # XXX will there be a locale-or-charset-aware version of - # string.lowercase in 2.3? - sentence_end_re = re.compile(r'[%s]' # lowercase letter - r'[\.\!\?]' # sentence-ending punct. - r'[\"\']?' # optional end-of-quote - % string.lowercase) - - - def __init__ (self, - width=70, - initial_indent="", - subsequent_indent="", - expand_tabs=True, - replace_whitespace=True, - fix_sentence_endings=False, - break_long_words=True): - self.width = width - self.initial_indent = initial_indent - self.subsequent_indent = subsequent_indent - self.expand_tabs = expand_tabs - self.replace_whitespace = replace_whitespace - self.fix_sentence_endings = fix_sentence_endings - self.break_long_words = break_long_words - - - # -- Private methods ----------------------------------------------- - # (possibly useful for subclasses to override) - - def _munge_whitespace(self, text): - """_munge_whitespace(text : string) -> string - - Munge whitespace in text: expand tabs and convert all other - whitespace characters to spaces. Eg. " foo\tbar\n\nbaz" - becomes " foo bar baz". - """ - if self.expand_tabs: - text = text.expandtabs() - if self.replace_whitespace: - if isinstance(text, str): - text = text.translate(self.whitespace_trans) - elif isinstance(text, unicode): - text = text.translate(self.unicode_whitespace_trans) - return text - - - def _split(self, text): - """_split(text : string) -> [string] - - Split the text to wrap into indivisible chunks. Chunks are - not quite the same as words; see wrap_chunks() for full - details. As an example, the text - Look, goof-ball -- use the -b option! - breaks into the following chunks: - 'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ', - 'use', ' ', 'the', ' ', '-b', ' ', 'option!' - """ - chunks = self.wordsep_re.split(text) - chunks = filter(None, chunks) - return chunks - - def _fix_sentence_endings(self, chunks): - """_fix_sentence_endings(chunks : [string]) - - Correct for sentence endings buried in 'chunks'. Eg. when the - original text contains "... foo.\nBar ...", munge_whitespace() - and split() will convert that to [..., "foo.", " ", "Bar", ...] - which has one too few spaces; this method simply changes the one - space to two. - """ - i = 0 - pat = self.sentence_end_re - while i < len(chunks)-1: - if chunks[i+1] == " " and pat.search(chunks[i]): - chunks[i+1] = " " - i += 2 - else: - i += 1 - - def _handle_long_word(self, chunks, cur_line, cur_len, width): - """_handle_long_word(chunks : [string], - cur_line : [string], - cur_len : int, width : int) - - Handle a chunk of text (most likely a word, not whitespace) that - is too long to fit in any line. - """ - space_left = width - cur_len - - # If we're allowed to break long words, then do so: put as much - # of the next chunk onto the current line as will fit. - if self.break_long_words: - cur_line.append(chunks[0][0:space_left]) - chunks[0] = chunks[0][space_left:] - - # Otherwise, we have to preserve the long word intact. Only add - # it to the current line if there's nothing already there -- - # that minimizes how much we violate the width constraint. - elif not cur_line: - cur_line.append(chunks.pop(0)) - - # If we're not allowed to break long words, and there's already - # text on the current line, do nothing. Next time through the - # main loop of _wrap_chunks(), we'll wind up here again, but - # cur_len will be zero, so the next line will be entirely - # devoted to the long word that we can't handle right now. - - def _wrap_chunks(self, chunks): - """_wrap_chunks(chunks : [string]) -> [string] - - Wrap a sequence of text chunks and return a list of lines of - length 'self.width' or less. (If 'break_long_words' is false, - some lines may be longer than this.) Chunks correspond roughly - to words and the whitespace between them: each chunk is - indivisible (modulo 'break_long_words'), but a line break can - come between any two chunks. Chunks should not have internal - whitespace; ie. a chunk is either all whitespace or a "word". - Whitespace chunks will be removed from the beginning and end of - lines, but apart from that whitespace is preserved. - """ - lines = [] - if self.width <= 0: - raise ValueError("invalid width %r (must be > 0)" % self.width) - - while chunks: - - # Start the list of chunks that will make up the current line. - # cur_len is just the length of all the chunks in cur_line. - cur_line = [] - cur_len = 0 - - # Figure out which static string will prefix this line. - if lines: - indent = self.subsequent_indent - else: - indent = self.initial_indent - - # Maximum width for this line. - width = self.width - len(indent) - - # First chunk on line is whitespace -- drop it, unless this - # is the very beginning of the text (ie. no lines started yet). - if chunks[0].strip() == '' and lines: - del chunks[0] - - while chunks: - l = len(chunks[0]) - - # Can at least squeeze this chunk onto the current line. - if cur_len + l <= width: - cur_line.append(chunks.pop(0)) - cur_len += l - - # Nope, this line is full. - else: - break - - # The current line is full, and the next chunk is too big to - # fit on *any* line (not just this one). - if chunks and len(chunks[0]) > width: - self._handle_long_word(chunks, cur_line, cur_len, width) - - # If the last chunk on this line is all whitespace, drop it. - if cur_line and cur_line[-1].strip() == '': - del cur_line[-1] - - # Convert current line back to a string and store it in list - # of all lines (return value). - if cur_line: - lines.append(indent + ''.join(cur_line)) - - return lines - - - # -- Public interface ---------------------------------------------- - - def wrap(self, text): - """wrap(text : string) -> [string] - - Reformat the single paragraph in 'text' so it fits in lines of - no more than 'self.width' columns, and return a list of wrapped - lines. Tabs in 'text' are expanded with string.expandtabs(), - and all other whitespace characters (including newline) are - converted to space. - """ - text = self._munge_whitespace(text) - indent = self.initial_indent - if len(text) + len(indent) <= self.width: - return [indent + text] - chunks = self._split(text) - if self.fix_sentence_endings: - self._fix_sentence_endings(chunks) - return self._wrap_chunks(chunks) - - def fill(self, text): - """fill(text : string) -> string - - Reformat the single paragraph in 'text' to fit in lines of no - more than 'self.width' columns, and return a new string - containing the entire wrapped paragraph. - """ - return "\n".join(self.wrap(text)) - - -# -- Convenience interface --------------------------------------------- - -def wrap(text, width=70, **kwargs): - """Wrap a single paragraph of text, returning a list of wrapped lines. - - Reformat the single paragraph in 'text' so it fits in lines of no - more than 'width' columns, and return a list of wrapped lines. By - default, tabs in 'text' are expanded with string.expandtabs(), and - all other whitespace characters (including newline) are converted to - space. See TextWrapper class for available keyword args to customize - wrapping behaviour. - """ - w = TextWrapper(width=width, **kwargs) - return w.wrap(text) - -def fill(text, width=70, **kwargs): - """Fill a single paragraph of text, returning a new string. - - Reformat the single paragraph in 'text' to fit in lines of no more - than 'width' columns, and return a new string containing the entire - wrapped paragraph. As with wrap(), tabs are expanded and other - whitespace characters converted to space. See TextWrapper class for - available keyword args to customize wrapping behaviour. - """ - w = TextWrapper(width=width, **kwargs) - return w.fill(text) - - -# -- Loosely related functionality ------------------------------------- - -def dedent(text): - """dedent(text : string) -> string - - Remove any whitespace than can be uniformly removed from the left - of every line in `text`. - - This can be used e.g. to make triple-quoted strings line up with - the left edge of screen/whatever, while still presenting it in the - source code in indented form. - - For example: - - def test(): - # end first line with \ to avoid the empty line! - s = '''\ - hello - world - ''' - print repr(s) # prints ' hello\n world\n ' - print repr(dedent(s)) # prints 'hello\n world\n' - """ - lines = text.expandtabs().split('\n') - margin = None - for line in lines: - content = line.lstrip() - if not content: - continue - indent = len(line) - len(content) - if margin is None: - margin = indent - else: - margin = min(margin, indent) - - if margin is not None and margin > 0: - for i in range(len(lines)): - lines[i] = lines[i][margin:] - - return '\n'.join(lines) diff --git a/docutils/install.py b/docutils/install.py deleted file mode 100755 index ef3020b67..000000000 --- a/docutils/install.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python -# $Id$ -# Copyright: This file has been placed in the public domain. - -""" -This is a quick & dirty installation shortcut. It is equivalent to the -command:: - - python setup.py install - -However, the shortcut lacks error checking! -""" - -from distutils import core -from setup import do_setup - -if __name__ == '__main__' : - core._setup_stop_after = 'config' - dist = do_setup() - dist.commands = ['install'] - dist.run_commands() diff --git a/docutils/licenses/gpl.txt b/docutils/licenses/gpl.txt deleted file mode 100644 index 5b6e7c66c..000000000 --- a/docutils/licenses/gpl.txt +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/docutils/licenses/python-2-1-1.txt b/docutils/licenses/python-2-1-1.txt deleted file mode 100644 index 7664787d1..000000000 --- a/docutils/licenses/python-2-1-1.txt +++ /dev/null @@ -1,232 +0,0 @@ -A. HISTORY OF THE SOFTWARE -========================== - -Python was created in the early 1990s by Guido van Rossum at Stichting -Mathematisch Centrum (CWI) in the Netherlands as a successor of a -language called ABC. Guido is Python's principal author, although it -includes many contributions from others. The last version released -from CWI was Python 1.2. In 1995, Guido continued his work on Python -at the Corporation for National Research Initiatives (CNRI) in Reston, -Virginia where he released several versions of the software. Python -1.6 was the last of the versions released by CNRI. In 2000, Guido and -the Python core development team moved to BeOpen.com to form the -BeOpen PythonLabs team. Python 2.0 was the first and only release -from BeOpen.com. - -Following the release of Python 1.6, and after Guido van Rossum left -CNRI to work with commercial software developers, it became clear that -the ability to use Python with software available under the GNU Public -License (GPL) was very desirable. CNRI and the Free Software -Foundation (FSF) interacted to develop enabling wording changes to the -Python license. Python 1.6.1 is essentially the same as Python 1.6, -with a few minor bug fixes, and with a different license that enables -later versions to be GPL-compatible. Python 2.1 is a derivative work -of Python 1.6.1, as well as of Python 2.0. - -After Python 2.0 was released by BeOpen.com, Guido van Rossum and the -other PythonLabs developers joined Digital Creations. All -intellectual property added from this point on, starting with Python -2.1 and its alpha and beta releases, is owned by the Python Software -Foundation (PSF), a non-profit modeled after the Apache Software -Foundation. See http://www.python.org/psf/ for more information about -the PSF. - -Thanks to the many outside volunteers who have worked under Guido's -direction to make these releases possible. - - -B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON -=============================================================== - -PSF LICENSE AGREEMENT ---------------------- - -1. This LICENSE AGREEMENT is between the Python Software Foundation -("PSF"), and the Individual or Organization ("Licensee") accessing and -otherwise using Python 2.1.1 software in source or binary form and its -associated documentation. - -2. Subject to the terms and conditions of this License Agreement, PSF -hereby grants Licensee a nonexclusive, royalty-free, world-wide -license to reproduce, analyze, test, perform and/or display publicly, -prepare derivative works, distribute, and otherwise use Python 2.1.1 -alone or in any derivative version, provided, however, that PSF's -License Agreement and PSF's notice of copyright, i.e., "Copyright (c) -2001 Python Software Foundation; All Rights Reserved" are retained in -Python 2.1.1 alone or in any derivative version prepared by Licensee. - -3. In the event Licensee prepares a derivative work that is based on -or incorporates Python 2.1.1 or any part thereof, and wants to make -the derivative work available to others as provided herein, then -Licensee hereby agrees to include in any such work a brief summary of -the changes made to Python 2.1.1. - -4. PSF is making Python 2.1.1 available to Licensee on an "AS IS" -basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR -IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND -DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS -FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 2.1.1 WILL NOT -INFRINGE ANY THIRD PARTY RIGHTS. - -5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON -2.1.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS -A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 2.1.1, -OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - -6. This License Agreement will automatically terminate upon a material -breach of its terms and conditions. - -7. Nothing in this License Agreement shall be deemed to create any -relationship of agency, partnership, or joint venture between PSF and -Licensee. This License Agreement does not grant permission to use PSF -trademarks or trade name in a trademark sense to endorse or promote -products or services of Licensee, or any third party. - -8. By copying, installing or otherwise using Python 2.1.1, Licensee -agrees to be bound by the terms and conditions of this License -Agreement. - - -BEOPEN.COM TERMS AND CONDITIONS FOR PYTHON 2.0 ----------------------------------------------- - -BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 - -1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an -office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the -Individual or Organization ("Licensee") accessing and otherwise using -this software in source or binary form and its associated -documentation ("the Software"). - -2. Subject to the terms and conditions of this BeOpen Python License -Agreement, BeOpen hereby grants Licensee a non-exclusive, -royalty-free, world-wide license to reproduce, analyze, test, perform -and/or display publicly, prepare derivative works, distribute, and -otherwise use the Software alone or in any derivative version, -provided, however, that the BeOpen Python License is retained in the -Software, alone or in any derivative version prepared by Licensee. - -3. BeOpen is making the Software available to Licensee on an "AS IS" -basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR -IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND -DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS -FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT -INFRINGE ANY THIRD PARTY RIGHTS. - -4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE -SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS -AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY -DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - -5. This License Agreement will automatically terminate upon a material -breach of its terms and conditions. - -6. This License Agreement shall be governed by and interpreted in all -respects by the law of the State of California, excluding conflict of -law provisions. Nothing in this License Agreement shall be deemed to -create any relationship of agency, partnership, or joint venture -between BeOpen and Licensee. This License Agreement does not grant -permission to use BeOpen trademarks or trade names in a trademark -sense to endorse or promote products or services of Licensee, or any -third party. As an exception, the "BeOpen Python" logos available at -http://www.pythonlabs.com/logos.html may be used according to the -permissions granted on that web page. - -7. By copying, installing or otherwise using the software, Licensee -agrees to be bound by the terms and conditions of this License -Agreement. - - -CNRI OPEN SOURCE GPL-COMPATIBLE LICENSE AGREEMENT -------------------------------------------------- - -1. This LICENSE AGREEMENT is between the Corporation for National -Research Initiatives, having an office at 1895 Preston White Drive, -Reston, VA 20191 ("CNRI"), and the Individual or Organization -("Licensee") accessing and otherwise using Python 1.6.1 software in -source or binary form and its associated documentation. - -2. Subject to the terms and conditions of this License Agreement, CNRI -hereby grants Licensee a nonexclusive, royalty-free, world-wide -license to reproduce, analyze, test, perform and/or display publicly, -prepare derivative works, distribute, and otherwise use Python 1.6.1 -alone or in any derivative version, provided, however, that CNRI's -License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) -1995-2001 Corporation for National Research Initiatives; All Rights -Reserved" are retained in Python 1.6.1 alone or in any derivative -version prepared by Licensee. Alternately, in lieu of CNRI's License -Agreement, Licensee may substitute the following text (omitting the -quotes): "Python 1.6.1 is made available subject to the terms and -conditions in CNRI's License Agreement. This Agreement together with -Python 1.6.1 may be located on the Internet using the following -unique, persistent identifier (known as a handle): 1895.22/1013. This -Agreement may also be obtained from a proxy server on the Internet -using the following URL: http://hdl.handle.net/1895.22/1013". - -3. In the event Licensee prepares a derivative work that is based on -or incorporates Python 1.6.1 or any part thereof, and wants to make -the derivative work available to others as provided herein, then -Licensee hereby agrees to include in any such work a brief summary of -the changes made to Python 1.6.1. - -4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" -basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR -IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND -DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS -FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT -INFRINGE ANY THIRD PARTY RIGHTS. - -5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON -1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS -A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, -OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - -6. This License Agreement will automatically terminate upon a material -breach of its terms and conditions. - -7. This License Agreement shall be governed by the federal -intellectual property law of the United States, including without -limitation the federal copyright law, and, to the extent such -U.S. federal law does not apply, by the law of the Commonwealth of -Virginia, excluding Virginia's conflict of law provisions. -Notwithstanding the foregoing, with regard to derivative works based -on Python 1.6.1 that incorporate non-separable material that was -previously distributed under the GNU General Public License (GPL), the -law of the Commonwealth of Virginia shall govern this License -Agreement only as to issues arising under or with respect to -Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this -License Agreement shall be deemed to create any relationship of -agency, partnership, or joint venture between CNRI and Licensee. This -License Agreement does not grant permission to use CNRI trademarks or -trade name in a trademark sense to endorse or promote products or -services of Licensee, or any third party. - -8. By clicking on the "ACCEPT" button where indicated, or by copying, -installing or otherwise using Python 1.6.1, Licensee agrees to be -bound by the terms and conditions of this License Agreement. - - ACCEPT - - -CWI PERMISSIONS STATEMENT AND DISCLAIMER ----------------------------------------- - -Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, -The Netherlands. All rights reserved. - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Stichting Mathematisch -Centrum or CWI not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO -THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE -FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/docutils/licenses/python-2-2.txt b/docutils/licenses/python-2-2.txt deleted file mode 100644 index f7c869124..000000000 --- a/docutils/licenses/python-2-2.txt +++ /dev/null @@ -1,246 +0,0 @@ -A. HISTORY OF THE SOFTWARE -========================== - -Python was created in the early 1990s by Guido van Rossum at Stichting -Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands -as a successor of a language called ABC. Guido remains Python's -principal author, although it includes many contributions from others. - -In 1995, Guido continued his work on Python at the Corporation for -National Research Initiatives (CNRI, see http://www.cnri.reston.va.us) -in Reston, Virginia where he released several versions of the -software. - -In May 2000, Guido and the Python core development team moved to -BeOpen.com to form the BeOpen PythonLabs team. In October of the same -year, the PythonLabs team moved to Digital Creations (see -http://www.digicool.com). In 2001, the Python Software Foundation -(PSF, see http://www.python.org/psf/) was formed, a non-profit -organization created specifically to own Python-related Intellectual -Property. Digital Creations is a sponsoring member of the PSF. - -All Python releases are Open Source (see http://www.opensource.org for -the Open Source Definition). Historically, most, but not all, Python -releases have also been GPL-compatible; the table below summarizes -the various releases. - - Release Derived Year Owner GPL- - from compatible? (1) - - 0.9.0 thru 1.2 1991-1995 CWI yes - 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes - 1.6 1.5.2 2000 CNRI no - 2.0 1.6 2000 BeOpen.com no - 1.6.1 1.6 2001 CNRI no - 2.1 2.0+1.6.1 2001 PSF no - 2.0.1 2.0+1.6.1 2001 PSF yes - 2.1.1 2.1+2.0.1 2001 PSF yes - 2.2 2.1.1 2001 PSF yes - -Footnotes: - -(1) GPL-compatible doesn't mean that we're distributing Python under - the GPL. All Python licenses, unlike the GPL, let you distribute - a modified version without making your changes open source. The - GPL-compatible licenses make it possible to combine Python with - other software that is released under the GPL; the others don't. - -Thanks to the many outside volunteers who have worked under Guido's -direction to make these releases possible. - - -B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON -=============================================================== - -PSF LICENSE AGREEMENT FOR PYTHON 2.2 ------------------------------------- - -1. This LICENSE AGREEMENT is between the Python Software Foundation -("PSF"), and the Individual or Organization ("Licensee") accessing and -otherwise using Python 2.2 software in source or binary form and its -associated documentation. - -2. Subject to the terms and conditions of this License Agreement, PSF -hereby grants Licensee a nonexclusive, royalty-free, world-wide -license to reproduce, analyze, test, perform and/or display publicly, -prepare derivative works, distribute, and otherwise use Python 2.2 -alone or in any derivative version, provided, however, that PSF's -License Agreement and PSF's notice of copyright, i.e., "Copyright (c) -2001 Python Software Foundation; All Rights Reserved" are retained in -Python 2.2 alone or in any derivative version prepared by Licensee. - -3. In the event Licensee prepares a derivative work that is based on -or incorporates Python 2.2 or any part thereof, and wants to make -the derivative work available to others as provided herein, then -Licensee hereby agrees to include in any such work a brief summary of -the changes made to Python 2.2. - -4. PSF is making Python 2.2 available to Licensee on an "AS IS" -basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR -IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND -DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS -FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 2.2 WILL NOT -INFRINGE ANY THIRD PARTY RIGHTS. - -5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON -2.2 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS -A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 2.2, -OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - -6. This License Agreement will automatically terminate upon a material -breach of its terms and conditions. - -7. Nothing in this License Agreement shall be deemed to create any -relationship of agency, partnership, or joint venture between PSF and -Licensee. This License Agreement does not grant permission to use PSF -trademarks or trade name in a trademark sense to endorse or promote -products or services of Licensee, or any third party. - -8. By copying, installing or otherwise using Python 2.2, Licensee -agrees to be bound by the terms and conditions of this License -Agreement. - - -BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 -------------------------------------------- - -BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 - -1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an -office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the -Individual or Organization ("Licensee") accessing and otherwise using -this software in source or binary form and its associated -documentation ("the Software"). - -2. Subject to the terms and conditions of this BeOpen Python License -Agreement, BeOpen hereby grants Licensee a non-exclusive, -royalty-free, world-wide license to reproduce, analyze, test, perform -and/or display publicly, prepare derivative works, distribute, and -otherwise use the Software alone or in any derivative version, -provided, however, that the BeOpen Python License is retained in the -Software, alone or in any derivative version prepared by Licensee. - -3. BeOpen is making the Software available to Licensee on an "AS IS" -basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR -IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND -DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS -FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT -INFRINGE ANY THIRD PARTY RIGHTS. - -4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE -SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS -AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY -DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - -5. This License Agreement will automatically terminate upon a material -breach of its terms and conditions. - -6. This License Agreement shall be governed by and interpreted in all -respects by the law of the State of California, excluding conflict of -law provisions. Nothing in this License Agreement shall be deemed to -create any relationship of agency, partnership, or joint venture -between BeOpen and Licensee. This License Agreement does not grant -permission to use BeOpen trademarks or trade names in a trademark -sense to endorse or promote products or services of Licensee, or any -third party. As an exception, the "BeOpen Python" logos available at -http://www.pythonlabs.com/logos.html may be used according to the -permissions granted on that web page. - -7. By copying, installing or otherwise using the software, Licensee -agrees to be bound by the terms and conditions of this License -Agreement. - - -CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 ---------------------------------------- - -1. This LICENSE AGREEMENT is between the Corporation for National -Research Initiatives, having an office at 1895 Preston White Drive, -Reston, VA 20191 ("CNRI"), and the Individual or Organization -("Licensee") accessing and otherwise using Python 1.6.1 software in -source or binary form and its associated documentation. - -2. Subject to the terms and conditions of this License Agreement, CNRI -hereby grants Licensee a nonexclusive, royalty-free, world-wide -license to reproduce, analyze, test, perform and/or display publicly, -prepare derivative works, distribute, and otherwise use Python 1.6.1 -alone or in any derivative version, provided, however, that CNRI's -License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) -1995-2001 Corporation for National Research Initiatives; All Rights -Reserved" are retained in Python 1.6.1 alone or in any derivative -version prepared by Licensee. Alternately, in lieu of CNRI's License -Agreement, Licensee may substitute the following text (omitting the -quotes): "Python 1.6.1 is made available subject to the terms and -conditions in CNRI's License Agreement. This Agreement together with -Python 1.6.1 may be located on the Internet using the following -unique, persistent identifier (known as a handle): 1895.22/1013. This -Agreement may also be obtained from a proxy server on the Internet -using the following URL: http://hdl.handle.net/1895.22/1013". - -3. In the event Licensee prepares a derivative work that is based on -or incorporates Python 1.6.1 or any part thereof, and wants to make -the derivative work available to others as provided herein, then -Licensee hereby agrees to include in any such work a brief summary of -the changes made to Python 1.6.1. - -4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" -basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR -IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND -DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS -FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT -INFRINGE ANY THIRD PARTY RIGHTS. - -5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON -1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS -A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, -OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - -6. This License Agreement will automatically terminate upon a material -breach of its terms and conditions. - -7. This License Agreement shall be governed by the federal -intellectual property law of the United States, including without -limitation the federal copyright law, and, to the extent such -U.S. federal law does not apply, by the law of the Commonwealth of -Virginia, excluding Virginia's conflict of law provisions. -Notwithstanding the foregoing, with regard to derivative works based -on Python 1.6.1 that incorporate non-separable material that was -previously distributed under the GNU General Public License (GPL), the -law of the Commonwealth of Virginia shall govern this License -Agreement only as to issues arising under or with respect to -Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this -License Agreement shall be deemed to create any relationship of -agency, partnership, or joint venture between CNRI and Licensee. This -License Agreement does not grant permission to use CNRI trademarks or -trade name in a trademark sense to endorse or promote products or -services of Licensee, or any third party. - -8. By clicking on the "ACCEPT" button where indicated, or by copying, -installing or otherwise using Python 1.6.1, Licensee agrees to be -bound by the terms and conditions of this License Agreement. - - ACCEPT - - -CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 --------------------------------------------------- - -Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, -The Netherlands. All rights reserved. - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Stichting Mathematisch -Centrum or CWI not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO -THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE -FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/docutils/licenses/python-2-3.txt b/docutils/licenses/python-2-3.txt deleted file mode 100644 index d33d9b08a..000000000 --- a/docutils/licenses/python-2-3.txt +++ /dev/null @@ -1,253 +0,0 @@ -A. HISTORY OF THE SOFTWARE -========================== - -Python was created in the early 1990s by Guido van Rossum at Stichting -Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands -as a successor of a language called ABC. Guido remains Python's -principal author, although it includes many contributions from others. - -In 1995, Guido continued his work on Python at the Corporation for -National Research Initiatives (CNRI, see http://www.cnri.reston.va.us) -in Reston, Virginia where he released several versions of the -software. - -In May 2000, Guido and the Python core development team moved to -BeOpen.com to form the BeOpen PythonLabs team. In October of the same -year, the PythonLabs team moved to Digital Creations (now Zope -Corporation, see http://www.zope.com). In 2001, the Python Software -Foundation (PSF, see http://www.python.org/psf/) was formed, a -non-profit organization created specifically to own Python-related -Intellectual Property. Zope Corporation is a sponsoring member of -the PSF. - -All Python releases are Open Source (see http://www.opensource.org for -the Open Source Definition). Historically, most, but not all, Python -releases have also been GPL-compatible; the table below summarizes -the various releases. - - Release Derived Year Owner GPL- - from compatible? (1) - - 0.9.0 thru 1.2 1991-1995 CWI yes - 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes - 1.6 1.5.2 2000 CNRI no - 2.0 1.6 2000 BeOpen.com no - 1.6.1 1.6 2001 CNRI no - 2.1 2.0+1.6.1 2001 PSF no - 2.0.1 2.0+1.6.1 2001 PSF yes - 2.1.1 2.1+2.0.1 2001 PSF yes - 2.2 2.1.1 2001 PSF yes - 2.1.2 2.1.1 2002 PSF yes - 2.1.3 2.1.2 2002 PSF yes - 2.2.1 2.2 2002 PSF yes - 2.2.2 2.2.1 2002 PSF yes - 2.3 2.2.2 2002-2003 PSF yes - -Footnotes: - -(1) GPL-compatible doesn't mean that we're distributing Python under - the GPL. All Python licenses, unlike the GPL, let you distribute - a modified version without making your changes open source. The - GPL-compatible licenses make it possible to combine Python with - other software that is released under the GPL; the others don't. - -Thanks to the many outside volunteers who have worked under Guido's -direction to make these releases possible. - - -B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON -=============================================================== - -PSF LICENSE AGREEMENT FOR PYTHON 2.3 --------------------------------------- - -1. This LICENSE AGREEMENT is between the Python Software Foundation -("PSF"), and the Individual or Organization ("Licensee") accessing and -otherwise using Python 2.3 software in source or binary form and its -associated documentation. - -2. Subject to the terms and conditions of this License Agreement, PSF -hereby grants Licensee a nonexclusive, royalty-free, world-wide -license to reproduce, analyze, test, perform and/or display publicly, -prepare derivative works, distribute, and otherwise use Python 2.3 -alone or in any derivative version, provided, however, that PSF's -License Agreement and PSF's notice of copyright, i.e., "Copyright (c) -2001, 2002, 2003 Python Software Foundation; All Rights Reserved" are -retained in Python 2.3 alone or in any derivative version prepared by -Licensee. - -3. In the event Licensee prepares a derivative work that is based on -or incorporates Python 2.3 or any part thereof, and wants to make -the derivative work available to others as provided herein, then -Licensee hereby agrees to include in any such work a brief summary of -the changes made to Python 2.3. - -4. PSF is making Python 2.3 available to Licensee on an "AS IS" -basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR -IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND -DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS -FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 2.3 WILL NOT -INFRINGE ANY THIRD PARTY RIGHTS. - -5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON -2.3 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS -A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 2.3, -OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - -6. This License Agreement will automatically terminate upon a material -breach of its terms and conditions. - -7. Nothing in this License Agreement shall be deemed to create any -relationship of agency, partnership, or joint venture between PSF and -Licensee. This License Agreement does not grant permission to use PSF -trademarks or trade name in a trademark sense to endorse or promote -products or services of Licensee, or any third party. - -8. By copying, installing or otherwise using Python 2.3, Licensee -agrees to be bound by the terms and conditions of this License -Agreement. - - -BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 -------------------------------------------- - -BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 - -1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an -office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the -Individual or Organization ("Licensee") accessing and otherwise using -this software in source or binary form and its associated -documentation ("the Software"). - -2. Subject to the terms and conditions of this BeOpen Python License -Agreement, BeOpen hereby grants Licensee a non-exclusive, -royalty-free, world-wide license to reproduce, analyze, test, perform -and/or display publicly, prepare derivative works, distribute, and -otherwise use the Software alone or in any derivative version, -provided, however, that the BeOpen Python License is retained in the -Software, alone or in any derivative version prepared by Licensee. - -3. BeOpen is making the Software available to Licensee on an "AS IS" -basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR -IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND -DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS -FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT -INFRINGE ANY THIRD PARTY RIGHTS. - -4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE -SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS -AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY -DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - -5. This License Agreement will automatically terminate upon a material -breach of its terms and conditions. - -6. This License Agreement shall be governed by and interpreted in all -respects by the law of the State of California, excluding conflict of -law provisions. Nothing in this License Agreement shall be deemed to -create any relationship of agency, partnership, or joint venture -between BeOpen and Licensee. This License Agreement does not grant -permission to use BeOpen trademarks or trade names in a trademark -sense to endorse or promote products or services of Licensee, or any -third party. As an exception, the "BeOpen Python" logos available at -http://www.pythonlabs.com/logos.html may be used according to the -permissions granted on that web page. - -7. By copying, installing or otherwise using the software, Licensee -agrees to be bound by the terms and conditions of this License -Agreement. - - -CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 ---------------------------------------- - -1. This LICENSE AGREEMENT is between the Corporation for National -Research Initiatives, having an office at 1895 Preston White Drive, -Reston, VA 20191 ("CNRI"), and the Individual or Organization -("Licensee") accessing and otherwise using Python 1.6.1 software in -source or binary form and its associated documentation. - -2. Subject to the terms and conditions of this License Agreement, CNRI -hereby grants Licensee a nonexclusive, royalty-free, world-wide -license to reproduce, analyze, test, perform and/or display publicly, -prepare derivative works, distribute, and otherwise use Python 1.6.1 -alone or in any derivative version, provided, however, that CNRI's -License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) -1995-2001 Corporation for National Research Initiatives; All Rights -Reserved" are retained in Python 1.6.1 alone or in any derivative -version prepared by Licensee. Alternately, in lieu of CNRI's License -Agreement, Licensee may substitute the following text (omitting the -quotes): "Python 1.6.1 is made available subject to the terms and -conditions in CNRI's License Agreement. This Agreement together with -Python 1.6.1 may be located on the Internet using the following -unique, persistent identifier (known as a handle): 1895.22/1013. This -Agreement may also be obtained from a proxy server on the Internet -using the following URL: http://hdl.handle.net/1895.22/1013". - -3. In the event Licensee prepares a derivative work that is based on -or incorporates Python 1.6.1 or any part thereof, and wants to make -the derivative work available to others as provided herein, then -Licensee hereby agrees to include in any such work a brief summary of -the changes made to Python 1.6.1. - -4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" -basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR -IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND -DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS -FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT -INFRINGE ANY THIRD PARTY RIGHTS. - -5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON -1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS -A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, -OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - -6. This License Agreement will automatically terminate upon a material -breach of its terms and conditions. - -7. This License Agreement shall be governed by the federal -intellectual property law of the United States, including without -limitation the federal copyright law, and, to the extent such -U.S. federal law does not apply, by the law of the Commonwealth of -Virginia, excluding Virginia's conflict of law provisions. -Notwithstanding the foregoing, with regard to derivative works based -on Python 1.6.1 that incorporate non-separable material that was -previously distributed under the GNU General Public License (GPL), the -law of the Commonwealth of Virginia shall govern this License -Agreement only as to issues arising under or with respect to -Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this -License Agreement shall be deemed to create any relationship of -agency, partnership, or joint venture between CNRI and Licensee. This -License Agreement does not grant permission to use CNRI trademarks or -trade name in a trademark sense to endorse or promote products or -services of Licensee, or any third party. - -8. By clicking on the "ACCEPT" button where indicated, or by copying, -installing or otherwise using Python 1.6.1, Licensee agrees to be -bound by the terms and conditions of this License Agreement. - - ACCEPT - - -CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 --------------------------------------------------- - -Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, -The Netherlands. All rights reserved. - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Stichting Mathematisch -Centrum or CWI not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO -THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE -FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/docutils/setup.py b/docutils/setup.py deleted file mode 100755 index 34c8680de..000000000 --- a/docutils/setup.py +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env python -# $Id$ -# Copyright: This file has been placed in the public domain. - -import sys -import os -from distutils.core import setup -from distutils.command.build_py import build_py - - -def do_setup(): - kwargs = package_data.copy() - extras = get_extras() - if extras: - kwargs['py_modules'] = extras - if sys.hexversion >= 0x02030000: # Python 2.3 - kwargs['classifiers'] = classifiers - else: - kwargs['cmdclass'] = {'build_py': dual_build_py} - dist = setup(**kwargs) - return dist - -package_data = { - 'name': 'docutils', - 'description': 'Docutils -- Python Documentation Utilities', - 'long_description': """\ -Docutils is a modular system for processing documentation -into useful formats, such as HTML, XML, and TeX. For input -Docutils supports reStructuredText, an easy-to-read, -what-you-see-is-what-you-get plaintext markup syntax.""", # wrap at col 60 - 'url': 'http://docutils.sourceforge.net/', - 'version': '0.3+', - 'author': 'David Goodger', - 'author_email': 'goodger@users.sourceforge.net', - 'license': 'public domain, Python, BSD, GPL (see COPYING.txt)', - 'platforms': 'OS-independent', - 'package_dir': {'docutils': 'docutils', '': 'extras'}, - 'packages': ['docutils', 'docutils.languages', - 'docutils.parsers', 'docutils.parsers.rst', - 'docutils.parsers.rst.directives', - 'docutils.parsers.rst.languages', - 'docutils.readers', 'docutils.readers.python', - 'docutils.transforms', - 'docutils.writers',],} -"""Distutils setup parameters.""" - -classifiers = [ - 'Development Status :: 3 - Alpha', - 'Environment :: Console', - 'Intended Audience :: End Users/Desktop', - 'Intended Audience :: Other Audience', - 'Intended Audience :: Developers', - 'Intended Audience :: System Administrators', - 'License :: Public Domain', - 'License :: OSI Approved :: Python Software Foundation License', - 'License :: OSI Approved :: BSD License', - 'License :: OSI Approved :: GNU General Public License (GPL)', - 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Topic :: Documentation', - 'Topic :: Software Development :: Documentation', - 'Topic :: Text Processing', - 'Natural Language :: English', # main/default language, keep first - 'Natural Language :: Afrikaans', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Italian', - 'Natural Language :: Russian', - 'Natural Language :: Slovak', - 'Natural Language :: Spanish', - 'Natural Language :: Swedish',] -"""Trove classifiers for the Distutils "register" command; -Python 2.3 and up.""" - -extra_modules = [('optparse', '1.4.1', None), - ('textwrap', None, None), - ('roman', '1.4', ['toRoman', 'fromRoman', - 'InvalidRomanNumeralError'])] -"""Third-party modules to install if they're not already present. -List of (module name, minimum __version__ string, [attribute names]).""" - -def get_extras(): - extras = [] - for module_name, version, attributes in extra_modules: - try: - module = __import__(module_name) - if version and module.__version__ < version: - raise ValueError - for attribute in attributes or []: - getattr(module, attribute) - print ('"%s" module already present; ignoring extras/%s.py.' - % (module_name, module_name)) - except (ImportError, AttributeError, ValueError): - extras.append(module_name) - return extras - - -class dual_build_py(build_py): - - """ - This class allows the distribution of both packages *and* modules with one - call to `distutils.core.setup()` (necessary for pre-2.3 Python). Thanks - to Thomas Heller. - """ - - def run(self): - if not self.py_modules and not self.packages: - return - if self.py_modules: - self.build_modules() - if self.packages: - self.build_packages() - self.byte_compile(self.get_outputs(include_bytecode=0)) - - -if __name__ == '__main__' : - do_setup() diff --git a/docutils/test/.cvsignore b/docutils/test/.cvsignore deleted file mode 100644 index b8af75aec..000000000 --- a/docutils/test/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -*.pyc -alltests.out diff --git a/docutils/test/DocutilsTestSupport.py b/docutils/test/DocutilsTestSupport.py deleted file mode 100644 index ebfc218f6..000000000 --- a/docutils/test/DocutilsTestSupport.py +++ /dev/null @@ -1,611 +0,0 @@ -# Authors: David Goodger; Garth Kidd -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Exports the following: - -:Modules: - - `statemachine` is 'docutils.statemachine' - - `nodes` is 'docutils.nodes' - - `urischemes` is 'docutils.urischemes' - - `utils` is 'docutils.utils' - - `transforms` is 'docutils.transforms' - - `states` is 'docutils.parsers.rst.states' - - `tableparser` is 'docutils.parsers.rst.tableparser' - -:Classes: - - `CustomTestSuite` - - `CustomTestCase` - - `TransformTestSuite` - - `TransformTestCase` - - `ParserTestSuite` - - `ParserTestCase` - - `PEPParserTestSuite` - - `PEPParserTestCase` - - `GridTableParserTestSuite` - - `GridTableParserTestCase` - - `SimpleTableParserTestSuite` - - `SimpleTableParserTestCase` - - 'LatexPublishTestSuite' - - 'LatexPublishTestCase' - - `DevNull` (output sink) -""" -__docformat__ = 'reStructuredText' - -import sys -import os -import unittest -import difflib -import inspect -from pprint import pformat -from types import UnicodeType -import package_unittest -import docutils -import docutils.core -from docutils import frontend, nodes, statemachine, urischemes, utils -from docutils.transforms import universal -from docutils.parsers import rst -from docutils.parsers.rst import states, tableparser, directives, languages -from docutils.readers import standalone, pep, python -from docutils.statemachine import string2lines - -try: - from docutils.readers.python import moduleparser -except: - moduleparser = None - -try: - import mypdb as pdb -except: - import pdb - - - -class DevNull: - - """Output sink.""" - - def write(self, string): - pass - - -class CustomTestSuite(unittest.TestSuite): - - """ - A collection of custom TestCases. - - """ - - id = '' - """Identifier for the TestSuite. Prepended to the - TestCase identifiers to make identification easier.""" - - next_test_case_id = 0 - """The next identifier to use for non-identified test cases.""" - - def __init__(self, tests=(), id=None): - """ - Initialize the CustomTestSuite. - - Arguments: - - id -- identifier for the suite, prepended to test cases. - """ - unittest.TestSuite.__init__(self, tests) - if id is None: - mypath = os.path.abspath( - sys.modules[CustomTestSuite.__module__].__file__) - outerframes = inspect.getouterframes(inspect.currentframe()) - for outerframe in outerframes[1:]: - if outerframe[3] != '__init__': - callerpath = outerframe[1] - if callerpath is None: - # It happens sometimes. Why is a mystery. - callerpath = os.getcwd() - callerpath = os.path.abspath(callerpath) - break - mydir, myname = os.path.split(mypath) - if not mydir: - mydir = os.curdir - if callerpath.startswith(mydir): - self.id = callerpath[len(mydir) + 1:] # caller's module - else: - self.id = callerpath - else: - self.id = id - - def addTestCase(self, test_case_class, method_name, input, expected, - id=None, run_in_debugger=0, short_description=None, - **kwargs): - """ - Create a custom TestCase in the CustomTestSuite. - Also return it, just in case. - - Arguments: - - test_case_class -- - method_name -- - input -- input to the parser. - expected -- expected output from the parser. - id -- unique test identifier, used by the test framework. - run_in_debugger -- if true, run this test under the pdb debugger. - short_description -- override to default test description. - """ - if id is None: # generate id if required - id = self.next_test_case_id - self.next_test_case_id += 1 - # test identifier will become suiteid.testid - tcid = '%s: %s' % (self.id, id) - # generate and add test case - tc = test_case_class(method_name, input, expected, tcid, - run_in_debugger=run_in_debugger, - short_description=short_description, - **kwargs) - self.addTest(tc) - return tc - - -class CustomTestCase(unittest.TestCase): - - compare = difflib.Differ().compare - """Comparison method shared by all subclasses.""" - - def __init__(self, method_name, input, expected, id, - run_in_debugger=0, short_description=None): - """ - Initialise the CustomTestCase. - - Arguments: - - method_name -- name of test method to run. - input -- input to the parser. - expected -- expected output from the parser. - id -- unique test identifier, used by the test framework. - run_in_debugger -- if true, run this test under the pdb debugger. - short_description -- override to default test description. - """ - self.id = id - self.input = input - self.expected = expected - self.run_in_debugger = run_in_debugger - # Ring your mother. - unittest.TestCase.__init__(self, method_name) - - def __str__(self): - """ - Return string conversion. Overridden to give test id, in addition to - method name. - """ - return '%s; %s' % (self.id, unittest.TestCase.__str__(self)) - - def __repr__(self): - return "<%s %s>" % (self.id, unittest.TestCase.__repr__(self)) - - def compare_output(self, input, output, expected): - """`input`, `output`, and `expected` should all be strings.""" - if type(input) == UnicodeType: - input = input.encode('raw_unicode_escape') - if type(output) == UnicodeType: - output = output.encode('raw_unicode_escape') - if type(expected) == UnicodeType: - expected = expected.encode('raw_unicode_escape') - try: - self.assertEquals('\n' + output, '\n' + expected) - except AssertionError: - print >>sys.stderr, '\n%s\ninput:' % (self,) - print >>sys.stderr, input - print >>sys.stderr, '-: expected\n+: output' - print >>sys.stderr, ''.join(self.compare(expected.splitlines(1), - output.splitlines(1))) - raise - - def skip_test(self): - print >>sys.stderr, '%s: Test skipped' % self - - -class TransformTestSuite(CustomTestSuite): - - """ - A collection of TransformTestCases. - - A TransformTestSuite instance manufactures TransformTestCases, - keeps track of them, and provides a shared test fixture (a-la - setUp and tearDown). - """ - - def __init__(self, parser): - self.parser = parser - """Parser shared by all test cases.""" - - CustomTestSuite.__init__(self) - - def generateTests(self, dict, dictname='totest', - testmethod='test_transforms'): - """ - Stock the suite with test cases generated from a test data dictionary. - - Each dictionary key (test type's name) maps to a list of transform - classes and list of tests. Each test is a list: input, expected - output, optional modifier. The optional third entry, a behavior - modifier, can be 0 (temporarily disable this test) or 1 (run this test - under the pdb debugger). Tests should be self-documenting and not - require external comments. - """ - for name, (transforms, cases) in dict.items(): - for casenum in range(len(cases)): - case = cases[casenum] - run_in_debugger = 0 - if len(case)==3: - if case[2]: - run_in_debugger = 1 - else: - continue - self.addTestCase( - TransformTestCase, testmethod, - transforms=transforms, parser=self.parser, - input=case[0], expected=case[1], - id='%s[%r][%s]' % (dictname, name, casenum), - run_in_debugger=run_in_debugger) - - -class TransformTestCase(CustomTestCase): - - """ - Output checker for the transform. - - Should probably be called TransformOutputChecker, but I can deal with - that later when/if someone comes up with a category of transform test - cases that have nothing to do with the input and output of the transform. - """ - - option_parser = frontend.OptionParser(components=(rst.Parser,)) - settings = option_parser.get_default_values() - settings.report_level = 1 - settings.halt_level = 5 - settings.debug = package_unittest.debug - settings.warning_stream = DevNull() - - def __init__(self, *args, **kwargs): - self.transforms = kwargs['transforms'] - """List of transforms to perform for this test case.""" - - self.parser = kwargs['parser'] - """Input parser for this test case.""" - - del kwargs['transforms'], kwargs['parser'] # only wanted here - CustomTestCase.__init__(self, *args, **kwargs) - - def supports(self, format): - return 1 - - def test_transforms(self): - if self.run_in_debugger: - pdb.set_trace() - document = utils.new_document('test data', self.settings) - self.parser.parse(self.input, document) - # Don't do a ``populate_from_components()`` because that would - # enable the Transformer's default transforms. - document.transformer.add_transforms(self.transforms) - document.transformer.add_transform(universal.TestMessages) - document.transformer.components['writer'] = self - document.transformer.apply_transforms() - output = document.pformat() - self.compare_output(self.input, output, self.expected) - - def test_transforms_verbosely(self): - if self.run_in_debugger: - pdb.set_trace() - print '\n', self.id - print '-' * 70 - print self.input - document = utils.new_document('test data', self.settings) - self.parser.parse(self.input, document) - print '-' * 70 - print document.pformat() - for transformClass in self.transforms: - transformClass(document).apply() - output = document.pformat() - print '-' * 70 - print output - self.compare_output(self.input, output, self.expected) - - -class ParserTestCase(CustomTestCase): - - """ - Output checker for the parser. - - Should probably be called ParserOutputChecker, but I can deal with - that later when/if someone comes up with a category of parser test - cases that have nothing to do with the input and output of the parser. - """ - - parser = rst.Parser() - """Parser shared by all ParserTestCases.""" - - option_parser = frontend.OptionParser(components=(parser,)) - settings = option_parser.get_default_values() - settings.report_level = 5 - settings.halt_level = 5 - settings.debug = package_unittest.debug - - def test_parser(self): - if self.run_in_debugger: - pdb.set_trace() - document = utils.new_document('test data', self.settings) - self.parser.parse(self.input, document) - output = document.pformat() - self.compare_output(self.input, output, self.expected) - - -class ParserTestSuite(CustomTestSuite): - - """ - A collection of ParserTestCases. - - A ParserTestSuite instance manufactures ParserTestCases, - keeps track of them, and provides a shared test fixture (a-la - setUp and tearDown). - """ - - test_case_class = ParserTestCase - - def generateTests(self, dict, dictname='totest'): - """ - Stock the suite with test cases generated from a test data dictionary. - - Each dictionary key (test type name) maps to a list of tests. Each - test is a list: input, expected output, optional modifier. The - optional third entry, a behavior modifier, can be 0 (temporarily - disable this test) or 1 (run this test under the pdb debugger). Tests - should be self-documenting and not require external comments. - """ - for name, cases in dict.items(): - for casenum in range(len(cases)): - case = cases[casenum] - run_in_debugger = 0 - if len(case)==3: - if case[2]: - run_in_debugger = 1 - else: - continue - self.addTestCase( - self.test_case_class, 'test_parser', - input=case[0], expected=case[1], - id='%s[%r][%s]' % (dictname, name, casenum), - run_in_debugger=run_in_debugger) - - -class PEPParserTestCase(ParserTestCase): - - """PEP-specific parser test case.""" - - parser = rst.Parser(rfc2822=1, inliner=pep.Inliner()) - """Parser shared by all PEPParserTestCases.""" - - option_parser = frontend.OptionParser(components=(parser, pep.Reader)) - settings = option_parser.get_default_values() - settings.report_level = 5 - settings.halt_level = 5 - settings.debug = package_unittest.debug - - -class PEPParserTestSuite(ParserTestSuite): - - """A collection of PEPParserTestCases.""" - - test_case_class = PEPParserTestCase - - -class GridTableParserTestCase(CustomTestCase): - - parser = tableparser.GridTableParser() - - def test_parse_table(self): - self.parser.setup(string2lines(self.input)) - try: - self.parser.find_head_body_sep() - self.parser.parse_table() - output = self.parser.cells - except Exception, details: - output = '%s: %s' % (details.__class__.__name__, details) - self.compare_output(self.input, pformat(output) + '\n', - pformat(self.expected) + '\n') - - def test_parse(self): - try: - output = self.parser.parse(string2lines(self.input)) - except Exception, details: - output = '%s: %s' % (details.__class__.__name__, details) - self.compare_output(self.input, pformat(output) + '\n', - pformat(self.expected) + '\n') - - -class GridTableParserTestSuite(CustomTestSuite): - - """ - A collection of GridTableParserTestCases. - - A GridTableParserTestSuite instance manufactures GridTableParserTestCases, - keeps track of them, and provides a shared test fixture (a-la setUp and - tearDown). - """ - - test_case_class = GridTableParserTestCase - - def generateTests(self, dict, dictname='totest'): - """ - Stock the suite with test cases generated from a test data dictionary. - - Each dictionary key (test type name) maps to a list of tests. Each - test is a list: an input table, expected output from parse_table(), - expected output from parse(), optional modifier. The optional fourth - entry, a behavior modifier, can be 0 (temporarily disable this test) - or 1 (run this test under the pdb debugger). Tests should be - self-documenting and not require external comments. - """ - for name, cases in dict.items(): - for casenum in range(len(cases)): - case = cases[casenum] - run_in_debugger = 0 - if len(case) == 4: - if case[-1]: - run_in_debugger = 1 - else: - continue - self.addTestCase(self.test_case_class, 'test_parse_table', - input=case[0], expected=case[1], - id='%s[%r][%s]' % (dictname, name, casenum), - run_in_debugger=run_in_debugger) - self.addTestCase(self.test_case_class, 'test_parse', - input=case[0], expected=case[2], - id='%s[%r][%s]' % (dictname, name, casenum), - run_in_debugger=run_in_debugger) - - -class SimpleTableParserTestCase(GridTableParserTestCase): - - parser = tableparser.SimpleTableParser() - - -class SimpleTableParserTestSuite(CustomTestSuite): - - """ - A collection of SimpleTableParserTestCases. - """ - - test_case_class = SimpleTableParserTestCase - - def generateTests(self, dict, dictname='totest'): - """ - Stock the suite with test cases generated from a test data dictionary. - - Each dictionary key (test type name) maps to a list of tests. Each - test is a list: an input table, expected output from parse(), optional - modifier. The optional third entry, a behavior modifier, can be 0 - (temporarily disable this test) or 1 (run this test under the pdb - debugger). Tests should be self-documenting and not require external - comments. - """ - for name, cases in dict.items(): - for casenum in range(len(cases)): - case = cases[casenum] - run_in_debugger = 0 - if len(case) == 3: - if case[-1]: - run_in_debugger = 1 - else: - continue - self.addTestCase(self.test_case_class, 'test_parse', - input=case[0], expected=case[1], - id='%s[%r][%s]' % (dictname, name, casenum), - run_in_debugger=run_in_debugger) - - -class PythonModuleParserTestCase(CustomTestCase): - - def test_parser(self): - if self.run_in_debugger: - pdb.set_trace() - module = moduleparser.parse_module(self.input, 'test data') - output = str(module) - self.compare_output(self.input, output, self.expected) - - def test_token_parser_rhs(self): - if self.run_in_debugger: - pdb.set_trace() - tr = moduleparser.TokenParser(self.input) - output = tr.rhs(1) - self.compare_output(self.input, output, self.expected) - - -class PythonModuleParserTestSuite(CustomTestSuite): - - """ - A collection of PythonModuleParserTestCase. - """ - - if moduleparser is None: - PythonModuleParserTestCase.test_parser = CustomTestCase.skip_test - PythonModuleParserTestCase.test_token_parser_rhs = \ - CustomTestCase.skip_test - - def generateTests(self, dict, dictname='totest', - testmethod='test_parser'): - """ - Stock the suite with test cases generated from a test data dictionary. - - Each dictionary key (test type's name) maps to a list of tests. Each - test is a list: input, expected output, optional modifier. The - optional third entry, a behavior modifier, can be 0 (temporarily - disable this test) or 1 (run this test under the pdb debugger). Tests - should be self-documenting and not require external comments. - """ - for name, cases in dict.items(): - for casenum in range(len(cases)): - case = cases[casenum] - run_in_debugger = 0 - if len(case)==3: - if case[2]: - run_in_debugger = 1 - else: - continue - self.addTestCase( - PythonModuleParserTestCase, testmethod, - input=case[0], expected=case[1], - id='%s[%r][%s]' % (dictname, name, casenum), - run_in_debugger=run_in_debugger) - - -# @@@ These should be generalized to WriterPublishTestCase/Suite or -# just PublishTestCase/Suite, as per TransformTestCase/Suite. -class LatexPublishTestCase(CustomTestCase, docutils.SettingsSpec): - - """ - Test case for publish. - """ - - settings_default_overrides = {'_disable_config': 1} - - def test_publish(self): - if self.run_in_debugger: - pdb.set_trace() - output = docutils.core.publish_string( - source=self.input, - reader_name='standalone', - parser_name='restructuredtext', - writer_name='latex', - settings_spec=self) - self.compare_output(self.input, output, self.expected) - - -class LatexPublishTestSuite(CustomTestSuite): - - def __init__(self): - CustomTestSuite.__init__(self) - - def generateTests(self, dict, dictname='totest'): - for name, cases in dict.items(): - for casenum in range(len(cases)): - case = cases[casenum] - run_in_debugger = 0 - if len(case)==3: - if case[2]: - run_in_debugger = 1 - else: - continue - self.addTestCase( - LatexPublishTestCase, 'test_publish', - input=case[0], expected=case[1], - id='%s[%r][%s]' % (dictname, name, casenum), - run_in_debugger=run_in_debugger) - - -def exception_args(code): - try: - exec(code) - except Exception, detail: - return detail.args diff --git a/docutils/test/alltests.py b/docutils/test/alltests.py deleted file mode 100755 index 8cacec5f2..000000000 --- a/docutils/test/alltests.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -All modules named 'test_*.py' in the current directory, and recursively in -subdirectories (packages) called 'test_*', are loaded and test suites within -are run. -""" - -import time -# Start point for actual elapsed time, including imports -# and setup outside of unittest. -start = time.time() - -import sys -import os - - -class Tee: - - """Write to a file and a stream (default: stdout) simultaneously.""" - - def __init__(self, filename, stream=sys.__stdout__): - self.file = open(filename, 'w') - self.stream = stream - - def write(self, string): - self.stream.write(string) - self.file.write(string) - - def flush(self): - self.stream.flush() - self.file.flush() - - -def pformat(suite): - step = 4 - suitestr = repr(suite).replace('=[<', '=[\n<').replace(', ', ',\n') - indent = 0 - output = [] - for line in suitestr.splitlines(): - output.append(' ' * indent + line) - if line[-1:] == '[': - indent += step - else: - if line [-5:] == ']>]>,': - indent -= step * 2 - elif line[-3:] == ']>,': - indent -= step - return '\n'.join(output) - - -# must redirect stderr *before* first import of unittest -sys.stdout = sys.stderr = Tee('alltests.out') - -import package_unittest - -path, script = os.path.split(sys.argv[0]) -suite = package_unittest.loadTestModules(path, 'test_', packages=1) -package_unittest.main(suite) -#if package_unittest.verbosity > 1: -# print >>sys.stderr, pformat(suite) # check the test suite -finish = time.time() - -print 'Elapsed time: %.3f seconds' % (finish - start) diff --git a/docutils/test/difflib.py b/docutils/test/difflib.py deleted file mode 100644 index a41d4d5ba..000000000 --- a/docutils/test/difflib.py +++ /dev/null @@ -1,1089 +0,0 @@ -#! /usr/bin/env python - -""" -Module difflib -- helpers for computing deltas between objects. - -Function get_close_matches(word, possibilities, n=3, cutoff=0.6): - Use SequenceMatcher to return list of the best "good enough" matches. - -Function ndiff(a, b): - Return a delta: the difference between `a` and `b` (lists of strings). - -Function restore(delta, which): - Return one of the two sequences that generated an ndiff delta. - -Class SequenceMatcher: - A flexible class for comparing pairs of sequences of any type. - -Class Differ: - For producing human-readable deltas from sequences of lines of text. -""" - -__all__ = ['get_close_matches', 'ndiff', 'restore', 'SequenceMatcher', - 'Differ'] - -TRACE = 0 - -class SequenceMatcher: - - """ - SequenceMatcher is a flexible class for comparing pairs of sequences of - any type, so long as the sequence elements are hashable. The basic - algorithm predates, and is a little fancier than, an algorithm - published in the late 1980's by Ratcliff and Obershelp under the - hyperbolic name "gestalt pattern matching". The basic idea is to find - the longest contiguous matching subsequence that contains no "junk" - elements (R-O doesn't address junk). The same idea is then applied - recursively to the pieces of the sequences to the left and to the right - of the matching subsequence. This does not yield minimal edit - sequences, but does tend to yield matches that "look right" to people. - - SequenceMatcher tries to compute a "human-friendly diff" between two - sequences. Unlike e.g. UNIX(tm) diff, the fundamental notion is the - longest *contiguous* & junk-free matching subsequence. That's what - catches peoples' eyes. The Windows(tm) windiff has another interesting - notion, pairing up elements that appear uniquely in each sequence. - That, and the method here, appear to yield more intuitive difference - reports than does diff. This method appears to be the least vulnerable - to synching up on blocks of "junk lines", though (like blank lines in - ordinary text files, or maybe "

" lines in HTML files). That may be - because this is the only method of the 3 that has a *concept* of - "junk" . - - Example, comparing two strings, and considering blanks to be "junk": - - >>> s = SequenceMatcher(lambda x: x == " ", - ... "private Thread currentThread;", - ... "private volatile Thread currentThread;") - >>> - - .ratio() returns a float in [0, 1], measuring the "similarity" of the - sequences. As a rule of thumb, a .ratio() value over 0.6 means the - sequences are close matches: - - >>> print round(s.ratio(), 3) - 0.866 - >>> - - If you're only interested in where the sequences match, - .get_matching_blocks() is handy: - - >>> for block in s.get_matching_blocks(): - ... print "a[%d] and b[%d] match for %d elements" % block - a[0] and b[0] match for 8 elements - a[8] and b[17] match for 6 elements - a[14] and b[23] match for 15 elements - a[29] and b[38] match for 0 elements - - Note that the last tuple returned by .get_matching_blocks() is always a - dummy, (len(a), len(b), 0), and this is the only case in which the last - tuple element (number of elements matched) is 0. - - If you want to know how to change the first sequence into the second, - use .get_opcodes(): - - >>> for opcode in s.get_opcodes(): - ... print "%6s a[%d:%d] b[%d:%d]" % opcode - equal a[0:8] b[0:8] - insert a[8:8] b[8:17] - equal a[8:14] b[17:23] - equal a[14:29] b[23:38] - - See the Differ class for a fancy human-friendly file differencer, which - uses SequenceMatcher both to compare sequences of lines, and to compare - sequences of characters within similar (near-matching) lines. - - See also function get_close_matches() in this module, which shows how - simple code building on SequenceMatcher can be used to do useful work. - - Timing: Basic R-O is cubic time worst case and quadratic time expected - case. SequenceMatcher is quadratic time for the worst case and has - expected-case behavior dependent in a complicated way on how many - elements the sequences have in common; best case time is linear. - - Methods: - - __init__(isjunk=None, a='', b='') - Construct a SequenceMatcher. - - set_seqs(a, b) - Set the two sequences to be compared. - - set_seq1(a) - Set the first sequence to be compared. - - set_seq2(b) - Set the second sequence to be compared. - - find_longest_match(alo, ahi, blo, bhi) - Find longest matching block in a[alo:ahi] and b[blo:bhi]. - - get_matching_blocks() - Return list of triples describing matching subsequences. - - get_opcodes() - Return list of 5-tuples describing how to turn a into b. - - ratio() - Return a measure of the sequences' similarity (float in [0,1]). - - quick_ratio() - Return an upper bound on .ratio() relatively quickly. - - real_quick_ratio() - Return an upper bound on ratio() very quickly. - """ - - def __init__(self, isjunk=None, a='', b=''): - """Construct a SequenceMatcher. - - Optional arg isjunk is None (the default), or a one-argument - function that takes a sequence element and returns true iff the - element is junk. None is equivalent to passing "lambda x: 0", i.e. - no elements are considered to be junk. For example, pass - lambda x: x in " \\t" - if you're comparing lines as sequences of characters, and don't - want to synch up on blanks or hard tabs. - - Optional arg a is the first of two sequences to be compared. By - default, an empty string. The elements of a must be hashable. See - also .set_seqs() and .set_seq1(). - - Optional arg b is the second of two sequences to be compared. By - default, an empty string. The elements of b must be hashable. See - also .set_seqs() and .set_seq2(). - """ - - # Members: - # a - # first sequence - # b - # second sequence; differences are computed as "what do - # we need to do to 'a' to change it into 'b'?" - # b2j - # for x in b, b2j[x] is a list of the indices (into b) - # at which x appears; junk elements do not appear - # b2jhas - # b2j.has_key - # fullbcount - # for x in b, fullbcount[x] == the number of times x - # appears in b; only materialized if really needed (used - # only for computing quick_ratio()) - # matching_blocks - # a list of (i, j, k) triples, where a[i:i+k] == b[j:j+k]; - # ascending & non-overlapping in i and in j; terminated by - # a dummy (len(a), len(b), 0) sentinel - # opcodes - # a list of (tag, i1, i2, j1, j2) tuples, where tag is - # one of - # 'replace' a[i1:i2] should be replaced by b[j1:j2] - # 'delete' a[i1:i2] should be deleted - # 'insert' b[j1:j2] should be inserted - # 'equal' a[i1:i2] == b[j1:j2] - # isjunk - # a user-supplied function taking a sequence element and - # returning true iff the element is "junk" -- this has - # subtle but helpful effects on the algorithm, which I'll - # get around to writing up someday <0.9 wink>. - # DON'T USE! Only __chain_b uses this. Use isbjunk. - # isbjunk - # for x in b, isbjunk(x) == isjunk(x) but much faster; - # it's really the has_key method of a hidden dict. - # DOES NOT WORK for x in a! - - self.isjunk = isjunk - self.a = self.b = None - self.set_seqs(a, b) - - def set_seqs(self, a, b): - """Set the two sequences to be compared. - - >>> s = SequenceMatcher() - >>> s.set_seqs("abcd", "bcde") - >>> s.ratio() - 0.75 - """ - - self.set_seq1(a) - self.set_seq2(b) - - def set_seq1(self, a): - """Set the first sequence to be compared. - - The second sequence to be compared is not changed. - - >>> s = SequenceMatcher(None, "abcd", "bcde") - >>> s.ratio() - 0.75 - >>> s.set_seq1("bcde") - >>> s.ratio() - 1.0 - >>> - - SequenceMatcher computes and caches detailed information about the - second sequence, so if you want to compare one sequence S against - many sequences, use .set_seq2(S) once and call .set_seq1(x) - repeatedly for each of the other sequences. - - See also set_seqs() and set_seq2(). - """ - - if a is self.a: - return - self.a = a - self.matching_blocks = self.opcodes = None - - def set_seq2(self, b): - """Set the second sequence to be compared. - - The first sequence to be compared is not changed. - - >>> s = SequenceMatcher(None, "abcd", "bcde") - >>> s.ratio() - 0.75 - >>> s.set_seq2("abcd") - >>> s.ratio() - 1.0 - >>> - - SequenceMatcher computes and caches detailed information about the - second sequence, so if you want to compare one sequence S against - many sequences, use .set_seq2(S) once and call .set_seq1(x) - repeatedly for each of the other sequences. - - See also set_seqs() and set_seq1(). - """ - - if b is self.b: - return - self.b = b - self.matching_blocks = self.opcodes = None - self.fullbcount = None - self.__chain_b() - - # For each element x in b, set b2j[x] to a list of the indices in - # b where x appears; the indices are in increasing order; note that - # the number of times x appears in b is len(b2j[x]) ... - # when self.isjunk is defined, junk elements don't show up in this - # map at all, which stops the central find_longest_match method - # from starting any matching block at a junk element ... - # also creates the fast isbjunk function ... - # note that this is only called when b changes; so for cross-product - # kinds of matches, it's best to call set_seq2 once, then set_seq1 - # repeatedly - - def __chain_b(self): - # Because isjunk is a user-defined (not C) function, and we test - # for junk a LOT, it's important to minimize the number of calls. - # Before the tricks described here, __chain_b was by far the most - # time-consuming routine in the whole module! If anyone sees - # Jim Roskind, thank him again for profile.py -- I never would - # have guessed that. - # The first trick is to build b2j ignoring the possibility - # of junk. I.e., we don't call isjunk at all yet. Throwing - # out the junk later is much cheaper than building b2j "right" - # from the start. - b = self.b - self.b2j = b2j = {} - self.b2jhas = b2jhas = b2j.has_key - for i in xrange(len(b)): - elt = b[i] - if b2jhas(elt): - b2j[elt].append(i) - else: - b2j[elt] = [i] - - # Now b2j.keys() contains elements uniquely, and especially when - # the sequence is a string, that's usually a good deal smaller - # than len(string). The difference is the number of isjunk calls - # saved. - isjunk, junkdict = self.isjunk, {} - if isjunk: - for elt in b2j.keys(): - if isjunk(elt): - junkdict[elt] = 1 # value irrelevant; it's a set - del b2j[elt] - - # Now for x in b, isjunk(x) == junkdict.has_key(x), but the - # latter is much faster. Note too that while there may be a - # lot of junk in the sequence, the number of *unique* junk - # elements is probably small. So the memory burden of keeping - # this dict alive is likely trivial compared to the size of b2j. - self.isbjunk = junkdict.has_key - - def find_longest_match(self, alo, ahi, blo, bhi): - """Find longest matching block in a[alo:ahi] and b[blo:bhi]. - - If isjunk is not defined: - - Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where - alo <= i <= i+k <= ahi - blo <= j <= j+k <= bhi - and for all (i',j',k') meeting those conditions, - k >= k' - i <= i' - and if i == i', j <= j' - - In other words, of all maximal matching blocks, return one that - starts earliest in a, and of all those maximal matching blocks that - start earliest in a, return the one that starts earliest in b. - - >>> s = SequenceMatcher(None, " abcd", "abcd abcd") - >>> s.find_longest_match(0, 5, 0, 9) - (0, 4, 5) - - If isjunk is defined, first the longest matching block is - determined as above, but with the additional restriction that no - junk element appears in the block. Then that block is extended as - far as possible by matching (only) junk elements on both sides. So - the resulting block never matches on junk except as identical junk - happens to be adjacent to an "interesting" match. - - Here's the same example as before, but considering blanks to be - junk. That prevents " abcd" from matching the " abcd" at the tail - end of the second sequence directly. Instead only the "abcd" can - match, and matches the leftmost "abcd" in the second sequence: - - >>> s = SequenceMatcher(lambda x: x==" ", " abcd", "abcd abcd") - >>> s.find_longest_match(0, 5, 0, 9) - (1, 0, 4) - - If no blocks match, return (alo, blo, 0). - - >>> s = SequenceMatcher(None, "ab", "c") - >>> s.find_longest_match(0, 2, 0, 1) - (0, 0, 0) - """ - - # CAUTION: stripping common prefix or suffix would be incorrect. - # E.g., - # ab - # acab - # Longest matching block is "ab", but if common prefix is - # stripped, it's "a" (tied with "b"). UNIX(tm) diff does so - # strip, so ends up claiming that ab is changed to acab by - # inserting "ca" in the middle. That's minimal but unintuitive: - # "it's obvious" that someone inserted "ac" at the front. - # Windiff ends up at the same place as diff, but by pairing up - # the unique 'b's and then matching the first two 'a's. - - a, b, b2j, isbjunk = self.a, self.b, self.b2j, self.isbjunk - besti, bestj, bestsize = alo, blo, 0 - # find longest junk-free match - # during an iteration of the loop, j2len[j] = length of longest - # junk-free match ending with a[i-1] and b[j] - j2len = {} - nothing = [] - for i in xrange(alo, ahi): - # look at all instances of a[i] in b; note that because - # b2j has no junk keys, the loop is skipped if a[i] is junk - j2lenget = j2len.get - newj2len = {} - for j in b2j.get(a[i], nothing): - # a[i] matches b[j] - if j < blo: - continue - if j >= bhi: - break - k = newj2len[j] = j2lenget(j-1, 0) + 1 - if k > bestsize: - besti, bestj, bestsize = i-k+1, j-k+1, k - j2len = newj2len - - # Now that we have a wholly interesting match (albeit possibly - # empty!), we may as well suck up the matching junk on each - # side of it too. Can't think of a good reason not to, and it - # saves post-processing the (possibly considerable) expense of - # figuring out what to do with it. In the case of an empty - # interesting match, this is clearly the right thing to do, - # because no other kind of match is possible in the regions. - while besti > alo and bestj > blo and \ - isbjunk(b[bestj-1]) and \ - a[besti-1] == b[bestj-1]: - besti, bestj, bestsize = besti-1, bestj-1, bestsize+1 - while besti+bestsize < ahi and bestj+bestsize < bhi and \ - isbjunk(b[bestj+bestsize]) and \ - a[besti+bestsize] == b[bestj+bestsize]: - bestsize = bestsize + 1 - - if TRACE: - print "get_matching_blocks", alo, ahi, blo, bhi - print " returns", besti, bestj, bestsize - return besti, bestj, bestsize - - def get_matching_blocks(self): - """Return list of triples describing matching subsequences. - - Each triple is of the form (i, j, n), and means that - a[i:i+n] == b[j:j+n]. The triples are monotonically increasing in - i and in j. - - The last triple is a dummy, (len(a), len(b), 0), and is the only - triple with n==0. - - >>> s = SequenceMatcher(None, "abxcd", "abcd") - >>> s.get_matching_blocks() - [(0, 0, 2), (3, 2, 2), (5, 4, 0)] - """ - - if self.matching_blocks is not None: - return self.matching_blocks - self.matching_blocks = [] - la, lb = len(self.a), len(self.b) - self.__helper(0, la, 0, lb, self.matching_blocks) - self.matching_blocks.append( (la, lb, 0) ) - if TRACE: - print '*** matching blocks', self.matching_blocks - return self.matching_blocks - - # builds list of matching blocks covering a[alo:ahi] and - # b[blo:bhi], appending them in increasing order to answer - - def __helper(self, alo, ahi, blo, bhi, answer): - i, j, k = x = self.find_longest_match(alo, ahi, blo, bhi) - # a[alo:i] vs b[blo:j] unknown - # a[i:i+k] same as b[j:j+k] - # a[i+k:ahi] vs b[j+k:bhi] unknown - if k: - if alo < i and blo < j: - self.__helper(alo, i, blo, j, answer) - answer.append(x) - if i+k < ahi and j+k < bhi: - self.__helper(i+k, ahi, j+k, bhi, answer) - - def get_opcodes(self): - """Return list of 5-tuples describing how to turn a into b. - - Each tuple is of the form (tag, i1, i2, j1, j2). The first tuple - has i1 == j1 == 0, and remaining tuples have i1 == the i2 from the - tuple preceding it, and likewise for j1 == the previous j2. - - The tags are strings, with these meanings: - - 'replace': a[i1:i2] should be replaced by b[j1:j2] - 'delete': a[i1:i2] should be deleted. - Note that j1==j2 in this case. - 'insert': b[j1:j2] should be inserted at a[i1:i1]. - Note that i1==i2 in this case. - 'equal': a[i1:i2] == b[j1:j2] - - >>> a = "qabxcd" - >>> b = "abycdf" - >>> s = SequenceMatcher(None, a, b) - >>> for tag, i1, i2, j1, j2 in s.get_opcodes(): - ... print ("%7s a[%d:%d] (%s) b[%d:%d] (%s)" % - ... (tag, i1, i2, a[i1:i2], j1, j2, b[j1:j2])) - delete a[0:1] (q) b[0:0] () - equal a[1:3] (ab) b[0:2] (ab) - replace a[3:4] (x) b[2:3] (y) - equal a[4:6] (cd) b[3:5] (cd) - insert a[6:6] () b[5:6] (f) - """ - - if self.opcodes is not None: - return self.opcodes - i = j = 0 - self.opcodes = answer = [] - for ai, bj, size in self.get_matching_blocks(): - # invariant: we've pumped out correct diffs to change - # a[:i] into b[:j], and the next matching block is - # a[ai:ai+size] == b[bj:bj+size]. So we need to pump - # out a diff to change a[i:ai] into b[j:bj], pump out - # the matching block, and move (i,j) beyond the match - tag = '' - if i < ai and j < bj: - tag = 'replace' - elif i < ai: - tag = 'delete' - elif j < bj: - tag = 'insert' - if tag: - answer.append( (tag, i, ai, j, bj) ) - i, j = ai+size, bj+size - # the list of matching blocks is terminated by a - # sentinel with size 0 - if size: - answer.append( ('equal', ai, i, bj, j) ) - return answer - - def ratio(self): - """Return a measure of the sequences' similarity (float in [0,1]). - - Where T is the total number of elements in both sequences, and - M is the number of matches, this is 2,0*M / T. - Note that this is 1 if the sequences are identical, and 0 if - they have nothing in common. - - .ratio() is expensive to compute if you haven't already computed - .get_matching_blocks() or .get_opcodes(), in which case you may - want to try .quick_ratio() or .real_quick_ratio() first to get an - upper bound. - - >>> s = SequenceMatcher(None, "abcd", "bcde") - >>> s.ratio() - 0.75 - >>> s.quick_ratio() - 0.75 - >>> s.real_quick_ratio() - 1.0 - """ - - matches = reduce(lambda sum, triple: sum + triple[-1], - self.get_matching_blocks(), 0) - return 2.0 * matches / (len(self.a) + len(self.b)) - - def quick_ratio(self): - """Return an upper bound on ratio() relatively quickly. - - This isn't defined beyond that it is an upper bound on .ratio(), and - is faster to compute. - """ - - # viewing a and b as multisets, set matches to the cardinality - # of their intersection; this counts the number of matches - # without regard to order, so is clearly an upper bound - if self.fullbcount is None: - self.fullbcount = fullbcount = {} - for elt in self.b: - fullbcount[elt] = fullbcount.get(elt, 0) + 1 - fullbcount = self.fullbcount - # avail[x] is the number of times x appears in 'b' less the - # number of times we've seen it in 'a' so far ... kinda - avail = {} - availhas, matches = avail.has_key, 0 - for elt in self.a: - if availhas(elt): - numb = avail[elt] - else: - numb = fullbcount.get(elt, 0) - avail[elt] = numb - 1 - if numb > 0: - matches = matches + 1 - return 2.0 * matches / (len(self.a) + len(self.b)) - - def real_quick_ratio(self): - """Return an upper bound on ratio() very quickly. - - This isn't defined beyond that it is an upper bound on .ratio(), and - is faster to compute than either .ratio() or .quick_ratio(). - """ - - la, lb = len(self.a), len(self.b) - # can't have more matches than the number of elements in the - # shorter sequence - return 2.0 * min(la, lb) / (la + lb) - -def get_close_matches(word, possibilities, n=3, cutoff=0.6): - """Use SequenceMatcher to return list of the best "good enough" matches. - - word is a sequence for which close matches are desired (typically a - string). - - possibilities is a list of sequences against which to match word - (typically a list of strings). - - Optional arg n (default 3) is the maximum number of close matches to - return. n must be > 0. - - Optional arg cutoff (default 0.6) is a float in [0, 1]. Possibilities - that don't score at least that similar to word are ignored. - - The best (no more than n) matches among the possibilities are returned - in a list, sorted by similarity score, most similar first. - - >>> get_close_matches("appel", ["ape", "apple", "peach", "puppy"]) - ['apple', 'ape'] - >>> import keyword as _keyword - >>> get_close_matches("wheel", _keyword.kwlist) - ['while'] - >>> get_close_matches("apple", _keyword.kwlist) - [] - >>> get_close_matches("accept", _keyword.kwlist) - ['except'] - """ - - if not n > 0: - raise ValueError("n must be > 0: " + `n`) - if not 0.0 <= cutoff <= 1.0: - raise ValueError("cutoff must be in [0.0, 1.0]: " + `cutoff`) - result = [] - s = SequenceMatcher() - s.set_seq2(word) - for x in possibilities: - s.set_seq1(x) - if s.real_quick_ratio() >= cutoff and \ - s.quick_ratio() >= cutoff and \ - s.ratio() >= cutoff: - result.append((s.ratio(), x)) - # Sort by score. - result.sort() - # Retain only the best n. - result = result[-n:] - # Move best-scorer to head of list. - result.reverse() - # Strip scores. - return [x for score, x in result] - - -def _count_leading(line, ch): - """ - Return number of `ch` characters at the start of `line`. - - Example: - - >>> _count_leading(' abc', ' ') - 3 - """ - - i, n = 0, len(line) - while i < n and line[i] == ch: - i += 1 - return i - -class Differ: - r""" - Differ is a class for comparing sequences of lines of text, and - producing human-readable differences or deltas. Differ uses - SequenceMatcher both to compare sequences of lines, and to compare - sequences of characters within similar (near-matching) lines. - - Each line of a Differ delta begins with a two-letter code: - - '- ' line unique to sequence 1 - '+ ' line unique to sequence 2 - ' ' line common to both sequences - '? ' line not present in either input sequence - - Lines beginning with '? ' attempt to guide the eye to intraline - differences, and were not present in either input sequence. These lines - can be confusing if the sequences contain tab characters. - - Note that Differ makes no claim to produce a *minimal* diff. To the - contrary, minimal diffs are often counter-intuitive, because they synch - up anywhere possible, sometimes accidental matches 100 pages apart. - Restricting synch points to contiguous matches preserves some notion of - locality, at the occasional cost of producing a longer diff. - - Example: Comparing two texts. - - First we set up the texts, sequences of individual single-line strings - ending with newlines (such sequences can also be obtained from the - `readlines()` method of file-like objects): - - >>> text1 = ''' 1. Beautiful is better than ugly. - ... 2. Explicit is better than implicit. - ... 3. Simple is better than complex. - ... 4. Complex is better than complicated. - ... '''.splitlines(1) - >>> len(text1) - 4 - >>> text1[0][-1] - '\n' - >>> text2 = ''' 1. Beautiful is better than ugly. - ... 3. Simple is better than complex. - ... 4. Complicated is better than complex. - ... 5. Flat is better than nested. - ... '''.splitlines(1) - - Next we instantiate a Differ object: - - >>> d = Differ() - - Note that when instantiating a Differ object we may pass functions to - filter out line and character 'junk'. See Differ.__init__ for details. - - Finally, we compare the two: - - >>> result = d.compare(text1, text2) - - 'result' is a list of strings, so let's pretty-print it: - - >>> from pprint import pprint as _pprint - >>> _pprint(result) - [' 1. Beautiful is better than ugly.\n', - '- 2. Explicit is better than implicit.\n', - '- 3. Simple is better than complex.\n', - '+ 3. Simple is better than complex.\n', - '? ++\n', - '- 4. Complex is better than complicated.\n', - '? ^ ---- ^\n', - '+ 4. Complicated is better than complex.\n', - '? ++++ ^ ^\n', - '+ 5. Flat is better than nested.\n'] - - As a single multi-line string it looks like this: - - >>> print ''.join(result), - 1. Beautiful is better than ugly. - - 2. Explicit is better than implicit. - - 3. Simple is better than complex. - + 3. Simple is better than complex. - ? ++ - - 4. Complex is better than complicated. - ? ^ ---- ^ - + 4. Complicated is better than complex. - ? ++++ ^ ^ - + 5. Flat is better than nested. - - Methods: - - __init__(linejunk=None, charjunk=None) - Construct a text differencer, with optional filters. - - compare(a, b) - Compare two sequences of lines; return the resulting delta (list). - """ - - def __init__(self, linejunk=None, charjunk=None): - """ - Construct a text differencer, with optional filters. - - The two optional keyword parameters are for filter functions: - - - `linejunk`: A function that should accept a single string argument, - and return true iff the string is junk. The module-level function - `IS_LINE_JUNK` may be used to filter out lines without visible - characters, except for at most one splat ('#'). - - - `charjunk`: A function that should accept a string of length 1. The - module-level function `IS_CHARACTER_JUNK` may be used to filter out - whitespace characters (a blank or tab; **note**: bad idea to include - newline in this!). - """ - - self.linejunk = linejunk - self.charjunk = charjunk - self.results = [] - - def compare(self, a, b): - r""" - Compare two sequences of lines; return the resulting delta (list). - - Each sequence must contain individual single-line strings ending with - newlines. Such sequences can be obtained from the `readlines()` method - of file-like objects. The list returned is also made up of - newline-terminated strings, ready to be used with the `writelines()` - method of a file-like object. - - Example: - - >>> print ''.join(Differ().compare('one\ntwo\nthree\n'.splitlines(1), - ... 'ore\ntree\nemu\n'.splitlines(1))), - - one - ? ^ - + ore - ? ^ - - two - - three - ? - - + tree - + emu - """ - - cruncher = SequenceMatcher(self.linejunk, a, b) - for tag, alo, ahi, blo, bhi in cruncher.get_opcodes(): - if tag == 'replace': - self._fancy_replace(a, alo, ahi, b, blo, bhi) - elif tag == 'delete': - self._dump('-', a, alo, ahi) - elif tag == 'insert': - self._dump('+', b, blo, bhi) - elif tag == 'equal': - self._dump(' ', a, alo, ahi) - else: - raise ValueError, 'unknown tag ' + `tag` - results = self.results - self.results = [] - return results - - def _dump(self, tag, x, lo, hi): - """Store comparison results for a same-tagged range.""" - for i in xrange(lo, hi): - self.results.append('%s %s' % (tag, x[i])) - - def _plain_replace(self, a, alo, ahi, b, blo, bhi): - assert alo < ahi and blo < bhi - # dump the shorter block first -- reduces the burden on short-term - # memory if the blocks are of very different sizes - if bhi - blo < ahi - alo: - self._dump('+', b, blo, bhi) - self._dump('-', a, alo, ahi) - else: - self._dump('-', a, alo, ahi) - self._dump('+', b, blo, bhi) - - def _fancy_replace(self, a, alo, ahi, b, blo, bhi): - r""" - When replacing one block of lines with another, search the blocks - for *similar* lines; the best-matching pair (if any) is used as a - synch point, and intraline difference marking is done on the - similar pair. Lots of work, but often worth it. - - Example: - - >>> d = Differ() - >>> d._fancy_replace(['abcDefghiJkl\n'], 0, 1, ['abcdefGhijkl\n'], 0, 1) - >>> print ''.join(d.results), - - abcDefghiJkl - ? ^ ^ ^ - + abcdefGhijkl - ? ^ ^ ^ - """ - - if TRACE: - self.results.append('*** _fancy_replace %s %s %s %s\n' - % (alo, ahi, blo, bhi)) - self._dump('>', a, alo, ahi) - self._dump('<', b, blo, bhi) - - # don't synch up unless the lines have a similarity score of at - # least cutoff; best_ratio tracks the best score seen so far - best_ratio, cutoff = 0.74, 0.75 - cruncher = SequenceMatcher(self.charjunk) - eqi, eqj = None, None # 1st indices of equal lines (if any) - - # search for the pair that matches best without being identical - # (identical lines must be junk lines, & we don't want to synch up - # on junk -- unless we have to) - for j in xrange(blo, bhi): - bj = b[j] - cruncher.set_seq2(bj) - for i in xrange(alo, ahi): - ai = a[i] - if ai == bj: - if eqi is None: - eqi, eqj = i, j - continue - cruncher.set_seq1(ai) - # computing similarity is expensive, so use the quick - # upper bounds first -- have seen this speed up messy - # compares by a factor of 3. - # note that ratio() is only expensive to compute the first - # time it's called on a sequence pair; the expensive part - # of the computation is cached by cruncher - if cruncher.real_quick_ratio() > best_ratio and \ - cruncher.quick_ratio() > best_ratio and \ - cruncher.ratio() > best_ratio: - best_ratio, best_i, best_j = cruncher.ratio(), i, j - if best_ratio < cutoff: - # no non-identical "pretty close" pair - if eqi is None: - # no identical pair either -- treat it as a straight replace - self._plain_replace(a, alo, ahi, b, blo, bhi) - return - # no close pair, but an identical pair -- synch up on that - best_i, best_j, best_ratio = eqi, eqj, 1.0 - else: - # there's a close pair, so forget the identical pair (if any) - eqi = None - - # a[best_i] very similar to b[best_j]; eqi is None iff they're not - # identical - if TRACE: - self.results.append('*** best_ratio %s %s %s %s\n' - % (best_ratio, best_i, best_j)) - self._dump('>', a, best_i, best_i+1) - self._dump('<', b, best_j, best_j+1) - - # pump out diffs from before the synch point - self._fancy_helper(a, alo, best_i, b, blo, best_j) - - # do intraline marking on the synch pair - aelt, belt = a[best_i], b[best_j] - if eqi is None: - # pump out a '-', '?', '+', '?' quad for the synched lines - atags = btags = "" - cruncher.set_seqs(aelt, belt) - for tag, ai1, ai2, bj1, bj2 in cruncher.get_opcodes(): - la, lb = ai2 - ai1, bj2 - bj1 - if tag == 'replace': - atags += '^' * la - btags += '^' * lb - elif tag == 'delete': - atags += '-' * la - elif tag == 'insert': - btags += '+' * lb - elif tag == 'equal': - atags += ' ' * la - btags += ' ' * lb - else: - raise ValueError, 'unknown tag ' + `tag` - self._qformat(aelt, belt, atags, btags) - else: - # the synch pair is identical - self.results.append(' ' + aelt) - - # pump out diffs from after the synch point - self._fancy_helper(a, best_i+1, ahi, b, best_j+1, bhi) - - def _fancy_helper(self, a, alo, ahi, b, blo, bhi): - if alo < ahi: - if blo < bhi: - self._fancy_replace(a, alo, ahi, b, blo, bhi) - else: - self._dump('-', a, alo, ahi) - elif blo < bhi: - self._dump('+', b, blo, bhi) - - def _qformat(self, aline, bline, atags, btags): - r""" - Format "?" output and deal with leading tabs. - - Example: - - >>> d = Differ() - >>> d._qformat('\tabcDefghiJkl\n', '\t\tabcdefGhijkl\n', - ... ' ^ ^ ^ ', '+ ^ ^ ^ ') - >>> for line in d.results: print repr(line) - ... - '- \tabcDefghiJkl\n' - '? \t ^ ^ ^\n' - '+ \t\tabcdefGhijkl\n' - '? \t ^ ^ ^\n' - """ - - # Can hurt, but will probably help most of the time. - common = min(_count_leading(aline, "\t"), - _count_leading(bline, "\t")) - common = min(common, _count_leading(atags[:common], " ")) - atags = atags[common:].rstrip() - btags = btags[common:].rstrip() - - self.results.append("- " + aline) - if atags: - self.results.append("? %s%s\n" % ("\t" * common, atags)) - - self.results.append("+ " + bline) - if btags: - self.results.append("? %s%s\n" % ("\t" * common, btags)) - -# With respect to junk, an earlier version of ndiff simply refused to -# *start* a match with a junk element. The result was cases like this: -# before: private Thread currentThread; -# after: private volatile Thread currentThread; -# If you consider whitespace to be junk, the longest contiguous match -# not starting with junk is "e Thread currentThread". So ndiff reported -# that "e volatil" was inserted between the 't' and the 'e' in "private". -# While an accurate view, to people that's absurd. The current version -# looks for matching blocks that are entirely junk-free, then extends the -# longest one of those as far as possible but only with matching junk. -# So now "currentThread" is matched, then extended to suck up the -# preceding blank; then "private" is matched, and extended to suck up the -# following blank; then "Thread" is matched; and finally ndiff reports -# that "volatile " was inserted before "Thread". The only quibble -# remaining is that perhaps it was really the case that " volatile" -# was inserted after "private". I can live with that . - -import re - -def IS_LINE_JUNK(line, pat=re.compile(r"\s*#?\s*$").match): - r""" - Return 1 for ignorable line: iff `line` is blank or contains a single '#'. - - Examples: - - >>> IS_LINE_JUNK('\n') - 1 - >>> IS_LINE_JUNK(' # \n') - 1 - >>> IS_LINE_JUNK('hello\n') - 0 - """ - - return pat(line) is not None - -def IS_CHARACTER_JUNK(ch, ws=" \t"): - r""" - Return 1 for ignorable character: iff `ch` is a space or tab. - - Examples: - - >>> IS_CHARACTER_JUNK(' ') - 1 - >>> IS_CHARACTER_JUNK('\t') - 1 - >>> IS_CHARACTER_JUNK('\n') - 0 - >>> IS_CHARACTER_JUNK('x') - 0 - """ - - return ch in ws - -del re - -def ndiff(a, b, linejunk=IS_LINE_JUNK, charjunk=IS_CHARACTER_JUNK): - r""" - Compare `a` and `b` (lists of strings); return a `Differ`-style delta. - - Optional keyword parameters `linejunk` and `charjunk` are for filter - functions (or None): - - - linejunk: A function that should accept a single string argument, and - return true iff the string is junk. The default is module-level function - IS_LINE_JUNK, which filters out lines without visible characters, except - for at most one splat ('#'). - - - charjunk: A function that should accept a string of length 1. The - default is module-level function IS_CHARACTER_JUNK, which filters out - whitespace characters (a blank or tab; note: bad idea to include newline - in this!). - - Tools/scripts/ndiff.py is a command-line front-end to this function. - - Example: - - >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(1), - ... 'ore\ntree\nemu\n'.splitlines(1)) - >>> print ''.join(diff), - - one - ? ^ - + ore - ? ^ - - two - - three - ? - - + tree - + emu - """ - return Differ(linejunk, charjunk).compare(a, b) - -def restore(delta, which): - r""" - Return one of the two sequences that generated a delta. - - Given a `delta` produced by `Differ.compare()` or `ndiff()`, extract - lines originating from file 1 or 2 (parameter `which`), stripping off line - prefixes. - - Examples: - - >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(1), - ... 'ore\ntree\nemu\n'.splitlines(1)) - >>> print ''.join(restore(diff, 1)), - one - two - three - >>> print ''.join(restore(diff, 2)), - ore - tree - emu - """ - try: - tag = {1: "- ", 2: "+ "}[int(which)] - except KeyError: - raise ValueError, ('unknown delta choice (must be 1 or 2): %r' - % which) - prefixes = (" ", tag) - results = [] - for line in delta: - if line[:2] in prefixes: - results.append(line[2:]) - return results - -def _test(): - import doctest, difflib - return doctest.testmod(difflib) - -if __name__ == "__main__": - _test() diff --git a/docutils/test/package_unittest.py b/docutils/test/package_unittest.py deleted file mode 100644 index 019d6fb38..000000000 --- a/docutils/test/package_unittest.py +++ /dev/null @@ -1,156 +0,0 @@ -#! /usr/bin/env python - -# Author: Garth Kidd -# Contact: garth@deadlybloodyserious.com -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -This module extends unittest.py with `loadTestModules()`, by loading multiple -test modules from a directory. Optionally, test packages are also loaded, -recursively. -""" - -import sys -import os -import getopt -import types -import unittest -import re - - -# So that individual test modules can share a bit of state, -# `package_unittest` acts as an intermediary for the following -# variables: -debug = 0 -verbosity = 1 - -USAGE = """\ -Usage: test_whatever [options] - -Options: - -h, --help Show this message - -v, --verbose Verbose output - -q, --quiet Minimal output - -d, --debug Debug mode -""" - -def usageExit(msg=None): - """Print usage and exit.""" - if msg: - print msg - print USAGE - sys.exit(2) - -def parseArgs(argv=sys.argv): - """Parse command line arguments and set TestFramework state. - - State is to be acquired by test_* modules by a grotty hack: - ``from TestFramework import *``. For this stylistic - transgression, I expect to be first up against the wall - when the revolution comes. --Garth""" - global verbosity, debug - try: - options, args = getopt.getopt(argv[1:], 'hHvqd', - ['help', 'verbose', 'quiet', 'debug']) - for opt, value in options: - if opt in ('-h', '-H', '--help'): - usageExit() - if opt in ('-q', '--quiet'): - verbosity = 0 - if opt in ('-v', '--verbose'): - verbosity = 2 - if opt in ('-d', '--debug'): - debug =1 - if len(args) != 0: - usageExit("No command-line arguments supported yet.") - except getopt.error, msg: - self.usageExit(msg) - -def loadTestModules(path, name='', packages=None): - """ - Return a test suite composed of all the tests from modules in a directory. - - Search for modules in directory `path`, beginning with `name`. If - `packages` is true, search subdirectories (also beginning with `name`) - recursively. Subdirectories must be Python packages; they must contain an - '__init__.py' module. - """ - testLoader = unittest.defaultTestLoader - testSuite = unittest.TestSuite() - testModules = [] - path = os.path.abspath(path) # current working dir if `path` empty - paths = [path] - while paths: - p = paths.pop(0) - files = os.listdir(p) - for filename in files: - if filename.startswith(name): - fullpath = os.path.join(p, filename) - if filename.endswith('.py'): - fullpath = fullpath[len(path)+1:] - testModules.append(path2mod(fullpath)) - elif packages and os.path.isdir(fullpath) and \ - os.path.isfile(os.path.join(fullpath, '__init__.py')): - paths.append(fullpath) - # Import modules and add their tests to the suite. - sys.path.insert(0, path) - for mod in testModules: - if debug: - print >>sys.stderr, "importing %s" % mod - module = import_module(mod) - # if there's a suite defined, incorporate its contents - try: - suite = getattr(module, 'suite') - except AttributeError: - # Look for individual tests - moduleTests = testLoader.loadTestsFromModule(module) - # unittest.TestSuite.addTests() doesn't work as advertised, - # as it can't load tests from another TestSuite, so we have - # to cheat: - testSuite.addTest(moduleTests) - continue - if type(suite) == types.FunctionType: - testSuite.addTest(suite()) - elif type(suite) == types.InstanceType \ - and isinstance(suite, unittest.TestSuite): - testSuite.addTest(suite) - else: - raise AssertionError, "don't understand suite (%s)" % mod - sys.path.pop(0) - return testSuite - -def path2mod(path): - """Convert a file path to a dotted module name.""" - return path[:-3].replace(os.sep, '.') - -def import_module(name): - """Import a dotted-path module name, and return the final component.""" - mod = __import__(name) - components = name.split('.') - for comp in components[1:]: - mod = getattr(mod, comp) - return mod - -def main(suite=None): - """ - Shared `main` for any individual test_* file. - - suite -- TestSuite to run. If not specified, look for any globally defined - tests and run them. - """ - parseArgs() - if suite is None: - # Load any globally defined tests. - suite = unittest.defaultTestLoader.loadTestsFromModule( - __import__('__main__')) - if debug: - print >>sys.stderr, "Debug: Suite=%s" % suite - testRunner = unittest.TextTestRunner(verbosity=verbosity) - # run suites (if we were called from test_all) or suite... - if type(suite) == type([]): - for s in suite: - testRunner.run(s) - else: - testRunner.run(suite) diff --git a/docutils/test/test_language.py b/docutils/test/test_language.py deleted file mode 100644 index cf9d75804..000000000 --- a/docutils/test/test_language.py +++ /dev/null @@ -1,210 +0,0 @@ -#!/usr/bin/env python - -# Authors: Engelbert Gruber; David Goodger -# Contact: grubert@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for language module completeness. - -Specify a language code (e.g. "de") as a command-line parameter to test only -that language. -""" - -import sys -import os -import re -from types import UnicodeType -import docutils.languages -import docutils.parsers.rst.languages -from docutils.parsers.rst import states, directives -from DocutilsTestSupport import CustomTestSuite, CustomTestCase - -reference_language = 'en' - - -class LanguageTestSuite(CustomTestSuite): - - language_module_pattern = re.compile('^([a-z]{2,3}(_[a-z]{2,8})*)\.py$') - - def __init__(self, languages=None): - CustomTestSuite.__init__(self) - if languages: - self.languages = languages - else: - self.get_languages() - - def get_languages(self): - """ - Get installed language translations from docutils.languages and from - docutils.parsers.rst.languages. - """ - languages = {} - for mod in (os.listdir(docutils.languages.__path__[0]) - + os.listdir(docutils.parsers.rst.languages.__path__[0])): - match = self.language_module_pattern.match(mod) - if match: - languages[match.group(1)] = 1 - self.languages = languages.keys() - - def generateTests(self): - for language in self.languages: - for method in LanguageTestCase.test_methods: - self.addTestCase(LanguageTestCase, method, None, None, - id=language+'.py', language=language) - - -class LanguageTestCase(CustomTestCase): - - test_methods = ['test_labels', 'test_bibliographic_fields', - 'test_directives', 'test_roles'] - """Names of methods used to test each language.""" - - def __init__(self, *args, **kwargs): - self.ref = docutils.languages.get_language(reference_language) - self.language = kwargs['language'] - del kwargs['language'] # only wanted here - CustomTestCase.__init__(self, *args, **kwargs) - - def _xor(self, ref_dict, l_dict): - """ - Returns entries that are only in one dictionary. - (missing_in_lang, more_than_in_ref). - """ - missing = [] # in ref but not in l. - too_much = [] # in l but not in ref. - for label in ref_dict.keys(): - if not l_dict.has_key(label): - missing.append(label) - for label in l_dict.keys(): - if not ref_dict.has_key(label): - too_much.append(label) - return (missing, too_much) - - def _invert(self, adict): - """Return an inverted (keys & values swapped) dictionary.""" - inverted = {} - for key, value in adict.items(): - inverted[value] = key - return inverted - - def test_labels(self): - try: - module = docutils.languages.get_language(self.language) - if not module: - raise ImportError - except ImportError: - self.fail('No docutils.languages.%s module.' % self.language) - missed, unknown = self._xor(self.ref.labels, module.labels) - if missed or unknown: - self.fail('Module docutils.languages.%s.labels:\n' - ' Missed: %s; Unknown: %s' - % (self.language, str(missed), str(unknown))) - - def test_bibliographic_fields(self): - try: - module = docutils.languages.get_language(self.language) - if not module: - raise ImportError - except ImportError: - self.fail('No docutils.languages.%s module.' % self.language) - missed, unknown = self._xor( - self._invert(self.ref.bibliographic_fields), - self._invert(module.bibliographic_fields)) - if missed or unknown: - self.fail('Module docutils.languages.%s.bibliographic_fields:\n' - ' Missed: %s; Unknown: %s' - % (self.language, str(missed), str(unknown))) - - def test_directives(self): - try: - module = docutils.parsers.rst.languages.get_language( - self.language) - if not module: - raise ImportError - except ImportError: - self.fail('No docutils.parsers.rst.languages.%s module.' - % self.language) - failures = [] - for d in module.directives.keys(): - try: - func, msg = directives.directive(d, module, None) - if not func: - failures.append('"%s": unknown directive' % d) - except Exception, error: - failures.append('"%s": %s' % (d, error)) - inverted = self._invert(module.directives) - canonical = directives._directive_registry.keys() - canonical.sort() - canonical.remove('restructuredtext-test-directive') - for name in canonical: - if not inverted.has_key(name): - failures.append('"%s": translation missing' % name) - if failures: - text = ('Module docutils.parsers.rst.languages.%s:\n %s' - % (self.language, '\n '.join(failures))) - if type(text) == UnicodeType: - text = text.encode('raw_unicode_escape') - self.fail(text) - - def test_roles(self): - try: - module = docutils.parsers.rst.languages.get_language( - self.language) - if not module: - raise ImportError - module.roles - except ImportError: - self.fail('No docutils.parsers.rst.languages.%s module.' - % self.language) - except AttributeError: - self.fail('No "roles" mapping in docutils.parsers.rst.languages.' - '%s module.' % self.language) - failures = [] - for d in module.roles.values(): - try: - method = states.Inliner._interpreted_roles[d] - #if not method: - # failures.append('"%s": unknown role' % d) - except KeyError, error: - failures.append('"%s": %s' % (d, error)) - inverted = self._invert(module.roles) - canonical = states.Inliner._interpreted_roles.keys() - canonical.sort() - canonical.remove('restructuredtext-unimplemented-role') - for name in canonical: - if not inverted.has_key(name): - failures.append('"%s": translation missing' % name) - if failures: - text = ('Module docutils.parsers.rst.languages.%s:\n %s' - % (self.language, '\n '.join(failures))) - if type(text) == UnicodeType: - text = text.encode('raw_unicode_escape') - self.fail(text) - - -languages_to_test = [] - -def suite(): - s = LanguageTestSuite(languages_to_test) - s.generateTests() - return s - -def get_language_arguments(): - while len(sys.argv) > 1: - last = sys.argv[-1] - if last.startswith('-'): - break - languages_to_test.append(last) - sys.argv.pop() - languages_to_test.reverse() - - -if __name__ == '__main__': - get_language_arguments() - import unittest - unittest.main(defaultTest='suite') - -# vim: set et ts=4 ai : diff --git a/docutils/test/test_nodes.py b/docutils/test/test_nodes.py deleted file mode 100755 index 4258d7817..000000000 --- a/docutils/test/test_nodes.py +++ /dev/null @@ -1,153 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Test module for nodes.py. -""" - -import unittest -from types import ClassType -from DocutilsTestSupport import nodes, utils - -debug = 0 - - -class TextTests(unittest.TestCase): - - def setUp(self): - self.text = nodes.Text('Line 1.\nLine 2.') - - def test_repr(self): - self.assertEquals(repr(self.text), r"<#text: 'Line 1.\nLine 2.'>") - - def test_str(self): - self.assertEquals(str(self.text), 'Line 1.\nLine 2.') - - def test_astext(self): - self.assertEquals(self.text.astext(), 'Line 1.\nLine 2.') - - def test_pformat(self): - self.assertEquals(self.text.pformat(), 'Line 1.\nLine 2.\n') - - -class ElementTests(unittest.TestCase): - - def test_empty(self): - element = nodes.Element() - self.assertEquals(repr(element), '') - self.assertEquals(str(element), '') - dom = element.asdom() - self.assertEquals(dom.toxml(), '') - dom.unlink() - element['attr'] = '1' - self.assertEquals(repr(element), '') - self.assertEquals(str(element), '') - dom = element.asdom() - self.assertEquals(dom.toxml(), '') - dom.unlink() - self.assertEquals(element.pformat(), '\n') - del element['attr'] - element['mark'] = u'\u2022' - self.assertEquals(repr(element), '') - self.assertEquals(str(element), '') - dom = element.asdom() - self.assertEquals(dom.toxml(), u'') - dom.unlink() - - def test_withtext(self): - element = nodes.Element('text\nmore', nodes.Text('text\nmore')) - self.assertEquals(repr(element), r">") - self.assertEquals(str(element), 'text\nmore') - dom = element.asdom() - self.assertEquals(dom.toxml(), 'text\nmore') - dom.unlink() - element['attr'] = '1' - self.assertEquals(repr(element), r">") - self.assertEquals(str(element), - 'text\nmore') - dom = element.asdom() - self.assertEquals(dom.toxml(), - 'text\nmore') - dom.unlink() - self.assertEquals(element.pformat(), -"""\ - - text - more -""") - - -class MiscTests(unittest.TestCase): - - def test_node_class_names(self): - node_class_names = [] - for x in dir(nodes): - c = getattr(nodes, x) - if type(c) is ClassType and issubclass(c, nodes.Node) \ - and len(c.__bases__) > 1: - node_class_names.append(x) - node_class_names.sort() - nodes.node_class_names.sort() - self.assertEquals(node_class_names, nodes.node_class_names) - - ids = [('a', 'a'), ('A', 'a'), ('', ''), ('a b \n c', 'a-b-c'), - ('a.b.c', 'a-b-c'), (' - a - b - c - ', 'a-b-c'), (' - ', ''), - (u'\u2020\u2066', ''), (u'a \xa7 b \u2020 c', 'a-b-c'), - ('1', ''), ('1abc', 'abc')] - - def test_make_id(self): - for input, output in self.ids: - normed = nodes.make_id(input) - self.assertEquals(normed, output) - - -class TreeCopyVisitorTests(unittest.TestCase): - - def setUp(self): - document = utils.new_document('test data') - document += nodes.paragraph('', 'Paragraph 1.') - blist = nodes.bullet_list() - for i in range(1, 6): - item = nodes.list_item() - for j in range(1, 4): - item += nodes.paragraph('', 'Item %s, paragraph %s.' % (i, j)) - blist += item - document += blist - self.document = document - - def compare_trees(self, one, two): - self.assertEquals(one.__class__, two.__class__) - self.assertNotEquals(id(one), id(two)) - children1 = one.get_children() - children2 = two.get_children() - self.assertEquals(len(children1), len(children2)) - for i in range(len(children1)): - self.compare_trees(children1[i], children2[i]) - - def test_copy_whole(self): - visitor = nodes.TreeCopyVisitor(self.document) - self.document.walkabout(visitor) - newtree = visitor.get_tree_copy() - self.assertEquals(self.document.pformat(), newtree.pformat()) - self.compare_trees(self.document, newtree) - - -class MiscFunctionTests(unittest.TestCase): - - names = [('a', 'a'), ('A', 'a'), ('A a A', 'a a a'), - ('A a A a', 'a a a a'), - (' AaA\n\r\naAa\tAaA\t\t', 'aaa aaa aaa')] - - def test_normalize_name(self): - for input, output in self.names: - normed = nodes.fully_normalize_name(input) - self.assertEquals(normed, output) - - -if __name__ == '__main__': - unittest.main() diff --git a/docutils/test/test_parsers/__init__.py b/docutils/test/test_parsers/__init__.py deleted file mode 100644 index 2fe79c55c..000000000 --- a/docutils/test/test_parsers/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -import os -import os.path -import sys - -sys.path.insert(0, os.path.abspath(os.curdir)) -prev = '' -while sys.path[0] != prev: - try: - import DocutilsTestSupport - break - except ImportError: - prev = sys.path[0] - sys.path[0] = os.path.dirname(prev) -sys.path.pop(0) diff --git a/docutils/test/test_parsers/test_rst/__init__.py b/docutils/test/test_parsers/test_rst/__init__.py deleted file mode 100644 index 2fe79c55c..000000000 --- a/docutils/test/test_parsers/test_rst/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -import os -import os.path -import sys - -sys.path.insert(0, os.path.abspath(os.curdir)) -prev = '' -while sys.path[0] != prev: - try: - import DocutilsTestSupport - break - except ImportError: - prev = sys.path[0] - sys.path[0] = os.path.dirname(prev) -sys.path.pop(0) diff --git a/docutils/test/test_parsers/test_rst/includes/include9.txt b/docutils/test/test_parsers/test_rst/includes/include9.txt deleted file mode 100644 index 9164722b3..000000000 --- a/docutils/test/test_parsers/test_rst/includes/include9.txt +++ /dev/null @@ -1,3 +0,0 @@ -In ../includes/include9.txt. - -.. include:: ../test_directives/include2.txt diff --git a/docutils/test/test_parsers/test_rst/test_SimpleTableParser.py b/docutils/test/test_parsers/test_rst/test_SimpleTableParser.py deleted file mode 100644 index 3bb669db1..000000000 --- a/docutils/test/test_parsers/test_rst/test_SimpleTableParser.py +++ /dev/null @@ -1,101 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for states.py. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.SimpleTableParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['simple_tables'] = [ -["""\ -============ ============ -A table with two columns. -============ ============ -""", -([12, 12], - [], - [[(0, 0, 1, ['A table with']), - (0, 0, 1, ['two columns.'])]])], -["""\ -============ ============ -A table with two columns -and two rows. -============ ============ -""", -([12, 12], - [], - [[(0, 0, 1, ['A table with']), - (0, 0, 1, ['two columns'])], - [(0, 0, 2, ['and']), - (0, 0, 2, ['two rows.'])]])], -["""\ -========== =========== -A table with four rows, ------------------------ -and two columns. -First and last rows -contain column spans. -======================= -""", -([10, 11], - [], - [[(0, 1, 1, ['A table with four rows,'])], - [(0, 0, 3, ['and two']), - (0, 0, 3, ['columns.'])], - [(0, 0, 4, ['First and']), - (0, 0, 4, ['last rows'])], - [(0, 1, 5, ['contain column spans.'])]])], -["""\ -======= ===== ====== -A bad table cell 2 -cell 3 cell 4 -============ ====== -""", -'TableMarkupError: Text in column margin at line offset 1.'], -["""\ -=========== ================ -A table with two header rows, ------------------------------ -the first with a span. -=========== ================ -Two body rows, -the second with a span. -============================= -""", -([11, 16], - [[(0, 1, 1, ['A table with two header rows,'])], - [(0, 0, 3, ['the first']), - (0, 0, 3, ['with a span.'])]], - [[(0, 0, 5, ['Two body']), - (0, 0, 5, ['rows,'])], - [(0, 1, 6, ['the second with a span.'])]])], -["""\ -============ ============= -A table with two head/body -============ ============= -row separators. -============ ============= -That's bad. -============ ============= -""", -'TableMarkupError: Multiple head/body row separators in table ' -'(at line offset 2 and 4); only one allowed.'], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_TableParser.py b/docutils/test/test_parsers/test_rst/test_TableParser.py deleted file mode 100755 index 08b13fc8c..000000000 --- a/docutils/test/test_parsers/test_rst/test_TableParser.py +++ /dev/null @@ -1,198 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for states.py. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.GridTableParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['grid_tables'] = [ -["""\ -+-------------------------------------+ -| A table with one cell and one line. | -+-------------------------------------+ -""", -[(0, 0, 2, 38, ['A table with one cell and one line.'])], -([37], - [], - [[(0, 0, 1, ['A table with one cell and one line.'])]])], -["""\ -+--------------+--------------+ -| A table with | two columns. | -+--------------+--------------+ -""", -[(0, 0, 2, 15, ['A table with']), - (0, 15, 2, 30, ['two columns.'])], -([14, 14], - [], - [[(0, 0, 1, ['A table with']), - (0, 0, 1, ['two columns.'])]])], -["""\ -+--------------+-------------+ -| A table with | two columns | -+--------------+-------------+ -| and | two rows. | -+--------------+-------------+ -""", -[(0, 0, 2, 15, ['A table with']), - (0, 15, 2, 29, ['two columns']), - (2, 0, 4, 15, ['and']), - (2, 15, 4, 29, ['two rows.'])], -([14, 13], - [], - [[(0, 0, 1, ['A table with']), - (0, 0, 1, ['two columns'])], - [(0, 0, 3, ['and']), - (0, 0, 3, ['two rows.'])]])], -["""\ -+--------------------------+ -| A table with three rows, | -+------------+-------------+ -| and two | columns. | -+------------+-------------+ -| First and last rows | -| contain column spans. | -+--------------------------+ -""", -[(0, 0, 2, 27, ['A table with three rows,']), - (2, 0, 4, 13, ['and two']), - (2, 13, 4, 27, ['columns.']), - (4, 0, 7, 27, ['First and last rows', 'contain column spans.'])], -([12, 13], - [], - [[(0, 1, 1, ['A table with three rows,']), - None], - [(0, 0, 3, ['and two']), - (0, 0, 3, ['columns.'])], - [(0, 1, 5, ['First and last rows', 'contain column spans.']), - None]])], -["""\ -+------------+-------------+---------------+ -| A table | two rows in | and row spans | -| with three +-------------+ to left and | -| columns, | the middle, | right. | -+------------+-------------+---------------+ -""", -[(0, 0, 4, 13, ['A table', 'with three', 'columns,']), - (0, 13, 2, 27, ['two rows in']), - (0, 27, 4, 43, ['and row spans', 'to left and', 'right.']), - (2, 13, 4, 27, ['the middle,'])], -([12, 13, 15], - [], - [[(1, 0, 1, ['A table', 'with three', 'columns,']), - (0, 0, 1, ['two rows in']), - (1, 0, 1, ['and row spans', 'to left and', 'right.'])], - [None, - (0, 0, 3, ['the middle,']), - None]])], -["""\ -+------------+-------------+---------------+ -| A table | | two rows in | and funny | -| with 3 +--+-------------+-+ stuff. | -| columns, | the middle, | | | -+------------+-------------+---------------+ -""", -[(0, 0, 4, 13, ['A table |', 'with 3 +--', 'columns,']), - (0, 13, 2, 27, ['two rows in']), - (0, 27, 4, 43, [' and funny', '-+ stuff.', ' |']), - (2, 13, 4, 27, ['the middle,'])], -([12, 13, 15], - [], - [[(1, 0, 1, ['A table |', 'with 3 +--', 'columns,']), - (0, 0, 1, ['two rows in']), - (1, 0, 1, [' and funny', '-+ stuff.', ' |'])], - [None, - (0, 0, 3, ['the middle,']), - None]])], -["""\ -+-----------+-------------------------+ -| W/NW cell | N/NE cell | -| +-------------+-----------+ -| | Middle cell | E/SE cell | -+-----------+-------------+ | -| S/SE cell | | -+-------------------------+-----------+ -""", -[(0, 0, 4, 12, ['W/NW cell', '', '']), - (0, 12, 2, 38, ['N/NE cell']), - (2, 12, 4, 26, ['Middle cell']), - (2, 26, 6, 38, ['E/SE cell', '', '']), - (4, 0, 6, 26, ['S/SE cell'])], -([11, 13, 11], - [], - [[(1, 0, 1, ['W/NW cell', '', '']), - (0, 1, 1, ['N/NE cell']), - None], - [None, - (0, 0, 3, ['Middle cell']), - (1, 0, 3, ['E/SE cell', '', ''])], - [(0, 1, 5, ['S/SE cell']), - None, - None]])], -["""\ -+--------------+-------------+ -| A bad table. | | -+--------------+ | -| Cells must be rectangles. | -+----------------------------+ -""", -'TableMarkupError: Malformed table; parse incomplete.', -'TableMarkupError: Malformed table; parse incomplete.'], -["""\ -+-------------------------------+ -| A table with two header rows, | -+------------+------------------+ -| the first | with a span. | -+============+==================+ -| Two body | rows, | -+------------+------------------+ -| the second with a span. | -+-------------------------------+ -""", -[(0, 0, 2, 32, ['A table with two header rows,']), - (2, 0, 4, 13, ['the first']), - (2, 13, 4, 32, ['with a span.']), - (4, 0, 6, 13, ['Two body']), - (4, 13, 6, 32, ['rows,']), - (6, 0, 8, 32, ['the second with a span.'])], -([12, 18], - [[(0, 1, 1, ['A table with two header rows,']), - None], - [(0, 0, 3, ['the first']), - (0, 0, 3, ['with a span.'])]], - [[(0, 0, 5, ['Two body']), - (0, 0, 5, ['rows,'])], - [(0, 1, 7, ['the second with a span.']), - None]])], -["""\ -+-------------------------------+ -| A table with two head/body | -+=============+=================+ -| row | separators. | -+=============+=================+ -| That's bad. | | -+-------------+-----------------+ -""", -'TableMarkupError: Multiple head/body row separators in table ' -'(at line offset 2 and 4); only one allowed.', -'TableMarkupError: Multiple head/body row separators in table ' -'(at line offset 2 and 4); only one allowed.'], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_block_quotes.py b/docutils/test/test_parsers/test_rst/test_block_quotes.py deleted file mode 100755 index 276e0132c..000000000 --- a/docutils/test/test_parsers/test_rst/test_block_quotes.py +++ /dev/null @@ -1,252 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for states.py. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['block_quotes'] = [ -["""\ -Line 1. -Line 2. - - Indented. -""", -"""\ - - - Line 1. - Line 2. - - - Indented. -"""], -["""\ -Line 1. -Line 2. - - Indented 1. - - Indented 2. -""", -"""\ - - - Line 1. - Line 2. - - - Indented 1. - - - Indented 2. -"""], -["""\ -Line 1. -Line 2. - Unexpectedly indented. -""", -"""\ - - - Line 1. - Line 2. - - - Unexpected indentation. - - - Unexpectedly indented. -"""], -["""\ -Line 1. -Line 2. - - Indented. -no blank line -""", -"""\ - - - Line 1. - Line 2. - - - Indented. - - - Block quote ends without a blank line; unexpected unindent. - - no blank line -"""], -["""\ -Here is a paragraph. - - Indent 8 spaces. - - Indent 4 spaces. - -Is this correct? Should it generate a warning? -Yes, it is correct, no warning necessary. -""", -"""\ - - - Here is a paragraph. - - - - Indent 8 spaces. - - Indent 4 spaces. - - Is this correct? Should it generate a warning? - Yes, it is correct, no warning necessary. -"""], -["""\ -Paragraph. - - Block quote. - - -- Attribution - -Paragraph. - - Block quote. - - --Attribution -""", -"""\ - - - Paragraph. - - - Block quote. - - Attribution - - Paragraph. - - - Block quote. - - Attribution -"""], -["""\ -Paragraph. - - Block quote. - - -- Attribution line one - and line two - -Paragraph. - - Block quote. - - -- Attribution line one - and line two -""", -"""\ - - - Paragraph. - - - Block quote. - - Attribution line one - and line two - - Paragraph. - - - Block quote. - - Attribution line one - and line two -"""], -["""\ -Paragraph. - - -- Not an attribution - -Paragraph. - - Block quote. - - \-- Not an attribution - -Paragraph. - - Block quote. - - --- Not an attribution - -Paragraph. - - Block quote. - - -- Not an attribution line one - and line two - and line three -""", -"""\ - - - Paragraph. - - - -- Not an attribution - - Paragraph. - - - Block quote. - - -- Not an attribution - - Paragraph. - - - Block quote. - - --- Not an attribution - - Paragraph. - - - Block quote. - - - - -- Not an attribution line one - - - - - and line two - - - and line three -"""], -] - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_bullet_lists.py b/docutils/test/test_parsers/test_rst/test_bullet_lists.py deleted file mode 100755 index 12ede6cf1..000000000 --- a/docutils/test/test_parsers/test_rst/test_bullet_lists.py +++ /dev/null @@ -1,181 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for states.py. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['bullet_lists'] = [ -["""\ -- item -""", -"""\ - - - - - item -"""], -["""\ -* item 1 - -* item 2 -""", -"""\ - - - - - item 1 - - - item 2 -"""], -["""\ -No blank line between: - -+ item 1 -+ item 2 -""", -"""\ - - - No blank line between: - - - - item 1 - - - item 2 -"""], -["""\ -- item 1, para 1. - - item 1, para 2. - -- item 2 -""", -"""\ - - - - - item 1, para 1. - - item 1, para 2. - - - item 2 -"""], -["""\ -- item 1, line 1 - item 1, line 2 -- item 2 -""", -"""\ - - - - - item 1, line 1 - item 1, line 2 - - - item 2 -"""], -["""\ -Different bullets: - -- item 1 - -+ item 2 - -* item 3 -- item 4 -""", -"""\ - - - Different bullets: - - - - item 1 - - - - item 2 - - - - item 3 - - - Bullet list ends without a blank line; unexpected unindent. - - - - item 4 -"""], -["""\ -- item -no blank line -""", -"""\ - - - - - item - - - Bullet list ends without a blank line; unexpected unindent. - - no blank line -"""], -["""\ -- - -empty item above -""", -"""\ - - - - - empty item above -"""], -["""\ -- -empty item above, no blank line -""", -"""\ - - - - - - Bullet list ends without a blank line; unexpected unindent. - - empty item above, no blank line -"""], -] - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_citations.py b/docutils/test/test_parsers/test_rst/test_citations.py deleted file mode 100755 index a92e151a4..000000000 --- a/docutils/test/test_parsers/test_rst/test_citations.py +++ /dev/null @@ -1,139 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for states.py. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['citations'] = [ -["""\ -.. [citation] This is a citation. -""", -"""\ - - -

This file is used by test_raw.py.

diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_admonitions.py b/docutils/test/test_parsers/test_rst/test_directives/test_admonitions.py deleted file mode 100755 index af24935c1..000000000 --- a/docutils/test/test_parsers/test_rst/test_directives/test_admonitions.py +++ /dev/null @@ -1,184 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for admonitions.py directives. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['admonitions'] = [ -["""\ -.. Attention:: Directives at large. - -.. Note:: This is a note. - -.. Tip:: 15% if the - service is good. - -.. Hint:: It's bigger than a bread box. - -- .. WARNING:: Strong prose may provoke extreme mental exertion. - Reader discretion is strongly advised. -- .. Error:: Does not compute. - -.. Caution:: - - Don't take any wooden nickels. - -.. DANGER:: Mad scientist at work! - -.. Important:: - - Wash behind your ears. - - Clean up your room. - - Call your mother. - - Back up your data. -""", -"""\ - - - - Directives at large. - - - This is a note. - - - 15% if the - service is good. - - - It's bigger than a bread box. - - - - - Strong prose may provoke extreme mental exertion. - Reader discretion is strongly advised. - - - - Does not compute. - - - Don't take any wooden nickels. - - - Mad scientist at work! - - - - - Wash behind your ears. - - - Clean up your room. - - - Call your mother. - - - Back up your data. -"""], -["""\ -.. note:: One-line notes. -.. note:: One after the other. -.. note:: No blank lines in-between. -""", -"""\ - - - - One-line notes. - - - One after the other. - - - No blank lines in-between. -"""], -["""\ -.. note:: -""", -"""\ - - - - The "note" admonition is empty; content required. - - .. note:: -"""], -["""\ -.. admonition:: Admonition - - This is a generic admonition. -""", -"""\ - - - - Admonition - <paragraph> - This is a generic admonition. -"""], -["""\ -.. admonition:: And, by the way... - - You can make up your own admonition too. -""", -"""\ -<document source="test data"> - <admonition class="admonition-and-by-the-way"> - <title> - And, by the way... - <paragraph> - You can make up your own admonition too. -"""], -["""\ -.. admonition:: Admonition - :class: emergency - - Test the "class" override. -""", -"""\ -<document source="test data"> - <admonition class="emergency"> - <title> - Admonition - <paragraph> - Test the "class" override. -"""], -["""\ -.. admonition:: - - Generic admonitions require a title. -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "admonition" directive: - 1 argument(s) required, 0 supplied. - <literal_block xml:space="preserve"> - .. admonition:: - - Generic admonitions require a title. -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_contents.py b/docutils/test/test_parsers/test_rst/test_directives/test_contents.py deleted file mode 100755 index de5913708..000000000 --- a/docutils/test/test_parsers/test_rst/test_directives/test_contents.py +++ /dev/null @@ -1,208 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for parts.py contents directive. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['contents'] = [ -["""\ -.. contents:: -""", -"""\ -<document source="test data"> - <pending> - .. internal attributes: - .transform: docutils.transforms.parts.Contents - .details: - title: None -"""], -["""\ -.. contents:: Table of Contents -""", -"""\ -<document source="test data"> - <pending> - .. internal attributes: - .transform: docutils.transforms.parts.Contents - .details: - title: - <title> - Table of Contents -"""], -["""\ -.. contents:: - Table of Contents -""", -"""\ -<document source="test data"> - <pending> - .. internal attributes: - .transform: docutils.transforms.parts.Contents - .details: - title: - <title> - Table of Contents -"""], -["""\ -.. contents:: Table - of - Contents -""", -"""\ -<document source="test data"> - <pending> - .. internal attributes: - .transform: docutils.transforms.parts.Contents - .details: - title: - <title> - Table - of - Contents -"""], -["""\ -.. contents:: *Table* of ``Contents`` -""", -"""\ -<document source="test data"> - <pending> - .. internal attributes: - .transform: docutils.transforms.parts.Contents - .details: - title: - <title> - <emphasis> - Table - of \n\ - <literal> - Contents -"""], -["""\ -.. contents:: - :depth: 2 - :local: -""", -"""\ -<document source="test data"> - <pending> - .. internal attributes: - .transform: docutils.transforms.parts.Contents - .details: - depth: 2 - local: None - title: None -"""], -["""\ -.. contents:: - :local: arg -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "contents" directive: - invalid option value: (option: "local"; value: 'arg') - no argument is allowed; "arg" supplied. - <literal_block xml:space="preserve"> - .. contents:: - :local: arg -"""], -["""\ -.. contents:: Table of Contents - :local: - :depth: 2 - :backlinks: none -""", -"""\ -<document source="test data"> - <pending> - .. internal attributes: - .transform: docutils.transforms.parts.Contents - .details: - backlinks: None - depth: 2 - local: None - title: - <title> - Table of Contents -"""], -["""\ -.. contents:: - :depth: two -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "contents" directive: - invalid option value: (option: "depth"; value: 'two') - invalid literal for int(): two. - <literal_block xml:space="preserve"> - .. contents:: - :depth: two -"""], -["""\ -.. contents:: - :width: 2 -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "contents" directive: - unknown option: "width". - <literal_block xml:space="preserve"> - .. contents:: - :width: 2 -"""], -["""\ -.. contents:: - :backlinks: no way! -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "contents" directive: - invalid option value: (option: "backlinks"; value: 'no way!') - "no way!" unknown; choose from "top", "entry", or "none". - <literal_block xml:space="preserve"> - .. contents:: - :backlinks: no way! -"""], -["""\ -.. contents:: - :backlinks: -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "contents" directive: - invalid option value: (option: "backlinks"; value: None) - must supply an argument; choose from "top", "entry", or "none". - <literal_block xml:space="preserve"> - .. contents:: - :backlinks: -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_figures.py b/docutils/test/test_parsers/test_rst/test_directives/test_figures.py deleted file mode 100755 index 888744bad..000000000 --- a/docutils/test/test_parsers/test_rst/test_directives/test_figures.py +++ /dev/null @@ -1,287 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for images.py figure directives. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['figures'] = [ -["""\ -.. figure:: picture.png -""", -"""\ -<document source="test data"> - <figure> - <image uri="picture.png"> -"""], -["""\ -.. figure:: not an image URI -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Image URI contains whitespace. - <literal_block xml:space="preserve"> - .. figure:: not an image URI -"""], -["""\ -.. figure:: picture.png - - A picture with a caption. -""", -"""\ -<document source="test data"> - <figure> - <image uri="picture.png"> - <caption> - A picture with a caption. -"""], -["""\ -.. figure:: picture.png - - - A picture with an invalid caption. -""", -"""\ -<document source="test data"> - <figure> - <image uri="picture.png"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Figure caption must be a paragraph or empty comment. - <literal_block xml:space="preserve"> - .. figure:: picture.png - \n\ - - A picture with an invalid caption. -"""], -["""\ -.. figure:: not an image URI - - And a caption. -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Image URI contains whitespace. - <literal_block xml:space="preserve"> - .. figure:: not an image URI - \n\ - And a caption. -"""], -["""\ -.. figure:: picture.png - - .. - - A picture with a legend but no caption. -""", -"""\ -<document source="test data"> - <figure> - <image uri="picture.png"> - <legend> - <paragraph> - A picture with a legend but no caption. -"""], -["""\ -.. Figure:: picture.png - :height: 100 - :width: 200 - :scale: 50 - - A picture with image options and a caption. -""", -"""\ -<document source="test data"> - <figure> - <image height="100" scale="50" uri="picture.png" width="200"> - <caption> - A picture with image options and a caption. -"""], -["""\ -.. Figure:: picture.png - :height: 100 - :alt: alternate text - :width: 200 - :scale: 50 - :figwidth: 300 - - A picture with image options on individual lines, and this caption. -""", -"""\ -<document source="test data"> - <figure width="300"> - <image alt="alternate text" height="100" scale="50" uri="picture.png" width="200"> - <caption> - A picture with image options on individual lines, and this caption. -"""], -["""\ -This figure lacks a caption. It may still have a -"Figure 1."-style caption appended in the output. - -.. figure:: picture.png -""", -"""\ -<document source="test data"> - <paragraph> - This figure lacks a caption. It may still have a - "Figure 1."-style caption appended in the output. - <figure> - <image uri="picture.png"> -"""], -["""\ -.. figure:: picture.png - - A picture with a caption and a legend. - - +-----------------------+-----------------------+ - | Symbol | Meaning | - +=======================+=======================+ - | .. image:: tent.png | Campground | - +-----------------------+-----------------------+ - | .. image:: waves.png | Lake | - +-----------------------+-----------------------+ - | .. image:: peak.png | Mountain | - +-----------------------+-----------------------+ -""", -"""\ -<document source="test data"> - <figure> - <image uri="picture.png"> - <caption> - A picture with a caption and a legend. - <legend> - <table> - <tgroup cols="2"> - <colspec colwidth="23"> - <colspec colwidth="23"> - <thead> - <row> - <entry> - <paragraph> - Symbol - <entry> - <paragraph> - Meaning - <tbody> - <row> - <entry> - <image uri="tent.png"> - <entry> - <paragraph> - Campground - <row> - <entry> - <image uri="waves.png"> - <entry> - <paragraph> - Lake - <row> - <entry> - <image uri="peak.png"> - <entry> - <paragraph> - Mountain -"""], -["""\ -.. figure:: picture.png - - .. - - A picture with a legend but no caption. - (The empty comment replaces the caption, which must - be a single paragraph.) -""", -"""\ -<document source="test data"> - <figure> - <image uri="picture.png"> - <legend> - <paragraph> - A picture with a legend but no caption. - (The empty comment replaces the caption, which must - be a single paragraph.) -"""], -["""\ -Testing for line-leaks: - -.. figure:: picture.png - - A picture with a caption. -.. figure:: picture.png - - A picture with a caption. -.. figure:: picture.png - - A picture with a caption. -.. figure:: picture.png -.. figure:: picture.png -.. figure:: picture.png -.. figure:: picture.png - - A picture with a caption. - -.. figure:: picture.png - -.. figure:: picture.png - - A picture with a caption. - -.. figure:: picture.png -""", -"""\ -<document source="test data"> - <paragraph> - Testing for line-leaks: - <figure> - <image uri="picture.png"> - <caption> - A picture with a caption. - <figure> - <image uri="picture.png"> - <caption> - A picture with a caption. - <figure> - <image uri="picture.png"> - <caption> - A picture with a caption. - <figure> - <image uri="picture.png"> - <figure> - <image uri="picture.png"> - <figure> - <image uri="picture.png"> - <figure> - <image uri="picture.png"> - <caption> - A picture with a caption. - <figure> - <image uri="picture.png"> - <figure> - <image uri="picture.png"> - <caption> - A picture with a caption. - <figure> - <image uri="picture.png"> -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_images.py b/docutils/test/test_parsers/test_rst/test_directives/test_images.py deleted file mode 100755 index cde08dfe6..000000000 --- a/docutils/test/test_parsers/test_rst/test_directives/test_images.py +++ /dev/null @@ -1,249 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for images.py image directives. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['images'] = [ -["""\ -.. image:: picture.png -""", -"""\ -<document source="test data"> - <image uri="picture.png"> -"""], -["""\ -.. image:: -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "image" directive: - 1 argument(s) required, 0 supplied. - <literal_block xml:space="preserve"> - .. image:: -"""], -["""\ -.. image:: one two three -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Image URI contains whitespace. - <literal_block xml:space="preserve"> - .. image:: one two three -"""], -["""\ -.. image:: picture.png - :height: 100 - :width: 200 - :scale: 50 -""", -"""\ -<document source="test data"> - <image height="100" scale="50" uri="picture.png" width="200"> -"""], -["""\ -.. image:: - picture.png - :height: 100 - :width: 200 - :scale: 50 -""", -"""\ -<document source="test data"> - <image height="100" scale="50" uri="picture.png" width="200"> -"""], -["""\ -.. image:: - :height: 100 - :width: 200 - :scale: 50 -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "image" directive: - 1 argument(s) required, 0 supplied. - <literal_block xml:space="preserve"> - .. image:: - :height: 100 - :width: 200 - :scale: 50 -"""], -["""\ -.. image:: a/very/long/path/to/ - picture.png - :height: 100 - :width: 200 - :scale: 50 -""", -"""\ -<document source="test data"> - <image height="100" scale="50" uri="a/very/long/path/to/picture.png" width="200"> -"""], -["""\ -.. image:: picture.png - :height: 100 - :width: 200 - :scale: 50 - :alt: Alternate text for the picture -""", -"""\ -<document source="test data"> - <image alt="Alternate text for the picture" height="100" scale="50" uri="picture.png" width="200"> -"""], -["""\ -.. image:: picture.png - :scale: - 50 -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "image" directive: - invalid option value: (option: "scale"; value: '- 50') - negative value; must be positive or zero. - <literal_block xml:space="preserve"> - .. image:: picture.png - :scale: - 50 -"""], -["""\ -.. image:: picture.png - :scale: -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "image" directive: - invalid option value: (option: "scale"; value: None) - %s. - <literal_block xml:space="preserve"> - .. image:: picture.png - :scale: -""" % DocutilsTestSupport.exception_args('int(None)')[0]], -["""\ -.. image:: picture.png - :scale 50 -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "image" directive: - invalid option block. - <literal_block xml:space="preserve"> - .. image:: picture.png - :scale 50 -"""], -["""\ -.. image:: picture.png - scale: 50 -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Image URI contains whitespace. - <literal_block xml:space="preserve"> - .. image:: picture.png - scale: 50 -"""], -["""\ -.. image:: picture.png - :: 50 -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "image" directive: - invalid option block. - <literal_block xml:space="preserve"> - .. image:: picture.png - :: 50 -"""], -["""\ -.. image:: picture.png - :sale: 50 -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "image" directive: - unknown option: "sale". - <literal_block xml:space="preserve"> - .. image:: picture.png - :sale: 50 -"""], -["""\ -.. image:: picture.png - :scale is: 50 -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "image" directive: - invalid option data: extension option field name may not contain multiple words. - <literal_block xml:space="preserve"> - .. image:: picture.png - :scale is: 50 -"""], -["""\ -.. image:: picture.png - :scale: fifty -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "image" directive: - invalid option value: (option: "scale"; value: 'fifty') - invalid literal for int(): fifty. - <literal_block xml:space="preserve"> - .. image:: picture.png - :scale: fifty -"""], -["""\ -.. image:: picture.png - :scale: 50 - :scale: 50 -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "image" directive: - invalid option data: duplicate option "scale". - <literal_block xml:space="preserve"> - .. image:: picture.png - :scale: 50 - :scale: 50 -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_include.py b/docutils/test/test_parsers/test_rst/test_directives/test_include.py deleted file mode 100755 index 892ec9816..000000000 --- a/docutils/test/test_parsers/test_rst/test_directives/test_include.py +++ /dev/null @@ -1,309 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for misc.py "include" directive. -""" - -import os.path -from __init__ import DocutilsTestSupport - - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -mydir = os.path.dirname(suite.func_code.co_filename) -include1 = os.path.join(mydir, 'include1.txt') -include1rel = DocutilsTestSupport.utils.relative_path(None, include1) -include2 = os.path.join(mydir, 'include2.txt') -include3 = os.path.join(mydir, 'include3.txt') -include8 = os.path.join(mydir, 'include8.txt') -include9 = os.path.join(mydir, 'include9.txt') -include9rel = DocutilsTestSupport.utils.relative_path(None, include9) - - -totest = {} - -totest['include'] = [ -["""\ -Include Test -============ - -.. include:: %s - -A paragraph. -""" % include1, -"""\ -<document source="test data"> - <section id="include-test" name="include test"> - <title> - Include Test - <section id="inclusion-1" name="inclusion 1"> - <title> - Inclusion 1 - <paragraph> - This file is used by \n\ - <literal> - test_include.py - . - <paragraph> - A paragraph. -"""], -["""\ -Include Test -============ - -.. include:: %s - :literal: - -A paragraph. -""" % include1, -"""\ -<document source="test data"> - <section id="include-test" name="include test"> - <title> - Include Test - <literal_block source="%s" xml:space="preserve"> - Inclusion 1 - ----------- - \n\ - This file is used by ``test_include.py``. - <paragraph> - A paragraph. -""" % include1rel], -["""\ -Let's test the parse context. - - This paragraph is in a block quote. - - .. include:: %s - -The included paragraphs should also be in the block quote. -""" % include2, -"""\ -<document source="test data"> - <paragraph> - Let's test the parse context. - <block_quote> - <paragraph> - This paragraph is in a block quote. - <paragraph> - Here are some paragraphs - that can appear at any level. - <paragraph> - This file (include2.txt) is used by \n\ - <literal> - test_include.py - . - <paragraph> - The included paragraphs should also be in the block quote. -"""], -["""\ -Include Test -============ - -.. include:: nonexistent.txt - -A paragraph. -""", -"""\ -<document source="test data"> - <section id="include-test" name="include test"> - <title> - Include Test - <system_message level="4" line="4" source="test data" type="SEVERE"> - <paragraph> - Problems with "include" directive path: - [Errno 2] No such file or directory: 'nonexistent.txt'. - <literal_block xml:space="preserve"> - .. include:: nonexistent.txt - <paragraph> - A paragraph. -"""], -["""\ -Include Test -============ - -.. include:: %s - -.. include:: %s - -A paragraph. -""" % (include1, include1), -"""\ -<document source="test data"> - <section id="include-test" name="include test"> - <title> - Include Test - <section dupname="inclusion 1" id="inclusion-1"> - <title> - Inclusion 1 - <paragraph> - This file is used by - <literal> - test_include.py - . - <section dupname="inclusion 1" id="id1"> - <title> - Inclusion 1 - <system_message backrefs="id1" level="1" line="2" source="%s" type="INFO"> - <paragraph> - Duplicate implicit target name: "inclusion 1". - <paragraph> - This file is used by - <literal> - test_include.py - . - <paragraph> - A paragraph. -""" % include1rel], -["""\ -Include Test -============ - -.. include:: %s - ----------- - -.. include:: %s - -A paragraph. -""" % (include1, include1), -"""\ -<document source="test data"> - <section id="include-test" name="include test"> - <title> - Include Test - <section dupname="inclusion 1" id="inclusion-1"> - <title> - Inclusion 1 - <paragraph> - This file is used by - <literal> - test_include.py - . - <transition> - <system_message level="3" line="12" source="test data" type="ERROR"> - <paragraph> - Section may not end with a transition. - <section dupname="inclusion 1" id="id1"> - <title> - Inclusion 1 - <system_message backrefs="id1" level="1" line="2" source="%s" type="INFO"> - <paragraph> - Duplicate implicit target name: "inclusion 1". - <paragraph> - This file is used by - <literal> - test_include.py - . - <paragraph> - A paragraph. -""" % include1rel], -["""\ -In test data - -.. include:: %s -""" % include3, -"""\ -<document source="test data"> - <paragraph> - In test data - <paragraph> - In include3.txt - <paragraph> - In includes/include4.txt - <paragraph> - In includes/include5.txt - <paragraph> - In includes/more/include6.txt - <paragraph> - In includes/sibling/include7.txt -"""], -["""\ -In test data - -Section -======= - -(Section contents in nested parse; slice of input_lines ViewList.) - -.. include:: %s -""" % include3, -"""\ -<document source="test data"> - <paragraph> - In test data - <section id="section" name="section"> - <title> - Section - <paragraph> - (Section contents in nested parse; slice of input_lines ViewList.) - <paragraph> - In include3.txt - <paragraph> - In includes/include4.txt - <paragraph> - In includes/include5.txt - <paragraph> - In includes/more/include6.txt - <paragraph> - In includes/sibling/include7.txt -"""], -["""\ -Testing relative includes: - -.. include:: %s -""" % include8, -"""\ -<document source="test data"> - <paragraph> - Testing relative includes: - <paragraph> - In include8.txt - <paragraph> - In ../includes/include9.txt. - <paragraph> - Here are some paragraphs - that can appear at any level. - <paragraph> - This file (include2.txt) is used by - <literal> - test_include.py - . -"""], -# @@@ BUG with errors reported with incorrect "source" & "line": -# ["""\ -# Testing bad charent includes: -# -# .. include:: %s -# """ % include9, -# """\ -# <document source="test data"> -# <paragraph> -# Testing bad charent includes: -# <system_message level="3" line="1" source="%s" type="ERROR"> -# <paragraph> -# Invalid character code: 0xFFFFFFFFF -# int() literal too large: FFFFFFFFF -# <literal_block xml:space="preserve"> -# unicode:: 0xFFFFFFFFF -# <system_message level="2" line="1" source="%s" type="WARNING"> -# <paragraph> -# Substitution definition "bad" empty or invalid. -# <literal_block xml:space="preserve"> -# .. |bad| unicode:: 0xFFFFFFFFF -# """ % (include9rel, include9rel)], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_meta.py b/docutils/test/test_parsers/test_rst/test_directives/test_meta.py deleted file mode 100755 index ecfedd721..000000000 --- a/docutils/test/test_parsers/test_rst/test_directives/test_meta.py +++ /dev/null @@ -1,232 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for html.py meta directives. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['meta'] = [ -["""\ -.. meta:: - :description: The reStructuredText plaintext markup language - :keywords: plaintext,markup language -""", -"""\ -<document source="test data"> - <pending> - .. internal attributes: - .transform: docutils.transforms.components.Filter - .details: - component: 'writer' - format: 'html' - nodes: - <meta content="The reStructuredText plaintext markup language" name="description"> - <pending> - .. internal attributes: - .transform: docutils.transforms.components.Filter - .details: - component: 'writer' - format: 'html' - nodes: - <meta content="plaintext,markup language" name="keywords"> -"""], -["""\ -.. meta:: - :description lang=en: An amusing story - :description lang=fr: Un histoire amusant -""", -"""\ -<document source="test data"> - <pending> - .. internal attributes: - .transform: docutils.transforms.components.Filter - .details: - component: 'writer' - format: 'html' - nodes: - <meta content="An amusing story" lang="en" name="description"> - <pending> - .. internal attributes: - .transform: docutils.transforms.components.Filter - .details: - component: 'writer' - format: 'html' - nodes: - <meta content="Un histoire amusant" lang="fr" name="description"> -"""], -["""\ -.. meta:: - :http-equiv=Content-Type: text/html; charset=ISO-8859-1 -""", -"""\ -<document source="test data"> - <pending> - .. internal attributes: - .transform: docutils.transforms.components.Filter - .details: - component: 'writer' - format: 'html' - nodes: - <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> -"""], -["""\ -.. meta:: - :name: content - over multiple lines -""", -"""\ -<document source="test data"> - <pending> - .. internal attributes: - .transform: docutils.transforms.components.Filter - .details: - component: 'writer' - format: 'html' - nodes: - <meta content="content over multiple lines" name="name"> -"""], -["""\ -Paragraph - -.. meta:: - :name: content -""", -"""\ -<document source="test data"> - <paragraph> - Paragraph - <pending> - .. internal attributes: - .transform: docutils.transforms.components.Filter - .details: - component: 'writer' - format: 'html' - nodes: - <meta content="content" name="name"> -"""], -["""\ -.. meta:: -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Empty meta directive. - <literal_block xml:space="preserve"> - .. meta:: -"""], -["""\ -.. meta:: - :empty: -""", -"""\ -<document source="test data"> - <system_message level="1" line="2" source="test data" type="INFO"> - <paragraph> - No content for meta tag "empty". - <literal_block xml:space="preserve"> - :empty: -"""], -["""\ -.. meta:: - not a field list -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Invalid meta directive. - <literal_block xml:space="preserve"> - .. meta:: - not a field list -"""], -["""\ -.. meta:: - :name: content - not a field - :name: content -""", -"""\ -<document source="test data"> - <pending> - .. internal attributes: - .transform: docutils.transforms.components.Filter - .details: - component: 'writer' - format: 'html' - nodes: - <meta content="content" name="name"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Invalid meta directive. - <literal_block xml:space="preserve"> - .. meta:: - :name: content - not a field - :name: content -"""], -["""\ -.. meta:: - :name: content - :name: content - not a field -""", -"""\ -<document source="test data"> - <pending> - .. internal attributes: - .transform: docutils.transforms.components.Filter - .details: - component: 'writer' - format: 'html' - nodes: - <meta content="content" name="name"> - <pending> - .. internal attributes: - .transform: docutils.transforms.components.Filter - .details: - component: 'writer' - format: 'html' - nodes: - <meta content="content" name="name"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Invalid meta directive. - <literal_block xml:space="preserve"> - .. meta:: - :name: content - :name: content - not a field -"""], -["""\ -.. meta:: - :name notattval: content -""", -"""\ -<document source="test data"> - <system_message level="3" line="2" source="test data" type="ERROR"> - <paragraph> - Error parsing meta tag attribute "notattval": missing "=". - <literal_block xml:space="preserve"> - :name notattval: content -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_raw.py b/docutils/test/test_parsers/test_rst/test_directives/test_raw.py deleted file mode 100755 index cbce2f50d..000000000 --- a/docutils/test/test_parsers/test_rst/test_directives/test_raw.py +++ /dev/null @@ -1,84 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for misc.py "raw" directive. -""" - -import os.path -from __init__ import DocutilsTestSupport - - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -mydir = os.path.dirname(suite.func_code.co_filename) -raw1 = os.path.join(mydir, 'raw1.txt') - -totest = {} - -totest['raw'] = [ -["""\ -.. raw:: html - - <span>This is some plain old raw text.</span> -""", -"""\ -<document source="test data"> - <raw format="html" xml:space="preserve"> - <span>This is some plain old raw text.</span> -"""], -["""\ -.. raw:: html - :file: %s -""" % raw1, -"""\ -<document source="test data"> - <raw format="html" source="%s" xml:space="preserve"> - <p>This file is used by <tt>test_raw.py</tt>.</p> -""" % DocutilsTestSupport.utils.relative_path(None, raw1)], -["""\ -.. raw:: html - :file: rawfile.html - :url: http://example.org/ -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - The "file" and "url" options may not be simultaneously specified for the "raw" directive. - <literal_block xml:space="preserve"> - .. raw:: html - :file: rawfile.html - :url: http://example.org/ -"""], -["""\ -.. raw:: html - :file: rawfile.html - - <p>Can't have both content and file attribute.</p> -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - "raw" directive may not both specify an external file and have content. - <literal_block xml:space="preserve"> - .. raw:: html - :file: rawfile.html - - <p>Can't have both content and file attribute.</p> -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_replace.py b/docutils/test/test_parsers/test_rst/test_directives/test_replace.py deleted file mode 100755 index 6de59d3a4..000000000 --- a/docutils/test/test_parsers/test_rst/test_directives/test_replace.py +++ /dev/null @@ -1,135 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for misc.py "replace" directive. -""" - -from __init__ import DocutilsTestSupport - - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['replace'] = [ -["""\ -Test the |name| directive. - -.. |name| replace:: "**replace**" -""", -"""\ -<document source="test data"> - <paragraph> - Test the \n\ - <substitution_reference refname="name"> - name - directive. - <substitution_definition name="name"> - " - <strong> - replace - " -"""], -["""\ -.. |name| replace:: paragraph 1 - - paragraph 2 -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "replace" directive: may contain a single paragraph only. - <system_message level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Substitution definition "name" empty or invalid. - <literal_block xml:space="preserve"> - .. |name| replace:: paragraph 1 - - paragraph 2 -"""], -["""\ -.. |name| replace:: -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - The "replace" directive is empty; content required. - <system_message level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Substitution definition "name" empty or invalid. - <literal_block xml:space="preserve"> - .. |name| replace:: -"""], -["""\ -.. |Python| replace:: Python, *the* best language around - -.. _Python: http://www.python.org/ - -I recommend you try |Python|_. -""", -"""\ -<document source="test data"> - <substitution_definition name="Python"> - Python, - <emphasis> - the - best language around - <target id="python" name="python" refuri="http://www.python.org/"> - <paragraph> - I recommend you try - <reference refname="python"> - <substitution_reference refname="Python"> - Python - . -"""], -["""\ -.. |name| replace:: *error in **inline ``markup -""", -"""\ -<document source="test data"> - <system_message id="id1" level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Inline emphasis start-string without end-string. - <system_message id="id3" level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Inline strong start-string without end-string. - <system_message id="id5" level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Inline literal start-string without end-string. - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "replace" directive: may contain a single paragraph only. - <system_message level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Substitution definition "name" empty or invalid. - <literal_block xml:space="preserve"> - .. |name| replace:: *error in **inline ``markup -"""], -["""\ -.. replace:: not valid outside of a substitution definition -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Invalid context: the "replace" directive can only be used within a substitution definition. - <literal_block xml:space="preserve"> - .. replace:: not valid outside of a substitution definition -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_rubrics.py b/docutils/test/test_parsers/test_rst/test_directives/test_rubrics.py deleted file mode 100755 index 271802736..000000000 --- a/docutils/test/test_parsers/test_rst/test_directives/test_rubrics.py +++ /dev/null @@ -1,74 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for the "rubric" directive. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['rubrics'] = [ -["""\ -.. rubric:: This is a rubric -""", -"""\ -<document source="test data"> - <rubric> - This is a rubric -"""], -["""\ -.. rubric:: -.. rubric:: A rubric has no content - - Invalid content -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "rubric" directive: - 1 argument(s) required, 0 supplied. - <literal_block xml:space="preserve"> - .. rubric:: - <system_message level="3" line="2" source="test data" type="ERROR"> - <paragraph> - Error in "rubric" directive: - no content permitted. - <literal_block xml:space="preserve"> - .. rubric:: A rubric has no content - \n\ - Invalid content -"""], -["""\ -.. rubric:: A rubric followed by a block quote -.. - - Block quote -""", -"""\ -<document source="test data"> - <rubric> - A rubric followed by a block quote - <comment xml:space="preserve"> - <block_quote> - <paragraph> - Block quote -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_test_directives.py b/docutils/test/test_parsers/test_rst/test_directives/test_test_directives.py deleted file mode 100755 index 09313e32b..000000000 --- a/docutils/test/test_parsers/test_rst/test_directives/test_test_directives.py +++ /dev/null @@ -1,195 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for misc.py test directives. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['test_directives'] = [ -["""\ -.. reStructuredText-test-directive:: - -Paragraph. -""", -"""\ -<document source="test data"> - <system_message level="1" line="1" source="test data" type="INFO"> - <paragraph> - Directive processed. Type="reStructuredText-test-directive", arguments=[], options={}, content: None - <paragraph> - Paragraph. -"""], -["""\ -.. reStructuredText-test-directive :: - -An optional space before the "::". -""", -"""\ -<document source="test data"> - <system_message level="1" line="1" source="test data" type="INFO"> - <paragraph> - Directive processed. Type="reStructuredText-test-directive", arguments=[], options={}, content: None - <paragraph> - An optional space before the "::". -"""], -["""\ -.. reStructuredText-test-directive:: argument - -Paragraph. -""", -"""\ -<document source="test data"> - <system_message level="1" line="1" source="test data" type="INFO"> - <paragraph> - Directive processed. Type="reStructuredText-test-directive", arguments=['argument'], options={}, content: None - <paragraph> - Paragraph. -"""], -["""\ -.. reStructuredText-test-directive:: argument - :option: value - -Paragraph. -""", -"""\ -<document source="test data"> - <system_message level="1" line="1" source="test data" type="INFO"> - <paragraph> - Directive processed. Type="reStructuredText-test-directive", arguments=['argument'], options={'option': 'value'}, content: None - <paragraph> - Paragraph. -"""], -["""\ -.. reStructuredText-test-directive:: :option: value - -Paragraph. -""", -"""\ -<document source="test data"> - <system_message level="1" line="1" source="test data" type="INFO"> - <paragraph> - Directive processed. Type="reStructuredText-test-directive", arguments=[], options={'option': 'value'}, content: None - <paragraph> - Paragraph. -"""], -["""\ -.. reStructuredText-test-directive:: :option: - -Paragraph. -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "reStructuredText-test-directive" directive: - invalid option value: (option: "option"; value: None) - argument required but none supplied. - <literal_block xml:space="preserve"> - .. reStructuredText-test-directive:: :option: - <paragraph> - Paragraph. -"""], -["""\ -.. reStructuredText-test-directive:: - - Directive block contains one paragraph, with a blank line before. - -Paragraph. -""", -"""\ -<document source="test data"> - <system_message level="1" line="1" source="test data" type="INFO"> - <paragraph> - Directive processed. Type="reStructuredText-test-directive", arguments=[], options={}, content: - <literal_block xml:space="preserve"> - Directive block contains one paragraph, with a blank line before. - <paragraph> - Paragraph. -"""], -["""\ -.. reStructuredText-test-directive:: - - - Directive block contains one paragraph, with two blank lines before. - -Paragraph. -""", -"""\ -<document source="test data"> - <system_message level="1" line="1" source="test data" type="INFO"> - <paragraph> - Directive processed. Type="reStructuredText-test-directive", arguments=[], options={}, content: - <literal_block xml:space="preserve"> - Directive block contains one paragraph, with two blank lines before. - <paragraph> - Paragraph. -"""], -["""\ -.. reStructuredText-test-directive:: - Directive block contains one paragraph, no blank line before. - -Paragraph. -""", -"""\ -<document source="test data"> - <system_message level="1" line="1" source="test data" type="INFO"> - <paragraph> - Directive processed. Type="reStructuredText-test-directive", arguments=['Directive block contains one paragraph, no blank line before.'], options={}, content: None - <paragraph> - Paragraph. -"""], -["""\ -.. reStructuredText-test-directive:: - block -no blank line. - -Paragraph. -""", -"""\ -<document source="test data"> - <system_message level="1" line="1" source="test data" type="INFO"> - <paragraph> - Directive processed. Type="reStructuredText-test-directive", arguments=['block'], options={}, content: None - <system_message level="2" line="3" source="test data" type="WARNING"> - <paragraph> - Explicit markup ends without a blank line; unexpected unindent. - <paragraph> - no blank line. - <paragraph> - Paragraph. -"""], -["""\ -.. reStructuredText-test-directive:: argument - :option: * value1 - * value2 - -Paragraph. -""", -"""\ -<document source="test data"> - <system_message level="1" line="1" source="test data" type="INFO"> - <paragraph> - Directive processed. Type="reStructuredText-test-directive", arguments=['argument'], options={'option': '* value1\\n* value2'}, content: None - <paragraph> - Paragraph. -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_topics.py b/docutils/test/test_parsers/test_rst/test_directives/test_topics.py deleted file mode 100644 index fa3d91100..000000000 --- a/docutils/test/test_parsers/test_rst/test_directives/test_topics.py +++ /dev/null @@ -1,242 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for the "topic" directive. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['topics'] = [ -["""\ -.. topic:: -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "topic" directive: - 1 argument(s) required, 0 supplied. - <literal_block xml:space="preserve"> - .. topic:: -"""], -["""\ -.. topic:: Title -""", -"""\ -<document source="test data"> - <system_message level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Content block expected for the "topic" directive; none found. - <literal_block xml:space="preserve"> - .. topic:: Title -"""], -["""\ -.. topic:: Title - - Body. -""", -"""\ -<document source="test data"> - <topic> - <title> - Title - <paragraph> - Body. -"""], -["""\ -.. topic:: - - Title - - Body. -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "topic" directive: - 1 argument(s) required, 0 supplied. - <literal_block xml:space="preserve"> - .. topic:: - \n\ - Title - \n\ - Body. -"""], -["""\ -.. topic:: Title - Body. -""", -"""\ -<document source="test data"> - <system_message level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Content block expected for the "topic" directive; none found. - <literal_block xml:space="preserve"> - .. topic:: Title - Body. -"""], -["""\ -.. topic:: - - Title - Body. -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "topic" directive: - 1 argument(s) required, 0 supplied. - <literal_block xml:space="preserve"> - .. topic:: - \n\ - Title - Body. -"""], -["""\ -.. topic:: Title - - .. topic:: Nested - - Body. -""", -"""\ -<document source="test data"> - <topic> - <title> - Title - <system_message level="3" line="3" source="test data" type="ERROR"> - <paragraph> - The "topic" directive may not be used within topics, sidebars, or body elements. - <literal_block xml:space="preserve"> - .. topic:: Nested - \n\ - Body. -"""], -["""\ -.. topic:: Title - - .. topic:: Nested - - Body. - More. -""", -"""\ -<document source="test data"> - <topic> - <title> - Title - <system_message level="3" line="3" source="test data" type="ERROR"> - <paragraph> - The "topic" directive may not be used within topics, sidebars, or body elements. - <literal_block xml:space="preserve"> - .. topic:: Nested - \n\ - Body. - <system_message level="2" line="6" source="test data" type="WARNING"> - <paragraph> - Explicit markup ends without a blank line; unexpected unindent. - <paragraph> - More. -"""], -["""\ -.. topic:: Title - - .. topic:: Nested - - Body. - - More. - -More. -""", -"""\ -<document source="test data"> - <topic> - <title> - Title - <system_message level="3" line="3" source="test data" type="ERROR"> - <paragraph> - The "topic" directive may not be used within topics, sidebars, or body elements. - <literal_block xml:space="preserve"> - .. topic:: Nested - \n\ - Body. - <paragraph> - More. - <paragraph> - More. -"""], -["""\ -.. topic:: First - - Body - -.. topic:: Second - - Body. -""", -"""\ -<document source="test data"> - <topic> - <title> - First - <paragraph> - Body - <topic> - <title> - Second - <paragraph> - Body. -"""], -["""\ -.. sidebar:: Title - :subtitle: Outer - - .. topic:: Nested - - Body. - - More. - -More. -""", -"""\ -<document source="test data"> - <sidebar> - <title> - Title - <subtitle> - Outer - <system_message level="3" line="4" source="test data" type="ERROR"> - <paragraph> - The "topic" directive may not be used within topics, sidebars, or body elements. - <literal_block xml:space="preserve"> - .. topic:: Nested - \n\ - Body. - <paragraph> - More. - <paragraph> - More. -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_unicode.py b/docutils/test/test_parsers/test_rst/test_directives/test_unicode.py deleted file mode 100755 index 704c13fa5..000000000 --- a/docutils/test/test_parsers/test_rst/test_directives/test_unicode.py +++ /dev/null @@ -1,131 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for misc.py "unicode" directive. -""" - -from __init__ import DocutilsTestSupport - - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['unicode'] = [ -[""" -Insert an em-dash (|mdash|), a copyright symbol (|copy|), a non-breaking -space (|nbsp|), a backwards-not-equals (|bne|), and a captial omega (|Omega|). - -.. |mdash| unicode:: 0x02014 -.. |copy| unicode:: \\u00A9 -.. |nbsp| unicode::   -.. |bne| unicode:: U0003D U020E5 -.. |Omega| unicode:: U+003A9 -""", -u"""\ -<document source="test data"> - <paragraph> - Insert an em-dash ( - <substitution_reference refname="mdash"> - mdash - ), a copyright symbol ( - <substitution_reference refname="copy"> - copy - ), a non-breaking - space ( - <substitution_reference refname="nbsp"> - nbsp - ), a backwards-not-equals ( - <substitution_reference refname="bne"> - bne - ), and a captial omega ( - <substitution_reference refname="Omega"> - Omega - ). - <substitution_definition name="mdash"> - \u2014 - <substitution_definition name="copy"> - \u00A9 - <substitution_definition name="nbsp"> - \u00A0 - <substitution_definition name="bne"> - = - \u20e5 - <substitution_definition name="Omega"> - \u03a9 -"""], -[""" -Bad input: - -.. |empty| unicode:: -.. |not hex| unicode:: 0xHEX -.. |not all hex| unicode:: UABCX -.. unicode:: not in a substitution definition -""", -"""\ -<document source="test data"> - <paragraph> - Bad input: - <system_message level="3" line="4" source="test data" type="ERROR"> - <paragraph> - Error in "unicode" directive: - 1 argument(s) required, 0 supplied. - <literal_block xml:space="preserve"> - unicode:: - <system_message level="2" line="4" source="test data" type="WARNING"> - <paragraph> - Substitution definition "empty" empty or invalid. - <literal_block xml:space="preserve"> - .. |empty| unicode:: - <substitution_definition name="not hex"> - 0xHEX - <substitution_definition name="not all hex"> - UABCX - <system_message level="3" line="7" source="test data" type="ERROR"> - <paragraph> - Invalid context: the "unicode" directive can only be used within a substitution definition. - <literal_block xml:space="preserve"> - .. unicode:: not in a substitution definition -"""], -[""" -Testing comments and extra text. - -Copyright |copy| 2003, |BogusMegaCorp (TM)|. - -.. |copy| unicode:: 0xA9 .. copyright sign -.. |BogusMegaCorp (TM)| unicode:: BogusMegaCorp U+2122 - .. with trademark sign -""", -u"""\ -<document source="test data"> - <paragraph> - Testing comments and extra text. - <paragraph> - Copyright - <substitution_reference refname="copy"> - copy - 2003, - <substitution_reference refname="BogusMegaCorp (TM)"> - BogusMegaCorp (TM) - . - <substitution_definition name="copy"> - \u00A9 - <substitution_definition name="BogusMegaCorp (TM)"> - BogusMegaCorp - \u2122 -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_unknown.py b/docutils/test/test_parsers/test_rst/test_directives/test_unknown.py deleted file mode 100755 index 3c859faa3..000000000 --- a/docutils/test/test_parsers/test_rst/test_directives/test_unknown.py +++ /dev/null @@ -1,67 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for unknown directives. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['unknown'] = [ -["""\ -.. reStructuredText-unknown-directive:: - -.. reStructuredText-unknown-directive:: argument - -.. reStructuredText-unknown-directive:: - block -""", -"""\ -<document source="test data"> - <system_message level="1" line="1" source="test data" type="INFO"> - <paragraph> - No directive entry for "reStructuredText-unknown-directive" in module "docutils.parsers.rst.languages.en". - Trying "reStructuredText-unknown-directive" as canonical directive name. - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Unknown directive type "reStructuredText-unknown-directive". - <literal_block xml:space="preserve"> - .. reStructuredText-unknown-directive:: - <system_message level="1" line="3" source="test data" type="INFO"> - <paragraph> - No directive entry for "reStructuredText-unknown-directive" in module "docutils.parsers.rst.languages.en". - Trying "reStructuredText-unknown-directive" as canonical directive name. - <system_message level="3" line="3" source="test data" type="ERROR"> - <paragraph> - Unknown directive type "reStructuredText-unknown-directive". - <literal_block xml:space="preserve"> - .. reStructuredText-unknown-directive:: argument - <system_message level="1" line="5" source="test data" type="INFO"> - <paragraph> - No directive entry for "reStructuredText-unknown-directive" in module "docutils.parsers.rst.languages.en". - Trying "reStructuredText-unknown-directive" as canonical directive name. - <system_message level="3" line="5" source="test data" type="ERROR"> - <paragraph> - Unknown directive type "reStructuredText-unknown-directive". - <literal_block xml:space="preserve"> - .. reStructuredText-unknown-directive:: - block -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_doctest_blocks.py b/docutils/test/test_parsers/test_rst/test_doctest_blocks.py deleted file mode 100755 index c9637c6d6..000000000 --- a/docutils/test/test_parsers/test_rst/test_doctest_blocks.py +++ /dev/null @@ -1,74 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for states.py. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['doctest_blocks'] = [ -["""\ -Paragraph. - ->>> print "Doctest block." -Doctest block. - -Paragraph. -""", -"""\ -<document source="test data"> - <paragraph> - Paragraph. - <doctest_block xml:space="preserve"> - >>> print "Doctest block." - Doctest block. - <paragraph> - Paragraph. -"""], -["""\ -Paragraph. - ->>> print " Indented output." - Indented output. -""", -"""\ -<document source="test data"> - <paragraph> - Paragraph. - <doctest_block xml:space="preserve"> - >>> print " Indented output." - Indented output. -"""], -["""\ -Paragraph. - - >>> print " Indented block & output." - Indented block & output. -""", -"""\ -<document source="test data"> - <paragraph> - Paragraph. - <block_quote> - <doctest_block xml:space="preserve"> - >>> print " Indented block & output." - Indented block & output. -"""], -] - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_enumerated_lists.py b/docutils/test/test_parsers/test_rst/test_enumerated_lists.py deleted file mode 100755 index b89691516..000000000 --- a/docutils/test/test_parsers/test_rst/test_enumerated_lists.py +++ /dev/null @@ -1,727 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for states.py. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['enumerated_lists'] = [ -["""\ -1. Item one. - -2. Item two. - -3. Item three. -""", -"""\ -<document source="test data"> - <enumerated_list enumtype="arabic" prefix="" suffix="."> - <list_item> - <paragraph> - Item one. - <list_item> - <paragraph> - Item two. - <list_item> - <paragraph> - Item three. -"""], -["""\ -No blank lines betwen items: - -1. Item one. -2. Item two. -3. Item three. -""", -"""\ -<document source="test data"> - <paragraph> - No blank lines betwen items: - <enumerated_list enumtype="arabic" prefix="" suffix="."> - <list_item> - <paragraph> - Item one. - <list_item> - <paragraph> - Item two. - <list_item> - <paragraph> - Item three. -"""], -["""\ -1. -empty item above, no blank line -""", -"""\ -<document source="test data"> - <paragraph> - 1. - empty item above, no blank line -"""], -["""\ -Scrambled: - -3. Item three. - -2. Item two. - -1. Item one. - -3. Item three. -2. Item two. -1. Item one. -""", -"""\ -<document source="test data"> - <paragraph> - Scrambled: - <system_message level="1" line="3" source="test data" type="INFO"> - <paragraph> - Enumerated list start value not ordinal-1: "3" (ordinal 3) - <enumerated_list enumtype="arabic" prefix="" start="3" suffix="."> - <list_item> - <paragraph> - Item three. - <system_message level="1" line="5" source="test data" type="INFO"> - <paragraph> - Enumerated list start value not ordinal-1: "2" (ordinal 2) - <enumerated_list enumtype="arabic" prefix="" start="2" suffix="."> - <list_item> - <paragraph> - Item two. - <enumerated_list enumtype="arabic" prefix="" suffix="."> - <list_item> - <paragraph> - Item one. - <paragraph> - 3. Item three. - 2. Item two. - 1. Item one. -"""], -["""\ -Skipping item 3: - -1. Item 1. -2. Item 2. -4. Item 4. -""", -"""\ -<document source="test data"> - <paragraph> - Skipping item 3: - <enumerated_list enumtype="arabic" prefix="" suffix="."> - <list_item> - <paragraph> - Item 1. - <system_message level="2" line="4" source="test data" type="WARNING"> - <paragraph> - Enumerated list ends without a blank line; unexpected unindent. - <paragraph> - 2. Item 2. - 4. Item 4. -"""], -["""\ -Start with non-ordinal-1: - -0. Item zero. -1. Item one. -2. Item two. -3. Item three. - -And again: - -2. Item two. -3. Item three. -""", -"""\ -<document source="test data"> - <paragraph> - Start with non-ordinal-1: - <system_message level="1" line="3" source="test data" type="INFO"> - <paragraph> - Enumerated list start value not ordinal-1: "0" (ordinal 0) - <enumerated_list enumtype="arabic" prefix="" start="0" suffix="."> - <list_item> - <paragraph> - Item zero. - <list_item> - <paragraph> - Item one. - <list_item> - <paragraph> - Item two. - <list_item> - <paragraph> - Item three. - <paragraph> - And again: - <system_message level="1" line="10" source="test data" type="INFO"> - <paragraph> - Enumerated list start value not ordinal-1: "2" (ordinal 2) - <enumerated_list enumtype="arabic" prefix="" start="2" suffix="."> - <list_item> - <paragraph> - Item two. - <list_item> - <paragraph> - Item three. -"""], -["""\ -1. Item one: line 1, - line 2. -2. Item two: line 1, - line 2. -3. Item three: paragraph 1, line 1, - line 2. - - Paragraph 2. -""", -"""\ -<document source="test data"> - <enumerated_list enumtype="arabic" prefix="" suffix="."> - <list_item> - <paragraph> - Item one: line 1, - line 2. - <list_item> - <paragraph> - Item two: line 1, - line 2. - <list_item> - <paragraph> - Item three: paragraph 1, line 1, - line 2. - <paragraph> - Paragraph 2. -"""], -["""\ -Different enumeration sequences: - -1. Item 1. -2. Item 2. -3. Item 3. - -A. Item A. -B. Item B. -C. Item C. - -a. Item a. -b. Item b. -c. Item c. - -I. Item I. -II. Item II. -III. Item III. - -i. Item i. -ii. Item ii. -iii. Item iii. -""", -"""\ -<document source="test data"> - <paragraph> - Different enumeration sequences: - <enumerated_list enumtype="arabic" prefix="" suffix="."> - <list_item> - <paragraph> - Item 1. - <list_item> - <paragraph> - Item 2. - <list_item> - <paragraph> - Item 3. - <enumerated_list enumtype="upperalpha" prefix="" suffix="."> - <list_item> - <paragraph> - Item A. - <list_item> - <paragraph> - Item B. - <list_item> - <paragraph> - Item C. - <enumerated_list enumtype="loweralpha" prefix="" suffix="."> - <list_item> - <paragraph> - Item a. - <list_item> - <paragraph> - Item b. - <list_item> - <paragraph> - Item c. - <enumerated_list enumtype="upperroman" prefix="" suffix="."> - <list_item> - <paragraph> - Item I. - <list_item> - <paragraph> - Item II. - <list_item> - <paragraph> - Item III. - <enumerated_list enumtype="lowerroman" prefix="" suffix="."> - <list_item> - <paragraph> - Item i. - <list_item> - <paragraph> - Item ii. - <list_item> - <paragraph> - Item iii. -"""], -["""\ -Bad Roman numerals: - -i. i - -ii. ii - -iii. iii - -iiii. iiii - second line - -(LCD) is an acronym made up of Roman numerals - -(livid) is a word made up of Roman numerals - -(CIVIL) is another such word - -(I) I - -(IVXLCDM) IVXLCDM -""", -"""\ -<document source="test data"> - <paragraph> - Bad Roman numerals: - <enumerated_list enumtype="lowerroman" prefix="" suffix="."> - <list_item> - <paragraph> - i - <list_item> - <paragraph> - ii - <list_item> - <paragraph> - iii - <definition_list> - <definition_list_item> - <term> - iiii. iiii - <definition> - <paragraph> - second line - <paragraph> - (LCD) is an acronym made up of Roman numerals - <paragraph> - (livid) is a word made up of Roman numerals - <paragraph> - (CIVIL) is another such word - <enumerated_list enumtype="upperroman" prefix="(" suffix=")"> - <list_item> - <paragraph> - I - <paragraph> - (IVXLCDM) IVXLCDM -"""], -["""\ -Potentially ambiguous cases: - -A. Item A. -B. Item B. -C. Item C. - -I. Item I. -II. Item II. -III. Item III. - -a. Item a. -b. Item b. -c. Item c. - -i. Item i. -ii. Item ii. -iii. Item iii. - -Phew! Safe! -""", -"""\ -<document source="test data"> - <paragraph> - Potentially ambiguous cases: - <enumerated_list enumtype="upperalpha" prefix="" suffix="."> - <list_item> - <paragraph> - Item A. - <list_item> - <paragraph> - Item B. - <list_item> - <paragraph> - Item C. - <enumerated_list enumtype="upperroman" prefix="" suffix="."> - <list_item> - <paragraph> - Item I. - <list_item> - <paragraph> - Item II. - <list_item> - <paragraph> - Item III. - <enumerated_list enumtype="loweralpha" prefix="" suffix="."> - <list_item> - <paragraph> - Item a. - <list_item> - <paragraph> - Item b. - <list_item> - <paragraph> - Item c. - <enumerated_list enumtype="lowerroman" prefix="" suffix="."> - <list_item> - <paragraph> - Item i. - <list_item> - <paragraph> - Item ii. - <list_item> - <paragraph> - Item iii. - <paragraph> - Phew! Safe! -"""], -["""\ -Definitely ambiguous: - -A. Item A. -B. Item B. -C. Item C. -D. Item D. -E. Item E. -F. Item F. -G. Item G. -H. Item H. -I. Item I. -II. Item II. -III. Item III. - -a. Item a. -b. Item b. -c. Item c. -d. Item d. -e. Item e. -f. Item f. -g. Item g. -h. Item h. -i. Item i. -ii. Item ii. -iii. Item iii. -""", -"""\ -<document source="test data"> - <paragraph> - Definitely ambiguous: - <enumerated_list enumtype="upperalpha" prefix="" suffix="."> - <list_item> - <paragraph> - Item A. - <list_item> - <paragraph> - Item B. - <list_item> - <paragraph> - Item C. - <list_item> - <paragraph> - Item D. - <list_item> - <paragraph> - Item E. - <list_item> - <paragraph> - Item F. - <list_item> - <paragraph> - Item G. - <list_item> - <paragraph> - Item H. - <system_message level="2" line="11" source="test data" type="WARNING"> - <paragraph> - Enumerated list ends without a blank line; unexpected unindent. - <enumerated_list enumtype="upperroman" prefix="" suffix="."> - <list_item> - <paragraph> - Item I. - <list_item> - <paragraph> - Item II. - <list_item> - <paragraph> - Item III. - <enumerated_list enumtype="loweralpha" prefix="" suffix="."> - <list_item> - <paragraph> - Item a. - <list_item> - <paragraph> - Item b. - <list_item> - <paragraph> - Item c. - <list_item> - <paragraph> - Item d. - <list_item> - <paragraph> - Item e. - <list_item> - <paragraph> - Item f. - <list_item> - <paragraph> - Item g. - <list_item> - <paragraph> - Item h. - <system_message level="2" line="23" source="test data" type="WARNING"> - <paragraph> - Enumerated list ends without a blank line; unexpected unindent. - <enumerated_list enumtype="lowerroman" prefix="" suffix="."> - <list_item> - <paragraph> - Item i. - <list_item> - <paragraph> - Item ii. - <list_item> - <paragraph> - Item iii. -"""], -["""\ -Different enumeration formats: - -1. Item 1. -2. Item 2. -3. Item 3. - -1) Item 1). -2) Item 2). -3) Item 3). - -(1) Item (1). -(2) Item (2). -(3) Item (3). -""", -"""\ -<document source="test data"> - <paragraph> - Different enumeration formats: - <enumerated_list enumtype="arabic" prefix="" suffix="."> - <list_item> - <paragraph> - Item 1. - <list_item> - <paragraph> - Item 2. - <list_item> - <paragraph> - Item 3. - <enumerated_list enumtype="arabic" prefix="" suffix=")"> - <list_item> - <paragraph> - Item 1). - <list_item> - <paragraph> - Item 2). - <list_item> - <paragraph> - Item 3). - <enumerated_list enumtype="arabic" prefix="(" suffix=")"> - <list_item> - <paragraph> - Item (1). - <list_item> - <paragraph> - Item (2). - <list_item> - <paragraph> - Item (3). -"""], -["""\ -Nested enumerated lists: - -1. Item 1. - - A) Item A). - B) Item B). - C) Item C). - -2. Item 2. - - (a) Item (a). - - I) Item I). - II) Item II). - III) Item III). - - (b) Item (b). - - (c) Item (c). - - (i) Item (i). - (ii) Item (ii). - (iii) Item (iii). - -3. Item 3. -""", -"""\ -<document source="test data"> - <paragraph> - Nested enumerated lists: - <enumerated_list enumtype="arabic" prefix="" suffix="."> - <list_item> - <paragraph> - Item 1. - <enumerated_list enumtype="upperalpha" prefix="" suffix=")"> - <list_item> - <paragraph> - Item A). - <list_item> - <paragraph> - Item B). - <list_item> - <paragraph> - Item C). - <list_item> - <paragraph> - Item 2. - <enumerated_list enumtype="loweralpha" prefix="(" suffix=")"> - <list_item> - <paragraph> - Item (a). - <enumerated_list enumtype="upperroman" prefix="" suffix=")"> - <list_item> - <paragraph> - Item I). - <list_item> - <paragraph> - Item II). - <list_item> - <paragraph> - Item III). - <list_item> - <paragraph> - Item (b). - <list_item> - <paragraph> - Item (c). - <enumerated_list enumtype="lowerroman" prefix="(" suffix=")"> - <list_item> - <paragraph> - Item (i). - <list_item> - <paragraph> - Item (ii). - <list_item> - <paragraph> - Item (iii). - <list_item> - <paragraph> - Item 3. -"""], -["""\ -A. Einstein was a great influence on -B. Physicist, who was a colleague of -C. Chemist. They all worked in -Princeton, NJ. -""", -# @@@ I think this is the correct result, but I'm not certain: -"""\ -<document source="test data"> - <enumerated_list enumtype="upperalpha" prefix="" suffix="."> - <list_item> - <paragraph> - Einstein was a great influence on - <list_item> - <paragraph> - Physicist, who was a colleague of - <system_message level="2" line="3" source="test data" type="WARNING"> - <paragraph> - Enumerated list ends without a blank line; unexpected unindent. - <paragraph> - C. Chemist. They all worked in - Princeton, NJ. -"""], -["""\ -1. Item one: line 1, - line 2. -2. Item two: line 1, - line 2. -3. Item three: paragraph 1, line 1, - line 2. - - Paragraph 2. -""", -"""\ -<document source="test data"> - <enumerated_list enumtype="arabic" prefix="" suffix="."> - <list_item> - <paragraph> - Item one: line 1, - line 2. - <list_item> - <paragraph> - Item two: line 1, - <system_message level="2" line="4" source="test data" type="WARNING"> - <paragraph> - Enumerated list ends without a blank line; unexpected unindent. - <block_quote> - <paragraph> - line 2. - <system_message level="2" line="5" source="test data" type="WARNING"> - <paragraph> - Block quote ends without a blank line; unexpected unindent. - <system_message level="1" line="5" source="test data" type="INFO"> - <paragraph> - Enumerated list start value not ordinal-1: "3" (ordinal 3) - <enumerated_list enumtype="arabic" prefix="" start="3" suffix="."> - <list_item> - <paragraph> - Item three: paragraph 1, line 1, - <system_message level="2" line="6" source="test data" type="WARNING"> - <paragraph> - Enumerated list ends without a blank line; unexpected unindent. - <block_quote> - <paragraph> - line 2. - <block_quote> - <paragraph> - Paragraph 2. -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_field_lists.py b/docutils/test/test_parsers/test_rst/test_field_lists.py deleted file mode 100755 index 4bdf07527..000000000 --- a/docutils/test/test_parsers/test_rst/test_field_lists.py +++ /dev/null @@ -1,469 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for states.py. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['field_lists'] = [ -["""\ -One-liners: - -:Author: Me - -:Version: 1 - -:Date: 2001-08-11 - -:Parameter i: integer -""", -"""\ -<document source="test data"> - <paragraph> - One-liners: - <field_list> - <field> - <field_name> - Author - <field_body> - <paragraph> - Me - <field> - <field_name> - Version - <field_body> - <paragraph> - 1 - <field> - <field_name> - Date - <field_body> - <paragraph> - 2001-08-11 - <field> - <field_name> - Parameter i - <field_body> - <paragraph> - integer -"""], -["""\ -One-liners, no blank lines: - -:Author: Me -:Version: 1 -:Date: 2001-08-11 -:Parameter i: integer -""", -"""\ -<document source="test data"> - <paragraph> - One-liners, no blank lines: - <field_list> - <field> - <field_name> - Author - <field_body> - <paragraph> - Me - <field> - <field_name> - Version - <field_body> - <paragraph> - 1 - <field> - <field_name> - Date - <field_body> - <paragraph> - 2001-08-11 - <field> - <field_name> - Parameter i - <field_body> - <paragraph> - integer -"""], -["""\ -:field: -empty item above, no blank line -""", -"""\ -<document source="test data"> - <field_list> - <field> - <field_name> - field - <field_body> - <system_message level="2" line="2" source="test data" type="WARNING"> - <paragraph> - Field list ends without a blank line; unexpected unindent. - <paragraph> - empty item above, no blank line -"""], -["""\ -Field bodies starting on the next line: - -:Author: - Me -:Version: - 1 -:Date: - 2001-08-11 -:Parameter i: - integer -""", -"""\ -<document source="test data"> - <paragraph> - Field bodies starting on the next line: - <field_list> - <field> - <field_name> - Author - <field_body> - <paragraph> - Me - <field> - <field_name> - Version - <field_body> - <paragraph> - 1 - <field> - <field_name> - Date - <field_body> - <paragraph> - 2001-08-11 - <field> - <field_name> - Parameter i - <field_body> - <paragraph> - integer -"""], -["""\ -One-paragraph, multi-liners: - -:Authors: Me, - Myself, - and I -:Version: 1 - or so -:Date: 2001-08-11 - (Saturday) -:Parameter i: counter - (integer) -""", -"""\ -<document source="test data"> - <paragraph> - One-paragraph, multi-liners: - <field_list> - <field> - <field_name> - Authors - <field_body> - <paragraph> - Me, - Myself, - and I - <field> - <field_name> - Version - <field_body> - <paragraph> - 1 - or so - <field> - <field_name> - Date - <field_body> - <paragraph> - 2001-08-11 - (Saturday) - <field> - <field_name> - Parameter i - <field_body> - <paragraph> - counter - (integer) -"""], -["""\ -One-paragraph, multi-liners, not lined up: - -:Authors: Me, - Myself, - and I -:Version: 1 - or so -:Date: 2001-08-11 - (Saturday) -:Parameter i: counter - (integer) -""", -"""\ -<document source="test data"> - <paragraph> - One-paragraph, multi-liners, not lined up: - <field_list> - <field> - <field_name> - Authors - <field_body> - <paragraph> - Me, - Myself, - and I - <field> - <field_name> - Version - <field_body> - <paragraph> - 1 - or so - <field> - <field_name> - Date - <field_body> - <paragraph> - 2001-08-11 - (Saturday) - <field> - <field_name> - Parameter i - <field_body> - <paragraph> - counter - (integer) -"""], -["""\ -Multiple body elements: - -:Authors: - Me - - Myself - - I - -:Abstract: - This is a field list item's body, - containing multiple elements. - - Here's a literal block:: - - def f(x): - return x**2 + x - - Even nested field lists are possible: - - :Date: 2001-08-11 - :Day: Saturday - :Time: 15:07 -""", -"""\ -<document source="test data"> - <paragraph> - Multiple body elements: - <field_list> - <field> - <field_name> - Authors - <field_body> - <bullet_list bullet="-"> - <list_item> - <paragraph> - Me - <list_item> - <paragraph> - Myself - <list_item> - <paragraph> - I - <field> - <field_name> - Abstract - <field_body> - <paragraph> - This is a field list item's body, - containing multiple elements. - <paragraph> - Here's a literal block: - <literal_block xml:space="preserve"> - def f(x): - return x**2 + x - <paragraph> - Even nested field lists are possible: - <field_list> - <field> - <field_name> - Date - <field_body> - <paragraph> - 2001-08-11 - <field> - <field_name> - Day - <field_body> - <paragraph> - Saturday - <field> - <field_name> - Time - <field_body> - <paragraph> - 15:07 -"""], -["""\ -Nested field lists on one line: - -:field1: :field2: :field3: body -:field4: :field5: :field6: body - :field7: body - :field8: body - :field9: body line 1 - body line 2 -""", -"""\ -<document source="test data"> - <paragraph> - Nested field lists on one line: - <field_list> - <field> - <field_name> - field1 - <field_body> - <field_list> - <field> - <field_name> - field2 - <field_body> - <field_list> - <field> - <field_name> - field3 - <field_body> - <paragraph> - body - <field> - <field_name> - field4 - <field_body> - <field_list> - <field> - <field_name> - field5 - <field_body> - <field_list> - <field> - <field_name> - field6 - <field_body> - <paragraph> - body - <field> - <field_name> - field7 - <field_body> - <paragraph> - body - <field> - <field_name> - field8 - <field_body> - <paragraph> - body - <field> - <field_name> - field9 - <field_body> - <paragraph> - body line 1 - body line 2 -"""], -["""\ -:Parameter i j k: multiple arguments -""", -"""\ -<document source="test data"> - <field_list> - <field> - <field_name> - Parameter i j k - <field_body> - <paragraph> - multiple arguments -"""], -["""\ -Some edge cases: - -:Empty: -:Author: Me -No blank line before this paragraph. - -:*Field* `with` **inline** ``markup``: inline markup shouldn't be recognized. - -: Field: marker must not begin with whitespace. - -:Field : marker must not end with whitespace. - -Field: marker is missing its open-colon. - -:Field marker is missing its close-colon. -""", -"""\ -<document source="test data"> - <paragraph> - Some edge cases: - <field_list> - <field> - <field_name> - Empty - <field_body> - <field> - <field_name> - Author - <field_body> - <paragraph> - Me - <system_message level="2" line="5" source="test data" type="WARNING"> - <paragraph> - Field list ends without a blank line; unexpected unindent. - <paragraph> - No blank line before this paragraph. - <field_list> - <field> - <field_name> - *Field* `with` **inline** ``markup`` - <field_body> - <paragraph> - inline markup shouldn't be recognized. - <paragraph> - : Field: marker must not begin with whitespace. - <paragraph> - :Field : marker must not end with whitespace. - <paragraph> - Field: marker is missing its open-colon. - <paragraph> - :Field marker is missing its close-colon. -"""], -] - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_footnotes.py b/docutils/test/test_parsers/test_rst/test_footnotes.py deleted file mode 100755 index 00e5c1f5d..000000000 --- a/docutils/test/test_parsers/test_rst/test_footnotes.py +++ /dev/null @@ -1,332 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for states.py. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['footnotes'] = [ -["""\ -.. [1] This is a footnote. -""", -"""\ -<document source="test data"> - <footnote id="id1" name="1"> - <label> - 1 - <paragraph> - This is a footnote. -"""], -["""\ -.. [1] This is a footnote - on multiple lines. -""", -"""\ -<document source="test data"> - <footnote id="id1" name="1"> - <label> - 1 - <paragraph> - This is a footnote - on multiple lines. -"""], -["""\ -.. [1] This is a footnote - on multiple lines with more space. - -.. [2] This is a footnote - on multiple lines with less space. -""", -"""\ -<document source="test data"> - <footnote id="id1" name="1"> - <label> - 1 - <paragraph> - This is a footnote - on multiple lines with more space. - <footnote id="id2" name="2"> - <label> - 2 - <paragraph> - This is a footnote - on multiple lines with less space. -"""], -["""\ -.. [1] - This is a footnote on multiple lines - whose block starts on line 2. -""", -"""\ -<document source="test data"> - <footnote id="id1" name="1"> - <label> - 1 - <paragraph> - This is a footnote on multiple lines - whose block starts on line 2. -"""], -["""\ -.. [1] - -That was an empty footnote. -""", -"""\ -<document source="test data"> - <footnote id="id1" name="1"> - <label> - 1 - <paragraph> - That was an empty footnote. -"""], -["""\ -.. [1] -No blank line. -""", -"""\ -<document source="test data"> - <footnote id="id1" name="1"> - <label> - 1 - <system_message level="2" line="2" source="test data" type="WARNING"> - <paragraph> - Explicit markup ends without a blank line; unexpected unindent. - <paragraph> - No blank line. -"""], -] - -totest['auto_numbered_footnotes'] = [ -["""\ -[#]_ is the first auto-numbered footnote reference. -[#]_ is the second auto-numbered footnote reference. - -.. [#] Auto-numbered footnote 1. -.. [#] Auto-numbered footnote 2. -.. [#] Auto-numbered footnote 3. - -[#]_ is the third auto-numbered footnote reference. -""", -"""\ -<document source="test data"> - <paragraph> - <footnote_reference auto="1" id="id1"> - is the first auto-numbered footnote reference. - <footnote_reference auto="1" id="id2"> - is the second auto-numbered footnote reference. - <footnote auto="1" id="id3"> - <paragraph> - Auto-numbered footnote 1. - <footnote auto="1" id="id4"> - <paragraph> - Auto-numbered footnote 2. - <footnote auto="1" id="id5"> - <paragraph> - Auto-numbered footnote 3. - <paragraph> - <footnote_reference auto="1" id="id6"> - is the third auto-numbered footnote reference. -"""], -["""\ -[#third]_ is a reference to the third auto-numbered footnote. - -.. [#first] First auto-numbered footnote. -.. [#second] Second auto-numbered footnote. -.. [#third] Third auto-numbered footnote. - -[#second]_ is a reference to the second auto-numbered footnote. -[#first]_ is a reference to the first auto-numbered footnote. -[#third]_ is another reference to the third auto-numbered footnote. - -Here are some internal cross-references to the targets generated by -the footnotes: first_, second_, third_. -""", -"""\ -<document source="test data"> - <paragraph> - <footnote_reference auto="1" id="id1" refname="third"> - is a reference to the third auto-numbered footnote. - <footnote auto="1" id="first" name="first"> - <paragraph> - First auto-numbered footnote. - <footnote auto="1" id="second" name="second"> - <paragraph> - Second auto-numbered footnote. - <footnote auto="1" id="third" name="third"> - <paragraph> - Third auto-numbered footnote. - <paragraph> - <footnote_reference auto="1" id="id2" refname="second"> - is a reference to the second auto-numbered footnote. - <footnote_reference auto="1" id="id3" refname="first"> - is a reference to the first auto-numbered footnote. - <footnote_reference auto="1" id="id4" refname="third"> - is another reference to the third auto-numbered footnote. - <paragraph> - Here are some internal cross-references to the targets generated by - the footnotes: \n\ - <reference refname="first"> - first - , \n\ - <reference refname="second"> - second - , \n\ - <reference refname="third"> - third - . -"""], -["""\ -Mixed anonymous and labelled auto-numbered footnotes: - -[#four]_ should be 4, [#]_ should be 1, -[#]_ should be 3, [#]_ is one too many, -[#two]_ should be 2, and [#six]_ doesn't exist. - -.. [#] Auto-numbered footnote 1. -.. [#two] Auto-numbered footnote 2. -.. [#] Auto-numbered footnote 3. -.. [#four] Auto-numbered footnote 4. -.. [#five] Auto-numbered footnote 5. -.. [#five] Auto-numbered footnote 5 again (duplicate). -""", -"""\ -<document source="test data"> - <paragraph> - Mixed anonymous and labelled auto-numbered footnotes: - <paragraph> - <footnote_reference auto="1" id="id1" refname="four"> - should be 4, \n\ - <footnote_reference auto="1" id="id2"> - should be 1, - <footnote_reference auto="1" id="id3"> - should be 3, \n\ - <footnote_reference auto="1" id="id4"> - is one too many, - <footnote_reference auto="1" id="id5" refname="two"> - should be 2, and \n\ - <footnote_reference auto="1" id="id6" refname="six"> - doesn't exist. - <footnote auto="1" id="id7"> - <paragraph> - Auto-numbered footnote 1. - <footnote auto="1" id="two" name="two"> - <paragraph> - Auto-numbered footnote 2. - <footnote auto="1" id="id8"> - <paragraph> - Auto-numbered footnote 3. - <footnote auto="1" id="four" name="four"> - <paragraph> - Auto-numbered footnote 4. - <footnote auto="1" dupname="five" id="five"> - <paragraph> - Auto-numbered footnote 5. - <footnote auto="1" dupname="five" id="id9"> - <system_message backrefs="id9" level="2" line="12" source="test data" type="WARNING"> - <paragraph> - Duplicate explicit target name: "five". - <paragraph> - Auto-numbered footnote 5 again (duplicate). -"""], -["""\ -Mixed manually-numbered, anonymous auto-numbered, -and labelled auto-numbered footnotes: - -[#four]_ should be 4, [#]_ should be 2, -[1]_ is 1, [3]_ is 3, -[#]_ should be 6, [#]_ is one too many, -[#five]_ should be 5, and [#six]_ doesn't exist. - -.. [1] Manually-numbered footnote 1. -.. [#] Auto-numbered footnote 2. -.. [#four] Auto-numbered footnote 4. -.. [3] Manually-numbered footnote 3 -.. [#five] Auto-numbered footnote 5. -.. [#five] Auto-numbered footnote 5 again (duplicate). -.. [#] Auto-numbered footnote 6. -""", -"""\ -<document source="test data"> - <paragraph> - Mixed manually-numbered, anonymous auto-numbered, - and labelled auto-numbered footnotes: - <paragraph> - <footnote_reference auto="1" id="id1" refname="four"> - should be 4, \n\ - <footnote_reference auto="1" id="id2"> - should be 2, - <footnote_reference id="id3" refname="1"> - 1 - is 1, \n\ - <footnote_reference id="id4" refname="3"> - 3 - is 3, - <footnote_reference auto="1" id="id5"> - should be 6, \n\ - <footnote_reference auto="1" id="id6"> - is one too many, - <footnote_reference auto="1" id="id7" refname="five"> - should be 5, and \n\ - <footnote_reference auto="1" id="id8" refname="six"> - doesn't exist. - <footnote id="id9" name="1"> - <label> - 1 - <paragraph> - Manually-numbered footnote 1. - <footnote auto="1" id="id10"> - <paragraph> - Auto-numbered footnote 2. - <footnote auto="1" id="four" name="four"> - <paragraph> - Auto-numbered footnote 4. - <footnote id="id11" name="3"> - <label> - 3 - <paragraph> - Manually-numbered footnote 3 - <footnote auto="1" dupname="five" id="five"> - <paragraph> - Auto-numbered footnote 5. - <footnote auto="1" dupname="five" id="id12"> - <system_message backrefs="id12" level="2" line="14" source="test data" type="WARNING"> - <paragraph> - Duplicate explicit target name: "five". - <paragraph> - Auto-numbered footnote 5 again (duplicate). - <footnote auto="1" id="id13"> - <paragraph> - Auto-numbered footnote 6. -"""], -] - -totest['auto_symbol_footnotes'] = [ -["""\ -.. [*] This is an auto-symbol footnote. -""", -"""\ -<document source="test data"> - <footnote auto="*" id="id1"> - <paragraph> - This is an auto-symbol footnote. -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_functions.py b/docutils/test/test_parsers/test_rst/test_functions.py deleted file mode 100755 index e6694b2c5..000000000 --- a/docutils/test/test_parsers/test_rst/test_functions.py +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for states.py. -""" - -import unittest -from __init__ import DocutilsTestSupport -states = DocutilsTestSupport.states - - -class FuctionTests(unittest.TestCase): - - escaped = r'escapes: \*one, \\*two, \\\*three' - nulled = 'escapes: \x00*one, \x00\\*two, \x00\\\x00*three' - unescaped = r'escapes: *one, \*two, \*three' - - def test_escape2null(self): - nulled = states.escape2null(self.escaped) - self.assertEquals(nulled, self.nulled) - nulled = states.escape2null(self.escaped + '\\') - self.assertEquals(nulled, self.nulled + '\x00') - - def test_unescape(self): - unescaped = states.unescape(self.nulled) - self.assertEquals(unescaped, self.unescaped) - restored = states.unescape(self.nulled, 1) - self.assertEquals(restored, self.escaped) - - -if __name__ == '__main__': - unittest.main() diff --git a/docutils/test/test_parsers/test_rst/test_inline_markup.py b/docutils/test/test_parsers/test_rst/test_inline_markup.py deleted file mode 100755 index 2cafdb09a..000000000 --- a/docutils/test/test_parsers/test_rst/test_inline_markup.py +++ /dev/null @@ -1,851 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for inline markup in docutils/parsers/rst/states.py. -Interpreted text tests are in a separate module, test_interpreted.py. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['emphasis'] = [ -["""\ -*emphasis* -""", -"""\ -<document source="test data"> - <paragraph> - <emphasis> - emphasis -"""], -["""\ -*emphasized sentence -across lines* -""", -"""\ -<document source="test data"> - <paragraph> - <emphasis> - emphasized sentence - across lines -"""], -["""\ -*emphasis without closing asterisk -""", -"""\ -<document source="test data"> - <paragraph> - <problematic id="id2" refid="id1"> - * - emphasis without closing asterisk - <system_message backrefs="id2" id="id1" level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Inline emphasis start-string without end-string. -"""], -["""\ -'*emphasis*' and 1/*emphasis*/2 and 3-*emphasis*-4 and 5:*emphasis*:6 -but not '*' or '"*"' or x*2* or 2*x* or \\*args or * -or *the\\* *stars\\\\\\* *inside* - -(however, '*args' will trigger a warning and may be problematic) - -what about *this**? -""", -"""\ -<document source="test data"> - <paragraph> - ' - <emphasis> - emphasis - ' and 1/ - <emphasis> - emphasis - /2 and 3- - <emphasis> - emphasis - -4 and 5: - <emphasis> - emphasis - :6 - but not '*' or '"*"' or x*2* or 2*x* or *args or * - or \n\ - <emphasis> - the* *stars\* *inside - <paragraph> - (however, ' - <problematic id="id2" refid="id1"> - * - args' will trigger a warning and may be problematic) - <system_message backrefs="id2" id="id1" level="2" line="5" source="test data" type="WARNING"> - <paragraph> - Inline emphasis start-string without end-string. - <paragraph> - what about \n\ - <emphasis> - this* - ? -"""], -["""\ -Emphasized asterisk: *\\** - -Emphasized double asterisk: *\\*** -""", -"""\ -<document source="test data"> - <paragraph> - Emphasized asterisk: \n\ - <emphasis> - * - <paragraph> - Emphasized double asterisk: \n\ - <emphasis> - ** -"""], -] - -totest['strong'] = [ -["""\ -**strong** -""", -"""\ -<document source="test data"> - <paragraph> - <strong> - strong -"""], -["""\ -(**strong**) but not (**) or '(** ' or x**2 or \\**kwargs or ** - -(however, '**kwargs' will trigger a warning and may be problematic) -""", -"""\ -<document source="test data"> - <paragraph> - ( - <strong> - strong - ) but not (**) or '(** ' or x**2 or **kwargs or ** - <paragraph> - (however, ' - <problematic id="id2" refid="id1"> - ** - kwargs' will trigger a warning and may be problematic) - <system_message backrefs="id2" id="id1" level="2" line="3" source="test data" type="WARNING"> - <paragraph> - Inline strong start-string without end-string. -"""], -["""\ -Strong asterisk: ***** - -Strong double asterisk: ****** -""", -"""\ -<document source="test data"> - <paragraph> - Strong asterisk: \n\ - <strong> - * - <paragraph> - Strong double asterisk: \n\ - <strong> - ** -"""], -["""\ -**strong without closing asterisks -""", -"""\ -<document source="test data"> - <paragraph> - <problematic id="id2" refid="id1"> - ** - strong without closing asterisks - <system_message backrefs="id2" id="id1" level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Inline strong start-string without end-string. -"""], -] - -totest['literal'] = [ -["""\ -``literal`` -""", -"""\ -<document source="test data"> - <paragraph> - <literal> - literal -"""], -["""\ -``\\literal`` -""", -"""\ -<document source="test data"> - <paragraph> - <literal> - \\literal -"""], -["""\ -``lite\\ral`` -""", -"""\ -<document source="test data"> - <paragraph> - <literal> - lite\\ral -"""], -["""\ -``literal\\`` -""", -"""\ -<document source="test data"> - <paragraph> - <literal> - literal\\ -"""], -["""\ -``literal ``TeX quotes'' & \\backslash`` but not "``" or `` - -(however, ``standalone TeX quotes'' will trigger a warning -and may be problematic) -""", -"""\ -<document source="test data"> - <paragraph> - <literal> - literal ``TeX quotes'' & \\backslash - but not "``" or `` - <paragraph> - (however, \n\ - <problematic id="id2" refid="id1"> - `` - standalone TeX quotes'' will trigger a warning - and may be problematic) - <system_message backrefs="id2" id="id1" level="2" line="3" source="test data" type="WARNING"> - <paragraph> - Inline literal start-string without end-string. -"""], -["""\ -Find the ```interpreted text``` in this paragraph! -""", -"""\ -<document source="test data"> - <paragraph> - Find the \n\ - <literal> - `interpreted text` - in this paragraph! -"""], -["""\ -``literal without closing backquotes -""", -"""\ -<document source="test data"> - <paragraph> - <problematic id="id2" refid="id1"> - `` - literal without closing backquotes - <system_message backrefs="id2" id="id1" level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Inline literal start-string without end-string. -"""], -["""\ -Python ``list``\\s use square bracket syntax. -""", -"""\ -<document source="test data"> - <paragraph> - Python \n\ - <literal> - list - s use square bracket syntax. -"""], -] - -totest['references'] = [ -["""\ -ref_ -""", -"""\ -<document source="test data"> - <paragraph> - <reference refname="ref"> - ref -"""], -["""\ -ref__ -""", -"""\ -<document source="test data"> - <paragraph> - <reference anonymous="1"> - ref -"""], -["""\ -ref_, r_, r_e-f_, -ref_, and anonymousref__, -but not _ref_ or __attr__ or object.__attr__ -""", -"""\ -<document source="test data"> - <paragraph> - <reference refname="ref"> - ref - , \n\ - <reference refname="r"> - r - , \n\ - <reference refname="r_e-f"> - r_e-f - , - - <reference refname="ref"> - ref - , and \n\ - <reference anonymous="1"> - anonymousref - , - but not _ref_ or __attr__ or object.__attr__ -"""], -] - -totest['phrase_references'] = [ -["""\ -`phrase reference`_ -""", -"""\ -<document source="test data"> - <paragraph> - <reference refname="phrase reference"> - phrase reference -"""], -["""\ -`anonymous reference`__ -""", -"""\ -<document source="test data"> - <paragraph> - <reference anonymous="1"> - anonymous reference -"""], -["""\ -`phrase reference -across lines`_ -""", -"""\ -<document source="test data"> - <paragraph> - <reference refname="phrase reference across lines"> - phrase reference - across lines -"""], -["""\ -`phrase\`_ reference`_ -""", -"""\ -<document source="test data"> - <paragraph> - <reference refname="phrase`_ reference"> - phrase`_ reference -"""], -["""\ -Invalid phrase reference: - -:role:`phrase reference`_ -""", -"""\ -<document source="test data"> - <paragraph> - Invalid phrase reference: - <paragraph> - <problematic id="id2" refid="id1"> - :role:`phrase reference`_ - <system_message backrefs="id2" id="id1" level="2" line="3" source="test data" type="WARNING"> - <paragraph> - Mismatch: both interpreted text role prefix and reference suffix. -"""], -["""\ -Invalid phrase reference: - -`phrase reference`:role:_ -""", -"""\ -<document source="test data"> - <paragraph> - Invalid phrase reference: - <paragraph> - <problematic id="id2" refid="id1"> - `phrase reference`:role:_ - <system_message backrefs="id2" id="id1" level="2" line="3" source="test data" type="WARNING"> - <paragraph> - Mismatch: both interpreted text role suffix and reference suffix. -"""], -["""\ -`phrase reference_ without closing backquote -""", -"""\ -<document source="test data"> - <paragraph> - <problematic id="id2" refid="id1"> - ` - phrase \n\ - <reference refname="reference"> - reference - without closing backquote - <system_message backrefs="id2" id="id1" level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Inline interpreted text or phrase reference start-string without end-string. -"""], -["""\ -`anonymous phrase reference__ without closing backquote -""", -"""\ -<document source="test data"> - <paragraph> - <problematic id="id2" refid="id1"> - ` - anonymous phrase \n\ - <reference anonymous="1"> - reference - without closing backquote - <system_message backrefs="id2" id="id1" level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Inline interpreted text or phrase reference start-string without end-string. -"""], -] - -totest['embedded_URIs'] = [ -["""\ -`phrase reference <http://example.com>`_ -""", -"""\ -<document source="test data"> - <paragraph> - <reference refuri="http://example.com"> - phrase reference - <target id="phrase-reference" name="phrase reference" refuri="http://example.com"> -"""], -["""\ -`anonymous reference <http://example.com>`__ -""", -"""\ -<document source="test data"> - <paragraph> - <reference refuri="http://example.com"> - anonymous reference -"""], -["""\ -`embedded URI on next line -<http://example.com>`__ -""", -"""\ -<document source="test data"> - <paragraph> - <reference refuri="http://example.com"> - embedded URI on next line -"""], -["""\ -`embedded URI across lines <http://example.com/ -long/path>`__ -""", -"""\ -<document source="test data"> - <paragraph> - <reference refuri="http://example.com/long/path"> - embedded URI across lines -"""], -["""\ -`embedded URI with whitespace <http://example.com/ -long/path /and /whitespace>`__ -""", -"""\ -<document source="test data"> - <paragraph> - <reference refuri="http://example.com/long/path/and/whitespace"> - embedded URI with whitespace -"""], -["""\ -`embedded email address <jdoe@example.com>`__ - -`embedded email address broken across lines <jdoe -@example.com>`__ -""", -"""\ -<document source="test data"> - <paragraph> - <reference refuri="mailto:jdoe@example.com"> - embedded email address - <paragraph> - <reference refuri="mailto:jdoe@example.com"> - embedded email address broken across lines -"""], -["""\ -`embedded URI with too much whitespace < http://example.com/ -long/path /and /whitespace >`__ - -`embedded URI with too much whitespace at end <http://example.com/ -long/path /and /whitespace >`__ - -`embedded URI with no preceding whitespace<http://example.com>`__ - -`escaped URI \\<http://example.com>`__ - -See `HTML Anchors: \\<a>`_. -""", -"""\ -<document source="test data"> - <paragraph> - <reference anonymous="1"> - embedded URI with too much whitespace < http://example.com/ - long/path /and /whitespace > - <paragraph> - <reference anonymous="1"> - embedded URI with too much whitespace at end <http://example.com/ - long/path /and /whitespace > - <paragraph> - <reference anonymous="1"> - embedded URI with no preceding whitespace<http://example.com> - <paragraph> - <reference anonymous="1"> - escaped URI <http://example.com> - <paragraph> - See \n\ - <reference refname="html anchors: <a>"> - HTML Anchors: <a> - . -"""], -] - -totest['inline_targets'] = [ -["""\ -_`target` - -Here is _`another target` in some text. And _`yet -another target`, spanning lines. - -_`Here is a TaRgeT` with case and spacial difficulties. -""", -"""\ -<document source="test data"> - <paragraph> - <target id="target" name="target"> - target - <paragraph> - Here is \n\ - <target id="another-target" name="another target"> - another target - in some text. And \n\ - <target id="yet-another-target" name="yet another target"> - yet - another target - , spanning lines. - <paragraph> - <target id="here-is-a-target" name="here is a target"> - Here is a TaRgeT - with case and spacial difficulties. -"""], -["""\ -But this isn't a _target; targets require backquotes. - -And _`this`_ is just plain confusing. -""", -"""\ -<document source="test data"> - <paragraph> - But this isn't a _target; targets require backquotes. - <paragraph> - And \n\ - <problematic id="id2" refid="id1"> - _` - this`_ is just plain confusing. - <system_message backrefs="id2" id="id1" level="2" line="3" source="test data" type="WARNING"> - <paragraph> - Inline target start-string without end-string. -"""], -["""\ -_`inline target without closing backquote -""", -"""\ -<document source="test data"> - <paragraph> - <problematic id="id2" refid="id1"> - _` - inline target without closing backquote - <system_message backrefs="id2" id="id1" level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Inline target start-string without end-string. -"""], -] - -totest['footnote_reference'] = [ -["""\ -[1]_ -""", -"""\ -<document source="test data"> - <paragraph> - <footnote_reference id="id1" refname="1"> - 1 -"""], -["""\ -[#]_ -""", -"""\ -<document source="test data"> - <paragraph> - <footnote_reference auto="1" id="id1"> -"""], -["""\ -[#label]_ -""", -"""\ -<document source="test data"> - <paragraph> - <footnote_reference auto="1" id="id1" refname="label"> -"""], -["""\ -[*]_ -""", -"""\ -<document source="test data"> - <paragraph> - <footnote_reference auto="*" id="id1"> -"""], -] - -totest['citation_reference'] = [ -["""\ -[citation]_ -""", -"""\ -<document source="test data"> - <paragraph> - <citation_reference id="id1" refname="citation"> - citation -"""], -["""\ -[citation]_ and [cit-ation]_ and [cit.ation]_ and [CIT1]_ but not [CIT 1]_ -""", -"""\ -<document source="test data"> - <paragraph> - <citation_reference id="id1" refname="citation"> - citation - and \n\ - <citation_reference id="id2" refname="cit-ation"> - cit-ation - and \n\ - <citation_reference id="id3" refname="cit.ation"> - cit.ation - and \n\ - <citation_reference id="id4" refname="cit1"> - CIT1 - but not [CIT 1]_ -"""], -] - -totest['substitution_references'] = [ -["""\ -|subref| -""", -"""\ -<document source="test data"> - <paragraph> - <substitution_reference refname="subref"> - subref -"""], -["""\ -|subref|_ and |subref|__ -""", -"""\ -<document source="test data"> - <paragraph> - <reference refname="subref"> - <substitution_reference refname="subref"> - subref - and \n\ - <reference anonymous="1"> - <substitution_reference refname="subref"> - subref -"""], -["""\ -|substitution reference| -""", -"""\ -<document source="test data"> - <paragraph> - <substitution_reference refname="substitution reference"> - substitution reference -"""], -["""\ -|substitution -reference| -""", -"""\ -<document source="test data"> - <paragraph> - <substitution_reference refname="substitution reference"> - substitution - reference -"""], -["""\ -|substitution reference without closing verbar -""", -"""\ -<document source="test data"> - <paragraph> - <problematic id="id2" refid="id1"> - | - substitution reference without closing verbar - <system_message backrefs="id2" id="id1" level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Inline substitution_reference start-string without end-string. -"""], -["""\ -| and || and ||| -""", -"""\ -<document source="test data"> - <paragraph> - | and || and ||| -"""], -] - -totest['standalone_hyperlink'] = [ -["""\ -http://www.standalone.hyperlink.com - -http:/one-slash-only.absolute.path - -[http://example.com] - -(http://example.com) - -<http://example.com> - -http://[1080:0:0:0:8:800:200C:417A]/IPv6address.html - -http://[3ffe:2a00:100:7031::1] (the final "]" is ambiguous in text) - -http://[3ffe:2a00:100:7031::1]/ - -mailto:someone@somewhere.com - -news:comp.lang.python - -An email address in a sentence: someone@somewhere.com. - -ftp://ends.with.a.period. - -(a.question.mark@end?) -""", -"""\ -<document source="test data"> - <paragraph> - <reference refuri="http://www.standalone.hyperlink.com"> - http://www.standalone.hyperlink.com - <paragraph> - <reference refuri="http:/one-slash-only.absolute.path"> - http:/one-slash-only.absolute.path - <paragraph> - [ - <reference refuri="http://example.com"> - http://example.com - ] - <paragraph> - ( - <reference refuri="http://example.com"> - http://example.com - ) - <paragraph> - < - <reference refuri="http://example.com"> - http://example.com - > - <paragraph> - <reference refuri="http://[1080:0:0:0:8:800:200C:417A]/IPv6address.html"> - http://[1080:0:0:0:8:800:200C:417A]/IPv6address.html - <paragraph> - <reference refuri="http://[3ffe:2a00:100:7031::1"> - http://[3ffe:2a00:100:7031::1 - ] (the final "]" is ambiguous in text) - <paragraph> - <reference refuri="http://[3ffe:2a00:100:7031::1]/"> - http://[3ffe:2a00:100:7031::1]/ - <paragraph> - <reference refuri="mailto:someone@somewhere.com"> - mailto:someone@somewhere.com - <paragraph> - <reference refuri="news:comp.lang.python"> - news:comp.lang.python - <paragraph> - An email address in a sentence: \n\ - <reference refuri="mailto:someone@somewhere.com"> - someone@somewhere.com - . - <paragraph> - <reference refuri="ftp://ends.with.a.period"> - ftp://ends.with.a.period - . - <paragraph> - ( - <reference refuri="mailto:a.question.mark@end"> - a.question.mark@end - ?) -"""], -["""\ -None of these are standalone hyperlinks (their "schemes" -are not recognized): signal:noise, a:b. -""", -"""\ -<document source="test data"> - <paragraph> - None of these are standalone hyperlinks (their "schemes" - are not recognized): signal:noise, a:b. -"""], -] - -totest['miscellaneous'] = [ -["""\ -__This__ should be left alone. -""", -"""\ -<document source="test data"> - <paragraph> - __This__ should be left alone. -"""], -[r""" -Character-level m\ *a*\ **r**\ ``k``\ `u`:title:\p -with backslash-escaped whitespace, including new\ -lines. -""", -"""\ -<document source="test data"> - <paragraph> - Character-level m - <emphasis> - a - <strong> - r - <literal> - k - <title_reference> - u - p - with backslash-escaped whitespace, including newlines. -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_interpreted.py b/docutils/test/test_parsers/test_rst/test_interpreted.py deleted file mode 100644 index 6c0d30ac0..000000000 --- a/docutils/test/test_parsers/test_rst/test_interpreted.py +++ /dev/null @@ -1,305 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for interpreted text in docutils/parsers/rst/states.py. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['basics'] = [ -["""\ -`interpreted` -""", -"""\ -<document source="test data"> - <paragraph> - <title_reference> - interpreted -"""], -["""\ -:title:`interpreted` -""", -"""\ -<document source="test data"> - <paragraph> - <title_reference> - interpreted -"""], -["""\ -`interpreted`:title: -""", -"""\ -<document source="test data"> - <paragraph> - <title_reference> - interpreted -"""], -["""\ -`interpreted \`title`` -""", -"""\ -<document source="test data"> - <paragraph> - <title_reference> - interpreted `title` -"""], -["""\ -:title:`:not-role: interpreted` -""", -"""\ -<document source="test data"> - <paragraph> - <title_reference> - :not-role: interpreted -"""], -["""\ -`interpreted` but not \\`interpreted` [`] or ({[`] or [`]}) or ` -""", -"""\ -<document source="test data"> - <paragraph> - <title_reference> - interpreted - but not `interpreted` [`] or ({[`] or [`]}) or ` -"""], -["""\ -`interpreted`-text `interpreted`: text `interpreted`:text `text`'s interpreted -""", -"""\ -<document source="test data"> - <paragraph> - <title_reference> - interpreted - -text \n\ - <title_reference> - interpreted - : text \n\ - <title_reference> - interpreted - :text \n\ - <title_reference> - text - 's interpreted -"""], -["""\ -`interpreted without closing backquote -""", -"""\ -<document source="test data"> - <paragraph> - <problematic id="id2" refid="id1"> - ` - interpreted without closing backquote - <system_message backrefs="id2" id="id1" level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Inline interpreted text or phrase reference start-string without end-string. -"""], -["""\ -`interpreted`:not a role if it contains whitespace: -""", -"""\ -<document source="test data"> - <paragraph> - <title_reference> - interpreted - :not a role if it contains whitespace: -"""], -["""\ -:title:`` (empty interpteted text not recognized) -""", -"""\ -<document source="test data"> - <paragraph> - :title:`` (empty interpteted text not recognized) -"""], -["""\ -Explicit roles for standard inline markup: -:emphasis:`emphasis`, -:strong:`strong`, -:literal:`inline literal text`. -""", -"""\ -<document source="test data"> - <paragraph> - Explicit roles for standard inline markup: - <emphasis> - emphasis - , - <strong> - strong - , - <literal> - inline literal text - . -"""], -["""\ -Simple explicit roles: -:ab:`abbreviation`, -:ac:`acronym`, -:sup:`superscript`, -:sub:`subscript`, -:title:`title reference`. -""", -"""\ -<document source="test data"> - <paragraph> - Simple explicit roles: - <abbreviation> - abbreviation - , - <acronym> - acronym - , - <superscript> - superscript - , - <subscript> - subscript - , - <title_reference> - title reference - . -"""], -] - -totest['references'] = [ -["""\ -:PEP:`0` -""", -"""\ -<document source="test data"> - <paragraph> - <reference refuri="http://www.python.org/peps/pep-0000.html"> - PEP 0 -"""], -["""\ -:PEP:`-1` -""", -"""\ -<document source="test data"> - <paragraph> - <problematic id="id2" refid="id1"> - -1 - <system_message backrefs="id2" id="id1" level="3" line="1" source="test data" type="ERROR"> - <paragraph> - PEP number must be a number from 0 to 9999; "-1" is invalid. -"""], -["""\ -:RFC:`2822` -""", -"""\ -<document source="test data"> - <paragraph> - <reference refuri="http://www.faqs.org/rfcs/rfc2822.html"> - RFC 2822 -"""], -["""\ -:RFC:`0` -""", -"""\ -<document source="test data"> - <paragraph> - <problematic id="id2" refid="id1"> - 0 - <system_message backrefs="id2" id="id1" level="3" line="1" source="test data" type="ERROR"> - <paragraph> - RFC number must be a number greater than or equal to 1; "0" is invalid. -"""], -] - -totest['unknown_roles'] = [ -["""\ -:role:`interpreted` -""", -"""\ -<document source="test data"> - <paragraph> - <problematic id="id2" refid="id1"> - :role:`interpreted` - <system_message level="1" line="1" source="test data" type="INFO"> - <paragraph> - No role entry for "role" in module "docutils.parsers.rst.languages.en". - Trying "role" as canonical role name. - <system_message backrefs="id2" id="id1" level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Unknown interpreted text role "role". -"""], -["""\ -`interpreted`:role: -""", -"""\ -<document source="test data"> - <paragraph> - <problematic id="id2" refid="id1"> - `interpreted`:role: - <system_message level="1" line="1" source="test data" type="INFO"> - <paragraph> - No role entry for "role" in module "docutils.parsers.rst.languages.en". - Trying "role" as canonical role name. - <system_message backrefs="id2" id="id1" level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Unknown interpreted text role "role". -"""], -["""\ -:role:`interpreted`:role: -""", -"""\ -<document source="test data"> - <paragraph> - <problematic id="id2" refid="id1"> - :role:`interpreted`:role: - <system_message backrefs="id2" id="id1" level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Multiple roles in interpreted text (both prefix and suffix present; only one allowed). -"""], -["""\ -:very.long-role_name:`interpreted` -""", -"""\ -<document source="test data"> - <paragraph> - <problematic id="id2" refid="id1"> - :very.long-role_name:`interpreted` - <system_message level="1" line="1" source="test data" type="INFO"> - <paragraph> - No role entry for "very.long-role_name" in module "docutils.parsers.rst.languages.en". - Trying "very.long-role_name" as canonical role name. - <system_message backrefs="id2" id="id1" level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Unknown interpreted text role "very.long-role_name". -"""], -["""\ -:restructuredtext-unimplemented-role:`interpreted` -""", -"""\ -<document source="test data"> - <paragraph> - <problematic id="id2" refid="id1"> - :restructuredtext-unimplemented-role:`interpreted` - <system_message level="1" line="1" source="test data" type="INFO"> - <paragraph> - No role entry for "restructuredtext-unimplemented-role" in module "docutils.parsers.rst.languages.en". - Trying "restructuredtext-unimplemented-role" as canonical role name. - <system_message backrefs="id2" id="id1" level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Interpreted text role "restructuredtext-unimplemented-role" not implemented. -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_literal_blocks.py b/docutils/test/test_parsers/test_rst/test_literal_blocks.py deleted file mode 100755 index 2fe1c9b88..000000000 --- a/docutils/test/test_parsers/test_rst/test_literal_blocks.py +++ /dev/null @@ -1,234 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for states.py. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['literal_blocks'] = [ -["""\ -A paragraph:: - - A literal block. -""", -"""\ -<document source="test data"> - <paragraph> - A paragraph: - <literal_block xml:space="preserve"> - A literal block. -"""], -["""\ -A paragraph with a space after the colons:: \n\ - - A literal block. -""", -"""\ -<document source="test data"> - <paragraph> - A paragraph with a space after the colons: - <literal_block xml:space="preserve"> - A literal block. -"""], -["""\ -A paragraph:: - - A literal block. - -Another paragraph:: - - Another literal block. - With two blank lines following. - - -A final paragraph. -""", -"""\ -<document source="test data"> - <paragraph> - A paragraph: - <literal_block xml:space="preserve"> - A literal block. - <paragraph> - Another paragraph: - <literal_block xml:space="preserve"> - Another literal block. - With two blank lines following. - <paragraph> - A final paragraph. -"""], -["""\ -A paragraph -on more than -one line:: - - A literal block. -""", -"""\ -<document source="test data"> - <paragraph> - A paragraph - on more than - one line: - <literal_block xml:space="preserve"> - A literal block. -"""], -["""\ -A paragraph -on more than -one line:: - A literal block - with no blank line above. -""", -"""\ -<document source="test data"> - <paragraph> - A paragraph - on more than - one line: - <system_message level="3" line="4" source="test data" type="ERROR"> - <paragraph> - Unexpected indentation. - <literal_block xml:space="preserve"> - A literal block - with no blank line above. -"""], -["""\ -A paragraph:: - - A literal block. -no blank line -""", -"""\ -<document source="test data"> - <paragraph> - A paragraph: - <literal_block xml:space="preserve"> - A literal block. - <system_message level="2" line="4" source="test data" type="WARNING"> - <paragraph> - Literal block ends without a blank line; unexpected unindent. - <paragraph> - no blank line -"""], -["""\ -A paragraph: :: - - A literal block. -""", -"""\ -<document source="test data"> - <paragraph> - A paragraph: - <literal_block xml:space="preserve"> - A literal block. -"""], -["""\ -A paragraph: - -:: - - A literal block. -""", -"""\ -<document source="test data"> - <paragraph> - A paragraph: - <literal_block xml:space="preserve"> - A literal block. -"""], -["""\ -A paragraph: -:: - - A literal block. -""", -"""\ -<document source="test data"> - <system_message level="1" line="2" source="test data" type="INFO"> - <paragraph> - Possible title underline, too short for the title. - Treating it as ordinary text because it's so short. - <paragraph> - A paragraph: - <literal_block xml:space="preserve"> - A literal block. -"""], -["""\ -A paragraph: - -:: - - A literal block. -""", -"""\ -<document source="test data"> - <paragraph> - A paragraph: - <literal_block xml:space="preserve"> - A literal block. -"""], -["""\ -A paragraph:: - -Not a literal block. -""", -"""\ -<document source="test data"> - <paragraph> - A paragraph: - <system_message level="2" line="2" source="test data" type="WARNING"> - <paragraph> - Literal block expected; none found. - <paragraph> - Not a literal block. -"""], -["""\ -A paragraph:: - - A wonky literal block. - Literal line 2. - - Literal line 3. -""", -"""\ -<document source="test data"> - <paragraph> - A paragraph: - <literal_block xml:space="preserve"> - A wonky literal block. - Literal line 2. - \n\ - Literal line 3. -"""], -["""\ -EOF, even though a literal block is indicated:: -""", -"""\ -<document source="test data"> - <paragraph> - EOF, even though a literal block is indicated: - <system_message level="2" line="2" source="test data" type="WARNING"> - <paragraph> - Literal block expected; none found. -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_option_lists.py b/docutils/test/test_parsers/test_rst/test_option_lists.py deleted file mode 100755 index e7f17f615..000000000 --- a/docutils/test/test_parsers/test_rst/test_option_lists.py +++ /dev/null @@ -1,684 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for states.py. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['option_lists'] = [ -["""\ -Short options: - --a option -a - --b file option -b - --c name option -c -""", -"""\ -<document source="test data"> - <paragraph> - Short options: - <option_list> - <option_list_item> - <option_group> - <option> - <option_string> - -a - <description> - <paragraph> - option -a - <option_list_item> - <option_group> - <option> - <option_string> - -b - <option_argument delimiter=" "> - file - <description> - <paragraph> - option -b - <option_list_item> - <option_group> - <option> - <option_string> - -c - <option_argument delimiter=" "> - name - <description> - <paragraph> - option -c -"""], -["""\ -Long options: - ---aaaa option --aaaa ---bbbb=file option --bbbb ---cccc name option --cccc ---d-e-f-g option --d-e-f-g ---h_i_j_k option --h_i_j_k -""", -"""\ -<document source="test data"> - <paragraph> - Long options: - <option_list> - <option_list_item> - <option_group> - <option> - <option_string> - --aaaa - <description> - <paragraph> - option --aaaa - <option_list_item> - <option_group> - <option> - <option_string> - --bbbb - <option_argument delimiter="="> - file - <description> - <paragraph> - option --bbbb - <option_list_item> - <option_group> - <option> - <option_string> - --cccc - <option_argument delimiter=" "> - name - <description> - <paragraph> - option --cccc - <option_list_item> - <option_group> - <option> - <option_string> - --d-e-f-g - <description> - <paragraph> - option --d-e-f-g - <option_list_item> - <option_group> - <option> - <option_string> - --h_i_j_k - <description> - <paragraph> - option --h_i_j_k -"""], -["""\ -Old GNU-style options: - -+a option +a - -+b file option +b - -+c name option +c -""", -"""\ -<document source="test data"> - <paragraph> - Old GNU-style options: - <option_list> - <option_list_item> - <option_group> - <option> - <option_string> - +a - <description> - <paragraph> - option +a - <option_list_item> - <option_group> - <option> - <option_string> - +b - <option_argument delimiter=" "> - file - <description> - <paragraph> - option +b - <option_list_item> - <option_group> - <option> - <option_string> - +c - <option_argument delimiter=" "> - name - <description> - <paragraph> - option +c -"""], -["""\ -VMS/DOS-style options: - -/A option /A -/B file option /B -/CCC option /CCC -/DDD string option /DDD -/EEE=int option /EEE -""", -"""\ -<document source="test data"> - <paragraph> - VMS/DOS-style options: - <option_list> - <option_list_item> - <option_group> - <option> - <option_string> - /A - <description> - <paragraph> - option /A - <option_list_item> - <option_group> - <option> - <option_string> - /B - <option_argument delimiter=" "> - file - <description> - <paragraph> - option /B - <option_list_item> - <option_group> - <option> - <option_string> - /CCC - <description> - <paragraph> - option /CCC - <option_list_item> - <option_group> - <option> - <option_string> - /DDD - <option_argument delimiter=" "> - string - <description> - <paragraph> - option /DDD - <option_list_item> - <option_group> - <option> - <option_string> - /EEE - <option_argument delimiter="="> - int - <description> - <paragraph> - option /EEE -"""], -["""\ -Mixed short, long, and VMS/DOS options: - --a option -a ---bbbb=file option -bbbb -/C option /C ---dddd name option --dddd --e string option -e -/F file option /F -""", -"""\ -<document source="test data"> - <paragraph> - Mixed short, long, and VMS/DOS options: - <option_list> - <option_list_item> - <option_group> - <option> - <option_string> - -a - <description> - <paragraph> - option -a - <option_list_item> - <option_group> - <option> - <option_string> - --bbbb - <option_argument delimiter="="> - file - <description> - <paragraph> - option -bbbb - <option_list_item> - <option_group> - <option> - <option_string> - /C - <description> - <paragraph> - option /C - <option_list_item> - <option_group> - <option> - <option_string> - --dddd - <option_argument delimiter=" "> - name - <description> - <paragraph> - option --dddd - <option_list_item> - <option_group> - <option> - <option_string> - -e - <option_argument delimiter=" "> - string - <description> - <paragraph> - option -e - <option_list_item> - <option_group> - <option> - <option_string> - /F - <option_argument delimiter=" "> - file - <description> - <paragraph> - option /F -"""], -["""\ -Aliased options: - --a, --aaaa, /A option -a, --aaaa, /A --b file, --bbbb=file, /B file option -b, --bbbb, /B -""", -"""\ -<document source="test data"> - <paragraph> - Aliased options: - <option_list> - <option_list_item> - <option_group> - <option> - <option_string> - -a - <option> - <option_string> - --aaaa - <option> - <option_string> - /A - <description> - <paragraph> - option -a, --aaaa, /A - <option_list_item> - <option_group> - <option> - <option_string> - -b - <option_argument delimiter=" "> - file - <option> - <option_string> - --bbbb - <option_argument delimiter="="> - file - <option> - <option_string> - /B - <option_argument delimiter=" "> - file - <description> - <paragraph> - option -b, --bbbb, /B -"""], -["""\ -Multiple lines in descriptions, aligned: - --a option -a, line 1 - line 2 --b file option -b, line 1 - line 2 -""", -"""\ -<document source="test data"> - <paragraph> - Multiple lines in descriptions, aligned: - <option_list> - <option_list_item> - <option_group> - <option> - <option_string> - -a - <description> - <paragraph> - option -a, line 1 - line 2 - <option_list_item> - <option_group> - <option> - <option_string> - -b - <option_argument delimiter=" "> - file - <description> - <paragraph> - option -b, line 1 - line 2 -"""], -["""\ -Multiple lines in descriptions, not aligned: - --a option -a, line 1 - line 2 --b file option -b, line 1 - line 2 -""", -"""\ -<document source="test data"> - <paragraph> - Multiple lines in descriptions, not aligned: - <option_list> - <option_list_item> - <option_group> - <option> - <option_string> - -a - <description> - <paragraph> - option -a, line 1 - line 2 - <option_list_item> - <option_group> - <option> - <option_string> - -b - <option_argument delimiter=" "> - file - <description> - <paragraph> - option -b, line 1 - line 2 -"""], -["""\ -Descriptions begin on next line: - --a - option -a, line 1 - line 2 --b file - option -b, line 1 - line 2 -""", -"""\ -<document source="test data"> - <paragraph> - Descriptions begin on next line: - <option_list> - <option_list_item> - <option_group> - <option> - <option_string> - -a - <description> - <paragraph> - option -a, line 1 - line 2 - <option_list_item> - <option_group> - <option> - <option_string> - -b - <option_argument delimiter=" "> - file - <description> - <paragraph> - option -b, line 1 - line 2 -"""], -["""\ -Multiple body elements in descriptions: - --a option -a, para 1 - - para 2 --b file - option -b, para 1 - - para 2 -""", -"""\ -<document source="test data"> - <paragraph> - Multiple body elements in descriptions: - <option_list> - <option_list_item> - <option_group> - <option> - <option_string> - -a - <description> - <paragraph> - option -a, para 1 - <paragraph> - para 2 - <option_list_item> - <option_group> - <option> - <option_string> - -b - <option_argument delimiter=" "> - file - <description> - <paragraph> - option -b, para 1 - <paragraph> - para 2 -"""], -["""\ ---option -empty item above, no blank line -""", -"""\ -<document source="test data"> - <paragraph> - --option - empty item above, no blank line -"""], -["""\ -An option list using equals: - ---long1=arg1 Description 1 ---long2=arg2 Description 2 - -An option list using spaces: - ---long1 arg1 Description 1 ---long2 arg2 Description 2 - -An option list using mixed delimiters: - ---long1=arg1 Description 1 ---long2 arg2 Description 2 - -An option list using mixed delimiters in one line: - ---long1=arg1, --long2 arg2 Description -""", -"""\ -<document source="test data"> - <paragraph> - An option list using equals: - <option_list> - <option_list_item> - <option_group> - <option> - <option_string> - --long1 - <option_argument delimiter="="> - arg1 - <description> - <paragraph> - Description 1 - <option_list_item> - <option_group> - <option> - <option_string> - --long2 - <option_argument delimiter="="> - arg2 - <description> - <paragraph> - Description 2 - <paragraph> - An option list using spaces: - <option_list> - <option_list_item> - <option_group> - <option> - <option_string> - --long1 - <option_argument delimiter=" "> - arg1 - <description> - <paragraph> - Description 1 - <option_list_item> - <option_group> - <option> - <option_string> - --long2 - <option_argument delimiter=" "> - arg2 - <description> - <paragraph> - Description 2 - <paragraph> - An option list using mixed delimiters: - <option_list> - <option_list_item> - <option_group> - <option> - <option_string> - --long1 - <option_argument delimiter="="> - arg1 - <description> - <paragraph> - Description 1 - <option_list_item> - <option_group> - <option> - <option_string> - --long2 - <option_argument delimiter=" "> - arg2 - <description> - <paragraph> - Description 2 - <paragraph> - An option list using mixed delimiters in one line: - <option_list> - <option_list_item> - <option_group> - <option> - <option_string> - --long1 - <option_argument delimiter="="> - arg1 - <option> - <option_string> - --long2 - <option_argument delimiter=" "> - arg2 - <description> - <paragraph> - Description -"""], -["""\ -Some edge cases: - ---option=arg arg too many arguments - ---option=arg,arg not supported (yet?) - ---option=arg=arg too many arguments - ---option arg arg too many arguments - --a letter arg2 too many arguments - -/A letter arg2 too many arguments - ---option= argument missing - ---=argument option missing - --- everything missing - -- this should be a bullet list item - -These next ones should be simple paragraphs: - --1 - ---option - ---1 - --1 and this one too. -""", -"""\ -<document source="test data"> - <paragraph> - Some edge cases: - <paragraph> - --option=arg arg too many arguments - <paragraph> - --option=arg,arg not supported (yet?) - <paragraph> - --option=arg=arg too many arguments - <paragraph> - --option arg arg too many arguments - <paragraph> - -a letter arg2 too many arguments - <paragraph> - /A letter arg2 too many arguments - <paragraph> - --option= argument missing - <paragraph> - --=argument option missing - <paragraph> - -- everything missing - <bullet_list bullet="-"> - <list_item> - <paragraph> - this should be a bullet list item - <paragraph> - These next ones should be simple paragraphs: - <paragraph> - -1 - <paragraph> - --option - <paragraph> - --1 - <paragraph> - -1 and this one too. -"""], -] - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_outdenting.py b/docutils/test/test_parsers/test_rst/test_outdenting.py deleted file mode 100755 index 1522b7f30..000000000 --- a/docutils/test/test_parsers/test_rst/test_outdenting.py +++ /dev/null @@ -1,90 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for states.py. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['outdenting'] = [ -["""\ -Anywhere a paragraph would have an effect on the current -indentation level, a comment or list item should also. - -+ bullet - -This paragraph ends the bullet list item before a block quote. - - Block quote. -""", -"""\ -<document source="test data"> - <paragraph> - Anywhere a paragraph would have an effect on the current - indentation level, a comment or list item should also. - <bullet_list bullet="+"> - <list_item> - <paragraph> - bullet - <paragraph> - This paragraph ends the bullet list item before a block quote. - <block_quote> - <paragraph> - Block quote. -"""], -["""\ -+ bullet - -.. Comments swallow up all indented text following. - - (Therefore this is not a) block quote. - -- bullet - - If we want a block quote after this bullet list item, - we need to use an empty comment: - -.. - - Block quote. -""", -"""\ -<document source="test data"> - <bullet_list bullet="+"> - <list_item> - <paragraph> - bullet - <comment xml:space="preserve"> - Comments swallow up all indented text following. - \n\ - (Therefore this is not a) block quote. - <bullet_list bullet="-"> - <list_item> - <paragraph> - bullet - <paragraph> - If we want a block quote after this bullet list item, - we need to use an empty comment: - <comment xml:space="preserve"> - <block_quote> - <paragraph> - Block quote. -"""], -] - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_paragraphs.py b/docutils/test/test_parsers/test_rst/test_paragraphs.py deleted file mode 100755 index 8ec8cbbc5..000000000 --- a/docutils/test/test_parsers/test_rst/test_paragraphs.py +++ /dev/null @@ -1,89 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for states.py. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['paragraphs'] = [ -["""\ -A paragraph. -""", -"""\ -<document source="test data"> - <paragraph> - A paragraph. -"""], -["""\ -Paragraph 1. - -Paragraph 2. -""", -"""\ -<document source="test data"> - <paragraph> - Paragraph 1. - <paragraph> - Paragraph 2. -"""], -["""\ -Line 1. -Line 2. -Line 3. -""", -"""\ -<document source="test data"> - <paragraph> - Line 1. - Line 2. - Line 3. -"""], -["""\ -Paragraph 1, Line 1. -Line 2. -Line 3. - -Paragraph 2, Line 1. -Line 2. -Line 3. -""", -"""\ -<document source="test data"> - <paragraph> - Paragraph 1, Line 1. - Line 2. - Line 3. - <paragraph> - Paragraph 2, Line 1. - Line 2. - Line 3. -"""], -["""\ -A. Einstein was a really -smart dude. -""", -"""\ -<document source="test data"> - <paragraph> - A. Einstein was a really - smart dude. -"""], -] - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_section_headers.py b/docutils/test/test_parsers/test_rst/test_section_headers.py deleted file mode 100755 index 98fdfcb8f..000000000 --- a/docutils/test/test_parsers/test_rst/test_section_headers.py +++ /dev/null @@ -1,912 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -"""Tests for states.py.""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['section_headers'] = [ -["""\ -Title -===== - -Paragraph. -""", -"""\ -<document source="test data"> - <section id="title" name="title"> - <title> - Title - <paragraph> - Paragraph. -"""], -["""\ -Title -===== -Paragraph (no blank line). -""", -"""\ -<document source="test data"> - <section id="title" name="title"> - <title> - Title - <paragraph> - Paragraph (no blank line). -"""], -["""\ -Paragraph. - -Title -===== - -Paragraph. -""", -"""\ -<document source="test data"> - <paragraph> - Paragraph. - <section id="title" name="title"> - <title> - Title - <paragraph> - Paragraph. -"""], -["""\ -Test unexpected section titles. - - Title - ===== - Paragraph. - - ----- - Title - ----- - Paragraph. -""", -"""\ -<document source="test data"> - <paragraph> - Test unexpected section titles. - <block_quote> - <system_message level="4" line="4" source="test data" type="SEVERE"> - <paragraph> - Unexpected section title. - <literal_block xml:space="preserve"> - Title - ===== - <paragraph> - Paragraph. - <system_message level="4" line="7" source="test data" type="SEVERE"> - <paragraph> - Unexpected section title or transition. - <literal_block xml:space="preserve"> - ----- - <system_message level="4" line="9" source="test data" type="SEVERE"> - <paragraph> - Unexpected section title. - <literal_block xml:space="preserve"> - Title - ----- - <paragraph> - Paragraph. -"""], -["""\ -Title -==== - -Test short underline. -""", -"""\ -<document source="test data"> - <section id="title" name="title"> - <title> - Title - <system_message level="2" line="2" source="test data" type="WARNING"> - <paragraph> - Title underline too short. - <literal_block xml:space="preserve"> - Title - ==== - <paragraph> - Test short underline. -"""], -["""\ -===== -Title -===== - -Test overline title. -""", -"""\ -<document source="test data"> - <section id="title" name="title"> - <title> - Title - <paragraph> - Test overline title. -"""], -["""\ -======= - Title -======= - -Test overline title with inset. -""", -"""\ -<document source="test data"> - <section id="title" name="title"> - <title> - Title - <paragraph> - Test overline title with inset. -"""], -["""\ -======================== - Test Missing Underline -""", -"""\ -<document source="test data"> - <system_message level="4" line="1" source="test data" type="SEVERE"> - <paragraph> - Incomplete section title. - <literal_block xml:space="preserve"> - ======================== - Test Missing Underline -"""], -["""\ -======================== - Test Missing Underline - -""", -"""\ -<document source="test data"> - <system_message level="4" line="1" source="test data" type="SEVERE"> - <paragraph> - Missing matching underline for section title overline. - <literal_block xml:space="preserve"> - ======================== - Test Missing Underline -"""], -["""\ -======= - Title - -Test missing underline, with paragraph. -""", -"""\ -<document source="test data"> - <system_message level="4" line="1" source="test data" type="SEVERE"> - <paragraph> - Missing matching underline for section title overline. - <literal_block xml:space="preserve"> - ======= - Title - <paragraph> - Test missing underline, with paragraph. -"""], -["""\ -======= - Long Title -======= - -Test long title and space normalization. -""", -"""\ -<document source="test data"> - <section id="long-title" name="long title"> - <title> - Long Title - <system_message level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Title overline too short. - <literal_block xml:space="preserve"> - ======= - Long Title - ======= - <paragraph> - Test long title and space normalization. -"""], -["""\ -======= - Title -------- - -Paragraph. -""", -"""\ -<document source="test data"> - <system_message level="4" line="1" source="test data" type="SEVERE"> - <paragraph> - Title overline & underline mismatch. - <literal_block xml:space="preserve"> - ======= - Title - ------- - <paragraph> - Paragraph. -"""], -["""\ -======================== - -======================== - -Test missing titles; blank line in-between. - -======================== - -======================== -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Document or section may not begin with a transition. - <transition> - <system_message level="3" line="3" source="test data" type="ERROR"> - <paragraph> - At least one body element must separate transitions; adjacent transitions not allowed. - <transition> - <paragraph> - Test missing titles; blank line in-between. - <transition> - <transition> - <system_message level="3" line="9" source="test data" type="ERROR"> - <paragraph> - Document or section may not end with a transition. -"""], -["""\ -======================== -======================== - -Test missing titles; nothing in-between. - -======================== -======================== -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Invalid section title or transition marker. - <literal_block xml:space="preserve"> - ======================== - ======================== - <paragraph> - Test missing titles; nothing in-between. - <system_message level="3" line="6" source="test data" type="ERROR"> - <paragraph> - Invalid section title or transition marker. - <literal_block xml:space="preserve"> - ======================== - ======================== -"""], -["""\ -.. Test return to existing, highest-level section (Title 3). - -Title 1 -======= -Paragraph 1. - -Title 2 -------- -Paragraph 2. - -Title 3 -======= -Paragraph 3. - -Title 4 -------- -Paragraph 4. -""", -"""\ -<document source="test data"> - <comment xml:space="preserve"> - Test return to existing, highest-level section (Title 3). - <section id="title-1" name="title 1"> - <title> - Title 1 - <paragraph> - Paragraph 1. - <section id="title-2" name="title 2"> - <title> - Title 2 - <paragraph> - Paragraph 2. - <section id="title-3" name="title 3"> - <title> - Title 3 - <paragraph> - Paragraph 3. - <section id="title-4" name="title 4"> - <title> - Title 4 - <paragraph> - Paragraph 4. -"""], -["""\ -Test return to existing, highest-level section (Title 3, with overlines). - -======= -Title 1 -======= -Paragraph 1. - -------- -Title 2 -------- -Paragraph 2. - -======= -Title 3 -======= -Paragraph 3. - -------- -Title 4 -------- -Paragraph 4. -""", -"""\ -<document source="test data"> - <paragraph> - Test return to existing, highest-level section (Title 3, with overlines). - <section id="title-1" name="title 1"> - <title> - Title 1 - <paragraph> - Paragraph 1. - <section id="title-2" name="title 2"> - <title> - Title 2 - <paragraph> - Paragraph 2. - <section id="title-3" name="title 3"> - <title> - Title 3 - <paragraph> - Paragraph 3. - <section id="title-4" name="title 4"> - <title> - Title 4 - <paragraph> - Paragraph 4. -"""], -["""\ -Test return to existing, higher-level section (Title 4). - -Title 1 -======= -Paragraph 1. - -Title 2 -------- -Paragraph 2. - -Title 3 -``````` -Paragraph 3. - -Title 4 -------- -Paragraph 4. -""", -"""\ -<document source="test data"> - <paragraph> - Test return to existing, higher-level section (Title 4). - <section id="title-1" name="title 1"> - <title> - Title 1 - <paragraph> - Paragraph 1. - <section id="title-2" name="title 2"> - <title> - Title 2 - <paragraph> - Paragraph 2. - <section id="title-3" name="title 3"> - <title> - Title 3 - <paragraph> - Paragraph 3. - <section id="title-4" name="title 4"> - <title> - Title 4 - <paragraph> - Paragraph 4. -"""], -["""\ -Test bad subsection order (Title 4). - -Title 1 -======= -Paragraph 1. - -Title 2 -------- -Paragraph 2. - -Title 3 -======= -Paragraph 3. - -Title 4 -``````` -Paragraph 4. -""", -"""\ -<document source="test data"> - <paragraph> - Test bad subsection order (Title 4). - <section id="title-1" name="title 1"> - <title> - Title 1 - <paragraph> - Paragraph 1. - <section id="title-2" name="title 2"> - <title> - Title 2 - <paragraph> - Paragraph 2. - <section id="title-3" name="title 3"> - <title> - Title 3 - <paragraph> - Paragraph 3. - <system_message level="4" line="15" source="test data" type="SEVERE"> - <paragraph> - Title level inconsistent: - <literal_block xml:space="preserve"> - Title 4 - ``````` - <paragraph> - Paragraph 4. -"""], -["""\ -Test bad subsection order (Title 4, with overlines). - -======= -Title 1 -======= -Paragraph 1. - -------- -Title 2 -------- -Paragraph 2. - -======= -Title 3 -======= -Paragraph 3. - -``````` -Title 4 -``````` -Paragraph 4. -""", -"""\ -<document source="test data"> - <paragraph> - Test bad subsection order (Title 4, with overlines). - <section id="title-1" name="title 1"> - <title> - Title 1 - <paragraph> - Paragraph 1. - <section id="title-2" name="title 2"> - <title> - Title 2 - <paragraph> - Paragraph 2. - <section id="title-3" name="title 3"> - <title> - Title 3 - <paragraph> - Paragraph 3. - <system_message level="4" line="19" source="test data" type="SEVERE"> - <paragraph> - Title level inconsistent: - <literal_block xml:space="preserve"> - ``````` - Title 4 - ``````` - <paragraph> - Paragraph 4. -"""], -["""\ -Title containing *inline* ``markup`` -==================================== - -Paragraph. -""", -"""\ -<document source="test data"> - <section id="title-containing-inline-markup" name="title containing inline markup"> - <title> - Title containing \n\ - <emphasis> - inline - \n\ - <literal> - markup - <paragraph> - Paragraph. -"""], -["""\ -1. Numbered Title -================= - -Paragraph. -""", -"""\ -<document source="test data"> - <section id="numbered-title" name="1. numbered title"> - <title> - 1. Numbered Title - <paragraph> - Paragraph. -"""], -["""\ -1. Item 1. -2. Item 2. -3. Numbered Title -================= - -Paragraph. -""", -"""\ -<document source="test data"> - <enumerated_list enumtype="arabic" prefix="" suffix="."> - <list_item> - <paragraph> - Item 1. - <list_item> - <paragraph> - Item 2. - <system_message level="2" line="3" source="test data" type="WARNING"> - <paragraph> - Enumerated list ends without a blank line; unexpected unindent. - <section id="numbered-title" name="3. numbered title"> - <title> - 3. Numbered Title - <paragraph> - Paragraph. -"""], -["""\ -ABC -=== - -Short title. -""", -"""\ -<document source="test data"> - <section id="abc" name="abc"> - <title> - ABC - <paragraph> - Short title. -"""], -["""\ -ABC -== - -Underline too short. -""", -"""\ -<document source="test data"> - <system_message level="1" line="2" source="test data" type="INFO"> - <paragraph> - Possible title underline, too short for the title. - Treating it as ordinary text because it's so short. - <paragraph> - ABC - == - <paragraph> - Underline too short. -"""], -["""\ -== -ABC -== - -Over & underline too short. -""", -"""\ -<document source="test data"> - <system_message level="1" line="1" source="test data" type="INFO"> - <paragraph> - Possible incomplete section title. - Treating the overline as ordinary text because it's so short. - <paragraph> - == - ABC - == - <paragraph> - Over & underline too short. -"""], -["""\ -== -ABC - -Overline too short, no underline. -""", -"""\ -<document source="test data"> - <system_message level="1" line="1" source="test data" type="INFO"> - <paragraph> - Possible incomplete section title. - Treating the overline as ordinary text because it's so short. - <paragraph> - == - ABC - <paragraph> - Overline too short, no underline. -"""], -["""\ -== -ABC -""", -"""\ -<document source="test data"> - <system_message level="1" line="1" source="test data" type="INFO"> - <paragraph> - Possible incomplete section title. - Treating the overline as ordinary text because it's so short. - <paragraph> - == - ABC -"""], -["""\ -== - Not a title: a definition list item. -""", -"""\ -<document source="test data"> - <system_message level="1" line="1" source="test data" type="INFO"> - <paragraph> - Possible incomplete section title. - Treating the overline as ordinary text because it's so short. - <definition_list> - <definition_list_item> - <term> - == - <definition> - <paragraph> - Not a title: a definition list item. -"""], -["""\ -== - Not a title: a definition list item. --- - Another definition list item. It's in a different list, - but that's an acceptable limitation given that this will - probably never happen in real life. - - The next line will trigger a warning: -== -""", -"""\ -<document source="test data"> - <system_message level="1" line="1" source="test data" type="INFO"> - <paragraph> - Possible incomplete section title. - Treating the overline as ordinary text because it's so short. - <definition_list> - <definition_list_item> - <term> - == - <definition> - <paragraph> - Not a title: a definition list item. - <system_message level="2" line="3" source="test data" type="WARNING"> - <paragraph> - Definition list ends without a blank line; unexpected unindent. - <system_message level="1" line="3" source="test data" type="INFO"> - <paragraph> - Possible incomplete section title. - Treating the overline as ordinary text because it's so short. - <definition_list> - <definition_list_item> - <term> - -- - <definition> - <paragraph> - Another definition list item. It's in a different list, - but that's an acceptable limitation given that this will - probably never happen in real life. - <paragraph> - The next line will trigger a warning: - <system_message level="2" line="9" source="test data" type="WARNING"> - <paragraph> - Definition list ends without a blank line; unexpected unindent. - <paragraph> - == -"""], -["""\ -Paragraph - - == - ABC - == - - Over & underline too short. -""", -"""\ -<document source="test data"> - <paragraph> - Paragraph - <block_quote> - <system_message level="1" line="3" source="test data" type="INFO"> - <paragraph> - Unexpected possible title overline or transition. - Treating it as ordinary text because it's so short. - <paragraph> - == - ABC - == - <paragraph> - Over & underline too short. -"""], -["""\ -Paragraph - - ABC - == - - Underline too short. -""", -"""\ -<document source="test data"> - <paragraph> - Paragraph - <block_quote> - <paragraph> - ABC - == - <paragraph> - Underline too short. -"""], -["""\ -... -... - -... ---- - -... -... -... -""", -"""\ -<document source="test data"> - <system_message level="1" line="1" source="test data" type="INFO"> - <paragraph> - Possible incomplete section title. - Treating the overline as ordinary text because it's so short. - <section dupname="..." id="id1"> - <title> - ... - <system_message level="1" line="4" source="test data" type="INFO"> - <paragraph> - Possible incomplete section title. - Treating the overline as ordinary text because it's so short. - <section dupname="..." id="id2"> - <title> - ... - <system_message backrefs="id2" level="1" line="5" source="test data" type="INFO"> - <paragraph> - Duplicate implicit target name: "...". - <system_message level="1" line="7" source="test data" type="INFO"> - <paragraph> - Possible incomplete section title. - Treating the overline as ordinary text because it's so short. - <system_message level="1" line="7" source="test data" type="INFO"> - <paragraph> - Possible incomplete section title. - Treating the overline as ordinary text because it's so short. - <section dupname="..." id="id3"> - <title> - ... - <system_message backrefs="id3" level="1" line="8" source="test data" type="INFO"> - <paragraph> - Duplicate implicit target name: "...". - <paragraph> - ... -"""], -["""\ -.. -Hi -.. - -... -Yo -... - -Ho -""", -"""\ -<document source="test data"> - <comment xml:space="preserve"> - <system_message level="2" line="2" source="test data" type="WARNING"> - <paragraph> - Explicit markup ends without a blank line; unexpected unindent. - <section id="hi" name="hi"> - <title> - Hi - <section id="yo" name="yo"> - <title> - Yo - <paragraph> - Ho -"""], -["""\ -Empty Section -============= -""", -"""\ -<document source="test data"> - <section id="empty-section" name="empty section"> - <title> - Empty Section - <system_message level="3" line="2" source="test data" type="ERROR"> - <paragraph> - Section empty; must have contents. -"""], -["""\ -=== -One -=== - -The bubble-up parser strategy conflicts with short titles -(<= 3 char-long over- & underlines). - -=== -Two -=== - -The parser currently contains a work-around kludge. -Without it, the parser ends up in an infinite loop. -""", -"""\ -<document source="test data"> - <section id="one" name="one"> - <title> - One - <paragraph> - The bubble-up parser strategy conflicts with short titles - (<= 3 char-long over- & underlines). - <section id="two" name="two"> - <title> - Two - <paragraph> - The parser currently contains a work-around kludge. - Without it, the parser ends up in an infinite loop. -"""], -["""\ -""", -"""\ -<document source="test data"> - <system_message level="3" line="0" source="test data" type="ERROR"> - <paragraph> - Document empty; must have contents. -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_substitutions.py b/docutils/test/test_parsers/test_rst/test_substitutions.py deleted file mode 100755 index ecbe5eab1..000000000 --- a/docutils/test/test_parsers/test_rst/test_substitutions.py +++ /dev/null @@ -1,231 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for states.py. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['substitution_definitions'] = [ -["""\ -Here's an image substitution definition: - -.. |symbol| image:: symbol.png -""", -"""\ -<document source="test data"> - <paragraph> - Here's an image substitution definition: - <substitution_definition name="symbol"> - <image alt="symbol" uri="symbol.png"> -"""], -["""\ -Embedded directive starts on the next line: - -.. |symbol| - image:: symbol.png -""", -"""\ -<document source="test data"> - <paragraph> - Embedded directive starts on the next line: - <substitution_definition name="symbol"> - <image alt="symbol" uri="symbol.png"> -"""], -["""\ -Here's a series of substitution definitions: - -.. |symbol 1| image:: symbol1.png -.. |SYMBOL 2| image:: symbol2.png - :height: 50 - :width: 100 -.. |symbol 3| image:: symbol3.png -""", -"""\ -<document source="test data"> - <paragraph> - Here's a series of substitution definitions: - <substitution_definition name="symbol 1"> - <image alt="symbol 1" uri="symbol1.png"> - <substitution_definition name="SYMBOL 2"> - <image alt="SYMBOL 2" height="50" uri="symbol2.png" width="100"> - <substitution_definition name="symbol 3"> - <image alt="symbol 3" uri="symbol3.png"> -"""], -["""\ -.. |very long substitution text, - split across lines| image:: symbol.png -""", -"""\ -<document source="test data"> - <substitution_definition name="very long substitution text, split across lines"> - <image alt="very long substitution text, split across lines" uri="symbol.png"> -"""], -["""\ -.. |symbol 1| image:: symbol.png - - Followed by a block quote. -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "image" directive: - no content permitted. - <literal_block xml:space="preserve"> - image:: symbol.png - \n\ - Followed by a block quote. - <system_message level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Substitution definition "symbol 1" empty or invalid. - <literal_block xml:space="preserve"> - .. |symbol 1| image:: symbol.png - \n\ - Followed by a block quote. -"""], -["""\ -.. |symbol 1| image:: symbol.png - -Followed by a paragraph. - -.. |symbol 2| image:: symbol.png - -.. - - Followed by a block quote. -""", -"""\ -<document source="test data"> - <substitution_definition name="symbol 1"> - <image alt="symbol 1" uri="symbol.png"> - <paragraph> - Followed by a paragraph. - <substitution_definition name="symbol 2"> - <image alt="symbol 2" uri="symbol.png"> - <comment xml:space="preserve"> - <block_quote> - <paragraph> - Followed by a block quote. -"""], -[u"""\ -Substitutions support case differences: - -.. |eacute| replace:: \u00E9 -.. |Eacute| replace:: \u00C9 -""", -u"""\ -<document source="test data"> - <paragraph> - Substitutions support case differences: - <substitution_definition name="eacute"> - \u00E9 - <substitution_definition name="Eacute"> - \u00C9 -"""], -["""\ -Here are some duplicate substitution definitions: - -.. |symbol| image:: symbol.png -.. |symbol| image:: symbol.png -""", -"""\ -<document source="test data"> - <paragraph> - Here are some duplicate substitution definitions: - <substitution_definition dupname="symbol"> - <image alt="symbol" uri="symbol.png"> - <system_message level="3" line="4" source="test data" type="ERROR"> - <paragraph> - Duplicate substitution definition name: "symbol". - <substitution_definition name="symbol"> - <image alt="symbol" uri="symbol.png"> -"""], -["""\ -Here are some bad cases: - -.. |symbol| image:: symbol.png -No blank line after. - -.. |empty| - -.. |unknown| directive:: symbol.png - -.. |invalid 1| there's no directive here -.. |invalid 2| there's no directive here - With some block quote text, line 1. - And some more, line 2. - -.. |invalid 3| there's no directive here - -.. | bad name | bad data -""", -"""\ -<document source="test data"> - <paragraph> - Here are some bad cases: - <substitution_definition name="symbol"> - <image alt="symbol" uri="symbol.png"> - <system_message level="2" line="4" source="test data" type="WARNING"> - <paragraph> - Explicit markup ends without a blank line; unexpected unindent. - <paragraph> - No blank line after. - <system_message level="2" line="6" source="test data" type="WARNING"> - <paragraph> - Substitution definition "empty" missing contents. - <literal_block xml:space="preserve"> - .. |empty| - <system_message level="1" line="8" source="test data" type="INFO"> - <paragraph> - No directive entry for "directive" in module "docutils.parsers.rst.languages.en". - Trying "directive" as canonical directive name. - <system_message level="3" line="8" source="test data" type="ERROR"> - <paragraph> - Unknown directive type "directive". - <literal_block xml:space="preserve"> - directive:: symbol.png - <system_message level="2" line="8" source="test data" type="WARNING"> - <paragraph> - Substitution definition "unknown" empty or invalid. - <literal_block xml:space="preserve"> - .. |unknown| directive:: symbol.png - <system_message level="2" line="10" source="test data" type="WARNING"> - <paragraph> - Substitution definition "invalid 1" empty or invalid. - <literal_block xml:space="preserve"> - .. |invalid 1| there's no directive here - <system_message level="2" line="11" source="test data" type="WARNING"> - <paragraph> - Substitution definition "invalid 2" empty or invalid. - <literal_block xml:space="preserve"> - .. |invalid 2| there's no directive here - With some block quote text, line 1. - And some more, line 2. - <system_message level="2" line="15" source="test data" type="WARNING"> - <paragraph> - Substitution definition "invalid 3" empty or invalid. - <literal_block xml:space="preserve"> - .. |invalid 3| there's no directive here - <comment xml:space="preserve"> - | bad name | bad data -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_tables.py b/docutils/test/test_parsers/test_rst/test_tables.py deleted file mode 100755 index d0d1d1317..000000000 --- a/docutils/test/test_parsers/test_rst/test_tables.py +++ /dev/null @@ -1,1151 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for states.py. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['full_tables'] = [ -["""\ -+-------------------------------------+ -| A table with one cell and one line. | -+-------------------------------------+ -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="1"> - <colspec colwidth="37"> - <tbody> - <row> - <entry> - <paragraph> - A table with one cell and one line. -"""], -["""\ -+-----------------------+ -| A table with one cell | -| and two lines. | -+-----------------------+ -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="1"> - <colspec colwidth="23"> - <tbody> - <row> - <entry> - <paragraph> - A table with one cell - and two lines. -"""], -["""\ -+-----------------------+ -| A malformed table. | -+-----------------------+ -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Malformed table. - <literal_block xml:space="preserve"> - +-----------------------+ - | A malformed table. | - +-----------------------+ -"""], -["""\ -+------------------------+ -| A well-formed | table. | -+------------------------+ - -+------------------------+ -| This +----------+ too! | -+------------------------+ -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="1"> - <colspec colwidth="24"> - <tbody> - <row> - <entry> - <paragraph> - A well-formed | table. - <table> - <tgroup cols="1"> - <colspec colwidth="24"> - <tbody> - <row> - <entry> - <paragraph> - This +----------+ too! -"""], -["""\ -+--------------+--------------+ -| A table with | two columns. | -+--------------+--------------+ -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="2"> - <colspec colwidth="14"> - <colspec colwidth="14"> - <tbody> - <row> - <entry> - <paragraph> - A table with - <entry> - <paragraph> - two columns. -"""], -["""\ -+--------------+ -| A table with | -+--------------+ -| two rows. | -+--------------+ -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="1"> - <colspec colwidth="14"> - <tbody> - <row> - <entry> - <paragraph> - A table with - <row> - <entry> - <paragraph> - two rows. -"""], -["""\ -+--------------+-------------+ -| A table with | two columns | -+--------------+-------------+ -| and | two rows. | -+--------------+-------------+ -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="2"> - <colspec colwidth="14"> - <colspec colwidth="13"> - <tbody> - <row> - <entry> - <paragraph> - A table with - <entry> - <paragraph> - two columns - <row> - <entry> - <paragraph> - and - <entry> - <paragraph> - two rows. -"""], -["""\ -+--------------+---------------+ -| A table with | two columns, | -+--------------+---------------+ -| two rows, and a column span. | -+------------------------------+ -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="2"> - <colspec colwidth="14"> - <colspec colwidth="15"> - <tbody> - <row> - <entry> - <paragraph> - A table with - <entry> - <paragraph> - two columns, - <row> - <entry morecols="1"> - <paragraph> - two rows, and a column span. -"""], -["""\ -+--------------------------+ -| A table with three rows, | -+------------+-------------+ -| and two | columns. | -+------------+-------------+ -| First and last rows | -| contains column spans. | -+--------------------------+ -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="2"> - <colspec colwidth="12"> - <colspec colwidth="13"> - <tbody> - <row> - <entry morecols="1"> - <paragraph> - A table with three rows, - <row> - <entry> - <paragraph> - and two - <entry> - <paragraph> - columns. - <row> - <entry morecols="1"> - <paragraph> - First and last rows - contains column spans. -"""], -["""\ -+--------------+--------------+ -| A table with | two columns, | -+--------------+ and a row | -| two rows, | span. | -+--------------+--------------+ -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="2"> - <colspec colwidth="14"> - <colspec colwidth="14"> - <tbody> - <row> - <entry> - <paragraph> - A table with - <entry morerows="1"> - <paragraph> - two columns, - and a row - span. - <row> - <entry> - <paragraph> - two rows, -"""], -["""\ -+------------+-------------+---------------+ -| A table | two rows in | and row spans | -| with three +-------------+ to left and | -| columns, | the middle, | right. | -+------------+-------------+---------------+ -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="3"> - <colspec colwidth="12"> - <colspec colwidth="13"> - <colspec colwidth="15"> - <tbody> - <row> - <entry morerows="1"> - <paragraph> - A table - with three - columns, - <entry> - <paragraph> - two rows in - <entry morerows="1"> - <paragraph> - and row spans - to left and - right. - <row> - <entry> - <paragraph> - the middle, -"""], -["""\ -Complex spanning pattern (no edge knows all rows/cols): - -+-----------+-------------------------+ -| W/NW cell | N/NE cell | -| +-------------+-----------+ -| | Middle cell | E/SE cell | -+-----------+-------------+ | -| S/SE cell | | -+-------------------------+-----------+ -""", -"""\ -<document source="test data"> - <paragraph> - Complex spanning pattern (no edge knows all rows/cols): - <table> - <tgroup cols="3"> - <colspec colwidth="11"> - <colspec colwidth="13"> - <colspec colwidth="11"> - <tbody> - <row> - <entry morerows="1"> - <paragraph> - W/NW cell - <entry morecols="1"> - <paragraph> - N/NE cell - <row> - <entry> - <paragraph> - Middle cell - <entry morerows="1"> - <paragraph> - E/SE cell - <row> - <entry morecols="1"> - <paragraph> - S/SE cell -"""], -["""\ -+------------------------+------------+----------+----------+ -| Header row, column 1 | Header 2 | Header 3 | Header 4 | -+========================+============+==========+==========+ -| body row 1, column 1 | column 2 | column 3 | column 4 | -+------------------------+------------+----------+----------+ -| body row 2 | Cells may span columns. | -+------------------------+------------+---------------------+ -| body row 3 | Cells may | - Table cells | -+------------------------+ span rows. | - contain | -| body row 4 | | - body elements. | -+------------------------+------------+---------------------+ -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="4"> - <colspec colwidth="24"> - <colspec colwidth="12"> - <colspec colwidth="10"> - <colspec colwidth="10"> - <thead> - <row> - <entry> - <paragraph> - Header row, column 1 - <entry> - <paragraph> - Header 2 - <entry> - <paragraph> - Header 3 - <entry> - <paragraph> - Header 4 - <tbody> - <row> - <entry> - <paragraph> - body row 1, column 1 - <entry> - <paragraph> - column 2 - <entry> - <paragraph> - column 3 - <entry> - <paragraph> - column 4 - <row> - <entry> - <paragraph> - body row 2 - <entry morecols="2"> - <paragraph> - Cells may span columns. - <row> - <entry> - <paragraph> - body row 3 - <entry morerows="1"> - <paragraph> - Cells may - span rows. - <entry morecols="1" morerows="1"> - <bullet_list bullet="-"> - <list_item> - <paragraph> - Table cells - <list_item> - <paragraph> - contain - <list_item> - <paragraph> - body elements. - <row> - <entry> - <paragraph> - body row 4 -"""], -["""\ -+-----------------+--------+ -| A simple table | cell 2 | -+-----------------+--------+ -| cell 3 | cell 4 | -+-----------------+--------+ -No blank line after table. -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="2"> - <colspec colwidth="17"> - <colspec colwidth="8"> - <tbody> - <row> - <entry> - <paragraph> - A simple table - <entry> - <paragraph> - cell 2 - <row> - <entry> - <paragraph> - cell 3 - <entry> - <paragraph> - cell 4 - <system_message level="2" line="6" source="test data" type="WARNING"> - <paragraph> - Blank line required after table. - <paragraph> - No blank line after table. -"""], -["""\ -+-----------------+--------+ -| A simple table | cell 2 | -+-----------------+--------+ -| cell 3 | cell 4 | -+-----------------+--------+ - Unexpected indent and no blank line after table. -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="2"> - <colspec colwidth="17"> - <colspec colwidth="8"> - <tbody> - <row> - <entry> - <paragraph> - A simple table - <entry> - <paragraph> - cell 2 - <row> - <entry> - <paragraph> - cell 3 - <entry> - <paragraph> - cell 4 - <system_message level="3" line="6" source="test data" type="ERROR"> - <paragraph> - Unexpected indentation. - <system_message level="2" line="6" source="test data" type="WARNING"> - <paragraph> - Blank line required after table. - <block_quote> - <paragraph> - Unexpected indent and no blank line after table. -"""], -["""\ -+--------------+-------------+ -| A bad table. | | -+--------------+ | -| Cells must be rectangles. | -+----------------------------+ -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Malformed table. - Malformed table; parse incomplete. - <literal_block xml:space="preserve"> - +--------------+-------------+ - | A bad table. | | - +--------------+ | - | Cells must be rectangles. | - +----------------------------+ -"""], -["""\ -+------------------------------+ -| This table contains another. | -| | -| +-------------------------+ | -| | A table within a table. | | -| +-------------------------+ | -+------------------------------+ -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="1"> - <colspec colwidth="30"> - <tbody> - <row> - <entry> - <paragraph> - This table contains another. - <table> - <tgroup cols="1"> - <colspec colwidth="25"> - <tbody> - <row> - <entry> - <paragraph> - A table within a table. -"""], -["""\ -+------------------+--------+ -| A simple table | | -+------------------+--------+ -| with empty cells | | -+------------------+--------+ -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="2"> - <colspec colwidth="18"> - <colspec colwidth="8"> - <tbody> - <row> - <entry> - <paragraph> - A simple table - <entry> - <row> - <entry> - <paragraph> - with empty cells - <entry> -"""], -] - -totest['simple_tables'] = [ -["""\ -============ ============ -A table with two columns. -============ ============ - -Paragraph. -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="2"> - <colspec colwidth="12"> - <colspec colwidth="12"> - <tbody> - <row> - <entry> - <paragraph> - A table with - <entry> - <paragraph> - two columns. - <paragraph> - Paragraph. -"""], -["""\ -============ ============ -A table with two columns -and two rows. -============ ============ -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="2"> - <colspec colwidth="12"> - <colspec colwidth="12"> - <tbody> - <row> - <entry> - <paragraph> - A table with - <entry> - <paragraph> - two columns - <row> - <entry> - <paragraph> - and - <entry> - <paragraph> - two rows. -"""], -["""\ -============ ============== -A table with two columns, -two rows, and a column span. -============================ -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="2"> - <colspec colwidth="12"> - <colspec colwidth="14"> - <tbody> - <row> - <entry> - <paragraph> - A table with - <entry> - <paragraph> - two columns, - <row> - <entry morecols="1"> - <paragraph> - two rows, and a column span. -"""], -["""\ -== =========== =========== -1 A table with three rows, --- ------------------------ -2 and three columns. -3 First and third rows - contain column spans. - - This row is a multi-line row, and overflows to the right. --- ------------------------ -4 One last row. -== =========== =========== -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="3"> - <colspec colwidth="2"> - <colspec colwidth="11"> - <colspec colwidth="44"> - <tbody> - <row> - <entry> - <paragraph> - 1 - <entry morecols="1"> - <paragraph> - A table with three rows, - <row> - <entry> - <paragraph> - 2 - <entry> - <paragraph> - and three - <entry> - <paragraph> - columns. - <row> - <entry> - <paragraph> - 3 - <entry morecols="1"> - <paragraph> - First and third rows - contain column spans. - <paragraph> - This row is a multi-line row, and overflows to the right. - <row> - <entry> - <paragraph> - 4 - <entry> - <paragraph> - One last - <entry> - <paragraph> - row. -"""], -["""\ -======= ========= ======== -A table with three columns. -================== ======== -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="3"> - <colspec colwidth="7"> - <colspec colwidth="9"> - <colspec colwidth="8"> - <tbody> - <row> - <entry morecols="1"> - <paragraph> - A table with three - <entry> - <paragraph> - columns. -"""], -["""\ -============== ====== -A simple table with -no bottom border -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Malformed table. - No bottom table border found. - <literal_block xml:space="preserve"> - ============== ====== - A simple table with - no bottom border -"""], -["""\ -============== ====== -A simple table cell 2 -cell 3 cell 4 -============== ====== -No blank line after table. -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Malformed table. - No bottom table border found or no blank line after table bottom. - <literal_block xml:space="preserve"> - ============== ====== - A simple table cell 2 - cell 3 cell 4 - ============== ====== - <system_message level="2" line="5" source="test data" type="WARNING"> - <paragraph> - Blank line required after table. - <paragraph> - No blank line after table. -"""], -["""\ -============== ====== -A simple table cell 2 -============== ====== -cell 3 cell 4 -============== ====== -No blank line after table. -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="2"> - <colspec colwidth="14"> - <colspec colwidth="6"> - <thead> - <row> - <entry> - <paragraph> - A simple table - <entry> - <paragraph> - cell 2 - <tbody> - <row> - <entry> - <paragraph> - cell 3 - <entry> - <paragraph> - cell 4 - <system_message level="2" line="6" source="test data" type="WARNING"> - <paragraph> - Blank line required after table. - <paragraph> - No blank line after table. -"""], -["""\ -============== ====== -A simple table cell 2 -cell 3 cell 4 -============== ====== - Unexpected indent and no blank line after table. -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Malformed table. - No bottom table border found or no blank line after table bottom. - <literal_block xml:space="preserve"> - ============== ====== - A simple table cell 2 - cell 3 cell 4 - ============== ====== - <system_message level="2" line="5" source="test data" type="WARNING"> - <paragraph> - Blank line required after table. - <block_quote> - <paragraph> - Unexpected indent and no blank line after table. -"""], -["""\ -============== ====== -A bad table cell 2 -cell 3 cell 4 -============ ======== -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Malformed table. - Column span alignment problem at line offset 2. - <literal_block xml:space="preserve"> - ============== ====== - A bad table cell 2 - cell 3 cell 4 - ============ ======== -"""], -["""\ -======== ========= -A bad table cell 2 -cell 3 cell 4 -======== ========= -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Malformed table. - Text in column margin at line offset 1. - <literal_block xml:space="preserve"> - ======== ========= - A bad table cell 2 - cell 3 cell 4 - ======== ========= -"""], -["""\ -== ============================ -1 This table contains another. -2 ======= ====== ======== - A table within a table. - ======= ====== ======== - - The outer table does have to - have at least two columns - though. -== ============================ -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="2"> - <colspec colwidth="2"> - <colspec colwidth="28"> - <tbody> - <row> - <entry> - <paragraph> - 1 - <entry> - <paragraph> - This table contains another. - <row> - <entry> - <paragraph> - 2 - <entry> - <table> - <tgroup cols="3"> - <colspec colwidth="7"> - <colspec colwidth="6"> - <colspec colwidth="8"> - <tbody> - <row> - <entry> - <paragraph> - A table - <entry> - <paragraph> - within - <entry> - <paragraph> - a table. - <paragraph> - The outer table does have to - have at least two columns - though. -"""], -["""\ -================ ====== -A simple table -with empty cells -================ ====== -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="2"> - <colspec colwidth="16"> - <colspec colwidth="6"> - <tbody> - <row> - <entry> - <paragraph> - A simple table - <entry> - <row> - <entry> - <paragraph> - with empty cells - <entry> -"""], -["""\ -============== ======== - A table with -============== ======== - centered cells. - -============== ======== -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="2"> - <colspec colwidth="14"> - <colspec colwidth="8"> - <thead> - <row> - <entry> - <paragraph> - A table - <entry> - <paragraph> - with - <tbody> - <row> - <entry> - <paragraph> - centered - <entry> - <paragraph> - cells. -"""], -["""\ -============== ====== -A simple table this text extends to the right -cell 3 the bottom border below is too long -============== ======== -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Malformed table. - Bottom/header table border does not match top border. - <literal_block xml:space="preserve"> - ============== ====== - A simple table this text extends to the right - cell 3 the bottom border below is too long - ============== ======== -"""], -["""\ -============ ================= -A table with row separators. ------------- ----------------- - -Blank line before. ------------- ----------------- - -Blank lines before and after. - ------------- ----------------- -Blank line after. - -============ ================= -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="2"> - <colspec colwidth="12"> - <colspec colwidth="17"> - <tbody> - <row> - <entry> - <paragraph> - A table with - <entry> - <paragraph> - row separators. - <row> - <entry> - <paragraph> - Blank line - <entry> - <paragraph> - before. - <row> - <entry> - <paragraph> - Blank lines - <entry> - <paragraph> - before and after. - <row> - <entry> - <paragraph> - Blank line - <entry> - <paragraph> - after. -"""], -["""\ -============ ==================== -A table with many row separators. ------------- -------------------- ------------- -------------------- - ------------- -------------------- -============ ==================== -""", -"""\ -<document source="test data"> - <table> - <tgroup cols="2"> - <colspec colwidth="12"> - <colspec colwidth="20"> - <tbody> - <row> - <entry> - <paragraph> - A table with - <entry> - <paragraph> - many row separators. - <row> - <entry> - <entry> - <row> - <entry> - <entry> - <row> - <entry> - <entry> -"""], -["""\ -== =========== =========== -1 Span columns 2 & 3 --- ------------------------ -2 Span columns 2 & 3 - ------------------------ -3 -== =========== =========== - -== =========== =========== -1 Span cols 1&2 but not 3 ---------------- ----------- -2 Span cols 1&2 but not 3 ---------------- -3 no spans here -== =========== =========== - -== =========== =========== -1 Not a span Not a span - ----------- ----------- -2 -== =========== =========== -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Malformed table. - Text in column margin at line offset 3. - <literal_block xml:space="preserve"> - == =========== =========== - 1 Span columns 2 & 3 - -- ------------------------ - 2 Span columns 2 & 3 - ------------------------ - 3 - == =========== =========== - <system_message level="3" line="9" source="test data" type="ERROR"> - <paragraph> - Malformed table. - Column span incomplete at line offset 4. - <literal_block xml:space="preserve"> - == =========== =========== - 1 Span cols 1&2 but not 3 - --------------- ----------- - 2 Span cols 1&2 but not 3 - --------------- - 3 no spans here - == =========== =========== - <table> - <tgroup cols="3"> - <colspec colwidth="2"> - <colspec colwidth="11"> - <colspec colwidth="11"> - <tbody> - <row> - <entry> - <paragraph> - 1 - <entry> - <system_message level="4" line="20" source="test data" type="SEVERE"> - <paragraph> - Unexpected section title. - <literal_block xml:space="preserve"> - Not a span - ----------- - <entry> - <system_message level="4" line="20" source="test data" type="SEVERE"> - <paragraph> - Unexpected section title. - <literal_block xml:space="preserve"> - Not a span - ----------- - <row> - <entry> - <paragraph> - 2 - <entry> - <entry> -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_targets.py b/docutils/test/test_parsers/test_rst/test_targets.py deleted file mode 100755 index f246ccf6e..000000000 --- a/docutils/test/test_parsers/test_rst/test_targets.py +++ /dev/null @@ -1,448 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for states.py. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['targets'] = [ -["""\ -.. _target: - -(Internal hyperlink target.) -""", -"""\ -<document source="test data"> - <target id="target" name="target"> - <paragraph> - (Internal hyperlink target.) -"""], -["""\ -.. _optional space before colon : -""", -"""\ -<document source="test data"> - <target id="optional-space-before-colon" name="optional space before colon"> -"""], -["""\ -External hyperlink targets: - -.. _one-liner: http://structuredtext.sourceforge.net - -.. _starts-on-this-line: http:// - structuredtext. - sourceforge.net - -.. _entirely-below: - http://structuredtext. - sourceforge.net - -.. _not-indirect: uri\_ -""", -"""\ -<document source="test data"> - <paragraph> - External hyperlink targets: - <target id="one-liner" name="one-liner" refuri="http://structuredtext.sourceforge.net"> - <target id="starts-on-this-line" name="starts-on-this-line" refuri="http://structuredtext.sourceforge.net"> - <target id="entirely-below" name="entirely-below" refuri="http://structuredtext.sourceforge.net"> - <target id="not-indirect" name="not-indirect" refuri="uri_"> -"""], -["""\ -Indirect hyperlink targets: - -.. _target1: reference_ - -.. _target2: `phrase-link reference`_ -""", -"""\ -<document source="test data"> - <paragraph> - Indirect hyperlink targets: - <target id="target1" name="target1" refname="reference"> - <target id="target2" name="target2" refname="phrase-link reference"> -"""], -["""\ -.. _target1: Not a proper hyperlink target - -.. _target2: Although it ends with an underscore, this is not a phrase-link_ - -.. _target3: A multi-line verson of something - ending with an underscore, but not a phrase-link_ -""", -"""\ -<document source="test data"> - <system_message level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Hyperlink target contains whitespace. Perhaps a footnote was intended? - <literal_block xml:space="preserve"> - .. _target1: Not a proper hyperlink target - <system_message level="2" line="3" source="test data" type="WARNING"> - <paragraph> - Hyperlink target contains whitespace. Perhaps a footnote was intended? - <literal_block xml:space="preserve"> - .. _target2: Although it ends with an underscore, this is not a phrase-link_ - <system_message level="2" line="5" source="test data" type="WARNING"> - <paragraph> - Hyperlink target contains whitespace. Perhaps a footnote was intended? - <literal_block xml:space="preserve"> - .. _target3: A multi-line verson of something - ending with an underscore, but not a phrase-link_ -"""], -["""\ -.. __: Not a proper hyperlink target - -__ Although it ends with an underscore, this is not a phrase-link_ - -__ A multi-line verson of something - ending with an underscore, but not a phrase-link_ -""", -"""\ -<document source="test data"> - <system_message level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Hyperlink target contains whitespace. Perhaps a footnote was intended? - <literal_block xml:space="preserve"> - .. __: Not a proper hyperlink target - <system_message level="2" line="3" source="test data" type="WARNING"> - <paragraph> - Anonymous hyperlink target contains whitespace. Perhaps a footnote was intended? - <literal_block xml:space="preserve"> - __ Although it ends with an underscore, this is not a phrase-link_ - <system_message level="2" line="5" source="test data" type="WARNING"> - <paragraph> - Anonymous hyperlink target contains whitespace. Perhaps a footnote was intended? - <literal_block xml:space="preserve"> - __ A multi-line verson of something - ending with an underscore, but not a phrase-link_ -"""], -["""\ -.. _a long target name: - -.. _`a target name: including a colon (quoted)`: - -.. _a target name\: including a colon (escaped): -""", -"""\ -<document source="test data"> - <target id="a-long-target-name" name="a long target name"> - <target id="a-target-name-including-a-colon-quoted" name="a target name: including a colon (quoted)"> - <target id="a-target-name-including-a-colon-escaped" name="a target name: including a colon (escaped)"> -"""], -["""\ -.. _a very long target name, - split across lines: -.. _`and another, - with backquotes`: -""", -"""\ -<document source="test data"> - <target id="a-very-long-target-name-split-across-lines" name="a very long target name, split across lines"> - <target id="and-another-with-backquotes" name="and another, with backquotes"> -"""], -["""\ -External hyperlink: - -.. _target: http://www.python.org/ -""", -"""\ -<document source="test data"> - <paragraph> - External hyperlink: - <target id="target" name="target" refuri="http://www.python.org/"> -"""], -["""\ -.. _email: jdoe@example.com - -.. _multi-line email: jdoe - @example.com -""", -"""\ -<document source="test data"> - <target id="email" name="email" refuri="mailto:jdoe@example.com"> - <target id="multi-line-email" name="multi-line email" refuri="mailto:jdoe@example.com"> -"""], -["""\ -Duplicate external targets (different URIs): - -.. _target: first - -.. _target: second -""", -"""\ -<document source="test data"> - <paragraph> - Duplicate external targets (different URIs): - <target dupname="target" id="target" refuri="first"> - <system_message backrefs="id1" level="2" line="5" source="test data" type="WARNING"> - <paragraph> - Duplicate explicit target name: "target". - <target dupname="target" id="id1" refuri="second"> -"""], -["""\ -Duplicate external targets (same URIs): - -.. _target: first - -.. _target: first -""", -"""\ -<document source="test data"> - <paragraph> - Duplicate external targets (same URIs): - <target id="target" name="target" refuri="first"> - <system_message backrefs="id1" level="1" line="5" source="test data" type="INFO"> - <paragraph> - Duplicate explicit target name: "target". - <target dupname="target" id="id1" refuri="first"> -"""], -["""\ -Duplicate implicit targets. - -Title -===== - -Paragraph. - -Title -===== - -Paragraph. -""", -"""\ -<document source="test data"> - <paragraph> - Duplicate implicit targets. - <section dupname="title" id="title"> - <title> - Title - <paragraph> - Paragraph. - <section dupname="title" id="id1"> - <title> - Title - <system_message backrefs="id1" level="1" line="9" source="test data" type="INFO"> - <paragraph> - Duplicate implicit target name: "title". - <paragraph> - Paragraph. -"""], -["""\ -Duplicate implicit/explicit targets. - -Title -===== - -.. _title: - -Paragraph. -""", -"""\ -<document source="test data"> - <paragraph> - Duplicate implicit/explicit targets. - <section dupname="title" id="title"> - <title> - Title - <system_message backrefs="id1" level="1" line="6" source="test data" type="INFO"> - <paragraph> - Duplicate implicit target name: "title". - <target id="id1" name="title"> - <paragraph> - Paragraph. -"""], -["""\ -Duplicate explicit targets. - -.. _title: - -First. - -.. _title: - -Second. - -.. _title: - -Third. -""", -"""\ -<document source="test data"> - <paragraph> - Duplicate explicit targets. - <target dupname="title" id="title"> - <paragraph> - First. - <system_message backrefs="id1" level="2" line="7" source="test data" type="WARNING"> - <paragraph> - Duplicate explicit target name: "title". - <target dupname="title" id="id1"> - <paragraph> - Second. - <system_message backrefs="id2" level="2" line="11" source="test data" type="WARNING"> - <paragraph> - Duplicate explicit target name: "title". - <target dupname="title" id="id2"> - <paragraph> - Third. -"""], -["""\ -Duplicate targets: - -Target -====== - -Implicit section header target. - -.. [target] Citation target. - -.. [#target] Autonumber-labeled footnote target. - -.. _target: - -Explicit internal target. - -.. _target: Explicit_external_target -""", -"""\ -<document source="test data"> - <paragraph> - Duplicate targets: - <section dupname="target" id="target"> - <title> - Target - <paragraph> - Implicit section header target. - <citation dupname="target" id="id1"> - <label> - target - <system_message backrefs="id1" level="1" line="8" source="test data" type="INFO"> - <paragraph> - Duplicate implicit target name: "target". - <paragraph> - Citation target. - <footnote auto="1" dupname="target" id="id2"> - <system_message backrefs="id2" level="2" line="10" source="test data" type="WARNING"> - <paragraph> - Duplicate explicit target name: "target". - <paragraph> - Autonumber-labeled footnote target. - <system_message backrefs="id3" level="2" line="12" source="test data" type="WARNING"> - <paragraph> - Duplicate explicit target name: "target". - <target dupname="target" id="id3"> - <paragraph> - Explicit internal target. - <system_message backrefs="id4" level="2" line="16" source="test data" type="WARNING"> - <paragraph> - Duplicate explicit target name: "target". - <target dupname="target" id="id4" refuri="Explicit_external_target"> -"""], -] - -totest['anonymous_targets'] = [ -["""\ -Anonymous external hyperlink target: - -.. __: http://w3c.org/ -""", -"""\ -<document source="test data"> - <paragraph> - Anonymous external hyperlink target: - <target anonymous="1" id="id1" refuri="http://w3c.org/"> -"""], -["""\ -Anonymous external hyperlink target: - -__ http://w3c.org/ -""", -"""\ -<document source="test data"> - <paragraph> - Anonymous external hyperlink target: - <target anonymous="1" id="id1" refuri="http://w3c.org/"> -"""], -["""\ -Anonymous indirect hyperlink target: - -.. __: reference_ -""", -"""\ -<document source="test data"> - <paragraph> - Anonymous indirect hyperlink target: - <target anonymous="1" id="id1" refname="reference"> -"""], -["""\ -Anonymous indirect hyperlink targets: - -__ reference_ -__ `a very long - reference`_ -""", -"""\ -<document source="test data"> - <paragraph> - Anonymous indirect hyperlink targets: - <target anonymous="1" id="id1" refname="reference"> - <target anonymous="1" id="id2" refname="a very long reference"> -"""], -["""\ -Mixed anonymous & named indirect hyperlink targets: - -__ reference_ -.. __: reference_ -__ reference_ -.. _target1: reference_ -no blank line - -.. _target2: reference_ -__ reference_ -.. __: reference_ -__ reference_ -no blank line -""", -"""\ -<document source="test data"> - <paragraph> - Mixed anonymous & named indirect hyperlink targets: - <target anonymous="1" id="id1" refname="reference"> - <target anonymous="1" id="id2" refname="reference"> - <target anonymous="1" id="id3" refname="reference"> - <target id="target1" name="target1" refname="reference"> - <system_message level="2" line="7" source="test data" type="WARNING"> - <paragraph> - Explicit markup ends without a blank line; unexpected unindent. - <paragraph> - no blank line - <target id="target2" name="target2" refname="reference"> - <target anonymous="1" id="id4" refname="reference"> - <target anonymous="1" id="id5" refname="reference"> - <target anonymous="1" id="id6" refname="reference"> - <system_message level="2" line="13" source="test data" type="WARNING"> - <paragraph> - Explicit markup ends without a blank line; unexpected unindent. - <paragraph> - no blank line -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_parsers/test_rst/test_transitions.py b/docutils/test/test_parsers/test_rst/test_transitions.py deleted file mode 100755 index 3e8a63e91..000000000 --- a/docutils/test/test_parsers/test_rst/test_transitions.py +++ /dev/null @@ -1,220 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for transition markers. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.ParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -# See DocutilsTestSupport.ParserTestSuite.generateTests for a -# description of the 'totest' data structure. -totest['transitions'] = [ -["""\ -Test transition markers. - --------- - -Paragraph -""", -"""\ -<document source="test data"> - <paragraph> - Test transition markers. - <transition> - <paragraph> - Paragraph -"""], -["""\ -Section 1 -========= -First text division of section 1. - --------- - -Second text division of section 1. - -Section 2 ---------- -Paragraph 2 in section 2. -""", -"""\ -<document source="test data"> - <section id="section-1" name="section 1"> - <title> - Section 1 - <paragraph> - First text division of section 1. - <transition> - <paragraph> - Second text division of section 1. - <section id="section-2" name="section 2"> - <title> - Section 2 - <paragraph> - Paragraph 2 in section 2. -"""], -["""\ --------- - -A section or document may not begin with a transition. - -The DTD specifies that two transitions may not -be adjacent: - --------- - --------- - --------- - -The DTD also specifies that a section or document -may not end with a transition. - --------- -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Document or section may not begin with a transition. - <transition> - <paragraph> - A section or document may not begin with a transition. - <paragraph> - The DTD specifies that two transitions may not - be adjacent: - <transition> - <system_message level="3" line="10" source="test data" type="ERROR"> - <paragraph> - At least one body element must separate transitions; adjacent transitions not allowed. - <transition> - <system_message level="3" line="12" source="test data" type="ERROR"> - <paragraph> - At least one body element must separate transitions; adjacent transitions not allowed. - <transition> - <paragraph> - The DTD also specifies that a section or document - may not end with a transition. - <transition> - <system_message level="3" line="17" source="test data" type="ERROR"> - <paragraph> - Document or section may not end with a transition. -"""], -["""\ -Test unexpected transition markers. - - Block quote. - - -------- - - Paragraph. -""", -"""\ -<document source="test data"> - <paragraph> - Test unexpected transition markers. - <block_quote> - <paragraph> - Block quote. - <system_message level="4" line="5" source="test data" type="SEVERE"> - <paragraph> - Unexpected section title or transition. - <literal_block xml:space="preserve"> - -------- - <paragraph> - Paragraph. -"""], -["""\ -Short transition marker. - ---- - -Paragraph -""", -"""\ -<document source="test data"> - <paragraph> - Short transition marker. - <paragraph> - --- - <paragraph> - Paragraph -"""], -["""\ -Sections with transitions at beginning and end. - -Section 1 -========= - ----------- - -Illegal transitions. - ----------- - -Section 2 -========= - ----------- -""", -"""\ -<document source="test data"> - <paragraph> - Sections with transitions at beginning and end. - <section id="section-1" name="section 1"> - <title> - Section 1 - <system_message level="3" line="6" source="test data" type="ERROR"> - <paragraph> - Section may not begin with a transition. - <transition> - <paragraph> - Illegal transitions. - <transition> - <system_message level="3" line="10" source="test data" type="ERROR"> - <paragraph> - Section may not end with a transition. - <section id="section-2" name="section 2"> - <title> - Section 2 - <system_message level="3" line="15" source="test data" type="ERROR"> - <paragraph> - Section may not begin with a transition. - <transition> - <system_message level="3" line="15" source="test data" type="ERROR"> - <paragraph> - Document or section may not end with a transition. -"""], -["""\ ----------- - -Document beginning with a transition. -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Document or section may not begin with a transition. - <transition> - <paragraph> - Document beginning with a transition. -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_readers/__init__.py b/docutils/test/test_readers/__init__.py deleted file mode 100644 index 2fe79c55c..000000000 --- a/docutils/test/test_readers/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -import os -import os.path -import sys - -sys.path.insert(0, os.path.abspath(os.curdir)) -prev = '' -while sys.path[0] != prev: - try: - import DocutilsTestSupport - break - except ImportError: - prev = sys.path[0] - sys.path[0] = os.path.dirname(prev) -sys.path.pop(0) diff --git a/docutils/test/test_readers/test_pep/__init__.py b/docutils/test/test_readers/test_pep/__init__.py deleted file mode 100644 index 2fe79c55c..000000000 --- a/docutils/test/test_readers/test_pep/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -import os -import os.path -import sys - -sys.path.insert(0, os.path.abspath(os.curdir)) -prev = '' -while sys.path[0] != prev: - try: - import DocutilsTestSupport - break - except ImportError: - prev = sys.path[0] - sys.path[0] = os.path.dirname(prev) -sys.path.pop(0) diff --git a/docutils/test/test_readers/test_pep/test_inline_markup.py b/docutils/test/test_readers/test_pep/test_inline_markup.py deleted file mode 100644 index 7ae69e8ec..000000000 --- a/docutils/test/test_readers/test_pep/test_inline_markup.py +++ /dev/null @@ -1,140 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for inline markup in PEPs (readers/pep.py). -""" - -from __init__ import DocutilsTestSupport - - -def suite(): - s = DocutilsTestSupport.PEPParserTestSuite() - s.generateTests(totest) - return s - - -totest = {} - -totest['standalone_references'] = [ -["""\ -See PEP 287 (pep-0287.txt), -and RFC 2822 (which obsoletes RFC822 and RFC-733). -""", -"""\ -<document source="test data"> - <paragraph> - See \n\ - <reference refuri="pep-0287.html"> - PEP 287 - ( - <reference refuri="pep-0287.html"> - pep-0287.txt - ), - and \n\ - <reference refuri="http://www.faqs.org/rfcs/rfc2822.html"> - RFC 2822 - (which obsoletes \n\ - <reference refuri="http://www.faqs.org/rfcs/rfc822.html"> - RFC822 - and \n\ - <reference refuri="http://www.faqs.org/rfcs/rfc733.html"> - RFC-733 - ). -"""], -["""\ -References split across lines: - -PEP -287 - -RFC -2822 -""", -"""\ -<document source="test data"> - <paragraph> - References split across lines: - <paragraph> - <reference refuri="pep-0287.html"> - PEP - 287 - <paragraph> - <reference refuri="http://www.faqs.org/rfcs/rfc2822.html"> - RFC - 2822 -"""], -["""\ -Test PEP-specific implicit references before a URL: - -PEP 287 (http://www.python.org/peps/pep-0287.html), RFC 2822. -""", -"""\ -<document source="test data"> - <paragraph> - Test PEP-specific implicit references before a URL: - <paragraph> - <reference refuri="pep-0287.html"> - PEP 287 - ( - <reference refuri="http://www.python.org/peps/pep-0287.html"> - http://www.python.org/peps/pep-0287.html - ), \n\ - <reference refuri="http://www.faqs.org/rfcs/rfc2822.html"> - RFC 2822 - . -"""], -] - -totest['miscellaneous'] = [ -["""\ -For *completeness*, _`let's` ``test`` **other** forms_ -|of| `inline markup` [*]_. - -.. [*] See http://docutils.sf.net/spec/rst/reStructuredText.html. -""", -"""\ -<document source="test data"> - <paragraph> - For \n\ - <emphasis> - completeness - , \n\ - <target id="let-s" name="let's"> - let's - \n\ - <literal> - test - \n\ - <strong> - other - \n\ - <reference refname="forms"> - forms - \n\ - <substitution_reference refname="of"> - of - \n\ - <title_reference> - inline markup - \n\ - <footnote_reference auto="*" id="id1"> - . - <footnote auto="*" id="id2"> - <paragraph> - See \n\ - <reference refuri="http://docutils.sf.net/spec/rst/reStructuredText.html"> - http://docutils.sf.net/spec/rst/reStructuredText.html - . -"""], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_readers/test_pep/test_rfc2822.py b/docutils/test/test_readers/test_pep/test_rfc2822.py deleted file mode 100644 index f13de16d2..000000000 --- a/docutils/test/test_readers/test_pep/test_rfc2822.py +++ /dev/null @@ -1,291 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for RFC-2822 headers in PEPs (readers/pep.py). -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.PEPParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['rfc2822'] = [ -["""\ -Author: Me -Version: 1 -Date: 2002-04-23 -""", -"""\ -<document source="test data"> - <field_list class="rfc2822"> - <field> - <field_name> - Author - <field_body> - <paragraph> - Me - <field> - <field_name> - Version - <field_body> - <paragraph> - 1 - <field> - <field_name> - Date - <field_body> - <paragraph> - 2002-04-23 -"""], -["""\ - - -Author: Me -Version: 1 -Date: 2002-04-23 - -.. Leading blank lines don't affect RFC-2822 header parsing. -""", -"""\ -<document source="test data"> - <field_list class="rfc2822"> - <field> - <field_name> - Author - <field_body> - <paragraph> - Me - <field> - <field_name> - Version - <field_body> - <paragraph> - 1 - <field> - <field_name> - Date - <field_body> - <paragraph> - 2002-04-23 - <comment xml:space="preserve"> - Leading blank lines don't affect RFC-2822 header parsing. -"""], -["""\ -.. A comment should prevent RFC-2822 header parsing. - -Author: Me -Version: 1 -Date: 2002-04-23 -""", -"""\ -<document source="test data"> - <comment xml:space="preserve"> - A comment should prevent RFC-2822 header parsing. - <paragraph> - Author: Me - Version: 1 - Date: 2002-04-23 -"""], -["""\ -Author: Me - -Version: 1 -Date: 2002-04-23 -""", -"""\ -<document source="test data"> - <field_list class="rfc2822"> - <field> - <field_name> - Author - <field_body> - <paragraph> - Me - <paragraph> - Version: 1 - Date: 2002-04-23 -"""], -["""\ -field: -empty item above, no blank line -""", -"""\ -<document source="test data"> - <field_list class="rfc2822"> - <field> - <field_name> - field - <field_body> - <system_message level="2" line="2" source="test data" type="WARNING"> - <paragraph> - RFC2822-style field list ends without a blank line; unexpected unindent. - <paragraph> - empty item above, no blank line -"""], -["""\ -Author: - Me -Version: - 1 -Date: - 2002-04-23 -""", -"""\ -<document source="test data"> - <field_list class="rfc2822"> - <field> - <field_name> - Author - <field_body> - <paragraph> - Me - <field> - <field_name> - Version - <field_body> - <paragraph> - 1 - <field> - <field_name> - Date - <field_body> - <paragraph> - 2002-04-23 -"""], -["""\ -Authors: Me, - Myself, - and I -Version: 1 - or so -Date: 2002-04-23 - (Tuesday) -""", -"""\ -<document source="test data"> - <field_list class="rfc2822"> - <field> - <field_name> - Authors - <field_body> - <paragraph> - Me, - Myself, - and I - <field> - <field_name> - Version - <field_body> - <paragraph> - 1 - or so - <field> - <field_name> - Date - <field_body> - <paragraph> - 2002-04-23 - (Tuesday) -"""], -["""\ -Authors: Me, - Myself, - and I -Version: 1 - or so -Date: 2002-04-23 - (Tuesday) -""", -"""\ -<document source="test data"> - <field_list class="rfc2822"> - <field> - <field_name> - Authors - <field_body> - <paragraph> - Me, - Myself, - and I - <field> - <field_name> - Version - <field_body> - <paragraph> - 1 - or so - <field> - <field_name> - Date - <field_body> - <paragraph> - 2002-04-23 - (Tuesday) -"""], -["""\ -Authors: - Me - - Myself - - I -Version: -""", -"""\ -<document source="test data"> - <field_list class="rfc2822"> - <field> - <field_name> - Authors - <field_body> - <bullet_list bullet="-"> - <list_item> - <paragraph> - Me - <list_item> - <paragraph> - Myself - <list_item> - <paragraph> - I - <field> - <field_name> - Version - <field_body> -"""], -["""\ -Authors: Me - - Myself and I -Version: -""", -"""\ -<document source="test data"> - <field_list class="rfc2822"> - <field> - <field_name> - Authors - <field_body> - <paragraph> - Me - <block_quote> - <paragraph> - Myself and I - <system_message level="2" line="4" source="test data" type="WARNING"> - <paragraph> - Block quote ends without a blank line; unexpected unindent. - <paragraph> - Version: -"""], -] - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_readers/test_python/__init__.py b/docutils/test/test_readers/test_python/__init__.py deleted file mode 100644 index 2fe79c55c..000000000 --- a/docutils/test/test_readers/test_python/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -import os -import os.path -import sys - -sys.path.insert(0, os.path.abspath(os.curdir)) -prev = '' -while sys.path[0] != prev: - try: - import DocutilsTestSupport - break - except ImportError: - prev = sys.path[0] - sys.path[0] = os.path.dirname(prev) -sys.path.pop(0) diff --git a/docutils/test/test_readers/test_python/showast b/docutils/test/test_readers/test_python/showast deleted file mode 100755 index e7d846307..000000000 --- a/docutils/test/test_readers/test_python/showast +++ /dev/null @@ -1,57 +0,0 @@ -#! /usr/bin/env python - -""" -This is a tool for exploring abstract syntax trees generated by -``compiler.parse()`` from test data in -docutils/test/test_readers/test_python/test_parser or stdin. - -Usage:: - - showast <key> <index> - - showast < <module.py> - -Where ``<key>`` is the key to the ``totest`` dictionary, and ``<index>`` is -the index of the list ``totest[key]``. If no arguments are given, stdin is -used for input. -""" - -import sys -import compiler -from compiler.ast import Node -import test_parser - -def pformat(ast, indent=' ', level=0): - assert isinstance(ast, Node), 'ast is not a Node: %r' % (ast,) - atts = {} - for name, value in vars(ast).items(): - if not value or isinstance(value, Node): - continue - if isinstance(value, list): - if isinstance(value[0], Node): - continue - if isinstance(value[0], tuple) and value[0] \ - and isinstance(value[0][0], Node): - continue - atts[name] = str(value).encode('unicode-escape') - attlist = atts.items() - attlist.sort() - parts = [ast.__class__.__name__] - for name, value in attlist: - parts.append('%s="%s"' % (name, value)) - result = ['%s<%s>\n' % (indent * level, ' '.join(parts))] - for node in ast.getChildNodes(): - result.extend(pformat(node, level=level+1)) - return result - -if len(sys.argv) > 1: - key, caseno = sys.argv[1:] - print 'totest["%s"][%s][0]:\n' % (key, caseno) - input_text = test_parser.totest[key][int(caseno)][0] -else: - input_text = sys.stdin.read() -print input_text -module = compiler.parse(input_text) -print module -print -print ''.join(pformat(module)), diff --git a/docutils/test/test_readers/test_python/showdoc b/docutils/test/test_readers/test_python/showdoc deleted file mode 100755 index 6461960f8..000000000 --- a/docutils/test/test_readers/test_python/showdoc +++ /dev/null @@ -1,33 +0,0 @@ -#! /usr/bin/env python - -""" -This is a tool for exploring module documentation trees generated by -``docutils.readers.python.moduleparser.parse_module()`` from test data in -docutils/test/test_readers/test_python/test_parser or stdin. - -Usage:: - - showdoc <key> <index> - - showdoc < <module.py> - -Where ``<key>`` is the key to the ``totest`` dictionary, and ``<index>`` is -the index of the list ``totest[key]``. If no arguments are given, stdin is -used for input. -""" - -import sys -from docutils.readers.python.moduleparser import parse_module -import test_parser - -if len(sys.argv) > 1: - key, caseno = sys.argv[1:] - print 'totest["%s"][%s][0]:\n' % (key, caseno) - input_text = test_parser.totest[key][int(caseno)][0] - input_source = "test_parser.totest['%s'][%s][0]" % (key, caseno) -else: - input_text = sys.stdin.read() - input_source = '<stdin>' -print input_text -module = parse_module(input_text, input_source) -print module, diff --git a/docutils/test/test_readers/test_python/showparse b/docutils/test/test_readers/test_python/showparse deleted file mode 100755 index 8144256d6..000000000 --- a/docutils/test/test_readers/test_python/showparse +++ /dev/null @@ -1,48 +0,0 @@ -#! /usr/bin/env python - -""" -This is a tool for exploring abstract syntax trees generated by -``parser.suite()`` from test data in -docutils/test/test_readers/test_python/test_parser or stdin. - -Usage:: - - showparse <key> <index> - - showparse < <module.py> - -Where ``<key>`` is the key to the ``totest`` dictionary, and ``<index>`` is -the index of the list ``totest[key]``. If no arguments are given, stdin is -used for input. -""" - -import sys -import types -import parser -import token -import symbol -import pprint -import test_parser - -names = token.tok_name.copy() -names.update(symbol.sym_name) - -def name_elements(ast): - if ast: - name = names[ast[0]] - ast[0] = '%s (%s)' % (name, ast[0]) - for node in ast[1:]: - if type(node) == types.ListType: - name_elements(node) - -if len(sys.argv) > 1: - key, caseno = sys.argv[1:] - print 'totest["%s"][%s][0]:\n' % (key, caseno) - input_text = test_parser.totest[key][int(caseno)][0] -else: - input_text = sys.stdin.read() -print input_text -module = parser.suite(input_text) -ast = parser.ast2list(module, line_info=1) -name_elements(ast) -pprint.pprint(ast) diff --git a/docutils/test/test_readers/test_python/showtok b/docutils/test/test_readers/test_python/showtok deleted file mode 100755 index efd250ce1..000000000 --- a/docutils/test/test_readers/test_python/showtok +++ /dev/null @@ -1,40 +0,0 @@ -#! /usr/bin/env python - - -""" -This is a tool for exploring token lists generated by -``tokenize.generate_tokens()`` from test data in -docutils/test/test_readers/test_python/test_parser or stdin. - -Usage:: - - showtok <key> <index> - - showtok < <module.py> - -Where ``<key>`` is the key to the ``totest`` dictionary, and ``<index>`` is -the index of the list ``totest[key]``. If no arguments are given, stdin is -used for input. -""" - -import sys -import tokenize -import pprint -from token import tok_name -import test_parser - -def name_tokens(tokens): - for i in range(len(tokens)): - tup = tokens[i] - tokens[i] = (tok_name[tup[0]], tup) - -if len(sys.argv) > 1: - key, caseno = sys.argv[1:] - print 'totest["%s"][%s][0]:\n' % (key, caseno) - input_text = test_parser.totest[key][int(caseno)][0] -else: - input_text = sys.stdin.read() -print input_text -tokens = list(tokenize.generate_tokens(iter(input_text.splitlines(1)).next)) -name_tokens(tokens) -pprint.pprint(tokens) diff --git a/docutils/test/test_readers/test_python/test_functions.py b/docutils/test/test_readers/test_python/test_functions.py deleted file mode 100644 index d521b2203..000000000 --- a/docutils/test/test_readers/test_python/test_functions.py +++ /dev/null @@ -1,56 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for PySource Reader functions. -""" - -import unittest -from __init__ import DocutilsTestSupport -from docutils.readers.python.moduleparser import trim_docstring - - -class MiscTests(unittest.TestCase): - - docstrings = ( - ("""""", """"""), # empty - ("""Begins on the first line. - - Middle line indented. - - Last line unindented. - """, - """\ -Begins on the first line. - - Middle line indented. - -Last line unindented."""), - (""" - Begins on the second line. - - Middle line indented. - - Last line unindented.""", - """\ -Begins on the second line. - - Middle line indented. - -Last line unindented."""), - ("""All on one line.""", """All on one line.""")) - - def test_trim_docstring(self): - for docstring, expected in self.docstrings: - self.assertEquals(trim_docstring(docstring), expected) - self.assertEquals(trim_docstring('\n ' + docstring), - expected) - - -if __name__ == '__main__': - unittest.main() diff --git a/docutils/test/test_readers/test_python/test_parser.py b/docutils/test/test_readers/test_python/test_parser.py deleted file mode 100644 index ce70cc27c..000000000 --- a/docutils/test/test_readers/test_python/test_parser.py +++ /dev/null @@ -1,745 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for docutils/readers/python/moduleparser.py. -""" - -from __init__ import DocutilsTestSupport - - -def suite(): - s = DocutilsTestSupport.PythonModuleParserTestSuite() - s.generateTests(totest) - return s - -totest = {} - -totest['module'] = [ -['''\ -''', -'''\ -<Module filename="test data"> -'''], -['''\ -"""docstring""" -''', -'''\ -<Module filename="test data"> - <Docstring> - docstring -'''], -['''\ -u"""Unicode docstring""" -''', -'''\ -<Module filename="test data"> - <Docstring> - Unicode docstring -'''], -['''\ -"""docstring""" -"""additional docstring""" -''', -'''\ -<Module filename="test data"> - <Docstring> - docstring - <Docstring lineno="2"> - additional docstring -'''], -['''\ -"""docstring""" -# comment -"""additional docstring""" -''', -'''\ -<Module filename="test data"> - <Docstring> - docstring - <Docstring lineno="3"> - additional docstring -'''], -['''\ -"""docstring""" -1 -"""not an additional docstring""" -''', -'''\ -<Module filename="test data"> - <Docstring> - docstring -'''], -] - -totest['import'] = [ -['''\ -import module -''', -'''\ -<Module filename="test data"> - <Import lineno="1"> - module -'''], -['''\ -import module as local -''', -'''\ -<Module filename="test data"> - <Import lineno="1"> - module as local -'''], -['''\ -import module.name -''', -'''\ -<Module filename="test data"> - <Import lineno="1"> - module.name -'''], -['''\ -import module.name as local -''', -'''\ -<Module filename="test data"> - <Import lineno="1"> - module.name as local -'''], -['''\ -import module -"""not documentable""" -''', -'''\ -<Module filename="test data"> - <Import lineno="1"> - module -'''], -] - -totest['from'] = [ -['''\ -from module import name -''', -'''\ -<Module filename="test data"> - <Import from="module" lineno="1"> - name -'''], -['''\ -from module import name as local -''', -'''\ -<Module filename="test data"> - <Import from="module" lineno="1"> - name as local -'''], -['''\ -from module import name1, name2 as local2 -''', -'''\ -<Module filename="test data"> - <Import from="module" lineno="1"> - name1 - name2 as local2 -'''], -['''\ -from module.sub import name -''', -'''\ -<Module filename="test data"> - <Import from="module.sub" lineno="1"> - name -'''], -['''\ -from module.sub import name as local -''', -'''\ -<Module filename="test data"> - <Import from="module.sub" lineno="1"> - name as local -'''], -['''\ -from module import * -''', -'''\ -<Module filename="test data"> - <Import from="module" lineno="1"> - * -'''], -['''\ -from __future__ import division -''', -'''\ -<Module filename="test data"> - <Import from="__future__" lineno="1"> - division -'''], -] - -totest['assign'] = [ -['''\ -a = 1 -''', -'''\ -<Module filename="test data"> - <Attribute lineno="1" name="a"> - <Expression lineno="1"> - 1 -'''], -['''a = 1''', -'''\ -<Module filename="test data"> - <Attribute lineno="1" name="a"> - <Expression lineno="1"> - 1 -'''], -['''\ -a = 1 -"""a's docstring""" -''', #" -'''\ -<Module filename="test data"> - <Attribute lineno="1" name="a"> - <Expression lineno="1"> - 1 - <Docstring lineno="2"> - a's docstring -'''], #' -['''\ -a = 1 -"""a's docstring""" -"""additional docstring""" -''', #" -'''\ -<Module filename="test data"> - <Attribute lineno="1" name="a"> - <Expression lineno="1"> - 1 - <Docstring lineno="2"> - a's docstring - <Docstring lineno="3"> - additional docstring -'''], #' -['''\ -a = 1 + 2 * 3 / 4 ** 5 -''', -'''\ -<Module filename="test data"> - <Attribute lineno="1" name="a"> - <Expression lineno="1"> - 1 + 2 * 3 / 4 ** 5 -'''], -['''\ -a = 1 \\ - + 2 -''', -'''\ -<Module filename="test data"> - <Attribute lineno="1" name="a"> - <Expression lineno="1"> - 1 + 2 -'''], -['''\ -a = not 1 and 2 or 3 -''', -'''\ -<Module filename="test data"> - <Attribute lineno="1" name="a"> - <Expression lineno="1"> - not 1 and 2 or 3 -'''], -['''\ -a = ~ 1 & 2 | 3 ^ 4 -''', -'''\ -<Module filename="test data"> - <Attribute lineno="1" name="a"> - <Expression lineno="1"> - ~ 1 & 2 | 3 ^ 4 -'''], -['''\ -a = `1 & 2` -''', -'''\ -<Module filename="test data"> - <Attribute lineno="1" name="a"> - <Expression lineno="1"> - `1 & 2` -'''], -['''\ -very_long_name = \\ - x -''', -'''\ -<Module filename="test data"> - <Attribute lineno="1" name="very_long_name"> - <Expression lineno="1"> - x -'''], -['''\ -very_long_name \\ - = x -''', -'''\ -<Module filename="test data"> - <Attribute lineno="1" name="very_long_name"> - <Expression lineno="2"> - x -'''], -['''\ -very_long_name = \\ - another_long_name = \\ - x -''', -'''\ -<Module filename="test data"> - <Attribute lineno="1" name="very_long_name"> - <Expression lineno="1"> - x - <Attribute lineno="2" name="another_long_name"> - <Expression lineno="1"> - x -'''], -['''\ -a = (1 - + 2) -b = a.b[1 + - fn(x, y, - z, {'key': (1 + 2 - + 3)})][4] -c = """first line -second line - third""" -''', -'''\ -<Module filename="test data"> - <Attribute lineno="1" name="a"> - <Expression lineno="1"> - (1 + 2) - <Attribute lineno="3" name="b"> - <Expression lineno="3"> - a.b[1 + fn(x, y, z, {'key': (1 + 2 + 3)})][4] - <Attribute lineno="7" name="c"> - <Expression lineno="7"> - """first line\\nsecond line\\n third""" -'''], -['''\ -a, b, c = range(3) -(d, e, - f) = a, b, c -g, h, i = j = a, b, c -k.a, k.b.c, k.d.e.f = a, b, c -''', -'''\ -<Module filename="test data"> - <AttributeTuple lineno="1" names="a b c"> - <Expression lineno="1"> - range(3) - <AttributeTuple lineno="2" names="d e f"> - <Expression lineno="3"> - a, b, c - <AttributeTuple lineno="4" names="g h i"> - <Expression lineno="4"> - a, b, c - <Attribute lineno="4" name="j"> - <Expression lineno="4"> - a, b, c - <AttributeTuple lineno="5" names="k.a k.b.c k.d.e.f"> - <Expression lineno="5"> - a, b, c -'''], -['''\ -a = 1 ; b = 2 -print ; c = 3 -''', -'''\ -<Module filename="test data"> - <Attribute lineno="1" name="a"> - <Expression lineno="1"> - 1 - <Attribute lineno="1" name="b"> - <Expression lineno="1"> - 2 - <Attribute lineno="2" name="c"> - <Expression lineno="2"> - 3 -'''], -['''\ -a.b = 1 -"""This assignment is noted but ignored unless ``a`` is a function.""" -''', -'''\ -<Module filename="test data"> - <Attribute lineno="1" name="a.b"> - <Expression lineno="1"> - 1 - <Docstring lineno="2"> - This assignment is noted but ignored unless ``a`` is a function. -'''], -['''\ -a[b] = 1 -"""Subscript assignments are ignored.""" -''', -'''\ -<Module filename="test data"> -'''], -['''\ -a = foo(b=1) -''', -'''\ -<Module filename="test data"> - <Attribute lineno="1" name="a"> - <Expression lineno="1"> - foo(b=1) -'''], -# ['''\ -# a = 1 -# -# """Because of the blank above, this is a module docstring.""" -# ''', -# '''\ -# <Module filename="test data"> -# <Attribute lineno="1" name="a"> -# <Expression lineno="1"> -# 1 -# <Docstring lineno="3"> -# Because of the blank above, this is a module docstring. -# '''], -] - -totest['def'] = [ -['''\ -def f(): - """Function f's docstring""" - """Additional docstring""" - local = 1 - """Not a docstring, since ``local`` is local.""" -''', # " -'''\ -<Module filename="test data"> - <Function lineno="1" name="f"> - <Docstring lineno="1"> - Function f's docstring - <Docstring lineno="3"> - Additional docstring -'''], # ' -['''\ -def f(a, b): - local = 1 -''', -'''\ -<Module filename="test data"> - <Function lineno="1" name="f"> - <ParameterList lineno="1"> - <Parameter lineno="1" name="a"> - <Parameter lineno="1" name="b"> -'''], -['''\ -def f(a=None, b=1): - local = 1 -''', -'''\ -<Module filename="test data"> - <Function lineno="1" name="f"> - <ParameterList lineno="1"> - <Parameter lineno="1" name="a"> - <Default lineno="1"> - None - <Parameter lineno="1" name="b"> - <Default lineno="1"> - 1 -'''], -['''\ -def f(a, (b, c, d)=range(3), - e=None): - local = 1 -''', -'''\ -<Module filename="test data"> - <Function lineno="1" name="f"> - <ParameterList lineno="1"> - <Parameter lineno="1" name="a"> - <ParameterTuple lineno="1" names="(b, c, d)"> - <Default lineno="1"> - range(3) - <Parameter lineno="1" name="e"> - <Default lineno="1"> - None -'''], -['''\ -def f(*args): - local = 1 -''', -'''\ -<Module filename="test data"> - <Function lineno="1" name="f"> - <ParameterList lineno="1"> - <ExcessPositionalArguments lineno="1" name="args"> -'''], -['''\ -def f(**kwargs): - local = 1 -''', -'''\ -<Module filename="test data"> - <Function lineno="1" name="f"> - <ParameterList lineno="1"> - <ExcessKeywordArguments lineno="1" name="kwargs"> -'''], -['''\ -def f(a, b=None, *args, **kwargs): - local = 1 -''', -'''\ -<Module filename="test data"> - <Function lineno="1" name="f"> - <ParameterList lineno="1"> - <Parameter lineno="1" name="a"> - <Parameter lineno="1" name="b"> - <Default lineno="1"> - None - <ExcessPositionalArguments lineno="1" name="args"> - <ExcessKeywordArguments lineno="1" name="kwargs"> -'''], -['''\ -def f(): - pass -f.attrib = 1 -"""f.attrib's docstring""" -''', # " -# @@@ When should the Attribute move inside the Function? -'''\ -<Module filename="test data"> - <Function lineno="1" name="f"> - <Attribute lineno="3" name="f.attrib"> - <Expression lineno="3"> - 1 - <Docstring lineno="4"> - f.attrib's docstring -'''], # ' -['''\ -def f(): - def g(): - pass - """Not a docstring""" - local = 1 -''', -'''\ -<Module filename="test data"> - <Function lineno="1" name="f"> -'''], -] - -totest['class'] = [ -['''\ -class C: - """class C's docstring""" -''', -'''\ -<Module filename="test data"> - <Class lineno="1" name="C"> - <Docstring lineno="1"> - class C's docstring -'''], -['''\ -class C(Super): - pass - -class D(SuperD, package.module.SuperD): - pass -''', -'''\ -<Module filename="test data"> - <Class bases="Super" lineno="1" name="C"> - <Class bases="SuperD package.module.SuperD" lineno="4" name="D"> -'''], -['''\ -class C: - class D: - pass - """Not a docstring""" -''', -'''\ -<Module filename="test data"> - <Class lineno="1" name="C"> -'''], -['''\ -class C: - def f(self): - self.local = 1 - local = 1 -''', -'''\ -<Module filename="test data"> - <Class lineno="1" name="C"> - <Method lineno="2" name="f"> - <ParameterList lineno="2"> - <Parameter lineno="2" name="self"> -'''], -['''\ -class C: - def __init__(self): - self.local = 1 - local = 1 -''', -'''\ -<Module filename="test data"> - <Class lineno="1" name="C"> - <Method lineno="2" name="__init__"> - <ParameterList lineno="2"> - <Parameter lineno="2" name="self"> - <Attribute lineno="3" name="self.local"> - <Expression lineno="3"> - 1 - <Attribute lineno="4" name="local"> - <Expression lineno="4"> - 1 -'''], -['''\ -class C: - def __init__(self): - local = foo(a=1) -''', -'''\ -<Module filename="test data"> - <Class lineno="1" name="C"> - <Method lineno="2" name="__init__"> - <ParameterList lineno="2"> - <Parameter lineno="2" name="self"> - <Attribute lineno="3" name="local"> - <Expression lineno="3"> - foo(a=1) -'''], -] - -totest['ignore'] = [ -['''\ -1 + 2 -''', -'''\ -<Module filename="test data"> -'''], -['''\ -del a -''', -'''\ -<Module filename="test data"> -'''], -] - -totest['comments'] = [ -# ['''\ -# # Comment -# ''', -# '''\ -# <Module filename="test data"> -# <Comment lineno="1"> -# # Comment -# '''], -] - -# @@@ no comments yet -totest['everything'] = [ -['''\ -# comment - -"""Docstring""" - -"""Additional docstring""" - -__docformat__ = 'reStructuredText' - -a = 1 -"""Attribute docstring""" - -class C(Super): - - """C's docstring""" - - class_attribute = 1 - """class_attribute's docstring""" - - def __init__(self, text=None): - """__init__'s docstring""" - - self.instance_attribute = (text * 7 - + ' whaddyaknow') - """instance_attribute's docstring""" - - -def f(x, # parameter x - y=a*5, # parameter y - *args): # parameter args - """f's docstring""" - return [x + item for item in args] - -f.function_attribute = 1 -"""f.function_attribute's docstring""" -''', -'''\ -<Module filename="test data"> - <Docstring> - Docstring - <Docstring lineno="5"> - Additional docstring - <Attribute lineno="7" name="__docformat__"> - <Expression lineno="7"> - 'reStructuredText' - <Attribute lineno="9" name="a"> - <Expression lineno="9"> - 1 - <Docstring lineno="10"> - Attribute docstring - <Class bases="Super" lineno="12" name="C"> - <Docstring lineno="12"> - C's docstring - <Attribute lineno="16" name="class_attribute"> - <Expression lineno="16"> - 1 - <Docstring lineno="17"> - class_attribute's docstring - <Method lineno="19" name="__init__"> - <Docstring lineno="19"> - __init__'s docstring - <ParameterList lineno="19"> - <Parameter lineno="19" name="self"> - <Parameter lineno="19" name="text"> - <Default lineno="19"> - None - <Attribute lineno="22" name="self.instance_attribute"> - <Expression lineno="22"> - (text * 7 + ' whaddyaknow') - <Docstring lineno="24"> - instance_attribute's docstring - <Function lineno="27" name="f"> - <Docstring lineno="27"> - f's docstring - <ParameterList lineno="27"> - <Parameter lineno="27" name="x"> - <Parameter lineno="27" name="y"> - <Default lineno="27"> - a * 5 - <ExcessPositionalArguments lineno="27" name="args"> - <Attribute lineno="33" name="f.function_attribute"> - <Expression lineno="33"> - 1 - <Docstring lineno="34"> - f.function_attribute's docstring -'''], -] - -""" -['''\ -''', -'''\ -'''], -""" - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_readers/test_python/test_token_parser.py b/docutils/test/test_readers/test_python/test_token_parser.py deleted file mode 100644 index 23015a7dc..000000000 --- a/docutils/test/test_readers/test_python/test_token_parser.py +++ /dev/null @@ -1,46 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for docutils/readers/python/moduleparser.py. -""" - -from __init__ import DocutilsTestSupport - - -def suite(): - s = DocutilsTestSupport.PythonModuleParserTestSuite() - s.generateTests(totest, testmethod='test_token_parser_rhs') - return s - -totest = {} - -totest['expressions'] = [ -['''a = 1''', '''1'''], -['''a = b = 1''', '''1'''], -['''\ -a = ( - 1 + 2 - + 3 - ) -''', -'''(1 + 2 + 3)'''], -['''\ -a = """\\ -line one -line two""" -''', -'''"""\\\nline one\nline two"""'''], -['''a = `1`''', '''`1`'''], -['''a = `1`+`2`''', '''`1` + `2`'''], -] - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_statemachine.py b/docutils/test/test_statemachine.py deleted file mode 100755 index 4ca2a0144..000000000 --- a/docutils/test/test_statemachine.py +++ /dev/null @@ -1,283 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Test module for statemachine.py. -""" - -import unittest -import sys -import re -from DocutilsTestSupport import statemachine - - -debug = 0 -testtext = statemachine.string2lines("""\ -First paragraph. - -- This is a bullet list. First list item. - Second line of first para. - - Second para. - - block quote - -- Second list item. Example:: - - a - literal - block - -Last paragraph.""") -expected = ('StateMachine1 text1 blank1 bullet1 known_indent1 ' - 'StateMachine2 text2 text2 blank2 text2 blank2 indent2 ' - 'StateMachine3 text3 blank3 finished3 finished2 ' - 'bullet1 known_indent1 ' - 'StateMachine2 text2 blank2 literalblock2(4) finished2 ' - 'text1 finished1').split() -para1 = testtext[:2] -item1 = [line[2:] for line in testtext[2:9]] -item2 = [line[2:] for line in testtext[9:-1]] -lbindent = 6 -literalblock = [line[lbindent:] for line in testtext[11:-1]] -para2 = testtext[-1] - - -class MockState(statemachine.StateWS): - - patterns = {'bullet': re.compile(r'- '), - 'text': ''} - initial_transitions = ['bullet', ['text']] - levelholder = [0] - - def bof(self, context): - self.levelholder[0] += 1 - self.level = self.levelholder[0] - if self.debug: print >>sys.stderr, 'StateMachine%s' % self.level - return [], ['StateMachine%s' % self.level] - - def blank(self, match, context, next_state): - result = ['blank%s' % self.level] - if self.debug: print >>sys.stderr, 'blank%s' % self.level - if context and context[-1] and context[-1][-2:] == '::': - result.extend(self.literalblock()) - return [], None, result - - def indent(self, match, context, next_state): - if self.debug: print >>sys.stderr, 'indent%s' % self.level - context, next_state, result = statemachine.StateWS.indent( - self, match, context, next_state) - return context, next_state, ['indent%s' % self.level] + result - - def known_indent(self, match, context, next_state): - if self.debug: print >>sys.stderr, 'known_indent%s' % self.level - context, next_state, result = statemachine.StateWS.known_indent( - self, match, context, next_state) - return context, next_state, ['known_indent%s' % self.level] + result - - def bullet(self, match, context, next_state): - if self.debug: print >>sys.stderr, 'bullet%s' % self.level - context, next_state, result \ - = self.known_indent(match, context, next_state) - return [], next_state, ['bullet%s' % self.level] + result - - def text(self, match, context, next_state): - if self.debug: print >>sys.stderr, 'text%s' % self.level - return [match.string], next_state, ['text%s' % self.level] - - def literalblock(self): - indented, indent, offset, good = self.state_machine.get_indented() - if self.debug: print >>sys.stderr, 'literalblock%s(%s)' % (self.level, - indent) - return ['literalblock%s(%s)' % (self.level, indent)] - - def eof(self, context): - self.levelholder[0] -= 1 - if self.debug: print >>sys.stderr, 'finished%s' % self.level - return ['finished%s' % self.level] - - -class EmptySMTests(unittest.TestCase): - - def setUp(self): - self.sm = statemachine.StateMachine( - state_classes=[], initial_state='State') - self.sm.debug = debug - - def test_add_state(self): - self.sm.add_state(statemachine.State) - self.assert_(len(self.sm.states) == 1) - self.assertRaises(statemachine.DuplicateStateError, self.sm.add_state, - statemachine.State) - self.sm.add_state(statemachine.StateWS) - self.assert_(len(self.sm.states) == 2) - - def test_add_states(self): - self.sm.add_states((statemachine.State, statemachine.StateWS)) - self.assertEqual(len(self.sm.states), 2) - - def test_get_state(self): - self.assertRaises(statemachine.UnknownStateError, self.sm.get_state) - self.sm.add_states((statemachine.State, statemachine.StateWS)) - self.assertRaises(statemachine.UnknownStateError, self.sm.get_state, - 'unknownState') - self.assert_(isinstance(self.sm.get_state('State'), - statemachine.State)) - self.assert_(isinstance(self.sm.get_state('StateWS'), - statemachine.State)) - self.assertEqual(self.sm.current_state, 'StateWS') - - -class EmptySMWSTests(EmptySMTests): - - def setUp(self): - self.sm = statemachine.StateMachineWS( - state_classes=[], initial_state='State') - self.sm.debug = debug - - -class SMWSTests(unittest.TestCase): - - def setUp(self): - self.sm = statemachine.StateMachineWS([MockState], 'MockState', - debug=debug) - self.sm.debug = debug - self.sm.states['MockState'].levelholder[0] = 0 - - def tearDown(self): - self.sm.unlink() - - def test___init__(self): - self.assertEquals(self.sm.states.keys(), ['MockState']) - self.assertEquals(len(self.sm.states['MockState'].transitions), 4) - - def test_get_indented(self): - self.sm.input_lines = statemachine.StringList(testtext) - self.sm.line_offset = -1 - self.sm.next_line(3) - indented, offset, good = self.sm.get_known_indented(2) - self.assertEquals(indented, item1) - self.assertEquals(offset, len(para1)) - self.failUnless(good) - self.sm.next_line() - indented, offset, good = self.sm.get_known_indented(2) - self.assertEquals(indented, item2) - self.assertEquals(offset, len(para1) + len(item1)) - self.failUnless(good) - self.sm.previous_line(3) - if self.sm.debug: - print '\ntest_get_indented: self.sm.line:\n', self.sm.line - indented, indent, offset, good = self.sm.get_indented() - if self.sm.debug: - print '\ntest_get_indented: indented:\n', indented - self.assertEquals(indent, lbindent) - self.assertEquals(indented, literalblock) - self.assertEquals(offset, (len(para1) + len(item1) + len(item2) - - len(literalblock))) - self.failUnless(good) - - def test_get_text_block(self): - self.sm.input_lines = statemachine.StringList(testtext) - self.sm.line_offset = -1 - self.sm.next_line() - textblock = self.sm.get_text_block() - self.assertEquals(textblock, testtext[:1]) - self.sm.next_line(2) - textblock = self.sm.get_text_block() - self.assertEquals(textblock, testtext[2:4]) - - def test_get_text_block_flush_left(self): - self.sm.input_lines = statemachine.StringList(testtext) - self.sm.line_offset = -1 - self.sm.next_line() - textblock = self.sm.get_text_block(flush_left=1) - self.assertEquals(textblock, testtext[:1]) - self.sm.next_line(2) - self.assertRaises(statemachine.UnexpectedIndentationError, - self.sm.get_text_block, flush_left=1) - - def test_run(self): - self.assertEquals(self.sm.run(testtext), expected) - - -class EmptyClass: - pass - - -class EmptyStateTests(unittest.TestCase): - - def setUp(self): - self.state = statemachine.State(EmptyClass(), debug=debug) - self.state.patterns = {'nop': 'dummy', - 'nop2': 'dummy', - 'nop3': 'dummy', - 'bogus': 'dummy'} - self.state.nop2 = self.state.nop3 = self.state.nop - - def test_add_transitions(self): - self.assertEquals(len(self.state.transitions), 0) - self.state.add_transitions(['None'], {'None': None}) - self.assertEquals(len(self.state.transitions), 1) - self.assertRaises(statemachine.UnknownTransitionError, - self.state.add_transitions, ['bogus'], {}) - self.assertRaises(statemachine.DuplicateTransitionError, - self.state.add_transitions, ['None'], - {'None': None}) - - def test_add_transition(self): - self.assertEquals(len(self.state.transitions), 0) - self.state.add_transition('None', None) - self.assertEquals(len(self.state.transitions), 1) - self.assertRaises(statemachine.DuplicateTransitionError, - self.state.add_transition, 'None', None) - - def test_remove_transition(self): - self.assertEquals(len(self.state.transitions), 0) - self.state.add_transition('None', None) - self.assertEquals(len(self.state.transitions), 1) - self.state.remove_transition('None') - self.assertEquals(len(self.state.transitions), 0) - self.assertRaises(statemachine.UnknownTransitionError, - self.state.remove_transition, 'None') - - def test_make_transition(self): - dummy = re.compile('dummy') - self.assertEquals(self.state.make_transition('nop', 'bogus'), - (dummy, self.state.nop, 'bogus')) - self.assertEquals(self.state.make_transition('nop'), - (dummy, self.state.nop, - self.state.__class__.__name__)) - self.assertRaises(statemachine.TransitionPatternNotFound, - self.state.make_transition, 'None') - self.assertRaises(statemachine.TransitionMethodNotFound, - self.state.make_transition, 'bogus') - - def test_make_transitions(self): - dummy = re.compile('dummy') - self.assertEquals(self.state.make_transitions(('nop', ['nop2'], - ('nop3', 'bogus'))), - (['nop', 'nop2', 'nop3'], - {'nop': (dummy, self.state.nop, - self.state.__class__.__name__), - 'nop2': (dummy, self.state.nop2, - self.state.__class__.__name__), - 'nop3': (dummy, self.state.nop3, 'bogus')})) - - -class MiscTests(unittest.TestCase): - - s2l_string = "hello\tthere\thow are\tyou?\n\tI'm fine\tthanks.\n" - s2l_expected = ['hello there how are you?', - " I'm fine thanks."] - def test_string2lines(self): - self.assertEquals(statemachine.string2lines(self.s2l_string), - self.s2l_expected) - - -if __name__ == '__main__': - unittest.main() diff --git a/docutils/test/test_transforms/__init__.py b/docutils/test/test_transforms/__init__.py deleted file mode 100644 index 2fe79c55c..000000000 --- a/docutils/test/test_transforms/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -import os -import os.path -import sys - -sys.path.insert(0, os.path.abspath(os.curdir)) -prev = '' -while sys.path[0] != prev: - try: - import DocutilsTestSupport - break - except ImportError: - prev = sys.path[0] - sys.path[0] = os.path.dirname(prev) -sys.path.pop(0) diff --git a/docutils/test/test_transforms/test_class.py b/docutils/test/test_transforms/test_class.py deleted file mode 100755 index db5a1cbdf..000000000 --- a/docutils/test/test_transforms/test_class.py +++ /dev/null @@ -1,104 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for `docutils.transforms.misc.ClassAttribute`. -""" - -from __init__ import DocutilsTestSupport -from docutils.parsers.rst import Parser - - -def suite(): - parser = Parser() - s = DocutilsTestSupport.TransformTestSuite(parser) - s.generateTests(totest) - return s - -totest = {} - -totest['tables_of_contents'] = ((), [ -["""\ -.. class:: one - -paragraph -""", -"""\ -<document source="test data"> - <paragraph class="one"> - paragraph -"""], -["""\ -.. class:: two -.. - - Block quote -""", -"""\ -<document source="test data"> - <comment xml:space="preserve"> - <block_quote class="two"> - <paragraph> - Block quote -"""], -["""\ - Block quote - - .. class:: three - -Paragraph -""", -"""\ -<document source="test data"> - <block_quote> - <paragraph> - Block quote - <paragraph class="three"> - Paragraph -"""], -["""\ -.. class:: four - -Section Title -============= - -Paragraph -""", -"""\ -<document source="test data"> - <section class="four" id="section-title" name="section title"> - <title> - Section Title - <paragraph> - Paragraph -"""], -["""\ -.. class:: - -.. class:: 99 -""", -"""\ -<document source="test data"> - <system_message level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Error in "class" directive: - 1 argument(s) required, 0 supplied. - <literal_block xml:space="preserve"> - .. class:: - <system_message level="3" line="3" source="test data" type="ERROR"> - <paragraph> - Invalid class attribute value for "class" directive: 99 - <literal_block xml:space="preserve"> - .. class:: 99 -"""], -]) - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_transforms/test_contents.py b/docutils/test/test_transforms/test_contents.py deleted file mode 100755 index 5f54e7a74..000000000 --- a/docutils/test/test_transforms/test_contents.py +++ /dev/null @@ -1,377 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for `docutils.transforms.parts.Contents` (via -`docutils.transforms.universal.LastReaderPending`). -""" - -from __init__ import DocutilsTestSupport -from docutils.transforms.references import Substitutions -from docutils.parsers.rst import Parser - - -def suite(): - parser = Parser() - s = DocutilsTestSupport.TransformTestSuite(parser) - s.generateTests(totest) - return s - -totest = {} - -totest['tables_of_contents'] = ((Substitutions,), [ -["""\ -.. contents:: - -Title 1 -======= -Paragraph 1. - -Title 2 -------- -Paragraph 2. - -Title 3 -``````` -Paragraph 3. - -Title 4 -------- -Paragraph 4. -""", -"""\ -<document source="test data"> - <topic class="contents" id="contents" name="contents"> - <title> - Contents - <bullet_list> - <list_item> - <paragraph> - <reference id="id1" refid="title-1"> - Title 1 - <bullet_list> - <list_item> - <paragraph> - <reference id="id2" refid="title-2"> - Title 2 - <bullet_list> - <list_item> - <paragraph> - <reference id="id3" refid="title-3"> - Title 3 - <list_item> - <paragraph> - <reference id="id4" refid="title-4"> - Title 4 - <section id="title-1" name="title 1"> - <title refid="id1"> - Title 1 - <paragraph> - Paragraph 1. - <section id="title-2" name="title 2"> - <title refid="id2"> - Title 2 - <paragraph> - Paragraph 2. - <section id="title-3" name="title 3"> - <title refid="id3"> - Title 3 - <paragraph> - Paragraph 3. - <section id="title-4" name="title 4"> - <title refid="id4"> - Title 4 - <paragraph> - Paragraph 4. -"""], -["""\ -.. contents:: Table of Contents - -Title 1 -======= -Paragraph 1. - -Title 2 -------- -Paragraph 2. -""", -"""\ -<document source="test data"> - <topic class="contents" id="table-of-contents" name="table of contents"> - <title> - Table of Contents - <bullet_list> - <list_item> - <paragraph> - <reference id="id1" refid="title-1"> - Title 1 - <bullet_list> - <list_item> - <paragraph> - <reference id="id2" refid="title-2"> - Title 2 - <section id="title-1" name="title 1"> - <title refid="id1"> - Title 1 - <paragraph> - Paragraph 1. - <section id="title-2" name="title 2"> - <title refid="id2"> - Title 2 - <paragraph> - Paragraph 2. -"""], -["""\ -.. contents:: There's an image in Title 2 - -Title 1 -======= -Paragraph 1. - -|Title 2| -========= -Paragraph 2. - -.. |Title 2| image:: title2.png -""", -"""\ -<document source="test data"> - <topic class="contents" id="there-s-an-image-in-title-2" name="there's an image in title 2"> - <title> - There's an image in Title 2 - <bullet_list> - <list_item> - <paragraph> - <reference id="id1" refid="title-1"> - Title 1 - <list_item> - <paragraph> - <reference id="id2" refid="title-2"> - Title 2 - <section id="title-1" name="title 1"> - <title refid="id1"> - Title 1 - <paragraph> - Paragraph 1. - <section id="title-2" name="title 2"> - <title refid="id2"> - <image alt="Title 2" uri="title2.png"> - <paragraph> - Paragraph 2. - <substitution_definition name="Title 2"> - <image alt="Title 2" uri="title2.png"> -"""], # emacs cruft: " -["""\ -.. contents:: - :depth: 2 - -Title 1 -======= -Paragraph 1. - -Title 2 -------- -Paragraph 2. - -Title 3 -``````` -Paragraph 3. - -Title 4 -------- -Paragraph 4. -""", -"""\ -<document source="test data"> - <topic class="contents" id="contents" name="contents"> - <title> - Contents - <bullet_list> - <list_item> - <paragraph> - <reference id="id1" refid="title-1"> - Title 1 - <bullet_list> - <list_item> - <paragraph> - <reference id="id2" refid="title-2"> - Title 2 - <list_item> - <paragraph> - <reference id="id3" refid="title-4"> - Title 4 - <section id="title-1" name="title 1"> - <title refid="id1"> - Title 1 - <paragraph> - Paragraph 1. - <section id="title-2" name="title 2"> - <title refid="id2"> - Title 2 - <paragraph> - Paragraph 2. - <section id="title-3" name="title 3"> - <title> - Title 3 - <paragraph> - Paragraph 3. - <section id="title-4" name="title 4"> - <title refid="id3"> - Title 4 - <paragraph> - Paragraph 4. -"""], -["""\ -Title 1 -======= - -.. contents:: - :local: - -Paragraph 1. - -Title 2 -------- -Paragraph 2. - -Title 3 -``````` -Paragraph 3. - -Title 4 -------- -Paragraph 4. -""", -"""\ -<document source="test data"> - <section id="title-1" name="title 1"> - <title> - Title 1 - <topic class="contents" id="contents" name="contents"> - <bullet_list> - <list_item> - <paragraph> - <reference id="id1" refid="title-2"> - Title 2 - <bullet_list> - <list_item> - <paragraph> - <reference id="id2" refid="title-3"> - Title 3 - <list_item> - <paragraph> - <reference id="id3" refid="title-4"> - Title 4 - <paragraph> - Paragraph 1. - <section id="title-2" name="title 2"> - <title refid="id1"> - Title 2 - <paragraph> - Paragraph 2. - <section id="title-3" name="title 3"> - <title refid="id2"> - Title 3 - <paragraph> - Paragraph 3. - <section id="title-4" name="title 4"> - <title refid="id3"> - Title 4 - <paragraph> - Paragraph 4. -"""], -["""\ -.. contents:: - :local: - -Test duplicate name "Contents". - -Contents --------- -Paragraph. -""", -"""\ -<document source="test data"> - <topic class="contents" id="id1"> - <bullet_list> - <list_item> - <paragraph> - <reference id="id2" refid="contents"> - Contents - <paragraph> - Test duplicate name "Contents". - <section id="contents" name="contents"> - <title refid="id2"> - Contents - <paragraph> - Paragraph. -"""], -["""\ -.. contents:: - :backlinks: top - -Contents --------- -Paragraph. -""", -"""\ -<document source="test data"> - <topic class="contents" id="id1"> - <title> - Contents - <bullet_list> - <list_item> - <paragraph> - <reference id="id2" refid="contents"> - Contents - <section id="contents" name="contents"> - <title refid="id1"> - Contents - <paragraph> - Paragraph. -"""], -["""\ -.. contents:: - :backlinks: none - -Contents --------- -Paragraph. -""", -"""\ -<document source="test data"> - <topic class="contents" id="id1"> - <title> - Contents - <bullet_list> - <list_item> - <paragraph> - <reference id="id2" refid="contents"> - Contents - <section id="contents" name="contents"> - <title> - Contents - <paragraph> - Paragraph. -"""], -["""\ -.. contents:: - -Degenerate case, no table of contents generated. -""", -"""\ -<document source="test data"> - <paragraph> - Degenerate case, no table of contents generated. -"""], -]) - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_transforms/test_docinfo.py b/docutils/test/test_transforms/test_docinfo.py deleted file mode 100755 index 9fafa4ccb..000000000 --- a/docutils/test/test_transforms/test_docinfo.py +++ /dev/null @@ -1,336 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for docutils.transforms.frontmatter.DocInfo. -""" - -from __init__ import DocutilsTestSupport -from docutils.transforms.frontmatter import DocInfo -from docutils.parsers.rst import Parser - - -def suite(): - parser = Parser() - s = DocutilsTestSupport.TransformTestSuite(parser) - s.generateTests(totest) - return s - -totest = {} - -totest['bibliographic_field_lists'] = ((DocInfo,), [ -["""\ -.. Bibliographic element extraction. - -:Abstract: - There can only be one abstract. - - It is automatically moved to the end of the other bibliographic elements. - -:Author: Me -:Version: 1 -:Date: 2001-08-11 -:Parameter i: integer -""", -"""\ -<document source="test data"> - <docinfo> - <author> - Me - <version> - 1 - <date> - 2001-08-11 - <field> - <field_name> - Parameter i - <field_body> - <paragraph> - integer - <topic class="abstract"> - <title> - Abstract - <paragraph> - There can only be one abstract. - <paragraph> - It is automatically moved to the end of the other bibliographic elements. - <comment xml:space="preserve"> - Bibliographic element extraction. -"""], -["""\ -.. Bibliographic element extraction. - -:Abstract: Abstract 1. -:Author: Me -:Address: 123 My Street - Example, EX -:Contact: me@my.org -:Version: 1 -:Abstract: Abstract 2 (should generate a warning). -:Date: 2001-08-11 -:Parameter i: integer -""", -"""\ -<document source="test data"> - <docinfo> - <author> - Me - <address xml:space="preserve"> - 123 My Street - Example, EX - <contact> - <reference refuri="mailto:me@my.org"> - me@my.org - <version> - 1 - <field> - <field_name> - Abstract - <field_body> - <paragraph> - Abstract 2 (should generate a warning). - <system_message level="2" line="9" source="test data" type="WARNING"> - <paragraph> - There can only be one "Abstract" field. - <date> - 2001-08-11 - <field> - <field_name> - Parameter i - <field_body> - <paragraph> - integer - <topic class="abstract"> - <title> - Abstract - <paragraph> - Abstract 1. - <comment xml:space="preserve"> - Bibliographic element extraction. -"""], -["""\ -:Author: - must be a paragraph -:Status: a *simple* paragraph -:Date: But only one - - paragraph. -:Version: - -.. and not empty either -""", -"""\ -<document source="test data"> - <docinfo> - <field> - <field_name> - Author - <field_body> - <bullet_list bullet="-"> - <list_item> - <paragraph> - must be a paragraph - <system_message level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Cannot extract bibliographic field "Author" containing anything other than a single paragraph. - <status> - a \n\ - <emphasis> - simple - paragraph - <field> - <field_name> - Date - <field_body> - <paragraph> - But only one - <paragraph> - paragraph. - <system_message level="2" line="3" source="test data" type="WARNING"> - <paragraph> - Cannot extract compound bibliographic field "Date". - <field> - <field_name> - Version - <field_body> - <system_message level="2" line="6" source="test data" type="WARNING"> - <paragraph> - Cannot extract empty bibliographic field "Version". - <comment xml:space="preserve"> - and not empty either -"""], -["""\ -:Authors: Me, Myself, **I** -:Authors: PacMan; Ms. PacMan; PacMan, Jr. -:Authors: - Here - - There - - *Everywhere* -:Authors: - First - - Second - - Third -""", -"""\ -<document source="test data"> - <docinfo> - <authors> - <author> - Me - <author> - Myself - <author> - I - <authors> - <author> - PacMan - <author> - Ms. PacMan - <author> - PacMan, Jr. - <authors> - <author> - Here - <author> - There - <author> - <emphasis> - Everywhere - <authors> - <author> - First - <author> - Second - <author> - Third -"""], -["""\ -:Authors: Only One -:Authors: One, Only; -""", -"""\ -<document source="test data"> - <docinfo> - <author> - Only One - <author> - One, Only -"""], -["""\ -:Authors: - -:Authors: 1. One - 2. Two - -:Authors: - - - - - -:Authors: - - One - - Two - -:Authors: - - One - - Two -""", -"""\ -<document source="test data"> - <docinfo> - <field> - <field_name> - Authors - <field_body> - <system_message level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Cannot extract empty bibliographic field "Authors". - <field> - <field_name> - Authors - <field_body> - <enumerated_list enumtype="arabic" prefix="" suffix="."> - <list_item> - <paragraph> - One - <list_item> - <paragraph> - Two - <system_message level="2" line="3" source="test data" type="WARNING"> - <paragraph> - Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item. - <field> - <field_name> - Authors - <field_body> - <bullet_list bullet="-"> - <list_item> - <list_item> - <system_message level="2" line="6" source="test data" type="WARNING"> - <paragraph> - Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item. - <field> - <field_name> - Authors - <field_body> - <bullet_list bullet="-"> - <list_item> - <paragraph> - One - <paragraph> - Two - <system_message level="2" line="10" source="test data" type="WARNING"> - <paragraph> - Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item. - <field> - <field_name> - Authors - <field_body> - <bullet_list bullet="-"> - <list_item> - <paragraph> - One - <paragraph> - Two - <system_message level="2" line="15" source="test data" type="WARNING"> - <paragraph> - Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item. -"""], -["""\ -.. RCS keyword extraction. - -:Status: $RCSfile$ -:Date: $Date$ - -RCS keyword 'RCSfile' doesn't change unless the file name changes, -so it's safe. The 'Date' keyword changes every time the file is -checked in to CVS, so the test's expected output text has to be -derived (hacked) in parallel in order to stay in sync. -""", -"""\ -<document source="test data"> - <docinfo> - <status> - test_docinfo.py - <date> - %s - <comment xml:space="preserve"> - RCS keyword extraction. - <paragraph> - RCS keyword 'RCSfile' doesn't change unless the file name changes, - so it's safe. The 'Date' keyword changes every time the file is - checked in to CVS, so the test's expected output text has to be - derived (hacked) in parallel in order to stay in sync. -""" % ('$Date$'[7:17].replace('/', '-'),)], -]) - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_transforms/test_doctitle.py b/docutils/test/test_transforms/test_doctitle.py deleted file mode 100755 index 3e08eb232..000000000 --- a/docutils/test/test_transforms/test_doctitle.py +++ /dev/null @@ -1,175 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for docutils.transforms.frontmatter.DocTitle. -""" - -from __init__ import DocutilsTestSupport -from docutils.transforms.frontmatter import DocTitle -from docutils.parsers.rst import Parser - - -def suite(): - parser = Parser() - s = DocutilsTestSupport.TransformTestSuite(parser) - s.generateTests(totest) - return s - -totest = {} - -totest['section_headers'] = ((DocTitle,), [ -["""\ -.. test title promotion - -Title -===== - -Paragraph. -""", -"""\ -<document id="title" name="title" source="test data"> - <title> - Title - <comment xml:space="preserve"> - test title promotion - <paragraph> - Paragraph. -"""], -["""\ -Title -===== -Paragraph (no blank line). -""", -"""\ -<document id="title" name="title" source="test data"> - <title> - Title - <paragraph> - Paragraph (no blank line). -"""], -["""\ -Paragraph. - -Title -===== - -Paragraph. -""", -"""\ -<document source="test data"> - <paragraph> - Paragraph. - <section id="title" name="title"> - <title> - Title - <paragraph> - Paragraph. -"""], -["""\ -Title -===== - -Subtitle --------- - -Test title & subtitle. -""", -"""\ -<document id="title" name="title" source="test data"> - <title> - Title - <subtitle id="subtitle" name="subtitle"> - Subtitle - <paragraph> - Test title & subtitle. -"""], -["""\ -Title -==== - -Test short underline. -""", -"""\ -<document id="title" name="title" source="test data"> - <title> - Title - <system_message level="2" line="2" source="test data" type="WARNING"> - <paragraph> - Title underline too short. - <literal_block xml:space="preserve"> - Title - ==== - <paragraph> - Test short underline. -"""], -["""\ -======= - Long Title -======= - -Test long title and space normalization. -The system_message should move after the document title -(it was before the beginning of the section). -""", -"""\ -<document id="long-title" name="long title" source="test data"> - <title> - Long Title - <system_message level="2" line="1" source="test data" type="WARNING"> - <paragraph> - Title overline too short. - <literal_block xml:space="preserve"> - ======= - Long Title - ======= - <paragraph> - Test long title and space normalization. - The system_message should move after the document title - (it was before the beginning of the section). -"""], -["""\ -.. Test multiple second-level titles. - -Title 1 -======= -Paragraph 1. - -Title 2 -------- -Paragraph 2. - -Title 3 -------- -Paragraph 3. -""", -"""\ -<document id="title-1" name="title 1" source="test data"> - <title> - Title 1 - <comment xml:space="preserve"> - Test multiple second-level titles. - <paragraph> - Paragraph 1. - <section id="title-2" name="title 2"> - <title> - Title 2 - <paragraph> - Paragraph 2. - <section id="title-3" name="title 3"> - <title> - Title 3 - <paragraph> - Paragraph 3. -"""], -]) - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_transforms/test_filter.py b/docutils/test/test_transforms/test_filter.py deleted file mode 100644 index 009600d81..000000000 --- a/docutils/test/test_transforms/test_filter.py +++ /dev/null @@ -1,41 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for docutils.transforms.components.Filter. -""" - -from __init__ import DocutilsTestSupport -from docutils.parsers.rst import Parser - - -def suite(): - parser = Parser() - s = DocutilsTestSupport.TransformTestSuite(parser) - s.generateTests(totest) - return s - -totest = {} - -totest['meta'] = ((), [ -["""\ -.. meta:: - :description: The reStructuredText plaintext markup language - :keywords: plaintext,markup language -""", -"""\ -<document source="test data"> - <meta content="The reStructuredText plaintext markup language" name="description"> - <meta content="plaintext,markup language" name="keywords"> -"""], -]) - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_transforms/test_final_checks.py b/docutils/test/test_transforms/test_final_checks.py deleted file mode 100755 index 36c55efda..000000000 --- a/docutils/test/test_transforms/test_final_checks.py +++ /dev/null @@ -1,46 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for docutils.transforms.universal.FinalChecks. -""" - -from __init__ import DocutilsTestSupport -from docutils.transforms.universal import FinalChecks -from docutils.parsers.rst import Parser - - -def suite(): - parser = Parser() - s = DocutilsTestSupport.TransformTestSuite(parser) - s.generateTests(totest) - return s - -totest = {} - -totest['final_checks'] = ((FinalChecks,), [ -["""\ -Unknown reference_. -""", -"""\ -<document source="test data"> - <paragraph> - Unknown \n\ - <problematic id="id2" refid="id1"> - reference_ - . - <system_message backrefs="id2" id="id1" level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Unknown target name: "reference". -"""], -]) - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_transforms/test_footnotes.py b/docutils/test/test_transforms/test_footnotes.py deleted file mode 100755 index 4da43e055..000000000 --- a/docutils/test/test_transforms/test_footnotes.py +++ /dev/null @@ -1,520 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for docutils.transforms.references.Footnotes. -""" - -from __init__ import DocutilsTestSupport -from docutils.transforms.references import Footnotes -from docutils.parsers.rst import Parser - - -def suite(): - parser = Parser() - s = DocutilsTestSupport.TransformTestSuite(parser) - s.generateTests(totest) - return s - -totest = {} - -totest['footnotes'] = ((Footnotes,), [ -["""\ -[#autolabel]_ - -.. [#autolabel] text -""", -"""\ -<document source="test data"> - <paragraph> - <footnote_reference auto="1" id="id1" refid="autolabel"> - 1 - <footnote auto="1" backrefs="id1" id="autolabel" name="autolabel"> - <label> - 1 - <paragraph> - text -"""], -["""\ -autonumber: [#]_ - -.. [#] text -""", -"""\ -<document source="test data"> - <paragraph> - autonumber: \n\ - <footnote_reference auto="1" id="id1" refid="id2"> - 1 - <footnote auto="1" backrefs="id1" id="id2" name="1"> - <label> - 1 - <paragraph> - text -"""], -["""\ -[#]_ is the first auto-numbered footnote reference. -[#]_ is the second auto-numbered footnote reference. - -.. [#] Auto-numbered footnote 1. -.. [#] Auto-numbered footnote 2. -.. [#] Auto-numbered footnote 3. - -[#]_ is the third auto-numbered footnote reference. -""", -"""\ -<document source="test data"> - <paragraph> - <footnote_reference auto="1" id="id1" refid="id3"> - 1 - is the first auto-numbered footnote reference. - <footnote_reference auto="1" id="id2" refid="id4"> - 2 - is the second auto-numbered footnote reference. - <footnote auto="1" backrefs="id1" id="id3" name="1"> - <label> - 1 - <paragraph> - Auto-numbered footnote 1. - <footnote auto="1" backrefs="id2" id="id4" name="2"> - <label> - 2 - <paragraph> - Auto-numbered footnote 2. - <footnote auto="1" backrefs="id6" id="id5" name="3"> - <label> - 3 - <paragraph> - Auto-numbered footnote 3. - <paragraph> - <footnote_reference auto="1" id="id6" refid="id5"> - 3 - is the third auto-numbered footnote reference. -"""], -["""\ -[#third]_ is a reference to the third auto-numbered footnote. - -.. [#first] First auto-numbered footnote. -.. [#second] Second auto-numbered footnote. -.. [#third] Third auto-numbered footnote. - -[#second]_ is a reference to the second auto-numbered footnote. -[#first]_ is a reference to the first auto-numbered footnote. -[#third]_ is another reference to the third auto-numbered footnote. - -Here are some internal cross-references to the implicit targets -generated by the footnotes: first_, second_, third_. -""", -"""\ -<document source="test data"> - <paragraph> - <footnote_reference auto="1" id="id1" refid="third"> - 3 - is a reference to the third auto-numbered footnote. - <footnote auto="1" backrefs="id3" id="first" name="first"> - <label> - 1 - <paragraph> - First auto-numbered footnote. - <footnote auto="1" backrefs="id2" id="second" name="second"> - <label> - 2 - <paragraph> - Second auto-numbered footnote. - <footnote auto="1" backrefs="id1 id4" id="third" name="third"> - <label> - 3 - <paragraph> - Third auto-numbered footnote. - <paragraph> - <footnote_reference auto="1" id="id2" refid="second"> - 2 - is a reference to the second auto-numbered footnote. - <footnote_reference auto="1" id="id3" refid="first"> - 1 - is a reference to the first auto-numbered footnote. - <footnote_reference auto="1" id="id4" refid="third"> - 3 - is another reference to the third auto-numbered footnote. - <paragraph> - Here are some internal cross-references to the implicit targets - generated by the footnotes: \n\ - <reference refname="first"> - first - , \n\ - <reference refname="second"> - second - , \n\ - <reference refname="third"> - third - . -"""], -["""\ -Mixed anonymous and labelled auto-numbered footnotes: - -[#four]_ should be 4, [#]_ should be 1, -[#]_ should be 3, [#]_ is one too many, -[#two]_ should be 2, and [#six]_ doesn't exist. - -.. [#] Auto-numbered footnote 1. -.. [#two] Auto-numbered footnote 2. -.. [#] Auto-numbered footnote 3. -.. [#four] Auto-numbered footnote 4. -.. [#five] Auto-numbered footnote 5. -.. [#five] Auto-numbered footnote 5 again (duplicate). -""", -"""\ -<document source="test data"> - <paragraph> - Mixed anonymous and labelled auto-numbered footnotes: - <paragraph> - <footnote_reference auto="1" id="id1" refid="four"> - 4 - should be 4, \n\ - <footnote_reference auto="1" id="id2" refid="id7"> - 1 - should be 1, - <footnote_reference auto="1" id="id3" refid="id8"> - 3 - should be 3, \n\ - <problematic id="id11" refid="id10"> - [#]_ - is one too many, - <footnote_reference auto="1" id="id5" refid="two"> - 2 - should be 2, and \n\ - <footnote_reference auto="1" id="id6" refname="six"> - doesn't exist. - <footnote auto="1" backrefs="id2" id="id7" name="1"> - <label> - 1 - <paragraph> - Auto-numbered footnote 1. - <footnote auto="1" backrefs="id5" id="two" name="two"> - <label> - 2 - <paragraph> - Auto-numbered footnote 2. - <footnote auto="1" backrefs="id3" id="id8" name="3"> - <label> - 3 - <paragraph> - Auto-numbered footnote 3. - <footnote auto="1" backrefs="id1" id="four" name="four"> - <label> - 4 - <paragraph> - Auto-numbered footnote 4. - <footnote auto="1" dupname="five" id="five"> - <label> - 5 - <paragraph> - Auto-numbered footnote 5. - <footnote auto="1" dupname="five" id="id9"> - <label> - 6 - <system_message backrefs="id9" level="2" line="12" source="test data" type="WARNING"> - <paragraph> - Duplicate explicit target name: "five". - <paragraph> - Auto-numbered footnote 5 again (duplicate). - <system_message backrefs="id11" id="id10" level="3" line="3" source="test data" type="ERROR"> - <paragraph> - Too many autonumbered footnote references: only 2 corresponding footnotes available. -"""], -["""\ -Mixed auto-numbered and manual footnotes: - -.. [1] manually numbered -.. [#] auto-numbered -.. [#label] autonumber-labeled -""", -"""\ -<document source="test data"> - <paragraph> - Mixed auto-numbered and manual footnotes: - <footnote id="id1" name="1"> - <label> - 1 - <paragraph> - manually numbered - <footnote auto="1" id="id2" name="2"> - <label> - 2 - <paragraph> - auto-numbered - <footnote auto="1" id="label" name="label"> - <label> - 3 - <paragraph> - autonumber-labeled -"""], -["""\ -A labeled autonumbered footnote referece: [#footnote]_. - -An unlabeled autonumbered footnote referece: [#]_. - -.. [#] Unlabeled autonumbered footnote. -.. [#footnote] Labeled autonumbered footnote. - Note that the footnotes are not in the same - order as the references. -""", -"""\ -<document source="test data"> - <paragraph> - A labeled autonumbered footnote referece: \n\ - <footnote_reference auto="1" id="id1" refid="footnote"> - 2 - . - <paragraph> - An unlabeled autonumbered footnote referece: \n\ - <footnote_reference auto="1" id="id2" refid="id3"> - 1 - . - <footnote auto="1" backrefs="id2" id="id3" name="1"> - <label> - 1 - <paragraph> - Unlabeled autonumbered footnote. - <footnote auto="1" backrefs="id1" id="footnote" name="footnote"> - <label> - 2 - <paragraph> - Labeled autonumbered footnote. - Note that the footnotes are not in the same - order as the references. -"""], -["""\ -Mixed manually-numbered, anonymous auto-numbered, -and labelled auto-numbered footnotes: - -[#four]_ should be 4, [#]_ should be 2, -[1]_ is 1, [3]_ is 3, -[#]_ should be 6, [#]_ is one too many, -[#five]_ should be 5, and [#eight]_ doesn't exist. - -.. [1] Manually-numbered footnote 1. -.. [#] Auto-numbered footnote 2. -.. [#four] Auto-numbered footnote 4. -.. [3] Manually-numbered footnote 3 -.. [#five] Auto-numbered footnote 5. -.. [#] Auto-numbered footnote 6. -.. [#five] Auto-numbered footnote 5 again (duplicate). -""", -"""\ -<document source="test data"> - <paragraph> - Mixed manually-numbered, anonymous auto-numbered, - and labelled auto-numbered footnotes: - <paragraph> - <footnote_reference auto="1" id="id1" refid="four"> - 4 - should be 4, \n\ - <footnote_reference auto="1" id="id2" refid="id10"> - 2 - should be 2, - <footnote_reference id="id3" refid="id9"> - 1 - is 1, \n\ - <footnote_reference id="id4" refid="id11"> - 3 - is 3, - <footnote_reference auto="1" id="id5" refid="id12"> - 6 - should be 6, \n\ - <problematic id="id15" refid="id14"> - [#]_ - is one too many, - <footnote_reference auto="1" id="id7" refname="five"> - should be 5, and \n\ - <footnote_reference auto="1" id="id8" refname="eight"> - doesn't exist. - <footnote backrefs="id3" id="id9" name="1"> - <label> - 1 - <paragraph> - Manually-numbered footnote 1. - <footnote auto="1" backrefs="id2" id="id10" name="2"> - <label> - 2 - <paragraph> - Auto-numbered footnote 2. - <footnote auto="1" backrefs="id1" id="four" name="four"> - <label> - 4 - <paragraph> - Auto-numbered footnote 4. - <footnote backrefs="id4" id="id11" name="3"> - <label> - 3 - <paragraph> - Manually-numbered footnote 3 - <footnote auto="1" dupname="five" id="five"> - <label> - 5 - <paragraph> - Auto-numbered footnote 5. - <footnote auto="1" backrefs="id5" id="id12" name="6"> - <label> - 6 - <paragraph> - Auto-numbered footnote 6. - <footnote auto="1" dupname="five" id="id13"> - <label> - 7 - <system_message backrefs="id13" level="2" line="15" source="test data" type="WARNING"> - <paragraph> - Duplicate explicit target name: "five". - <paragraph> - Auto-numbered footnote 5 again (duplicate). - <system_message backrefs="id15" id="id14" level="3" line="4" source="test data" type="ERROR"> - <paragraph> - Too many autonumbered footnote references: only 2 corresponding footnotes available. -"""], -["""\ -Referencing a footnote by symbol [*]_. - -.. [*] This is an auto-symbol footnote. -""", -"""\ -<document source="test data"> - <paragraph> - Referencing a footnote by symbol \n\ - <footnote_reference auto="*" id="id1" refid="id2"> - * - . - <footnote auto="*" backrefs="id1" id="id2"> - <label> - * - <paragraph> - This is an auto-symbol footnote. -"""], -["""\ -A sequence of symbol footnote references: -[*]_ [*]_ [*]_ [*]_ [*]_ [*]_ [*]_ [*]_ [*]_ [*]_ [*]_ [*]_. - -.. [*] Auto-symbol footnote 1. -.. [*] Auto-symbol footnote 2. -.. [*] Auto-symbol footnote 3. -.. [*] Auto-symbol footnote 4. -.. [*] Auto-symbol footnote 5. -.. [*] Auto-symbol footnote 6. -.. [*] Auto-symbol footnote 7. -.. [*] Auto-symbol footnote 8. -.. [*] Auto-symbol footnote 9. -.. [*] Auto-symbol footnote 10. -.. [*] Auto-symbol footnote 11. -.. [*] Auto-symbol footnote 12. -""", -u"""\ -<document source="test data"> - <paragraph> - A sequence of symbol footnote references: - <footnote_reference auto="*" id="id1" refid="id13"> - * - \n\ - <footnote_reference auto="*" id="id2" refid="id14"> - \u2020 - \n\ - <footnote_reference auto="*" id="id3" refid="id15"> - \u2021 - \n\ - <footnote_reference auto="*" id="id4" refid="id16"> - \u00A7 - \n\ - <footnote_reference auto="*" id="id5" refid="id17"> - \u00B6 - \n\ - <footnote_reference auto="*" id="id6" refid="id18"> - # - \n\ - <footnote_reference auto="*" id="id7" refid="id19"> - \u2660 - \n\ - <footnote_reference auto="*" id="id8" refid="id20"> - \u2665 - \n\ - <footnote_reference auto="*" id="id9" refid="id21"> - \u2666 - \n\ - <footnote_reference auto="*" id="id10" refid="id22"> - \u2663 - \n\ - <footnote_reference auto="*" id="id11" refid="id23"> - ** - \n\ - <footnote_reference auto="*" id="id12" refid="id24"> - \u2020\u2020 - . - <footnote auto="*" backrefs="id1" id="id13"> - <label> - * - <paragraph> - Auto-symbol footnote 1. - <footnote auto="*" backrefs="id2" id="id14"> - <label> - \u2020 - <paragraph> - Auto-symbol footnote 2. - <footnote auto="*" backrefs="id3" id="id15"> - <label> - \u2021 - <paragraph> - Auto-symbol footnote 3. - <footnote auto="*" backrefs="id4" id="id16"> - <label> - \u00A7 - <paragraph> - Auto-symbol footnote 4. - <footnote auto="*" backrefs="id5" id="id17"> - <label> - \u00B6 - <paragraph> - Auto-symbol footnote 5. - <footnote auto="*" backrefs="id6" id="id18"> - <label> - # - <paragraph> - Auto-symbol footnote 6. - <footnote auto="*" backrefs="id7" id="id19"> - <label> - \u2660 - <paragraph> - Auto-symbol footnote 7. - <footnote auto="*" backrefs="id8" id="id20"> - <label> - \u2665 - <paragraph> - Auto-symbol footnote 8. - <footnote auto="*" backrefs="id9" id="id21"> - <label> - \u2666 - <paragraph> - Auto-symbol footnote 9. - <footnote auto="*" backrefs="id10" id="id22"> - <label> - \u2663 - <paragraph> - Auto-symbol footnote 10. - <footnote auto="*" backrefs="id11" id="id23"> - <label> - ** - <paragraph> - Auto-symbol footnote 11. - <footnote auto="*" backrefs="id12" id="id24"> - <label> - \u2020\u2020 - <paragraph> - Auto-symbol footnote 12. -"""], -]) - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_transforms/test_hyperlinks.py b/docutils/test/test_transforms/test_hyperlinks.py deleted file mode 100755 index 43e18d3f2..000000000 --- a/docutils/test/test_transforms/test_hyperlinks.py +++ /dev/null @@ -1,520 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for docutils.transforms.references.Hyperlinks. -""" - -from __init__ import DocutilsTestSupport -from docutils.transforms.references import ChainedTargets, \ - AnonymousHyperlinks, IndirectHyperlinks, ExternalTargets, InternalTargets -from docutils.parsers.rst import Parser - - -def suite(): - parser = Parser() - s = DocutilsTestSupport.TransformTestSuite(parser) - s.generateTests(totest) - return s - -totest = {} - -# Exhaustive listing of hyperlink variations: every combination of -# target/reference, direct/indirect, internal/external, and named/anonymous, -# plus embedded URIs. -totest['exhaustive_hyperlinks'] = ((ChainedTargets, AnonymousHyperlinks, - IndirectHyperlinks, ExternalTargets, - InternalTargets,), [ -["""\ -direct_ external - -.. _direct: http://direct -""", -"""\ -<document source="test data"> - <paragraph> - <reference refuri="http://direct"> - direct - external - <target id="direct" name="direct" refuri="http://direct"> -"""], -["""\ -indirect_ external - -.. _indirect: xtarget_ -.. _xtarget: http://indirect -""", -"""\ -<document source="test data"> - <paragraph> - <reference refuri="http://indirect"> - indirect - external - <target id="indirect" name="indirect" refuri="http://indirect"> - <target id="xtarget" name="xtarget" refuri="http://indirect"> -"""], -["""\ -.. _direct: - -direct_ internal -""", -"""\ -<document source="test data"> - <target id="direct" name="direct"> - <paragraph> - <reference refid="direct"> - direct - internal -"""], -["""\ -.. _ztarget: - -indirect_ internal - -.. _indirect2: ztarget_ -.. _indirect: indirect2_ -""", -"""\ -<document source="test data"> - <target id="ztarget" name="ztarget"> - <paragraph> - <reference refid="ztarget"> - indirect - internal - <target id="indirect2" name="indirect2" refid="ztarget"> - <target id="indirect" name="indirect" refid="ztarget"> -"""], -["""\ -Implicit --------- - -indirect_ internal - -.. _indirect: implicit_ -""", -"""\ -<document source="test data"> - <section id="implicit" name="implicit"> - <title> - Implicit - <paragraph> - <reference refid="implicit"> - indirect - internal - <target id="indirect" name="indirect" refid="implicit"> -"""], -["""\ -Implicit --------- - -`multiply-indirect`_ internal - -.. _multiply-indirect: indirect_ -.. _indirect: implicit_ -""", -"""\ -<document source="test data"> - <section id="implicit" name="implicit"> - <title> - Implicit - <paragraph> - <reference refid="implicit"> - multiply-indirect - internal - <target id="multiply-indirect" name="multiply-indirect" refid="implicit"> - <target id="indirect" name="indirect" refid="implicit"> -"""], -["""\ -circular_ indirect reference - -.. _circular: indirect_ -.. _indirect: circular_ -""", -"""\ -<document source="test data"> - <paragraph> - <problematic id="id2" refid="id1"> - circular_ - indirect reference - <target id="circular" name="circular" refid="circular"> - <problematic id="id3" refid="id1"> - .. _indirect: circular_ - <system_message backrefs="id2 id3" id="id1" level="3" line="3" source="test data" type="ERROR"> - <paragraph> - Indirect hyperlink target "circular" (id="circular") refers to target "indirect", forming a circular reference. -"""], -["""\ -Implicit --------- - -Duplicate implicit targets. - -Implicit --------- - -indirect_ internal - -.. _indirect: implicit_ -""", -"""\ -<document source="test data"> - <section dupname="implicit" id="implicit"> - <title> - Implicit - <paragraph> - Duplicate implicit targets. - <section dupname="implicit" id="id1"> - <title> - Implicit - <system_message backrefs="id1" level="1" line="7" source="test data" type="INFO"> - <paragraph> - Duplicate implicit target name: "implicit". - <paragraph> - <problematic id="id3" refid="id2"> - indirect_ - internal - <target id="indirect" name="indirect" refname="implicit"> - <system_message backrefs="id3" id="id2" level="3" line="11" source="test data" type="ERROR"> - <paragraph> - Indirect hyperlink target "indirect" (id="indirect") refers to target "implicit", which does not exist. -"""], -["""\ -`direct external`__ - -__ http://direct -""", -"""\ -<document source="test data"> - <paragraph> - <reference anonymous="1" refuri="http://direct"> - direct external - <target anonymous="1" id="id1" refuri="http://direct"> -"""], -["""\ -`indirect external`__ - -__ xtarget_ -.. _xtarget: http://indirect -""", -"""\ -<document source="test data"> - <paragraph> - <reference anonymous="1" refuri="http://indirect"> - indirect external - <target anonymous="1" id="id1" refuri="http://indirect"> - <target id="xtarget" name="xtarget" refuri="http://indirect"> -"""], -["""\ -__ - -`direct internal`__ -""", -"""\ -<document source="test data"> - <target anonymous="1" id="id1"> - <paragraph> - <reference anonymous="1" refid="id1"> - direct internal -"""], -["""\ -.. _ztarget: - -`indirect internal`__ - -__ ztarget_ -""", -"""\ -<document source="test data"> - <target id="ztarget" name="ztarget"> - <paragraph> - <reference anonymous="1" refid="ztarget"> - indirect internal - <target anonymous="1" id="id1" refid="ztarget"> -"""], -["""\ -.. _ztarget: - -First - -.. _ztarget: - -Second - -`indirect internal`__ - -__ ztarget_ -""", -"""\ -<document source="test data"> - <target dupname="ztarget" id="ztarget"> - <paragraph> - First - <system_message backrefs="id1" level="2" line="5" source="test data" type="WARNING"> - <paragraph> - Duplicate explicit target name: "ztarget". - <target dupname="ztarget" id="id1"> - <paragraph> - Second - <paragraph> - <problematic id="id4" refid="id3"> - `indirect internal`__ - <target anonymous="1" id="id2" refname="ztarget"> - <system_message backrefs="id4" id="id3" level="3" line="11" source="test data" type="ERROR"> - <paragraph> - Indirect hyperlink target (id="id2") refers to target "ztarget", which does not exist. -"""], -["""\ -An `embedded uri <http://direct>`_. - -Another reference to the same `embedded URI`_. -""", -"""\ -<document source="test data"> - <paragraph> - An \n\ - <reference refuri="http://direct"> - embedded uri - <target id="embedded-uri" name="embedded uri" refuri="http://direct"> - . - <paragraph> - Another reference to the same \n\ - <reference refuri="http://direct"> - embedded URI - . -"""], -["""\ -An `anonymous embedded uri <http://direct>`__. -""", -"""\ -<document source="test data"> - <paragraph> - An \n\ - <reference refuri="http://direct"> - anonymous embedded uri - . -"""], -]) - -totest['hyperlinks'] = ((ChainedTargets, AnonymousHyperlinks, - IndirectHyperlinks, ExternalTargets, - InternalTargets,), [ -["""\ -.. _internal hyperlink: - -This paragraph referenced. - -By this `internal hyperlink`_ referemce. -""", -"""\ -<document source="test data"> - <target id="internal-hyperlink" name="internal hyperlink"> - <paragraph> - This paragraph referenced. - <paragraph> - By this \n\ - <reference refid="internal-hyperlink"> - internal hyperlink - referemce. -"""], -["""\ -.. _chained: -.. _internal hyperlink: - -This paragraph referenced. - -By this `internal hyperlink`_ referemce -as well as by this chained_ reference. - -The results of the transform are not visible at the XML level. -""", -"""\ -<document source="test data"> - <target id="chained" name="chained"> - <target id="internal-hyperlink" name="internal hyperlink"> - <paragraph> - This paragraph referenced. - <paragraph> - By this \n\ - <reference refid="internal-hyperlink"> - internal hyperlink - referemce - as well as by this \n\ - <reference refid="chained"> - chained - reference. - <paragraph> - The results of the transform are not visible at the XML level. -"""], -["""\ -.. _external hyperlink: http://uri - -`External hyperlink`_ reference. -""", -"""\ -<document source="test data"> - <target id="external-hyperlink" name="external hyperlink" refuri="http://uri"> - <paragraph> - <reference refuri="http://uri"> - External hyperlink - reference. -"""], -["""\ -.. _external hyperlink: http://uri -.. _indirect target: `external hyperlink`_ -""", -"""\ -<document source="test data"> - <target id="external-hyperlink" name="external hyperlink" refuri="http://uri"> - <target id="indirect-target" name="indirect target" refuri="http://uri"> - <system_message level="1" line="2" source="test data" type="INFO"> - <paragraph> - Indirect hyperlink target "indirect target" is not referenced. -"""], -["""\ -.. _chained: -.. _external hyperlink: http://uri - -`External hyperlink`_ reference -and a chained_ reference too. -""", -"""\ -<document source="test data"> - <target id="chained" name="chained" refuri="http://uri"> - <target id="external-hyperlink" name="external hyperlink" refuri="http://uri"> - <paragraph> - <reference refuri="http://uri"> - External hyperlink - reference - and a \n\ - <reference refuri="http://uri"> - chained - reference too. -"""], -["""\ -.. _external hyperlink: http://uri -.. _indirect hyperlink: `external hyperlink`_ - -`Indirect hyperlink`_ reference. -""", -"""\ -<document source="test data"> - <target id="external-hyperlink" name="external hyperlink" refuri="http://uri"> - <target id="indirect-hyperlink" name="indirect hyperlink" refuri="http://uri"> - <paragraph> - <reference refuri="http://uri"> - Indirect hyperlink - reference. -"""], -["""\ -.. _external hyperlink: http://uri -.. _chained: -.. _indirect hyperlink: `external hyperlink`_ - -Chained_ `indirect hyperlink`_ reference. -""", -"""\ -<document source="test data"> - <target id="external-hyperlink" name="external hyperlink" refuri="http://uri"> - <target id="chained" name="chained" refuri="http://uri"> - <target id="indirect-hyperlink" name="indirect hyperlink" refuri="http://uri"> - <paragraph> - <reference refuri="http://uri"> - Chained - \n\ - <reference refuri="http://uri"> - indirect hyperlink - reference. -"""], -["""\ -.. __: http://full -__ -__ http://simplified -.. _external: http://indirect.external -__ external_ -__ - -`Full syntax anonymous external hyperlink reference`__, -`chained anonymous external reference`__, -`simplified syntax anonymous external hyperlink reference`__, -`indirect anonymous hyperlink reference`__, -`internal anonymous hyperlink reference`__. -""", -"""\ -<document source="test data"> - <target anonymous="1" id="id1" refuri="http://full"> - <target anonymous="1" id="id2" refuri="http://simplified"> - <target anonymous="1" id="id3" refuri="http://simplified"> - <target id="external" name="external" refuri="http://indirect.external"> - <target anonymous="1" id="id4" refuri="http://indirect.external"> - <target anonymous="1" id="id5"> - <paragraph> - <reference anonymous="1" refuri="http://full"> - Full syntax anonymous external hyperlink reference - , - <reference anonymous="1" refuri="http://simplified"> - chained anonymous external reference - , - <reference anonymous="1" refuri="http://simplified"> - simplified syntax anonymous external hyperlink reference - , - <reference anonymous="1" refuri="http://indirect.external"> - indirect anonymous hyperlink reference - , - <reference anonymous="1" refid="id5"> - internal anonymous hyperlink reference - . -"""], -["""\ -Duplicate external target_'s (different URIs): - -.. _target: first - -.. _target: second -""", -"""\ -<document source="test data"> - <paragraph> - Duplicate external \n\ - <reference refname="target"> - target - 's (different URIs): - <target dupname="target" id="target" refuri="first"> - <system_message backrefs="id1" level="2" line="5" source="test data" type="WARNING"> - <paragraph> - Duplicate explicit target name: "target". - <target dupname="target" id="id1" refuri="second"> -"""], -["""\ -Several__ anonymous__ hyperlinks__, but not enough targets. - -__ http://example.org -""", -"""\ -<document source="test data"> - <paragraph> - <problematic id="id3" refid="id2"> - Several__ - \n\ - <problematic id="id4" refid="id2"> - anonymous__ - \n\ - <problematic id="id5" refid="id2"> - hyperlinks__ - , but not enough targets. - <target anonymous="1" id="id1" refuri="http://example.org"> - <system_message backrefs="id3 id4 id5" id="id2" level="3" source="test data" type="ERROR"> - <paragraph> - Anonymous hyperlink mismatch: 3 references but 1 targets. - See "backrefs" attribute for IDs. -"""], -]) - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_transforms/test_messages.py b/docutils/test/test_transforms/test_messages.py deleted file mode 100755 index 75325bc96..000000000 --- a/docutils/test/test_transforms/test_messages.py +++ /dev/null @@ -1,66 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for docutils.transforms.universal.Messages. -""" - -from __init__ import DocutilsTestSupport -from docutils.transforms.universal import Messages -from docutils.transforms.references import Substitutions -from docutils.parsers.rst import Parser - - -def suite(): - parser = Parser() - s = DocutilsTestSupport.TransformTestSuite(parser) - s.generateTests(totest) - return s - -totest = {} - -totest['system_message_sections'] = ((Substitutions, Messages), [ -["""\ -This |unknown substitution| will generate a system message, thanks to -the ``Substitutions`` transform. The ``Messages`` transform will -generate a "System Messages" section. - -(A second copy of the system message is tacked on to the end of the -document by the test framework.) -""", -"""\ -<document source="test data"> - <paragraph> - This \n\ - <problematic id="id2" refid="id1"> - |unknown substitution| - will generate a system message, thanks to - the \n\ - <literal> - Substitutions - transform. The \n\ - <literal> - Messages - transform will - generate a "System Messages" section. - <paragraph> - (A second copy of the system message is tacked on to the end of the - document by the test framework.) - <section class="system-messages"> - <title> - Docutils System Messages - <system_message backrefs="id2" id="id1" level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Undefined substitution referenced: "unknown substitution". -"""], -]) - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_transforms/test_peps.py b/docutils/test/test_transforms/test_peps.py deleted file mode 100644 index 28fa68af2..000000000 --- a/docutils/test/test_transforms/test_peps.py +++ /dev/null @@ -1,68 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for docutils.transforms.peps. -""" - -from __init__ import DocutilsTestSupport -from docutils.transforms.peps import TargetNotes -from docutils.parsers.rst import Parser - - -def suite(): - parser = Parser() - s = DocutilsTestSupport.TransformTestSuite(parser) - s.generateTests(totest) - return s - -totest = {} - -totest['target_notes'] = ((TargetNotes,), [ -["""\ -No references or targets exist, therefore -no "References" section should be generated. -""", -"""\ -<document source="test data"> - <paragraph> - No references or targets exist, therefore - no "References" section should be generated. -"""], -["""\ -A target exists, here's the reference_. -A "References" section should be generated. - -.. _reference: http://www.example.org -""", -"""\ -<document source="test data"> - <paragraph> - A target exists, here's the \n\ - <reference refname="reference"> - reference - \n\ - <footnote_reference auto="1" id="id3" refname="target_note: id2"> - . - A "References" section should be generated. - <target id="reference" name="reference" refuri="http://www.example.org"> - <section id="id1"> - <title> - References - <footnote auto="1" id="id2" name="target_note: id2"> - <paragraph> - <reference refuri="http://www.example.org"> - http://www.example.org -"""], -]) - - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_transforms/test_sectnum.py b/docutils/test/test_transforms/test_sectnum.py deleted file mode 100644 index 543deac16..000000000 --- a/docutils/test/test_transforms/test_sectnum.py +++ /dev/null @@ -1,226 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger, Dmitry Jemerov -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for `docutils.transforms.parts.SectNum` (via -`docutils.transforms.universal.LastReaderPending`). -""" - -from __init__ import DocutilsTestSupport -from docutils.transforms.references import Substitutions -from docutils.parsers.rst import Parser - - -def suite(): - parser = Parser() - s = DocutilsTestSupport.TransformTestSuite(parser) - s.generateTests(totest) - return s - -totest = {} - -totest['section_numbers'] = ((Substitutions,), [ -["""\ -.. sectnum:: - -Title 1 -======= -Paragraph 1. - -Title 2 -------- -Paragraph 2. - -Title 3 -``````` -Paragraph 3. - -Title 4 -------- -Paragraph 4. -""", -u"""\ -<document source="test data"> - <section id="title-1" name="title 1"> - <title auto="1"> - <generated class="sectnum"> - 1\u00a0\u00a0\u00a0 - Title 1 - <paragraph> - Paragraph 1. - <section id="title-2" name="title 2"> - <title auto="1"> - <generated class="sectnum"> - 1.1\u00a0\u00a0\u00a0 - Title 2 - <paragraph> - Paragraph 2. - <section id="title-3" name="title 3"> - <title auto="1"> - <generated class="sectnum"> - 1.1.1\u00a0\u00a0\u00a0 - Title 3 - <paragraph> - Paragraph 3. - <section id="title-4" name="title 4"> - <title auto="1"> - <generated class="sectnum"> - 1.2\u00a0\u00a0\u00a0 - Title 4 - <paragraph> - Paragraph 4. -"""], -["""\ -.. sectnum:: - -**Bold Title** -============== -Paragraph 1. -""", -u"""\ -<document source="test data"> - <section id="bold-title" name="bold title"> - <title auto="1"> - <generated class="sectnum"> - 1\u00a0\u00a0\u00a0 - <strong> - Bold Title - <paragraph> - Paragraph 1. -"""], -["""\ -.. sectnum:: :depth: 2 - -Title 1 -======= -Paragraph 1. - -Title 2 -------- -Paragraph 2. - -Title 3 -``````` -Paragraph 3. - -Title 4 -------- -Paragraph 4. -""", -u"""\ -<document source="test data"> - <section id="title-1" name="title 1"> - <title auto="1"> - <generated class="sectnum"> - 1\u00a0\u00a0\u00a0 - Title 1 - <paragraph> - Paragraph 1. - <section id="title-2" name="title 2"> - <title auto="1"> - <generated class="sectnum"> - 1.1\u00a0\u00a0\u00a0 - Title 2 - <paragraph> - Paragraph 2. - <section id="title-3" name="title 3"> - <title> - Title 3 - <paragraph> - Paragraph 3. - <section id="title-4" name="title 4"> - <title auto="1"> - <generated class="sectnum"> - 1.2\u00a0\u00a0\u00a0 - Title 4 - <paragraph> - Paragraph 4. -"""], -["""\ -.. contents:: -.. sectnum:: :depth: 2 - -Title 1 -======= -Paragraph 1. - -Title 2 -------- -Paragraph 2. - -Title 3 -``````` -Paragraph 3. - -Title 4 -------- -Paragraph 4. -""", -u"""\ -<document source="test data"> - <topic class="contents" id="contents" name="contents"> - <title> - Contents - <bullet_list class="auto-toc"> - <list_item> - <paragraph> - <reference id="id1" refid="title-1"> - <generated class="sectnum"> - 1\u00a0\u00a0\u00a0 - Title 1 - <bullet_list class="auto-toc"> - <list_item> - <paragraph> - <reference id="id2" refid="title-2"> - <generated class="sectnum"> - 1.1\u00a0\u00a0\u00a0 - Title 2 - <bullet_list> - <list_item> - <paragraph> - <reference id="id3" refid="title-3"> - Title 3 - <list_item> - <paragraph> - <reference id="id4" refid="title-4"> - <generated class="sectnum"> - 1.2\u00a0\u00a0\u00a0 - Title 4 - <section id="title-1" name="title 1"> - <title auto="1" refid="id1"> - <generated class="sectnum"> - 1\u00a0\u00a0\u00a0 - Title 1 - <paragraph> - Paragraph 1. - <section id="title-2" name="title 2"> - <title auto="1" refid="id2"> - <generated class="sectnum"> - 1.1\u00a0\u00a0\u00a0 - Title 2 - <paragraph> - Paragraph 2. - <section id="title-3" name="title 3"> - <title refid="id3"> - Title 3 - <paragraph> - Paragraph 3. - <section id="title-4" name="title 4"> - <title auto="1" refid="id4"> - <generated class="sectnum"> - 1.2\u00a0\u00a0\u00a0 - Title 4 - <paragraph> - Paragraph 4. -"""], -]) - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_transforms/test_substitutions.py b/docutils/test/test_transforms/test_substitutions.py deleted file mode 100755 index 503dfba40..000000000 --- a/docutils/test/test_transforms/test_substitutions.py +++ /dev/null @@ -1,151 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for docutils.transforms.references.Substitutions. -""" - -from __init__ import DocutilsTestSupport -from docutils.transforms.references import Substitutions -from docutils.parsers.rst import Parser - - -def suite(): - parser = Parser() - s = DocutilsTestSupport.TransformTestSuite(parser) - s.generateTests(totest) - return s - -totest = {} - -totest['substitutions'] = ((Substitutions,), [ -["""\ -The |biohazard| symbol is deservedly scary-looking. - -.. |biohazard| image:: biohazard.png -""", -"""\ -<document source="test data"> - <paragraph> - The \n\ - <image alt="biohazard" uri="biohazard.png"> - symbol is deservedly scary-looking. - <substitution_definition name="biohazard"> - <image alt="biohazard" uri="biohazard.png"> -"""], -["""\ -Here's an |unknown| substitution. -""", -"""\ -<document source="test data"> - <paragraph> - Here's an \n\ - <problematic id="id2" refid="id1"> - |unknown| - substitution. - <system_message backrefs="id2" id="id1" level="3" line="1" source="test data" type="ERROR"> - <paragraph> - Undefined substitution referenced: "unknown". -"""], -[u"""\ -Substitutions support case differences: - -.. |eacute| replace:: \u00E9 -.. |Eacute| replace:: \u00C9 - -|Eacute|\\t\\ |eacute|, and even |EACUTE|. -""", -u"""\ -<document source="test data"> - <paragraph> - Substitutions support case differences: - <substitution_definition name="eacute"> - \u00E9 - <substitution_definition name="Eacute"> - \u00C9 - <paragraph> - \u00C9 - t - \u00E9 - , and even \n\ - \u00C9 - . -"""], -]) - -totest['unicode'] = ((Substitutions,), [ -["""\ -Insert an em-dash (|mdash|), a copyright symbol (|copy|), a non-breaking -space (|nbsp|), a backwards-not-equals (|bne|), and a captial omega (|Omega|). - -.. |mdash| unicode:: 0x02014 -.. |copy| unicode:: \\u00A9 -.. |nbsp| unicode::   -.. |bne| unicode:: U0003D U020E5 -.. |Omega| unicode:: U+003A9 -""", -u"""\ -<document source="test data"> - <paragraph> - Insert an em-dash ( - \u2014 - ), a copyright symbol ( - \u00a9 - ), a non-breaking - space ( - \u00a0 - ), a backwards-not-equals ( - = - \u20e5 - ), and a captial omega ( - \u03a9 - ). - <substitution_definition name="mdash"> - \u2014 - <substitution_definition name="copy"> - \u00a9 - <substitution_definition name="nbsp"> - \u00a0 - <substitution_definition name="bne"> - = - \u20e5 - <substitution_definition name="Omega"> - \u03a9 -"""], -[""" -Testing comments and extra text. - -Copyright |copy| 2003, |BogusMegaCorp (TM)|. - -.. |copy| unicode:: 0xA9 .. copyright sign -.. |BogusMegaCorp (TM)| unicode:: BogusMegaCorp U+2122 - .. with trademark sign -""", -u"""\ -<document source="test data"> - <paragraph> - Testing comments and extra text. - <paragraph> - Copyright \n\ - \u00a9 - 2003, \n\ - BogusMegaCorp - \u2122 - . - <substitution_definition name="copy"> - \u00a9 - <substitution_definition name="BogusMegaCorp (TM)"> - BogusMegaCorp - \u2122 -"""], -]) - - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/test/test_utils.py b/docutils/test/test_utils.py deleted file mode 100755 index dc4297113..000000000 --- a/docutils/test/test_utils.py +++ /dev/null @@ -1,297 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Test module for utils.py. -""" - -import unittest -import StringIO -import sys -from DocutilsTestSupport import utils, nodes - - -class ReporterTests(unittest.TestCase): - - stream = StringIO.StringIO() - reporter = utils.Reporter('test data', 2, 4, stream, 1) - - def setUp(self): - self.stream.seek(0) - self.stream.truncate() - - def test_level0(self): - sw = self.reporter.system_message(0, 'debug output') - self.assertEquals(sw.pformat(), """\ -<system_message level="0" source="test data" type="DEBUG"> - <paragraph> - debug output -""") - self.assertEquals(self.stream.getvalue(), - 'test data:: (DEBUG/0) debug output\n') - - def test_level1(self): - sw = self.reporter.system_message(1, 'a little reminder') - self.assertEquals(sw.pformat(), """\ -<system_message level="1" source="test data" type="INFO"> - <paragraph> - a little reminder -""") - self.assertEquals(self.stream.getvalue(), '') - - def test_level2(self): - sw = self.reporter.system_message(2, 'a warning') - self.assertEquals(sw.pformat(), """\ -<system_message level="2" source="test data" type="WARNING"> - <paragraph> - a warning -""") - self.assertEquals(self.stream.getvalue(), - 'test data:: (WARNING/2) a warning\n') - - def test_level3(self): - sw = self.reporter.system_message(3, 'an error') - self.assertEquals(sw.pformat(), """\ -<system_message level="3" source="test data" type="ERROR"> - <paragraph> - an error -""") - self.assertEquals(self.stream.getvalue(), - 'test data:: (ERROR/3) an error\n') - - def test_level4(self): - self.assertRaises(utils.SystemMessage, self.reporter.system_message, 4, - 'a severe error, raises an exception') - self.assertEquals(self.stream.getvalue(), 'test data:: (SEVERE/4) ' - 'a severe error, raises an exception\n') - - -class QuietReporterTests(unittest.TestCase): - - stream = StringIO.StringIO() - reporter = utils.Reporter('test data', 5, 5, stream, 0) - - def setUp(self): - self.stream.seek(0) - self.stream.truncate() - - def test_debug(self): - sw = self.reporter.debug('a debug message') - self.assertEquals(sw.pformat(), """\ -<system_message level="0" source="test data" type="DEBUG"> - <paragraph> - a debug message -""") - self.assertEquals(self.stream.getvalue(), '') - - def test_info(self): - sw = self.reporter.info('an informational message') - self.assertEquals(sw.pformat(), """\ -<system_message level="1" source="test data" type="INFO"> - <paragraph> - an informational message -""") - self.assertEquals(self.stream.getvalue(), '') - - def test_warning(self): - sw = self.reporter.warning('a warning') - self.assertEquals(sw.pformat(), """\ -<system_message level="2" source="test data" type="WARNING"> - <paragraph> - a warning -""") - self.assertEquals(self.stream.getvalue(), '') - - def test_error(self): - sw = self.reporter.error('an error') - self.assertEquals(sw.pformat(), """\ -<system_message level="3" source="test data" type="ERROR"> - <paragraph> - an error -""") - self.assertEquals(self.stream.getvalue(), '') - - def test_severe(self): - sw = self.reporter.severe('a severe error') - self.assertEquals(sw.pformat(), """\ -<system_message level="4" source="test data" type="SEVERE"> - <paragraph> - a severe error -""") - self.assertEquals(self.stream.getvalue(), '') - - -class ReporterCategoryTests(unittest.TestCase): - - stream = StringIO.StringIO() - - def setUp(self): - self.stream.seek(0) - self.stream.truncate() - self.reporter = utils.Reporter('test data', 2, 4, self.stream, 1) - self.reporter.set_conditions('lemon', 1, 3, self.stream, 0) - - def test_getset(self): - self.reporter.set_conditions('test', 5, 5, None, 0) - self.assertEquals(self.reporter.get_conditions('other').astuple(), - (1, 2, 4, self.stream)) - self.assertEquals(self.reporter.get_conditions('test').astuple(), - (0, 5, 5, sys.stderr)) - self.assertEquals(self.reporter.get_conditions('test.dummy').astuple(), - (0, 5, 5, sys.stderr)) - self.reporter.set_conditions('test.dummy.spam', 1, 2, self.stream, 1) - self.assertEquals( - self.reporter.get_conditions('test.dummy.spam').astuple(), - (1, 1, 2, self.stream)) - self.assertEquals(self.reporter.get_conditions('test.dummy').astuple(), - (0, 5, 5, sys.stderr)) - self.assertEquals( - self.reporter.get_conditions('test.dummy.spam.eggs').astuple(), - (1, 1, 2, self.stream)) - self.reporter.unset_conditions('test.dummy.spam') - self.assertEquals( - self.reporter.get_conditions('test.dummy.spam.eggs').astuple(), - (0, 5, 5, sys.stderr)) - - def test_debug(self): - sw = self.reporter.debug('debug output', category='lemon.curry') - self.assertEquals(self.stream.getvalue(), '') - sw = self.reporter.debug('debug output') - self.assertEquals(self.stream.getvalue(), - 'test data:: (DEBUG/0) debug output\n') - - def test_info(self): - sw = self.reporter.info('some info') - self.assertEquals(self.stream.getvalue(), '') - sw = self.reporter.info('some info', category='lemon.curry') - self.assertEquals( - self.stream.getvalue(), - 'test data:: (INFO/1) some info [lemon.curry]\n') - - def test_warning(self): - sw = self.reporter.warning('a warning') - self.assertEquals(self.stream.getvalue(), - 'test data:: (WARNING/2) a warning\n') - sw = self.reporter.warning('a warning', category='lemon.curry') - self.assertEquals(self.stream.getvalue(), """\ -test data:: (WARNING/2) a warning -test data:: (WARNING/2) a warning [lemon.curry] -""") - - def test_error(self): - sw = self.reporter.error('an error') - self.assertEquals(self.stream.getvalue(), - 'test data:: (ERROR/3) an error\n') - self.assertRaises(utils.SystemMessage, self.reporter.error, - 'an error', category='lemon.curry') - self.assertEquals(self.stream.getvalue(), """\ -test data:: (ERROR/3) an error -test data:: (ERROR/3) an error [lemon.curry] -""") - - def test_severe(self): - self.assertRaises(utils.SystemMessage, self.reporter.severe, - 'a severe error') - self.assertEquals(self.stream.getvalue(), - 'test data:: (SEVERE/4) a severe error\n') - self.assertRaises(utils.SystemMessage, self.reporter.severe, - 'a severe error', category='lemon.curry') - self.assertEquals(self.stream.getvalue(), """\ -test data:: (SEVERE/4) a severe error -test data:: (SEVERE/4) a severe error [lemon.curry] -""") - - -class NameValueTests(unittest.TestCase): - - def test_extract_name_value(self): - self.assertRaises(utils.NameValueError, utils.extract_name_value, - 'hello') - self.assertRaises(utils.NameValueError, utils.extract_name_value, - 'hello') - self.assertRaises(utils.NameValueError, utils.extract_name_value, - '=hello') - self.assertRaises(utils.NameValueError, utils.extract_name_value, - 'hello=') - self.assertRaises(utils.NameValueError, utils.extract_name_value, - 'hello="') - self.assertRaises(utils.NameValueError, utils.extract_name_value, - 'hello="something') - self.assertRaises(utils.NameValueError, utils.extract_name_value, - 'hello="something"else') - output = utils.extract_name_value( - """att1=val1 att2=val2 att3="value number '3'" att4=val4""") - self.assertEquals(output, [('att1', 'val1'), ('att2', 'val2'), - ('att3', "value number '3'"), - ('att4', 'val4')]) - - -class ExtensionOptionTests(unittest.TestCase): - - optionspec = {'a': int, 'bbb': float, 'cdef': (lambda x: x), - 'empty': (lambda x: x)} - - def test_assemble_option_dict(self): - input = utils.extract_name_value('a=1 bbb=2.0 cdef=hol%s' % chr(224)) - self.assertEquals( - utils.assemble_option_dict(input, self.optionspec), - {'a': 1, 'bbb': 2.0, 'cdef': ('hol%s' % chr(224))}) - input = utils.extract_name_value('a=1 b=2.0 c=hol%s' % chr(224)) - self.assertRaises(KeyError, utils.assemble_option_dict, - input, self.optionspec) - input = utils.extract_name_value('a=1 bbb=two cdef=hol%s' % chr(224)) - self.assertRaises(ValueError, utils.assemble_option_dict, - input, self.optionspec) - - def test_extract_extension_options(self): - field_list = nodes.field_list() - field_list += nodes.field( - '', nodes.field_name('', 'a'), - nodes.field_body('', nodes.paragraph('', '1'))) - field_list += nodes.field( - '', nodes.field_name('', 'bbb'), - nodes.field_body('', nodes.paragraph('', '2.0'))) - field_list += nodes.field( - '', nodes.field_name('', 'cdef'), - nodes.field_body('', nodes.paragraph('', 'hol%s' % chr(224)))) - field_list += nodes.field( - '', nodes.field_name('', 'empty'), nodes.field_body()) - self.assertEquals( - utils.extract_extension_options(field_list, self.optionspec), - {'a': 1, 'bbb': 2.0, 'cdef': ('hol%s' % chr(224)), - 'empty': None}) - self.assertRaises(KeyError, utils.extract_extension_options, - field_list, {}) - field_list += nodes.field( - '', nodes.field_name('', 'cdef'), - nodes.field_body('', nodes.paragraph('', 'one'), - nodes.paragraph('', 'two'))) - self.assertRaises(utils.BadOptionDataError, - utils.extract_extension_options, - field_list, self.optionspec) - field_list[-1] = nodes.field( - '', nodes.field_name('', 'cdef bad'), - nodes.field_body('', nodes.paragraph('', 'no arguments'))) - self.assertRaises(utils.BadOptionError, - utils.extract_extension_options, - field_list, self.optionspec) - field_list[-1] = nodes.field( - '', nodes.field_name('', 'cdef'), - nodes.field_body('', nodes.paragraph('', 'duplicate'))) - self.assertRaises(utils.DuplicateOptionError, - utils.extract_extension_options, - field_list, self.optionspec) - field_list[-2] = nodes.field( - '', nodes.field_name('', 'unkown'), - nodes.field_body('', nodes.paragraph('', 'unknown'))) - self.assertRaises(KeyError, utils.extract_extension_options, - field_list, self.optionspec) - - -if __name__ == '__main__': - unittest.main() diff --git a/docutils/test/test_viewlist.py b/docutils/test/test_viewlist.py deleted file mode 100644 index 3ddf1fcf1..000000000 --- a/docutils/test/test_viewlist.py +++ /dev/null @@ -1,166 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Test module for the ViewList class from statemachine.py. -""" - -import unittest -import sys -import re -from DocutilsTestSupport import statemachine - - -class ViewListTests(unittest.TestCase): - - a_list = list('abcdefg') - b_list = list('AEIOU') - c_list = list('XYZ') - - def setUp(self): - self.a = statemachine.ViewList(self.a_list, 'a') - self.b = statemachine.ViewList(self.b_list, 'b') - self.c = statemachine.ViewList(self.c_list, 'c') - - def test_lists(self): - self.assertEqual(self.a, self.a_list) - self.assertEqual(str(self.a), str(self.a_list)) - self.assertEqual(self.b, self.b_list) - self.assertEqual(self.c, self.c_list) - self.assertEqual(self.a.items, - zip('a' * len(self.a_list), range(len(self.a_list)))) - - def test_get_slice(self): - a = self.a[1:-1] - a_list = self.a_list[1:-1] - self.assertEqual(a, a_list) - self.assertEqual(a.items, - zip('a' * len(a_list), range(1, len(a_list) + 1))) - self.assertEqual(a.parent, self.a) - - def test_set_slice(self): - a = statemachine.ViewList(self.a[:]) - s = a[2:-2] - s[2:2] = self.b - s_list = self.a_list[2:-2] - s_list[2:2] = self.b_list - self.assertEqual(s, s_list) - self.assertEqual(s, a[2:-2]) - self.assertEqual(s.items, a[2:-2].items) - - def test_del_slice(self): - a = statemachine.ViewList(self.a[:]) - s = a[2:] - s_list = self.a_list[2:] - del s[3:5] - del s_list[3:5] - self.assertEqual(s, s_list) - self.assertEqual(s, a[2:]) - self.assertEqual(s.items, a[2:].items) - - def test_insert(self): - a_list = self.a_list[:] - a_list.insert(2, 'Q') - a_list[4:4] = self.b_list - a = self.a[:] - self.assert_(isinstance(a, statemachine.ViewList)) - a.insert(2, 'Q', 'runtime') - a.insert(4, self.b) - self.assertEqual(a, a_list) - self.assertEqual(a.info(2), ('runtime', 0)) - self.assertEqual(a.info(5), ('b', 1)) - - def test_append(self): - a_list = self.a_list[:] - a_list.append('Q') - a_list.extend(self.b_list) - a = statemachine.ViewList(self.a) - a.append('Q', 'runtime') - a.append(self.b) - self.assertEqual(a, a_list) - self.assertEqual(a.info(len(self.a)), ('runtime', 0)) - self.assertEqual(a.info(-2), ('b', len(self.b) - 2)) - - def test_extend(self): - a_list = self.a_list[:] - a_list.extend(self.b_list) - a = statemachine.ViewList(self.a) - a.extend(self.b) - self.assertEqual(a, a_list) - self.assertEqual(a.info(len(self.a) + 1), ('b', 1)) - - def test_view(self): - a = statemachine.ViewList(self.a[:]) - a.insert(4, self.b) - s = a[2:-2] - s.insert(5, self.c) - self.assertEqual(s, a[2:-2]) - self.assertEqual(s.items, a[2:-2].items) - s.pop() - self.assertEqual(s, a[2:-2]) - self.assertEqual(s.items, a[2:-2].items) - s.remove('X') - self.assertEqual(s, a[2:-2]) - self.assertEqual(s.items, a[2:-2].items) - - def test_trim(self): - a = statemachine.ViewList(self.a[:]) - s = a[1:-1] - s.trim_start(1) - self.assertEquals(a, self.a) - self.assertEquals(s, a[2:-1]) - s.trim_end(1) - self.assertEquals(a, self.a) - self.assertEquals(s, a[2:-2]) - - -# print -# print a -# print s -# print a.items -# print s.items - - -class StringList(unittest.TestCase): - - text = """\ -This is some -example text. - - Here is some - indented text. - -Unindented text. -""" - - indented_string = """\ - a - literal - block""" - - - def setUp(self): - self.a_list = self.text.splitlines(1) - self.a = statemachine.StringList(self.a_list, 'a') - - def test_strip_indent(self): - s = self.a[3:5] - s.strip_indent(4) - self.assertEqual(s, [line.lstrip() for line in self.a_list[3:5]]) - - def test_get_indented(self): - self.assertEquals(self.a.get_indented(), - ([], 0, 0)) - block = statemachine.StringList( - statemachine.string2lines(self.indented_string)) - self.assertEquals(block.get_indented(), - ([s[6:] for s in block], 6, 1)) - - -if __name__ == '__main__': - unittest.main() diff --git a/docutils/test/test_writers/__init__.py b/docutils/test/test_writers/__init__.py deleted file mode 100644 index 2fe79c55c..000000000 --- a/docutils/test/test_writers/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -import os -import os.path -import sys - -sys.path.insert(0, os.path.abspath(os.curdir)) -prev = '' -while sys.path[0] != prev: - try: - import DocutilsTestSupport - break - except ImportError: - prev = sys.path[0] - sys.path[0] = os.path.dirname(prev) -sys.path.pop(0) diff --git a/docutils/test/test_writers/test_latex2e.py b/docutils/test/test_writers/test_latex2e.py deleted file mode 100644 index 75a013fe6..000000000 --- a/docutils/test/test_writers/test_latex2e.py +++ /dev/null @@ -1,255 +0,0 @@ -#! /usr/bin/env python - -# Author: engelbert gruber -# Contact: grubert@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Tests for latex2e writer. -""" - -from __init__ import DocutilsTestSupport - -def suite(): - s = DocutilsTestSupport.LatexPublishTestSuite() - s.generateTests(totest) - return s - - -latex_head = """\ -\\documentclass[10pt,english]{article} -\\usepackage{babel} -\\usepackage{shortvrb} -\\usepackage[latin1]{inputenc} -\\usepackage{tabularx} -\\usepackage{longtable} -\\setlength{\\extrarowheight}{2pt} -\\usepackage{amsmath} -\\usepackage{graphicx} -\\usepackage{color} -\\usepackage{multirow} -\\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref} -\\usepackage[a4paper,margin=2cm,nohead]{geometry} -%% generator Docutils: http://docutils.sourceforge.net/ -\\newlength{\\admonitionwidth} -\\setlength{\\admonitionwidth}{0.9\\textwidth} -\\newlength{\\docinfowidth} -\\setlength{\\docinfowidth}{0.9\\textwidth} -\\newcommand{\\optionlistlabel}[1]{\\bf #1 \\hfill} -\\newenvironment{optionlist}[1] -{\\begin{list}{} - {\\setlength{\\labelwidth}{#1} - \\setlength{\\rightmargin}{1cm} - \\setlength{\\leftmargin}{\\rightmargin} - \\addtolength{\\leftmargin}{\\labelwidth} - \\addtolength{\\leftmargin}{\\labelsep} - \\renewcommand{\\makelabel}{\\optionlistlabel}} -}{\\end{list}} -% begin: floats for footnotes tweaking. -\\setlength{\\floatsep}{0.5em} -\\setlength{\\textfloatsep}{\\fill} -\\addtolength{\\textfloatsep}{3em} -\\renewcommand{\\textfraction}{0.5} -\\renewcommand{\\topfraction}{0.5} -\\renewcommand{\\bottomfraction}{0.5} -\\setcounter{totalnumber}{50} -\\setcounter{topnumber}{50} -\\setcounter{bottomnumber}{50} -% end floats for footnotes -% some commands, that could be overwritten in the style file. -\\newcommand{\\rubric}[1]{\\subsection*{~\\hfill {\\it #1} \\hfill ~}} -% end of "some commands" -\\input{style.tex} -""" - -totest = {} - -totest['table_of_contents'] = [ -# input -["""\ -.. contents:: Table of Contents - -Title 1 -======= -Paragraph 1. - -Title 2 -------- -Paragraph 2. -""", -# expected output -latex_head + """\ -\\title{Title 1} -\\author{} -\\date{} -\\hypersetup{\npdftitle={Title 1} -} -\\raggedbottom -\\begin{document} -\\maketitle - -\\hypertarget{table-of-contents}{}\\subsection*{~\\hfill Table of Contents\\hfill ~} -\\pdfbookmark[0]{Table of Contents}{table-of-contents} -\\begin{list}{}{} -\\item \\href{#title-2}{Title 2} - -\\end{list} - - -Paragraph 1. - - -%___________________________________________________________________________ - -\\hypertarget{title-2}{} -\\section*{Title 2} -\\pdfbookmark[0]{Title 2}{title-2} - -Paragraph 2. - -\\end{document} -"""], - -] - - -totest['enumerated_lists'] = [ -# input -["""\ -1. Item 1. -2. Second to the previous item this one will explain - - a) nothing. - b) or some other. - -3. Third is - - (I) having pre and postfixes - (II) in roman numerals. -""", -# expected output -latex_head + """\ -\\title{} -\\author{} -\\date{} -\\raggedbottom -\\begin{document} -\\maketitle - -\\newcounter{listcnt1} -\\begin{list}{\\arabic{listcnt1}.} -{ -\\usecounter{listcnt1} -\\setlength{\\rightmargin}{\\leftmargin} -} -\\item -Item 1. - -\\item -Second to the previous item this one will explain - -\\end{list} -\\begin{quote} -\\newcounter{listcnt2} -\\begin{list}{\\alph{listcnt2})} -{ -\\usecounter{listcnt2} -\\setlength{\\rightmargin}{\\leftmargin} -} -\\item -nothing. - -\\item -or some other. - -\\end{list} -\\end{quote} -\\newcounter{listcnt3} -\\begin{list}{\\arabic{listcnt3}.} -{ -\\usecounter{listcnt3} -\\addtocounter{listcnt3}{2} -\\setlength{\\rightmargin}{\\leftmargin} -} -\\item -Third is - -\\end{list} -\\begin{quote} -\\newcounter{listcnt4} -\\begin{list}{(\\Roman{listcnt4})} -{ -\\usecounter{listcnt4} -\\setlength{\\rightmargin}{\\leftmargin} -} -\\item -having pre and postfixes - -\\item -in roman numerals. - -\\end{list} -\\end{quote} - -\\end{document} -"""], -] - -# BUG: need to test for quote replacing if language is de (ngerman). - -totest['quote_mangling'] = [ -# input -["""\ -Depending on language quotes are converted for latex. -Expecting "en" here. - -Inside literal blocks quotes should be left untouched -(use only two quotes in test code makes life easier for -the python interpreter running the test):: - - "" - This is left "untouched" also *this*. - "" - -.. parsed-literal:: - - should get "quotes" and *italics*. - - -Inline ``literal "quotes"`` should be kept. -""", -latex_head + """\ -\\title{} -\\author{} -\\date{} -\\raggedbottom -\\begin{document} -\\maketitle - - -Depending on language quotes are converted for latex. -Expecting ``en'' here. - -Inside literal blocks quotes should be left untouched -(use only two quotes in test code makes life easier for -the python interpreter running the test): -\\begin{ttfamily}\\begin{flushleft} -\\mbox{""}\\\\ -\\mbox{This~is~left~"untouched"~also~*this*.}\\\\ -\\mbox{""} -\\end{flushleft}\\end{ttfamily} -\\begin{ttfamily}\\begin{flushleft} -\\mbox{should~get~"quotes"~and~\\emph{italics}.} -\\end{flushleft}\\end{ttfamily} - -Inline \\texttt{literal "quotes"} should be kept. - -\\end{document} -"""], -] - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest='suite') diff --git a/docutils/tools/buildhtml.py b/docutils/tools/buildhtml.py deleted file mode 100755 index dfba99945..000000000 --- a/docutils/tools/buildhtml.py +++ /dev/null @@ -1,227 +0,0 @@ -#!/usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Generates .html from all the .txt files in a directory. - -Ordinary .txt files are understood to be standalone reStructuredText. -Files named ``pep-*.txt`` are interpreted as PEPs (either old-style or -new reStructuredText PEPs). -""" -# Once PySource is here, build .html from .py as well. - -__docformat__ = 'reStructuredText' - - -import locale -try: - locale.setlocale(locale.LC_ALL, '') -except: - pass - -import sys -import os -import os.path -import copy -import docutils -from docutils import ApplicationError -from docutils import core, frontend -from docutils.parsers import rst -from docutils.readers import standalone, pep -from docutils.writers import html4css1, pep_html - - -usage = '%prog [options] [<directory> ...]' -description = ('Generates .html from all the .txt files (including PEPs) ' - 'in each <directory> (default is the current directory).') - - -class SettingsSpec(docutils.SettingsSpec): - - """ - Runtime settings & command-line options for the front end. - """ - - # Can't be included in OptionParser below because we don't want to - # override the base class. - settings_spec = ( - 'Build-HTML Options', - None, - (('Recursively scan subdirectories for files to process. This is ' - 'the default.', - ['--recurse'], {'action': 'store_true', 'default': 1}), - ('Do not scan subdirectories for files to process.', - ['--local'], {'dest': 'recurse', 'action': 'store_false'}), - ('Work silently (no progress messages). Independent of "--quiet".', - ['--silent'], {'action': 'store_true'}),)) - - -class OptionParser(frontend.OptionParser): - - """ - Command-line option processing for the ``buildhtml.py`` front end. - """ - - def check_values(self, values, args): - frontend.OptionParser.check_values(self, values, args) - values._source = None - return values - - def check_args(self, args): - source = destination = None - if args: - self.values._directories = args - else: - self.values._directories = [os.getcwd()] - return source, destination - - -class Struct: - - """Stores data attributes for dotted-attribute access.""" - - def __init__(self, **keywordargs): - self.__dict__.update(keywordargs) - - -class Builder: - - def __init__(self): - self.publishers = { - '': Struct(components=(SettingsSpec, pep.Reader, rst.Parser, - pep_html.Writer)), - '.txt': Struct(components=(rst.Parser, standalone.Reader, - html4css1.Writer)), - 'PEPs': Struct(components=(rst.Parser, pep.Reader, - pep_html.Writer))} - """Publisher-specific settings. Key '' is for the front-end script - itself. ``self.publishers[''].components`` must contain a superset of - all components used by individual publishers.""" - - self.setup_publishers() - - def setup_publishers(self): - """ - Manage configurations for individual publishers. - - Each publisher (combination of parser, reader, and writer) may have - its own configuration defaults, which must be kept separate from those - of the other publishers. Setting defaults are combined with the - config file settings and command-line options by - `self.get_settings()`. - """ - for name, publisher in self.publishers.items(): - option_parser = OptionParser( - components=publisher.components, - usage=usage, description=description) - publisher.option_parser = option_parser - publisher.setting_defaults = option_parser.get_default_values() - frontend.make_paths_absolute(publisher.setting_defaults.__dict__, - option_parser.relative_path_settings) - config_parser = frontend.ConfigParser() - config_parser.read_standard_files(option_parser) - self.config_settings = config_parser.get_section('options') - frontend.make_paths_absolute( - self.config_settings, - self.publishers[''].option_parser.relative_path_settings) - self.settings_spec = self.publishers[''].option_parser.parse_args( - values=frontend.Values()) # no defaults; just the cmdline opts - self.initial_settings = self.get_settings('') - - def get_settings(self, publisher_name, directory=None): - """ - Return a settings object, from multiple sources. - - Copy the setting defaults, overlay the startup config file settings, - then the local config file settings, then the command-line options. - Assumes the current directory has been set. - """ - publisher = self.publishers[publisher_name] - settings = copy.deepcopy(publisher.setting_defaults) - settings.__dict__.update(self.config_settings) - if directory: - config_parser = frontend.ConfigParser() - config_parser.read(os.path.join(directory, 'docutils.conf'), - publisher.option_parser) - local_config = config_parser.get_section('options') - frontend.make_paths_absolute( - local_config, publisher.option_parser.relative_path_settings, - directory) - settings.__dict__.update(local_config) - settings.__dict__.update(self.settings_spec.__dict__) - return settings - - def run(self, directory=None, recurse=1): - recurse = recurse and self.initial_settings.recurse - if directory: - self.directories = [directory] - elif self.settings_spec._directories: - self.directories = self.settings_spec._directories - else: - self.directories = [os.getcwd()] - for directory in self.directories: - os.path.walk(directory, self.visit, recurse) - - def visit(self, recurse, directory, names): - if not self.initial_settings.silent: - print >>sys.stderr, '/// Processing directory:', directory - sys.stderr.flush() - peps_found = 0 - for name in names: - if name.endswith('.txt'): - if name.startswith('pep-'): - peps_found = 1 - else: - self.process_txt(directory, name) - if peps_found: - self.process_peps(directory) - if not recurse: - del names[:] - - def process_txt(self, directory, name): - settings = self.get_settings('.txt', directory) - settings._source = os.path.normpath(os.path.join(directory, name)) - settings._destination = settings._source[:-4]+'.html' - if not self.initial_settings.silent: - print >>sys.stderr, ' ::: Processing .txt:', name - sys.stderr.flush() - try: - core.publish_file(source_path=settings._source, - destination_path=settings._destination, - reader_name='standalone', - parser_name='restructuredtext', - writer_name='html', - settings=settings) - except ApplicationError, error: - print >>sys.stderr, (' Error (%s): %s' - % (error.__class__.__name__, error)) - - def process_peps(self, directory): - # only import PEP module/script if we need it. - import pep2html - - settings = self.get_settings('PEPs', directory) - old_directory = os.getcwd() - os.chdir(directory) - if self.initial_settings.silent: - argv = ['-q'] - else: - print >>sys.stderr, ' ::: Processing PEPs:' - sys.stderr.flush() - argv = [] - pep2html.docutils_settings = settings - try: - pep2html.main(argv) - except Exception, error: - print >>sys.stderr, (' Error (%s): %s' - % (error.__class__.__name__, error)) - os.chdir(old_directory) - - -if __name__ == "__main__": - Builder().run() diff --git a/docutils/tools/docutils-xml.py b/docutils/tools/docutils-xml.py deleted file mode 100755 index 42c879cc8..000000000 --- a/docutils/tools/docutils-xml.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -A minimal front end to the Docutils Publisher, producing Docutils XML. -""" - -import locale -try: - locale.setlocale(locale.LC_ALL, '') -except: - pass - -from docutils.core import publish_cmdline, default_description - - -description = ('Generates Docutils-native XML from standalone ' - 'reStructuredText sources. ' + default_description) - -publish_cmdline(writer_name='xml', description=description) diff --git a/docutils/tools/docutils.conf b/docutils/tools/docutils.conf deleted file mode 100644 index 63d8f4f5b..000000000 --- a/docutils/tools/docutils.conf +++ /dev/null @@ -1,15 +0,0 @@ -[options] - -# These entries affect all processing: -source-link: 1 -datestamp: %Y-%m-%d %H:%M UTC -generator: 1 - -# These entries affect HTML output: -stylesheet-path: stylesheets/default.css - -# These entries affect reStructuredText-style PEPs: -pep-template: pep-html-template -pep-stylesheet-path: stylesheets/pep.css -python-home: http://www.python.org -no-random: 1 diff --git a/docutils/tools/editors/README.txt b/docutils/tools/editors/README.txt deleted file mode 100644 index 8e489f447..000000000 --- a/docutils/tools/editors/README.txt +++ /dev/null @@ -1,12 +0,0 @@ -====================================== - Editor Support for reStructuredText_ -====================================== - -:Date: $Date$ - -The files in this directory contain support code for reStructuredText -editing for the following editors: - -* `Emacs <emacs>`__ - -.. _reStructuredText: http://docutils.sf.net/rst.html diff --git a/docutils/tools/editors/emacs/restructuredtext.el b/docutils/tools/editors/emacs/restructuredtext.el deleted file mode 100644 index 15cd4054e..000000000 --- a/docutils/tools/editors/emacs/restructuredtext.el +++ /dev/null @@ -1,149 +0,0 @@ -;; Authors: David Goodger <goodger@python.org>; -;; Martin Blais -;; Date: $Date$ -;; Copyright: This module has been placed in the public domain. -;; -;; Support code for editing reStructuredText with Emacs indented-text mode. -;; The goal is to create an integrated reStructuredText editing mode. -;; -;; Updates -;; ------- -;; -;; 2003-02-25 (blais): updated repeat-last-character function and added -;; a few routines for navigating between titles. - -(defun replace-lines (fromchar tochar) - ;; by David Goodger - "Replace flush-left lines, consisting of multiple FROMCHAR characters, -with equal-length lines of TOCHAR." - (interactive "\ -cSearch for flush-left lines of char: -cand replace with char: ") - (save-excursion - (let* ((fromstr (string fromchar)) - (searchre (concat "^" (regexp-quote fromstr) "+ *$")) - (found 0)) - (condition-case err - (while t - (search-forward-regexp searchre) - (setq found (1+ found)) - (search-backward fromstr) ;; point will be *before* last char - (setq p (1+ (point))) - (beginning-of-line) - (setq l (- p (point))) - (kill-line) - (insert-char tochar l)) - (search-failed - (message (format "%d lines replaced." found))))))) - -(defun repeat-last-character () - ;; by Martin Blais - "Fills the current line up to the length of the preceding line (if not empty), -using the last character on the current line. If the preceding line is empty, -or if a prefix argument is provided, fill up to the fill-column. - -If the current line is longer than the desired length, shave the characters off -the current line to fit the desired length. - -As an added convenience, if the command is repeated immediately, the alternative -behaviour is performed." - -;; TODO -;; ---- -;; It would be useful if only these characters were repeated: -;; =-`:.'"~^_*+#<>!$%&(),/;?@[\]{|} -;; Especially, empty lines shouldn't be repeated. - - (interactive) - (let* ((curcol (current-column)) - (curline (+ (count-lines (point-min) (point)) (if (eq curcol 0) 1 0))) - (lbp (line-beginning-position 0)) - (prevcol (if (= curline 1) - fill-column - (save-excursion - (forward-line -1) - (end-of-line) - (skip-chars-backward " \t" lbp) - (let ((cc (current-column))) - (if (= cc 0) fill-column cc))))) - (rightmost-column - (cond (current-prefix-arg fill-column) - ((equal last-command 'repeat-last-character) - (if (= curcol fill-column) prevcol fill-column)) - (t (save-excursion - (if (= prevcol 0) fill-column prevcol))) )) ) - (end-of-line) - (if (> (current-column) rightmost-column) - ;; shave characters off the end - (delete-region (- (point) - (- (current-column) rightmost-column)) - (point)) - ;; fill with last characters - (insert-char (preceding-char) - (- rightmost-column (current-column)))) )) - -(defun reST-title-char-p (c) - ;; by Martin Blais - "Returns true if the given character is a valid title char." - (and (string-match "[-=`:\\.'\"~^_*+#<>!$%&(),/;?@\\\|]" - (char-to-string c)) t)) - -(defun reST-forward-title () - ;; by Martin Blais - "Skip to the next restructured text section title." - (interactive) - (let* ( (newpoint - (save-excursion - (forward-char) ;; in case we're right on a title - (while - (not - (and (re-search-forward "^[A-Za-z0-9].*[ \t]*$" nil t) - (reST-title-char-p (char-after (+ (point) 1))) - (looking-at (format "\n%c\\{%d,\\}[ \t]*$" - (char-after (+ (point) 1)) - (current-column)))))) - (beginning-of-line) - (point))) ) - (if newpoint (goto-char newpoint)) )) - -(defun reST-backward-title () - ;; by Martin Blais - "Skip to the previous restructured text section title." - (interactive) - (let* ( (newpoint - (save-excursion - ;;(forward-char) ;; in case we're right on a title - (while - (not - (and (or (backward-char) t) - (re-search-backward "^[A-Za-z0-9].*[ \t]*$" nil t) - (or (end-of-line) t) - (reST-title-char-p (char-after (+ (point) 1))) - (looking-at (format "\n%c\\{%d,\\}[ \t]*$" - (char-after (+ (point) 1)) - (current-column)))))) - (beginning-of-line) - (point))) ) - (if newpoint (goto-char newpoint)) )) - -(defun join-paragraph () - ;; by David Goodger - "Join lines in current paragraph into one line, removing end-of-lines." - (interactive) - (save-excursion - (backward-paragraph 1) - (forward-char 1) - (let ((start (point))) ; remember where we are - (forward-paragraph 1) ; go to the end of the paragraph - (beginning-of-line 0) ; go to the beginning of the previous line - (while (< start (point)) ; as long as we haven't passed where we started - (delete-indentation) ; join this line to the line before - (beginning-of-line))))) ; and go back to the beginning of the line - -(defun force-fill-paragraph () - ;; by David Goodger - "Fill paragraph at point, first joining the paragraph's lines into one. -This is useful for filling list item paragraphs." - (interactive) - (join-paragraph) - (fill-paragraph nil)) diff --git a/docutils/tools/editors/emacs/rst-html.el b/docutils/tools/editors/emacs/rst-html.el deleted file mode 100644 index c9ebf33ef..000000000 --- a/docutils/tools/editors/emacs/rst-html.el +++ /dev/null @@ -1,129 +0,0 @@ -;;; rst-mode.el --- Goodies to automate converting reST documents to HTML. - -;; Copyright 2003 Martin Blais <blais@iro.umontreal.ca> -;; -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2 of the License, or -;; (at your option) any later version. -;; -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. -;; -;; You should have received a copy of the GNU General Public License -;; along with this program; if not, write to the Free Software -;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -;;; Commentary: - -;; This package provides a few functions and variables that can help in -;; automating converting reST documents to HTML from within emacs. You could -;; use a makefile to do this, of use the compile command that this package -;; provides. - -;; You can also bind a command to automate converting to HTML: -;; (defun user-rst-mode-hook () -;; (local-set-key [(control c)(?9)] 'rst-html-compile)) -;; (add-hook 'rst-mode-hook 'user-rst-mode-hook) - -;;; Code: - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; Customization: - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defgroup rst-html nil - "Settings for conversion to HTML available by \\[rst-html-compile]. Use of -this functionality is discouraged. Get a proper `Makefile' instead." - :group 'rst - :version "21.1") - -(defcustom rst-html-command "docutils-html" - "Command to convert an reST file to HTML." - :group 'rst-html - :type '(string)) - -(defcustom rst-html-stylesheet "" - "Stylesheet for reST to HTML conversion. Empty for no special stylesheet." - :group 'rst-html - :type '(string)) - -(defcustom rst-html-options "" - "Local file options for reST to HTML conversion. -Stylesheets are set by an own option." - :group 'rst-html - :type '(string)) - -(defcustom rst-html-extension ".html" - "Extension for HTML output file." - :group 'rst-html - :type '(string)) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Conversion to HTML - -(defun rst-html-compile () - "Compile command to convert reST document into HTML." - (interactive) - (let* ((bufname (file-name-nondirectory buffer-file-name)) - (outname (file-name-sans-extension bufname)) - (ssheet - (or (and (not (zerop (length rst-html-stylesheet))) - (concat "--stylesheet=\"" rst-html-stylesheet "\"")) - ""))) - (set (make-local-variable 'compile-command) - (mapconcat 'identity - (list rst-html-command - ssheet rst-html-options - bufname (concat outname rst-html-extension)) - " ")) - (if (or compilation-read-command current-prefix-arg) - (call-interactively 'compile) - (compile compile-command)) - )) - -(defun rst-html-compile-with-conf () - "Compile command to convert reST document into HTML. Attempts to find -configuration file, if it can, overrides the options." - (interactive) - (let ((conffile (rst-html-find-conf))) - (if conffile - (let* ((bufname (file-name-nondirectory buffer-file-name)) - (outname (file-name-sans-extension bufname))) - (set (make-local-variable 'compile-command) - (mapconcat 'identity - (list rst-html-command - (concat "--config=\"" conffile "\"") - bufname (concat outname rst-html-extension)) - " ")) - (if (or compilation-read-command current-prefix-arg) - (call-interactively 'compile) - (compile compile-command))) - (call-interactively 'rst-html-compile) - ))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Find the configuration file in the parents. - -(defun rst-html-find-conf () - "Look for the configuration file in the parents of the current path." - (interactive) - (let ((file-name "docutils.conf") - (buffer-file (buffer-file-name))) - ;; Move up in the dir hierarchy till we find a change log file. - (let ((dir (file-name-directory buffer-file))) - (while (and (or (not (string= "/" dir)) (setq dir nil) nil) - (not (file-exists-p (concat dir file-name)))) - ;; Move up to the parent dir and try again. - (setq dir (expand-file-name (file-name-directory - (directory-file-name - (file-name-directory dir))))) ) - (or (and dir (concat dir file-name)) nil) - ))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;;; rst-mode.el ends here diff --git a/docutils/tools/editors/emacs/rst-mode.el b/docutils/tools/editors/emacs/rst-mode.el deleted file mode 100644 index 3f81da39c..000000000 --- a/docutils/tools/editors/emacs/rst-mode.el +++ /dev/null @@ -1,696 +0,0 @@ -;;; rst-mode.el --- Mode for viewing and editing reStructuredText-documents. - -;; Copyright 2003 Stefan Merten <smerten@oekonux.de> -;; -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2 of the License, or -;; (at your option) any later version. -;; -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. -;; -;; You should have received a copy of the GNU General Public License -;; along with this program; if not, write to the Free Software -;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -;;; Commentary: - -;; This package provides support for documents marked up using the -;; reStructuredText format -;; [http://docutils.sourceforge.net/spec/rst/reStructuredText.html]. Support -;; includes font locking as well as some convenience functions for editing. - -;; The package is based on `text-mode' and inherits some things from it. -;; Particularly `text-mode-hook' is run before `rst-mode-hook'. - -;; Add the following lines to your `.emacs' file: -;; -;; (autoload 'rst-mode "rst-mode" "mode for editing reStructuredText documents" t) -;; (setq auto-mode-alist -;; (append '(("\\.rst$" . rst-mode) -;; ("\\.rest$" . rst-mode)) auto-mode-alist)) -;; -;; If you are using `.txt' as a standard extension for reST files as -;; http://docutils.sourceforge.net/FAQ.html#what-s-the-standard-filename-extension-for-a-restructuredtext-file -;; suggests you may use one of the `Local Variables in Files' mechanism Emacs -;; provides to set the major mode automatically. For instance you may use -;; -;; .. -*- mode: rst -*- -;; -;; in the very first line of your file. However, because this is a major -;; security breach you or your administrator may have chosen to switch that -;; feature off. See `Local Variables in Files' in the Emacs documentation for a -;; more complete discussion. - -;;; Code: - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; Customization: - -(defgroup rst nil "Support for reStructuredText documents" - :group 'wp - :version "21.1" - :link '(url-link "http://docutils.sourceforge.net/spec/rst/reStructuredText.html")) - -(defcustom rst-mode-hook nil - "Hook run when Rst Mode is turned on. The hook for Text Mode is run before - this one." - :group 'rst - :type '(hook)) - -(defcustom rst-mode-lazy t - "*If non-nil Rst Mode font-locks comment, literal blocks, and section titles -correctly. Because this is really slow it switches on Lazy Lock Mode -automatically. You may increase Lazy Lock Defer Time for reasonable results. - -If nil comments and literal blocks are font-locked only on the line they start. - -The value of this variable is used when Rst Mode is turned on." - :group 'rst - :type '(boolean)) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defgroup rst-faces nil "Faces used in Rst Mode" - :group 'rst - :group 'faces - :version "21.1") - -(defcustom rst-block-face 'font-lock-keyword-face - "All syntax marking up a special block" - :group 'rst-faces - :type '(face)) - -(defcustom rst-external-face 'font-lock-type-face - "Field names and interpreted text" - :group 'rst-faces - :type '(face)) - -(defcustom rst-definition-face 'font-lock-function-name-face - "All other defining constructs" - :group 'rst-faces - :type '(face)) - -(defcustom rst-directive-face - ;; XEmacs compatibility - (if (boundp 'font-lock-builtin-face) - 'font-lock-builtin-face - 'font-lock-preprocessor-face) - "Directives and roles" - :group 'rst-faces - :type '(face)) - -(defcustom rst-comment-face 'font-lock-comment-face - "Comments" - :group 'rst-faces - :type '(face)) - -(defcustom rst-emphasis1-face - ;; XEmacs compatibility - (if (facep 'italic) - ''italic - 'italic) - "Simple emphasis" - :group 'rst-faces - :type '(face)) - -(defcustom rst-emphasis2-face - ;; XEmacs compatibility - (if (facep 'bold) - ''bold - 'bold) - "Double emphasis" - :group 'rst-faces - :type '(face)) - -(defcustom rst-literal-face 'font-lock-string-face - "Literal text" - :group 'rst-faces - :type '(face)) - -(defcustom rst-reference-face 'font-lock-variable-name-face - "References to a definition" - :group 'rst-faces - :type '(face)) - -;; Faces for displaying items on several levels; these definitions define -;; different shades of grey where the lightest one is used for level 1 -(defconst rst-level-face-max 6 - "Maximum depth of level faces defined") -(defconst rst-level-face-base-color "grey" - "The base color to be used for creating level faces") -(defconst rst-level-face-base-light 85 - "The lightness factor for the base color") -(defconst rst-level-face-format-light "%2d" - "The format for the lightness factor for the base color") -(defconst rst-level-face-step-light -7 - "The step width to use for next color") - -;; Define the faces -(let ((i 1)) - (while (<= i rst-level-face-max) - (let ((sym (intern (format "rst-level-%d-face" i))) - (doc (format "Face for showing section title text at level %d" i)) - (col (format (concat "%s" rst-level-face-format-light) - rst-level-face-base-color - (+ (* (1- i) rst-level-face-step-light) - rst-level-face-base-light)))) - (make-empty-face sym) - (set-face-doc-string sym doc) - (set-face-background sym col) - (set sym sym) - (setq i (1+ i))))) - -(defcustom rst-adornment-faces-alist - '((1 . rst-level-1-face) - (2 . rst-level-2-face) - (3 . rst-level-3-face) - (4 . rst-level-4-face) - (5 . rst-level-5-face) - (6 . rst-level-6-face) - (t . font-lock-keyword-face) - (nil . font-lock-keyword-face)) - "Provides faces for the various adornment types. Key is a number (for the -section title text of that level), t (for transitions) or nil (for section -title adornment)." - :group 'rst-faces - :type '(alist :key-type (choice (integer :tag "Section level") - (boolean :tag "transitions (on) / section title adornment (off)")) - :value-type (face))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;; FIXME: Code from `restructuredtext.el' should be integrated - -(defvar rst-mode-syntax-table nil - "Syntax table used while in rst mode.") - -(unless rst-mode-syntax-table - (setq rst-mode-syntax-table (make-syntax-table text-mode-syntax-table)) - (modify-syntax-entry ?$ "." rst-mode-syntax-table) - (modify-syntax-entry ?% "." rst-mode-syntax-table) - (modify-syntax-entry ?& "." rst-mode-syntax-table) - (modify-syntax-entry ?' "." rst-mode-syntax-table) - (modify-syntax-entry ?* "." rst-mode-syntax-table) - (modify-syntax-entry ?+ "." rst-mode-syntax-table) - (modify-syntax-entry ?. "_" rst-mode-syntax-table) - (modify-syntax-entry ?/ "." rst-mode-syntax-table) - (modify-syntax-entry ?< "." rst-mode-syntax-table) - (modify-syntax-entry ?= "." rst-mode-syntax-table) - (modify-syntax-entry ?> "." rst-mode-syntax-table) - (modify-syntax-entry ?\\ "\\" rst-mode-syntax-table) - (modify-syntax-entry ?| "." rst-mode-syntax-table) - ) - -(defvar rst-mode-abbrev-table nil - "Abbrev table used while in rst mode.") -(define-abbrev-table 'rst-mode-abbrev-table ()) - -;; FIXME: Movement keys to skip forward / backward over or mark an indented -;; block could be defined; keys to markup section titles based on -;; `rst-adornment-level-alist' would be useful -(defvar rst-mode-map nil - "Keymap for rst mode. This inherits from Text mode.") - -(unless rst-mode-map - (setq rst-mode-map (copy-keymap text-mode-map))) - -(defun rst-mode () - "Major mode for editing reStructuredText documents. - -You may customize `rst-mode-lazy' to switch font-locking of blocks. - -\\{rst-mode-map} -Turning on `rst-mode' calls the normal hooks `text-mode-hook' and -`rst-mode-hook'." - (interactive) - (kill-all-local-variables) - - ;; Maps and tables - (use-local-map rst-mode-map) - (setq local-abbrev-table rst-mode-abbrev-table) - (set-syntax-table rst-mode-syntax-table) - - ;; For editing text - ;; - ;; FIXME: It would be better if this matches more exactly the start of a reST - ;; paragraph; however, this not always possible with a simple regex because - ;; paragraphs are determined by indentation of the following line - (set (make-local-variable 'paragraph-start) - (concat page-delimiter "\\|[ \t]*$")) - (if (eq ?^ (aref paragraph-start 0)) - (setq paragraph-start (substring paragraph-start 1))) - (set (make-local-variable 'paragraph-separate) paragraph-start) - (set (make-local-variable 'indent-line-function) 'indent-relative-maybe) - (set (make-local-variable 'adaptive-fill-mode) t) - (set (make-local-variable 'comment-start) ".. ") - - ;; Special variables - (make-local-variable 'rst-adornment-level-alist) - - ;; Font lock - (set (make-local-variable 'font-lock-defaults) - '(rst-font-lock-keywords-function - t nil nil nil - (font-lock-multiline . t) - (font-lock-mark-block-function . mark-paragraph))) - (when (boundp 'font-lock-support-mode) - ;; rst-mode has its own mind about font-lock-support-mode - (make-local-variable 'font-lock-support-mode) - (cond - ((and (not rst-mode-lazy) (not font-lock-support-mode))) - ;; No support mode set and none required - leave it alone - ((or (not font-lock-support-mode) ;; No support mode set (but required) - (symbolp font-lock-support-mode)) ;; or a fixed mode for all - (setq font-lock-support-mode - (list (cons 'rst-mode (and rst-mode-lazy 'lazy-lock-mode)) - (cons t font-lock-support-mode)))) - ((and (listp font-lock-support-mode) - (not (assoc 'rst-mode font-lock-support-mode))) - ;; A list of modes missing rst-mode - (setq font-lock-support-mode - (append '((cons 'rst-mode (and rst-mode-lazy 'lazy-lock-mode))) - font-lock-support-mode))))) - - ;; Names and hooks - (setq mode-name "reST") - (setq major-mode 'rst-mode) - (run-hooks 'text-mode-hook) - (run-hooks 'rst-mode-hook)) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Font lock - -(defun rst-font-lock-keywords-function () - "Returns keywords to highlight in rst mode according to current settings." - ;; The reST-links in the comments below all relate to sections in - ;; http://docutils.sourceforge.net/spec/rst/reStructuredText.html - (let* ( ;; This gets big - so let's define some abbreviations - ;; horizontal white space - (re-hws "[\t ]") - ;; beginning of line with possible indentation - (re-bol (concat "^" re-hws "*")) - ;; Separates block lead-ins from their content - (re-blksep1 (concat "\\(" re-hws "+\\|$\\)")) - ;; explicit markup tag - (re-emt "\\.\\.") - ;; explicit markup start - (re-ems (concat re-emt re-hws "+")) - ;; inline markup prefix - (re-imp1 (concat "\\(^\\|" re-hws "\\|[-'\"([{</:]\\)")) - ;; inline markup suffix - (re-ims1 (concat "\\(" re-hws "\\|[]-'\")}>/:.,;!?\\]\\|$\\)")) - ;; symbol character - (re-sym1 "\\(\\sw\\|\\s_\\)") - ;; inline markup content begin - (re-imbeg2 "\\(\\S \\|\\S \\([^") - - ;; There seems to be a bug leading to error "Stack overflow in regexp - ;; matcher" when "|" or "\\*" are the characters searched for - (re-imendbeg - (if (< emacs-major-version 21) - "]" - "\\]\\|\\\\.")) - ;; inline markup content end - (re-imend (concat re-imendbeg "\\)*[^\t \\\\]\\)")) - ;; inline markup content without asterisk - (re-ima2 (concat re-imbeg2 "*" re-imend)) - ;; inline markup content without backquote - (re-imb2 (concat re-imbeg2 "`" re-imend)) - ;; inline markup content without vertical bar - (re-imv2 (concat re-imbeg2 "|" re-imend)) - ;; Supported URI schemes - (re-uris1 "\\(acap\\|cid\\|data\\|dav\\|fax\\|file\\|ftp\\|gopher\\|http\\|https\\|imap\\|ldap\\|mailto\\|mid\\|modem\\|news\\|nfs\\|nntp\\|pop\\|prospero\\|rtsp\\|service\\|sip\\|tel\\|telnet\\|tip\\|urn\\|vemmi\\|wais\\)") - ;; Line starting with adornment and optional whitespace; complete - ;; adornment is in (match-string 1); there must be at least 3 - ;; characters because otherwise explicit markup start would be - ;; recognized - (re-ado2 (concat "^\\(\\([" - (if (or - (< emacs-major-version 21) - (save-match-data - (string-match "XEmacs\\|Lucid" emacs-version))) - "^a-zA-Z0-9 \t\x00-\x1F" - "^[:word:][:space:][:cntrl:]") - "]\\)\\2\\2+\\)" re-hws "*$")) - ) - (list - ;; FIXME: Block markup is not recognized in blocks after explicit markup - ;; start - - ;; Simple `Body Elements`_ - ;; `Bullet Lists`_ - (list - (concat re-bol "\\([-*+]" re-blksep1 "\\)") - 1 rst-block-face) - ;; `Enumerated Lists`_ - (list - (concat re-bol "\\((?\\([0-9]+\\|[A-Za-z]\\|[IVXLCMivxlcm]+\\)[.)]" re-blksep1 "\\)") - 1 rst-block-face) - ;; `Definition Lists`_ FIXME: missing - ;; `Field Lists`_ - (list - (concat re-bol "\\(:[^:]+:\\)" re-blksep1) - 1 rst-external-face) - ;; `Option Lists`_ - (list - (concat re-bol "\\(\\(\\(\\([-+/]\\|--\\)\\sw\\(-\\|\\sw\\)*\\([ =]\\S +\\)?\\)\\(,[\t ]\\)?\\)+\\)\\($\\|[\t ]\\{2\\}\\)") - 1 rst-block-face) - - ;; `Tables`_ FIXME: missing - - ;; All the `Explicit Markup Blocks`_ - ;; `Footnotes`_ / `Citations`_ - (list - (concat re-bol "\\(" re-ems "\\[[^[]+\\]\\)" re-blksep1) - 1 rst-definition-face) - ;; `Directives`_ / `Substitution Definitions`_ - (list - (concat re-bol "\\(" re-ems "\\)\\(\\(|[^|]+|[\t ]+\\)?\\)\\(" re-sym1 "+::\\)" re-blksep1) - (list 1 rst-directive-face) - (list 2 rst-definition-face) - (list 4 rst-directive-face)) - ;; `Hyperlink Targets`_ - (list - (concat re-bol "\\(" re-ems "_\\([^:\\`]\\|\\\\.\\|`[^`]+`\\)+:\\)" re-blksep1) - 1 rst-definition-face) - (list - (concat re-bol "\\(__\\)" re-blksep1) - 1 rst-definition-face) - - ;; All `Inline Markup`_ - ;; FIXME: Condition 5 preventing fontification of e.g. "*" not implemented - ;; `Strong Emphasis`_ - (list - (concat re-imp1 "\\(\\*\\*" re-ima2 "\\*\\*\\)" re-ims1) - 2 rst-emphasis2-face) - ;; `Emphasis`_ - (list - (concat re-imp1 "\\(\\*" re-ima2 "\\*\\)" re-ims1) - 2 rst-emphasis1-face) - ;; `Inline Literals`_ - (list - (concat re-imp1 "\\(``" re-imb2 "``\\)" re-ims1) - 2 rst-literal-face) - ;; `Inline Internal Targets`_ - (list - (concat re-imp1 "\\(_`" re-imb2 "`\\)" re-ims1) - 2 rst-definition-face) - ;; `Hyperlink References`_ - ;; FIXME: `Embedded URIs`_ not considered - (list - (concat re-imp1 "\\(\\(`" re-imb2 "`\\|\\sw+\\)__?\\)" re-ims1) - 2 rst-reference-face) - ;; `Interpreted Text`_ - (list - (concat re-imp1 "\\(\\(:" re-sym1 "+:\\)?\\)\\(`" re-imb2 "`\\)\\(\\(:" re-sym1 "+:\\)?\\)" re-ims1) - (list 2 rst-directive-face) - (list 5 rst-external-face) - (list 8 rst-directive-face)) - ;; `Footnote References`_ / `Citation References`_ - (list - (concat re-imp1 "\\(\\[[^]]+\\]_\\)" re-ims1) - 2 rst-reference-face) - ;; `Substitution References`_ - (list - (concat re-imp1 "\\(|" re-imv2 "|\\)" re-ims1) - 2 rst-reference-face) - ;; `Standalone Hyperlinks`_ - (list - ;; FIXME: This takes it easy by using a whitespace as delimiter - (concat re-imp1 "\\(" re-uris1 ":\\S +\\)" re-ims1) - 2 rst-definition-face) - (list - (concat re-imp1 "\\(" re-sym1 "+@" re-sym1 "+\\)" re-ims1) - 2 rst-definition-face) - - ;; Do all block fontification as late as possible so 'append works - - ;; Sections_ / Transitions_ - (append - (list - re-ado2) - (if (not rst-mode-lazy) - (list 1 rst-block-face) - (list - (list 'rst-font-lock-handle-adornment - '(progn - (setq rst-font-lock-adornment-point (match-end 1)) - (point-max)) - nil - (list 1 '(cdr (assoc nil rst-adornment-faces-alist)) - 'append t) - (list 2 '(cdr (assoc rst-font-lock-level rst-adornment-faces-alist)) - 'append t) - (list 3 '(cdr (assoc nil rst-adornment-faces-alist)) - 'append t))))) - - ;; `Comments`_ - (append - (list - (concat re-bol "\\(" re-ems "\\)\[^[|_]\\([^:]\\|:\\([^:]\\|$\\)\\)*$") - (list 1 rst-comment-face)) - (if rst-mode-lazy - (list - (list 'rst-font-lock-find-unindented-line - '(progn - (setq rst-font-lock-indentation-point (match-end 1)) - (point-max)) - nil - (list 0 rst-comment-face 'append))))) - (append - (list - (concat re-bol "\\(" re-emt "\\)\\(\\s *\\)$") - (list 1 rst-comment-face) - (list 2 rst-comment-face)) - (if rst-mode-lazy - (list - (list 'rst-font-lock-find-unindented-line - '(progn - (setq rst-font-lock-indentation-point 'next) - (point-max)) - nil - (list 0 rst-comment-face 'append))))) - - ;; `Literal Blocks`_ - (append - (list - (concat re-bol "\\(\\([^.\n]\\|\\.[^.\n]\\).*\\)?\\(::\\)$") - (list 3 rst-block-face)) - (if rst-mode-lazy - (list - (list 'rst-font-lock-find-unindented-line - '(progn - (setq rst-font-lock-indentation-point t) - (point-max)) - nil - (list 0 rst-literal-face 'append))))) - ))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Indented blocks - -(defun rst-forward-indented-block (&optional column limit) - "Move forward across one indented block. -Find the next non-empty line which is not indented at least to COLUMN (defaults -to the column of the point). Moves point to first character of this line or the -first empty line immediately before it and returns that position. If there is -no such line before LIMIT (defaults to the end of the buffer) returns nil and -point is not moved." - (interactive) - (let ((clm (or column (current-column))) - (start (point)) - fnd beg cand) - (if (not limit) - (setq limit (point-max))) - (save-match-data - (while (and (not fnd) (< (point) limit)) - (forward-line 1) - (when (< (point) limit) - (setq beg (point)) - (if (looking-at "\\s *$") - (setq cand (or cand beg)) ; An empty line is a candidate - (move-to-column clm) - ;; FIXME: No indentation [(zerop clm)] must be handled in some - ;; useful way - though it is not clear what this should mean at all - (if (string-match - "^\\s *$" (buffer-substring-no-properties beg (point))) - (setq cand nil) ; An indented line resets a candidate - (setq fnd (or cand beg))))))) - (goto-char (or fnd start)) - fnd)) - -;; Stores the point where the current indentation ends if a number. If `next' -;; indicates `rst-font-lock-find-unindented-line' shall take the indentation -;; from the next line if this is not empty. If non-nil indicates -;; `rst-font-lock-find-unindented-line' shall take the indentation from the -;; next non-empty line. Also used as a trigger for -;; `rst-font-lock-find-unindented-line'. -(defvar rst-font-lock-indentation-point nil) - -(defun rst-font-lock-find-unindented-line (limit) - (let* ((ind-pnt rst-font-lock-indentation-point) - (beg-pnt ind-pnt)) - ;; May run only once - enforce this - (setq rst-font-lock-indentation-point nil) - (when (and ind-pnt (not (numberp ind-pnt))) - ;; Find indentation point in next line if any - (setq ind-pnt - (save-excursion - (save-match-data - (if (eq ind-pnt 'next) - (when (and (zerop (forward-line 1)) (< (point) limit)) - (setq beg-pnt (point)) - (when (not (looking-at "\\s *$")) - (looking-at "\\s *") - (match-end 0))) - (while (and (zerop (forward-line 1)) (< (point) limit) - (looking-at "\\s *$"))) - (when (< (point) limit) - (setq beg-pnt (point)) - (looking-at "\\s *") - (match-end 0))))))) - (when ind-pnt - (goto-char ind-pnt) - ;; Always succeeds because the limit set by PRE-MATCH-FORM is the - ;; ultimate point to find - (goto-char (or (rst-forward-indented-block nil limit) limit)) - (set-match-data (list beg-pnt (point))) - t))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Adornments - -;; Stores the point where the current adornment ends. Also used as a trigger -;; for `rst-font-lock-handle-adornment'. -(defvar rst-font-lock-adornment-point nil) - -;; Here `rst-font-lock-handle-adornment' stores the section level of the -;; current adornment or t for a transition. -(defvar rst-font-lock-level nil) - -;; FIXME: It would be good if this could be used to markup section titles of -;; given level with a special key; it would be even better to be able to -;; customize this so it can be used for a generally available personal style -;; -;; FIXME: There should be some way to reset and reload this variable - probably -;; a special key -;; -;; FIXME: Some support for `outline-mode' would be nice which should be based -;; on this information -(defvar rst-adornment-level-alist nil - "Associates adornments with section levels. -The key is a two character string. The first character is the adornment -character. The second character distinguishes underline section titles (`u') -from overline/underline section titles (`o'). The value is the section level. - -This is made buffer local on start and adornments found during font lock are -entered.") - -;; Returns section level for adornment key KEY. Adds new section level if KEY -;; is not found and ADD. If KEY is not a string it is simply returned. -(defun rst-adornment-level (key &optional add) - (let ((fnd (assoc key rst-adornment-level-alist)) - (new 1)) - (cond - ((not (stringp key)) - key) - (fnd - (cdr fnd)) - (add - (while (rassoc new rst-adornment-level-alist) - (setq new (1+ new))) - (setq rst-adornment-level-alist - (append rst-adornment-level-alist (list (cons key new)))) - new)))) - -;; Classifies adornment for section titles and transitions. ADORNMENT is the -;; complete adornment string as found in the buffer. END is the point after the -;; last character of ADORNMENT. For overline section adornment LIMIT limits the -;; search for the matching underline. Returns a list. The first entry is t for -;; a transition, or a key string for `rst-adornment-level' for a section title. -;; The following eight values forming four match groups as can be used for -;; `set-match-data'. First match group contains the maximum points of the whole -;; construct. Second and last match group matched pure section title adornment -;; while third match group matched the section title text or the transition. -;; Each group but the first may or may not exist. -(defun rst-classify-adornment (adornment end limit) - (save-excursion - (save-match-data - (goto-char end) - (let ((ado-ch (aref adornment 0)) - (ado-re (regexp-quote adornment)) - (end-pnt (point)) - (beg-pnt (progn - (forward-line 0) - (point))) - (nxt-emp - (save-excursion - (or (not (zerop (forward-line 1))) - (looking-at "\\s *$")))) - (prv-emp - (save-excursion - (or (not (zerop (forward-line -1))) - (looking-at "\\s *$")))) - key beg-ovr end-ovr beg-txt end-txt beg-und end-und) - (cond - ((and nxt-emp prv-emp) - ;; A transition - (setq key t) - (setq beg-txt beg-pnt) - (setq end-txt end-pnt)) - (prv-emp - ;; An overline - (setq key (concat (list ado-ch) "o")) - (setq beg-ovr beg-pnt) - (setq end-ovr end-pnt) - (forward-line 1) - (setq beg-txt (point)) - (while (and (< (point) limit) (not end-txt)) - (if (looking-at "\\s *$") - ;; No underline found - (setq end-txt (1- (point))) - (when (looking-at (concat "\\(" ado-re "\\)\\s *$")) - (setq end-und (match-end 1)) - (setq beg-und (point)) - (setq end-txt (1- beg-und)))) - (forward-line 1))) - (t - ;; An underline - (setq key (concat (list ado-ch) "u")) - (setq beg-und beg-pnt) - (setq end-und end-pnt) - (setq end-txt (1- beg-und)) - (setq beg-txt (progn - (if (re-search-backward "^\\s *$" 1 'move) - (forward-line 1)) - (point))))) - (list key - (or beg-ovr beg-txt beg-und) - (or end-und end-txt end-und) - beg-ovr end-ovr beg-txt end-txt beg-und end-und))))) - -;; Handles adornments for font-locking section titles and transitions. Returns -;; three match groups. First and last match group matched pure overline / -;; underline adornment while second group matched section title text. Each -;; group may not exist. -(defun rst-font-lock-handle-adornment (limit) - (let ((ado-pnt rst-font-lock-adornment-point)) - ;; May run only once - enforce this - (setq rst-font-lock-adornment-point nil) - (if ado-pnt - (let* ((ado (rst-classify-adornment (match-string-no-properties 1) - ado-pnt limit)) - (key (car ado)) - (mtc (cdr ado))) - (setq rst-font-lock-level (rst-adornment-level key t)) - (goto-char (nth 1 mtc)) - (set-match-data mtc) - t)))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;;; rst-mode.el ends here diff --git a/docutils/tools/html.py b/docutils/tools/html.py deleted file mode 100755 index 98293b3a1..000000000 --- a/docutils/tools/html.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -A minimal front end to the Docutils Publisher, producing HTML. -""" - -import locale -try: - locale.setlocale(locale.LC_ALL, '') -except: - pass - -from docutils.core import publish_cmdline, default_description - - -description = ('Generates (X)HTML documents from standalone reStructuredText ' - 'sources. ' + default_description) - -publish_cmdline(writer_name='html', description=description) diff --git a/docutils/tools/pep-html-template b/docutils/tools/pep-html-template deleted file mode 100644 index 94ecafb70..000000000 --- a/docutils/tools/pep-html-template +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0" encoding="%(encoding)s" ?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<!-- -This HTML is auto-generated. DO NOT EDIT THIS FILE! If you are writing a new -PEP, see http://www.python.org/peps/pep-0001.html for instructions and links -to templates. DO NOT USE THIS HTML FILE AS YOUR TEMPLATE! ---> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=%(encoding)s" /> - <meta name="generator" content="Docutils %(version)s: http://docutils.sourceforge.net/" /> - <title>PEP %(pep)s -- %(title)s - %(stylesheet)s - - - - -%(body)s -%(body_suffix)s diff --git a/docutils/tools/pep.py b/docutils/tools/pep.py deleted file mode 100755 index 4c38980b6..000000000 --- a/docutils/tools/pep.py +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -A minimal front end to the Docutils Publisher, producing HTML from PEP -(Python Enhancement Proposal) documents. -""" - -import locale -try: - locale.setlocale(locale.LC_ALL, '') -except: - pass - -from docutils.core import publish_cmdline, default_description - - -description = ('Generates (X)HTML from reStructuredText-format PEP files. ' - + default_description) - -publish_cmdline(reader_name='pep', writer_name='pep_html', - description=description) diff --git a/docutils/tools/pep2html.py b/docutils/tools/pep2html.py deleted file mode 100755 index fb82a4718..000000000 --- a/docutils/tools/pep2html.py +++ /dev/null @@ -1,531 +0,0 @@ -#!/usr/bin/env python -"""Convert PEPs to (X)HTML - courtesy of /F - -Usage: %(PROGRAM)s [options] [peps] - -Options: - - -u/--user - python.org username - - -b/--browse - After generating the HTML, direct your web browser to view it - (using the Python webbrowser module). If both -i and -b are - given, this will browse the on-line HTML; otherwise it will - browse the local HTML. If no pep arguments are given, this - will browse PEP 0. - - -i/--install - After generating the HTML, install it and the plaintext source file - (.txt) on python.org. In that case the user's name is used in the scp - and ssh commands, unless "-u username" is given (in which case, it is - used instead). Without -i, -u is ignored. - - -l/--local - Same as -i/--install, except install on the local machine. Use this - when logged in to the python.org machine (creosote). - - -q/--quiet - Turn off verbose messages. - - -h/--help - Print this help message and exit. - -The optional argument `peps' is a list of either pep numbers or .txt files. -""" - -import sys -import os -import re -import cgi -import glob -import getopt -import errno -import random -import time - -REQUIRES = {'python': '2.2', - 'docutils': '0.2.7'} -PROGRAM = sys.argv[0] -RFCURL = 'http://www.faqs.org/rfcs/rfc%d.html' -PEPURL = 'pep-%04d.html' -PEPCVSURL = ('http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python' - '/nondist/peps/pep-%04d.txt') -PEPDIRRUL = 'http://www.python.org/peps/' - - -HOST = "www.python.org" # host for update -HDIR = "/ftp/ftp.python.org/pub/www.python.org/peps" # target host directory -LOCALVARS = "Local Variables:" - -COMMENT = """""" - -# The generated HTML doesn't validate -- you cannot use
and

inside -#
 tags.  But if I change that, the result doesn't look very nice...
-DTD = ('')
-
-fixpat = re.compile("((http|ftp):[-_a-zA-Z0-9/.+~:?#$=&,]+)|(pep-\d+(.txt)?)|"
-                    "(RFC[- ]?(?P\d+))|"
-                    "(PEP\s+(?P\d+))|"
-                    ".")
-
-EMPTYSTRING = ''
-SPACE = ' '
-COMMASPACE = ', '
-
-
-
-def usage(code, msg=''):
-    print >> sys.stderr, __doc__ % globals()
-    if msg:
-        print >> sys.stderr, msg
-    sys.exit(code)
-
-
-
-def fixanchor(current, match):
-    text = match.group(0)
-    link = None
-    if text.startswith('http:') or text.startswith('ftp:'):
-        # Strip off trailing punctuation.  Pattern taken from faqwiz.
-        ltext = list(text)
-        while ltext:
-            c = ltext.pop()
-            if c not in '();:,.?\'"<>':
-                ltext.append(c)
-                break
-        link = EMPTYSTRING.join(ltext)
-    elif text.startswith('pep-') and text <> current:
-        link = os.path.splitext(text)[0] + ".html"
-    elif text.startswith('PEP'):
-        pepnum = int(match.group('pepnum'))
-        link = PEPURL % pepnum
-    elif text.startswith('RFC'):
-        rfcnum = int(match.group('rfcnum'))
-        link = RFCURL % rfcnum
-    if link:
-        return '%s' % (cgi.escape(link), cgi.escape(text))
-    return cgi.escape(match.group(0)) # really slow, but it works...
-
-
-
-NON_MASKED_EMAILS = [
-    'peps@python.org',
-    'python-list@python.org',
-    'python-dev@python.org',
-    ]
-
-def fixemail(address, pepno):
-    if address.lower() in NON_MASKED_EMAILS:
-        # return hyperlinked version of email address
-        return linkemail(address, pepno)
-    else:
-        # return masked version of email address
-        parts = address.split('@', 1)
-        return '%s at %s' % (parts[0], parts[1])
-
-
-def linkemail(address, pepno):
-    parts = address.split('@', 1)
-    return (''
-            '%s at %s'
-            % (parts[0], parts[1], pepno, parts[0], parts[1]))
-
-
-def fixfile(inpath, input_lines, outfile):
-    from email.Utils import parseaddr
-    basename = os.path.basename(inpath)
-    infile = iter(input_lines)
-    # convert plaintext pep to minimal XHTML markup
-    print >> outfile, DTD
-    print >> outfile, ''
-    print >> outfile, COMMENT
-    print >> outfile, ''
-    # head
-    header = []
-    pep = ""
-    title = ""
-    for line in infile:
-        if not line.strip():
-            break
-        if line[0].strip():
-            if ":" not in line:
-                break
-            key, value = line.split(":", 1)
-            value = value.strip()
-            header.append((key, value))
-        else:
-            # continuation line
-            key, value = header[-1]
-            value = value + line
-            header[-1] = key, value
-        if key.lower() == "title":
-            title = value
-        elif key.lower() == "pep":
-            pep = value
-    if pep:
-        title = "PEP " + pep + " -- " + title
-    if title:
-        print >> outfile, '  %s' % cgi.escape(title)
-    r = random.choice(range(64))
-    print >> outfile, (
-        '  \n'
-        '\n'
-        '\n'
-        '\n'
-        '\n'
-        ''
-    print >> outfile, '
\n' - for k, v in header: - if k.lower() in ('author', 'discussions-to'): - mailtos = [] - for part in re.split(',\s*', v): - if '@' in part: - realname, addr = parseaddr(part) - if k.lower() == 'discussions-to': - m = linkemail(addr, pep) - else: - m = fixemail(addr, pep) - mailtos.append('%s <%s>' % (realname, m)) - elif part.startswith('http:'): - mailtos.append( - '%s' % (part, part)) - else: - mailtos.append(part) - v = COMMASPACE.join(mailtos) - elif k.lower() in ('replaces', 'replaced-by', 'requires'): - otherpeps = '' - for otherpep in re.split(',?\s+', v): - otherpep = int(otherpep) - otherpeps += '%i ' % (otherpep, - otherpep) - v = otherpeps - elif k.lower() in ('last-modified',): - date = v or time.strftime('%d-%b-%Y', - time.localtime(os.stat(inpath)[8])) - try: - url = PEPCVSURL % int(pep) - v = '%s ' % (url, cgi.escape(date)) - except ValueError, error: - v = date - elif k.lower() in ('content-type',): - url = PEPURL % 9 - pep_type = v or 'text/plain' - v = '%s ' % (url, cgi.escape(pep_type)) - else: - v = cgi.escape(v) - print >> outfile, ' ' \ - % (cgi.escape(k), v) - print >> outfile, '
%s: %s
' - print >> outfile, '
' - print >> outfile, '
' - print >> outfile, '
' - need_pre = 1 - for line in infile: - if line[0] == '\f': - continue - if line.strip() == LOCALVARS: - break - if line[0].strip(): - if not need_pre: - print >> outfile, '
' - print >> outfile, '

%s

' % line.strip() - need_pre = 1 - elif not line.strip() and need_pre: - continue - else: - # PEP 0 has some special treatment - if basename == 'pep-0000.txt': - parts = line.split() - if len(parts) > 1 and re.match(r'\s*\d{1,4}', parts[1]): - # This is a PEP summary line, which we need to hyperlink - url = PEPURL % int(parts[1]) - if need_pre: - print >> outfile, '
'
-                        need_pre = 0
-                    print >> outfile, re.sub(
-                        parts[1],
-                        '%s' % (url, parts[1]),
-                        line, 1),
-                    continue
-                elif parts and '@' in parts[-1]:
-                    # This is a pep email address line, so filter it.
-                    url = fixemail(parts[-1], pep)
-                    if need_pre:
-                        print >> outfile, '
'
-                        need_pre = 0
-                    print >> outfile, re.sub(
-                        parts[-1], url, line, 1),
-                    continue
-            line = fixpat.sub(lambda x, c=inpath: fixanchor(c, x), line)
-            if need_pre:
-                print >> outfile, '
'
-                need_pre = 0
-            outfile.write(line)
-    if not need_pre:
-        print >> outfile, '
' - print >> outfile, '
' - print >> outfile, '' - print >> outfile, '' - - -docutils_settings = None -"""Runtime settings object used by Docutils. Can be set by the client -application when this module is imported.""" - -def fix_rst_pep(inpath, input_lines, outfile): - from docutils import core - output = core.publish_string( - source=''.join(input_lines), - source_path=inpath, - destination_path=outfile.name, - reader_name='pep', - parser_name='restructuredtext', - writer_name='pep_html', - settings=docutils_settings) - outfile.write(output) - - -def get_pep_type(input_lines): - """ - Return the Content-Type of the input. "text/plain" is the default. - Return ``None`` if the input is not a PEP. - """ - pep_type = None - for line in input_lines: - line = line.rstrip().lower() - if not line: - # End of the RFC 2822 header (first blank line). - break - elif line.startswith('content-type: '): - pep_type = line.split()[1] or 'text/plain' - break - elif line.startswith('pep: '): - # Default PEP type, used if no explicit content-type specified: - pep_type = 'text/plain' - return pep_type - - -def get_input_lines(inpath): - try: - infile = open(inpath) - except IOError, e: - if e.errno <> errno.ENOENT: raise - print >> sys.stderr, 'Error: Skipping missing PEP file:', e.filename - sys.stderr.flush() - return None, None - lines = infile.read().splitlines(1) # handles x-platform line endings - infile.close() - return lines - - -def find_pep(pep_str): - """Find the .txt file indicated by a cmd line argument""" - if os.path.exists(pep_str): - return pep_str - num = int(pep_str) - return "pep-%04d.txt" % num - -def make_html(inpath, verbose=0): - input_lines = get_input_lines(inpath) - pep_type = get_pep_type(input_lines) - if pep_type is None: - print >> sys.stderr, 'Error: Input file %s is not a PEP.' % inpath - sys.stdout.flush() - return None - elif not PEP_TYPE_DISPATCH.has_key(pep_type): - print >> sys.stderr, ('Error: Unknown PEP type for input file %s: %s' - % (inpath, pep_type)) - sys.stdout.flush() - return None - elif PEP_TYPE_DISPATCH[pep_type] == None: - pep_type_error(inpath, pep_type) - return None - outpath = os.path.splitext(inpath)[0] + ".html" - if verbose: - print inpath, "(%s)" % pep_type, "->", outpath - sys.stdout.flush() - outfile = open(outpath, "w") - PEP_TYPE_DISPATCH[pep_type](inpath, input_lines, outfile) - outfile.close() - os.chmod(outfile.name, 0664) - return outpath - -def push_pep(htmlfiles, txtfiles, username, verbose, local=0): - quiet = "" - if local: - if verbose: - quiet = "-v" - target = HDIR - copy_cmd = "cp" - chmod_cmd = "chmod" - else: - if not verbose: - quiet = "-q" - if username: - username = username + "@" - target = username + HOST + ":" + HDIR - copy_cmd = "scp" - chmod_cmd = "ssh %s%s chmod" % (username, HOST) - files = htmlfiles[:] - files.extend(txtfiles) - files.append("style.css") - files.append("pep.css") - filelist = SPACE.join(files) - rc = os.system("%s %s %s %s" % (copy_cmd, quiet, filelist, target)) - if rc: - sys.exit(rc) - rc = os.system("%s 664 %s/*" % (chmod_cmd, HDIR)) - if rc: - sys.exit(rc) - - -PEP_TYPE_DISPATCH = {'text/plain': fixfile, - 'text/x-rst': fix_rst_pep} -PEP_TYPE_MESSAGES = {} - -def check_requirements(): - # Check Python: - try: - from email.Utils import parseaddr - except ImportError: - PEP_TYPE_DISPATCH['text/plain'] = None - PEP_TYPE_MESSAGES['text/plain'] = ( - 'Python %s or better required for "%%(pep_type)s" PEP ' - 'processing; %s present (%%(inpath)s).' - % (REQUIRES['python'], sys.version.split()[0])) - # Check Docutils: - try: - import docutils - except ImportError: - PEP_TYPE_DISPATCH['text/x-rst'] = None - PEP_TYPE_MESSAGES['text/x-rst'] = ( - 'Docutils not present for "%(pep_type)s" PEP file %(inpath)s. ' - 'See README.txt for installation.') - else: - installed = [int(part) for part in docutils.__version__.split('.')] - required = [int(part) for part in REQUIRES['docutils'].split('.')] - if installed < required: - PEP_TYPE_DISPATCH['text/x-rst'] = None - PEP_TYPE_MESSAGES['text/x-rst'] = ( - 'Docutils must be reinstalled for "%%(pep_type)s" PEP ' - 'processing (%%(inpath)s). Version %s or better required; ' - '%s present. See README.txt for installation.' - % (REQUIRES['docutils'], docutils.__version__)) - -def pep_type_error(inpath, pep_type): - print >> sys.stderr, 'Error: ' + PEP_TYPE_MESSAGES[pep_type] % locals() - sys.stdout.flush() - - -def browse_file(pep): - import webbrowser - file = find_pep(pep) - if file.endswith(".txt"): - file = file[:-3] + "html" - file = os.path.abspath(file) - url = "file:" + file - webbrowser.open(url) - -def browse_remote(pep): - import webbrowser - file = find_pep(pep) - if file.endswith(".txt"): - file = file[:-3] + "html" - url = PEPDIRRUL + file - webbrowser.open(url) - - -def main(argv=None): - # defaults - update = 0 - local = 0 - username = '' - verbose = 1 - browse = 0 - - check_requirements() - - if argv is None: - argv = sys.argv[1:] - - try: - opts, args = getopt.getopt( - argv, 'bilhqu:', - ['browse', 'install', 'local', 'help', 'quiet', 'user=']) - except getopt.error, msg: - usage(1, msg) - - for opt, arg in opts: - if opt in ('-h', '--help'): - usage(0) - elif opt in ('-i', '--install'): - update = 1 - elif opt in ('-l', '--local'): - update = 1 - local = 1 - elif opt in ('-u', '--user'): - username = arg - elif opt in ('-q', '--quiet'): - verbose = 0 - elif opt in ('-b', '--browse'): - browse = 1 - - if args: - peptxt = [] - html = [] - for pep in args: - file = find_pep(pep) - peptxt.append(file) - newfile = make_html(file, verbose=verbose) - if newfile: - html.append(newfile) - if browse and not update: - browse_file(pep) - else: - # do them all - peptxt = [] - html = [] - files = glob.glob("pep-*.txt") - files.sort() - for file in files: - peptxt.append(file) - newfile = make_html(file, verbose=verbose) - if newfile: - html.append(newfile) - if browse and not update: - browse_file("0") - - if update: - push_pep(html, peptxt, username, verbose, local=local) - if browse: - if args: - for pep in args: - browse_remote(pep) - else: - browse_remote("0") - - - -if __name__ == "__main__": - main() diff --git a/docutils/tools/publish.py b/docutils/tools/publish.py deleted file mode 100755 index d360cd124..000000000 --- a/docutils/tools/publish.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -A minimal front end to the Docutils Publisher, producing pseudo-XML. -""" - -import locale -try: - locale.setlocale(locale.LC_ALL, '') -except: - pass - -from docutils.core import publish_cmdline, default_description - - -description = ('Generates pseudo-XML from standalone reStructuredText ' - 'sources (for testing purposes). ' + default_description) - -publish_cmdline(description=description) diff --git a/docutils/tools/quicktest.py b/docutils/tools/quicktest.py deleted file mode 100755 index 04e3209fa..000000000 --- a/docutils/tools/quicktest.py +++ /dev/null @@ -1,211 +0,0 @@ -#!/usr/bin/env python - -# Author: Garth Kidd -# Contact: garth@deadlybloodyserious.com -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -import locale -try: - locale.setlocale(locale.LC_ALL, '') -except: - pass - -import sys -import os -import getopt -import docutils -from docutils.frontend import OptionParser -from docutils.utils import new_document -from docutils.parsers.rst import Parser - - -usage_header = """\ -quicktest.py: quickly test the restructuredtext parser. - -Usage:: - - quicktest.py [options] [ []] - -``source`` is the name of the file to use as input (default is stdin). -``destination`` is the name of the file to create as output (default is -stdout). - -Options: -""" - -options = [('pretty', 'p', - 'output pretty pseudo-xml: no "&abc;" entities (default)'), - ('test', 't', 'output test-ready data (input & expected output, ' - 'ready to be copied to a parser test module)'), - ('rawxml', 'r', 'output raw XML'), - ('styledxml=', 's', 'output raw XML with XSL style sheet ' - 'reference (filename supplied in the option argument)'), - ('xml', 'x', 'output pretty XML (indented)'), - ('attributes', 'A', 'dump document attributes after processing'), - ('debug', 'd', 'debug mode (lots of output)'), - ('version', 'V', 'show Docutils version then exit'), - ('help', 'h', 'show help text then exit')] -"""See ``distutils.fancy_getopt.FancyGetopt.__init__`` for a description of -the data structure: (long option, short option, description).""" - -def usage(): - print usage_header - for longopt, shortopt, description in options: - if longopt[-1:] == '=': - opts = '-%s arg, --%sarg' % (shortopt, longopt) - else: - opts = '-%s, --%s' % (shortopt, longopt) - print '%-15s' % opts, - if len(opts) > 14: - print '%-16s' % '\n', - while len(description) > 60: - limit = description.rindex(' ', 0, 60) - print description[:limit].strip() - description = description[limit + 1:] - print '%-15s' % ' ', - print description - -def _pretty(input, document, optargs): - return document.pformat() - -def _rawxml(input, document, optargs): - return document.asdom().toxml() - -def _styledxml(input, document, optargs): - docnode = document.asdom().childNodes[0] - return '%s\n%s\n%s' % ( - '', - '' - % optargs['styledxml'], docnode.toxml()) - -def _prettyxml(input, document, optargs): - return document.asdom().toprettyxml(' ', '\n') - -def _test(input, document, optargs): - tq = '"""' - output = document.pformat() # same as _pretty() - return """\ - totest['change_this_test_name'] = [ -[%s\\ -%s -%s, -%s\\ -%s -%s], -] -""" % ( tq, escape(input.rstrip()), tq, tq, escape(output.rstrip()), tq ) - -def escape(text): - """ - Return `text` in triple-double-quoted Python string form. - """ - text = text.replace('\\', '\\\\') # escape backslashes - text = text.replace('"""', '""\\"') # break up triple-double-quotes - text = text.replace(' \n', ' \\n\\\n') # protect trailing whitespace - return text - -_outputFormatters = { - 'rawxml': _rawxml, - 'styledxml': _styledxml, - 'xml': _prettyxml, - 'pretty' : _pretty, - 'test': _test - } - -def format(outputFormat, input, document, optargs): - formatter = _outputFormatters[outputFormat] - return formatter(input, document, optargs) - -def getArgs(): - if os.name == 'mac' and len(sys.argv) <= 1: - return macGetArgs() - else: - return posixGetArgs(sys.argv[1:]) - -def posixGetArgs(argv): - outputFormat = 'pretty' - # convert fancy_getopt style option list to getopt.getopt() arguments - shortopts = ''.join([option[1] + ':' * (option[0][-1:] == '=') - for option in options if option[1]]) - longopts = [option[0] for option in options if option[0]] - try: - opts, args = getopt.getopt(argv, shortopts, longopts) - except getopt.GetoptError: - usage() - sys.exit(2) - optargs = {'debug': 0, 'attributes': 0} - for o, a in opts: - if o in ['-h', '--help']: - usage() - sys.exit() - elif o in ['-V', '--version']: - print >>sys.stderr, ('quicktest.py (Docutils %s)' - % docutils.__version__) - sys.exit() - elif o in ['-r', '--rawxml']: - outputFormat = 'rawxml' - elif o in ['-s', '--styledxml']: - outputFormat = 'styledxml' - optargs['styledxml'] = a - elif o in ['-x', '--xml']: - outputFormat = 'xml' - elif o in ['-p', '--pretty']: - outputFormat = 'pretty' - elif o in ['-t', '--test']: - outputFormat = 'test' - elif o == '--attributes': - optargs['attributes'] = 1 - elif o in ['-d', '--debug']: - optargs['debug'] = 1 - else: - raise getopt.GetoptError, "getopt should have saved us!" - if len(args) > 2: - print 'Maximum 2 arguments allowed.' - usage() - sys.exit(1) - inputFile = sys.stdin - outputFile = sys.stdout - if args: - inputFile = open(args.pop(0)) - if args: - outputFile = open(args.pop(0), 'w') - return inputFile, outputFile, outputFormat, optargs - -def macGetArgs(): - import EasyDialogs - EasyDialogs.Message("""\ -Use the next dialog to build a command line: - -1. Choose an output format from the [Option] list -2. Click [Add] -3. Choose an input file: [Add existing file...] -4. Save the output: [Add new file...] -5. [OK]""") - optionlist = [(longopt, description) - for (longopt, shortopt, description) in options] - argv = EasyDialogs.GetArgv(optionlist=optionlist, addfolder=0) - return posixGetArgs(argv) - -def main(): - # process cmdline arguments: - inputFile, outputFile, outputFormat, optargs = getArgs() - settings = OptionParser(components=(Parser,)).get_default_values() - settings.debug = optargs['debug'] - parser = Parser() - input = inputFile.read() - document = new_document(inputFile.name, settings) - parser.parse(input, document) - output = format(outputFormat, input, document, optargs) - outputFile.write(output) - if optargs['attributes']: - import pprint - pprint.pprint(document.__dict__) - - -if __name__ == '__main__': - sys.stderr = sys.stdout - main() diff --git a/docutils/tools/rst2latex.py b/docutils/tools/rst2latex.py deleted file mode 100755 index 3b7fdae82..000000000 --- a/docutils/tools/rst2latex.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -A minimal front end to the Docutils Publisher, producing LaTeX. -""" - -import locale -try: - locale.setlocale(locale.LC_ALL, '') -except: - pass - -from docutils.core import publish_cmdline, default_description - - -description = ('Generates LaTeX documents from standalone reStructuredText ' - 'sources. ' + default_description) - -publish_cmdline(writer_name='latex', description=description) diff --git a/docutils/tools/stylesheets/default.css b/docutils/tools/stylesheets/default.css deleted file mode 100644 index 5b2e1be96..000000000 --- a/docutils/tools/stylesheets/default.css +++ /dev/null @@ -1,224 +0,0 @@ -/* -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:date: $Date$ -:version: $Revision$ -:copyright: This stylesheet has been placed in the public domain. - -Default cascading style sheet for the HTML output of Docutils. -*/ - -.first { - margin-top: 0 } - -.last { - margin-bottom: 0 } - -a.toc-backref { - text-decoration: none ; - color: black } - -dd { - margin-bottom: 0.5em } - -div.abstract { - margin: 2em 5em } - -div.abstract p.topic-title { - font-weight: bold ; - text-align: center } - -div.attention, div.caution, div.danger, div.error, div.hint, -div.important, div.note, div.tip, div.warning, div.admonition { - margin: 2em ; - border: medium outset ; - padding: 1em } - -div.attention p.admonition-title, div.caution p.admonition-title, -div.danger p.admonition-title, div.error p.admonition-title, -div.warning p.admonition-title { - color: red ; - font-weight: bold ; - font-family: sans-serif } - -div.hint p.admonition-title, div.important p.admonition-title, -div.note p.admonition-title, div.tip p.admonition-title, -div.admonition p.admonition-title { - font-weight: bold ; - font-family: sans-serif } - -div.dedication { - margin: 2em 5em ; - text-align: center ; - font-style: italic } - -div.dedication p.topic-title { - font-weight: bold ; - font-style: normal } - -div.figure { - margin-left: 2em } - -div.footer, div.header { - font-size: smaller } - -div.sidebar { - margin-left: 1em ; - border: medium outset ; - padding: 0em 1em ; - background-color: #ffffee ; - width: 40% ; - float: right ; - clear: right } - -div.sidebar p.rubric { - font-family: sans-serif ; - font-size: medium } - -div.system-messages { - margin: 5em } - -div.system-messages h1 { - color: red } - -div.system-message { - border: medium outset ; - padding: 1em } - -div.system-message p.system-message-title { - color: red ; - font-weight: bold } - -div.topic { - margin: 2em } - -h1.title { - text-align: center } - -h2.subtitle { - text-align: center } - -hr { - width: 75% } - -ol.simple, ul.simple { - margin-bottom: 1em } - -ol.arabic { - list-style: decimal } - -ol.loweralpha { - list-style: lower-alpha } - -ol.upperalpha { - list-style: upper-alpha } - -ol.lowerroman { - list-style: lower-roman } - -ol.upperroman { - list-style: upper-roman } - -p.attribution { - text-align: right ; - margin-left: 50% } - -p.caption { - font-style: italic } - -p.credits { - font-style: italic ; - font-size: smaller } - -p.label { - white-space: nowrap } - -p.rubric { - font-weight: bold ; - font-size: larger ; - color: darkred ; - text-align: center } - -p.sidebar-title { - font-family: sans-serif ; - font-weight: bold ; - font-size: larger } - -p.sidebar-subtitle { - font-family: sans-serif ; - font-weight: bold } - -p.topic-title { - font-weight: bold } - -pre.address { - margin-bottom: 0 ; - margin-top: 0 ; - font-family: serif ; - font-size: 100% } - -pre.line-block { - font-family: serif ; - font-size: 100% } - -pre.literal-block, pre.doctest-block { - margin-left: 2em ; - margin-right: 2em ; - background-color: #eeeeee } - -span.classifier { - font-family: sans-serif ; - font-style: oblique } - -span.classifier-delimiter { - font-family: sans-serif ; - font-weight: bold } - -span.interpreted { - font-family: sans-serif } - -span.option { - white-space: nowrap } - -span.option-argument { - font-style: italic } - -span.pre { - white-space: pre } - -span.problematic { - color: red } - -table { - margin-top: 0.5em ; - margin-bottom: 0.5em } - -table.citation { - border-left: solid thin gray ; - padding-left: 0.5ex } - -table.docinfo { - margin: 2em 4em } - -table.footnote { - border-left: solid thin black ; - padding-left: 0.5ex } - -td, th { - padding-left: 0.5em ; - padding-right: 0.5em ; - vertical-align: top } - -th.docinfo-name, th.field-name { - font-weight: bold ; - text-align: left ; - white-space: nowrap } - -h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { - font-size: 100% } - -tt { - background-color: #eeeeee } - -ul.auto-toc { - list-style-type: none } diff --git a/docutils/tools/stylesheets/pep.css b/docutils/tools/stylesheets/pep.css deleted file mode 100644 index a82045bc9..000000000 --- a/docutils/tools/stylesheets/pep.css +++ /dev/null @@ -1,240 +0,0 @@ -/* -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:date: $Date$ -:version: $Revision$ -:copyright: This stylesheet has been placed in the public domain. - -Default cascading style sheet for the PEP HTML output of Docutils. -*/ - -.first { - margin-top: 0 } - -.last { - margin-bottom: 0 } - -.navigation { - width: 100% ; - background: #99ccff ; - margin-top: 0px ; - margin-bottom: 0px } - -.navigation .navicon { - width: 150px ; - height: 35px } - -.navigation .textlinks { - padding-left: 1em ; - text-align: left } - -.navigation td, .navigation th { - padding-left: 0em ; - padding-right: 0em ; - vertical-align: middle } - -.rfc2822 { - margin-top: 0.5em ; - margin-left: 0.5em ; - margin-right: 0.5em ; - margin-bottom: 0em } - -.rfc2822 td { - text-align: left } - -.rfc2822 th.field-name { - text-align: right ; - font-family: sans-serif ; - padding-right: 0.5em ; - font-weight: bold ; - margin-bottom: 0em } - -a.toc-backref { - text-decoration: none ; - color: black } - -body { - margin: 0px ; - margin-bottom: 1em ; - padding: 0px } - -dd { - margin-bottom: 0.5em } - -div.section { - margin-left: 1em ; - margin-right: 1em ; - margin-bottom: 1.5em } - -div.section div.section { - margin-left: 0em ; - margin-right: 0em ; - margin-top: 1.5em } - -div.abstract { - margin: 2em 5em } - -div.abstract p.topic-title { - font-weight: bold ; - text-align: center } - -div.attention, div.caution, div.danger, div.error, div.hint, -div.important, div.note, div.tip, div.warning { - margin: 2em ; - border: medium outset ; - padding: 1em } - -div.attention p.admonition-title, div.caution p.admonition-title, -div.danger p.admonition-title, div.error p.admonition-title, -div.warning p.admonition-title { - color: red ; - font-weight: bold ; - font-family: sans-serif } - -div.hint p.admonition-title, div.important p.admonition-title, -div.note p.admonition-title, div.tip p.admonition-title { - font-weight: bold ; - font-family: sans-serif } - -div.figure { - margin-left: 2em } - -div.footer, div.header { - font-size: smaller } - -div.footer { - margin-left: 1em ; - margin-right: 1em } - -div.system-messages { - margin: 5em } - -div.system-messages h1 { - color: red } - -div.system-message { - border: medium outset ; - padding: 1em } - -div.system-message p.system-message-title { - color: red ; - font-weight: bold } - -div.topic { - margin: 2em } - -h1 { - font-family: sans-serif ; - font-size: large } - -h2 { - font-family: sans-serif ; - font-size: medium } - -h3 { - font-family: sans-serif ; - font-size: small } - -h4 { - font-family: sans-serif ; - font-style: italic ; - font-size: small } - -h5 { - font-family: sans-serif; - font-size: x-small } - -h6 { - font-family: sans-serif; - font-style: italic ; - font-size: x-small } - -.section hr { - width: 75% } - -ol.simple, ul.simple { - margin-bottom: 1em } - -ol.arabic { - list-style: decimal } - -ol.loweralpha { - list-style: lower-alpha } - -ol.upperalpha { - list-style: upper-alpha } - -ol.lowerroman { - list-style: lower-roman } - -ol.upperroman { - list-style: upper-roman } - -p.caption { - font-style: italic } - -p.credits { - font-style: italic ; - font-size: smaller } - -p.label { - white-space: nowrap } - -p.topic-title { - font-family: sans-serif ; - font-weight: bold } - -pre.line-block { - font-family: serif ; - font-size: 100% } - -pre.literal-block, pre.doctest-block { - margin-left: 2em ; - margin-right: 2em ; - background-color: #eeeeee } - -span.classifier { - font-family: sans-serif ; - font-style: oblique } - -span.classifier-delimiter { - font-family: sans-serif ; - font-weight: bold } - -span.interpreted { - font-family: sans-serif } - -span.option-argument { - font-style: italic } - -span.pre { - white-space: pre } - -span.problematic { - color: red } - -table { - margin-top: 0.5em ; - margin-bottom: 0.5em } - -td, th { - padding-left: 0.5em ; - padding-right: 0.5em ; - vertical-align: top } - -td.num { - text-align: right } - -th.field-name { - font-weight: bold ; - text-align: left ; - white-space: nowrap } - -h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { - font-size: 100% } - -tt { - background-color: #eeeeee } - -ul.auto-toc { - list-style-type: none } diff --git a/docutils/tools/unicode2rstsubs.py b/docutils/tools/unicode2rstsubs.py deleted file mode 100755 index d5e259863..000000000 --- a/docutils/tools/unicode2rstsubs.py +++ /dev/null @@ -1,195 +0,0 @@ -#! /usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This program has been placed in the public domain. - -""" -unicode2subfiles.py -- produce character entity files (reSructuredText -substitutions) from the MathML master unicode.xml file. - -This program extracts character entity and entity set information from a -unicode.xml file and produces multiple reStructuredText files (in the current -directory) containing substitutions. Entity sets are from ISO 8879 & ISO -9573-13 (combined), MathML, and HTML4. One or two files are produced for each -entity set; a second file with a "-wide.txt" suffix is produced if there are -wide-Unicode characters in the set. - -The input file, unicode.xml, is maintained as part of the MathML 2 -Recommentation XML source, and is available at - (as of 2003-06-22). -""" - -import sys -import os -import optparse -import re -from xml.parsers.expat import ParserCreate - - -usage_msg = """Usage: %s [unicode.xml]""" - -def usage(prog, status=0, msg=None): - print >>sys.stderr, usage_msg % prog - if msg: - print >>sys.stderr, msg - sys.exit(status) - -def main(argv=None): - if argv is None: - argv = sys.argv - if len(argv) == 2: - inpath = argv[1] - elif len(argv) > 2: - usage(argv[0], 2, - 'Too many arguments (%s): only 1 expected.' % (len(argv) - 1)) - else: - inpath = 'unicode.xml' - if not os.path.isfile(inpath): - usage(argv[0], 1, 'No such file: "%s".' % inpath) - infile = open(inpath) - process(infile) - -def process(infile): - grouper = CharacterEntitySetExtractor(infile) - grouper.group() - grouper.write_sets() - - -class CharacterEntitySetExtractor: - - """ - Extracts character entity information from unicode.xml file, groups it by - entity set, and writes out reStructuredText substitution files. - """ - - unwanted_entity_sets = ['stix', # unknown, buggy set - 'predefined'] - - def __init__(self, infile): - self.infile = infile - """Input unicode.xml file.""" - - self.parser = self.setup_parser() - """XML parser.""" - - self.elements = [] - """Stack of element names. Last is current element.""" - - self.sets = {} - """Mapping of charent set name to set dict.""" - - self.charid = None - """Current character's "id" attribute value.""" - - self.descriptions = {} - """Mapping of character ID to description.""" - - def setup_parser(self): - parser = ParserCreate() - parser.StartElementHandler = self.StartElementHandler - parser.EndElementHandler = self.EndElementHandler - parser.CharacterDataHandler = self.CharacterDataHandler - return parser - - def group(self): - self.parser.ParseFile(self.infile) - - def StartElementHandler(self, name, attributes): - self.elements.append(name) - handler = name + '_start' - if hasattr(self, handler): - getattr(self, handler)(name, attributes) - - def EndElementHandler(self, name): - assert self.elements[-1] == name, \ - 'unknown end-tag %r (%r)' % (name, self.element) - self.elements.pop() - handler = name + '_end' - if hasattr(self, handler): - getattr(self, handler)(name) - - def CharacterDataHandler(self, data): - handler = self.elements[-1] + '_data' - if hasattr(self, handler): - getattr(self, handler)(data) - - def character_start(self, name, attributes): - self.charid = attributes['id'] - - def entity_start(self, name, attributes): - set = self.entity_set_name(attributes['set']) - if not set: - return - if not self.sets.has_key(set): - print 'bad set: %r' % set - return - entity = attributes['id'] - assert (not self.sets[set].has_key(entity) - or self.sets[set][entity] == self.charid), \ - ('sets[%r][%r] == %r (!= %r)' - % (set, entity, self.sets[set][entity], self.charid)) - self.sets[set][entity] = self.charid - - def description_data(self, data): - self.descriptions.setdefault(self.charid, '') - self.descriptions[self.charid] += data - - entity_set_name_pat = re.compile(r'[0-9-]*(.+)$') - """Pattern to strip ISO numbers off the beginning of set names.""" - - def entity_set_name(self, name): - """ - Return lowcased and standard-number-free entity set name. - Return ``None`` for unwanted entity sets. - """ - match = self.entity_set_name_pat.match(name) - name = match.group(1).lower() - if name in self.unwanted_entity_sets: - return None - self.sets.setdefault(name, {}) - return name - - def write_sets(self): - sets = self.sets.keys() - sets.sort() - for set_name in sets: - self.write_set(set_name) - - def write_set(self, set_name, wide=None): - if wide: - outname = set_name + '-wide.txt' - else: - outname = set_name + '.txt' - outfile = open(outname, 'w') - print 'writing file "%s"' % outname - set = self.sets[set_name] - entities = [(e.lower(), e) for e in set.keys()] - entities.sort() - longest = 0 - for _, entity_name in entities: - longest = max(longest, len(entity_name)) - has_wide = None - for _, entity_name in entities: - has_wide = self.write_entity( - set, set_name, entity_name, outfile, longest, wide) or has_wide - if has_wide and not wide: - self.write_set(set_name, 1) - - def write_entity(self, set, set_name, entity_name, outfile, longest, - wide=None): - charid = set[entity_name] - if not wide: - for code in charid[1:].split('-'): - if int(code, 16) > 0xFFFF: - return 1 # wide-Unicode character - codes = ' '.join(['U+%s' % code for code in charid[1:].split('-')]) - print >>outfile, ('.. %-*s unicode:: %s .. %s' - % (longest + 2, '|' + entity_name + '|', - codes, self.descriptions[charid])) - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/sandbox/README.txt b/sandbox/README.txt deleted file mode 100644 index a062608a2..000000000 --- a/sandbox/README.txt +++ /dev/null @@ -1,32 +0,0 @@ -===================== - README: The Sandbox -===================== - -The Sandbox_ is a place to play around, to try out and share ideas. -It's a part of the CVS repository but it isn't distributed as part of -Docutils_ releases. Each developer who wants to play here should -create their own subdirectory (suggested name: SourceForge ID, or -given name + family initial). - -It's OK to make a mess here! But please, play nice. - -For more information, please see the `Docutils Project Policies`_. - -.. _Sandbox: ./ -.. _Docutils: ../ -.. _Docutils Project Policies: ../spec/notes.html#project-policies - - -Sandbox Projects -================ - -.. contents:: :local: - -Project Infrastructure ----------------------- - -`docutils-update `_ is -a script that is installed as a cron job on SourceForge to -automatically update the Docutils_ web site whenever the CVS files -change. Any .html document with a corresponding .txt file is -regenerated whenever the .txt file changes. diff --git a/sandbox/aahz/OO/Makefile b/sandbox/aahz/OO/Makefile deleted file mode 100644 index 57b826b59..000000000 --- a/sandbox/aahz/OO/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -export PYTHON=python -export PYTHONPATH=$(HOME)/src/Lib-Python -MAIN=$(HOME)/write/effective/book - -CHAPTER=Way -CHAPTER=Control -CHAPTER=Objects -CHAPTER=Data - -SRCDIR=$(MAIN)/tmp/$(CHAPTER) -SRCDIR=$(MAIN)/Chapters/$(CHAPTER) -SRC=$(SRCDIR)/$(CHAPTER) - -DESTDIR=$(MAIN)/Output/$(CHAPTER) -DESTDIR=$(MAIN)/Output/upload -DEST=$(DESTDIR)/$(CHAPTER).sxw - -#DEST=$(MAIN)/Output/foo.xml - -GRAPH_TYPE=pdf -GRAPH_TYPE=eps - -test: - #$(PYTHON) force_mkdir.py $(DESTDIR) - $(PYTHON) graphics_output.py $(GRAPH_TYPE) $(SRCDIR) $(DESTDIR) - $(PYTHON) open_office.py $(SRC) $(DEST) - #$(PYTHON) publish.py $(SRC) > $(DEST) diff --git a/sandbox/aahz/OO/OOdirectives.py b/sandbox/aahz/OO/OOdirectives.py deleted file mode 100644 index e437f6fbf..000000000 --- a/sandbox/aahz/OO/OOdirectives.py +++ /dev/null @@ -1,72 +0,0 @@ -import sys -import os - -from docutils import nodes -from docutils.parsers.rst import directives -from docutils.parsers.rst.languages import en - -registry = directives._directive_registry -registry['index'] = ('OOdirectives', 'index_directive') -registry['include-code'] = ('OOdirectives', 'include_code') -registry['include-output'] = ('OOdirectives', 'include_output') - -en.directives['index'] = 'index' -en.directives['include-code'] = 'include-code' -en.directives['include-output'] = 'include-output' - - -class index_entry(nodes.General, nodes.Element): pass -class index_entry(nodes.Inline, nodes.TextElement): pass - -def index_directive(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - #nodes = [] - #for entry in content: - # nodes.append(index_entry(entry, entry)) - #return nodes - entries = '\n'.join(content) - return [index_entry(entries,entries)] - -index_directive.content = 1 - - - -def include_code(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - #obj = state_machine.document.attributes - #print >> sys.stderr, obj - #print >> sys.stderr, dir(obj) - document = state_machine.document - dirname = getDocDir(document) - fname = os.path.join(dirname, arguments[0]) - code = open(fname).read() - return [nodes.literal_block(code, code)] - -include_code.arguments = (0, 1, 0) - - - -def include_output(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - document = state_machine.document - dirname = getDocDir(document) - fname = os.path.join(dirname, arguments[0]) - cmd = os.environ['PYTHON'] + ' ' + fname - f_input, f_output = os.popen4(cmd) - output = f_output.read() - f_output.close() - return [nodes.literal_block(output, output)] - -include_output.arguments = (0, 1, 0) - - -def getDocDir(document): - source = document.current_source - if source is None: - return os.getcwd() - else: - dirname = os.path.dirname(os.path.abspath(source)) - if dirname is None: - return os.getcwd() - else: - return dirname diff --git a/sandbox/aahz/OO/OOtext.py b/sandbox/aahz/OO/OOtext.py deleted file mode 100644 index 9651a10c6..000000000 --- a/sandbox/aahz/OO/OOtext.py +++ /dev/null @@ -1,127 +0,0 @@ -# Can't have blank line at beginning of XML - -styles = ''' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -''' - -manifest = ''' - - - - - %s - -''' - -manifest_format = '' - -content_header = ''' - - - - - - - - - - - - - - - - -''' - -content_footer = ''' - -''' diff --git a/sandbox/aahz/OO/OOwriter.py b/sandbox/aahz/OO/OOwriter.py deleted file mode 100644 index 6a0841040..000000000 --- a/sandbox/aahz/OO/OOwriter.py +++ /dev/null @@ -1,676 +0,0 @@ -# Author: Aahz -# Contact: aahz@pythoncraft.com -# Revision: -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -OpenOffice writer - -The output is an OpenOffice.org 1.0-compatible document. -""" - -__docformat__ = 'reStructuredText' - - -import sys -from warnings import warn -import re - -import docutils -from docutils import nodes, utils, writers, languages - -import OOtext - - -section_styles = [ - '.ch title', - '.head 1', - '.head 2' - ] - -class Writer(writers.Writer): - - supported = ('OpenOffice') - """Formats this writer supports.""" - - def __init__(self): - writers.Writer.__init__(self) - self.output = None - self.translator_class = Translator - - def translate(self): - visitor = self.translator_class(self.document) - self.document.walkabout(visitor) - self.output = visitor.astext() - - -class Translator(nodes.NodeVisitor): - - header = [OOtext.content_header] - footer = [OOtext.content_footer] - - start_para = '\n\n' - end_para = '\n\n' - - start_charstyle = '' - end_charstyle = '' - - line_break = '\n' - re_spaces = re.compile(' +') - spaces = '' - - re_annotation = re.compile(r'#\d+(?:, #\d+)*$') - - def __init__(self, document): - nodes.NodeVisitor.__init__(self, document) - self.settings = document.settings - self.body = [] - self.section_level = 0 - self.skip_para_tag = False - - def astext(self): - return ''.join(self.header + self.body + self.footer) - - def encode(self, text): - """Encode special characters in `text` & return.""" - # @@@ A codec to do these and all other HTML entities would be nice. - text = text.replace("&", "&") - text = text.replace("<", "<") - text = text.replace('"', """) - text = text.replace(">", ">") - return text - - def compress_spaces(self, line): - while 1: - match = self.re_spaces.search(line) - if match: - start, end = match.span() - numspaces = end - start - line = line[:start] + (self.spaces % numspaces) + line[end:] - else: - break - return line - - def fix_annotation(self, line): - match = self.re_annotation.search(line) - if match: - pos = match.start() - line = line[:pos] + '|' + line[pos:] - return line - - def visit_Text(self, node): - self.body.append(self.encode(node.astext())) - - def depart_Text(self, node): - pass - - def visit_admonition(self, node, name): - self.skip_para_tag = True - self.body.append(self.start_para % '.CALLOUT') - - def depart_admonition(self): - self.body.append(self.end_para) - self.skip_para_tag = False - - def visit_attention(self, node): - self.visit_admonition(node, 'attention') - - def depart_attention(self, node): - self.depart_admonition() - - def visit_block_quote(self, node): - self.skip_para_tag = True - self.body.append(self.start_para % '.quotes') - - def depart_block_quote(self, node): - self.body.append(self.end_para) - self.skip_para_tag = False - - def visit_bullet_list(self, node): - self.body.append('\n\n') - - def depart_bullet_list(self, node): - self.body.append('\n') - - def visit_caption(self, node): - self.body.append(self.starttag(node, 'p', '', CLASS='caption')) - - def depart_caption(self, node): - self.body.append('

\n') - - def visit_caution(self, node): - self.visit_admonition(node, 'caution') - - def depart_caution(self, node): - self.depart_admonition() - - def visit_citation(self, node): - self.body.append(self.starttag(node, 'table', CLASS='citation', - frame="void", rules="none")) - self.footnote_backrefs(node) - - def depart_citation(self, node): - self.body.append('\n' - '\n\n') - - def visit_citation_reference(self, node): - href = '' - if node.has_key('refid'): - href = '#' + node['refid'] - elif node.has_key('refname'): - href = '#' + self.document.nameids[node['refname']] - self.body.append(self.starttag(node, 'a', '[', href=href, - CLASS='citation-reference')) - - def depart_citation_reference(self, node): - self.body.append(']') - - def visit_classifier(self, node): - self.body.append(' : ') - self.body.append(self.starttag(node, 'span', '', CLASS='classifier')) - - def depart_classifier(self, node): - self.body.append('') - - def visit_colspec(self, node): - self.colspecs.append(node) - - def depart_colspec(self, node): - pass - - def write_colspecs(self): - width = 0 - for node in self.colspecs: - width += node['colwidth'] - for node in self.colspecs: - colwidth = int(node['colwidth'] * 100.0 / width + 0.5) - self.body.append(self.emptytag(node, 'col', - colwidth='%i%%' % colwidth)) - self.colspecs = [] - - def visit_comment(self, node): - raise nodes.SkipNode - - def visit_decoration(self, node): - pass - - def depart_decoration(self, node): - pass - - def visit_definition(self, node): - self.body.append('\n') - self.body.append(self.starttag(node, 'dd', '')) - if len(node) and isinstance(node[0], nodes.paragraph): - node[0].set_class('first') - - def depart_definition(self, node): - self.body.append('\n') - - def visit_definition_list(self, node): - print node.astext() - self.body.append(self.starttag(node, 'dl')) - - def depart_definition_list(self, node): - self.body.append('\n') - - def visit_definition_list_item(self, node): - pass - - def depart_definition_list_item(self, node): - pass - - def visit_description(self, node): - self.body.append(self.starttag(node, 'td', '')) - if len(node) and isinstance(node[0], nodes.paragraph): - node[0].set_class('first') - - def depart_description(self, node): - self.body.append('') - - def visit_doctest_block(self, node): - self.visit_literal_block(node) - - def visit_document(self, node): - pass - - def depart_document(self, node): - pass - - def visit_emphasis(self, node): - self.body.append(self.start_charstyle % 'italic') - - def depart_emphasis(self, node): - self.body.append(self.end_charstyle) - - def visit_entry(self, node): - if isinstance(node.parent.parent, nodes.thead): - tagname = 'th' - else: - tagname = 'td' - atts = {} - if node.has_key('morerows'): - atts['rowspan'] = node['morerows'] + 1 - if node.has_key('morecols'): - atts['colspan'] = node['morecols'] + 1 - self.body.append(self.starttag(node, tagname, '', **atts)) - self.context.append('\n' % tagname.lower()) - if len(node) == 0: # empty cell - self.body.append(' ') - elif isinstance(node[0], nodes.paragraph): - node[0].set_class('first') - - def depart_entry(self, node): - self.body.append(self.context.pop()) - - def visit_enumerated_list(self, node): - """ - The 'start' attribute does not conform to HTML 4.01's strict.dtd, but - CSS1 doesn't help. CSS2 isn't widely enough supported yet to be - usable. - """ - atts = {} - if node.has_key('start'): - atts['start'] = node['start'] - if node.has_key('enumtype'): - atts['class'] = node['enumtype'] - # @@@ To do: prefix, suffix. How? Change prefix/suffix to a - # single "format" attribute? Use CSS2? - old_compact_simple = self.compact_simple - self.context.append((self.compact_simple, self.compact_p)) - self.compact_p = None - self.compact_simple = (self.options.compact_lists and - (self.compact_simple - or self.topic_class == 'contents' - or self.check_simple_list(node))) - if self.compact_simple and not old_compact_simple: - atts['class'] = (atts.get('class', '') + ' simple').strip() - self.body.append(self.starttag(node, 'ol', **atts)) - - def depart_enumerated_list(self, node): - self.compact_simple, self.compact_p = self.context.pop() - self.body.append('\n') - - def visit_error(self, node): - self.visit_admonition(node, 'error') - - def depart_error(self, node): - self.depart_admonition() - - def visit_field(self, node): - self.body.append(self.starttag(node, 'tr', '', CLASS='field')) - - def depart_field(self, node): - self.body.append('\n') - - def visit_field_body(self, node): - self.body.append(self.starttag(node, 'td', '', CLASS='field-body')) - if len(node) and isinstance(node[0], nodes.paragraph): - node[0].set_class('first') - - def depart_field_body(self, node): - self.body.append('\n') - - def visit_field_list(self, node): - self.body.append(self.starttag(node, 'table', frame='void', - rules='none', CLASS='field-list')) - self.body.append('\n' - '\n' - '\n') - - def depart_field_list(self, node): - self.body.append('\n\n') - - def visit_field_name(self, node): - atts = {} - if self.in_docinfo: - atts['class'] = 'docinfo-name' - else: - atts['class'] = 'field-name' - if len(node.astext()) > 14: - atts['colspan'] = 2 - self.context.append('\n ') - else: - self.context.append('') - self.body.append(self.starttag(node, 'th', '', **atts)) - - def depart_field_name(self, node): - self.body.append(':') - self.body.append(self.context.pop()) - - def visit_figure(self, node): - self.body.append(self.start_para % '.figure') - - def depart_figure(self, node): - self.body.append(self.end_para) - - def visit_footnote(self, node): - raise nodes.SkipNode - - def footnote_backrefs(self, node): - warn("footnote backrefs not available") - - def depart_footnote(self, node): - pass - - def visit_footnote_reference(self, node): - name = node['refid'] - id = node['id'] - number = node['auto'] - for footnote in self.document.autofootnotes: - if name == footnote['name']: - break - self.body.append('\n' % id) - self.body.append('\n' % number) - self.body.append('\n') - self.body.append(self.start_para % '.body') - for child in footnote.children: - if isinstance(child, nodes.paragraph): - self.body.append(child.astext()) - self.body.append(self.end_para) - self.body.append('\n') - self.body.append('') - raise nodes.SkipNode - - def depart_footnote_reference(self, node): - pass - - def visit_generated(self, node): - pass - - def depart_generated(self, node): - pass - - def visit_header(self, node): - self.context.append(len(self.body)) - - def depart_header(self, node): - start = self.context.pop() - self.body_prefix.append(self.starttag(node, 'div', CLASS='header')) - self.body_prefix.extend(self.body[start:]) - self.body_prefix.append('
\n
\n') - del self.body[start:] - - def visit_hint(self, node): - self.visit_admonition(node, 'hint') - - def depart_hint(self, node): - self.depart_admonition() - - def visit_image(self, node): - name = "Figure: %s\n" % node.attributes['uri'] - self.body.append(name) - - def depart_image(self, node): - pass - - def visit_important(self, node): - self.visit_admonition(node, 'important') - - def depart_important(self, node): - self.depart_admonition() - - def visit_index_entry(self, node): - index_format = '\n' - self.body.append(self.start_para % '.body') - entries = node.astext().split('\n') - for entry in entries: - self.body.append(index_format % self.encode(entry)) - self.body.append(self.end_para) - raise nodes.SkipNode - - def visit_interpreted(self, node): - # @@@ Incomplete, pending a proper implementation on the - # Parser/Reader end. - #self.body.append(node['role'] + ':') - self.body.append(node.astext()) - raise nodes.SkipNode - - def depart_interpreted(self, node): - pass - - # Don't need footnote labels/numbers - def visit_label(self, node): - print "!" - raise nodes.SkipNode - - def visit_legend(self, node): - self.body.append(self.starttag(node, 'div', CLASS='legend')) - - def depart_legend(self, node): - self.body.append('\n') - - def visit_line_block(self, node): - self.body.append(self.start_para % '.quotes') - lines = node.astext() - lines = lines.split('\n') - lines = self.line_break.join(lines) - self.body.append(lines) - self.body.append(self.end_para) - raise nodes.SkipNode - - def visit_list_item(self, node): - self.body.append('') - - def depart_list_item(self, node): - self.body.append('\n') - - def visit_literal(self, node): - self.body.append(self.start_charstyle % 'code') - - def depart_literal(self, node): - self.body.append(self.end_charstyle) - - def visit_literal_block(self, node): - self.body.append(self.start_para % '.code first') - self.body.append(self.end_para) - lines = self.encode(node.astext()) - lines = lines.split('\n') - while lines[-1] == '': - lines.pop() - for line in lines: - self.body.append(self.start_para % '.code') - line = self.fix_annotation(line) - line = self.compress_spaces(line) - self.body.append(line) - self.body.append(self.end_para) - self.body.append(self.start_para % '.code last') - self.body.append(self.end_para) - raise nodes.SkipNode - - def visit_note(self, node): - self.visit_admonition(node, '.note') - - def depart_note(self, node): - self.depart_admonition() - - def visit_option(self, node): - if self.context[-1]: - self.body.append(', ') - - def depart_option(self, node): - self.context[-1] += 1 - - def visit_option_argument(self, node): - self.body.append(node.get('delimiter', ' ')) - self.body.append(self.starttag(node, 'var', '')) - - def depart_option_argument(self, node): - self.body.append('') - - def visit_option_group(self, node): - atts = {} - if len(node.astext()) > 14: - atts['colspan'] = 2 - self.context.append('\n ') - else: - self.context.append('') - self.body.append(self.starttag(node, 'td', **atts)) - self.body.append('') - self.context.append(0) # count number of options - - def depart_option_group(self, node): - self.context.pop() - self.body.append('\n') - self.body.append(self.context.pop()) - - def visit_option_list(self, node): - self.body.append( - self.starttag(node, 'table', CLASS='option-list', - frame="void", rules="none")) - self.body.append('\n' - '\n' - '\n') - - def depart_option_list(self, node): - self.body.append('\n\n') - - def visit_option_list_item(self, node): - self.body.append(self.starttag(node, 'tr', '')) - - def depart_option_list_item(self, node): - self.body.append('\n') - - def visit_option_string(self, node): - self.body.append(self.starttag(node, 'span', '', CLASS='option')) - - def depart_option_string(self, node): - self.body.append('') - - def visit_paragraph(self, node): - if not self.skip_para_tag: - self.body.append(self.start_para % '.body') - - def depart_paragraph(self, node): - if not self.skip_para_tag: - self.body.append(self.end_para) - - def visit_problematic(self, node): - if node.hasattr('refid'): - self.body.append('' % (node['refid'], - node['id'])) - self.context.append('') - else: - self.context.append('') - self.body.append(self.starttag(node, 'span', '', CLASS='problematic')) - - def depart_problematic(self, node): - self.body.append('') - self.body.append(self.context.pop()) - - def visit_raw(self, node): - if node.has_key('format') and node['format'] == 'html': - self.body.append(node.astext()) - raise nodes.SkipNode - - def visit_reference(self, node): - pass - - def depart_reference(self, node): - pass - - def visit_row(self, node): - self.body.append(self.starttag(node, 'tr', '')) - - def depart_row(self, node): - self.body.append('\n') - - def visit_section(self, node): - self.section_level += 1 - - def depart_section(self, node): - self.section_level -= 1 - - def visit_strong(self, node): - self.body.append('') - - def depart_strong(self, node): - self.body.append('') - - def visit_table(self, node): - self.body.append( - self.starttag(node, 'table', CLASS="table", - frame='border', rules='all')) - - def depart_table(self, node): - self.body.append('\n') - - def visit_target(self, node): - if not (node.has_key('refuri') or node.has_key('refid') - or node.has_key('refname')): - self.body.append(self.starttag(node, 'a', '', CLASS='target')) - self.context.append('') - else: - self.context.append('') - - def depart_target(self, node): - self.body.append(self.context.pop()) - - def visit_tbody(self, node): - self.write_colspecs() - self.body.append(self.context.pop()) # '\n' or '' - self.body.append(self.starttag(node, 'tbody', valign='top')) - - def depart_tbody(self, node): - self.body.append('\n') - - def visit_term(self, node): - self.body.append(self.starttag(node, 'dt', '')) - - def depart_term(self, node): - """ - Leave the end tag to `self.visit_definition()`, in case there's a - classifier. - """ - pass - - def visit_tgroup(self, node): - # Mozilla needs : - self.body.append(self.starttag(node, 'colgroup')) - # Appended by thead or tbody: - self.context.append('\n') - - def depart_tgroup(self, node): - pass - - def visit_thead(self, node): - self.write_colspecs() - self.body.append(self.context.pop()) # '\n' - # There may or may not be a ; this is for to use: - self.context.append('') - self.body.append(self.starttag(node, 'thead', valign='bottom')) - - def depart_thead(self, node): - self.body.append('\n') - - def visit_tip(self, node): - self.visit_admonition(node, 'tip') - - def depart_tip(self, node): - self.depart_admonition() - - def visit_title(self, node): - """Only 3 section levels are supported by this writer.""" - title_tag = self.start_para % section_styles[self.section_level] - self.body.append(title_tag) - - def depart_title(self, node): - self.body.append(self.end_para) - - def visit_warning(self, node): - self.visit_admonition(node, 'warning') - - def depart_warning(self, node): - self.depart_admonition() - - def visit_system_message(self, node): - print node.astext() - - def depart_system_message(self, node): - pass - - def unknown_visit(self, node): - print "Failure processing at line", node.line - print "Failure is", node.astext() - raise NotImplementedError('visiting unimplemented node type: %s' - % node.__class__.__name__) diff --git a/sandbox/aahz/OO/graphics_output.py b/sandbox/aahz/OO/graphics_output.py deleted file mode 100644 index 35d2f9516..000000000 --- a/sandbox/aahz/OO/graphics_output.py +++ /dev/null @@ -1,28 +0,0 @@ -import sys -import os - -SOURCE_EXT = '.fig' - -TypeList = { - 'eps': { - 'ext': '.eps', - 'cmd': 'fig2dev -L eps %s %s' - }, - 'pdf': { - 'ext': '.pdf', - 'cmd': 'fig2dev -L pdf %s %s' - } - } - -type = TypeList[sys.argv[1]] -SourceDir = sys.argv[2] -DestDir = sys.argv[3] - -for name in os.listdir(SourceDir): - base, ext = os.path.splitext(name) - if ext == SOURCE_EXT: - src = SourceDir + '/' + name - dest = DestDir + '/' + base + type['ext'] - cmd = type['cmd'] % (src, dest) - print cmd - os.system(cmd) diff --git a/sandbox/aahz/OO/open_office.py b/sandbox/aahz/OO/open_office.py deleted file mode 100644 index 90e4c4393..000000000 --- a/sandbox/aahz/OO/open_office.py +++ /dev/null @@ -1,33 +0,0 @@ -import sys -import zipfile -from cStringIO import StringIO - -from docutils import core, io - -import OOdirectives -import OOtext -import OOwriter - -pub = core.Publisher(writer=OOwriter.Writer()) -pub.set_reader('standalone', None, 'restructuredtext') -settings = pub.get_settings() -pub.source = io.FileInput(settings, source_path=sys.argv[1]) -pub.destination = io.StringOutput(settings) -content = pub.publish() - -manifest_list = [ - ('content.xml', content), - ('styles.xml', OOtext.styles) - ] - -manifest_entries = [] -for docname, _ in manifest_list: - manifest_entries.append(OOtext.manifest_format % docname) -manifest = OOtext.manifest % '\n '.join(manifest_entries) -manifest_list.append( ('META-INF/manifest.xml', manifest) ) - -zip = zipfile.ZipFile(sys.argv[2], "w") -for docname, contents in manifest_list: - zinfo = zipfile.ZipInfo(docname) - zip.writestr(zinfo, contents) -zip.close() diff --git a/sandbox/aahz/OO/publish.py b/sandbox/aahz/OO/publish.py deleted file mode 100755 index 006d3fd97..000000000 --- a/sandbox/aahz/OO/publish.py +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env python - -# Author: David Goodger -# Contact: goodger@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -A minimal front end to the Docutils Publisher, producing pseudo-XML. -""" - -import locale -try: - locale.setlocale(locale.LC_ALL, '') -except: - pass - -from docutils.core import publish, default_description - -import OOdirectives - - -description = ('Generates pseudo-XML from standalone reStructuredText ' - 'sources (for testing purposes). ' + default_description) - -publish(description=description) diff --git a/sandbox/bbum/00README.txt b/sandbox/bbum/00README.txt deleted file mode 100644 index c5d461b6d..000000000 --- a/sandbox/bbum/00README.txt +++ /dev/null @@ -1,14 +0,0 @@ -======================= -bbum's Docutils sandbox -======================= - -:Author: Bill Bumgarner -:Contact: bbum@codefab.com -:Copyright: See individual modules for copyright & license information - -DocArticle -========== - -A plain HTML writer for Docutils. Produces non-CSS based HTML that is -compliant with the O'Reilly DevCenter's article submission guidelines. - diff --git a/sandbox/bbum/ChangeLog b/sandbox/bbum/ChangeLog deleted file mode 100644 index 598c618e5..000000000 --- a/sandbox/bbum/ChangeLog +++ /dev/null @@ -1,38 +0,0 @@ -2003-02-27 Bill Bumgarner - * DocArticle/DocArticle/__init__.py: Added sidebar and title_reference - support. - -2003-01-07 Bill Bumgarner - * DocArticle/DocArticle/__init__.py: Improved formatting of admonitions. - Sort of. Would like to make them better. Maybe add little icons, if - icons are enabled (need to fix settings). - * DocArticle/DocArticle/__init__.py: Improved formatting of - abstract/dedication block. Now in 'box' w/abstract/dedication centered - at top. Should all be in italics, but that'll hose the body formatting - of the contained text. - -2003-01-05 Bill Bumgarner - * DocArticle/DocArticle/__init__.py: Can now successfully [I think] - process test.txt. Output is not exactly pretty yet. - -2002-12-28 Bill Bumgarner - * Added support for subtitle, note, and block_quote. Cleaned up a - compile of CSS leftovers. - * DocArticle/DocArticle/__init__.py: Added support for arbitrary fields - and moved docinfo presentation to being table based (so that multiline - field values actually work). Lots of cleanup-- reordered a bunch of - methods that had gotten out of order. Added limited support for - Admonitions-- not at all useful yet. - (HTMLDocArticleTranslator.visit_enumerated_list): Added support for - enumerated lists and modified the paragraph tag rules for all lists. - (HTMLDocArticleTranslator.visit_enumerated_list): Added support for - non-css based typed enumerated lists. - -2002-12-27 Bill Bumgarner - * DocArticle/DocArticle/__init__.py: Added support for subtitle and - block_quote nodes. - * Added initial working implementation of DocArticle HTML writer. - * 00README.txt: Added basic information. - (HTMLDocArticleTranslator.__init__): Moved to a more traditional - initialization of instance variables. - diff --git a/sandbox/bbum/DocArticle/00README.txt b/sandbox/bbum/DocArticle/00README.txt deleted file mode 100644 index cf0061624..000000000 --- a/sandbox/bbum/DocArticle/00README.txt +++ /dev/null @@ -1,15 +0,0 @@ -========== -DocArticle -========== - -:Author: Bill Bumgarner -:Contact: bbum@codefab.com -:Copyright: 2002 - Bill Bumgarner - All Rights Reserved -:License: The MIT License -- see LICENSE.txt -:Abstract: A writer for Docutils_ that produces straight, non-CSS, HTML - output. - -A plain HTML writer for Docutils_. Produces non-CSS based HTML that is -compliant with the O'Reilly DevCenter's article submission guidelines. - -.. _Docutils: http://docutils.sourceforge.net/ diff --git a/sandbox/bbum/DocArticle/DocArticle/DocArticleText.py b/sandbox/bbum/DocArticle/DocArticle/DocArticleText.py deleted file mode 100644 index c9eec0f53..000000000 --- a/sandbox/bbum/DocArticle/DocArticle/DocArticleText.py +++ /dev/null @@ -1,37 +0,0 @@ -# Author: Bill Bumgarner -# Contact: bbum@codefab.com -# Copyright: 2002 - Bill Bumgarner - All Rights Reserved -# License: The MIT License -- see LICENSE.txt - -""" -Defines various chunks o' static text that are spewed into Articles. - -A sort of half-baked library of templates. Currently extremely limited in scope. -""" - -__docformat__ = 'reStructuredText' - -contentStart = """ - - -""" - -headerStart = """ - -""" - -titleStart = """ -""" -titleEnd = """ -""" - -headerEnd = """ -""" - -bodyStart = """ -""" -bodyEnd = """ -""" - -contentEnd = """ -""" diff --git a/sandbox/bbum/DocArticle/DocArticle/__init__.py b/sandbox/bbum/DocArticle/DocArticle/__init__.py deleted file mode 100644 index 68be34e09..000000000 --- a/sandbox/bbum/DocArticle/DocArticle/__init__.py +++ /dev/null @@ -1,941 +0,0 @@ -# Author: Bill Bumgarner -# Contact: bbum@codefab.com -# Copyright: 2002 - Bill Bumgarner - All Rights Reserved -# License: The MIT License -- see LICENSE.txt - -""" -This is the DocArticle package. - -This package provides a writer for DocUtils that spews HTML compliant -with O'Reilly's Dev Center article submission guidelines. -""" - -try: - x = True -except NameError: - True = 1 - False = 0 - -__docformat__ = 'reStructuredText' - -import sys -from warnings import warn -import re -from types import * - -import docutils -from docutils import nodes, utils, writers, languages - -from DocArticle import DocArticleText - -class DocArticleWriter(writers.Writer): - supported = ('html',) - """Formats this writer supports.""" - - output = None - """Final translated form of `document`.""" - - def __init__(self): - writers.Writer.__init__(self) - self.translator_class = HTMLDocArticleTranslator - - def translate(self): - visitor = self.translator_class(self.document) - self.document.walkabout(visitor) - self.output = visitor.astext() - -SpewNothing = 0 -SpewParagraph = 1 -SpewBreak = 2 -SpewBreakBreak = 3 -SpewNothingThenPara = 4 - -olTypeTranslator = { - 'arabic' : '1', - 'upperalpha' : 'A', - 'loweralpha' : 'a', - 'upperroman' : 'I', - 'lowerroman' : 'i' - } - -class HTMLDocArticleTranslator(nodes.NodeVisitor): - named_tags = {'a': 1, - 'applet': 1, - 'form': 1, - 'frame': 1, - 'iframe': 1, - 'img': 1, - 'map': 1} - - words_and_spaces = re.compile(r'\S+| +|\n') - - def __init__(self, document): - nodes.NodeVisitor.__init__(self, document) - self.section_level = 0 - self.headerContent = [] - self.bodyContent = [] - self.metaContent = [] - self.context = [] - self.spewTextContext = [True] - self.spewParaTag = [SpewParagraph] - self.paraFormat = [(None,None)] - self.colspecs = [] - - self.body_pre_docinfo = [] - self.docinfo = [] - self.compact_simple = None - self.compact_p = 1 - - self.firstFootnoteVisited = False - - # lcode = settings.language_code - lcode = 'en' - self.language = languages.get_language(lcode) - - def astext(self): - return ''.join([DocArticleText.contentStart, DocArticleText.headerStart] + - self.headerContent + - [DocArticleText.headerEnd, DocArticleText.bodyStart] + - self.body_pre_docinfo + self.docinfo + self.bodyContent + - [DocArticleText.bodyEnd, DocArticleText.contentEnd]) - - def encode(self, text): - """Encode special characters in `text` & return.""" - # @@@ A codec to do these and all other HTML entities would be nice. - text = text.replace('&', '&') - text = text.replace('<', '<') - text = text.replace('"', '"') - text = text.replace('>', '>') - return text - - def popAndAppend(self, node): - possiblePoppedContent = self.context.pop() - if possiblePoppedContent: - self.bodyContent.append(possiblePoppedContent) - - def attval(self, text, - whitespace=re.compile('[\n\r\t\v\f]')): - """Cleanse, HTML encode, and return attribute value text.""" - return self.encode(whitespace.sub(' ', text)) - - def emptytag(self, node, tagname, suffix='\n', **attributes): - """Construct and return an XML-compatible empty tag.""" - return self.starttag(node, tagname, suffix, infix=' /', **attributes) - - def starttag(self, node, tagname, suffix='\n', infix='', **attributes): - tagname = tagname.lower() - atts = {} - for (name, value) in attributes.items(): - atts[name.lower()] = value - for att in ('id',): # node attribute overrides - if node.has_key(att): - atts[att] = node[att] - if atts.has_key('id') and self.named_tags.has_key(tagname): - atts['name'] = atts['id'] # for compatibility with old browsers - attlist = atts.items() - attlist.sort() - parts = [tagname] - for name, value in attlist: - if value is None: # boolean attribute - # According to the HTML spec, ```` is good, - # ```` is bad. - # (But the XHTML (XML) spec says the opposite. ) - parts.append(name.lower()) - elif isinstance(value, ListType): - values = [str(v) for v in value] - parts.append('%s="%s"' % (name.lower(), - self.attval(' '.join(values)))) - else: - parts.append('%s="%s"' % (name.lower(), - self.attval(str(value)))) - return '<%s%s>%s' % (' '.join(parts), infix, suffix) - - def visit_Text(self, node): - if self.spewTextContext[-1]: - self.bodyContent.append(self.encode(node.astext())) - - def depart_Text(self, node): - pass - - def visit_address(self, node): - self.visit_docinfo_item(node, 'address', meta=None) - self.bodyContent.append(self.starttag(node, 'pre')) - - def depart_address(self, node): - self.bodyContent.append('\n\n') - self.depart_docinfo_item(node) - - def visit_admonition(self, node, name, admonitionCellAtts={}): - baseAdmonitionCellAtts = {"width" : "15%"} - baseAdmonitionCellAtts.update(admonitionCellAtts) - self.bodyContent.append('\n' - '
\n') - self.bodyContent.append(self.starttag(node, 'td', **baseAdmonitionCellAtts)) - self.bodyContent.append(self.language.labels[name.lower()]) - self.bodyContent.append('
') - - - def depart_admonition(self, node): - self.bodyContent.append('
') - - def visit_author(self, node): - self.visit_docinfo_item(node, 'Author') - - def depart_author(self, node): - self.depart_docinfo_item(node) - - def visit_authors(self, node): - pass - - def depart_authors(self, node): - pass - - def visit_attention(self, node): - self.visit_admonition(node, 'attention', admonitionCellAtts={"bgcolor":"#ffffcc"}) - - def depart_attention(self, node): - self.depart_admonition(node) - - def visit_block_quote(self, node): - self.bodyContent.append(self.starttag(node, 'blockquote')) - - def depart_block_quote(self, node): - self.bodyContent.append('\n') - - def visit_line_block(self, node): - self.bodyContent.append(self.starttag(node, 'pre')) - - def depart_line_block(self, node): - self.bodyContent.append('\n\n') - - def visit_bullet_list(self, node): - self.bodyContent.append(self.starttag(node, 'ul')) - self.spewParaTag.append(SpewNothing) - - def depart_bullet_list(self, node): - self.bodyContent.append('\n') - self.spewParaTag.pop() - - def visit_caption(self, node): - self.bodyContent.append(self.starttag(node, 'p', '')) - - def depart_caption(self, node): - self.bodyContent.append('

\n') - - def visit_caution(self, node): - self.visit_admonition(node, 'caution', admonitionCellAtts={"bgcolor":"#ffff99"}) - - def depart_caution(self, node): - self.depart_admonition(node) - - def visit_citation(self, node): - ##! verify col configuration - self.bodyContent.append(self.starttag(node, 'table')) - self.bodyContent.append('\n' - '\n' - '\n' - '') - self.footnote_backrefs(node) - - def depart_citation(self, node): - self.bodyContent.append('\n' - '\n\n') - - def visit_citation_reference(self, node): - href = '' - if node.has_key('refid'): - href = '#' + node['refid'] - elif node.has_key('refname'): - href = '#' + self.document.nameids[node['refname']] - self.bodyContent.append(self.starttag(node, 'a', '[', href=href)) - - def depart_citation_reference(self, node): - self.bodyContent.append(']') - - def visit_classifier(self, node): - pass - - def depart_classifier(self, node): - pass - - def visit_colspec(self, node): - self.colspecs.append(node) - - def depart_colspec(self, node): - pass - - def write_colspecs(self): - ##! verify - width = 0 - for node in self.colspecs: - width += node['colwidth'] - for node in self.colspecs: - colwidth = int(node['colwidth'] * 100.0 / width + 0.5) - self.bodyContent.append(self.emptytag(node, 'col', width='%i%%' % colwidth)) - self.colspecs = [] - - def visit_comment(self, node, sub=re.compile('-(?=-)').sub): - self.bodyContent.append('\n' % sub('- ', node.astext())) - raise nodes.SkipNode - - def visit_contact(self, node): - self.visit_docinfo_item(node, 'Contact') - - def depart_contact(self, node): - self.depart_docinfo_item(node) - - def visit_copyright(self, node): - self.visit_docinfo_item(node, 'copyright') - - def depart_copyright(self, node): - self.depart_docinfo_item(node) - - def visit_danger(self, node): - self.visit_admonition(node, 'danger', admonitionCellAtts={"bgcolor":"#ff6666"}) - - def depart_danger(self, node): - self.depart_admonition(node) - - def visit_date(self, node): - self.visit_docinfo_item(node, 'date') - - def depart_date(self, node): - self.depart_docinfo_item(node) - - def visit_decoration(self, node): - pass - - def depart_decoration(self, node): - pass - - def visit_definition(self, node): - self.bodyContent.append('\n') - self.bodyContent.append(self.starttag(node, 'dd', '')) - - def depart_definition(self, node): - self.bodyContent.append('\n') - - def visit_definition_list(self, node): - self.bodyContent.append(self.starttag(node, 'dl')) - - def depart_definition_list(self, node): - self.bodyContent.append('\n') - - def visit_definition_list_item(self, node): - pass - - def depart_definition_list_item(self, node): - pass - - def visit_description(self, node): - self.bodyContent.append(self.starttag(node, 'td', '')) - - def depart_description(self, node): - self.bodyContent.append('') - - def visit_docinfo(self, node): - self.context.append(len(self.bodyContent)) - self.bodyContent.append(self.starttag(node, 'table')) - self.bodyContent.append('\n') - self.in_docinfo = 1 - - def depart_docinfo(self, node): - self.bodyContent.append('\n\n') - self.in_docinfo = None - start = self.context.pop() - self.body_pre_docinfo = self.bodyContent[:start] - self.docinfo = self.bodyContent[start:] - self.bodyContent = [] - - def visit_docinfo_item(self, node, name, meta=1): - if meta: - self.headerContent.append('\n' % - (name, self.attval(node.astext()))) - self.bodyContent.append(self.starttag(node, 'tr', '')) - self.bodyContent.append('%s:\n' % self.language.labels[name.lower()]) - - def depart_docinfo_item(self, node): - self.bodyContent.append('\n') - - def visit_doctest_block(self, node): - self.bodyContent.append(self.starttag(node, 'pre')) - - def depart_doctest_block(self, node): - self.bodyContent.append('\n\n') - - def visit_document(self, node): - pass - - def depart_document(self, node): - pass - - def visit_emphasis(self, node): - self.bodyContent.append('') - - def depart_emphasis(self, node): - self.bodyContent.append('') - - def visit_entry(self, node): - if isinstance(node.parent.parent, nodes.thead): - tagname = 'th' - else: - tagname = 'td' - atts = {} - if node.has_key('morerows'): - atts['rowspan'] = node['morerows'] + 1 - if node.has_key('morecols'): - atts['colspan'] = node['morecols'] + 1 - self.bodyContent.append(self.starttag(node, tagname, '', **atts)) - self.context.append('\n' % tagname.lower()) - if len(node) == 0: # empty cell - self.bodyContent.append(' ') - - def depart_entry(self, node): - self.bodyContent.append(self.context.pop()) - - def visit_enumerated_list(self, node): - atts = {} - if node.has_key('start'): - atts['start'] = node['start'] - if node.has_key('enumtype'): - atts['type'] = olTypeTranslator[node['enumtype']] - self.bodyContent.append(self.starttag(node, 'ol', **atts)) - - def depart_enumerated_list(self, node): - self.bodyContent.append('\n') - - def visit_error(self, node): - self.visit_admonition(node, 'error', admonitionCellAtts={"bgcolor":"#ff6666"}) - - def depart_error(self, node): - self.depart_admonition(node) - - def visit_field(self, node): - self.bodyContent.append(self.starttag(node, 'tr', '')) - - def depart_field(self, node): - self.bodyContent.append('\n') - - def visit_field_body(self, node): - self.bodyContent.append(self.starttag(node, 'td', '')) - self.spewParaTag.append(SpewBreak) - - def depart_field_body(self, node): - self.bodyContent.append('\n') - self.spewParaTag.pop() - - def visit_field_list(self, node): - self.bodyContent.append(self.starttag(node, 'table')) - self.bodyContent.append('\n') - - def depart_field_list(self, node): - self.bodyContent.append('\n\n') - - def visit_field_name(self, node): - atts = {} - if len(node.astext()) > 14: - atts['colspan'] = 2 - self.context.append('\n ') - else: - self.context.append('') - self.bodyContent.append(self.starttag(node, 'th', '', **atts)) - - def depart_field_name(self, node): - self.bodyContent.append(':') - self.bodyContent.append(self.context.pop()) - - def visit_figure(self, node): - self.bodyContent.append(self.starttag(node, 'div')) - - def depart_figure(self, node): - self.bodyContent.append('\n') - - def check_simple_list(self, node): - """Check for a simple list that can be rendered compactly.""" - visitor = SimpleListChecker(self.document) - try: - node.walk(visitor) - except nodes.NodeFound: - return None - else: - return 1 - - def visit_footnote(self, node): - if not self.firstFootnoteVisited: - self.bodyContent.append('
') - self.firstFootnoteVisited = True - self.bodyContent.append(self.starttag(node, 'table')) - self.bodyContent.append('\n') - self.spewParaTag.append(SpewBreak) - self.footnote_backrefs(node) - - def footnote_backrefs(self, node): - # if self.settings.footnote_backlinks and node.hasattr('backrefs'): - if node.hasattr('backrefs'): - backrefs = node['backrefs'] - if len(backrefs) == 1: - self.context.append('') - self.context.append('' % (backrefs[0], node['id'])) - else: - i = 1 - backlinks = [] - for backref in backrefs: - backlinks.append('%s' % (backref, i)) - i += 1 - self.context.append('(%s) ' % ', '.join(backlinks)) - self.context.append('' % node['id']) - else: - self.context.append('') - self.context.append('' % node['id']) - - def depart_footnote(self, node): - self.spewParaTag.pop() - self.paraFormat.pop() - self.bodyContent.append('\n\n\n') - - def visit_footnote_reference(self, node): - href = '' - if node.has_key('refid'): - href = '#' + node['refid'] - elif node.has_key('refname'): - href = '#' + self.document.nameids[node['refname']] - # format = self.settings.footnote_references - format = 'superscript' - if format == 'brackets': - suffix = '[' - self.context.append(']') - elif format == 'superscript': - suffix = '' - self.context.append('') - else: # shouldn't happen - suffix = '???' - self.content.append('???') - self.bodyContent.append('') - self.bodyContent.append(suffix) - self.bodyContent.append(self.starttag(node, 'a', '', href=href)) - - def depart_footnote_reference(self, node): - self.bodyContent.append('') - self.bodyContent.append(self.context.pop()) - self.bodyContent.append('') - - def visit_generated(self, node): - pass - - def depart_generated(self, node): - pass - - def visit_hint(self, node): - self.visit_admonition(node, 'hint', admonitionCellAtts={"bgcolor":"#99ff99"}) - - def depart_hint(self, node): - self.depart_admonition(node) - - def visit_image(self, node): - atts = node.attributes.copy() - atts['src'] = atts['uri'] - del atts['uri'] - if not atts.has_key('alt'): - atts['alt'] = atts['src'] - if isinstance(node.parent, nodes.TextElement): - self.context.append(None) - else: - self.bodyContent.append('

') - self.context.append('

\n') - self.bodyContent.append(self.emptytag(node, 'img', '', **atts)) - - depart_image = popAndAppend - - def visit_important(self, node): - self.visit_admonition(node, 'important', admonitionCellAtts={"bgcolor":"#ffcccc"}) - - def depart_important(self, node): - self.depart_admonition(node) - - def visit_interpreted(self, node): - ###! no idea what to do here - pass - - def depart_interpreted(self, node): - pass - - def visit_label(self, node): - self.bodyContent.append(self.starttag(node, 'td', '[%s' % self.context.pop())) - - def depart_label(self, node): - self.paraFormat.append(('', '')) - self.bodyContent.append(']%s' % self.context.pop()) - - def visit_legend(self, node): - self.bodyContent.append(self.starttag(node, 'div')) - - def depart_legend(self, node): - self.bodyContent.append('\n') - - def visit_list_item(self, node): - self.bodyContent.append(self.starttag(node, 'li', '')) - self.spewParaTag.append(SpewNothingThenPara) - - def depart_list_item(self, node): - self.bodyContent.append('\n') - self.spewParaTag.pop() - - def visit_literal(self, node): - self.bodyContent.append(self.starttag(node, 'code', '')) - text = node.astext() - for token in self.words_and_spaces.findall(text): - if token.strip(): - # Protect text like "--an-option" from bad line wrapping: - self.bodyContent.append('%s' % self.encode(token)) - elif token in ('\n', ' '): - # Allow breaks at whitespace: - self.bodyContent.append(token) - else: - # Protect runs of multiple spaces; the last space can wrap: - self.bodyContent.append(' ' * (len(token) - 1) + ' ') - self.bodyContent.append('
') - # Content already processed: - raise nodes.SkipNode - - def visit_literal_block(self, node): - self.bodyContent.append(self.starttag(node, 'pre')) - - def depart_literal_block(self, node): - self.bodyContent.append('\n\n') - - def visit_meta(self, node): - self.headerContent.append(self.emptytag(node, 'meta', **node.attributes)) - - def depart_meta(self, node): - pass - - def visit_note(self, node): - self.visit_admonition(node, 'note') - - def depart_note(self, node): - self.depart_admonition(node) - - def visit_option(self, node): - if self.context[-1]: - self.bodyContent.append(', ') - - def depart_option(self, node): - self.context[-1] += 1 - - def visit_option_argument(self, node): - self.bodyContent.append(node.get('delimiter', ' ')) - self.bodyContent.append(self.starttag(node, 'var', '')) - - def depart_option_argument(self, node): - self.bodyContent.append('') - - def visit_option_group(self, node): - atts = {} - if len(node.astext()) > 14: - atts['colspan'] = 2 - self.context.append('\n ') - else: - self.context.append('') - self.bodyContent.append(self.starttag(node, 'td', **atts)) - self.bodyContent.append('') ###! What tag is this? - self.context.append(0) # count number of options - - def depart_option_group(self, node): - self.context.pop() - self.bodyContent.append('\n') - self.bodyContent.append(self.context.pop()) - - def visit_option_list(self, node): - self.bodyContent.append(self.starttag(node, 'table')) - self.bodyContent.append('\n') - - def depart_option_list(self, node): - self.bodyContent.append('\n\n') - - def visit_option_list_item(self, node): - self.bodyContent.append(self.starttag(node, 'tr', '')) - - def depart_option_list_item(self, node): - self.bodyContent.append('\n') - - def visit_option_string(self, node): - self.bodyContent.append(self.starttag(node, 'span', '')) - - def depart_option_string(self, node): - self.bodyContent.append('') - - def visit_organization(self, node): - self.visit_docinfo_item(node, 'organization') - - def depart_organization(self, node): - self.depart_docinfo_item(node) - - def visit_paragraph(self, node): - currentSpewParaTag = self.spewParaTag[-1] - if currentSpewParaTag == SpewParagraph: - self.bodyContent.append(self.starttag(node, 'p', '')) - self.context.append('

\n') - elif currentSpewParaTag == SpewBreak: - self.context.append('
\n') - elif currentSpewParaTag == SpewBreakBreak: - self.context.append('

\n') - elif currentSpewParaTag == SpewNothingThenPara: - self.context.append(None) - self.spewParaTag[-1] = SpewParagraph - else: - self.context.append(None) - - start, end = self.paraFormat[-1] - if start: - self.bodyContent.append(start) - if end: - self.context.append(end) - else: - self.context.append(None) - - def depart_paragraph(self, node): - self.popAndAppend(node) # pop end formatting tag, if any - self.popAndAppend(node) # pop end paragraph tag, if any - - def visit_problematic(self, node): - if node.hasattr('refid'): - self.bodyContent.append('' % (node['refid'], node['id'])) - self.context.append('') - else: - self.context.append('') - self.bodyContent.append(self.starttag(node, 'span', '')) - - def depart_problematic(self, node): - self.bodyContent.append('') - self.bodyContent.append(self.context.pop()) - - def visit_reference(self, node): - if node.has_key('refuri'): - href = node['refuri'] - elif node.has_key('refid'): - href = '#' + node['refid'] - elif node.has_key('refname'): - href = '#' + self.document.nameids[node['refname']] - self.bodyContent.append(self.starttag(node, 'a', '', href=href)) - self.context.append('') - - depart_reference = popAndAppend - - def visit_revision(self, node): - self.visit_docinfo_item(node, 'revision') - - def depart_revision(self, node): - self.depart_docinfo_item(node) - - def visit_row(self, node): - self.bodyContent.append(self.starttag(node, 'tr', '')) - - def depart_row(self, node): - self.bodyContent.append('\n') - - def visit_section(self, node): - self.section_level += 1 - #hTag = 'h%s'% self.section_level - #self.bodyContent.append(self.starttag(node, hTag)) - #self.bodyContent.append('\n' % hTag) - - def depart_section(self, node): - self.section_level -= 1 - - def visit_sidebar(self, node): - self.bodyContent.append('
') - self.bodyContent.append('
') - - def depart_sidebar(self, node): - self.bodyContent.append('
\n') - self.bodyContent.append('
') - - def visit_status(self, node): - self.visit_docinfo_item(node, 'status', meta=None) - - def depart_status(self, node): - self.depart_docinfo_item(node) - - def visit_strong(self, node): - self.bodyContent.append('') - - def depart_strong(self, node): - self.bodyContent.append('') - - def visit_substitution_definition(self, node): - raise nodes.SkipNode # internal - - def visit_substitution_reference(self, node): - pass - - def visit_subtitle(self, node): - self.bodyContent.append(self.starttag(node, 'h3', '')) - - def depart_subtitle(self, node): - self.bodyContent.append('\n') - - def visit_table(self, node): - self.bodyContent.append(self.starttag(node, 'table')) - - def depart_table(self, node): - self.bodyContent.append('\n') - - def visit_target(self, node): - if not (node.has_key('refuri') or node.has_key('refid') or node.has_key('refname')): - self.bodyContent.append(self.starttag(node, 'a', '')) - self.context.append('') - else: - self.context.append(None) - - depart_target = popAndAppend - - def visit_tbody(self, node): - self.write_colspecs() - self.bodyContent.append(self.context.pop()) # '\n' or '' - self.bodyContent.append(self.starttag(node, 'tbody', valign='top')) - - def depart_tbody(self, node): - self.bodyContent.append('\n') - - def visit_term(self, node): - self.bodyContent.append(self.starttag(node, 'dt', '')) - - def depart_term(self, node): - pass - - def visit_tgroup(self, node): - ###! verify - # Mozilla needs : - self.bodyContent.append(self.starttag(node, 'colgroup')) - # Appended by thead or tbody: - self.context.append('\n') - - def depart_tgroup(self, node): - pass - - def visit_thead(self, node): - self.write_colspecs() - self.bodyContent.append(self.context.pop()) # '\n' - # There may or may not be a ; this is for to use: - self.context.append('') - self.bodyContent.append(self.starttag(node, 'thead', valign='bottom')) - - def depart_thead(self, node): - self.bodyContent.append('\n') - - def visit_tip(self, node): - self.visit_admonition(node, 'tip') - - def depart_tip(self, node): - self.depart_admonition(node) - - def visit_title(self, node): - if isinstance(node.parent, nodes.topic) and (node.parent.attributes.get('name', None) != 'contents'): - self.bodyContent.append('
') - if node.parent.hasattr('id'): - self.bodyContent.append(self.starttag({},'a','',name=node.parent['id'])) - self.context.append('

\n') - else: - self.context.append('
\n') - elif self.section_level == 0: - self.headerContent.append(DocArticleText.titleStart) - self.headerContent.append(self.encode(node.astext())) - self.headerContent.append(DocArticleText.titleEnd) - self.bodyContent.append(self.starttag(node, 'h2', '')) - self.context.append('\n') - else: - ### O'Reilly uses h2 to denote title and h3 for all sections. In theory, - ### nothing should hang below h3. In practice, we leave it up to the - ### author. - level = self.section_level + 1 - self.bodyContent.append(self.starttag(node, 'h%s' % level, '')) - atts = {} - if node.parent.hasattr('id'): - atts['name'] = node.parent['id'] - if node.hasattr('refid'): - atts['href'] = '#' + node['refid'] - self.bodyContent.append(self.starttag({}, 'a', '', **atts)) - self.context.append('\n' % level) - - def depart_title(self, node): - self.popAndAppend(node) - - def visit_title_reference(self, node): - self.bodyContent.append(self.starttag(node, 'cite', '')) - - def depart_title_reference(self, node): - self.bodyContent.append('') - - def visit_topic(self, node): - if node.attributes.get('name', None) != 'contents': - self.spewParaTag.append(SpewNothingThenPara) - self.bodyContent.append('
') - - def depart_topic(self, node): - if node.attributes.get('name', None) != 'contents': - self.bodyContent.append('
\n') - self.spewParaTag.pop() - - def visit_transition(self, node): - self.bodyContent.append(self.emptytag(node, 'hr')) - - def depart_transition(self, node): - pass - - def visit_version(self, node): - self.visit_docinfo_item(node, 'version') - - def depart_version(self, node): - self.depart_docinfo_item(node) - - def visit_warning(self, node): - self.visit_admonition(node, 'warning', admonitionCellAtts={"bgcolor":"#ffff33"}) - - def depart_warning(self, node): - self.depart_admonition(node) - - def unknown_visit(self, node): - print 'Node: %s' % node.__class__.__name__ - print "Failure processing at line (%s) of node:\n %s" % (node.line, node.pformat()) - raise NotImplementedError('visiting unknown node type: %s' - % node.__class__.__name__) - - def visit_system_message(self, node): - if node['level'] < self.document.reporter['writer'].report_level: - # Level is too low to display: - raise nodes.SkipNode - self.bodyContent.append(self.starttag(node, 'div')) - self.bodyContent.append('

') - attr = {} - backref_text = '' - if node.hasattr('id'): - attr['name'] = node['id'] - if node.hasattr('backrefs'): - backrefs = node['backrefs'] - if len(backrefs) == 1: - backref_text = ('; backlink' - % backrefs[0]) - else: - i = 1 - backlinks = [] - for backref in backrefs: - backlinks.append('%s' % (backref, i)) - i += 1 - backref_text = ('; backlinks: %s' - % ', '.join(backlinks)) - if node.hasattr('line'): - line = ', line %s' % node['line'] - else: - line = '' - if attr: - a_start = self.starttag({}, 'a', '', **attr) - a_end = '' - else: - a_start = a_end = '' - self.bodyContent.append('System Message: %s%s/%s%s (%s%s)%s

\n' - % (a_start, node['type'], node['level'], a_end, - node['source'], line, backref_text)) - - def depart_system_message(self, node): - self.bodyContent.append('\n') - diff --git a/sandbox/bbum/DocArticle/LICENSE.txt b/sandbox/bbum/DocArticle/LICENSE.txt deleted file mode 100644 index 435339fe2..000000000 --- a/sandbox/bbum/DocArticle/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -(This is the MIT license) - - Copyright (c) 2002 - Bill Bumgarner - All Rights Reserved. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - diff --git a/sandbox/bbum/DocArticle/docarticle.py b/sandbox/bbum/DocArticle/docarticle.py deleted file mode 100755 index fe1f68c78..000000000 --- a/sandbox/bbum/DocArticle/docarticle.py +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env python - -# Author: Bill Bumgarner -# Contact: bbum@codefab.com -# Copyright: This module has been placed in the public domain. - -""" -docarticle.py -============= - -This module provides a simple command line interface that uses the -DocArticle HTML writer to produce plain HTML output from -ReStructuredText source. -""" - -import locale -try: - locale.setlocale(locale.LC_ALL, '') -except: - pass - -from docutils.core import publish_cmdline, default_description -from DocArticle import DocArticleWriter - -description = ("Generates plain HTML. " + default_description) - -publish_cmdline(writer=DocArticleWriter(), description=description) diff --git a/sandbox/bbum/DocArticle/setup.py b/sandbox/bbum/DocArticle/setup.py deleted file mode 100755 index 8557e4554..000000000 --- a/sandbox/bbum/DocArticle/setup.py +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env python - -# Author: Bill Bumgarner -# Contact: bbum@codefab.com -# Copyright: 2002 - Bill Bumgarner - All Rights Reserved -# License: The MIT License -- see LICENSE.txt - -from distutils.core import setup - -setup(name = "DocArticle", - version = "0.1", - description = "Turn reStructuredText source into O'Reilly DevCenter compatible HTML.", - author = "Bill Bumgarner", - url = "mailto:bbum@codefab.com", - author_email = "bbum@codefab.com", - packages = ['DocArticle'], - scripts = ['docarticle.py'] - ) diff --git a/sandbox/blais/css_tricks/README.txt b/sandbox/blais/css_tricks/README.txt deleted file mode 100644 index 9920d5968..000000000 --- a/sandbox/blais/css_tricks/README.txt +++ /dev/null @@ -1,12 +0,0 @@ -.. -*- mode: text; fill-column: 70; truncate-lines: t -*- - -========== -CSS Tricks -========== - -:Author: Martin Blais -:Date: $Date$ - -This mini-project is meant to contain neat tricks with cascading -stylesheet to spice up the looks of reST documents converted to HTML -with the default HTML converter. diff --git a/sandbox/blais/css_tricks/boxed_titles/castro.png b/sandbox/blais/css_tricks/boxed_titles/castro.png deleted file mode 100644 index b75456b6b..000000000 Binary files a/sandbox/blais/css_tricks/boxed_titles/castro.png and /dev/null differ diff --git a/sandbox/blais/css_tricks/boxed_titles/clinton.png b/sandbox/blais/css_tricks/boxed_titles/clinton.png deleted file mode 100644 index eb13abd8d..000000000 Binary files a/sandbox/blais/css_tricks/boxed_titles/clinton.png and /dev/null differ diff --git a/sandbox/blais/css_tricks/boxed_titles/docutils.conf b/sandbox/blais/css_tricks/boxed_titles/docutils.conf deleted file mode 100644 index 21677a51f..000000000 --- a/sandbox/blais/css_tricks/boxed_titles/docutils.conf +++ /dev/null @@ -1,3 +0,0 @@ -[options] - -stylesheet-path: style.css diff --git a/sandbox/blais/css_tricks/boxed_titles/index.txt b/sandbox/blais/css_tricks/boxed_titles/index.txt deleted file mode 100644 index 07e894063..000000000 --- a/sandbox/blais/css_tricks/boxed_titles/index.txt +++ /dev/null @@ -1,37 +0,0 @@ -.. -*- mode: rst; -*- - -.. image:: castro.png - :align: left - -Box Title -========= - -.. .. raw:: html -.. -.. My Face -..

Viva Los Boxed Titles!

- -This is a trick that shows how to do a kind of slightly fancier heading with an -image by using a tiny bit of raw HTML and CSS. There would be a way to minimize -the few raw HTML directives that this requires: - -From : - -Add a "class" option to many/most directives, to set an arbitrary "class" -attribute on the enclosing element? Perhaps "name" as well? - -It may be useful to add an option [*] to the HTML writer to restrict the -document title to only, and not include it in the document body. -As for the "raw" stuff, a combination of the "image" directive's "align" option, -the yet-to-be-implemented "class" directive, and stylesheet magic may allow such -effects without resorting to raw HTML. - -We continue with a similar trick for the bottom part. - -.. raw:: html - - <img SRC="clinton.png" class="home-image2" /> - <h2 class="box-title">I love boxed titles too!</h2> - -Oh yeah! - diff --git a/sandbox/blais/css_tricks/boxed_titles/style.css b/sandbox/blais/css_tricks/boxed_titles/style.css deleted file mode 100644 index 9fe378f1e..000000000 --- a/sandbox/blais/css_tricks/boxed_titles/style.css +++ /dev/null @@ -1,16 +0,0 @@ -.home-image1 { float: left; border: 0; padding: 5px; } -.home-image2 { float: right; border: 0; padding: 5px; } - -H1 { - background-color: #EEF; - border: thin dashed black; - padding: 10px; - margin: 20px -} - -.box-title { - background-color: #EEF; - border: thin dashed black; - padding: 10px; - margin: 20px -} diff --git a/sandbox/blais/css_tricks/section_based/docutils.conf b/sandbox/blais/css_tricks/section_based/docutils.conf deleted file mode 100644 index 21677a51f..000000000 --- a/sandbox/blais/css_tricks/section_based/docutils.conf +++ /dev/null @@ -1,3 +0,0 @@ -[options] - -stylesheet-path: style.css diff --git a/sandbox/blais/css_tricks/section_based/index.txt b/sandbox/blais/css_tricks/section_based/index.txt deleted file mode 100644 index fcec84658..000000000 --- a/sandbox/blais/css_tricks/section_based/index.txt +++ /dev/null @@ -1,35 +0,0 @@ -.. -*- mode: rst; -*- - -========================= -Section-Based CSS Changes -========================= - -Introduction ------------- - -In this example, we just want to demonstrate simply that one can customize the -content style by using CSS with the automatically-generated title classes. - -This is a bit of a hack but it can be useful under some circumstances. - -Red Section ------------ - -For example, this section contains red items. - -* Yes, this should be read. -* No, you must be ``red``. - - -Green Section -------------- - -* But here we turn green. - - -Blue Section ------------- - -* A problem with this approach is that if you change the section title the CSS - file has to be changed as well. - diff --git a/sandbox/blais/css_tricks/section_based/style.css b/sandbox/blais/css_tricks/section_based/style.css deleted file mode 100644 index 6754ed865..000000000 --- a/sandbox/blais/css_tricks/section_based/style.css +++ /dev/null @@ -1,11 +0,0 @@ -.section#red-section LI { - color: red; -} - -.section#green-section LI { - color: green; -} - -.section#blue-section LI { - color: blue; -} diff --git a/sandbox/davidg/infrastructure/docutils-update b/sandbox/davidg/infrastructure/docutils-update deleted file mode 100755 index 12d7640ac..000000000 --- a/sandbox/davidg/infrastructure/docutils-update +++ /dev/null @@ -1,109 +0,0 @@ -#! /bin/sh -# $Id$ -# -# This script is installed as a cron job to automatically update the -# Docutils web site whenever the CVS files change. Any .html document -# with a corresponding .txt file is regenerated whenever the .txt -# changes. -# -# Options: -# -e Access CVS as current user ("ext" instead of "pserver"; requires -# authentication). -# -p Run from the project directory. -# -t Run the script in trace mode ("set -o xtrace"). -# -u Regenerate .html unconditionally. - -projdir=/home/groups/d/do/docutils -project=docutils -dest=$projdir/htdocs -tmp=$projdir/tmp/$project -pylib=$projdir/lib/python -lib=$pylib/$project -root= - -export CVS_RSH=ssh -export CVSROOT=:pserver:anonymous@cvs1:/cvsroot/$project - -trace=0 -unconditional=0 - -while getopts eptu opt -do - case $opt in - e) root="-d:ext:${USER}@cvs1:/cvsroot/docutils" ;; - p) export PYTHONPATH=$pylib:$lib;; - t) trace=1;; - u) unconditional=1;; - \?) exit 2;; - esac -done -shift `expr $OPTIND - 1` - -if [ $trace -eq 1 ] ; then - set -o xtrace -fi - -# prep the tmp area -rm -rf $tmp 2>&1 > /dev/null -mkdir -p $tmp 2>&1 > /dev/null -cd $tmp - -# gather the materials -cvs -Q -z3 $root export -rHEAD $project sandbox web - -if [ $? -ne 0 ] ; then - exit 1 -fi - -# remove junk -find -name .cvsignore | xargs rm - -# ensure executable bits are set -chmod +x $project/*.py -chmod +x $project/tools/*.py -chmod +x $project/test/alltests.py -find $project/test -name 'test_*.py' | xargs chmod +x - -# create the snapshots -tar -czf $project-snapshot.tgz $project -tar -czf $project-sandbox-snapshot.tgz sandbox -tar -czf $project-web-snapshot.tgz web -( cd sandbox/gschwant ; tar -czf ../../docfactory-snapshot.tgz docfactory ) - -# plant the snapshots -mv *snapshot.tgz $dest - -# update htdocs -cd $project -cp -ru . $dest -cd .. -cp -ru sandbox $dest -cd web -cp -ru . $dest - -# destroy the evidence -cd -rm -rf $tmp - -# update library area -cd $lib -cvs -Q $root update 2>&1 > /dev/null - -# update HTML docs -cd $dest/tools -for htmlfile in `find .. -name '*.html'` ; do - dir=`dirname $htmlfile` - base=`basename $htmlfile .html` - txtfile=$dir/$base.txt - if [ -e $txtfile ] ; then - if [ $unconditional -eq 1 -o $txtfile -nt $htmlfile ] ; then - if [ "${base:0:4}" == "pep-" ] ; then - echo "$txtfile (PEP)" - ~/bin/python $lib/tools/pep2html.py $txtfile - else - echo $txtfile - ~/bin/python $lib/tools/html.py --config=$dir/docutils.conf $txtfile $htmlfile - fi - fi - fi -done diff --git a/sandbox/davidg/pysource_reader/en.py b/sandbox/davidg/pysource_reader/en.py deleted file mode 100644 index 78a383ab3..000000000 --- a/sandbox/davidg/pysource_reader/en.py +++ /dev/null @@ -1,31 +0,0 @@ -#! /usr/bin/env python - -""" -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This module has been placed in the public domain. - -""" - -interpreted = { - 'package': nodes.package, - 'module': nodes.module, - 'class': nodes.inline_class, - 'method': nodes.method, - 'function': nodes.function, - 'variable': nodes.variable, - 'parameter': nodes.parameter, - 'type': nodes.type, - 'class attribute': nodes.class_attribute, - 'classatt': nodes.class_attribute, - 'instance attribute': nodes.instance_attribute, - 'instanceatt': nodes.instance_attribute, - 'module attribute': nodes.module_attribute, - 'moduleatt': nodes.module_attribute, - 'exception class': nodes.exception_class, - 'exception': nodes.exception_class, - 'warning class': nodes.warning_class, - 'warning': nodes.warning_class,} -"""Mapping of interpreted text role name to nodes.py class.""" diff --git a/sandbox/davidg/pysource_reader/nodes.py b/sandbox/davidg/pysource_reader/nodes.py deleted file mode 100644 index 6aae3bdb6..000000000 --- a/sandbox/davidg/pysource_reader/nodes.py +++ /dev/null @@ -1,98 +0,0 @@ -#! /usr/bin/env python - -""" -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This module has been placed in the public domain. - -""" - -from dps import nodes -from dps.nodes import Element, TextElement, Structural, Component, Inline - - -# ===================== -# Structural Elements -# ===================== - -class package_section(Structural, Element): pass -class module_section(Structural, Element): pass -class class_section(Structural, Element): pass -class method_section(Structural, Element): pass -class function_section(Structural, Element): pass -class module_attribute_section(Structural, Element): pass -class class_attribute_section(Structural, Element): pass -class instance_attribute_section(Structural, Element): pass - -# Structural Support Elements -# --------------------------- - -class inheritance_list(Component, Element): pass -class parameter_list(Component, Element): pass -class parameter_item(Component, Element): pass -class optional_parameters(Component, Element): pass -class parameter_tuple(Component, Element): pass -class parameter_default(Component, TextElement): pass -class initial_value(Component, TextElement): pass - - -# ================= -# Inline Elements -# ================= - -class package(Component, Inline, TextElement): pass -class module(Component, Inline, TextElement): pass - - -class inline_class(Component, Inline, TextElement): - - tagname = 'class' - - -class method(Component, Inline, TextElement): pass -class function(Component, Inline, TextElement): pass -class variable(Inline, TextElement): pass -class parameter(Component, Inline, TextElement): pass -class type(Inline, TextElement): pass -class class_attribute(Component, Inline, TextElement): pass -class module_attribute(Component, Inline, TextElement): pass -class instance_attribute(Component, Inline, TextElement): pass -class exception_class(Inline, TextElement): pass -class warning_class(Inline, TextElement): pass - - -class SpecificVisitor(nodes.SpecificVisitor): - - """ - """ - - def visit_class_attribute(self, node, ancestry): pass - def visit_class_attribute_section(self, node, ancestry): pass - def visit_class_section(self, node, ancestry): pass - def visit_exception_class(self, node, ancestry): pass - def visit_function(self, node, ancestry): pass - def visit_function_section(self, node, ancestry): pass - def visit_inheritance_list(self, node, ancestry): pass - def visit_initial_value(self, node, ancestry): pass - def visit_inline_class(self, node, ancestry): pass - def visit_instance_attribute(self, node, ancestry): pass - def visit_instance_attribute_section(self, node, ancestry): pass - def visit_method(self, node, ancestry): pass - def visit_method_section(self, node, ancestry): pass - def visit_module(self, node, ancestry): pass - def visit_module_attribute(self, node, ancestry): pass - def visit_module_attribute_section(self, node, ancestry): pass - def visit_module_section(self, node, ancestry): pass - def visit_optional_parameters(self, node, ancestry): pass - def visit_package(self, node, ancestry): pass - def visit_package_section(self, node, ancestry): pass - def visit_parameter(self, node, ancestry): pass - def visit_parameter_default(self, node, ancestry): pass - def visit_parameter_item(self, node, ancestry): pass - def visit_parameter_list(self, node, ancestry): pass - def visit_parameter_tuple(self, node, ancestry): pass - def visit_type(self, node, ancestry): pass - def visit_variable(self, node, ancestry): pass - def visit_warning_class(self, node, ancestry): pass diff --git a/sandbox/dreamcatcher/ChangeLog b/sandbox/dreamcatcher/ChangeLog deleted file mode 100644 index aa1f76093..000000000 --- a/sandbox/dreamcatcher/ChangeLog +++ /dev/null @@ -1,13 +0,0 @@ -2003-05-03 Sidnei da Silva <sidnei@x3ng.com> - - * rlpdf/rlpdf.py: Added some options to the Writer. Added - footnotes, backrefs, topic. Works with docutils/tools/test.txt, - but the output needs work on the stylesheet. - -2003-05-02 Sidnei da Silva <sidnei@x3ng.com> - - * rlpdf/rlpdf.py (Writer.translate): use StringIO as output for - Reportlab and set the output to the writer output. - (PDFTranslator.visit_title): Fix weird logic. node.parent['id'] - didn't always existed. - diff --git a/sandbox/dreamcatcher/reportlabs.diff b/sandbox/dreamcatcher/reportlabs.diff deleted file mode 100644 index ba2c07e8a..000000000 --- a/sandbox/dreamcatcher/reportlabs.diff +++ /dev/null @@ -1,1258 +0,0 @@ -Index: lib/rparsexml.py -=================================================================== -RCS file: /cvsroot/reportlab/reportlab/lib/rparsexml.py,v -retrieving revision 1.2 -diff -u -r1.2 rparsexml.py ---- lib/rparsexml.py 4 Nov 2002 00:11:48 -0000 1.2 -+++ lib/rparsexml.py 28 May 2003 19:45:52 -0000 -@@ -168,15 +168,15 @@ - # raise ValueError, "I don't handle ampersands yet!!!" - docontents = 1 - if firstbracket<0: -- # no tags -- #if verbose: print "no tags" -- if toplevel is not None: -- #D = {NAMEKEY: NONAME, CONTENTSKEY: [xmltext[cursor:]]} -- ContentList = [xmltext[cursor:]] -- ContentList = unEscapeContentList(ContentList) -- return (NameString, AttDict, ContentList, ExtraStuff) -- else: -- raise ValueError, "no tags at non-toplevel %s" % `xmltext[cursor:cursor+20]` -+ # no tags -+ #if verbose: print "no tags" -+ if toplevel is not None: -+ #D = {NAMEKEY: NONAME, CONTENTSKEY: [xmltext[cursor:]]} -+ ContentList = [xmltext[cursor:]] -+ ContentList = unEscapeContentList(ContentList) -+ return ((NameString, AttDict, ContentList, ExtraStuff), cursor) -+ else: -+ raise ValueError, "no tags at non-toplevel %s" % `xmltext[cursor:cursor+20]` - #D = {} - L = [] - # look for start tag -Index: pdfgen/canvas.py -=================================================================== -RCS file: /cvsroot/reportlab/reportlab/pdfgen/canvas.py,v -retrieving revision 1.111 -diff -u -r1.111 canvas.py ---- pdfgen/canvas.py 10 Apr 2003 00:01:17 -0000 1.111 -+++ pdfgen/canvas.py 28 May 2003 19:45:54 -0000 -@@ -429,13 +429,13 @@ - is to keep the user's current zoom settings. the last - arguments may or may not be needed depending on the - choice of 'fitType'. -- -+ - Fit types and the other arguments they use are: - /XYZ left top zoom - fine grained control. null - or zero for any of the parameters means 'leave - as is', so "0,0,0" will keep the reader's settings. - NB. Adobe Reader appears to prefer "null" to 0's. -- -+ - /Fit - entire page fits in window - - /FitH top - top coord at top of window, width scaled -@@ -443,7 +443,7 @@ - - /FitV left - left coord at left of window, height - scaled to fit -- -+ - /FitR left bottom right top - scale window to fit - the specified rectangle - -@@ -464,7 +464,7 @@ - right = "null" - if zoom is None: - zoom = "null" -- -+ - if fitType == "XYZ": - dest.xyz(left,top,zoom) - elif fitType == "Fit": -@@ -483,7 +483,7 @@ - elif fitType == "FitBV": - dest.fitbv(left) - else: -- raise "Unknown Fit type %s" % (fitType,) -+ raise "Unknown Fit type %s" % (fitType,) - - dest.setPage(pageref) - return dest -@@ -498,7 +498,7 @@ - the page.""" - #This method should probably be deprecated since it is just a sub-set of bookmarkPage - return self.bookmarkPage(key,fitType="FitH",top=yhorizontal) -- -+ - def bookmarkHorizontal(self, key, relativeX, relativeY): - """w.r.t. the current transformation, bookmark this horizontal.""" - (xt, yt) = self.absolutePosition(relativeX,relativeY) -@@ -829,7 +829,7 @@ - assert rot % 90.0 == 0.0, "Rotation must be a multiple of 90 degrees" - self._pageRotation = rot - -- -+ - def addLiteral(self, s, escaped=1): - """introduce the literal text of PDF operations s into the current stream. - Only use this if you are an expert in the PDF file format.""" -Index: platypus/para.py -=================================================================== -RCS file: /cvsroot/reportlab/reportlab/platypus/para.py,v -retrieving revision 1.6 -diff -u -r1.6 para.py ---- platypus/para.py 9 Apr 2003 22:58:37 -0000 1.6 -+++ platypus/para.py 28 May 2003 19:45:55 -0000 -@@ -63,7 +63,8 @@ - from reportlab.platypus.flowables import Flowable - from reportlab.lib import colors - --import string -+from types import StringType, UnicodeType, InstanceType, TupleType, ListType, FloatType -+from string import letters as LETTERS, whitespace as WHITESPACE - - # SET THIS TO CAUSE A VIEWING BUG WITH ACROREAD 3 (for at least one input) - # CAUSEERROR = 0 -@@ -91,7 +92,6 @@ - program = [] - self.lineOpHandlers = [] # for handling underlining and hyperlinking, etc - self.program = program -- #self. - self.indent = self.rightIndent = 0.0 - self.baseindent = 0.0 # adjust this to add more indentation for bullets, eg - self.fontName = "Helvetica" -@@ -102,10 +102,12 @@ - from reportlab.lib.enums import TA_LEFT - self.alignment = TA_LEFT - self.textStateStack = [] -+ - TEXT_STATE_VARIABLES = ("indent", "rightIndent", "fontName", "fontSize", - "leading", "fontColor", "lineOpHandlers", "rise", - "alignment") - #"textStateStack") -+ - def pushTextState(self): - state = [] - for var in self.TEXT_STATE_VARIABLES: -@@ -116,6 +118,7 @@ - #print "push", self.textStateStack - #print "push", len(self.textStateStack), state - return state -+ - def popTextState(self): - state = self.textStateStack[-1] - self.textStateStack = self.textStateStack[:-1] -@@ -136,7 +139,6 @@ - remainder = program[:] - #program1 = remainder[:] # debug only - lineprogram = [] -- from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY - #if maxheight<TOOSMALLSPACE: - # raise ValueError, "attempt to format inside too small a height! "+repr(maxheight) - heightremaining = maxheight-leading -@@ -150,9 +152,11 @@ - linewidth = maxwidth - indent - rightIndent - beforelinestate = self.__dict__.copy() - if linewidth<TOOSMALLSPACE: -- raise ValueError, "indents %s %s too wide for space %s" % (self.indent, self.rightIndent, maxwidth) -+ raise ValueError, "indents %s %s too wide for space %s" % (self.indent, self.rightIndent, \ -+ maxwidth) - try: -- (lineIsFull, line, cursor, currentLength, usedIndent, maxLength, justStrings) = self.fitLine(remainder, maxwidth) -+ (lineIsFull, line, cursor, currentLength, \ -+ usedIndent, maxLength, justStrings) = self.fitLine(remainder, maxwidth) - except: - ## print "failed to fit line near", cursorcount # debug - ## for i in program1[max(0,cursorcount-10): cursorcount]: -@@ -235,20 +239,23 @@ - self.__dict__.update(startstate) - heightused = maxheight - heightremaining - return (lineprogram, remainder, laststate, heightused) -+ - def getState(self): - # inlined - return self.__dict__.copy() -+ - def resetState(self, state): - # primarily inlined - self.__dict__.update(state) -+ - ## def sizeOfWord(self, word): - ## inlineThisFunctionForEfficiency - ## return float(stringWidth(word, self.fontName, self.fontSize)) -+ - def fitLine(self, program, totalLength): - "fit words (and other things) onto a line" - # assuming word lengths and spaces have not been yet added - # fit words onto a line up to maxlength, adding spaces and respecting extra space -- from types import StringType, TupleType, InstanceType, FloatType - from reportlab.pdfbase.pdfmetrics import stringWidth - usedIndent = self.indent - maxLength = totalLength - usedIndent - self.rightIndent -@@ -269,7 +276,7 @@ - opcode = program[cursor] - #if debug: print "opcode", cursor, opcode - topcode = type(opcode) -- if topcode is StringType or topcode is InstanceType: -+ if topcode in (StringType, UnicodeType, InstanceType): - lastneedspace = needspace - needspace = 0 - if topcode is InstanceType: -@@ -278,7 +285,7 @@ - needspace = 0 - else: - saveopcode = opcode -- opcode = opcode.strip() #string.strip(opcode) -+ opcode = opcode.strip() - if opcode: - width = stringWidth(opcode, fontName, fontSize) - else: -@@ -342,7 +349,7 @@ - oldcolor = self.fontColor - (i, colorname) = opcode - #print "opcode", opcode -- if type(colorname) is StringType: -+ if type(colorname) in (StringType, UnicodeType): - color = self.fontColor = getattr(colors, colorname) - else: - color = self.fontColor = colorname # assume its something sensible :) -@@ -357,7 +364,7 @@ - # change font size - (i, fontsize) = opcode - size = abs(float(fontsize)) -- if type(fontsize) is StringType: -+ if type(fontsize) in (StringType, UnicodeType): - if fontsize[:1]=="+": - fontSize = self.fontSize = self.fontSize + size - elif fontsize[:1]=="-": -@@ -457,41 +464,43 @@ - line.append( ("nextLine", 0) ) - #print "fitline", line - return (lineIsFull, line, cursor, currentLength, usedIndent, maxLength, justStrings) -+ - def centerAlign(self, line, lineLength, maxLength): - diff = maxLength-lineLength - shift = diff/2.0 - if shift>TOOSMALLSPACE: - return self.insertShift(line, shift) - return line -+ - def rightAlign(self, line, lineLength, maxLength): - shift = maxLength-lineLength - #die - if shift>TOOSMALLSPACE: - return self.insertShift(line, shift) - return line -+ - def insertShift(self, line, shift): - # insert shift just before first visible element in line -- from types import StringType, InstanceType - result = [] - first = 1 - for e in line: - te = type(e) -- if first and (te is StringType or te is InstanceType): -+ if first and (te in (StringType, UnicodeType, InstanceType)): - result.append(shift) - first = 0 - result.append(e) - return result -+ - def justifyAlign(self, line, lineLength, maxLength): - diff = maxLength-lineLength - # count EXPANDABLE SPACES AFTER THE FIRST VISIBLE -- from types import InstanceType, StringType, TupleType, FloatType - spacecount = 0 - visible = 0 - for e in line: - te = type(e) - if te is FloatType and e>TOOSMALLSPACE and visible: - spacecount = spacecount+1 -- elif te is StringType or te is InstanceType: -+ elif te in (StringType, UnicodeType, InstanceType): - visible = 1 - #if debug: print "diff is", diff, "wordcount", wordcount #; die - if spacecount<1: -@@ -509,7 +518,7 @@ - e = line[cursor] - te = type(e) - result.append(e) -- if (te is InstanceType or te is StringType): -+ if (te in (StringType, UnicodeType, InstanceType)): - visible = 1 - elif te is FloatType and e>TOOSMALLSPACE and visible: - expanded = e+shift -@@ -545,25 +554,23 @@ - ## first = 0 - ## cursor = cursor+1 - ## return result -+ - def shrinkWrap(self, line): - # for non justified text, collapse adjacent text/shift's into single operations -- #return line # for testing - result = [] - index = 0 - maxindex = len(line) -- from types import FloatType, StringType, InstanceType -- from string import join - while index<maxindex: - e = line[index] - te = type(e) -- if te is StringType and index<maxindex-1: -+ if te in (StringType, UnicodeType) and index<maxindex-1: - # collect strings and floats - thestrings = [e] - thefloats = 0.0 - index = index+1 - nexte = line[index] - tnexte = type(nexte) -- while index<maxindex and (tnexte is FloatType or tnexte is StringType): -+ while index<maxindex and (tnexte in (FloatType, StringType, UnicodeType)): - # switch to expandable space if appropriate - if tnexte is FloatType: - if thefloats<0 and nexte>0: -@@ -571,14 +578,14 @@ - if nexte<0 and thefloats>0: - nexte = -nexte - thefloats = thefloats + nexte -- elif tnexte is StringType: -+ elif tnexte in (StringType, UnicodeType): - thestrings.append(nexte) - index = index+1 - if index<maxindex: - nexte = line[index] - tnexte = type(nexte) - # wrap up the result -- s = string.join(thestrings) -+ s = ' '.join(thestrings) - result.append(s) - result.append(float(thefloats)) - # back up for unhandled element -@@ -588,12 +595,12 @@ - index = index+1 - - return result -+ - def cleanProgram(self, line): - "collapse adjacent spacings" - #return line # for debugging - result = [] - last = 0 -- from types import FloatType, TupleType, StringType, InstanceType - for e in line: - if type(e) is FloatType: - # switch to expandable space if appropriate -@@ -634,7 +641,9 @@ - tthis = type(this) - tnext = type(next) - # don't swap visibles -- if tthis is StringType or tnext is StringType or this is InstanceType or tnext is InstanceType: -+ if tthis in (StringType, UnicodeType) or \ -+ tnext in (StringType, UnicodeType) or \ -+ this is InstanceType or tnext is InstanceType: - doswap = 0 - # only swap two tuples if the second one is an end operation and the first is something else - elif tthis is TupleType: -@@ -654,10 +663,10 @@ - result[nextindex] = this - change = 1 - return result -+ - def runOpCodes(self, program, canvas, textobject): - "render the line(s)" -- #import types -- from types import StringType, TupleType, InstanceType, FloatType -+ - escape = canvas._escape - code = textobject._code - startstate = self.__dict__.copy() -@@ -672,7 +681,7 @@ - indented = 0 - for opcode in program: - topcode = type(opcode) -- if topcode is StringType or topcode is InstanceType: -+ if topcode in (StringType, UnicodeType, InstanceType): - if not indented: - if abs(thislineindent)>TOOSMALLSPACE: - #if debug: print "INDENTING", thislineindent -@@ -688,7 +697,7 @@ - font = self.fontName - size = self.fontSize - textobject.setFont(font, size) -- if topcode is StringType: -+ if topcode in (StringType, UnicodeType): - #textobject.textOut(opcode) - text = escape(opcode) - code.append('(%s) Tj' % text) -@@ -723,7 +732,7 @@ - oldcolor = self.fontColor - (i, colorname) = opcode - #print "opcode", opcode -- if type(colorname) is StringType: -+ if type(colorname) in (StringType, UnicodeType): - color = self.fontColor = getattr(colors, colorname) - else: - color = self.fontColor = colorname # assume its something sensible :) -@@ -744,7 +753,7 @@ - # change font size - (i, fontsize) = opcode - size = abs(float(fontsize)) -- if type(fontsize) is StringType: -+ if type(fontsize) in (StringType, UnicodeType): - if fontsize[:1]=="+": - fontSize = self.fontSize = self.fontSize + size - elif fontsize[:1]=="-": -@@ -834,12 +843,12 @@ - - def stringLine(line, length): - "simple case: line with just strings and spacings which can be ignored" -+ - strings = [] -- from types import StringType - for x in line: -- if type(x) is StringType: -+ if type(x) in (StringType, UnicodeType): - strings.append(x) -- text = string.join(strings) -+ text = ' '.join(strings) - result = [text, float(length)] - nextlinemark = ("nextLine", 0) - if line and line[-1]==nextlinemark: -@@ -848,14 +857,14 @@ - - def simpleJustifyAlign(line, currentLength, maxLength): - "simple justification with only strings" -+ - strings = [] -- from types import StringType - for x in line[:-1]: -- if type(x) is StringType: -+ if type(x) in (StringType, UnicodeType): - strings.append(x) - nspaces = len(strings)-1 - slack = maxLength-currentLength -- text = string.join(strings) -+ text = ' '.join(strings) - if nspaces>0 and slack>0: - wordspacing = slack/float(nspaces) - result = [("wordSpacing", wordspacing), text, maxLength, ("wordSpacing", 0)] -@@ -869,16 +878,15 @@ - from reportlab.lib.colors import black - - def readBool(text): -- if string.upper(text) in ("Y", "YES", "TRUE", "1"): -+ if text.upper() in ("Y", "YES", "TRUE", "1"): - return 1 -- elif string.upper(text) in ("N", "NO", "FALSE", "0"): -+ elif text.upper() in ("N", "NO", "FALSE", "0"): - return 0 - else: - raise RMLError, "true/false attribute has illegal value '%s'" % text - - def readAlignment(text): -- from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY -- up = string.upper(text) -+ up = text.upper() - if up == 'LEFT': - return TA_LEFT - elif up == 'RIGHT': -@@ -891,13 +899,13 @@ - def readLength(text): - """Read a dimension measurement: accept "3in", "5cm", - "72 pt" and so on.""" -- text = string.strip(text) -+ text = text.strip() - try: - return float(text) - except ValueError: -- text = string.lower(text) -+ text = text.lower() - numberText, units = text[:-2],text[-2:] -- numberText = string.strip(numberText) -+ numberText = numberText.strip() - try: - number = float(numberText) - except ValueError: -@@ -916,13 +924,12 @@ - - def lengthSequence(s, converter=readLength): - """from "(2, 1)" or "2,1" return [2,1], for example""" -- from string import split, strip -- s = strip(s) -+ s = s.strip() - if s[:1]=="(" and s[-1:]==")": - s = s[1:-1] -- sl = split(s, ",") -- sl = map(strip, sl) -- sl = map(converter, sl) -+ sl = s.split(',') -+ sl = [s.strip() for s in sl] -+ sl = [converter(s) for s in sl] - return sl - - -@@ -931,7 +938,7 @@ - if not text: - return None - from reportlab.lib import colors -- if text[0] in string.letters: -+ if text[0] in LETTERS: - return colors.__dict__[text] - tup = lengthSequence(text) - -@@ -978,6 +985,7 @@ - bulletIndent=0 - textColor=black - backColor=None -+ - def __init__(self, name, parent=None, **kw): - mydict = self.__dict__ - if parent: -@@ -985,6 +993,7 @@ - mydict[a]=b - for (a,b) in kw.items(): - mydict[a] = b -+ - def addAttributes(self, dictionary): - for key in dictionary.keys(): - value = dictionary[key] -@@ -999,14 +1008,21 @@ - "h1.defaultStyle": "Heading1", - "h2.defaultStyle": "Heading2", - "h3.defaultStyle": "Heading3", -+ "h4.defaultStyle": "Heading4", -+ "h5.defaultStyle": "Heading5", -+ "h6.defaultStyle": "Heading6", - "title.defaultStyle": "Title", -+ "subtitle.defaultStyle": "SubTitle", - "para.defaultStyle": "Normal", - "pre.defaultStyle": "Code", -- "li.defaultStyle": "Definition" -+ "ul.defaultStyle": "Definition", -+ "ol.defaultStyle": "Definition", -+ "li.defaultStyle": "Definition", - } - - class FastPara(Flowable): - "paragraph with no special features (not even a single ampersand!)" -+ - def __init__(self, style, simpletext): - #if debug: - # print "FAST", id(self) -@@ -1015,6 +1031,7 @@ - self.style = style - self.simpletext = simpletext - self.lines = None -+ - def wrap(self, availableWidth, availableHeight): - simpletext = self.simpletext - self.availableWidth = availableWidth -@@ -1027,7 +1044,7 @@ - size = style.fontSize - firstindent = style.firstLineIndent - #textcolor = style.textColor -- words = string.split(simpletext) -+ words = simpletext.split() - lines = [] - from reportlab.pdfbase.pdfmetrics import stringWidth - spacewidth = stringWidth(" ", font, size) -@@ -1062,18 +1079,18 @@ - #print "currentline", currentline - else: - # emit the line -- lines.append( (string.join(currentline), currentlength, len(currentline)) ) -+ lines.append( (' '.join(currentline), currentlength, len(currentline)) ) - currentline = [] - currentlength = 0 - heightused = heightused+leading - if heightused+leading>availableHeight: - done = 1 - if currentlength and not done: -- lines.append( (string.join(currentline), currentlength, len(currentline) )) -+ lines.append( (' '.join(currentline), currentlength, len(currentline) )) - heightused = heightused+leading - self.lines = lines - self.height = heightused -- remainder = self.remainder = string.join(words[cursor:]) -+ remainder = self.remainder = ' '.join(words[cursor:]) - #print "lines", lines - #print "remainder is", remainder - else: -@@ -1086,6 +1103,7 @@ - result = (availableWidth, heightused) - #if debug: print "wrap is", (availableWidth, availableHeight), result, len(lines) - return result -+ - def split(self, availableWidth, availableHeight): - style = self.style - leading = style.leading -@@ -1102,7 +1120,6 @@ - return [self] - - def draw(self): -- from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY - style = self.style - lines = self.lines - rightIndent = style.rightIndent -@@ -1158,10 +1175,12 @@ - #textobject.textOut(text) - y = y-leading - c.drawText(textobject) -+ - def getSpaceBefore(self): - #if debug: - # print "got space before", self.spaceBefore - return self.style.spaceBefore -+ - def getSpaceAfter(self): - #print "got space after", self.spaceAfter - return self.style.spaceAfter -@@ -1174,15 +1193,39 @@ - result[stylenamekey] = styles[stylenamevalue] - return result - -+def buildContext(stylesheet=None): -+ result = {} -+ from reportlab.lib.styles import getSampleStyleSheet -+ from reportlab.lib.styles import StyleSheet1 -+ if stylesheet is not None: -+ if isinstance(stylesheet, StyleSheet1): -+ result.update(stylesheet.byName.copy()) -+ result.update(stylesheet.byAlias.copy()) -+ else: -+ if hasattr(stylesheet, 'copy'): -+ result.update(stylesheet.copy()) -+ else: -+ stylesheet = {} -+ styles = getSampleStyleSheet() -+ for (stylenamekey, stylenamevalue) in DEFAULT_ALIASES.items(): -+ # Copy styles with the same name as aliases -+ if stylesheet.has_key(stylenamevalue): -+ result[stylenamekey] = stylesheet[stylenamevalue] -+ # Then, fill in defaults if they were not filled yet. -+ if not result.has_key(stylenamekey) and styles.has_key(stylenamevalue): -+ result[stylenamekey] = styles[stylenamevalue] -+ -+ return result -+ - class Para(Flowable): -+ - spaceBefore = 0 - spaceAfter = 0 -+ - def __init__(self, style, parsedText=None, bulletText=None, state=None, context=None, baseindent=0): - #print id(self), "para", parsedText - self.baseindent = baseindent -- if context is None: -- context = defaultContext() -- self.context = context -+ self.context = buildContext(context) - self.parsedText = parsedText - self.bulletText = bulletText - self.style1 = style # make sure Flowable doesn't use this unless wanted! call it style1 NOT style -@@ -1199,15 +1242,18 @@ - # print "spaceBefore is", self.spaceBefore, self.parsedText - self.bold = 0 - self.italic = 0 -- self.face = "times" -- self.size = 10 -+ self.face = style.fontName -+ self.size = style.fontSize -+ - def getSpaceBefore(self): - #if debug: - # print "got space before", self.spaceBefore - return self.spaceBefore -+ - def getSpaceAfter(self): - #print "got space after", self.spaceAfter - return self.spaceAfter -+ - def wrap(self, availableWidth, availableHeight): - if debug: - print "WRAPPING", id(self), availableWidth, availableHeight -@@ -1242,7 +1288,8 @@ - if not program: - self.program = program = self.compileProgram(parsedText) - if not self.formattedProgram: -- (formattedProgram, remainder, laststate, heightused) = p.format(availableWidth, availableHeight, program, leading) -+ (formattedProgram, remainder, \ -+ laststate, heightused) = p.format(availableWidth, availableHeight, program, leading) - self.formattedProgram = formattedProgram - self.height = heightused - self.laststate = laststate -@@ -1259,7 +1306,8 @@ - height = availableHeight + 1 - #print "laststate is", laststate - #print "saving remainder", remainder -- self.remainder = Para(self.style1, parsedText=None, bulletText=None, state=laststate) -+ self.remainder = Para(self.style1, parsedText=None, bulletText=None, \ -+ state=laststate, context=self.context) - self.remainder.program = remainder - self.remainder.spaceAfter = self.spaceAfter - self.spaceAfter = 0 -@@ -1277,6 +1325,7 @@ - print "exact match???" + repr(availableHeight, h) - print "wrap is", (availableWidth, availableHeight), result - return result -+ - def split(self, availableWidth, availableHeight): - #if debug: - # print "SPLITTING", id(self), availableWidth, availableHeight -@@ -1300,6 +1349,7 @@ - result= [self] - #if debug: print "split is", result - return result -+ - def draw(self): - p = self.myengine #paragraphEngine() - formattedProgram = self.formattedProgram -@@ -1362,40 +1412,15 @@ - # now look for a place where to insert the unindent after the first line - if style.firstLineIndent: - count = 0 -- from types import StringType, InstanceType - for x in program: - count = count+1 - tx = type(x) -- if tx is StringType or tx is InstanceType: -+ if tx in (StringType, UnicodeType, InstanceType): - break - program.insert( count, ("indent", -style.firstLineIndent ) ) # defaults to end if no visibles -- #print "="*8, id(self), "program is" -- #for x in program: -- # print x --## print "="*11 --## # check pushes and pops --## stackcount = 0 --## dump = 0 --## from types import TupleType --## for x in program: --## if dump: --## print "dump:", x --## if type(x) is TupleType: --## i = x[0] --## if i=="push": --## stackcount = stackcount+1 --## print " "*stackcount, "push", stackcount --## if i=="pop": --## stackcount = stackcount-1 --## print " "*stackcount, "pop", stackcount --## if stackcount<0: --## dump=1 --## print "STACK UNDERFLOW!" --## if dump: stop - return program -+ - def linearize(self, program = None, parsedText=None): -- #print "LINEARIZING", self -- #program = self.program = [] - if parsedText is None: - parsedText = self.parsedText - style = self.style1 -@@ -1417,23 +1442,22 @@ - program.append( ("leading", 0) ) - program.append( ("nextLine", 0) ) - program.append( ("pop",) ) -+ - def compileComponent(self, parsedText, program): -- import types - ttext = type(parsedText) -- #program = self.program -- if ttext is types.StringType: -+ if ttext in (StringType, UnicodeType): - # handle special characters here... - # short cut - if parsedText: -- stext = parsedText.strip() #string.strip(parsedText) -+ stext = parsedText.strip() - if not stext: - program.append(" ") # contract whitespace to single space - else: - handleSpecialCharacters(self, parsedText, program) -- elif ttext is types.ListType: -+ elif ttext is ListType: - for e in parsedText: - self.compileComponent(e, program) -- elif ttext is types.TupleType: -+ elif ttext is TupleType: - (tagname, attdict, content, extra) = parsedText - if not attdict: - attdict = {} -@@ -1455,10 +1479,11 @@ - a("</%s>" % tagname) - else: - a("/>") -- t = string.join(L, "") -+ t = ''.join(L) - handleSpecialCharacters(self, t, program) - else: - raise ValueError, "don't know how to handle tag " + repr(tagname) -+ - def shiftfont(self, program, face=None, bold=None, italic=None): - oldface = self.face - oldbold = self.bold -@@ -1481,26 +1506,29 @@ - # "anonymous" tag: just do the content - for e in content: - self.compileComponent(e, program) -- #compile_para = compile_ # at least for now... -+ - def compile_pageNumber(self, attdict, content, extra, program): - program.append(PageNumberObject()) -+ - def compile_b(self, attdict, content, extra, program): - (f,b,i) = self.shiftfont(program, bold=1) - for e in content: - self.compileComponent(e, program) - self.shiftfont(program, bold=b) -+ - def compile_i(self, attdict, content, extra, program): - (f,b,i) = self.shiftfont(program, italic=1) - for e in content: - self.compileComponent(e, program) - self.shiftfont(program, italic=i) -+ - def compile_u(self, attdict, content, extra, program): - # XXXX must eventually add things like alternative colors -- #program = self.program - program.append( ('lineOperation', UNDERLINE) ) - for e in content: - self.compileComponent(e, program) - program.append( ('endLineOperation', UNDERLINE) ) -+ - def compile_sub(self, attdict, content, extra, program): - size = self.size - self.size = newsize = size * 0.7 -@@ -1515,18 +1543,15 @@ - program.append( ('rise', rise) ) - - def compile_ul(self, attdict, content, extra, program, tagname="ul"): -- # by transformation -- #print "compile", tagname, attdict - atts = attdict.copy() - bulletmaker = bulletMaker(tagname, atts, self.context) - # now do each element as a separate paragraph -- import types - for e in content: - te = type(e) -- if te is types.StringType: -- if e.strip(): #string.strip(e): -+ if te in (StringType, UnicodeType): -+ if e.strip(): - raise ValueError, "don't expect CDATA between list elements" -- elif te is types.TupleType: -+ elif te is TupleType: - (tagname, attdict1, content1, extra) = e - if tagname!="li": - raise ValueError, "don't expect %s inside list" % repr(tagname) -@@ -1534,57 +1559,59 @@ - if attdict1: - newatts.update(attdict1) - bulletmaker.makeBullet(newatts) -- self.compile_para(newatts, content1, extra, program) -+ self.compile_li(newatts, content1, extra, program) - - def compile_ol(self, attdict, content, extra, program): - return self.compile_ul(attdict, content, extra, program, tagname="ol") - -+ def compile_li(self, attdict, content, extra, program): -+ self.compile_para(attdict, content, extra, program) -+ - def compile_dl(self, attdict, content, extra, program): -- # by transformation -- #print "compile", tagname, attdict -- atts = attdict.copy() -- # by transformation -- #print "compile", tagname, attdict - atts = attdict.copy() - bulletmaker = bulletMaker("dl", atts, self.context) - # now do each element as a separate paragraph -- import types - contentcopy = list(content) # copy for destruction - bullet = "" - while contentcopy: - e = contentcopy[0] - del contentcopy[0] - te = type(e) -- if te is types.StringType: -- if e.strip(): #string.strip(e): -+ if te in (StringType, UnicodeType): -+ if e.strip(): - raise ValueError, "don't expect CDATA between list elements" - elif not contentcopy: - break # done at ending whitespace - else: - continue # ignore intermediate whitespace -- elif te is types.TupleType: -+ elif te is TupleType: - (tagname, attdict1, content1, extra) = e - if tagname!="dd" and tagname!="dt": -- raise ValueError, "don't expect %s here inside list, expect 'dd' or 'dt'" % repr(tagname) -+ raise ValueError, "don't expect %s here inside list, expect 'dd' or 'dt'" % \ -+ repr(tagname) - if tagname=="dt": - if bullet: - raise ValueError, "dt will not be displayed unless followed by a dd: "+repr(bullet) - if content1: -- if len(content1)!=1: -- raise ValueError, "only simple strings supported in dd content currently: "+repr(content1) -- bullet = content1[0] -- if type(bullet) is not types.StringType: -- raise ValueError, "only simple strings supported in dd content currently: "+repr(content1) -+ self.compile_dt(attdict1, content1, extra, program) -+ # raise ValueError, \ -+ # "only simple strings supported in dd content currently: "+repr(content1) - elif tagname=="dd": - newatts = atts.copy() - if attdict1: - newatts.update(attdict1) - bulletmaker.makeBullet(newatts, bl=bullet) -- self.compile_para(newatts, content1, extra, program) -+ self.compile_dd(newatts, content1, extra, program) - bullet = "" # don't use this bullet again - if bullet: - raise ValueError, "dt will not be displayed unless followed by a dd"+repr(bullet) - -+ def compile_dt(self, attdict, content, extra, program): -+ self.compile_para(attdict, content, extra, program) -+ -+ def compile_dd(self, attdict, content, extra, program): -+ self.compile_para(attdict, content, extra, program) -+ - def compile_super(self, attdict, content, extra, program): - size = self.size - self.size = newsize = size * 0.7 -@@ -1597,6 +1624,7 @@ - program.append( ('size', size) ) - self.size = size - program.append( ('rise', -rise) ) -+ - def compile_font(self, attdict, content, extra, program): - #program = self.program - program.append( ("push",) ) # store current data -@@ -1618,6 +1646,7 @@ - for e in content: - self.compileComponent(e, program) - program.append( ("pop",) ) # restore as before -+ - def compile_a(self, attdict, content, extra, program): - url = attdict["href"] - colorname = attdict.get("color", "blue") -@@ -1632,6 +1661,7 @@ - program.append( ('endLineOperation', UNDERLINE) ) - program.append( ('endLineOperation', Link) ) - program.append( ("pop",) ) # restore as before -+ - def compile_link(self, attdict, content, extra, program): - dest = attdict["destination"] - colorname = attdict.get("color", None) -@@ -1647,6 +1677,7 @@ - program.append( ('endLineOperation', UNDERLINE) ) - program.append( ('endLineOperation', Link) ) - program.append( ("pop",) ) # restore as before -+ - def compile_setLink(self, attdict, content, extra, program): - dest = attdict["destination"] - colorname = attdict.get("color", "blue") -@@ -1664,43 +1695,55 @@ - program.append( ('endLineOperation', UNDERLINE) ) - program.append( ('endLineOperation', Link) ) - program.append( ("pop",) ) # restore as before -+ - #def compile_p(self, attdict, content, extra, program): - # # have to be careful about base indent here! - # not finished -+ - def compile_bullet(self, attdict, content, extra, program): -- from types import StringType - ### eventually should allow things like images and graphics in bullets too XXXX -- if len(content)!=1 or type(content[0]) is not StringType: -+ if len(content)!=1 or type(content[0]) not in (StringType, UnicodeType): - raise ValueError, "content for bullet must be a single string" - text = content[0] - self.do_bullet(text, program) -+ - def do_bullet(self, text, program): - style = self.style1 -- #program = self.program - indent = style.bulletIndent + self.baseindent - font = style.bulletFontName - size = style.bulletFontSize - program.append( ("bullet", text, indent, font, size) ) -+ - def compile_tt(self, attdict, content, extra, program): - (f,b,i) = self.shiftfont(program, face="Courier") - for e in content: - self.compileComponent(e, program) - self.shiftfont(program, face=f) -+ - def compile_greek(self, attdict, content, extra, program): - self.compile_font({"face": "symbol"}, content, extra, program) -+ - def compile_evalString(self, attdict, content, extra, program): - program.append( EvalStringObject(attdict, content, extra, self.context) ) -+ - def compile_name(self, attdict, content, extra, program): - program.append( NameObject(attdict, content, extra, self.context) ) -+ - def compile_getName(self, attdict, content, extra, program): - program.append( GetNameObject(attdict, content, extra, self.context) ) -+ - def compile_seq(self, attdict, content, extra, program): - program.append( SeqObject(attdict, content, extra, self.context) ) -+ - def compile_seqReset(self, attdict, content, extra, program): - program.append( SeqResetObject(attdict, content, extra, self.context) ) -+ - def compile_seqDefault(self, attdict, content, extra, program): - program.append( SeqDefaultObject(attdict, content, extra, self.context) ) -+ - def compile_para(self, attdict, content, extra, program, stylename = "para.defaultStyle"): -+ if attdict is None: -+ attdict = {} - context = self.context - stylename = attdict.get("style", stylename) - style = context[stylename] -@@ -1708,45 +1751,37 @@ - newstyle.addAttributes(attdict) - bulletText = attdict.get("bulletText", None) - mystyle = self.style1 -- #newstyle.bulletIndent = mystyle.leftIndent+newstyle.bulletIndent -- #print "attdict", attdict -- #print "leftindent, baseindent", mystyle.leftIndent -- #print "bulletIndent", newstyle.bulletIndent -- thepara = Para(newstyle, content, context=context, bulletText=bulletText) # possible ref loop on context, break later -+ thepara = Para(newstyle, content, context=context, bulletText=bulletText) -+ # possible ref loop on context, break later - # now compile it and add it to the program - mybaseindent = self.baseindent - self.baseindent = thepara.baseindent = mystyle.leftIndent + self.baseindent - thepara.linearize(program=program) -- #print "program so far" -- #for x in program: -- # print x - program.append( ("nextLine", 0) ) - self.baseindent = mybaseindent - -- - class bulletMaker: -+ - def __init__(self, tagname, atts, context): - self.tagname = tagname -- #print "context is", context -- style = "li.defaultStyle" -+ self.context = context -+ style = context.has_key(tagname) and tagname or "%s.defaultStyle" % tagname - self.style = style = atts.get("style", style) -- typ = {"ul": "disc", "ol": "1", "dl": None}[tagname] -- #print tagname, "bulletmaker type is", typ -- self.typ =typ = atts.get("type", typ) -- #print tagname, "bulletmaker type is", typ -+ typ = {"ul": "disc", "ol": "1"}.get(tagname, None) -+ self.typ = typ = atts.get("type", typ) - if not atts.has_key("leftIndent"): - # get the style so you can choose an indent length -- thestyle = context[style] - from reportlab.pdfbase.pdfmetrics import stringWidth -- size = thestyle.fontSize -+ size = self.context[self.style].fontSize - indent = stringWidth("XXX", "Courier", size) - atts["leftIndent"] = str(indent) - self.count = 0 -+ - def makeBullet(self, atts, bl=None): - count = self.count = self.count+1 - typ = self.typ - tagname = self.tagname -- #print "makeBullet", tagname, typ, count -+ if bl == 'm': raise ValueError - # forget space before for non-first elements - if count>1: - atts["spaceBefore"] = "0" -@@ -1758,7 +1793,7 @@ - else: - raise ValueError, "unordered list type %s not implemented" % repr(typ) - if not atts.has_key("bulletFontName"): -- atts["bulletFontName"] = "ZapfDingbats" -+ atts["bulletFontName"] = self.context[self.style].bulletFontName or "ZapfDingbats" - elif tagname=="ol": - if typ=="1": bl = repr(count) - elif typ=="a": -@@ -1778,7 +1813,9 @@ - - class EvalStringObject: - "this will only work if rml2pdf is present" -+ - tagname = "evalString" -+ - def __init__(self, attdict, content, extra, context): - if not attdict: - attdict = {} -@@ -1786,11 +1823,13 @@ - self.content = content - self.context = context - self.extra = extra -+ - def getOp(self, tuple, engine): - from rlextra.rml2pdf.rml2pdf import Controller - #print "tuple", tuple - op = self.op = Controller.processTuple(tuple, self.context, {}) - return op -+ - def width(self, engine): - from reportlab.pdfbase.pdfmetrics import stringWidth - content = self.content -@@ -1803,10 +1842,12 @@ - #print self - s = str(op) - return stringWidth(s, engine.fontName, engine.fontSize) -+ - def execute(self, engine, textobject, canvas): - textobject.textOut(str(self.op)) - - class SeqObject(EvalStringObject): -+ - def getOp(self, tuple, engine): - from reportlab.lib.sequencer import getSequencer - globalsequencer = getSequencer() -@@ -1830,6 +1871,7 @@ - pass # name doesn't produce any output - - class SeqDefaultObject(NameObject): -+ - def getOp(self, tuple, engine): - from reportlab.lib.sequencer import getSequencer - globalsequencer = getSequencer() -@@ -1843,6 +1885,7 @@ - return "" - - class SeqResetObject(NameObject): -+ - def getOp(self, tuple, engine): - from reportlab.lib.sequencer import getSequencer - import math -@@ -1864,11 +1907,14 @@ - tagname = "getName" - - class PageNumberObject: -+ - def __init__(self, example="XXX"): - self.example = example # XXX SHOULD ADD THE ABILITY TO PASS IN EXAMPLES -+ - def width(self, engine): - from reportlab.pdfbase.pdfmetrics import stringWidth - return stringWidth(self.example, engine.fontName, engine.fontSize) -+ - def execute(self, engine, textobject, canvas): - n = canvas.getPageNumber() - textobject.textOut(str(n)) -@@ -1890,11 +1936,10 @@ - mystyle.addAttributes(attdict) - bulletText = attdict.get("bulletText", None) - # can we use the fast implementation? -- import types - result = None - if not bulletText and len(content)==1: - text = content[0] -- if type(text) is types.StringType and "&" not in text: -+ if type(text) in (StringType, UnicodeType) and "&" not in text: - result = FastPara(mystyle, text) - if result is None: - result = Para(mystyle, content, context=context, bulletText=bulletText) # possible ref loop on context, break later -@@ -2119,7 +2164,7 @@ - for fragment in amptext: - if not first: - # check for special chars -- semi = string.find(fragment, ";") -+ semi = fragment.find(";") - if semi>0: - name = fragment[:semi] - if greeks.has_key(name): -@@ -2128,7 +2173,7 @@ - (f,b,i) = engine.shiftfont(program, face="symbol") - program.append(greeksub) - engine.shiftfont(program, face=f) -- if fragment and fragment[0] in string.whitespace: -+ if fragment and fragment[0] in WHITESPACE: - program.append(" ") # follow the greek with a space - else: - # add back the & -@@ -2143,10 +2188,10 @@ - # does the last one need a space? - if sfragment and fragment: - # reader 3 used to go nuts if you don't special case the last frag, but it's fixed? -- if fragment[-1] in string.whitespace: # or fragment==lastfrag: -+ if fragment[-1] in WHITESPACE: # or fragment==lastfrag: - program.append( sfragment[-1]+" " ) - else: -- last = sfragment[-1].strip() #string.strip(sfragment[-1]) -+ last = sfragment[-1].strip() - if last: - #print "last is", repr(last) - program.append( last ) -@@ -2154,7 +2199,7 @@ - #print "HANDLED", program - return program - --def Paragraph(text, style, bulletText=None, frags=None): -+def Paragraph(text, style, bulletText=None, frags=None, context=None): - """ Paragraph(text, style, bulletText=None) - intended to be like a platypus Paragraph but better. - """ -@@ -2165,7 +2210,7 @@ - # use the fully featured one. - from reportlab.lib import rparsexml - parsedpara = rparsexml.parsexmlSimple(text) -- return Para(style, parsedText=parsedpara, bulletText=bulletText, state=None) -+ return Para(style, parsedText=parsedpara, bulletText=bulletText, state=None, context=context) - - ##class Paragraph(Para): - ## """ Paragraph(text, style, bulletText=None) -@@ -2206,8 +2251,10 @@ - UNDERLINE = UnderLineHandler() - - class HotLink(UnderLineHandler): -+ - def __init__(self, url): - self.url = url -+ - def end_at(self, x, y, para, canvas, textobject): - fontsize = para.fontSize - rect = [self.xStart, self.yStart, x,y+fontsize] -@@ -2215,27 +2262,31 @@ - print "LINKING RECTANGLE", rect - #canvas.rect(self.xStart, self.yStart, x-self.xStart,y+fontsize-self.yStart, stroke=1) - self.link(rect, canvas) -+ - def link(self, rect, canvas): - canvas.linkURL(self.url, rect, relative=1) - - class InternalLink(HotLink): -+ - def link(self, rect, canvas): - destinationname = self.url - contents = "" - canvas.linkRect(contents, destinationname, rect, Border="[0 0 0]") - - class DefDestination(HotLink): -+ - defined = 0 -+ - def link(self, rect, canvas): - destinationname = self.url - if not self.defined: - [x, y, x1, y1] = rect -- canvas.bookmarkHorizontal(destinationname, x,y1) # use the upper y -+ canvas.bookmarkHorizontal(destinationname, x, y1) # use the upper y - self.defined = 1 - - def splitspace(text): - # split on spacing but include spaces at element ends -- stext = string.split(text) -+ stext = text.split() - result = [] - for e in stext: - result.append(e+" ") diff --git a/sandbox/dreamcatcher/rlpdf/README.txt b/sandbox/dreamcatcher/rlpdf/README.txt deleted file mode 100644 index 62e31f1ef..000000000 --- a/sandbox/dreamcatcher/rlpdf/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -modules from reportlab tools - diff --git a/sandbox/dreamcatcher/rlpdf/__init__.py b/sandbox/dreamcatcher/rlpdf/__init__.py deleted file mode 100644 index 274814120..000000000 --- a/sandbox/dreamcatcher/rlpdf/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# rlpdf subpackage - -from rlpdf import Writer -from stylesheet import getStyleSheet -from rltemplate import RLDocTemplate diff --git a/sandbox/dreamcatcher/rlpdf/rllicense.txt b/sandbox/dreamcatcher/rlpdf/rllicense.txt deleted file mode 100644 index f3825f506..000000000 --- a/sandbox/dreamcatcher/rlpdf/rllicense.txt +++ /dev/null @@ -1,29 +0,0 @@ -##################################################################################### -# -# Copyright (c) 2000-2001, ReportLab Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, -# are permitted provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# * Neither the name of the company nor the names of its contributors may be -# used to endorse or promote products derived from this software without -# specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE OFFICERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# -##################################################################################### diff --git a/sandbox/dreamcatcher/rlpdf/rlpdf.py b/sandbox/dreamcatcher/rlpdf/rlpdf.py deleted file mode 100644 index d0dafc02e..000000000 --- a/sandbox/dreamcatcher/rlpdf/rlpdf.py +++ /dev/null @@ -1,789 +0,0 @@ -#! /usr/bin/env python - -""" -:Author: Engelbert Gruber -:Contact: goodger@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This module has been placed in the public domain. - -Simple pdf writer. - -The output uses reportlabs module. - -Some stylesheet is needed. -""" - -__docformat__ = 'reStructuredText' - - -import time -from types import ListType, TupleType, UnicodeType -from docutils import writers, nodes, languages - -from stylesheet import getStyleSheet -from rltemplate import RLDocTemplate - -from reportlab.lib.styles import ParagraphStyle -from reportlab.lib.enums import * -from reportlab.lib.pagesizes import A4 -from reportlab.platypus import * -from reportlab.platypus.para import Paragraph -from reportlab.lib import colors -from reportlab.lib.units import inch -from StringIO import StringIO - -class Writer(writers.Writer): - - supported = ('pdf','rlpdf') - """Formats this writer supports.""" - - settings_spec = ( - 'PDF-Specific Options', - None, - (('Format for footnote references: one of "superscript" or ' - '"brackets". Default is "brackets".', - ['--footnote-references'], - {'choices': ['superscript', 'brackets'], 'default': 'brackets', - 'metavar': '<FORMAT>'}),)) - - output = None - """Final translated form of `document`.""" - - def __init__(self): - writers.Writer.__init__(self) - self.translator_class = PDFTranslator - - def translate(self): - visitor = self.translator_class(self.document) - self.document.walkabout(visitor) - self.story = visitor.as_what() - self.output = self.record() - - def record(self): - from reportlab.platypus import SimpleDocTemplate - out = StringIO() - doc = SimpleDocTemplate(out, pagesize=A4) - doc.build(self.story) - return out.getvalue() - - def lower(self): - return 'pdf' - -class PDFTranslator(nodes.NodeVisitor): - - def __init__(self, doctree): - self.settings = settings = doctree.settings - self.styleSheet = getStyleSheet() - nodes.NodeVisitor.__init__(self, doctree) - self.language = languages.get_language(doctree.settings.language_code) - self.in_docinfo = None - self.head = [] - self.body = [] - self.foot = [] - self.sectionlevel = 0 - self.context = [] - self.topic_class = '' - self.story = [] - self.bulletText = '\267' # maybe move this into stylesheet. - self.bulletlevel = 0 - - def as_what(self): - return self.story - - def encode(self, text): - """Encode special characters in `text` & return.""" - if type(text) is UnicodeType: - text = text.replace(u'\u2020', u' ') - text = text.replace(u'\xa0', u' ') - text = text.encode('utf-8') - #text = text.replace("&", "&") - #text = text.replace("<", '"') - #text = text.replace('"', "(quot)") - #text = text.replace(">", '"') - # footnotes have character values above 128 ? - return text - - def append_para(self, text, in_style='Normal', bulletText=None): - if type(text) in (ListType, TupleType): - text = ''.join([self.encode(t) for t in text]) - style = self.styleSheet[in_style] - self.story.append(Paragraph(self.encode(text), style, \ - bulletText=bulletText, context=self.styleSheet)) - - def starttag(self, node, tagname, suffix='\n', **attributes): - atts = {} - for (name, value) in attributes.items(): - atts[name.lower()] = value - for att in ('class',): # append to node attribute - if node.has_key(att): - if atts.has_key(att): - atts[att] = node[att] + ' ' + atts[att] - for att in ('id',): # node attribute overrides - if node.has_key(att): - atts[att] = node[att] - attlist = atts.items() - attlist.sort() - parts = [tagname] - for name, value in attlist: - if value is None: # boolean attribute - parts.append(name.lower()) - elif isinstance(value, ListType): - values = [str(v) for v in value] - parts.append('%s="%s"' % (name.lower(), - self.encode(' '.join(values)))) - else: - parts.append('%s="%s"' % (name.lower(), - self.encode(str(value)))) - return '<%s>%s' % (' '.join(parts), suffix) - - def visit_Text(self, node): - self.context.append('#text') - self.body.append(node.astext()) - - def depart_Text(self, node): - self.context.pop() - - def visit_admonition(self, node, name): - pass - - def depart_admonition(self): - pass - - def visit_attention(self, node): - self.visit_admonition(node, 'attention') - - def depart_attention(self, node): - self.depart_admonition() - - def visit_author(self, node): - self.visit_docinfo_item(node, 'author') - - def depart_author(self, node): - self.depart_docinfo_item() - - def visit_address(self, node): - self.visit_docinfo_item(node, 'address') - - def depart_address(self, node): - self.depart_docinfo_item() - - def visit_version(self, node): - self.visit_docinfo_item(node, 'version') - - def depart_version(self, node): - self.depart_docinfo_item() - - def visit_system_message(self, node): - pass - - def depart_system_message(self, node): - pass - - def visit_term(self, node): - self.context.append('dt') - self.body.append(self.starttag(node, 'dt', '')) - - def depart_term(self, node): - # Closes on visit_definition - self.context.pop() - - def visit_authors(self, node): - pass - - def depart_authors(self, node): - pass - - def visit_block_quote(self, node): - pass - - def depart_block_quote(self, node): - pass - - def visit_bullet_list(self, node): - self.context.append(len(self.body)) - self.context.append('ul') - self.body.append('<ul bulletText="%s">' % self.bulletText) - - def depart_bullet_list(self, node): - self.context.pop() - self.body.append('</ul>') - start = self.context.pop() - if not 'ul' in self.context: - self.append_para(self.body[start:]) - self.body = self.body[:start] - - def visit_caption(self, node): - pass - - def depart_caption(self, node): - pass - - def visit_caution(self, node): - self.visit_admonition(node, 'caution') - - def depart_caution(self, node): - self.depart_admonition() - - def visit_citation(self, node): - pass - - def depart_citation(self, node): - pass - - def visit_citation_reference(self, node): - pass - - def depart_citation_reference(self, node): - pass - - def visit_classifier(self, node): - pass - - def depart_classifier(self, node): - pass - - def visit_colspec(self, node): - pass - - def depart_colspec(self, node): - pass - - def visit_contact(self, node): - self.visit_docinfo_item(node, 'contact') - - def depart_contact(self, node): - self.depart_docinfo_item() - - def visit_copyright(self, node): - self.visit_docinfo_item(node, 'copyright') - - def depart_copyright(self, node): - self.depart_docinfo_item() - - def visit_danger(self, node): - self.visit_admonition(node, 'danger') - - def depart_danger(self, node): - self.depart_admonition() - - def visit_date(self, node): - self.visit_docinfo_item(node, 'date') - - def depart_date(self, node): - self.depart_docinfo_item() - - def visit_definition(self, node): - self.body.append('</dt>') - self.context.append('dd') - self.body.append(self.starttag(node, 'dd')) - - def depart_definition(self, node): - self.context.pop() - self.body.append('</dd>') - - def visit_definition_list(self, node): - self.context.append(len(self.body)) - self.context.append('dl') - self.body.append(self.starttag(node, 'dl')) - - def depart_definition_list(self, node): - self.context.pop() - self.body.append('</dl>') - start = self.context.pop() - if not 'dl' in self.context: - self.append_para(self.body[start:]) - self.body = self.body[:start] - - def visit_definition_list_item(self, node): - pass - - def depart_definition_list_item(self, node): - pass - - def visit_description(self, node): - pass - - def depart_description(self, node): - pass - - def visit_docinfo(self, node): - self.context.append(len(self.body)) - self.in_docinfo = 1 - - def depart_docinfo(self, node): - start = self.context.pop() - docinfo = self.body[start:] - self.body = self.body[:start] - self.append_para(docinfo) - self.in_docinfo = None - - def visit_docinfo_item(self, node, name): - self.body.append('<para style="DocInfo"><b>%s: </b>' % self.language.labels[name]) - - def depart_docinfo_item(self): - self.body.append('</para>') - - def visit_doctest_block(self, node): - self.visit_literal_block(node) - - def depart_doctest_block(self, node): - self.depart_literal_block(node) - - def visit_line_block(self, node): - self.visit_literal_block(node) - - def depart_line_block(self, node): - self.depart_literal_block(node) - - def visit_document(self, node): - pass - - def depart_document(self, node): - pass - - def visit_emphasis(self, node): - self.context.append('i') - self.body.append('<i>') - - def depart_emphasis(self, node): - self.context.pop() - self.body.append('</i>') - - def visit_entry(self, node): - pass - - def depart_entry(self, node): - pass - - def visit_enumerated_list(self, node): - self.context.append(len(self.body)) - self.context.append('ol') - self.body.append('<ol>') - - def depart_enumerated_list(self, node): - self.context.pop() - self.body.append('</ol>') - start = self.context.pop() - if not 'ol' in self.context: - self.append_para(self.body[start:]) - self.body = self.body[:start] - - def visit_error(self, node): - self.visit_admonition(node, 'error') - - def depart_error(self, node): - self.depart_admonition() - - def visit_field(self, node): - self.body.append('<para>') - - def depart_field(self, node): - self.body.append('</para>') - - def visit_field_argument(self, node): - pass - - def depart_field_argument(self, node): - pass - - def visit_field_list(self, node): - self.context.append(len(self.body)) - self.body.append('<para>') - - def depart_field_list(self, node): - start = self.context.pop() - self.body.append('</para>') - self.append_para(self.body[start:]) - self.body = self.body[:start] - - def visit_field_name(self, node): - self.body.append('<b>') - - def depart_field_name(self, node): - self.body.append(': </b>') - - def visit_field_body(self, node): - pass - - def depart_field_body(self, node): - pass - - def visit_footnote(self, node): - self.context.append('footnotes') - self.footnote_backrefs(node) - - def footnote_backrefs(self, node): - if self.settings.footnote_backlinks and node.hasattr('backrefs'): - backrefs = node['backrefs'] - if len(backrefs) == 1: - self.context.append("%s%s" % (self.starttag({}, 'setLink', '', destination=node['id']), \ - '</setLink>')) - self.context.append("%s%s" % (self.starttag({}, 'link', '', destination=backrefs[0]), \ - '</link>')) - else: - i = 1 - backlinks = [] - for backref in backrefs: - backlinks.append("%s%s%s" % (self.starttag({}, 'link', '', destination=backref), - i, - '</link>')) - i += 1 - self.context.append(' <i>(%s)</i> ' % ', '.join(backlinks)) - self.context.append("%s%s" % (self.starttag({}, 'setLink', '', destination=node['id']), \ - '</setLink>')) - else: - self.context.append("%s%s" % (self.starttag({}, 'setLink', '', destination=node['id']), \ - '</setLink>')) - self.context.append('') - - def footnote_backrefs_depart(self, node): - if not self.context and self.body: - self.append_para(self.body) - self.body = [] - - def depart_footnote(self, node): - self.context.pop() - self.footnote_backrefs_depart(node) - - def visit_footnote_reference(self, node): - # for backrefs - if self.settings.footnote_backlinks and node.has_key('id'): - self.body.append(self.starttag(node, 'setLink', '', destination=node['id'])) - self.context.append('</setLink>') - else: - self.context.append('') - - href = '' - if node.has_key('refid'): - href = node['refid'] - elif node.has_key('refname'): - href = self.document.nameids[node['refname']] - format = self.settings.footnote_references - if format == 'brackets': - suffix = '[' - self.context.append(']') - elif format == 'superscript': - suffix = '<super>' - self.context.append('</super>') - else: # shouldn't happen - suffix = '???' - self.content.append('???') - self.body.append(self.starttag(node, 'link', suffix, destination=href)) - - def depart_footnote_reference(self, node): - self.body.append(self.context.pop()) - self.body.append('</link>') - self.body.append(self.context.pop()) - - def visit_hint(self, node): - self.visit_admonition(node, 'hint') - - def depart_hint(self, node): - self.depart_admonition() - - def visit_image(self, node): - pass - - def depart_image(self, node): - pass - - def visit_important(self, node): - self.visit_admonition(node, 'important') - - def depart_important(self, node): - self.depart_admonition() - - def visit_interpreted(self, node): - pass - - def depart_interpreted(self, node): - pass - - def visit_label(self, node): - if 'footnotes' in self.context: - self.body.append('[') - - def depart_label(self, node): - if 'footnotes' in self.context: - self.body.append(']') - self.body.append(self.context.pop()) - self.body.append(self.context.pop()) - self.body.append(' ') - - def visit_legend(self, node): - pass - - def depart_legend(self, node): - pass - - def visit_list_item(self, node): - self.context.append('li') - self.body.append('<li>') - - def depart_list_item(self, node): - self.context.pop() - self.body.append('</li>') - - def visit_literal(self, node): - self.context.append('literal') - - def depart_literal(self, node): - self.context.pop() - - def visit_literal_block(self, node): - self.story.append(Preformatted(node.astext(), self.styleSheet['Code'])) - raise nodes.SkipNode - - def depart_literal_block(self, node): - pass - - def visit_meta(self, node): - self.head.append(self.starttag(node, 'meta', **node.attributes)) - - def depart_meta(self, node): - pass - - def visit_note(self, node): - self.visit_admonition(node, 'note') - - def depart_note(self, node): - self.depart_admonition() - - def visit_option(self, node): - pass - - def depart_option(self, node): - pass - - def visit_option_argument(self, node): - pass - - def depart_option_argument(self, node): - pass - - def visit_option_group(self, node): - pass - - def depart_option_group(self, node): - pass - - def visit_option_list(self, node): - self.context.append(len(self.body)) - self.context.append('option_list') - - def depart_option_list(self, node): - self.context.pop() - start = self.context.pop() - if not 'option_list' in self.context: - self.append_para(self.body[start:]) - self.body = self.body[:start] - - def visit_option_list_item(self, node): - pass - - def depart_option_list_item(self, node): - pass - - def visit_option_string(self, node): - pass - - def depart_option_string(self, node): - pass - - def visit_organization(self, node): - self.visit_docinfo_item(node, 'organization') - - def depart_organization(self, node): - self.depart_docinfo_item() - - def visit_paragraph(self, node): - self.context.append(len(self.body)) - self.context.append('p') - - def depart_paragraph(self, node): - self.context.pop() - start = self.context.pop() - if not self.context and self.body: - self.append_para(self.body[start:]) - self.body = self.body[:start] - - def visit_problematic(self, node): - pass - - def depart_problematic(self, node): - pass - - def visit_raw(self, node): - if node.has_key('format') and node['format'] == 'html': - self.body.append(node.astext()) - raise nodes.SkipNode - - def visit_target(self, node): - if not (node.has_key('refuri') or node.has_key('refid') - or node.has_key('refname')): - href = '' - if node.has_key('id'): - href = node['id'] - elif node.has_key('name'): - href = node['name'] - self.body.append("%s%s" % (self.starttag(node, 'setLink', '', destination=href), \ - '</setLink>')) - raise nodes.SkipNode - - def depart_target(self, node): - pass - - def visit_reference(self, node): - self.context.append('a') - if node.has_key('refuri'): - href = node['refuri'] - self.body.append(self.starttag(node, 'a', '', href=href)) - self.context.append('</a>') - else: - if node.has_key('id'): - self.body.append(self.starttag({}, 'setLink', '', destination=node['id'])) - self.context.append('</setLink>') - if node.has_key('refid'): - href = node['refid'] - elif node.has_key('refname'): - href = self.document.nameids[node['refname']] - self.body.append(self.starttag(node, 'link', '', destination=href)) - self.context.append('</link>') - - def depart_reference(self, node): - if node.has_key('id') and \ - not node.has_key('refuri'): - self.body.append(self.context.pop()) - self.body.append(self.context.pop()) - self.context.pop() - - def visit_revision(self, node): - self.visit_docinfo_item(node, 'revision') - - def depart_revision(self, node): - self.depart_docinfo_item() - - def visit_row(self, node): - pass - - def depart_row(self, node): - pass - - def visit_section(self, node): - self.sectionlevel += 1 - - def depart_section(self, node): - self.sectionlevel -= 1 - - def visit_status(self, node): - self.visit_docinfo_item(node, 'status') - - def depart_status(self, node): - self.depart_docinfo_item() - - def visit_strong(self, node): - self.context.append('b') - self.body.append('<b>') - - def depart_strong(self, node): - self.context.pop() - self.body.append('</b>') - - def visit_subtitle(self, node): - self.context.append(len(self.body)) - self.context.append('subtitle') - - def depart_subtitle(self, node): - style = self.context.pop() - start = self.context.pop() - self.append_para(self.body[start:], style) - self.body = self.body[:start] - - def visit_title(self, node): - atts = {} - self.context.append(len(self.body)) - self.context.append('title') - if isinstance(node.parent, nodes.topic): - self.context.append('') - self.topic_class = 'topic-title' - elif self.sectionlevel == 0: - self.context.append('title') - else: - self.context.append("h%s" % self.sectionlevel) - - if self.context[-1] != 'title': - if node.parent.hasattr('id'): - self.context.append('</setLink>') - self.body.append(self.starttag({}, 'setLink', '', destination=node.parent['id'])) - if node.hasattr('refid'): - self.context.append('</link>') - self.body.append(self.starttag({}, 'link', '', destination=node['refid'])) - else: - self.context.append('') - - def depart_title(self, node): - if node.hasattr('refid'): - self.body.append(self.context.pop()) - if node.parent.hasattr('id'): - self.body.append(self.context.pop()) - style = self.context.pop() - self.context.pop() - if isinstance(node.parent, nodes.topic): - style = self.topic_class - start = self.context.pop() - self.append_para(self.body[start:], style) - self.body = self.body[:start] - - def unimplemented_visit(self, node): - raise NotImplementedError('visiting unimplemented node type: %s' - % node.__class__.__name__) - - def visit_topic(self, node): - if node.hasattr('id'): - self.context.append('</setLink>') - self.body.append(self.starttag({}, 'setLink', '', destination=node['id'])) - - def depart_topic(self, node): - if node.hasattr('id'): - self.body.append(self.context.pop()) - - def visit_generated(self, node): - pass - - def depart_generated(self, node): - pass - - def invisible_visit(self, node): - """Invisible nodes should be ignored.""" - pass - - def visit_comment(self, node): - raise nodes.SkipNode - - depart_comment = invisible_visit - visit_substitution_definition = visit_comment - depart_substitution_definition = depart_comment - visit_figure = visit_comment - depart_figure = depart_comment - - visit_sidebar = invisible_visit - visit_warning = invisible_visit - visit_tip = invisible_visit - visit_tbody = invisible_visit - visit_thead = invisible_visit - visit_tgroup = invisible_visit - visit_table = invisible_visit - visit_title_reference = invisible_visit - visit_transition = invisible_visit - visit_pending = invisible_visit - depart_pending = invisible_visit - depart_transition = invisible_visit - depart_title_reference = invisible_visit - depart_table = invisible_visit - depart_tgroup = invisible_visit - depart_thead = invisible_visit - depart_tbody = invisible_visit - depart_tip = invisible_visit - depart_warning = invisible_visit - depart_sidebar = invisible_visit diff --git a/sandbox/dreamcatcher/rlpdf/rltemplate.py b/sandbox/dreamcatcher/rlpdf/rltemplate.py deleted file mode 100644 index 16b453b73..000000000 --- a/sandbox/dreamcatcher/rlpdf/rltemplate.py +++ /dev/null @@ -1,143 +0,0 @@ -#copyright ReportLab Inc. 2000 -#see rllicense.txt for license details -#history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/docs/tools/rltemplate.py?cvsroot=reportlab -#$Header$ -# doc template for RL manuals. Currently YAML is hard-coded -#to use this, which is wrong. - - -from reportlab.platypus import PageTemplate, \ - BaseDocTemplate, SimpleDocTemplate, Frame, Paragraph -from reportlab.lib.units import inch, cm -from reportlab.rl_config import defaultPageSize - - -class FrontCoverTemplate(PageTemplate): - def __init__(self, id, pageSize=defaultPageSize): - self.pageWidth = pageSize[0] - self.pageHeight = pageSize[1] - frame1 = Frame(inch, - 3*inch, - self.pageWidth - 2*inch, - self.pageHeight - 518, id='cover') - PageTemplate.__init__(self, id, [frame1]) # note lack of onPage - - def afterDrawPage(self, canvas, doc): - canvas.saveState() - #canvas.drawImage('../images/replogo.gif',2*inch, 8*inch) - - - canvas.setFont('Times-Roman', 10) - canvas.line(inch, 120, self.pageWidth - inch, 120) - - #canvas.drawString(inch, 100, 'Lombard Business Park') - #canvas.drawString(inch, 88, '8 Lombard Road') - #canvas.drawString(inch, 76, 'Wimbledon') - #canvas.drawString(inch, 64, 'London, ENGLAND SW19 3TZ') - - #canvas.drawRightString(self.pageWidth - inch, 100, '103 Bayard Street') - #canvas.drawRightString(self.pageWidth - inch, 88, 'New Brunswick') - #canvas.drawRightString(self.pageWidth - inch, 76, 'New Jersey, 08904)') - #canvas.drawRightString(self.pageWidth - inch, 64, 'USA') - - canvas.restoreState() - - -class OneColumnTemplate(PageTemplate): - def __init__(self, id, pageSize=defaultPageSize): - self.pageWidth = pageSize[0] - self.pageHeight = pageSize[1] - frame1 = Frame(inch, - inch, - self.pageWidth - 2*inch, - self.pageHeight - 2*inch, - id='normal') - PageTemplate.__init__(self, id, [frame1]) # note lack of onPage - - def afterDrawPage(self, canvas, doc): - y = self.pageHeight - 50 - canvas.saveState() - canvas.setFont('Times-Roman', 10) - canvas.drawString(inch, y+8, doc.title) - canvas.drawRightString(self.pageWidth - inch, y+8, doc.chapter) - canvas.line(inch, y, self.pageWidth - inch, y) - canvas.drawCentredString(doc.pagesize[0] / 2, 0.75*inch, 'Page %d' % canvas.getPageNumber()) - canvas.restoreState() - -class TwoColumnTemplate(PageTemplate): - def __init__(self, id, pageSize=defaultPageSize): - self.pageWidth = pageSize[0] - self.pageHeight = pageSize[1] - colWidth = 0.5 * (self.pageWidth - 2.25*inch) - frame1 = Frame(inch, - inch, - colWidth, - self.pageHeight - 2*inch, - id='leftCol') - frame2 = Frame(0.5 * self.pageWidth + 0.125, - inch, - colWidth, - self.pageHeight - 2*inch, - id='rightCol') - PageTemplate.__init__(self, id, [frame1, frame2]) # note lack of onPage - - def afterDrawPage(self, canvas, doc): - y = self.pageHeight - 50 - canvas.saveState() - canvas.setFont('Times-Roman', 10) - canvas.drawString(inch, y+8, doc.title) - canvas.drawRightString(self.pageWidth - inch, y+8, doc.chapter) - canvas.line(inch, y, self.pageWidth - inch, y*inch) - canvas.drawCentredString(doc.pagesize[0] / 2, 0.75*inch, 'Page %d' % canvas.getPageNumber()) - canvas.restoreState() - - -# class RLDocTemplate(BaseDocTemplate): -class RLDocTemplate(SimpleDocTemplate): - def afterInit(self): - self.addPageTemplates(FrontCoverTemplate('Cover', self.pagesize)) - self.addPageTemplates(OneColumnTemplate('Normal', self.pagesize)) - self.addPageTemplates(TwoColumnTemplate('TwoColumn', self.pagesize)) - self.addPageTemplates(OneColumnTemplate('Cover', self.pagesize)) - - #just playing - self.title = "(Document Title Goes Here)" - self.chapter = "(No chapter yet)" - self.chapterNo = 1 #unique keys - self.sectionNo = 1 # unique keys - -## # AR hack -## self.counter = 1 - def beforeDocument(self): - self.canv.showOutline() - - def afterFlowable(self, flowable): - """Detect Level 1 and 2 headings, build outline, - and track chapter title.""" - if isinstance(flowable, Paragraph): - style = flowable.style.name - -## #AR debug text -## try: -## print '%d: %s...' % (self.counter, flowable.getPlainText()[0:40]) -## except AttributeError: -## print '%d: (something with ABag)' % self.counter -## self.counter = self.counter + 1 - - if style == 'Title': - self.title = flowable.getPlainText() - elif style == 'Heading1': - self.chapter = flowable.getPlainText() - key = 'ch%d' % self.chapterNo - self.canv.bookmarkPage(key) - self.canv.addOutlineEntry(flowable.getPlainText(), - key, 0, 0) - self.chapterNo = self.chapterNo + 1 - self.sectionNo = 1 - elif style == 'Heading2': - self.section = flowable.text - key = 'ch%ds%d' % (self.chapterNo, self.sectionNo) - self.canv.bookmarkPage(key) - self.canv.addOutlineEntry(flowable.getPlainText(), - key, 1, 0) - self.sectionNo = self.sectionNo + 1 diff --git a/sandbox/dreamcatcher/rlpdf/stylesheet.py b/sandbox/dreamcatcher/rlpdf/stylesheet.py deleted file mode 100644 index ed2c21233..000000000 --- a/sandbox/dreamcatcher/rlpdf/stylesheet.py +++ /dev/null @@ -1,212 +0,0 @@ -#copyright ReportLab Inc. 2000 -#see rllicense.txt for license details -#history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/docs/tools/stylesheet.py?cvsroot=reportlab -#$Header$ -#standard stylesheet for our manuals -from reportlab.lib.styles import StyleSheet1, ParagraphStyle -from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RIGHT, TA_JUSTIFY -from reportlab.lib import colors - - -def getStyleSheet(): - """Returns a stylesheet object""" - stylesheet = StyleSheet1() - - stylesheet.add(ParagraphStyle(name='Normal', - fontName='Times-Roman', - fontSize=10, - leading=12, - spaceBefore=4, - spaceAfter=4) - ) - - stylesheet.add(ParagraphStyle(name='DocInfo', - parent=stylesheet['Normal'], - leading=12, - spaceBefore=0, - spaceAfter=0) - ) - - stylesheet.add(ParagraphStyle(name='Comment', - fontName='Times-Italic') - ) - - stylesheet.add(ParagraphStyle(name='Indent1', - leftIndent=36, - firstLineIndent=0) - ) - - stylesheet.add(ParagraphStyle(name='BodyText', - parent=stylesheet['Normal'], - spaceBefore=6) - ) - stylesheet.add(ParagraphStyle(name='Italic', - parent=stylesheet['BodyText'], - fontName = 'Times-Italic') - ) - - stylesheet.add(ParagraphStyle(name='Heading1', - parent=stylesheet['Normal'], - fontName = 'Times-Bold', - fontSize=20, - leading=20, - spaceBefore=10, - spaceAfter=6), - alias='h1') - - stylesheet.add(ParagraphStyle(name='Heading2', - parent=stylesheet['Normal'], - fontName = 'Times-Bold', - fontSize=18, - leading=18, - spaceBefore=10, - spaceAfter=6), - alias='h2') - - stylesheet.add(ParagraphStyle(name='Heading3', - parent=stylesheet['Normal'], - fontName = 'Times-BoldItalic', - fontSize=16, - leading=16, - spaceBefore=10, - spaceAfter=6), - alias='h3') - - stylesheet.add(ParagraphStyle(name='Heading4', - parent=stylesheet['Normal'], - fontName = 'Times-BoldItalic', - fontsize=14, - leading=14, - spaceBefore=8, - spaceAfter=4), - alias='h4') - - stylesheet.add(ParagraphStyle(name='Heading5', - parent=stylesheet['Normal'], - fontName = 'Times-BoldItalic', - fontsize=13, - leading=13, - spaceBefore=8, - spaceAfter=4), - alias='h5') - - stylesheet.add(ParagraphStyle(name='Heading6', - parent=stylesheet['Normal'], - fontName = 'Times-BoldItalic', - fontsize=12, - leading=12, - spaceBefore=8, - spaceAfter=4), - alias='h6') - - stylesheet.add(ParagraphStyle(name='Title', - parent=stylesheet['Normal'], - fontName = 'Times-Bold', - fontSize=22, - leading=22, - spaceAfter=8, - alignment=TA_CENTER - ), - alias='title') - - stylesheet.add(ParagraphStyle(name='Subtitle', - parent=stylesheet['Normal'], - fontName = 'Times-Bold', - fontSize=20, - leading=20, - spaceAfter=6, - alignment=TA_CENTER - ), - alias='subtitle') - - stylesheet.add(ParagraphStyle(name='TopicTitle', - parent=stylesheet['Normal'], - fontName = 'Times-Bold', - fontSize=18, - leading=14, - spaceAfter=6, - ), - alias='topic-title') - - for i in range(0, 15): - indent = 18*i - stylesheet.add(ParagraphStyle(name='TopicItem%s' % i, - parent=stylesheet['Normal'], - fontName = 'Times-Roman', - fontSize=12, - leftIndent=indent, - spaceBefore=0, - spaceAfter=0, - ), - alias='topic-item-%s' % i) - - stylesheet.add(ParagraphStyle(name='UnorderedList', - parent=stylesheet['Normal'], - firstLineIndent=0, - leftIndent=18, - bulletIndent=9, - spaceBefore=0, - bulletFontName='Symbol'), - alias='ul') - - stylesheet.add(ParagraphStyle(name='Definition', - parent=stylesheet['Normal'], - firstLineIndent=0, - leftIndent=36, - bulletIndent=0, - spaceAfter=2, - spaceBefore=2, - bulletFontName='Times-BoldItalic'), - alias='dl') - - stylesheet.add(ParagraphStyle(name='OrderedList', - parent=stylesheet['Definition']), - alias='ol') - - stylesheet.add(ParagraphStyle(name='Code', - parent=stylesheet['Normal'], - fontName='Courier', - textColor=colors.navy, - fontSize=8, - leading=8.8, - leftIndent=36, - firstLineIndent=0)) - - stylesheet.add(ParagraphStyle(name='FunctionHeader', - parent=stylesheet['Normal'], - fontName='Courier-Bold', - fontSize=8, - leading=8.8)) - - stylesheet.add(ParagraphStyle(name='DocString', - parent=stylesheet['Normal'], - fontName='Courier', - fontSize=8, - leftIndent=18, - leading=8.8)) - - stylesheet.add(ParagraphStyle(name='DocStringIndent', - parent=stylesheet['Normal'], - fontName='Courier', - fontSize=8, - leftIndent=36, - leading=8.8)) - - stylesheet.add(ParagraphStyle(name='URL', - parent=stylesheet['Normal'], - fontName='Courier', - textColor=colors.navy, - alignment=TA_CENTER), - alias='u') - - stylesheet.add(ParagraphStyle(name='Centred', - parent=stylesheet['Normal'], - alignment=TA_CENTER - )) - - stylesheet.add(ParagraphStyle(name='Caption', - parent=stylesheet['Centred'], - fontName='Times-Italic' - )) - - return stylesheet diff --git a/sandbox/dreamcatcher/tools/pdf.py b/sandbox/dreamcatcher/tools/pdf.py deleted file mode 100755 index de89e44d5..000000000 --- a/sandbox/dreamcatcher/tools/pdf.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python - -""" -:Author: Engelbert Gruber -:Contact: grubert@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This module has been placed in the public domain. - -A minimal front-end to the Docutils Publisher, producing PDF via ReportLabs. -""" - -from docutils.core import publish_cmdline -try: - from docutils.writers.rlpdf import Writer -except ImportError: - from rlpdf import Writer - - -usage = 'usage:\n %prog [options] [source [destination]]' - -publish_cmdline(writer=Writer(), usage=usage) diff --git a/sandbox/grubert/README.txt b/sandbox/grubert/README.txt deleted file mode 100644 index 12b81cfa5..000000000 --- a/sandbox/grubert/README.txt +++ /dev/null @@ -1,69 +0,0 @@ -2003-02 -------- - -latex writer into main -~~~~~~~~~~~~~~~~~~~~~~ - -Done: -* move latex2e.py into docutils/writers -* move rst2latex.py into tools. -* add latex to writers/__init__ writer_aliases. -* documentation: tools documentation. - -To do: -* commandline options, style.tex, ... - - Where to move the latex2e-README. txt. -* test: writer tests might be too simple, currently publish is used. - test/test_writers - test that the produced latex document is the same. - - -2002-12 -------- - -pdfsamples -~~~~~~~~~~ - -1. reduced tools_test.txt_ multirow and multicol tablecells donot work. - -2. docs_tools.txt_. - -3. specs_pep-0256.txt_. - -.. _tools_test.txt: test.pdf -.. _specs_pep-0256.txt: pep-0256.pdf -.. _docs_tools.txt: tools.pdf - - -2002-09 -------- - -latex enhanced by julien. - -2002-07 -------- - -Menu changed now try for latex writer. - -2002-05-11 ----------- - -This month sandbox menu is a pdf writer using -reportlab lib. - -I am unsure it it will ever work, justification might -need hyphenation and automatic sizing of table cells -seams to be nontrivial (considering the size of the -usual html browsers). - -A better layout might be possible via the latex2e writer. -(on next month menu). - -I try to approach davids structure and work and -coding conventions but slowly as a morning sunrise. - -cheers - - grubert@users.sourceforge.net - diff --git a/sandbox/grubert/directory_structur b/sandbox/grubert/directory_structur deleted file mode 100644 index 44e39d4df..000000000 --- a/sandbox/grubert/directory_structur +++ /dev/null @@ -1,24 +0,0 @@ -Sandbox directory structure (2002-07-05) - -sandbox/ - userid/ - component_name/ # A verbose name is best. - README.txt # Please explain requirements, - # purpose/goals, and usage. - docs/ - ... - component.py # The component is a single module. - # *OR* (but *not* both) - component/ # The component is a package. - __init__.py # Contains the Reader/Writer class. - other1.py # Other modules and data files used - data.txt # by this component. - ... - test/ # Test suite. - ... - tools/ # For front-ends etc. - ... - setup.py # Use Distutils to install the component - # code and tools/ files into the right - # places in Docutils. - diff --git a/sandbox/grubert/docutils.sty b/sandbox/grubert/docutils.sty deleted file mode 100644 index 7c25b3ad4..000000000 --- a/sandbox/grubert/docutils.sty +++ /dev/null @@ -1,54 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%% docutils.sty: A style for docutils latex output %%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% -%% o author: Alexander Schmolck (a.schmolck@gmx.net) -%% o created: 2002-07-07 10:50:31+00:40 -%% o last modified: $Date$ -%% o keywords: -%% o license: -%XXX titlesec -%% XXX geometry -\usepackage{graphicx} -\usepackage{latexsym} % extra symbols -\usepackage{url} % !!!: pay attention when using in other commands!!! -\usepackage{verbatim} % normal verbatim has lenght-limit -\usepackage{enumerate} % easy style choice with e.g: ``\begin{enumerate}[Ex i.]`` -\usepackage{hyperref} %href, htarget and hlink XXX: pdfauthor, pdfcreator etc. -\usepackage{xr} %XXX do we need this? -% need this to have ``fboxes`` in ``enviroments``, as well as ``verbatim``s -\usepackage{fancybox} -\usepackage{mdwtab} % better tables and arrays (fixes spacing and adds - % vertical align and multirows (m)) -\usepackage{ltxtable} % long and autoscaling tables (use X for autoscaled - % columns) -\newcommand{\transition}{\vspace{2em}\par\hrule{}\par\vspace{2em}} -\newcommand{\classifier}[1]{(\textit{#1})} -\newenvironment{topic}[1]% -{\begin{Sbox}% - \begin{minipage}{.8\textwidth}% - \protect{\large{\textbf{#1}}}\par\vspace{.5em}}% -{\end{minipage}\end{Sbox}\fbox{\TheSbox}\par\vspace{.5em}} -%XXX shadow box for warnings? -\newenvironment{admonition}[1]% -{\begin{center}% - \begin{Sbox}% - \begin{minipage}{.9\textwidth}% - \protect{\textsc{#1}}\par\vspace{.2em}}% -{\end{minipage}\end{Sbox}\fbox{\TheSbox}\par\vspace{.5em}\end{center}} - -\newenvironment{doctest}% -{\VerbatimEnvironment - \begin{Verbatim}}% -{\end{Verbatim}} -% {% -% \begin{Sbox}% -% \begin{minipage}{.8\textwidth}% -% \protect{\large{\textsc{#1}}\par\vspace{.5em}}}% -% {\end{minipage}\end{Sbox}\fbox{\TheSbox}\par\vspace{.5em}} -%{\end{minipage}\end{Sbox}\fbox{\TheSbox}} - - -%% just a piece of example code -% \newcommand{\vitem}% -% {\SaveVerb[{\item[\UseVerb{\MyTemp}]}]{\MyTemp}} diff --git a/sandbox/grubert/latex.py b/sandbox/grubert/latex.py deleted file mode 100755 index a0f1a6ab8..000000000 --- a/sandbox/grubert/latex.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python - -""" -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This module has been placed in the public domain. - -A minimal front-end to the Docutils Publisher, producing HTML. -""" - -import locale -locale.setlocale(locale.LC_ALL, '') - -from docutils.core import publish_cmdline - - -usage = '%prog [options] [source [destination]]' -description = ('Generate LaTeX documents from standalone reStructuredText ' - 'sources.') - -publish_cmdline(writer_name='latex', usage=usage, description=description) diff --git a/sandbox/grubert/latex/__init__.py b/sandbox/grubert/latex/__init__.py deleted file mode 100644 index 0981bc081..000000000 --- a/sandbox/grubert/latex/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from latex2e import Writer diff --git a/sandbox/grubert/latex2e-README.txt b/sandbox/grubert/latex2e-README.txt deleted file mode 100644 index b757c8c9a..000000000 --- a/sandbox/grubert/latex2e-README.txt +++ /dev/null @@ -1,173 +0,0 @@ -latex2e BUGS TODOS and other animals ------------------------------------- - -for processing tools/test.txt use pdflatex because it will handle png-images. - - -:Author: engelbert gruber -:Contact: grubert@users.sourceforge.net -:Date: $Date$ - -To do -~~~~~ - -* dedication is centered italic in html (test.txt). - -* term: html puts classifier in italic and newline after classifier, - latex in parentheses and no newline after it (test.txt). - -* field lists are indented in latex (test.txt). - -* literal block is indented in html (test.txt). - -* doctest block is indented in html. - -* footnotes donot link back in latex. - -* rubric, sidebar, ... - -* citation references and bibtex: could we learn or use something ? - - e.g. contemplating about persistence storage of references or - the like reminds me of latex generating toc,lot,lof files. - -* quotes for german: {\glqq} {\grqq} {\glq} {\grq} {\dq}. - -* support embed-stylesheet. - -* the ^-sign is problematic: using mathmode wedge is usually the wrong font. - -* sidebar handling. - -* Maybe add end of line after term in definition list. see - http://roundup.sf.net/doc-0.5/features.pdf - -* In tools.txt the option tables right column, there should be some more spacing - between the description and the next paragraph "Default:". - - Paragraph separation in tables is hairy. - see http://www.tex.ac.uk/cgi-bin/texfaq2html?label=struttab - - - The strut solution did not work. - - setting extrarowheight added ad top of row not between paragraphs in - a cell. ALTHOUGH i set it to 2pt because, text is too close to the topline. - - baselineskip/stretch does not help. - -* two hlines after table head and on table end ? - -* table: multicol cells are always {l}. - -* pdfbookmark level 4 (and greater) does not work (might be settable but OTOH). - -* center subsection{Abstract} gives a latex error here. - ``! LaTeX Error: Something's wrong--perhaps a missing \item.`` - Committed a HACK: centering by hfill - -* document errors are also too silent. - -* use optionlist for docinfo. - -* the title "table of contents" is centered too. - -* consider peter funk's hooks for TeXpert: - - * Define his own document preamble (including the choice to - choose his own documentclass. That would make the ``--documentclass`` - option superfluous). I suggest to call this option ``--preamble`` - - * Use two additional hooks to put additional stuff just behind the - ``\begin{document}`` and just before the ``\end{document}`` macros. - Typical uses would be ``\tableofcontents``, ``\listoffigures`` and - ``\appendix``, ``\makeindex``, ``\makeglossary`` and some such - for larger documents. - -* hyphens: co-developers should be co--developers ? - -* table heads and footer for longtable (firstpage lastpage ..) - -* longtable does not work with multirow - -* tabularx says "do not use any multicolmn which spans any X column. - maybe use ltxtable instead of tabularx (Longtable combined with tabularx). - but ltxtable disables longtable's multicolumn. - -* multiple author entries in docinfo (same thing as in html). - -* the indentional problematic error in test.txt is not referring anywhere. - -* table cells with multirow and multicolumn - -* tables have borders, and the border is missing in empty cells. - -* footnotes are not all on the same page (as in tools/test.txt) and do not link back - and forth. - -* no link to system errors. - -* hyperlinks are not hyphenated this leads to bad spacing. see tools/test.txt - 2.14 directives directives - -* meta keywords into pdf ? - -* pagestyle headings does not work, when sections are starred. - -* additional docinfo items: the field_body is inserted as text. - -ATTENTION -~~~~~~~~~ -* put labeling inside (after the begin) environments. -* me (e.g.) uses textwidth, julien linewidth see what is what. - - textwidth: is the normal width of the text on a page. It should generally - be changed only in the preamble. - - linewidth: is the width of lines in the current environment. Normally equal to - \textwidth, it may be different within an environment such as list or quote - environments. - -Done -~~~~ - -* HACK --snap-footnote-refs=1 to strip trailing blanks from item preceeding a footnote-ref. -* add a LaTeX-nbsp (~) before a LaTeX-newline to avoid "LaTeX-Error no line to end here". -* line_blocks without use of mbox, to allow markups span over line ends. -* add french to babel support. -* double quotes by dq inside literal if language is de. -* no quote mangling in literal blocks. -* enumertated list with pre- and postfix. -* support stylesheet and stylesheet-path. -* FIX: QUICK: for latex error on abstract. -* FIX: ^ by mathmode wedge (verb|^| did not work in mbox). -* admonitions are not so visible as in html (make a border a bigger title, indent - text) thanks to g.schwant. -* FIX: protection of braces: formerly literal blocks were verbatim. - Now that they are no longer verbatim braces are dangerous. -* literal_block no longer verbatim to allow inline markup, no longer intended. -* Always emit empty date and author entries. -* FIX: descriptions without docinfo (self.docinfo not initialized). -* footnotes are spread vertically (not with juliens style.tex) include it in python. -* add handling (do nothing) for title-reference. -* setlength extrarowheight 2pt too get a little space between text in tables - and the lines above them. -* table: multicol rows have no vertical lines. -* --use-latex-toc: so we get pagenumbers. -* reduce table width to 0.93 of linewidth. -* decrement pdfbookmark levels. now 0 to 3. -* use subsubsection for deeper ones. -* all spaces in line-blocks are nonbreakable (~). -* newenvironment optionlist for option-lists. -* append ":" onto definition list terms. -* long option-groups use multicolumn. -* remove borders from option-lists. -* lists that donot start at one donot work. -* ordered list numbering style is taken from latex a.,b. in source - gives 1., .. in document. -* enumeration too deep: latex goes up to four. -* abstract title should be centered. -* docinfo table centered and narrower. -* bibliographic field names have a ":". -* german (de*) quotes. -* colspec for tables without heads. -* multipage table -* field lists as description inside quote. -* literal blocks are inside a quote environment (means indented). diff --git a/sandbox/grubert/ltx-test.txt b/sandbox/grubert/ltx-test.txt deleted file mode 100644 index 134eda67e..000000000 --- a/sandbox/grubert/ltx-test.txt +++ /dev/null @@ -1,476 +0,0 @@ -.. This is a comment. Note how any initial comments are moved by - transforms to after the document title, subtitle, and docinfo. - -================================ - reStructuredText Test Document -================================ - -.. Above is the document title, and below is the subtitle. - They are transformed from section titles after parsing. - --------------------------------- - Examples of Syntax Constructs --------------------------------- - -.. bibliographic fields (which also require a transform): - -:Author: David Goodger -:Address: 123 Example Street - Example, EX Canada - A1B 2C3 -:Contact: goodger@users.sourceforge.net -:Authors: Me; Myself; I -:organization: humankind -:date: $Date$ -:status: This is a "work in progress" -:revision: $Revision$ -:version: 1 -:copyright: This document has been placed in the public domain. You - may do with it as you wish. You may copy, modify, - redistribute, reattribute, sell, buy, rent, lease, - destroy, or improve it, quote it at length, excerpt, - incorporate, collate, fold, staple, or mutilate it, or do - anything else to it that your or anyone else's heart - desires. -:field name: This is a generic bibliographic field. -:field name 2: - Generic bibliographic fields may contain multiple body elements. - - Like this. - -:Dedication: - - For Docutils users & co-developers. - -:abstract: - - This is a test document, containing at least one example of each - reStructuredText construct. - -.. meta:: - :keywords: reStructuredText, test, parser - :description lang=en: A test document, containing at least one - example of each reStructuredText construct. - -.. contents:: Table of Contents -.. section-numbering:: - - -Structural Elements -=================== - -Section Title -------------- - -That's it, the text just above this line. - -Transitions ------------ - -Here's a transition: - ---------- - -It divides the section. - -Body Elements -============= - -Paragraphs ----------- - -A paragraph. - -Inline Markup -````````````` - -Paragraphs contain text and may contain inline markup: *emphasis*, -**strong emphasis**, `interpreted text`, ``inline literals``, -standalone hyperlinks (http://www.python.org), external hyperlinks -(Python_), internal cross-references (example_), footnote references -(manually numbered [1]_, anonymous auto-numbered [#]_, labeled -auto-numbered [#label]_, or symbolic [*]_), citation references -([CIT2002]_), substitution references (|example|), and _`inline -hyperlink targets` (see Targets_ below for a reference back to here). -Problems are indicated by |problematic| text (generated by processing -errors; this one is intentional). - -.. DO NOT RE-WRAP THE FOLLOWING PARAGRAPH! - -Let's test wrapping and whitespace significance in inline literals: -``This is an example of --inline-literal --text, --including some-- -strangely--hyphenated-words. Adjust-the-width-of-your-browser-window -to see how the text is wrapped. -- ---- -------- Now note the -spacing between the words of this sentence (words -should be grouped in pairs).`` - -If the ``--pep-references`` option was supplied, there should be a -live link to PEP 258 here. - -Bullet Lists ------------- - -- A bullet list - - + Nested bullet list. - + Nested item 2. - -- Item 2. - - Paragraph 2 of item 2. - - * Nested bullet list. - * Nested item 2. - - - Third level. - - Item 2. - - * Nested item 3. - -Enumerated Lists ----------------- - -1. Arabic numerals. - - a) lower alpha) - - (i) (lower roman) - - A. upper alpha. - - I) upper roman) - -2. Lists that don't start at 1: - - 3. Three - - 4. Four - - C. C - - D. D - - iii. iii - - iv. iv - -Definition Lists ----------------- - -Term - Definition -Term : classifier - Definition paragraph 1. - - Definition paragraph 2. -Term - Definition - -Field Lists ------------ - -:what: Field lists map field names to field bodies, like database - records. They are often part of an extension syntax. They are - an unambiguous variant of RFC 2822 fields. - -:how arg1 arg2: - - The field marker is a colon, the field name, and a colon. - - The field body may contain one or more body elements, indented - relative to the field marker. - -Option Lists ------------- - -For listing command-line options: - --a command-line option "a" --b file options can have arguments - and long descriptions ---long options can be long also ---input=file long options can also have - arguments - ---very-long-option - The description can also start on the next line. - - The description may contain multiple body elements, - regardless of where it starts. - --x, -y, -z Multiple options are an "option group". --v, --verbose Commonly-seen: short & long options. --1 file, --one=file, --two file - Multiple options with arguments. -/V DOS/VMS-style options too - -There must be at least two spaces between the option and the -description. - -Literal Blocks --------------- - -Literal blocks are indented, and indicated with a double-colon ("::") -at the end of the preceding paragraph (right here ``-->``):: - - if literal_block: - text = 'is left as-is' - spaces_and_linebreaks = 'are preserved' - markup_processing = None - -Block Quotes ------------- - -Block quotes consist of indented body elements: - - This theory, that is mine, is mine. - - -- Anne Elk (Miss) - -Doctest Blocks --------------- - ->>> print 'Python-specific usage examples; begun with ">>>"' -Python-specific usage examples; begun with ">>>" ->>> print '(cut and pasted from interactive Python sessions)' -(cut and pasted from interactive Python sessions) - -Tables ------- - -Here's a grid table followed by a simple table: - -+------------------------+------------+----------+----------+ -| Header row, column 1 | Header 2 | Header 3 | Header 4 | -| (header rows optional) | | | | -+========================+============+==========+==========+ -| body row 1, column 1 | column 2 | column 3 | column 4 | -+------------------------+------------+----------+----------+ -| body row 2 | Cells may span columns. | -+------------------------+------------+----------+----------+ -| body row 5 | Cells may also be | | -| | empty: ``-->`` | | -+------------------------+-----------------------+----------+ - -.. not for latex - +------------------------+------------+---------------------+ - | body row 3 | Cells may | - Table cells | - +------------------------+ span rows. | - contain | - | body row 4 | | - body elements. | - - -===== ===== ====== - Inputs Output ------------- ------ - A B A or B -===== ===== ====== -False False False -True False True -False True True -True True True -===== ===== ====== - -Footnotes ---------- - -.. [1] A footnote contains body elements, consistently indented by at - least 3 spaces. - - This is the footnote's second paragraph. - -.. [#label] Footnotes may be numbered, either manually (as in [1]_) or - automatically using a "#"-prefixed label. This footnote has a - label so it can be referred to from multiple places, both as a - footnore reference ([#label]_) and as a hyperlink reference - (label_). - -.. [#] This footnote is numbered automatically and anonymously using a - label of "#" only. - -.. [*] Footnotes may also use symbols, specified with a "*" label. - Here's a reference to the next footnote: [*]_. - -.. [*] This footnote shows the next symbol in the sequence. - -.. [4] Here's an unreferenced footnote, with a reference to a - nonexistent footnote: [5]_. - -Citations ---------- - -.. [CIT2002] Citations are text-labeled footnotes. They may be - rendered separately and differently from footnotes. - -Here's a reference to the above, [CIT2002]_, and a [nonexistent]_ -citation. - -Targets -------- - -.. _example: - -This paragraph is pointed to by the explicit "example" target. A -reference can be found under `Inline Markup`_, above. `Inline -hyperlink targets`_ are also possible. - -Section headers are implicit targets, referred to by name. See -Targets_, which is a subsection of `Body Elements`_. - -Explicit external targets are interpolated into references such as -"Python_". - -.. _Python: http://www.python.org/ - -Targets may be indirect and anonymous. Thus `this phrase`__ may also -refer to the Targets_ section. - -__ Targets_ - -Here's a `hyperlink reference without a target`_, which generates an -error. - -Duplicate Target Names -`````````````````````` - -Duplicate names in section headers or other implicit targets will -generate "info" (level-1) system messages. Duplicate names in -explicit targets will generate "warning" (level-2) system messages. - -Duplicate Target Names -`````````````````````` - -Since there are two "Duplicate Target Names" section headers, we -cannot uniquely refer to either of them by name. If we try to (like -this: `Duplicate Target Names`_), an error is generated. - -Directives ----------- - -.. contents:: :local: - -These are just a sample of the many reStructuredText Directives. For -others, please see http://docutils.sf.net/spec/rst/directives.html. - -Document Parts -`````````````` - -An example of the "contents" directive can be seen above this section -(a local, untitled table of contents_) and at the beginning of the -document (a document-wide `table of contents`_). - -Images -`````` - -An image directive: - -.. image:: ../docs/rst/images/title.png - -A figure directive: - -.. figure:: ../docs/rst/images/title.png - :alt: reStructuredText, the markup syntax - - A figure is an image with a caption and/or a legend: - - +------------+-----------------------------------------------+ - | re | Revised, revisited, based on 're' module. | - +------------+-----------------------------------------------+ - | Structured | Structure-enhanced text, structuredtext. | - +------------+-----------------------------------------------+ - | Text | Well it is, isn't it? | - +------------+-----------------------------------------------+ - - This paragraph is also part of the legend. - -Admonitions -``````````` - -.. Attention:: Directives at large. - -.. Caution:: - - Don't take any wooden nickels. - -.. DANGER:: Mad scientist at work! - -.. Error:: Does not compute. - -.. Hint:: It's bigger than a bread box. - -.. Important:: - - Wash behind your ears. - - Clean up your room. - - Call your mother. - - Back up your data. - -.. Note:: This is a note. - -.. Tip:: 15% if the service is good. - -.. WARNING:: Strong prose may provoke extreme mental exertion. - Reader discretion is strongly advised. - -Target Footnotes -```````````````` - -.. target-notes:: - -Line Blocks -``````````` - -Take it away, Eric the Orchestra Leader! - -.. line-block:: - - A one, two, a one two three four - - Half a bee, philosophically, - must, *ipso facto*, half not be. - But half the bee has got to be, - *vis a vis* its entity. D'you see? - - But can a bee be said to be - or not to be an entire bee, - when half the bee is not a bee, - due to some ancient injury? - - Singing... - -Replacement Text -```````````````` - -I recommend you try |Python|_. - -.. |Python| replace:: Python, *the* best language around - -Substitution Definitions ------------------------- - -An inline image (|example|) example: - -.. |EXAMPLE| image:: ../docs/rst/images/biohazard.png - -(Substitution definitions are not visible in the HTML source.) - -Comments --------- - -Here's one: - -.. Comments begin with two dots and a space. Anything may - follow, except for the syntax of footnotes, hyperlink - targets, directives, or substitution definitions. - - Double-dashes -- "--" -- must be escaped somehow in HTML output. - -(View the HTML source to see the comment.) - -Error Handling -============== - -Any errors caught during processing will generate system messages. - -There should be five messages in the following, auto-generated -section, "Docutils System Messages": - -.. section should be added by Docutils automatically diff --git a/sandbox/grubert/making_a_writer.txt b/sandbox/grubert/making_a_writer.txt deleted file mode 100644 index 4d76b5170..000000000 --- a/sandbox/grubert/making_a_writer.txt +++ /dev/null @@ -1,133 +0,0 @@ -=============== -Making a writer -=============== - -:Author: engelbert gruber -:Contact: grubert@users.sourceforge.net -:Date: $Date$ -:Web site: http://docutils.sourceforge.net/ - -.. contents:: - -Introduction -============ - -This might become a document sometime, is now a FAQ, collected -from docutils-develop@lists.sourceforge.net. - -This should give help in making a writer for the python docutils. -Writers are backends writing to a dedicated format. - -General description -=================== - -from PEP-0258: - - Writers produce the final output (HTML, XML, TeX, etc.). Writers translate - the internal document tree structure into the final data format, possibly - running Writer-specific transforms first. - - Responsibilities: - - * Run transforms over the doctree(s). - * Translate doctree(s) into specific output formats. - * Transform references into format-native forms. - * Write the translated output to the destination I/O. - -or in other words - - By the time the document gets to the Writer, it should be in - final form. The Writer's job is simply (and only) to translate from - the Docutils doctree structure to the target format. Some small - transforms may be required, but they should be local and - format-specific. - - -The smallest writer -=================== - -Next to come. This should be a writer module where everything is done -in unimplemented. - - -Methods -======= - -Empty methods -------------- - -It is legal and does not hint to missing functionality, when a -method only implements pass, it just means that this calls information -is not used, the actual content is usually produced between ``visit_*`` -and ``depart_*`` calls. e.g.:: - - def visit_Text(self, node): - self.body.append(self.encode(node.astext())) - - def depart_Text(self, node): - pass - -As long as there is no need for termination depart_Text is ok. - -Fallback methods ----------------- - -If derived from NodeVisitor - -* unknown_visit, unknown_departure - -Deriving from SparseNodeVisitor means everything might pass. - -GenericNodeVisitor adds - -* default_visit, default_depart. - -unimplemented_visit( self, node) seams to be there for both. - -Each might raise NotImplementedError(describe_here), - -General Problems ----------------- - -html pages are more like papyrus rolls, if one wants to go more usual -paper formats some things are different or not. - -* page headings -* page numbers - - -Problems --------- - -In latex2e writer this looks awful to me, but as i understand this ensures -that e.g. http addresses are not only text. - -Maybe this is due to the fact that self.docinfo is used, if one would remove -it context might be unecessary. - -:: - - def visit_docinfo_item (...): - ... - else: - ##self.head.append('\\%s{%s}\n' - ## % (name, self.attval(node.astext()))) - self.docinfo.append('\\textbf{%s} &\n\t' % name) - self.context.append(' \\\\\n') - self.context.append(self.docinfo) - self.context.append(len(self.body)) - ##raise nodes.SkipNode - - def depart_docinfo_item(self, node): - size = self.context.pop() - dest = self.context.pop() - tail = self.context.pop() - tail = self.body[size:] + [tail] - del self.body[size:] - dest.extend(tail) - - -Notes on Classes ----------------- - -To be completed. diff --git a/sandbox/grubert/pdf1 b/sandbox/grubert/pdf1 deleted file mode 100755 index db5f32d84..000000000 --- a/sandbox/grubert/pdf1 +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -DOCUTILS=../.. -QWRITER=$DOCUTILS/tools/quicktest.py -OUT=test.pdf -TEXT=pdftest_3.txt - -PYTHONPATH=`pwd`:$DOCUTILS:$PYTHONPATH - -if [ -n "$1" -a -e "$1" ] ; then - TEXT=$1 - shift -fi - -if [ -n "$1" ] ; then - echo "-$1-" - if [ $1 == "t" ] ; then - $QWRITER -p $TEXT |less - exit - fi -fi - -./pdf.py $TEXT $OUT - diff --git a/sandbox/grubert/pdftest_1.txt b/sandbox/grubert/pdftest_1.txt deleted file mode 100644 index 3c215d725..000000000 --- a/sandbox/grubert/pdftest_1.txt +++ /dev/null @@ -1,127 +0,0 @@ -Text - -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... - -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... - -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... -Und was ich immer schon einmal sagen wollte ... - - diff --git a/sandbox/grubert/pdftest_2.txt b/sandbox/grubert/pdftest_2.txt deleted file mode 100644 index 9ccd0bef8..000000000 --- a/sandbox/grubert/pdftest_2.txt +++ /dev/null @@ -1,49 +0,0 @@ -.. This is a comment. Note how any initial comments are moved by - transforms to after the document title, subtitle, and docinfo. - -================================ - reStructuredText Test Document -================================ - -.. Above is the document title, and below is the subtitle. - They are transformed from section titles after parsing. - --------------------------------- - Examples of Syntax Constructs --------------------------------- - -.. bibliographic fields (which also require a transform): - -Structural Elements -=================== - -Section Title -------------- - -That's it, the text just above this line. - -Transitions ------------ - -Here's a transition: - ---------- - -It divides the section. - -Body Elements -============= - -Paragraphs ----------- - -A paragraph. - -Inline Markup -````````````` - -Paragraphs contain text and may contain inline markup: *emphasis*, -**strong emphasis**, `interpreted text`, ``inline literals``, -standalone hyperlinks (http://www.python.org), external hyperlinks -(Python_), internal cross-references (example_). - diff --git a/sandbox/grubert/rllicense.txt b/sandbox/grubert/rllicense.txt deleted file mode 100644 index f3825f506..000000000 --- a/sandbox/grubert/rllicense.txt +++ /dev/null @@ -1,29 +0,0 @@ -##################################################################################### -# -# Copyright (c) 2000-2001, ReportLab Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, -# are permitted provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# * Neither the name of the company nor the names of its contributors may be -# used to endorse or promote products derived from this software without -# specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE OFFICERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# -##################################################################################### diff --git a/sandbox/grubert/rlpdf/README.txt b/sandbox/grubert/rlpdf/README.txt deleted file mode 100644 index 62e31f1ef..000000000 --- a/sandbox/grubert/rlpdf/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -modules from reportlab tools - diff --git a/sandbox/grubert/rlpdf/__init__.py b/sandbox/grubert/rlpdf/__init__.py deleted file mode 100644 index 274814120..000000000 --- a/sandbox/grubert/rlpdf/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# rlpdf subpackage - -from rlpdf import Writer -from stylesheet import getStyleSheet -from rltemplate import RLDocTemplate diff --git a/sandbox/grubert/rlpdf/rlpdf.py b/sandbox/grubert/rlpdf/rlpdf.py deleted file mode 100644 index 781aa0e70..000000000 --- a/sandbox/grubert/rlpdf/rlpdf.py +++ /dev/null @@ -1,671 +0,0 @@ -#! /usr/bin/env python - -""" -:Author: Engelbert Gruber -:Contact: goodger@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This module has been placed in the public domain. - -Simple pdf writer. - -The output uses reportlabs module. - -Some stylesheet is needed. -""" - -__docformat__ = 'reStructuredText' - - -import time -from types import ListType -from docutils import writers, nodes, languages - -from stylesheet import getStyleSheet -from rltemplate import RLDocTemplate - -from reportlab.lib.styles import ParagraphStyle -from reportlab.lib.enums import * -from reportlab.lib.pagesizes import A4 -from reportlab.platypus import * -from reportlab.lib import colors -from reportlab.lib.units import inch - -class Writer(writers.Writer): - - output = None - """Final translated form of `document`.""" - - def translate(self): - visitor = PDFTranslator(self.document) - self.document.walkabout(visitor) - self.story = visitor.as_what() - - def record(self): - doc = RLDocTemplate(self.destination, pagesize=A4) - doc.build(self.story) - - def lower(self): - return 'pdf' - -class PDFTranslator(nodes.NodeVisitor): - - def __init__(self, doctree): - self.styleSheet = getStyleSheet() - nodes.NodeVisitor.__init__(self, doctree) - self.language = languages.get_language(doctree.settings.language_code) - self.head = [] - self.body = [] - self.foot = [] - self.sectionlevel = 0 - self.context = [] - self.topic_class = '' - self.story = [] - self.bulletText = '\xb7' # maybe move this into stylesheet. - - def as_what(self): - return self.story - - def encode(self, text): - """Encode special characters in `text` & return.""" - text = text.replace("&", "&") - #text = text.replace("<", "(lt)") - #text = text.replace('"', "(quot)") - #text = text.replace(">", "(gt)") - # footnotes have character values above 128 ? - for i in range(len(text)): - if (ord(text[i])>128): - return "ATT" - print "warning: %d %x" % (i,ord(text[i])) - text.replace(text[i],"?") - return text - - def append_styled(self,text,in_style='Normal'): - if self.styleSheet.has_key(in_style): - style = self.styleSheet[in_style] - self.story.append(Paragraph(self.encode(text), style, bulletText=None)) - - def append_normal(self,text): - style = self.styleSheet['Normal'] - self.story.append(Paragraph(self.encode(text), style, bulletText=None)) - - def starttag(self, node, tagname, suffix='\n', **attributes): - atts = {} - for (name, value) in attributes.items(): - atts[name.lower()] = value - for att in ('class',): # append to node attribute - if node.has_key(att): - if atts.has_key(att): - atts[att] = node[att] + ' ' + atts[att] - for att in ('id',): # node attribute overrides - if node.has_key(att): - atts[att] = node[att] - attlist = atts.items() - attlist.sort() - parts = [tagname.upper()] - for name, value in attlist: - if value is None: # boolean attribute - parts.append(name.upper()) - elif isinstance(value, ListType): - values = [str(v) for v in value] - parts.append('%s="%s"' % (name.upper(), - self.encode(' '.join(values)))) - else: - parts.append('%s="%s"' % (name.upper(), - self.encode(str(value)))) - return '<%s>%s' % (' '.join(parts), suffix) - - def visit_Text(self, node): - #self.body.append(self.encode(node.astext())) - # Text is visited for every element ? - #self.append_normal("Text:"+node.astext()) - pass - - def depart_Text(self, node): - pass - - def visit_admonition(self, node, name): - self.body.append(self.starttag(node, 'div', CLASS=name)) - self.body.append('<P CLASS="admonition-title">' + self.language.labels[name] + '</P>\n') - - def depart_admonition(self): - self.body.append('</DIV>\n') - - def visit_attention(self, node): - self.visit_admonition(node, 'attention') - - def depart_attention(self, node): - self.depart_admonition() - - def visit_author(self, node): - self.visit_docinfo_item(node, 'author') - - def depart_author(self, node): - self.depart_docinfo_item() - - def visit_authors(self, node): - pass - - def depart_authors(self, node): - pass - - def visit_block_quote(self, node): - self.body.append(self.starttag(node, 'blockquote')) - - def depart_block_quote(self, node): - self.body.append('</BLOCKQUOTE>\n') - - def visit_bullet_list(self, node): - if self.topic_class == 'contents': - self.body.append(self.starttag(node, 'ul', compact=None)) - else: - style = self.styleSheet['Normal'] - self.story.append(Paragraph(self.encode(node.astext()), - style, bulletText=self.bulletText)) - - def depart_bullet_list(self, node): - pass - - def visit_caption(self, node): - self.body.append(self.starttag(node, 'p', '', CLASS='caption')) - - def depart_caption(self, node): - self.body.append('</P>\n') - - def visit_caution(self, node): - self.visit_admonition(node, 'caution') - - def depart_caution(self, node): - self.depart_admonition() - - def visit_citation(self, node): - self.body.append(self.starttag(node, 'table', CLASS='citation', - frame="void", rules="none")) - self.body.append('<COL CLASS="label">\n' - '<COL>\n' - '<TBODY VALIGN="top">\n' - '<TR><TD>\n') - - def depart_citation(self, node): - self.body.append('</TD></TR>\n' - '</TBODY>\n</TABLE>\n') - - def visit_citation_reference(self, node): - href = '' - if node.has_key('refid'): - href = '#' + node['refid'] - elif node.has_key('refname'): - href = '#' + self.doctree.nameids[node['refname']] - self.body.append(self.starttag(node, 'a', '[', href=href, #node['refid'], - CLASS='citation-reference')) - - def depart_citation_reference(self, node): - self.body.append(']</A>') - - def visit_classifier(self, node): - self.body.append(' <SPAN CLASS="classifier-delimiter">:</SPAN> ') - self.body.append(self.starttag(node, 'span', '', CLASS='classifier')) - - def depart_classifier(self, node): - self.body.append('</SPAN>') - - def visit_colspec(self, node): - atts = {} - #if node.has_key('colwidth'): - # atts['width'] = str(node['colwidth']) + '*' - self.body.append(self.starttag(node, 'col', **atts)) - - def depart_colspec(self, node): - pass - - def visit_comment(self, node): - self.body.append('<!-- ') - - def depart_comment(self, node): - self.body.append(' -->\n') - - def visit_contact(self, node): - self.visit_docinfo_item(node, 'contact') - - def depart_contact(self, node): - self.depart_docinfo_item() - - def visit_copyright(self, node): - self.visit_docinfo_item(node, 'copyright') - - def depart_copyright(self, node): - self.depart_docinfo_item() - - def visit_danger(self, node): - self.visit_admonition(node, 'danger') - - def depart_danger(self, node): - self.depart_admonition() - - def visit_date(self, node): - self.visit_docinfo_item(node, 'date') - - def depart_date(self, node): - self.depart_docinfo_item() - - def visit_definition(self, node): - self.body.append('</DT>\n') - self.body.append(self.starttag(node, 'dd')) - - def depart_definition(self, node): - self.body.append('</DD>\n') - - def visit_definition_list(self, node): - self.body.append(self.starttag(node, 'dl')) - - def depart_definition_list(self, node): - self.body.append('</DL>\n') - - def visit_definition_list_item(self, node): - pass - - def depart_definition_list_item(self, node): - pass - - def visit_description(self, node): - self.body.append('<TD>\n') - - def depart_description(self, node): - self.body.append('</TD>') - - def visit_docinfo(self, node): - self.body.append(self.starttag(node, 'table', CLASS='docinfo', - frame="void", rules="none")) - self.body.append('<COL CLASS="docinfo-name">\n' - '<COL CLASS="docinfo-content">\n' - '<TBODY VALIGN="top">\n') - - def depart_docinfo(self, node): - self.body.append('</TBODY>\n</TABLE>\n') - - def visit_docinfo_item(self, node, name): - self.head.append('<META NAME="%s" CONTENT="%s">\n' - % (name, self.encode(node.astext()))) - self.body.append(self.starttag(node, 'tr', '')) - self.body.append('<TD>\n' - '<P CLASS="docinfo-name">%s:</P>\n' - '</TD><TD>\n' - '<P>' % self.language.labels[name]) - - def depart_docinfo_item(self): - self.body.append('</P>\n</TD></TR>') - - def visit_doctest_block(self, node): - self.body.append(self.starttag(node, 'pre', CLASS='doctest-block')) - - def depart_doctest_block(self, node): - self.body.append('</PRE>\n') - - def visit_document(self, node): - self.body.append(self.starttag(node, 'div', CLASS='document')) - - def depart_document(self, node): - self.body.append('</DIV>\n') - #self.body.append( - # '<P CLASS="credits">HTML generated from <CODE>%s</CODE> on %s ' - # 'by <A HREF="http://docutils.sourceforge.net/">Docutils</A>.' - # '</P>\n' % (node['source'], time.strftime('%Y-%m-%d'))) - - def visit_emphasis(self, node): - self.append_styled(node.astext(),'Italic') - - def depart_emphasis(self, node): - pass - - def visit_entry(self, node): - if isinstance(node.parent.parent, nodes.thead): - tagname = 'th' - else: - tagname = 'td' - atts = {} - if node.has_key('morerows'): - atts['rowspan'] = node['morerows'] + 1 - if node.has_key('morecols'): - atts['colspan'] = node['morecols'] + 1 - self.body.append(self.starttag(node, tagname, **atts)) - self.context.append('</%s>' % tagname.upper()) - if len(node) == 0: # empty cell - self.body.append(' ') - - def depart_entry(self, node): - self.body.append(self.context.pop()) - - def visit_enumerated_list(self, node): - """ - The 'start' attribute does not conform to HTML 4.01's strict.dtd, but - CSS1 doesn't help. CSS2 isn't widely enough supported yet to be - usable. - """ - atts = {} - if node.has_key('start'): - atts['start'] = node['start'] - if node.has_key('enumtype'): - atts['class'] = node['enumtype'] - # @@@ To do: prefix, suffix. How? Change prefix/suffix to a - # single "format" attribute? Use CSS2? - self.body.append(self.starttag(node, 'ol', **atts)) - - def depart_enumerated_list(self, node): - self.body.append('</OL>\n') - - def visit_error(self, node): - self.visit_admonition(node, 'error') - - def depart_error(self, node): - self.depart_admonition() - - def visit_field(self, node): - self.body.append(self.starttag(node, 'tr', CLASS='field')) - - def depart_field(self, node): - self.body.append('</TR>\n') - - def visit_field_argument(self, node): - self.body.append(' ') - self.body.append(self.starttag(node, 'span', '', - CLASS='field-argument')) - - def depart_field_argument(self, node): - self.body.append('</SPAN>') - - def visit_field_body(self, node): - self.body.append(':</P>\n</TD><TD>') - self.body.append(self.starttag(node, 'div', CLASS='field-body')) - - def depart_field_body(self, node): - self.body.append('</DIV></TD>\n') - - def visit_field_list(self, node): - self.body.append(self.starttag(node, 'table', frame='void', - rules='none')) - self.body.append('<COL CLASS="field-name">\n' - '<COL CLASS="field-body">\n' - '<TBODY VALIGN="top">\n') - - def depart_field_list(self, node): - self.body.append('</TBODY>\n</TABLE>\n') - - def visit_field_name(self, node): - self.body.append('<TD>\n') - self.body.append(self.starttag(node, 'p', '', CLASS='field-name')) - - def depart_field_name(self, node): - """ - Leave the end tag to `self.visit_field_body()`, in case there are any - field_arguments. - """ - pass - - def visit_figure(self, node): - self.body.append(self.starttag(node, 'div', CLASS='figure')) - - def depart_figure(self, node): - self.body.append('</DIV>\n') - - def visit_footnote(self, node): - self.body.append(self.starttag(node, 'table', CLASS='footnote', - frame="void", rules="none")) - self.body.append('<COL CLASS="label">\n' - '<COL>\n' - '<TBODY VALIGN="top">\n' - '<TR><TD>\n') - - def depart_footnote(self, node): - self.body.append('</TD></TR>\n' - '</TBODY>\n</TABLE>\n') - - def visit_footnote_reference(self, node): - href = '' - if node.has_key('refid'): - href = '#' + node['refid'] - elif node.has_key('refname'): - href = '#' + self.doctree.nameids[node['refname']] - self.body.append(self.starttag(node, 'a', '', href=href, #node['refid'], - CLASS='footnote-reference')) - - def depart_footnote_reference(self, node): - self.body.append('</A>') - - def visit_hint(self, node): - self.visit_admonition(node, 'hint') - - def depart_hint(self, node): - self.depart_admonition() - - def visit_image(self, node): - atts = node.attributes.copy() - atts['src'] = atts['uri'] - del atts['uri'] - if not atts.has_key('alt'): - atts['alt'] = atts['src'] - self.body.append(self.starttag(node, 'img', '', **atts)) - - def depart_image(self, node): - pass - - def visit_important(self, node): - self.visit_admonition(node, 'important') - - def depart_important(self, node): - self.depart_admonition() - - def visit_interpreted(self, node): - self.body.append('<SPAN class="interpreted">') - - def depart_interpreted(self, node): - self.body.append('</SPAN>') - - def visit_label(self, node): - self.body.append(self.starttag(node, 'p', '[', CLASS='label')) - - def depart_label(self, node): - self.body.append(']</P>\n' - '</TD><TD>\n') - - def visit_legend(self, node): - self.body.append(self.starttag(node, 'div', CLASS='legend')) - - def depart_legend(self, node): - self.body.append('</DIV>\n') - - def visit_list_item(self, node): - self.body.append(self.starttag(node, 'li')) - - def depart_list_item(self, node): - self.body.append('</LI>\n') - - def visit_literal(self, node): - self.body.append('<CODE>') - - def depart_literal(self, node): - self.body.append('</CODE>') - - def visit_literal_block(self, node): - self.body.append(self.starttag(node, 'pre', CLASS='literal-block')) - - def depart_literal_block(self, node): - self.body.append('</PRE>\n') - - def visit_meta(self, node): - self.head.append(self.starttag(node, 'meta', **node.attributes)) - - def depart_meta(self, node): - pass - - def visit_note(self, node): - self.visit_admonition(node, 'note') - - def depart_note(self, node): - self.depart_admonition() - - def visit_option(self, node): - if self.context[-1]: - self.body.append(', ') - - def depart_option(self, node): - self.context[-1] += 1 - - def visit_option_argument(self, node): - self.body.append(node.get('delimiter', ' ')) - self.body.append(self.starttag(node, 'span', '', - CLASS='option-argument')) - - def depart_option_argument(self, node): - self.body.append('</SPAN>') - - def visit_option_group(self, node): - atts = {} - if len(node.astext()) > 14: - atts['colspan'] = 2 - self.context.append('</TR>\n<TR><TD> </TD>') - else: - self.context.append('') - self.body.append(self.starttag(node, 'td', **atts)) - self.body.append('<P><CODE>') - self.context.append(0) - - def depart_option_group(self, node): - self.context.pop() - self.body.append('</CODE></P>\n</TD>') - self.body.append(self.context.pop()) - - def visit_option_list(self, node): - self.body.append( - self.starttag(node, 'table', CLASS='option-list', - frame="void", rules="none", cellspacing=12)) - self.body.append('<COL CLASS="option">\n' - '<COL CLASS="description">\n' - '<TBODY VALIGN="top">\n') - - def depart_option_list(self, node): - self.body.append('</TBODY>\n</TABLE>\n') - - def visit_option_list_item(self, node): - self.body.append(self.starttag(node, 'tr', '')) - - def depart_option_list_item(self, node): - self.body.append('</TR>\n') - - def visit_option_string(self, node): - self.body.append(self.starttag(node, 'span', '', CLASS='option')) - - def depart_option_string(self, node): - self.body.append('</SPAN>') - - def visit_organization(self, node): - self.visit_docinfo_item(node, 'organization') - - def depart_organization(self, node): - self.depart_docinfo_item() - - def visit_paragraph(self, node): - if not self.topic_class == 'contents': - self.append_normal(node.astext()) - - def depart_paragraph(self, node): - if self.topic_class == 'contents': - self.append_normal('\n') - else: - self.append_normal('\n') - - def visit_problematic(self, node): - if node.hasattr('refid'): - self.body.append('<A HREF="#%s">' % node['refid']) - self.context.append('</A>') - else: - self.context.append('') - self.body.append(self.starttag(node, 'span', '', CLASS='problematic')) - - def depart_problematic(self, node): - self.body.append('</SPAN>') - self.body.append(self.context.pop()) - - def visit_raw(self, node): - if node.has_key('format') and node['format'] == 'html': - self.body.append(node.astext()) - raise nodes.SkipNode - - def visit_reference(self, node): - if node.has_key('refuri'): - href = node['refuri'] - elif node.has_key('refid'): - #else: - href = '#' + node['refid'] - elif node.has_key('refname'): - # @@@ Check for non-existent mappings. Here or in a transform? - href = '#' + self.doctree.nameids[node['refname']] - self.body.append(self.starttag(node, 'a', '', href=href, - CLASS='reference')) - - def depart_reference(self, node): - self.body.append('</A>') - - def visit_revision(self, node): - self.visit_docinfo_item(node, 'revision') - - def depart_revision(self, node): - self.depart_docinfo_item() - - def visit_row(self, node): - self.body.append(self.starttag(node, 'tr', '')) - - def depart_row(self, node): - self.body.append('</TR>\n') - - def visit_section(self, node): - self.sectionlevel += 1 - self.body.append(self.starttag(node, 'div', CLASS='section')) - - def depart_section(self, node): - self.sectionlevel -= 1 - self.body.append('</DIV>\n') - - def visit_status(self, node): - self.visit_docinfo_item(node, 'status') - - def depart_status(self, node): - self.depart_docinfo_item() - - def visit_strong(self, node): - self.body.append('<STRONG>') - - def depart_strong(self, node): - self.body.append('</STRONG>') - - def visit_subtitle(self, node): - self.append_styled(node.astext(),'h2') - - def depart_subtitle(self, node): - pass - - def visit_title(self, node): - """Only 6 section levels are supported by HTML.""" - if isinstance(node.parent, nodes.topic): - self.body.append( - self.starttag(node, 'P', '', CLASS='topic-title')) - self.context.append('</P>\n') - elif self.sectionlevel == 0: - self.head.append('<TITLE>%s\n' - % self.encode(node.astext())) - self.body.append(self.starttag(node, 'H1', '', CLASS='title')) - self.context.append('\n') - self.append_styled(node.astext(),'h1') - else: - self.append_styled(node.astext(), "h%s" % self.sectionlevel ) - context = '' - if node.hasattr('refid'): - self.body.append('' % node['refid']) - context = '' - self.context.append('%s\n' % (context, self.sectionlevel)) - - def depart_title(self, node): - self.body.append(self.context.pop()) - - def unimplemented_visit(self, node): - raise NotImplementedError('visiting unimplemented node type: %s' - % node.__class__.__name__) diff --git a/sandbox/grubert/rlpdf/rltemplate.py b/sandbox/grubert/rlpdf/rltemplate.py deleted file mode 100644 index dc462430f..000000000 --- a/sandbox/grubert/rlpdf/rltemplate.py +++ /dev/null @@ -1,143 +0,0 @@ -#copyright ReportLab Inc. 2000 -#see rllicense.txt for license details -#history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/docs/tools/rltemplate.py?cvsroot=reportlab -#$Header$ -# doc template for RL manuals. Currently YAML is hard-coded -#to use this, which is wrong. - - -from reportlab.platypus import PageTemplate, \ - BaseDocTemplate, SimpleDocTemplate, Frame, Paragraph -from reportlab.lib.units import inch, cm -from reportlab.rl_config import defaultPageSize - - -class FrontCoverTemplate(PageTemplate): - def __init__(self, id, pageSize=defaultPageSize): - self.pageWidth = pageSize[0] - self.pageHeight = pageSize[1] - frame1 = Frame(inch, - 3*inch, - self.pageWidth - 2*inch, - self.pageHeight - 518, id='cover') - PageTemplate.__init__(self, id, [frame1]) # note lack of onPage - - def afterDrawPage(self, canvas, doc): - canvas.saveState() - #canvas.drawImage('../images/replogo.gif',2*inch, 8*inch) - - - canvas.setFont('Times-Roman', 10) - canvas.line(inch, 120, self.pageWidth - inch, 120) - - #canvas.drawString(inch, 100, 'Lombard Business Park') - #canvas.drawString(inch, 88, '8 Lombard Road') - #canvas.drawString(inch, 76, 'Wimbledon') - #canvas.drawString(inch, 64, 'London, ENGLAND SW19 3TZ') - - #canvas.drawRightString(self.pageWidth - inch, 100, '103 Bayard Street') - #canvas.drawRightString(self.pageWidth - inch, 88, 'New Brunswick') - #canvas.drawRightString(self.pageWidth - inch, 76, 'New Jersey, 08904)') - #canvas.drawRightString(self.pageWidth - inch, 64, 'USA') - - canvas.restoreState() - - -class OneColumnTemplate(PageTemplate): - def __init__(self, id, pageSize=defaultPageSize): - self.pageWidth = pageSize[0] - self.pageHeight = pageSize[1] - frame1 = Frame(inch, - inch, - self.pageWidth - 2*inch, - self.pageHeight - 2*inch, - id='normal') - PageTemplate.__init__(self, id, [frame1]) # note lack of onPage - - def afterDrawPage(self, canvas, doc): - y = self.pageHeight - 50 - canvas.saveState() - canvas.setFont('Times-Roman', 10) - canvas.drawString(inch, y+8, doc.title) - canvas.drawRightString(self.pageWidth - inch, y+8, doc.chapter) - canvas.line(inch, y, self.pageWidth - inch, y) - canvas.drawCentredString(doc.pagesize[0] / 2, 0.75*inch, 'Page %d' % canvas.getPageNumber()) - canvas.restoreState() - -class TwoColumnTemplate(PageTemplate): - def __init__(self, id, pageSize=defaultPageSize): - self.pageWidth = pageSize[0] - self.pageHeight = pageSize[1] - colWidth = 0.5 * (self.pageWidth - 2.25*inch) - frame1 = Frame(inch, - inch, - colWidth, - self.pageHeight - 2*inch, - id='leftCol') - frame2 = Frame(0.5 * self.pageWidth + 0.125, - inch, - colWidth, - self.pageHeight - 2*inch, - id='rightCol') - PageTemplate.__init__(self, id, [frame1, frame2]) # note lack of onPage - - def afterDrawPage(self, canvas, doc): - y = self.pageHeight - 50 - canvas.saveState() - canvas.setFont('Times-Roman', 10) - canvas.drawString(inch, y+8, doc.title) - canvas.drawRightString(self.pageWidth - inch, y+8, doc.chapter) - canvas.line(inch, y, self.pageWidth - inch, y*inch) - canvas.drawCentredString(doc.pagesize[0] / 2, 0.75*inch, 'Page %d' % canvas.getPageNumber()) - canvas.restoreState() - - -# class RLDocTemplate(BaseDocTemplate): -class RLDocTemplate(SimpleDocTemplate): - def afterInit(self): - self.addPageTemplates(FrontCoverTemplate('Cover', self.pagesize)) - self.addPageTemplates(OneColumnTemplate('Normal', self.pagesize)) - self.addPageTemplates(TwoColumnTemplate('TwoColumn', self.pagesize)) - self.addPageTemplates(OneColumnTemplate('Cover', self.pagesize)) - - #just playing - self.title = "(Document Title Goes Here)" - self.chapter = "(No chapter yet)" - self.chapterNo = 1 #unique keys - self.sectionNo = 1 # unique keys - -## # AR hack -## self.counter = 1 - def beforeDocument(self): - self.canv.showOutline() - - def afterFlowable(self, flowable): - """Detect Level 1 and 2 headings, build outline, - and track chapter title.""" - if isinstance(flowable, Paragraph): - style = flowable.style.name - -## #AR debug text -## try: -## print '%d: %s...' % (self.counter, flowable.getPlainText()[0:40]) -## except AttributeError: -## print '%d: (something with ABag)' % self.counter -## self.counter = self.counter + 1 - - if style == 'Title': - self.title = flowable.getPlainText() - elif style == 'Heading1': - self.chapter = flowable.getPlainText() - key = 'ch%d' % self.chapterNo - self.canv.bookmarkPage(key) - self.canv.addOutlineEntry(flowable.getPlainText(), - key, 0, 0) - self.chapterNo = self.chapterNo + 1 - self.sectionNo = 1 - elif style == 'Heading2': - self.section = flowable.text - key = 'ch%ds%d' % (self.chapterNo, self.sectionNo) - self.canv.bookmarkPage(key) - self.canv.addOutlineEntry(flowable.getPlainText(), - key, 1, 0) - self.sectionNo = self.sectionNo + 1 diff --git a/sandbox/grubert/rlpdf/stylesheet.py b/sandbox/grubert/rlpdf/stylesheet.py deleted file mode 100644 index 3b7749935..000000000 --- a/sandbox/grubert/rlpdf/stylesheet.py +++ /dev/null @@ -1,158 +0,0 @@ -#copyright ReportLab Inc. 2000 -#see rllicense.txt for license details -#history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/docs/tools/stylesheet.py?cvsroot=reportlab -#$Header$ -#standard stylesheet for our manuals -from reportlab.lib.styles import StyleSheet1, ParagraphStyle -from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RIGHT, TA_JUSTIFY -from reportlab.lib import colors - - -def getStyleSheet(): - """Returns a stylesheet object""" - stylesheet = StyleSheet1() - - stylesheet.add(ParagraphStyle(name='Normal', - fontName='Times-Roman', - fontSize=10, - leading=12, - spaceBefore=6) - ) - - stylesheet.add(ParagraphStyle(name='Comment', - fontName='Times-Italic') - ) - - stylesheet.add(ParagraphStyle(name='Indent1', - leftIndent=36, - firstLineIndent=0) - ) - - stylesheet.add(ParagraphStyle(name='BodyText', - parent=stylesheet['Normal'], - spaceBefore=6) - ) - stylesheet.add(ParagraphStyle(name='Italic', - parent=stylesheet['BodyText'], - fontName = 'Times-Italic') - ) - - stylesheet.add(ParagraphStyle(name='Heading1', - parent=stylesheet['Normal'], - fontName = 'Times-Bold', - alignment=TA_CENTER, - fontSize=18, - leading=22, - spaceAfter=6), - alias='h1') - - stylesheet.add(ParagraphStyle(name='Heading2', - parent=stylesheet['Normal'], - fontName = 'Times-Bold', - fontSize=14, - leading=17, - spaceBefore=12, - spaceAfter=6), - alias='h2') - - stylesheet.add(ParagraphStyle(name='Heading3', - parent=stylesheet['Normal'], - fontName = 'Times-BoldItalic', - fontSize=12, - leading=14, - spaceBefore=12, - spaceAfter=6), - alias='h3') - - stylesheet.add(ParagraphStyle(name='Heading4', - parent=stylesheet['Normal'], - fontName = 'Times-BoldItalic', - spaceBefore=10, - spaceAfter=4), - alias='h4') - - stylesheet.add(ParagraphStyle(name='Title', - parent=stylesheet['Normal'], - fontName = 'Times-Bold', - fontSize=48, - leading=56, - spaceAfter=72, - alignment=TA_CENTER - ), - alias='t') - - stylesheet.add(ParagraphStyle(name='Subtitle', - parent=stylesheet['Normal'], - fontName = 'Times-Bold', - fontSize=32, - leading=56, - spaceAfter=72, - alignment=TA_CENTER - ), - alias='subtitle') - - stylesheet.add(ParagraphStyle(name='Bullet', - parent=stylesheet['Normal'], - firstLineIndent=0, - leftIndent=36, - bulletIndent=18, - spaceBefore=0, - bulletFontName='Symbol'), - alias='bu') - - stylesheet.add(ParagraphStyle(name='Definition', - parent=stylesheet['Normal'], - firstLineIndent=0, - leftIndent=36, - bulletIndent=0, - spaceBefore=6, - bulletFontName='Times-BoldItalic'), - alias='df') - - stylesheet.add(ParagraphStyle(name='Code', - parent=stylesheet['Normal'], - fontName='Courier', - textColor=colors.navy, - fontSize=8, - leading=8.8, - leftIndent=36, - firstLineIndent=0)) - - stylesheet.add(ParagraphStyle(name='FunctionHeader', - parent=stylesheet['Normal'], - fontName='Courier-Bold', - fontSize=8, - leading=8.8)) - - stylesheet.add(ParagraphStyle(name='DocString', - parent=stylesheet['Normal'], - fontName='Courier', - fontSize=8, - leftIndent=18, - leading=8.8)) - - stylesheet.add(ParagraphStyle(name='DocStringIndent', - parent=stylesheet['Normal'], - fontName='Courier', - fontSize=8, - leftIndent=36, - leading=8.8)) - - stylesheet.add(ParagraphStyle(name='URL', - parent=stylesheet['Normal'], - fontName='Courier', - textColor=colors.navy, - alignment=TA_CENTER), - alias='u') - - stylesheet.add(ParagraphStyle(name='Centred', - parent=stylesheet['Normal'], - alignment=TA_CENTER - )) - - stylesheet.add(ParagraphStyle(name='Caption', - parent=stylesheet['Centred'], - fontName='Times-Italic' - )) - - return stylesheet diff --git a/sandbox/grubert/runtest b/sandbox/grubert/runtest deleted file mode 100755 index f66e2667e..000000000 --- a/sandbox/grubert/runtest +++ /dev/null @@ -1,131 +0,0 @@ -#!/bin/sh - -CHECKS=0 -FAILS=0 - -function do_diff() { - CHECKS=$((CHECKS + 1)) - diff -q -s $1 $2 - if test $? -gt 0 ; then - FAILS=$((FAIL + 1)) - fi -} - -function report() { - echo "-------------------------------------" - if test $FAILS -eq 0 ; then - echo "OK: all $CHECKS tests passed" - else - echo "ERROR: $FAILS of $CHECKS failed" - fi -} - -#CMD="../../tools/rst2latex.py --snap-footnote-refs=1" -#CMD="../../tools/rst2latex.py --footnote-references=superscript" -#CMD="../../tools/rst2latex.py --documentclass=book --hyperlink-color=0" - -CMD="../../tools/rst2latex.py" -if [ -z "$1" ] ; then - FM="*.txt" -else - FM=$1 -fi - - -for INF in `ls test/$FM` ; do - OUTF="$INF.tex" - REFF="$OUTF.ref" - $CMD $INF > $OUTF - do_diff $REFF $OUTF -done - -if [ -n "$1" -a ! "$1" == "-" ] ; then - report - exit -fi - -INF=test/french.txt -OUTF="$INF-fr.tex" -REFF="$OUTF.ref" -$CMD -l fr $INF > $OUTF -do_diff $REFF $OUTF - -INF=test/kasten.txt -OUTF="$INF-de.tex" -REFF="$OUTF.ref" -$CMD -l de $INF > $OUTF -do_diff $REFF $OUTF - -INF=test/tools.txt -OUTF="$INF-ltoc.tex" -REFF="$OUTF.ref" -$CMD --use-latex-toc 1 $INF > $OUTF -do_diff $REFF $OUTF - -CMD="../../tools/rst2latex.py -l de" -INF=test/quotes.txt -OUTF="$INF-l-de.tex" -REFF="$OUTF.ref" -$CMD $INF > $OUTF -do_diff $REFF $OUTF - -# with generated footer -CMD="../../tools/rst2latex.py -gs" -INF=test/README.txt -OUTF="$INF-gs.tex" -REFF="$OUTF.ref" -$CMD $INF > $OUTF -do_diff $REFF $OUTF - -CMD="../../tools/rst2latex.py --documentclass=book" -INF=test/README.txt -OUTF="$INF-book.tex" -REFF="$OUTF.ref" -$CMD $INF > $OUTF -do_diff $REFF $OUTF - -#CMD="../../tools/rst2latex.py --dump-settings" -CMD="../../tools/rst2latex.py --no-doc-info" -INF=test/README.txt -OUTF="$INF-no-info.tex" -REFF="$OUTF.ref" -$CMD $INF > $OUTF -do_diff $REFF $OUTF - -CMD="../../tools/rst2latex.py --no-doc-title" -INF=test/README.txt -OUTF="$INF-no-title.tex" -REFF="$OUTF.ref" -$CMD $INF > $OUTF -do_diff $REFF $OUTF - -CMD="../../tools/rst2latex.py --no-doc-title --no-doc-info" -INF=test/README.txt -OUTF="$INF-no-title-info.tex" -REFF="$OUTF.ref" -$CMD $INF > $OUTF -do_diff $REFF $OUTF - -echo ATTRIBUTION -CMD="../../tools/rst2latex.py --attribution=none" -INF=test/attribution.txt -OUTF="$INF-none-attribution.tex" -REFF="$OUTF.ref" -$CMD $INF > $OUTF -do_diff $REFF $OUTF - -CMD="../../tools/rst2latex.py --attribution=parens" -INF=test/attribution.txt -OUTF="$INF-parens-attribution.tex" -REFF="$OUTF.ref" -$CMD $INF > $OUTF -do_diff $REFF $OUTF - -INF=test/iso-8859-15.txt -OUTF="$INF-enc.tex" -REFF="$OUTF.ref" -$CMD --input-encoding=iso-8859-15 --output-encoding=iso-8859-15 $INF > $OUTF -do_diff $REFF $OUTF - -report - diff --git a/sandbox/grubert/style.tex b/sandbox/grubert/style.tex deleted file mode 100644 index 8c6bcc28a..000000000 --- a/sandbox/grubert/style.tex +++ /dev/null @@ -1,21 +0,0 @@ -% donot indent first line. -\setlength{\parindent}{0pt} -\setlength{\parskip}{5pt plus 2pt minus 1pt} - -% sloppy -% ------ -% Less strict (opposite to default fussy) space size between words. Therefore -% less hyphenation. -\sloppy - -% fonts -% ----- -% times for pdf generation, gives smaller pdf files. -% -% But in standard postscript fonts: courier and times/helvetica do not fit. -% Maybe use pslatex. -\usepackage{times} - -% pagestyle -\pagestyle{headings} - diff --git a/sandbox/grubert/tools/pdf.py b/sandbox/grubert/tools/pdf.py deleted file mode 100755 index de89e44d5..000000000 --- a/sandbox/grubert/tools/pdf.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python - -""" -:Author: Engelbert Gruber -:Contact: grubert@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This module has been placed in the public domain. - -A minimal front-end to the Docutils Publisher, producing PDF via ReportLabs. -""" - -from docutils.core import publish_cmdline -try: - from docutils.writers.rlpdf import Writer -except ImportError: - from rlpdf import Writer - - -usage = 'usage:\n %prog [options] [source [destination]]' - -publish_cmdline(writer=Writer(), usage=usage) diff --git a/sandbox/gschwant/docfactory/LICENSE.txt b/sandbox/gschwant/docfactory/LICENSE.txt deleted file mode 100644 index 39bed4591..000000000 --- a/sandbox/gschwant/docfactory/LICENSE.txt +++ /dev/null @@ -1,32 +0,0 @@ -DocFactory License -================== - -Copyright (c) 2002 Dr. Gunnar Schwant (g.schwant@gmx.de). -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -* Neither the name of the author nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sandbox/gschwant/docfactory/NOTES.txt b/sandbox/gschwant/docfactory/NOTES.txt deleted file mode 100644 index c0e7a80ae..000000000 --- a/sandbox/gschwant/docfactory/NOTES.txt +++ /dev/null @@ -1,52 +0,0 @@ -=================== - DocFactory_ Notes -=================== - -:Date: $Date$ -:Revision: $Revision$ - -.. _DocFactory: http://docutils.sf.net/sandbox/gschwant/docfactory/ - -.. contents:: - -The names of the original contributors are appended to the items, -marked in brackets. - - -To Do -===== - -* Convert system message handling from stderr parsing to simply using - the "line" attribute of system_message elements, accessible from - ``document.parse_messages`` and ``document.transform_messages``. - [David Goodger] - -* Use the docutils.conf config file mechanism. May require changes to - the current Docutils setup. [David Goodger] - -* Add a dependency checking mechanism, like that in pep2html.py. - [David Goodger] - -* Any variable data saved between runs should be stored in the user's - home directory; perhaps in a ~/.docutils file. [David Goodger] - - -Ideas -===== - -* Should the interface be file-centric instead of project-centric? I - think the user should be able to open a file, edit it, and process - it, without having to create a project first. Projects should be - optional. [David Goodger] - -* What is the current representation of a project? Is it best? - [David Goodger] - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: diff --git a/sandbox/gschwant/docfactory/README.txt b/sandbox/gschwant/docfactory/README.txt deleted file mode 100644 index b5f0a3773..000000000 --- a/sandbox/gschwant/docfactory/README.txt +++ /dev/null @@ -1,434 +0,0 @@ -==================== - DocFactory README -==================== - -:author: Dr. Gunnar Schwant -:contact: g.schwant@gmx.de -:date: 2003/03/02 -:copyright: Copyright (c) 2002 Dr. Gunnar Schwant (g.schwant@gmx.de). - All rights reserved. See LICENSE.txt_ for license details. - -:abstract: This is a short introduction to DocFactory. Hopefully, - more documentation will be available soon. - -.. contents:: -.. sectnum:: - -What is it? -=========== - -DocFactory is a kind of *integrated publishing environment* for -documentation, tied to |Docutils|. In fact, the intention of -DocFactory is to be a GUI for Docutils. At present it can be used -to edit a set of one or more |ReST| files simultaneously -and publish them as HTML. Support for other markups and output -formats is planned for future releases; see `Future Directions`_. - -DocFactory was built using |Docutils|, |Python| and |wxPython|. -*Many thanks to all developers!* - - -System requirements -=================== - -DocFactory is distributed as a subpackage of Docutils -(``docutils.factory``). In order to run it in a Python-environment -you'll need the following: - -* Python 2.1.1 or later (|http://www.python.org|). - -* wxPython 2.3.4.2 or later (|http://wxpython.org|). Be sure to get the - build matching the version of Python you're using. - -* Docutils 0.2.8 or later (|http://docutils.sourceforge.net|). Use the - CVS snapshot; improvements are being made almost daily. - - -Installation -============ - -The first step is to expand the ``.tar.gz`` or ``.tgz`` archive. [1]_ -It contains a distutils setup file "setup.py". OS-specific -installation instructions follow. - -Win32 ------ - -1. Open a DOS box (Command Shell, MSDOS Prompt, or whatever they're - calling it these days). - -2. Go to the directory created by expanding the archive:: - - cd - -3. Install the package:: - - \python setup.py install - - -GNU/Linux, Unix, MacOS X, etc. ------------------------------- - -1. Open a shell. - -2. Go to the directory created by expanding the archive:: - - cd - -3. Install the package:: - - python setup.py install - - If the python executable isn't on your path, you'll have to specify - the complete path, such as /usr/local/bin/python. You may need - root permissions to complete this step. - -.. note:: To create and browse the documentation of DocFactory please - run the script ``createdoc.py``. This script converts all the - ``.txt``-files of the tarball to ``.html``-files and opens - ``doc/index.html`` with your default webbrowser. - -Usage -===== - -How to start DocFactory ------------------------ - -After successful installation you'll find "docfactory.py" in the -scripts-directory of your Python environment. Run this file in the -same way as you do it with any other Python-program on your system. -The main window will appear. - -Files ------ - -Create a new file -~~~~~~~~~~~~~~~~~ - -Type ``Ctrl+N`` to create a new text file. You will be asked for a -location and title of the new file. Afterwards the file will be -created, added to the tree on the left and loaded it into the editor. -As you will notice the title has been inserted at the top of the -file. - -Open an existing file -~~~~~~~~~~~~~~~~~~~~~ - -To open an already existing text file simply type ``Ctrl+O`` and -select the file. It will be added to the tree and loaded into -the editor. Moreover, you can open a file from the command-line -if you specify the file as first parameter. A command like ``python -[Scripts-directory]/docfactory.py []`` should launch DocFactory -and open the file for editing. (Of course, this command depends on your -system. For example:: - - C:\>python Python22\Scripts\docfactory.py temp\test.txt - -works on my windows machine. In particular, the Python executable has -to be on your path.) - - -Publish a file -~~~~~~~~~~~~~~ - -To "publish" a file means to process the file into useful formats, such -as HTML, XML or TeX. - -A file which has been loaded into the editor can be published by pressing -``F7``. You will be asked for a docutils-writer, an output-directory and -a filename: - -================= ========================================================= -Dialogue Item Description -================= ========================================================= -Docutils-Writer The docutils-writer which will be used for publishing. -Output-Directory The directory where the output-file will be created. -Output-File The name of the output-file. (Existing files will be - overwritten!) -================= ========================================================= - -Press "OK" to start the publisher. - -If you choose the HTML-writer the HTML-file will be displayed on -DocFactory's HTML-viewer-page as soon as it is finished. Please note that -this viewer does support stylesheets on Windows platforms only (including -Windows 95, 98, ME, 2000, NT, XP). On any other platform you will have to -check the final layout with a webbrowser of your choice (which hopefully -does support stylesheets). Click on "View In Browser" to open the file -with your system's default webbrowser. - -.. note:: Please note that publishing happens in a standard Docutils way - and can be customized by setting up Docutils configuration files. - [2]_ - -Projects --------- - -If you want - -* to edit and publish one or more text files in the same way - -* to use DocFactory to edit the same files more than once *or* - -* to setup a Docutils configuration file easily - -a project may be the right choice for you. - -Setting up a project -~~~~~~~~~~~~~~~~~~~~ - -To setup a project select "Project -> New". The **Project Settings** -dialog will appear. It consists of two pages: - -**DocFactory-page** - On this page you specify an *output-directory* and a *title* for your - project. The output-directory is the default directory for any - output-files be created. - -**Docutils-page** - As part of your project a Docutils configuration file ``docutils.conf`` - will be created in the output-directory. (If there is already a - ``docutils.conf`` file in the output-directory this one will be used.) - On the Docutils-page of the "Project Settings" dialog you can set - the values of certain configuration file entries (*stylesheet*, - *output-encoding*, *datestamp*, ...). Please have a closer look at - the Docutils documentation on configuration file entries to learn about - the effect of these settings. [3]_ - -Press the "OK"-button to finish the setup. The project appears as part -of the tree on the left. - -**A note on stylesheets:** You shouldn't worry about the stylesheet. When -you leave the "Project Settings" dialog DocFactory checks if the stylesheet -is present. If the stylesheet can not be found a dialog window will pop up -and ask you if you want that DocFactory creates a stylesheet for you. You -will be offered two different styles ("Classic" and "Modern"). Select one -and press "OK". - - -Adding files to a project -~~~~~~~~~~~~~~~~~~~~~~~~~ - -In order to create a new file within a project or add an existing file -to a project simply activate the project's item in the tree on the left -(double-click) and press ``Ctrl+N`` or ``Ctrl+O``. The behaviour is like -this: If a project is active any file which is created and/or opened will -be added to the active project. (If no project is active files will be -created/opened outside of projects.) - - -Editing -------- - -Keyboard Shortcuts -~~~~~~~~~~~~~~~~~~ - -For rapid development DocFactory features Windows-style keyboard -shortcuts: - -============================== =========================================== -Action Keyboard Shortcut -============================== =========================================== -**File Menu** ---------------------------------------------------------------------------- -New File ``Ctrl+N`` ------------------------------- ------------------------------------------- -Open File ``Ctrl+O`` ------------------------------- ------------------------------------------- -Save File ``Ctrl+S`` ------------------------------- ------------------------------------------- -Publish File ``F7`` ------------------------------- ------------------------------------------- -Exit Application ``Alt+X`` ------------------------------- ------------------------------------------- -**Edit Menu** ---------------------------------------------------------------------------- -Undo ``Ctrl+Z`` ------------------------------- ------------------------------------------- -Redo ``Ctrl+Y`` ------------------------------- ------------------------------------------- -Cut ``Shift+Del``, ``Ctrl+X`` ------------------------------- ------------------------------------------- -Copy ``Ctrl+Ins``, ``Ctrl+C`` ------------------------------- ------------------------------------------- -Paste ``Shift+Ins``, ``Ctrl+V`` ------------------------------- ------------------------------------------- -Select all ``Ctrl+A`` ------------------------------- ------------------------------------------- -Find & Replace ``Ctrl+F`` ------------------------------- ------------------------------------------- -Goto line ``Ctrl+G`` ------------------------------- ------------------------------------------- -**Toolbox Menu** ---------------------------------------------------------------------------- -Open toolbox ``F8`` ------------------------------- ------------------------------------------- -**Further editing commands** ---------------------------------------------------------------------------- -Cursor movement Arrow keys or mouse ------------------------------- ------------------------------------------- -Beginning of line ``Home`` ------------------------------- ------------------------------------------- -End of line ``End`` ------------------------------- ------------------------------------------- -Beginning of buffer ``Ctrl+Home`` ------------------------------- ------------------------------------------- -End of the buffer ``Ctrl+End`` ------------------------------- ------------------------------------------- -Select text Hold down ``Shift`` while moving the cursor ------------------------------- ------------------------------------------- -Zoom-In ``Ctrl+L`` ------------------------------- ------------------------------------------- -Zoom-Out ``Ctrl+K`` -============================== =========================================== - -Right mouse-click brings up a popup-dialog with most of the above -editor commands. Moreover, you can use the mouse to move selected -text. - - -Find & Replace -~~~~~~~~~~~~~~ - -The "Find & Replace"-dialog was introduced with DocFactory release 0.2 -and is special in the sense that it uses |regular expression syntax| -for searching as defined by Python's re-module. This offers a great deal -of flexibility in searching. For example: Searching for ``Fred|Ted`` will -search the file for appearances of ``Fred`` as well as for appearances -of ``Ted``. However, it also requires a certain kind of familiarity with -Python's regular expression syntax. For example: In order to find -appearances of ``C:\temp\test.txt`` you will have to search for -``C:\\temp\\test.txt``. - - -Toolbox -------- - -The Toolbox allows you to run operating system commands from within -DocFactory. In the menu bar select "Toolbox -> Configure" to set up -your personal toolbox. Press the "+"-button to add a new tool. You will -be asked for a **name**, a **command** and an **initial directory**: - -================= ========================================================= -Dialogue Item Description -================= ========================================================= -Name An individual name of the tool. -Command The operating system command which will be executed - when you run the tool. -Initial Directory The initial working directory of the tool. -================= ========================================================= - -Command and initial directory of a tool may include **tool macros** which -will be replaced on tool-execution as follows: - -================= ========================================================= -Tool Macro Description -================= ========================================================= -``$[FilePath]`` The full pathname of the active file. -``$[FileDir]`` The drive and directory of the active file. -``$[FileName]`` The filename of the active file. -``$[FileBase]`` The filename without the extension. -``$[ProjectDir]`` The output-directory of the active project. -================= ========================================================= - -To launch a tool select "Toolbox -> Open..." or press ``F8``. - -Data Storage -============ - -DocFactory uses the Python's |ConfigParser|-module to store any information -about projects, tools, etc. which has to be saved between runs. [4]_ -As default the data storage file is located in the package's directory. [5]_ -The default name of the file is ``docfactory.dat``. - -You can change the name and location of the data storage file by creating -a file called ``conf.pth`` in the package's directory. This file should -consist of one line only which contains the complete data storage path. -For example: If the first line of ``conf.pth`` is - -:: - - /home/fred/.docfactory - -DocFactory will store its data in ``/home/fred/.docfactory``. - - -Future Directions -================= - -Future releases of DocFactory will support any markup and output -formats which are supported by Docutils. Some other useful things -will be implemented as well. For example: - -* more stylesheets (please contribute!) -* preferences dialog -* [...] - -*Now, this should be enough for the beginning. Start playing with -DocFactory, have fun, report bugs, contribute, ... Any kind of -feedback is welcome.* - ---------- - -.. Footnotes - -.. [1] The latest DocFactory-tarball is available at - http://docutils.sf.net/docfactory-snapshot.tgz. - -.. [2] http://docutils.sourceforge.net/docs/tools.html#configuration-files - -.. [3] http://docutils.sourceforge.net/docs/tools.html#configuration-file-entries - -.. [4] The storage file has a ``[docfactory_project: ]`` - section for each project. (```` is replaced by the - project's name.) Each section header is followed by two ``name=value`` - entries: One for all project files and one for the outputdirectory. - For example: The section for a project called ``project_01`` which - consists of two files ``C:\file1.txt``, ``C:\file2.txt`` and whose - output-directory is ``C:\project1`` looks like this:: - - [docfactory_project: project_01] - files=C:\file1.txt;C:\file2.txt - outputdirectory=C:\project1 - -.. [5] ``os.path.dirname(docutils.factory.__file__)`` - -.. Hyperlinks - -.. _LICENSE.txt: LICENSE.html - -.. |ReST| raw:: html - - reStructuredText - -.. |Python| raw:: html - - Python - -.. |http://www.python.org| raw:: html - - http://www.python.org - -.. |wxPython| raw:: html - - wxPython - -.. |http://wxPython.org| raw:: html - - http://wxPython.org - -.. |Docutils| raw:: html - - Docutils - -.. |http://docutils.sourceforge.net| raw:: html - - http://docutils.sourceforge.net - -.. |regular expression syntax| raw:: html - - regular expression syntax - -.. |ConfigParser| raw:: html - - ConfigParser diff --git a/sandbox/gschwant/docfactory/createdoc.py b/sandbox/gschwant/docfactory/createdoc.py deleted file mode 100644 index 6f57dec48..000000000 --- a/sandbox/gschwant/docfactory/createdoc.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python - -""" -:author: Dr. Gunnar Schwant -:contact: g.schwant@gmx.de -:version: 0.2.1 -""" - -import glob, os, webbrowser -from docutils.core import publish_cmdline - -def convert(): - for file in glob.glob('*.txt'): - htmlfile = '%s.html' % os.path.splitext(file)[0] - print '%s --> %s' % (file, htmlfile) - publish_cmdline(writer_name='html', - argv = [file, htmlfile]) - -if __name__=='__main__': - print '\nGenerating HTML ...\n' - convert() - os.chdir('doc') - convert() - print '\nOpen doc/index.html with default webbrowser ...\n' - webbrowser.open('index.html') diff --git a/sandbox/gschwant/docfactory/doc/FAQ.txt b/sandbox/gschwant/docfactory/doc/FAQ.txt deleted file mode 100644 index 406ea698d..000000000 --- a/sandbox/gschwant/docfactory/doc/FAQ.txt +++ /dev/null @@ -1,52 +0,0 @@ -===================================== -DocFactory Frequently Asked Questions -===================================== - -.. If you have downloaded this file as part of the - DocFactory-tarball, please use docutils to convert - it to HTML and open index.html with your webbrowser. - -.. contents:: Questions -.. section-numbering:: - -How can I manage accentuated characters to be processed properly? -================================================================= - -On the "Docutils"-page of the "Project-Settings"-dialog be sure to set -Docutils' output-encoding to the right value. For example: ``ISO-8859-1`` -for french or german accentuated characters. (The default setting is -``UTF-8``.) The problem is to find out which encoding you need. There is -a wide variety of encodings available. Many of these encodings support -the same languages. However, they vary in individual characters. For -example, ``ISO-8859-1`` does not support the EURO SIGN (try ``cp1252`` -if you need it). If you face problems your first attempt should be -to try out Python's different standard encodings which can be found -at |www.python.org|. - -.. |www.python.org| raw:: html - - http://www.python.org/dev/doc/devel/lib/node123.html - - -Is it possible to run DocFactory on systems without a Python installation? -========================================================================== - -The Docfactory-tarball contains a script called ``docfactory2exe.py``. If -|py2exe| is installed on your machine you can use this script to convert -``docfactory.py`` into a into an executable Windows program, which is able -to run without requiring a Python installation. Copy ``docfactory2exe.py`` -and ``docfactory.ico`` (both part of the tarball) to the directory where -``docfactory.py`` is located, go to the command-line and enter - -:: - - python docfactory2exe.py py2exe -w -p encodings,docutils --icon docfactory.ico - -This will create a sub-directory ``dist\docfactory``, containing the file -``docfactory.exe`` and several other files needed at runtime. (Visit -|py2exe| for more details.) - -.. |py2exe| raw:: html - - py2exe - diff --git a/sandbox/gschwant/docfactory/doc/HISTORY.txt b/sandbox/gschwant/docfactory/doc/HISTORY.txt deleted file mode 100644 index ad3a478b7..000000000 --- a/sandbox/gschwant/docfactory/doc/HISTORY.txt +++ /dev/null @@ -1,67 +0,0 @@ -===================== - DocFactory History -===================== - -.. If you have downloaded this file as part of the - DocFactory-tarball, please use docutils to convert - it to HTML and open index.html with your webbrowser. - -DocFactory 0.2.4 (2003/05/01) - * "Preferences"-menu - * Backup option for files - -DocFactory 0.2.3 (2003/03/02) - * Support of more writers (XML, PEP, LaTeX) - * Toolbox - -DocFactory 0.2.2 (2003/02/16) - * Toolbar - * New "Insert Hyperlink"-feature - * Enhanced "Insert Image"-feature - -DocFactory 0.2.1 (2003/01/11) - * Processing of files which are not part of a project asks - for an output-directory. - -DocFactory 0.2 (2003/01/08) - * New editor features: - - - Change EOLs to CR/LF/CRLF - - Find & Replace... (using |regular expression syntax| as defined - by Python's re-module) - - Goto line... - - Insert image/figure/path - - Syntax highlightening for HTML-files - - * New "View"-menu: - - - View EOL markers - - View right edge indicator - - View whitespace - - Set fontsize to small/normal/big - - * Ability to open files from command-line. - * Stylesheet-support of HTML-viewer on Windows platforms. - * Automatic stylesheet-creation. - * Animated "About"-dialog. - * Added "docfactory2exe.py" for usage with |py2exe|. - * Modified data storage. - -DocFactory 0.1.4 (2002/09/30) - * Files can be opened without creating a project first. - * The project settings dialog produces a docutils configuration file. - -DocFactory 0.1.3 (2002/09/15) - * Initial sandbox-release. - - - -.. |py2exe| raw:: html - - py2exe - -.. |regular expression syntax| raw:: html - - regular expression syntax - -.. _README: ../README.html diff --git a/sandbox/gschwant/docfactory/doc/docutils.conf b/sandbox/gschwant/docfactory/doc/docutils.conf deleted file mode 100644 index 0fe9d29ec..000000000 --- a/sandbox/gschwant/docfactory/doc/docutils.conf +++ /dev/null @@ -1,12 +0,0 @@ -[options] -output_encoding = UTF-8 -footnote_backlinks = 1 -compact_lists = 1 -generator = -source_link = -embed_stylesheet = -stylesheet_path = stylesheets/df.css -toc_backlinks = top -footnote_references = superscript -datestamp = - diff --git a/sandbox/gschwant/docfactory/doc/downloads.txt b/sandbox/gschwant/docfactory/doc/downloads.txt deleted file mode 100644 index 38fca23f2..000000000 --- a/sandbox/gschwant/docfactory/doc/downloads.txt +++ /dev/null @@ -1,11 +0,0 @@ -====================== - DocFactory Download -====================== - -.. If you have downloaded this file as part of the - DocFactory-tarball, please use docutils to convert - it to HTML and open index.html with your webbrowser. - -* `Latest development snapshot`_ - -.. _`Latest development snapshot`: http://docutils.sourceforge.net/docfactory-snapshot.tgz diff --git a/sandbox/gschwant/docfactory/doc/head.html b/sandbox/gschwant/docfactory/doc/head.html deleted file mode 100644 index 71595aac7..000000000 --- a/sandbox/gschwant/docfactory/doc/head.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/sandbox/gschwant/docfactory/doc/index.html b/sandbox/gschwant/docfactory/doc/index.html deleted file mode 100644 index 14a3dfdc1..000000000 --- a/sandbox/gschwant/docfactory/doc/index.html +++ /dev/null @@ -1,24 +0,0 @@ - - - DocFactory - - - - - - - - - - - - - - diff --git a/sandbox/gschwant/docfactory/doc/navigation_l.html b/sandbox/gschwant/docfactory/doc/navigation_l.html deleted file mode 100644 index fde558cad..000000000 --- a/sandbox/gschwant/docfactory/doc/navigation_l.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DocFactory
Home
README
FAQ
Requirements
Download
Screenshots
History

Contact
g.schwant@gmx.de

Links
Docutils Home
Docutils FAQ
www.Python.org
wxPython.org



































- diff --git a/sandbox/gschwant/docfactory/doc/pics/DF.png b/sandbox/gschwant/docfactory/doc/pics/DF.png deleted file mode 100644 index cfb0caf0f..000000000 Binary files a/sandbox/gschwant/docfactory/doc/pics/DF.png and /dev/null differ diff --git a/sandbox/gschwant/docfactory/doc/pics/screenshot1.jpg b/sandbox/gschwant/docfactory/doc/pics/screenshot1.jpg deleted file mode 100644 index 2d7426812..000000000 Binary files a/sandbox/gschwant/docfactory/doc/pics/screenshot1.jpg and /dev/null differ diff --git a/sandbox/gschwant/docfactory/doc/pics/screenshot2.jpg b/sandbox/gschwant/docfactory/doc/pics/screenshot2.jpg deleted file mode 100644 index 3f9e6dc83..000000000 Binary files a/sandbox/gschwant/docfactory/doc/pics/screenshot2.jpg and /dev/null differ diff --git a/sandbox/gschwant/docfactory/doc/screenshots.txt b/sandbox/gschwant/docfactory/doc/screenshots.txt deleted file mode 100644 index 49154badd..000000000 --- a/sandbox/gschwant/docfactory/doc/screenshots.txt +++ /dev/null @@ -1,11 +0,0 @@ -======================= -DocFactory Screenshots -======================= - -.. If you have downloaded this file as part of the - DocFactory-tarball, please use docutils to convert - it to HTML and open index.html with your webbrowser. - -.. image:: pics/screenshot1.jpg - -.. image:: pics/screenshot2.jpg diff --git a/sandbox/gschwant/docfactory/doc/start.txt b/sandbox/gschwant/docfactory/doc/start.txt deleted file mode 100644 index b5b2766be..000000000 --- a/sandbox/gschwant/docfactory/doc/start.txt +++ /dev/null @@ -1,26 +0,0 @@ -========================= - Welcome to DocFactory! -========================= - -.. If you have downloaded this file as part of the - DocFactory-tarball, please use docutils to convert - it to HTML and open index.html with your webbrowser. - -DocFactory is a kind of *integrated publishing environment* for -documentation, tied to |Docutils|. In fact, the intention of -DocFactory is to be a GUI for |Docutils|. At present it can be used -to edit a set of one or more |ReST| files simultaneously -and publish them as HTML. Support for other markups and output -formats is planned for future releases. `Read more...`__ - -__ ../README.html - -.. |Docutils| raw:: html - - Docutils - -.. |ReST| raw:: html - - reStructuredText - - diff --git a/sandbox/gschwant/docfactory/doc/stylesheets/df.css b/sandbox/gschwant/docfactory/doc/stylesheets/df.css deleted file mode 100644 index af86ec0a8..000000000 --- a/sandbox/gschwant/docfactory/doc/stylesheets/df.css +++ /dev/null @@ -1,411 +0,0 @@ - -/* -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:date: $Date$ -:version: $Revision$ -:copyright: This stylesheet has been placed in the public domain. - -Default cascading style sheet for the HTML output of Docutils. -*/ - -.first { - margin-top: 0 } - -.last { - margin-bottom: 0 } - -a.toc-backref { - text-decoration: none ; - color: black } - -dd { - margin-bottom: 0.5em } - -div.abstract { - margin: 2em 5em } - -div.abstract p.topic-title { - font-weight: bold ; - text-align: center } - -div.attention, div.caution, div.danger, div.error, div.hint, -div.important, div.note, div.tip, div.warning { - margin: 2em ; - border: medium outset ; - padding: 1em } - -div.attention p.admonition-title, div.caution p.admonition-title, -div.danger p.admonition-title, div.error p.admonition-title, -div.warning p.admonition-title { - color: red ; - font-weight: bold ; - font-family: sans-serif } - -div.hint p.admonition-title, div.important p.admonition-title, -div.note p.admonition-title, div.tip p.admonition-title { - font-weight: bold ; - font-family: sans-serif } - -div.dedication { - margin: 2em 5em ; - text-align: center ; - font-style: italic } - -div.dedication p.topic-title { - font-weight: bold ; - font-style: normal } - -div.figure { - margin-left: 2em } - -div.footer, div.header { - font-size: smaller } - -div.system-messages { - margin: 5em } - -div.system-messages h1 { - color: red } - -div.system-message { - border: medium outset ; - padding: 1em } - -div.system-message p.system-message-title { - color: red ; - font-weight: bold } - -div.topic { - margin: 2em } - -hr { - width: 75% } - -ol.simple, ul.simple { - margin-bottom: 1em } - -ol.arabic { - list-style: decimal } - -ol.loweralpha { - list-style: lower-alpha } - -ol.upperalpha { - list-style: upper-alpha } - -ol.lowerroman { - list-style: lower-roman } - -ol.upperroman { - list-style: upper-roman } - -p.caption { - font-style: italic } - -p.credits { - font-style: italic ; - font-size: smaller } - -p.label { - white-space: nowrap } - -p.topic-title { - font-weight: bold } - -pre.address { - margin-bottom: 0 ; - margin-top: 0 ; - font-family: serif ; - font-size: 100% } - -pre.line-block { - font-family: serif ; - font-size: 100% } - -pre.literal-block, pre.doctest-block { - background-color: #eeeeee } - -span.classifier { - font-family: sans-serif ; - font-style: oblique } - -span.classifier-delimiter { - font-family: sans-serif ; - font-weight: bold } - -span.interpreted { - font-family: sans-serif } - -span.option-argument { - font-style: italic } - -span.pre { - white-space: pre } - -span.problematic { - color: red } - -table { - margin-top: 0.5em ; - margin-bottom: 0.5em } - -table.citation { - border-left: solid thin gray ; - padding-left: 0.5ex } - -table.docinfo { - margin: 2em 4em } - -table.footnote { - border-left: solid thin black ; - padding-left: 0.5ex } - -td, th { - padding-left: 0.5em ; - padding-right: 0.5em ; - vertical-align: top } - -th.docinfo-name, th.field-name { - font-weight: bold ; - text-align: left ; - white-space: nowrap } - -h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { - font-size: 100% } - -tt { - background-color: #eeeeee } - -ul.auto-toc { - list-style-type: none } - - -/* -Additional styles for "modern"-style of DocFactory. - -:Author: Gunnar Schwant -:Contact: g.schwant@gmx.de -*/ - -.first { - font-size: 10pt } - -.last { - font-size: 10pt } - -a { - text-decoration: none } - -a.reference { - color: #00009F } - -a:hover { - background-color: #00009F ; - color: white } - -body { - font-family: arial,helvetica,univers ; - font-size: 10pt ; - padding-top: 0.6cm ; - margin-left:0.5cm ; - margin-right:0.5cm ; - margin-bottom:0.5cm } - -dd { - font-size: 10pt ; - padding-top: 0.1cm -} - -dt { - font-size: 10pt ; - font-weight: bold ; - background-color: #6FC7FB ; - padding-left: 0.1cm ; - padding-top: 0.1cm ; - padding-bottom: 0.1cm } - -div.abstract { - font-size: 10pt } - -div.abstract p.topic-title { - font-size: 10pt } - -div.attention, div.caution, div.danger, div.error, div.hint, -div.important, div.note, div.tip, div.warning { - font-size: 10pt } - -div.attention p.admonition-title, div.caution p.admonition-title, -div.danger p.admonition-title, div.error p.admonition-title, -div.warning p.admonition-title, div.hint p.admonition-title, -div.important p.admonition-title, div.note p.admonition-title, -div.tip p.admonition-title { - margin-top: 0em ; - font-size: 12pt ; - font-family: arial,helvetica,univers } - -div.dedication { - font-size: 10pt } - -div.dedication p.topic-title { - font-size: 10pt } - -div.figure { - font-size: 10pt } - -div.footer, div.header { - font-size: 8pt } - -div.system-messages { - font-size: 10pt } - -div.system-messages h1 { - font-size: 12pt } - -div.system-message { - font-size: 10pt } - -div.system-message p.system-message-title { - font-size: 10pt } - -div.topic { - font-size: 10pt } - -h1, h2, h3, h4, h5, h6 { - padding-top: 0.5cm ; - page-break-after: avoid ; - font-family: arial,helvetica,univers } - -h1 { - font-size: 18pt } - -h1.title { - color: white ; - background-color: #00009F ; - padding-top: 0cm } - -h2 { - font-size: 16pt } - -h2.subtitle { - padding-top: 0cm } - -h3 { - font-size: 14pt } - -h4 { - font-size: 12pt } - -h5, h6 { - font-size: 10pt } - -hr { - width: 100%; - page-break-after: always } - -li { - padding-top: 1mm ; - padding-bottom: 1mm } - -ol.simple, ul.simple { - font-size: 10pt } - -ol.arabic { - font-size: 10pt } - -ol.loweralpha { - font-size: 10pt } - -ol.upperalpha { - font-size: 10pt } - -ol.lowerroman { - font-size: 10pt } - -ol.upperroman { - font-size: 10pt } - -p.caption { - font-size: 10pt } - -p.credits { - font-style: italic ; - font-size: 8pt } - -p.label { - font-size: 10pt } - -p.topic-title { - font-size: 10pt } - -pre.address { - font-family: arial,helvetica,univers ; - font-size: 10pt } - -pre.line-block { - font-size: 10pt } - -pre.literal-block, pre.doctest-block { - border-width: 1pt ; - border-style: solid ; - border-color: #999999 ; - color: #0000C0 ; - background-color: #ffffe0 ; - font-size: 9pt } - -span.classifier { - font-size: 10pt ; - font-family: arial,helvetica,univers } - -span.classifier-delimiter { - font-size: 10pt ; - font-family: arial,helvetica,univers } - -span.field-argument { - font-size: 10pt } - -span.interpreted { - font-size: 10pt ; - font-family: arial,helvetica,univers } - -span.option-argument { - font-size: 10pt } - -span.problematic { - font-size: 10pt } - -table { - font-size: 10pt ; - border-collapse: collapse ; - border-width: 1.5pt ; - border-color: #003366 } - -table.citation { - font-size: 10pt } - -table.docinfo { - font-size: 10pt } - -table.footnote { - font-size: 8pt ; - text-align: left } - -table.table { - width: 100% } - -th { - border-width: 1.5pt } - -td { - border-width: 1pt } - -td, th { - font-size: 10pt ; - border-style: thin ; - border-color: #003366 } - -td.docinfo-name, th.field-name { - font-size: 10pt } - -h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { - font-size: 10pt } diff --git a/sandbox/gschwant/docfactory/doc/stylesheets/navigation_l.css b/sandbox/gschwant/docfactory/doc/stylesheets/navigation_l.css deleted file mode 100644 index 2e6d177c9..000000000 --- a/sandbox/gschwant/docfactory/doc/stylesheets/navigation_l.css +++ /dev/null @@ -1,38 +0,0 @@ -@import url(df.css); - -a { - color: black ; - font-size: 8pt } - -a:hover { - background-color: #00009F } - -body { - background-color: white ; - font-size: 8pt ; - padding-top: 0.6cm ; - margin-top: 0cm ; - margin-left: 0cm ; - margin-right: 0.3cm ; - margin-bottom: 1.0cm } - -table { - margin-top: 0cm ; - width: 100% ; - border-width: 0pt ; - border-style: thin } - -td { - background-color: #6FC7FB ; - font-size: 8pt ; - width: 100% ; - border-width: 0pt ; - border-style: thin } - -td.section { - background-color: #00009F ; - font-weight: bold ; - color: white } - -td.empty { - background-color: white } diff --git a/sandbox/gschwant/docfactory/docfactory.ico b/sandbox/gschwant/docfactory/docfactory.ico deleted file mode 100644 index 6717dc00c..000000000 Binary files a/sandbox/gschwant/docfactory/docfactory.ico and /dev/null differ diff --git a/sandbox/gschwant/docfactory/docfactory.py b/sandbox/gschwant/docfactory/docfactory.py deleted file mode 100755 index ba3a62b53..000000000 --- a/sandbox/gschwant/docfactory/docfactory.py +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env python - -""" -:author: Dr. Gunnar Schwant -:contact: g.schwant@gmx.de -:version: 0.2 -""" - -from docutils.factory import main -main.main() diff --git a/sandbox/gschwant/docfactory/docfactory2exe.py b/sandbox/gschwant/docfactory/docfactory2exe.py deleted file mode 100644 index 711d49c7e..000000000 --- a/sandbox/gschwant/docfactory/docfactory2exe.py +++ /dev/null @@ -1,17 +0,0 @@ -""" -:author: Dr. Gunnar Schwant -:contact: g.schwant@gmx.de -:version: 0.2 - -Usage:: - - python docfactory2exe.py py2exe -w -p encodings,docutils --icon docfactory.ico - -""" - -from distutils.core import setup -import py2exe - -setup(name="DocFactory", - scripts=["docfactory.py"], - ) diff --git a/sandbox/gschwant/docfactory/docutils.conf b/sandbox/gschwant/docfactory/docutils.conf deleted file mode 100644 index 73cf660c4..000000000 --- a/sandbox/gschwant/docfactory/docutils.conf +++ /dev/null @@ -1,12 +0,0 @@ -[options] -output_encoding = ISO-8859-1 -footnote_backlinks = 1 -compact_lists = 1 -generator = -source_link = -embed_stylesheet = -stylesheet_path = doc/stylesheets/df.css -toc_backlinks = top -footnote_references = superscript -datestamp = - diff --git a/sandbox/gschwant/docfactory/factory/.cvsignore b/sandbox/gschwant/docfactory/factory/.cvsignore deleted file mode 100644 index 0d20b6487..000000000 --- a/sandbox/gschwant/docfactory/factory/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -*.pyc diff --git a/sandbox/gschwant/docfactory/factory/__init__.py b/sandbox/gschwant/docfactory/factory/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/sandbox/gschwant/docfactory/factory/browser.py b/sandbox/gschwant/docfactory/factory/browser.py deleted file mode 100644 index 5b638900b..000000000 --- a/sandbox/gschwant/docfactory/factory/browser.py +++ /dev/null @@ -1,198 +0,0 @@ -""" -:author: Dr. Gunnar Schwant -:contact: g.schwant@gmx.de -:version: 0.2.4 -""" - -import sys, os, webbrowser - -from wxPython.wx import * -from wxPython.html import * -from wxPython.lib.dialogs import wxScrolledMessageDialog -from dialogs import customMsgBox - -if wxPlatform == '__WXMSW__': - from wxPython.iewin import * - -class HtmlWindow(wxHtmlWindow): - def __init__(self, parent, id, log): - wxHtmlWindow.__init__(self, parent, id) - self.log = log - - def OnLinkClicked(self, linkinfo): - self.log.WriteText('You clicked on link: %s\n' % linkinfo.GetHref()) - # Virtuals in the base class have been renamed with base_ on the front. - self.base_OnLinkClicked(linkinfo) - -class HtmlPanel(wxPanel): - def __init__(self, parent, frame, log, htmlfile=None): - wxPanel.__init__(self, parent, -1) - self.log = log - self.frame = frame - self.cwd = os.path.split(sys.argv[0])[0] - if not self.cwd: - self.cwd = os.getcwd() - - self.html = HtmlWindow(self, -1, log) - - self.printer = wxHtmlEasyPrinting() - - self.box = wxBoxSizer(wxVERTICAL) - self.box.Add(self.html, 1, wxGROW) - - subbox = wxBoxSizer(wxHORIZONTAL) - - exitID=wxNewId() - btn = wxButton(self, exitID, "View In Browser") - EVT_BUTTON(self, exitID, self.OnViewInBrowser) - subbox.Add(btn, 1, wxGROW | wxALL, 2) - - exitID=wxNewId() - btn = wxButton(self, exitID, "View Source") - EVT_BUTTON(self, exitID, self.OnViewSource) - subbox.Add(btn, 1, wxGROW | wxALL, 2) - - exitID=wxNewId() - btn = wxButton(self, exitID, "<<<") - EVT_BUTTON(self, exitID, self.OnBack) - subbox.Add(btn, 1, wxGROW | wxALL, 2) - - exitID=wxNewId() - btn = wxButton(self, exitID, ">>>") - EVT_BUTTON(self, exitID, self.OnForward) - subbox.Add(btn, 1, wxGROW | wxALL, 2) - - exitID=wxNewId() - btn = wxButton(self, exitID, "Print") - EVT_BUTTON(self, exitID, self.OnPrint) - subbox.Add(btn, 1, wxGROW | wxALL, 2) - - self.box.Add(subbox, 0, wxGROW) - self.SetSizer(self.box) - self.SetAutoLayout(true) - - self.html.LoadPage(htmlfile) - - def OnBack(self, event): - if not self.html.HistoryBack(): - customMsgBox(self, 'No more items in history!', 'wakeup') - - def OnForward(self, event): - if not self.html.HistoryForward(): - customMsgBox(self, 'No more items in history!', 'wakeup') - - def OnViewSource(self, event): - source = self.html.GetParser().GetSource() - dlg = wxScrolledMessageDialog(self, source, 'HTML Source') - dlg.ShowModal() - dlg.Destroy() - - def OnViewInBrowser(self, event): - htmlfile = self.html.GetOpenedPage() - try: - webbrowser.open('file:%s' % htmlfile, autoraise=1) - except: - customMsgBox(self, '%s:\n%s\n%s' % sys.exc_info(), 'error') - - def OnPrint(self, event): - self.printer.PrintFile(self.html.GetOpenedPage()) - -class IEHtmlPanel(wxPanel): - - def __init__(self, parent, frame, log, htmlfile=None): - wxPanel.__init__(self, parent, -1) - self.log = log - if htmlfile != None: - self.current = htmlfile - else: - self.current = "about:blank" - self.frame = frame - if frame: - self.titleBase = frame.GetTitle() - - sizer = wxBoxSizer(wxVERTICAL) - btnSizer = wxBoxSizer(wxHORIZONTAL) - - self.ie = wxIEHtmlWin(self, -1, style = wxNO_FULL_REPAINT_ON_RESIZE) - - btn = wxButton(self, wxNewId(), '<<<', style=wxBU_EXACTFIT) - EVT_BUTTON(self, btn.GetId(), self.OnPrevPageButton) - btnSizer.Add(btn, 0, wxEXPAND|wxALL, 2) - - btn = wxButton(self, wxNewId(), '>>>', style=wxBU_EXACTFIT) - EVT_BUTTON(self, btn.GetId(), self.OnNextPageButton) - btnSizer.Add(btn, 0, wxEXPAND|wxALL, 2) - - btn = wxButton(self, wxNewId(), 'Stop', style=wxBU_EXACTFIT) - EVT_BUTTON(self, btn.GetId(), self.OnStopButton) - btnSizer.Add(btn, 0, wxEXPAND|wxALL, 2) - - btn = wxButton(self, wxNewId(), 'Refresh', style=wxBU_EXACTFIT) - EVT_BUTTON(self, btn.GetId(), self.OnRefreshPageButton) - btnSizer.Add(btn, 0, wxEXPAND|wxALL, 2) - - txt = wxStaticText(self, -1, 'Location:') - btnSizer.Add(txt, 0, wxCENTER|wxALL, 2) - - self.location = wxComboBox(self, wxNewId(), '', style=wxCB_DROPDOWN|wxPROCESS_ENTER) - EVT_COMBOBOX(self, self.location.GetId(), self.OnLocationSelect) - EVT_KEY_UP(self.location, self.OnLocationKey) - EVT_CHAR(self.location, self.IgnoreReturn) - btnSizer.Add(self.location, 1, wxEXPAND|wxALL, 2) - - sizer.Add(btnSizer, 0, wxEXPAND) - sizer.Add(self.ie, 1, wxEXPAND) - - self.ie.Navigate(self.current) - self.location.Append(self.current) - - self.SetSizer(sizer) - self.SetAutoLayout(true) - EVT_SIZE(self, self.OnSize) - - # Hook up the event handlers for the IE window - EVT_MSHTML_NEWWINDOW2(self, -1, self.OnNewWindow2) - EVT_MSHTML_DOCUMENTCOMPLETE(self, -1, self.OnDocumentComplete) - EVT_MSHTML_STATUSTEXTCHANGE(self, -1, self.OnStatusTextChange) - - def OnSize(self, evt): - self.Layout() - - def OnLocationSelect(self, evt): - url = self.location.GetStringSelection() - self.ie.Navigate(url) - - def OnLocationKey(self, evt): - if evt.KeyCode() == WXK_RETURN: - URL = self.location.GetValue() - self.location.Append(URL) - self.ie.Navigate(URL) - else: - evt.Skip() - - def IgnoreReturn(self, evt): - if evt.GetKeyCode() != WXK_RETURN: - evt.Skip() - - def OnPrevPageButton(self, event): - self.ie.GoBack() - - def OnNextPageButton(self, event): - self.ie.GoForward() - - def OnStopButton(self, evt): - self.ie.Stop() - - def OnRefreshPageButton(self, evt): - self.ie.Refresh(wxIEHTML_REFRESH_COMPLETELY) - - def OnNewWindow2(self, evt): - evt.Veto() # don't allow it - - def OnDocumentComplete(self, evt): - self.current = evt.GetText1() - self.location.SetValue(self.current) - - def OnStatusTextChange(self, evt): - if self.frame: - self.frame.SetStatusText(evt.GetText1()) diff --git a/sandbox/gschwant/docfactory/factory/controls.py b/sandbox/gschwant/docfactory/factory/controls.py deleted file mode 100644 index 75f4782a3..000000000 --- a/sandbox/gschwant/docfactory/factory/controls.py +++ /dev/null @@ -1,183 +0,0 @@ -""" -:author: Dr. Gunnar Schwant -:contact: g.schwant@gmx.de -:version: 0.2.4 -""" - -import os, throbimages, time -from wxPython.wx import * -from wxPython.stc import * -from docutilsadapter import get_rest_bibl_fields -from docutilsadapter import get_rest_directives -from dialogs import customMsgBox -from shutil import copyfile - -if wxPlatform == '__WXMSW__': - faces = { 'times': 'Times New Roman', - 'mono' : 'Courier New', - 'helv' : 'Arial', - 'other': 'Comic Sans MS', - 'size' : 10, - 'size2': 8, - } -else: - faces = { 'times': 'Times', - 'mono' : 'Courier', - 'helv' : 'Helvetica', - 'other': 'new century schoolbook', - 'size' : 12, - 'size2': 10, - } - -#--------------------------------------------------------------------------- - -class CustomStyledTextCtrl(wxStyledTextCtrl): - def __init__(self, parent, ID, log): - wxStyledTextCtrl.__init__(self, parent, ID) - self.log = log - - self.CmdKeyAssign(ord('L'), wxSTC_SCMOD_CTRL, wxSTC_CMD_ZOOMIN) - self.CmdKeyAssign(ord('K'), wxSTC_SCMOD_CTRL, wxSTC_CMD_ZOOMOUT) - self.SetEdgeMode(wxSTC_EDGE_LINE) - self.SetEdgeColour(wxColour(175,255,255)) - self.SetEdgeColumn(75) - self.SetUseTabs(0) - self.SetIndent(2) - self.SetEOLMode(wxSTC_EOL_LF) - - self.set_styles() - - EVT_STC_MODIFIED(self, ID, self.OnModified) - EVT_CHAR(self, self.OnChar) - - # lists for autocompletion: - self.bibliographic_fields = get_rest_bibl_fields() - self.directives = get_rest_directives() - - self.IsModified = 0 - - def set_styles(self): - - # general - self.StyleSetSpec(wxSTC_STYLE_DEFAULT, 'face:%(mono)s,size:%(size)d' % faces) - self.StyleSetSpec(1, 'face:%(mono)s,bold,fore:#0000FF,size:%(size)d' % faces) - self.StyleSetSpec(2, 'face:%(mono)s,italic,fore:#FF0000,size:%(size)d' % faces) - self.StyleSetSpec(3, 'face:%(mono)s,bold,size:%(size)d' % faces) - self.StyleSetSpec(4, 'face:%(mono)s,size:%(size)d' % faces) - self.StyleSetSpec(wxSTC_STYLE_CONTROLCHAR, 'face:%(other)s' % faces) - - # line numbers in the margin - self.StyleSetSpec(wxSTC_STYLE_LINENUMBER, - 'back:#C0C0C0,face:%(helv)s,size:%(size2)d' % faces) - self.SetMarginType(0, wxSTC_MARGIN_NUMBER) - self.SetMarginWidth(0, 3*faces['size']-2) - - # markers - self.SetMarginType(1, wxSTC_MARGIN_SYMBOL) - self.MarkerDefine(0, wxSTC_MARK_CIRCLE, 'RED', '#FFFF00') - self.MarkerDefine(1, wxSTC_MARK_CIRCLE, '#FFFF00', 'RED') - - def OnChar(self, event): - key = event.KeyCode() - currpos = self.GetCurrentPos() - currcol = self.GetColumn(currpos) - if currcol == 0 and key == ord(':'): - self.AddText(':') - self.AutoCompShow(0, self.bibliographic_fields) - elif currcol == 2 and key == ord(' '): - if self.GetCharAt(currpos - 1) == self.GetCharAt(currpos - 2) == ord('.'): - self.AddText(' ') - self.AutoCompShow(0, self.directives) - else: - event.Skip() - else: - event.Skip() - - def OnModified(self, evt): - self.IsModified = 1 - - def set_lexer(self, ext): - lexer = self.GetLexer() - if ext == '.html' or ext == '.htm': - if lexer != wxSTC_LEX_HTML: - self.SetLexer(wxSTC_LEX_HTML) - else: - if lexer != wxSTC_LEX_NULL: - self.SetLexer(wxSTC_LEX_NULL) - - def LoadFile(self, filename): - try: - wxBeginBusyCursor() - try: - f = open(filename, 'rt') - text = f.read() - f.close() - ext = os.path.splitext(filename)[1] - self.set_lexer(ext) - self.SetText(text) - self.EmptyUndoBuffer() - self.IsModified = 0 - except: - self.Clear() - customMsgBox(self, '%s:\n%s\n%s' % sys.exc_info(), 'error') - finally: - wxEndBusyCursor() - - def SaveFile(self, filename, backup=0): - return_value = 1 - try: - wxBeginBusyCursor() - try: - if backup: - copyfile(filename, '%s.bak' % filename) - f = open(filename, 'w') - f.write(self.GetText()) - f.close() - self.IsModified = 0 - except: - return_value = 0 - customMsgBox(self, 'Error when saving "%s".\n\n%s:\n%s\n%s' \ - % (filename, sys.exc_info()[0], sys.exc_info()[1], - sys.exc_info()[2]), - 'error') - finally: - wxEndBusyCursor() - return return_value - - def Clear(self): - self.SetText('') - self.IsModified = 0 - -#--------------------------------------------------------------------------- - -class CustomStatusBar(wxStatusBar): - def __init__(self, parent): - wxStatusBar.__init__(self, parent, -1) - self.SetFieldsCount(2) - self.SetStatusWidths([-1,150]) - - self.SetStatusText('Ready', 0) - - # start timer - self.timer = wxPyTimer(self.Notify) - self.timer.Start(1000) - self.Notify() - - # Time-out handler - def Notify(self): - t = time.localtime(time.time()) - st = time.strftime(" %d-%b-%Y %H:%M:%S", t) - self.SetStatusText(st, 1) - -#--------------------------------------------------------------------------- - -class CustomTreeCtrl(wxTreeCtrl): - - def OnCompareItems(self, item1, item2): - t1 = self.GetItemText(item1) - t2 = self.GetItemText(item2) - #self.log.WriteText('compare: ' + t1 + ' <> ' + t2 + '\n') - if t1 < t2: return -1 - if t1 == t2: return 0 - return 1 - diff --git a/sandbox/gschwant/docfactory/factory/dialogs.py b/sandbox/gschwant/docfactory/factory/dialogs.py deleted file mode 100644 index 1d9b90066..000000000 --- a/sandbox/gschwant/docfactory/factory/dialogs.py +++ /dev/null @@ -1,853 +0,0 @@ -""" -:author: Dr. Gunnar Schwant -:contact: g.schwant@gmx.de -:version: 0.2.4 -""" - -from wxPython.lib.throbber import Throbber -from wxPython.wx import * -from wxPython.help import * -from wxPython.lib.filebrowsebutton import DirBrowseButton -from docutils.utils import relative_path -from urllib import quote -from docutilsadapter import language_codes, publishers -import images, os, string, ConfigParser, stylesheets, throbimages - -NAME = 'DocFactory' - -#--------------------------------------------------------------------------- - -def customMsgBox(window, text, type=None): - if type=='info': - style=wxOK|wxICON_INFORMATION - elif type=='error': - style=wxOK|wxICON_ERROR - elif type=='wakeup': - style=wxOK|wxICON_EXCLAMATION - else: - style=wxOK - dlg = wxMessageDialog(window, text, NAME, style) - dlg.Centre() - dlg.ShowModal() - dlg.Destroy() - -#--------------------------------------------------------------------------- - -class aboutDlg(wxDialog): - - def __init__(self, parent): - wxDialog.__init__(self, parent, -1, title='About') - self.SetBackgroundColour(wxColour(0, 0, 0)) - self.SetForegroundColour(wxColour(0, 255, 0)) - self.SetFont(wxFont(10, wxMODERN, wxNORMAL, wxNORMAL, false)) - - bmp = images.getLogoBigBitmap() - mask = wxMaskColour(bmp, wxWHITE) - bmp.SetMask(mask) - wxStaticBitmap(self, -1, bmp, wxPoint(42, 8)) - wxStaticBitmap(self, -1, bmp, wxPoint(274, 8)) - - # throbber - pics = [throbimages.catalog[i].getBitmap() - for i in throbimages.index - ] - - Throbber(self, -1, pics, pos=wxPoint(74, 11), - size=(200, 25), frameDelay = 0.065, reverse=true).Start() - - #text = wxStaticText(self, -1, 'DocFactory 0.2', wxPoint(50, 8)) - #text.SetFont(wxFont(20, wxSWISS, wxNORMAL, wxBOLD, false)) - - text = wxStaticText(self , -1, - '>>> release: 0.2.4', - wxPoint(9, 50)) - text = wxStaticText(self, -1, - '>>> manufactured by: gunnar schwant', - wxPoint(9, 65)) - text = wxStaticText(self, -1, - '>>> mailto: g.schwant@gmx.de', - wxPoint(9, 80)) - text = wxStaticText(self, -1, - '>>> Python version: 2.1.1 (or later)', - wxPoint(9, 95)) - text = wxStaticText(self, -1, - '>>> wxPython version: 2.3.4.2', - wxPoint(9, 110)) - text = wxStaticText(self, -1, - '>>> Docutils version: 0.2.8 (or later)', - wxPoint(9, 125)) - text = wxStaticText(self, -1, - '>>> special thanks to: guido van rossum,', - wxPoint(9, 140)) - text = wxStaticText(self, -1, - '... robin dunn', - wxPoint(9, 155)) - text = wxStaticText(self, -1, - '... and david goodger', - wxPoint(9, 170)) - text = wxStaticText(self, -1, - '>>> visit http://docutils.sourceforge.net', - wxPoint(9, 185)) - self.Fit() - -#--------------------------------------------------------------------------- - -class projectSettingsDlg(wxDialog): - - def __init__(self, parent, project, invalid_names): - wxDialog.__init__(self, parent, -1, title = 'Project Settings') - - self.project = project - self.configfile = os.path.join(project.directory, 'docutils.conf') - self.config = self.loadconf() - self.invalid_names = invalid_names - - #-------------------------------------------------- - # Create a Notebook - tID = wxNewId() - self.nb = wxNotebook(self, tID, style=wxCLIP_CHILDREN) - #EVT_NOTEBOOK_PAGE_CHANGED(self.nb, tID, self.on_notebook_page_changed) - - #-------------------------------------------------- - # DocFactory Page - self.df = wxPanel(self, -1) - - # Help Button - wxContextHelpButton(self.df, pos = wxPoint(370, 8), - size = wxSize(23, 23)) - - # Output Directory - wxStaticText(self.df, -1, 'Output-Directory', wxPoint(8, 42)) - exitID = wxNewId() - self.dirCtrl = wxTextCtrl(self.df, exitID, - pos = wxPoint(96, 40), - size = wxSize(240, 21)) - self.dirCtrl.SetHelpText('This is the default ' + \ - 'directory for output-files.') - exitID = wxNewId() - self.btnSelDir = wxButton(self.df, exitID, 'Select', - pos = wxPoint(344, 40), - size = wxSize(75, 23)) - EVT_BUTTON(self, exitID, self.onBtnSelDir) - - # Title - wxStaticText(self.df, -1, 'Title', wxPoint(8, 74)) - exitID = wxNewId() - self.nameCtrl = wxTextCtrl(self.df, exitID, - pos = wxPoint(96, 72), - size = wxSize(240, 21), - validator = customValidator(PROJECT_NAME)) - self.nameCtrl.SetHelpText('Enter a title for your project here.') - - #-------------------------------------------------- - # Docutils Page - self.du = wxPanel(self, -1) - - # Help Button - wxContextHelpButton(self.du, pos = wxPoint(370, 8), - size = wxSize(23, 23)) - - # Language Code - wxStaticText(self.du, -1, 'Language-Code', wxPoint(8, 10)) - exitID = wxNewId() - if not self.config.options['language_code'] in language_codes: - language_codes.append(self.config.options['language_code']) - language_codes.sort() - self.languageCodeCtrl = wxChoice(self.du, exitID, pos = wxPoint(97, 8), - choices = language_codes) - self.languageCodeCtrl.SetStringSelection(self.config.options['language_code']) - self.languageCodeCtrl.SetHelpText('Language code of your documents.') - EVT_CHOICE(self, exitID, self.onChoiceLanguageCode) - - # Stylesheet - wxStaticText(self.du, -1, 'Stylesheet', wxPoint(8, 42)) - exitID = wxNewId() - self.styCtrl = wxTextCtrl(self.du, exitID, - pos = wxPoint(96, 40), - size = wxSize(240, 21)) - self.styCtrl.SetHelpText('Path to stylesheet.') - exitID = wxNewId() - self.btnSelSty = wxButton(self.du, exitID, 'Select', - pos = wxPoint(344, 40), - size = wxSize(75, 23), style = 0) - EVT_BUTTON(self, exitID, self.onBtnSelSty) - - # Output Encoding - wxStaticText(self.du, -1, 'Output-Encoding', wxPoint(8, 74)) - exitID = wxNewId() - self.outencCtrl = wxTextCtrl(self.du, exitID, - self.config.options['output_encoding'], - pos = wxPoint(96, 72), - size = wxSize(115, 21)) - self.outencCtrl.SetHelpText('Encoding of output.') - - # Datestamp - wxStaticText(self.du, -1, 'Datestamp', wxPoint(8, 106)) - exitID = wxNewId() - self.datestampCtrl = wxTextCtrl(self.du, exitID, - pos = wxPoint(96, 104), - size = wxSize(115, 21)) - self.datestampCtrl.SetHelpText('Include a time/datestamp in ' + \ - 'the document footer. Contains ' + \ - 'a format string for time.strftime.') - - # TOC-Backlinks - exitID = wxNewId() - self.tocliCtrl = wxRadioBox(self.du, exitID, 'TOC-Backlinks', - wxPoint(224, 79), wxDefaultSize, - ['entry','top','none'], - 3, wxRA_SPECIFY_COLS) - self.tocliCtrl.SetHelpText('Enable backlinks from section ' + \ - 'titles to table of contents ' + \ - 'entries ("entry"), to the top ' + \ - 'of the TOC ("top"), or disable ("none").') - - # Footnote References - exitID = wxNewId() - self.footrefCtrl = wxRadioBox(self.du, exitID, - 'Footnote References', - wxPoint(224, 131), - wxDefaultSize, - ['superscript','brackets'], - 1, wxRA_SPECIFY_COLS) - self.footrefCtrl.SetHelpText('Format for footnote references.') - - # More Options via Checklistbox - optionList = ['Compact Lists', - 'Embed Stylesheet', - 'Footnote-Backlinks', - 'Generator', - 'Source-Link', - 'Use LaTeX-TOC' - ] - exitID = NewId() - self.optionsCtrl = wxCheckListBox(self.du, exitID, wxPoint(50, 136), - wxSize(161, 90), optionList) - self.optionsCtrl.SetHelpText('Set more Docutils-options here.') - - #-------------------------------------------------- - # Fill controls with initial values - self.init_ctrls() - - #-------------------------------------------------- - # Sizing of Notebook - self.df.Fit() - self.du.Fit() - size_of_df = self.df.GetSize() - size_of_du = self.du.GetSize() - self.nb.SetSize(wxSize(max(size_of_df[0],size_of_du[0])+15, - max(size_of_df[1],size_of_du[1])+15)) - - #-------------------------------------------------- - # Add pages to notebook - self.nb.AddPage(self.df, 'DocFactory') - self.nb.AddPage(self.du, 'Docutils') - self.nb.SetSelection(0) - - #-------------------------------------------------- - # OK- and Cancel-Buttons - size_of_nb = self.nb.GetSize() - ok_position = wxPoint((size_of_nb[0]/2)-80,size_of_nb[1]+10) - cancel_position = wxPoint((size_of_nb[0]/2)+5,size_of_nb[1]+10) - exitID = wxNewId() - self.ok = wxButton(self, exitID, 'OK', - pos = ok_position, - size = wxSize(75, 23)) - EVT_BUTTON(self, exitID, self.onBtnOk) - self.cancel = wxButton(self, wxID_CANCEL, 'Cancel', - pos = cancel_position, - size = wxSize(75, 23)) - self.ok.SetDefault() - - #-------------------------------------------------- - # Dialog Sizing - self.Fit() - - def onBtnSelDir(self, event): - dir = self.dirCtrl.GetValue() - if not os.path.isdir(dir): - dir = '' - dlg = wxDirDialog(self, 'Choose a directory for output files', dir) - if dlg.ShowModal() == wxID_OK: - directory = dlg.GetPath() - self.project.directory = directory - newconfig = os.path.join(directory, 'docutils.conf') - if newconfig != self.configfile: - self.configfile = newconfig - self.config = self.loadconf() - self.init_ctrls() - dlg.Destroy() - - def onBtnSelSty(self, event): - dir = self.dirCtrl.GetValue() - if not os.path.isdir(dir): - customMsgBox(self, 'Invalid Output-Directory.', 'wakeup') - else: - wildcard = 'Stylesheet-Files (*.css, *.tex)|*.css;*.tex|' \ - 'All files (*.*)|*.*' - dlg = wxFileDialog(self, 'Choose a stylesheet', - dir, '', wildcard, - wxOPEN|wxFILE_MUST_EXIST) - if dlg.ShowModal() == wxID_OK: - stylesheetpath = relative_path(self.configfile, - dlg.GetPath()) - self.styCtrl.SetValue(stylesheetpath) - dlg.Destroy() - - def onChoiceLanguageCode(self, event): - self.config.options['language_code'] = event.GetString() - - def getValues(self): - return(self.nameCtrl.GetValue(), self.dirCtrl.GetValue()) - - def onBtnOk(self, event): - - dir = self.dirCtrl.GetValue() - name = self.nameCtrl.GetValue() - configfile = os.path.join(dir, 'docutils.conf') - cfg = ConfigParser.ConfigParser() - if os.path.isfile(configfile): - cfg.read(configfile) - docfactory_section = 'docfactory_project: %s' % name - - if not os.path.isdir(dir): - customMsgBox(self, 'Invalid Output-Directory.', 'wakeup') - elif name == '': - customMsgBox(self, 'You have to enter a Project-Title.', 'wakeup') - elif (name in self.invalid_names): - customMsgBox(self, - 'Invalid Project-Title. Please try another title.', - 'wakeup') - else: - if self.optionsCtrl.IsChecked(0): - self.config.options['compact_lists'] = '1' - else: - self.config.options['compact_lists'] = '' - if self.optionsCtrl.IsChecked(1): - self.config.options['embed_stylesheet'] = '1' - else: - self.config.options['embed_stylesheet'] = '' - if self.optionsCtrl.IsChecked(2): - self.config.options['footnote_backlinks'] = '1' - else: - self.config.options['footnote_backlinks'] = '' - if self.optionsCtrl.IsChecked(3): - self.config.options['generator'] = '1' - else: - self.config.options['generator'] = '' - if self.optionsCtrl.IsChecked(4): - self.config.options['source_link'] = '1' - else: - self.config.options['source_link'] = '' - if self.optionsCtrl.IsChecked(5): - self.config.options['use_latex_toc'] = '1' - else: - self.config.options['use_latex_toc'] = '' - - self.config.options['datestamp'] = self.datestampCtrl.GetValue() - self.config.options['stylesheet'] = self.styCtrl.GetValue() - - stylesheetpath=os.path.abspath(os.path.join(dir,self.config.options['stylesheet'])) - if not os.path.exists(stylesheetpath): - styles = stylesheets.stylesheets.keys() - styles.sort() - dlg = wxSingleChoiceDialog(self, - 'The stylesheet does not exist.' \ - '\nPlease select a style to create it' \ - '\nor press "Cancel" to abort.', - 'Create stylesheet?', - styles, wxOK|wxCANCEL) - dlg.Centre() - if dlg.ShowModal() == wxID_OK: - f = open(stylesheetpath, 'wt') - f.write(stylesheets.stylesheets[dlg.GetStringSelection()]) - f.close() - dlg.Destroy() - - self.config.options['output_encoding'] = self.outencCtrl.GetValue() - - self.config.options['footnote_references'] = self.footrefCtrl.GetStringSelection() - self.config.options['toc_backlinks'] = self.tocliCtrl.GetStringSelection() - - self.saveconf() - self.Show(0) - - def init_ctrls(self): - self.nameCtrl.SetValue(self.project.name) - self.dirCtrl.SetValue(self.project.directory) - self.styCtrl.SetValue(self.config.options['stylesheet']) - if self.config.options['datestamp'] != None: - ds = self.config.options['datestamp'] - else: - ds = '' - self.datestampCtrl.SetValue(ds) - self.outencCtrl.SetValue(self.config.options['output_encoding']) - self.tocliCtrl.SetStringSelection(self.config.options['toc_backlinks']) - self.footrefCtrl.SetStringSelection(self.config.options['footnote_references']) - - if self.config.options['compact_lists'] == '1': - self.optionsCtrl.Check(0, TRUE) - else: - self.optionsCtrl.Check(0, FALSE) - - if self.config.options['embed_stylesheet'] == '1': - self.optionsCtrl.Check(1, TRUE) - else: - self.optionsCtrl.Check(1, FALSE) - - if self.config.options['footnote_backlinks'] == '1': - self.optionsCtrl.Check(2, TRUE) - else: - self.optionsCtrl.Check(2, FALSE) - - if self.config.options['generator'] == '1': - self.optionsCtrl.Check(3, TRUE) - else: - self.optionsCtrl.Check(3, FALSE) - - if self.config.options['source_link'] == '1': - self.optionsCtrl.Check(4, TRUE) - else: - self.optionsCtrl.Check(4, FALSE) - - if self.config.options['use_latex_toc'] == '1': - self.optionsCtrl.Check(5, TRUE) - else: - self.optionsCtrl.Check(5, FALSE) - - def loadconf(self): - config = Config() - if os.path.isfile(self.configfile): - cfg = ConfigParser.ConfigParser() - cfg.read(self.configfile) - for key in config.options.keys(): - if cfg.has_option('options', key): - config.options[key] = cfg.get('options', key) - return config - - def saveconf(self): - cfg = ConfigParser.ConfigParser() - if os.path.isfile(self.configfile): - cfg.read(self.configfile) - if not cfg.has_section('options'): - cfg.add_section('options') - for key in self.config.options.keys(): - cfg.set('options', key, self.config.options[key]) - old_section = 'docfactory_project: %s' % self.project.name - new_section = 'docfactory_project: %s' % \ - self.nameCtrl.GetValue() - if old_section != new_section: - if cfg.has_section(old_section): - cfg.remove_section(old_section) - f = open(self.configfile, 'wt') - cfg.write(f) - f.close() - -class Config: - def __init__(self): - self.options = {} - self.options['compact_lists'] = '1' - self.options['datestamp'] = '' - self.options['embed_stylesheet'] = '' - self.options['footnote_backlinks'] = '1' - self.options['footnote_references'] = 'superscript' - self.options['generator'] = '' - self.options['language_code'] = 'en' - self.options['output_encoding'] = 'UTF-8' - self.options['source_link'] = '' - self.options['stylesheet'] = '' - self.options['toc_backlinks'] = 'entry' - self.options['use_latex_toc'] = '1' - -#--------------------------------------------------------------------------- - -class hyperlinkDlg(wxDialog): - - def __init__(self, parent, directory, project=None): - wxDialog.__init__(self, parent, -1, title = 'Hyperlink') - btn_size = wxSize(75, 23) - self.directory = directory - self.project = project - wxStaticText(self, -1, 'Path?', wxPoint(8, 12)) - exitID = wxNewId() - self.pathCtrl = wxTextCtrl(self, exitID, - pos = wxPoint(46, 10), - size = wxSize(240, 21)) - exitID = wxNewId() - self.btnSelPath = wxButton(self, exitID, 'Select', - pos = wxPoint(294, 10), - size = btn_size) - EVT_BUTTON(self, exitID, self.onBtnSelPath) - self.ok = wxButton(self, wxID_OK, 'OK', - pos = wxPoint(185-80,40), - size = btn_size) - self.cancel = wxButton(self, wxID_CANCEL, 'Cancel', - pos = wxPoint(185+5,40), - size = btn_size) - self.ok.SetDefault() - self.Fit() - - def onBtnSelPath(self, event): - go_ahead = 1 - dlg = wxFileDialog(self, 'Select a file', - self.directory, '', '*.*', - wxOPEN|wxFILE_MUST_EXIST) - if dlg.ShowModal() == wxID_OK: - path = dlg.GetPath() - else: - go_ahead = 0 - dlg.Destroy() - if go_ahead: - if self.project == None: - dlg = wxDirDialog(self, 'Calculate path relative' - ' to which outputdirectory?', - self.directory) - if dlg.ShowModal() == wxID_OK: - self.directory = dlg.GetPath() - else: - go_ahead = 0 - dlg.Destroy() - if go_ahead: - self.pathCtrl.SetValue( - quote(relative_path('%s%sdummy.html' % (self.directory, - os.sep), - path))) - - def GetPath(self): - return self.pathCtrl.GetValue() - -#--------------------------------------------------------------------------- - -class publishDlg(wxDialog): - - def __init__(self, parent, infile, project=None): - wxDialog.__init__(self, parent, -1, title = 'Publish') - btn_size = wxSize(75, 23) - self.infile = infile - self.project = project - if self.project != None: - self.directory = self.project.directory - else: - self.directory = os.path.dirname(infile) - self.writer = 'HTML' - # Writer - wxStaticText(self, -1, 'Docutils-Writer:', wxPoint(8, 12)) - exitID = wxNewId() - writers = publishers.keys() - writers.sort() - self.writerCtrl = wxChoice(self, exitID, (100, 10), - choices = writers) - self.writerCtrl.SetSelection(1) - EVT_CHOICE(self, exitID, self.onChoiceWriter) - - # Output-directory - wxStaticText(self, -1, 'Output-Directory:', wxPoint(8, 42)) - exitID = wxNewId() - self.outdirCtrl = wxTextCtrl(self, exitID, - pos = wxPoint(100, 40), - size = wxSize(240, 21)) - self.outdirCtrl.SetValue(self.directory) - exitID = wxNewId() - self.btnSelOutdir = wxButton(self, exitID, 'Select', - pos = wxPoint(350, 40), - size = btn_size) - EVT_BUTTON(self, exitID, self.onBtnOutdir) - - # Output-file - wxStaticText(self, -1, 'Output-File:', wxPoint(8, 72)) - exitID = wxNewId() - self.outfileCtrl = wxTextCtrl(self, exitID, - pos = wxPoint(100, 70), - size = wxSize(240, 21)) - self.outfileCtrl.SetValue(self.default_outfile()) - - # OK and Cancel - self.ok = wxButton(self, wxID_OK, 'OK', - pos = wxPoint(235-80,100), - size = btn_size) - self.cancel = wxButton(self, wxID_CANCEL, 'Cancel', - pos = wxPoint(235+5,100), - size = btn_size) - self.ok.SetDefault() - self.Fit() - - def onBtnOutdir(self, event): - dlg = wxDirDialog(self, 'Select output-directory:', - self.directory) - if dlg.ShowModal() == wxID_OK: - self.directory = dlg.GetPath() - self.outdirCtrl.SetValue(self.directory) - dlg.Destroy() - - def onChoiceWriter(self, event): - self.writer = event.GetString() - self.outfileCtrl.SetValue(self.default_outfile()) - - def GetValues(self): - return (self.outfileCtrl.GetValue(), - self.outdirCtrl.GetValue(), - self.writer) - - def default_outfile(self): - outfile = self.outfileCtrl.GetValue() - if outfile == '': - outfile = os.path.splitext(os.path.basename(self.infile))[0] + publishers[self.writer][2] - else: - outfile = os.path.splitext(os.path.basename(outfile))[0] + publishers[self.writer][2] - return outfile - -#--------------------------------------------------------------------------- - -class toolsDlg(wxDialog): - - def __init__(self, parent): - wxDialog.__init__(self, parent, -1, title = 'Configure Toolbox') - self.tools = parent.tools - self.parent = parent - self.currentItem = None - btn_size = wxSize(75, 23) - self.il = wxImageList(16, 16) - bmp = images.getToolBitmap() - mask = wxMaskColour(bmp, wxBLUE) - bmp.SetMask(mask) - self.idx1 = self.il.Add(bmp) - exitID = wxNewId() - self.list = wxListCtrl(self, exitID, - wxDLG_PNT(self, 26, 10), - wxDLG_SZE(self, 400, 120), - wxLC_REPORT|wxSUNKEN_BORDER|wxLC_SINGLE_SEL|wxLC_HRULES|wxLC_VRULES) - self.list.InsertColumn(0, "Tool") - self.list.InsertColumn(1, "Name") - self.list.InsertColumn(2, "Command") - self.list.InsertColumn(3, "Initial Directory") - self.list.SetImageList(self.il, wxIMAGE_LIST_SMALL) - EVT_LIST_ITEM_SELECTED(self, exitID, self.on_item_selected) - self.update_list() - self.ok = wxButton(self, wxID_OK, 'OK', - pos = wxDLG_PNT(self, 195, 135), - size = btn_size) - exitID = wxNewId() - bmp = images.getPlusBitmap() - mask = wxMaskColour(bmp, wxBLUE) - bmp.SetMask(mask) - b = wxBitmapButton(self, exitID, bmp, wxDLG_PNT(self, 5, 10), - wxSize(23, 23)) - b.SetToolTipString("Add tool") - EVT_BUTTON(self, exitID, self.on_plus_btn) - exitID = wxNewId() - bmp = images.getPenBitmap() - mask = wxMaskColour(bmp, wxBLUE) - bmp.SetMask(mask) - b = wxBitmapButton(self, exitID, bmp, wxDLG_PNT(self, 5, 26), - wxSize(23, 23)) - b.SetToolTipString("Edit tool") - EVT_BUTTON(self, exitID, self.on_edit_btn) - exitID = wxNewId() - bmp = images.getMinusBitmap() - mask = wxMaskColour(bmp, wxBLUE) - bmp.SetMask(mask) - b = wxBitmapButton(self, exitID, bmp, wxDLG_PNT(self, 5, 42), - wxSize(23, 23)) - b.SetToolTipString("Remove tool") - EVT_BUTTON(self, exitID, self.on_minus_btn) - self.ok.SetDefault() - self.Fit() - - def add_tool(self, name, command, init_dir): - if self.tools == {}: - key = 1 - else: - key = max(self.tools.keys())+1 - self.tools[key] = [0, name, command, init_dir] - i = 1 - for tool in self.tools.values(): - tool[0] = i - i = i+1 - self.update_list() - - def colourize_list(self): - color = ('yellow', 'light blue') - for i in range(self.list.GetItemCount()): - item = self.list.GetItem(i) - item.SetBackgroundColour(color[i%2]) - self.list.SetItem(item) - - def get_column_text(self, index, col): - item = self.list.GetItem(index, col) - return item.GetText() - - def get_tools(self): - return self.tools - - def update_list(self): - self.list.DeleteAllItems() - items = self.tools.items() - for x in range(len(items)): - key, data = items[x] - self.list.InsertImageStringItem(x, str(data[0]), self.idx1) - self.list.SetStringItem(x, 1, data[1]) - self.list.SetStringItem(x, 2, data[2]) - self.list.SetStringItem(x, 3, data[3]) - self.list.SetItemData(x, key) - for i in range(4): - self.list.SetColumnWidth(i, wxLIST_AUTOSIZE) - self.colourize_list() - - def on_edit_btn(self, event): - go_ahead = 1 - if self.currentItem != None: - item = self.currentItem - else: - go_ahead = 0 - customMsgBox(self, 'Select a tool first.', 'wakeup') - if go_ahead: - selected_tool = [int(self.list.GetItemText(self.currentItem)), - self.get_column_text(self.currentItem, 1), - self.get_column_text(self.currentItem, 2), - self.get_column_text(self.currentItem, 3)] - dlg = editToolDlg(self, selected_tool) - dlg.Centre() - if dlg.ShowModal() == wxID_OK: - new_values = dlg.get_values() - else: - go_ahead = 0 - if go_ahead: - for key in self.tools.keys(): - if self.tools[key] == selected_tool: - self.tools[key][1] = new_values[0] - self.tools[key][2] = new_values[1] - self.tools[key][3] = new_values[2] - self.update_list() - - def on_item_selected(self, event): - self.currentItem = event.m_itemIndex - - def on_minus_btn(self, event): - go_ahead = 1 - if self.currentItem != None: - item = self.currentItem - else: - go_ahead = 0 - customMsgBox(self, 'Select a tool first.', 'wakeup') - if go_ahead: - selected_tool = [int(self.list.GetItemText(self.currentItem)), - self.get_column_text(self.currentItem, 1), - self.get_column_text(self.currentItem, 2), - self.get_column_text(self.currentItem, 3)] - for key in self.tools.keys(): - if self.tools[key] == selected_tool: - del self.tools[key] - i = 1 - for tool in self.tools.values(): - tool[0] = i - i = i+1 - self.update_list() - - def on_plus_btn(self, event): - dlg = editToolDlg(self) - dlg.Centre() - if dlg.ShowModal() == wxID_OK: - tool = dlg.get_values() - self.add_tool(tool[0],tool[1],tool[2]) - dlg.Destroy() - -#--------------------------------------------------------------------------- - -class editToolDlg(wxDialog): - - def __init__(self, parent, tool=['','','','']): - wxDialog.__init__(self, parent, -1, title = 'Tool') - wxStaticText(self, -1, 'Name:', wxPoint(28, 13)) - self.name = wxTextCtrl(self, -1, pos = wxPoint(64, 10), - size = wxSize(322, -1), - validator = customValidator(TOOL_NAME)) - wxStaticText(self, -1, 'Command:', wxPoint(28, 45)) - self.command = wxTextCtrl(self, -1, pos = wxPoint(84, 42), - size = wxSize(302, -1), - validator = customValidator(NO_SEMICOLON)) - self.init_dir = DirBrowseButton(self, -1, wxPoint(20,70), wxSize(450,-1), - labelText= 'Initial Directory:', - buttonText= 'Browse') - btn_size = wxSize(75, 23) - self.ok = wxButton(self, wxID_OK, 'OK', - pos = wxPoint(230-80,110), - size = btn_size) - EVT_BUTTON(self, wxID_OK, self.on_btn_ok) - self.cancel = wxButton(self, wxID_CANCEL, 'Cancel', - pos = wxPoint(230+5,110), - size = btn_size) - self.name.SetValue(tool[1]) - self.command.SetValue(tool[2]) - self.init_dir.SetValue(tool[3]) - self.ok.SetDefault() - self.Fit() - - def get_values(self): - return self.name.GetValue(), self.command.GetValue(), self.init_dir.GetValue() - - def on_btn_ok(self, event): - go_ahead = 1 - for ctrl in (self.name, self.command, self.init_dir): - if ctrl.GetValue() == '': - go_ahead = 0 - break - if go_ahead: - self.EndModal(event.GetId()) - else: - customMsgBox(self, 'All fields have to be filled.', 'wakeup') - -#--------------------------------------------------------------------------- - -PROJECT_NAME = 1 -TOOL_NAME = 2 -NO_SEMICOLON = 3 -PROJECT_CHARS = string.letters + string.digits -TOOL_CHARS = PROJECT_CHARS + '$[]|<>,.:-_\\/(){} ' - -class customValidator(wxPyValidator): - def __init__(self, flag=None, pyVar=None): - wxPyValidator.__init__(self) - self.flag = flag - EVT_CHAR(self, self.OnChar) - - def Clone(self): - return customValidator(self.flag) - - def Validate(self, win): - tc = self.GetWindow() - val = tc.GetValue() - if self.flag == PROJECT_NAME: - for x in val: - if x not in PROJECT_CHARS: - return false - - elif self.flag == TOOL_NAME: - for x in val: - if x not in TOOL_CHARS: - return false - - elif self.flag == NO_SEMICOLON: - for x in val: - if x == ';': - return false - - return true - - def OnChar(self, event): - key = event.KeyCode() - if key < WXK_SPACE or key == WXK_DELETE or key > 255: - event.Skip() - return - if self.flag == PROJECT_NAME and chr(key) in PROJECT_CHARS: - event.Skip() - return - if self.flag == TOOL_NAME and chr(key) in TOOL_CHARS: - event.Skip() - return - if self.flag == NO_SEMICOLON and chr(key) != ';': - event.Skip() - return - if not wxValidator_IsSilent(): - wxBell() - return - diff --git a/sandbox/gschwant/docfactory/factory/docutilsadapter.py b/sandbox/gschwant/docfactory/factory/docutilsadapter.py deleted file mode 100644 index 17dc26f7a..000000000 --- a/sandbox/gschwant/docfactory/factory/docutilsadapter.py +++ /dev/null @@ -1,112 +0,0 @@ -""" -:author: Dr. Gunnar Schwant -:contact: g.schwant@gmx.de -:version: 0.2.4 -""" - -from docutils.languages import en, de, fr, it -from docutils.parsers.rst.languages.en import directives -from docutils.core import publish_file -from docutils import __version__ -from re import findall -import os, sys -from wxPython.wx import wxLogMessage - -docutilsversion = __version__ - -language_codes = ['en', 'de', 'fr', 'it'] - -publishers = { 'HTML': (None, 'html', '.html'), - 'Docutils-XML': (None, 'xml', '.xml'), - 'LaTeX': (None, 'latex', '.tex'), - 'PEP-HTML': ('pep', 'pep_html', '.html'), - 'Pseudo-XML': (None, None, '.xml'), - } - -try: - from docutils.writers import htmlnav - publishers['HTML with navigation-bars'] = (None, 'htmlnav', '.html') -except: - pass - -def get_rest_bibl_fields(language_code='en'): - # suitable for autocompletion in wxStyledTextCtrl - bibl_fields = '' - if language_code not in language_codes: - language_code = 'en' - if language_code == 'en': - list = en.bibliographic_fields.keys() - if language_code == 'de': - list = de.bibliographic_fields.keys() - if language_code == 'fr': - list = fr.bibliographic_fields.keys() - if language_code == 'it': - list = it.bibliographic_fields.keys() - list.sort() - for value in list: - bibl_fields = '%s %s:' % (bibl_fields, value) - return bibl_fields[1:] - -def get_rest_directives(): - # suitable for autocompletion in wxStyledTextCtrl - drvs = '' - list = directives.keys() - list.sort() - for value in list: - drvs = '%s %s::' % (drvs, value) - return drvs[1:] - -def publish_document(writer, infile, outfile, outdir): - current_dir = os.path.abspath(os.curdir) - sys.stderr = StdCatcher() - os.chdir(outdir) - if publishers[writer][0] != None: - publish_file(reader_name=publishers[writer][0], - writer_name=publishers[writer][1], - source_path=infile, - destination_path=os.path.join(outdir,outfile)) - else: - if publishers[writer][1] != None: - publish_file(writer_name=publishers[writer][1], - source_path=infile, - destination_path=os.path.join(outdir,outfile)) - else: - publish_file(source_path=infile, - destination_path=os.path.join(outdir,outfile)) - os.chdir(current_dir) - sys.stderr = sys.__stderr__ - return 1 - -class StdCatcher: - # suitable for catching docutils stderr-output - def __init__(self): - self.text = '' - - def write(self,s): - wxLogMessage(s) - -def get_errors(str): - errors = [] - warnings = [] - lines = str.splitlines() - for s in lines: - if docutilsversion < '0.2.5': - if s.startswith('WARNING'): - for i in findall('line \d+', s): - warnings.append(int(i.split(' ')[1])-1) - if s.startswith('ERROR') or s.startswith('SEVERE'): - for i in findall('line \d+', s): - errors.append(int(i.split(' ')[1])-1) - else: - parts = s.split(': (') - if len(parts) > 1: - s2 = parts[1] - if s2.startswith('WARNING'): - for i in findall(':\d+:', s): - warnings.append(int(i[1:-1])-1) - if s2.startswith('ERROR') or s2.startswith('SEVERE'): - for i in findall(':\d+:', s): - errors.append(int(i[1:-1])-1) - errors.sort() - warnings.sort() - return warnings, errors diff --git a/sandbox/gschwant/docfactory/factory/images.py b/sandbox/gschwant/docfactory/factory/images.py deleted file mode 100644 index af46e0241..000000000 --- a/sandbox/gschwant/docfactory/factory/images.py +++ /dev/null @@ -1,460 +0,0 @@ -""" -:author: Dr. Gunnar Schwant -:contact: g.schwant@gmx.de -:version: 0.2.4 -""" - -#---------------------------------------------------------------------- -# This file was generated by img2py.py -# -from wxPython.wx import wxBitmapFromXPMData, wxImageFromBitmap -import cPickle, zlib -from wxPython.wx import wxImageFromStream, wxBitmapFromImage -import cStringIO - - -def getLogoSmallData(): - return cPickle.loads(zlib.decompress( -'x\xda\x8d\x90=\x0b\x830\x10\x86w\x7f\xc5\x81_%\x81#\x96"\x8eZ\xc1\xd5\xc1\ -\xc5U\x1c+\xd8\xff?\xf5\xde\x8b\x89\xba\xf5U\x02\xcfs\x17/\xf1\xb1}\xabd*\ -\xab\x9a\xf0>\xa9*\x93e*\x99Vzo\xcb\xfaQ\xca\x84\xd2A\xa3<\x83\x9d\xe4\xe0\ -\xd1\xf308\xa7\xdc\x82kW\x87\xba\x01\xf7\xae\x0f\x9c\x82\x9b\xb3\x9e{n\x02\ -\x93\x9f\x87\t\xca\x16\xfcr\xafP\xdf\xc3y\x8ez\x01\xee\\\x17\xf7\xf3-\xe4\ -\xaf4kv\x84\xc7\x91\x83\x94\x06,j/r\x97u\x14+\xe5\x8b\xdcgVI\xf4\xaf\xbco\ -\xc7\x0c\xc99H\xb46Y\x0e\x9d\xf1\xf0\xd6\xda6=\x0eO\x19\x9e\x0c\x92\xd3\r\x7fv\x8d\xd9\xadW\xd7\xcb\x9a\xcc\xcd|\xdf\xaf\xb7\x1fq[\ -v\x85s\x07\xd7\xf7\xe2\x0b\xf8^$\xdek\xdd\xc5\xfaY}\xdf;\'\xbe\x84\xdf\xbb}\ -\xac\xb7\xf0\'w\x8a\xbe\x82?Lu\xa3\xf9\x07\xd7\xe8\xdf\xd7Z\x1f\xfb[\xad\xa3\ -\xa3\xf8\x0e\xbea:\xd4\x878_\xa8o\xe0\x8f\xee8\xe6S\x94\xaeL\xf8\x85\t\xd2#\ -\xf0Q4@Dg\x11YQ\x0e\x05j\x88\x14r\x12H\xf2\xf1\xd3Z\x920\xc4!j\x06\xf1 \x83\ -\xd2g\xa6\x90AH\x9aC\x1a\xc0\x0b\xb4\xe1\x15\x87\x10\xd9\x17\x90\xd1y^&Y\xf3\ -F\x92}#\xe9\r\x88\x8b\x0b\x83\x83\xe2\x95\x15\ne>\x82\x1cb\x8d\x87\x08J\x0fs\ -\x0e\xcd\xef\x84\x9eC\x9e\xe2\x05\x93\xbatp;>\x95\xb8\xf2\xbe\xebt\x84\x1126\ -U\xf2&\xb0\x9f\t*\xe2\x07\x1b\xf7\xc8\xe9\xba\xb2\xac\xea\xfa\x1f\xa8\x0bP\ -\xf5\x04\xa2\xc0\x101R\xd7\x1eS=B\xda\x0c3\x03\xaa\xfd\x02\xc4ck\x0e27\x9b\ -\xb6]\x80\xf89F\xc8\n\xb4\x90\xc4B\xbbmY\xa1\x1d\xe7,\xb4\x93Sb\n\xfb\xd2f\ -\x8f\x83\x07\x91\xc7\xbe\x800\x94\x1fAT\n\xe5\'\x9e]\x8b\xcc\x93_\xcb$\xbd`\ -\x9dgv\xc1E&}*\xc6$_\xf3\xf9+\xd0=JJ\xfa\x0f\xc3\xbc\x10C\xf4\x07\xe7\xd5-h'\ - )) - -def getLogoBigBitmap(): - return wxBitmapFromXPMData(getLogoBigData()) - -def getLogoBigImage(): - return wxImageFromBitmap(getLogoBigBitmap()) - -#---------------------------------------------------------------------- -def getProjectData(): - return cPickle.loads(zlib.decompress( -'x\xda]\x90\xb1\n\x840\x0c\x86\xf7{\x8a@\xb5\x1e\x14B\x0b"\x8ez\x82k\x07\x17\ -Wq<\xa1\xf7\xfe\xd3\xa5\x899\xeb\xfdt\xf9\xbe\xfe\t\xb4\xcf\xe3\x13\x1eK\x13\ -:\xc8\'@h\x1e\xdb\xd2 \xec\xf0:\xb6\xfd\xcd\xb4\x12\x99\x99\xd2zfP\x9eg\xe6!\ -s\xe7;\x7f\xb2\xcd<\xf9I\xd9d\xee\xaf\xfbJ\xb8W\x8e\xb2o\xf4^\xf6\'\xe1I\xd9\ -en}\xab\xfd:\xf3\xe8Ge\x00\xa4\xc0/"Y\xe0]"\xac\x14\xae\xf3\x80\xc8\x95\x03\ -\xda\x17\x99\x12\x16Qy\xedK\xa02\x9e\x0b\xa8\x16\xd7\xbb$\xe5\x8aq\x92\x89\ -\xf6:\xe7\x06s\x97\xd4sh\xaaR\xc6\x98]\xc4\xda\xa2\xbeHB\xb3\xe4TJh\xb6\xb6T\ -\xbcKD\xcb\xef,%\xeb\xeb\x97\xfeB\x12\xbf\x98zjg' )) - -def getProjectBitmap(): - return wxBitmapFromXPMData(getProjectData()) - -def getProjectImage(): - return wxImageFromBitmap(getProjectBitmap()) - -#---------------------------------------------------------------------- -def getFile1Data(): - return cPickle.loads(zlib.decompress( -'x\xda\xd3\xc8)0\xe4\nV74S\x00"\x13\x05Cu\xae\xc4`\xf5|\x85d\x05\xa7\x9c\xc4\ -\xe4l0O\x01\xc8Sv\x03\x030?\x02\xc4w6p6\x80\xf2\xf5@|\x0b\x03\x10\x84\xa8\ -\xd7\x83\x03\x05\x10\x80\n*@A\x84\x1e6A0\x13.\x98\x0f\x02`\x12C%Pm>\xbaJ\xa0\ -\xb2\x88A\xad2\x02\x01\xe0\x82\xf9\xc8\x00&\x88\x06\x80\x82z\x00lj[\xe4' )) - -def getFile1Bitmap(): - return wxBitmapFromXPMData(getFile1Data()) - -def getFile1Image(): - return wxImageFromBitmap(getFile1Bitmap()) - -#---------------------------------------------------------------------- -def getLinkData(): - return zlib.decompress( -'x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\x02 \xcc\xc1\ -\x06$\xe5?\xffO\x04R,\xc5N\x9e!\x1c@P\xc3\x91\xd2\x01\xe4gz\xba8\x86T\xcc\ -\xb9:\xd1\x91\xaf\xc1\x80\x83\xe5\xe0\x8f\xff\xfa\xfd\xe2\x01J\t+\xe6\xdd\ -\xf1\x9e=\xcd\xaf\xdc\xd1\xd5\xc1k\xe5\xda\xb3[3_\xcb13\xb1\\\x10JXw\x9f!dW\ -\xdc\x9b\xc9\xcfo,\x08Qn\xb1|\xc0\xf9m%{\x83\xf5\x89k\xcb\xac\x94\xafX\xae\ -\xff\xfc\xfb\xdeT\xa5\x10\xd7\xa9{\xce1,\x99\xbf\x9c\x8b\xef\x9e\xe3)M\x9fd\ -\x91\x86Rq\xf6S\xef4\xc5]Z\xc3N\x01-e\xf0t\xf5sY\xe7\x94\xd0\x04\x00\t\x8e?\ -\x85' ) - -def getLinkBitmap(): - return wxBitmapFromImage(getLinkImage()) - -def getLinkImage(): - stream = cStringIO.StringIO(getLinkData()) - return wxImageFromStream(stream) - -#---------------------------------------------------------------------- -def getImageData(): - return zlib.decompress( -'x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\x02 \xcc\xc1\ -\x06$\xe5?\xffO\x04R,\xc5N\x9e!\x1c@P\xc3\x91\xd2\x01\xe4\xf7z\xba8\x86T\xcc\ -9\x1a\xec\xc8\xd5`\xc0\xe3}\xb4\xfd%{\xcd\xe5_\xaa\x07w\xdf\xfb\x1bl\xe3\xb3\ -tv\xe8\x1c.\xb1S7<6M\xc8c\x9aP\x11xU\xfa\x93:Si\xcc\x13\xc6\xa93\x99?\xd51;,\ -\xbev\xf0\xee\xef\xbe\xba\xd7\xc6\x13X\xe3z5\x05-\xbc\x0fqu.\xd3\xa8\xe7z\ -\xe5\xfd4%>\x819r\xc3\xaa\x9b\xec\xf1\x0b\xe4\x8f){\xa8\xce{\xbfd\n\xcf\x0c\ -\x9e];\xcf20:8\x98\xfb\xeb]\x14\xe9\x9c\xe1\x1fi\xde\xc8\xb0\xd3\xea\xc1?\ -\x03/\xef\xba\xff\xbd\xdc\xcf/\xb9\\\xfb\xb4`}3\xd0a\x0c\x9e\xae~.\xeb\x9c\ -\x12\x9a\x00\x90]PH' ) - -def getImageBitmap(): - return wxBitmapFromImage(getImageImage()) - -def getImageImage(): - stream = cStringIO.StringIO(getImageData()) - return wxImageFromStream(stream) - -#---------------------------------------------------------------------- -def getOpenData(): - return zlib.decompress( -"x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\x02 \xcc\xc1\ -\x06$\xe5?\xffO\x04R,\xc5N\x9e!\x1c@P\xc3\x91\xd2\x01\xe4W{\xba8\x86T\xccY\ -\x1a\xec\xc9w@\x81\xa3e\x19\xff\xf3\xe7\x97\xbb\x05\\X\xa5<{\xa47;Lal\xd0{\ -\xf4V\xc5p\xf3\xda\xc5\xf7.32oX\x98b5\x9d%\xf0\xe2d\x81^!\xa3nk\xf7\xcbvI\ -\x87j_\x1d\x939\xe3\xa9\xfe\xf4o\xe5\xcdf\xadiBF[%\x18\xae\t\xcd\xe8t\xc9\ -\xda\xf0\xccG\xf5\x0f\xe3\xea\\\xe5\x0f\t\x13\x8d'\xb2\x0b\xf7\xcaUx\xc7>m] \ -|\xbb\xbc\xe0\xa7\xe4\xfb\xfb\x07\xd9\xd9\xa5\x9c\xf8\x1f\xecJ\xf2\x05:\x83\ -\xc1\xd3\xd5\xcfe\x9dSB\x13\x00\x15\x16EI" ) - -def getOpenBitmap(): - return wxBitmapFromImage(getOpenImage()) - -def getOpenImage(): - stream = cStringIO.StringIO(getOpenData()) - return wxImageFromStream(stream) - -#---------------------------------------------------------------------- -def getNewData(): - return zlib.decompress( -'x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\x02 \xcc\xc1\ -\x06$\xe5?\xffO\x04R,\xc5N\x9e!\x1c@P\xc3\x91\xd2\x01\xe4\x07{\xba8\x86T\xcc\ -INI\xf8\xf1\x7f~#\xd3\x81\xa6\x04#\xa1\x80\xae\xbbrb"\xaa\x162\x87O\x9c\xe0\ -\xd8\xca\x10<\xaf\xb3akF[\xf2\xaeI\x19\xcc\n\xeb\x12\x0e\x18\xb4\xb0\x06k\ -\xea\xdd\xbe\xc8\xabt\x91u\xc7\x81\x15\x8c\xcd\x07\x19\xa6\x944\xc8\x1dW\x91\ -r\x88[\xb6\xe4\x067\xc3\xf1W|:\xa9.g\xc4\x80\xc63x\xba\xfa\xb9\xacsJh\x02\ -\x00\x18\x0c1\x97' ) - -def getNewBitmap(): - return wxBitmapFromImage(getNewImage()) - -def getNewImage(): - stream = cStringIO.StringIO(getNewData()) - return wxImageFromStream(stream) - -#---------------------------------------------------------------------- -def getPasteData(): - return zlib.decompress( -'x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\x02 \xcc\xc1\ -\x06$\xe5?\xffO\x04R,\xc5N\x9e!\x1c@P\xc3\x91\xd2\x01\xe4/\xf4tq\x0c\xa9\x98\ -\xb3tr\xa0P\x93\x01\x8f\x8b9\xcf\xf5\x027\xff,\x1b\xcd\xd2\x0fr\x1f\x95\xd3&\ -]\x9a\x12vw=\xd3\xcd\xed\xd1\x0bX:\x1e\xf0\xaf\xfd\x99k\x15\xf3\xdd\xf8\xda\ -\x1d\x86\x13\xcb%\x04\xe72q6\x18\xfcVN3]}\xf1\xfaq\xc9f\x9d\x89\xa7y\xa6\xe4\ -\x1e\xdf\xbc\'`\xdb\xde(w\x87M\xac\xd7\xbf\x96\x9dT\xb7^\xc5\xb0wJ\xe6\x01\ -\xfd\rz\x0c\x1f\xf4\x05S\xf5\xafo1\x11\x16\x0e2\xe8\x95\xcex\xa4,\xf1\xde\ -\xb7[\xf1\x80O\xe9.\xe7}Y\x13\x1c=\xf9\x83\x7fk\x1f\xdf"\xe3\xc3p\x84\xe1\ -\xe5\x89\x152\x0c\x96\xb7\x0f\xdd\xd1\xacg\xae`r\xba\xee;u\xc9r\xa0c\x19<]\ -\xfd\\\xd69%4\x01\x00\xaaxW\x00' ) - -def getPasteBitmap(): - return wxBitmapFromImage(getPasteImage()) - -def getPasteImage(): - stream = cStringIO.StringIO(getPasteData()) - return wxImageFromStream(stream) - -#---------------------------------------------------------------------- -def getCopyData(): - return zlib.decompress( -'x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\x02 \xcc\xc1\ -\x06$\xe5?\xffO\x04R,\xc5N\x9e!\x1c@P\xc3\x91\xd2\x01\xe47y\xba8\x86T\xccY:9\ -\x90\xaf\xc1\x80\xc3\xb9\xfb\xe3\xbdc\x93\xaf\xf3\x1f\x94\xdc \xdd\xf97U{}\ -\x8e\x84\xc3\xa3v\x9e\x06\x83\x17?\xa5\x18\x8c\x1cgD\xdeN\tn\xbd}%\xe4\xe7E\ -\xbb]\xf3\xea>z\x88\xdcT\xb9\xf8H\xd9I\xa2d\x91h\xd3T\x8f]\x82\xd5,\xef3\x9a\ -\x13\x8eD\n\x1d\xf1YT\xddwY\xed\xc42\xc1\xe4O\x13\x03\xdafHW\xb0\x94\x9e\x10\ -d=\xf8zJV\xf0\xfc@\x81\x8c\xab+\xc3}y\xaaN\xab\x94/\\\xcd\xfd\xea\xa0\xc7\ -\xac\xb8\x1bb \xa72x\xba\xfa\xb9\xacsJh\x02\x00\x80\xa5K\xbe' ) - -def getCopyBitmap(): - return wxBitmapFromImage(getCopyImage()) - -def getCopyImage(): - stream = cStringIO.StringIO(getCopyData()) - return wxImageFromStream(stream) - -#---------------------------------------------------------------------- -def getCutData(): - return zlib.decompress( -"x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\x02 \xcc\xc1\ -\x06$\xe5?\xffO\x04R,\xc5N\x9e!\x1c@P\xc3\x91\xd2\x01\xe4\xe7{\xba8\x86T\xcc\ -Y;\xc9\x9b\xaf\xc1\x80\xc3E\xf6\xf1\xde\xd9\xf3d\xc2%\xbc\x12/\x10\xcb\xca8e\xfe\xea\xa8n\x06\x86\xd56\x8c\x13\xa5\'OW\ -\xb2>\xd8\x1f\xbe\xfe./\xd3\xce\xa8\x08\xb5\xccE\xca\xba\x0bbrY\x8bL\xf7\xf7\ -\xeb\xba\xda$K&\xd5\xbc\x980[7\xa3\xc8;\xa1\xfd?\xcb\xb3F\xad)\xabs\xcc\xf8\ -\x05\x83^\xec`}\xa9\xf0Ma\xbf=\xe7\x9e\x89Fr\xe9"N\x8a{#4\x80f20x\xba\xfa\ -\xb9\xacsJh\x02\x00\x89\x06=\xeb' ) - -def getAboutBitmap(): - return wxBitmapFromImage(getAboutImage()) - -def getAboutImage(): - stream = cStringIO.StringIO(getAboutData()) - return wxImageFromStream(stream) - -#---------------------------------------------------------------------- -def getBoldData(): - return zlib.decompress( -'x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\x02 \xcc\xc1\ -\x06$\xe5?\xffO\x04R,\xc5N\x9e!\x1c@P\xc3\x91\xd2\x01\xe4\xcf\xf6tq\x0c\xa9\ -\x98\xb35\xf8 /\xb3"O\xf1\xaau\xd3{\xf3\xe6\x7fH\xe3\xdc\xf7!\x85{\xc6\x81\ -\xbf"/\x1fDe\xbc\x8f\xf2\x9e\x16 \xa4\xa3\xce\xa8\xe8\x19s\xe0\xed\xa9\xa7\ -\xcd\r\x1d>/\xe78\xaf\xdd\x1a\xfe\xa0!\x88\x8b\xb1\xc0\xe7\xa8\x04g\xc3\xaa[\ -G\x9f^\xe5qY\xd2\xa9\xff8\xfe\xbcC\xe8s]\x1b\xd9R\xdd\'sv\xe6J3\x1a\x1c\xbbq\ -\xfd\x1c\x8b[\xd5\xfb\xfe\xad\xf3-\x14<\x8d\x95\x19\xda\x04\xceqn\xf9\xf1\ -\x7f\xfb\x86z\x8d\xdf\xc5^\x99{[\xcb\x0fg\x9b\x18O\x0b\xda%\xf6\xae\xf9FFF\ -\xe7\xfd\xbae\xc6\x15\x0c\xf3\x16\xf9\x17]h\xf1\xe2\x07:\x93\xc1\xd3\xd5\xcf\ -e\x9dSB\x13\x005-YC' ) - -def getBoldBitmap(): - return wxBitmapFromImage(getBoldImage()) - -def getBoldImage(): - stream = cStringIO.StringIO(getBoldData()) - return wxImageFromStream(stream) - -#---------------------------------------------------------------------- -def getItalicData(): - return zlib.decompress( -"x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\x02 \xcc\xc1\ -\x06$\xe5?\xffO\x04R,\xc5N\x9e!\x1c@P\xc3\x91\xd2\x01\xe4\x07x\xba8\x86T\xcc\ -9:\xd9\x93\x8b\xc1\x80\x83y\xee\xa5\xff\xf57\xe7q\xc5\xc5\xac\xf0\xb0\xcd\ -\x96\x10v\r\r\x95\xdajuX\x95\xd1\xa1\xc1\xb2i\xaei\x8a\xd8Y\xa1\x1bwm'MX0\ -\xa9@\xa3\x80Si\xe1O\xeb\n\xb1\r?\xd6:39\xf1\xdf\x91Xm\xff\xed\xfe\x11\xe6\ -\x96\xe9\x92J\x1e[\x05\xc5\x81f3x\xba\xfa\xb9\xacsJh\x02\x00\xf9\xac.\xf0" ) - -def getItalicBitmap(): - return wxBitmapFromImage(getItalicImage()) - -def getItalicImage(): - stream = cStringIO.StringIO(getItalicData()) - return wxImageFromStream(stream) - -#---------------------------------------------------------------------- -def getPreData(): - return zlib.decompress( -'x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\x02 \xcc\xc1\ -\x06$\xe5?\xffO\x04R,\xc5N\x9e!\x1c@P\xc3\x91\xd2\x01\xe4\xbbx\xba8\x86T\xcc\ -I\xfe\xf3\xff\xff\xffz6.\x06a\xd5Y+\x93\x18\xb8\xcd\x1c\xdd\xdc\xdcD\xec\xec\ -\xe2\x93J\x0f\x02e>f)e0h&\\i8\x98\xc0\xe0\xe6\xe4\xe4\xef\xf2"\xe9\xc5K\xe6\ -\xc3\x0cA\x9f\xaf\x1dhgd\x905\x14\x96\xf9\xde`s\x08h\x1e\x83\xa7\xab\x9f\xcb\ -:\xa7\x84&\x00={+\xe6' ) - -def getPreBitmap(): - return wxBitmapFromImage(getPreImage()) - -def getPreImage(): - stream = cStringIO.StringIO(getPreData()) - return wxImageFromStream(stream) - -#---------------------------------------------------------------------- -def getPlusData(): - return cPickle.loads(zlib.decompress( -'x\xda\xd3\xc8)0\xe4\nV74S\x00"\x13\x05Cu\xae\xc4`\xf5\x08\x85d\x05e\x03 \ -\xb00\x00\xf3\xf5@|70\x00\xf3\x15`\xf2P~>\x88oa\x02\x82PyT@HPOO\x0fS0""\x82\ -\\A\xa0yz@A=\x88\xb9P\xc1\x08\x04P\xc8\xc7"\x98\x8fU\x10\xdd\xa2|\x08@\xb3\ -\x1d\x9b \xd0~A\x85|\x04\xa0\xaf\x8f\xf4\x00ixNy' )) - -def getMinusBitmap(): - return wxBitmapFromXPMData(getMinusData()) - -def getMinusImage(): - return wxImageFromBitmap(getMinusBitmap()) - -#---------------------------------------------------------------------- -def getToolData(): - return zlib.decompress( -'x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\x02 \xcc\xc1\ -\x06$\xe5?\xffO\x04R,\xc5N\x9e!\x1c@P\xc3\x91\xd2\x01\xe4\x1f\xf0tq\x0c\xa9\ -\x98\xb3t\xf2F\xdeC\x06\x02\xae\xf5Nb\x0b\x16,1\xd0\x15be\xad=\xc3\xe1\xe1s@\ -\x81GH?!\xc5\x8dc\xf6\x06\x06W\xb7\x1f"\x9d\xc9\xea]\xb2\xec\xfbJ&\x95^\xfa\ -\xbd\xef\xf3\\\xe3\x86#=\x1e\x0f~\x0604\x9c\xfe\xcav@\xf1\xa7}\xc1\xa4\x83\'\ -\xd6\xd9K\xae\xad3,\xd8\xa0\xa3\xda\x13\xa61\xad\x89A\xc1\xbb\xf3Wh\xb9n#\ -\x0f\xab\xa7T\xec\xc6\x9f{\xd8\x13K\x8en\x937\xcaxp\x98\xefCsbs\xa6EH&\xfb\ -\x0f\xaf\xf6\x93\x87\xe6o\xbe\xfaa\xe2\xa3\xeamVo\xb6\x7f/\x0c\xe2h|\xfc\xd2\ -\x86\x9b9\xe3\xf8\x8b\xfb)\xeeSW\xd9,=\xb3\xe2\xe0\x95\xaau\xe6\xbbS.\xd7M\ -\xd5\xdd\xb3e\x91\xceS\xeb\xe3_X\x9f\x9d\xbd\xa4sx\x8d8\x0b\xd0/\x0c\x9e\xae\ -~.\xeb\x9c\x12\x9a\x00\xe5\xfej@' ) - -def getToolBitmap(): - return wxBitmapFromImage(getToolImage()) - -def getToolImage(): - stream = cStringIO.StringIO(getToolData()) - return wxImageFromStream(stream) - -#---------------------------------------------------------------------- -def getPublishData(): - return zlib.decompress( -'x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\x02 \xcc\xc1\ -\x06$\xe5?\xffO\x04R,\xc5N\x9e!\x1c@P\xc3\x91\xd2\x01\xe4\xef\xf6tq\x0c\xa9\ -\x98\xd3;\xf9.\xef!\x03\x9e\x16{e\xb5%M\xac\x12\xca\xb5>\xdb\x1bX\x1d\x0c\ -\xc4\xa3e\xf8\xfd\x9c\xbb\xef\x98\xa8Gz\x89>\xaf\xbbs\x84\xe1\xa2C\xb1\xb0\ -\x81C\xd0\x9d\xb4\xb4\xdd*\xc7+?\xd6\xdd\x0b\x97^\xfe\xf9*\xbf\xf7\x8c\x9bj\ -\x9e\xd3\x9b%\x03\xaf/k\x8e\xac\xf5LKa0\x9a 1\xbd\xf6w\x83\xce\x849W\xf7\xb3\ -fY1\xcco\xbd\xc9\xb2$\x9e\x8dq\xda\x8c*Y\x87\xb2T\xcf\xf5\xc7\xd7\xaeS\\\xcd\ -gXd\x10cg\xfayG\tC\xc2\x84\xee\xf6wg.\xf28\xb1\xaf\x93\xd1\xee\xb3\xad_8u\ -\xe7\x89\xebV-\x8b\xf5\xbb\x18\x9cwN|\xa7\xd0\xf6\xa8\xcb\xf8\xff\xf4\x95\ -\x1f\xc3\xb6\xe5\xdd[\xb5\xdc\xf5B\xb3~M\xa0`\x81\xc0\xbe}b@o0x\xba\xfa\xb9\ -\xacsJh\x02\x00:\xc2a\x8f' ) - -def getPublishBitmap(): - return wxBitmapFromImage(getPublishImage()) - -def getPublishImage(): - stream = cStringIO.StringIO(getPublishData()) - return wxImageFromStream(stream) - -#---------------------------------------------------------------------- -def getPenData(): - return zlib.decompress( -'x\xda\x01\n\x02\xf5\xfd\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\ -\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\x00\x00\x00\x04sBIT\x08\ -\x08\x08\x08|\x08d\x88\x00\x00\x01\xc1IDATx\x9c}\x931o\xd3P\x10\xc7\x7f\xa9:\ -\xa4[2 1\xfa*u\x80\x89\x8e\xee\xe6\x872P\x89\x85HH\xb0\xb9f"]\x10S)c\xc87@H(\ -n\'\xf2%P\xed\x01\x89\x0c\x95b&:D\xeay\x8b7g\xf4\xf6\x18\x9e\x95\xb8\xb4\xc9\ -\x93Nzw\xa7\xdf\xff\xee\xdd{\xaf\x05\xd6\xb2u\xb5\xf0\x01S{\t0\xc56\xb2[\x05\ -Z\x0cGCL`hO\x7fSV\x15\xe6\xd3g\x8e\x1a"\xbb\xdb\xe0\xf1\xc5\x18\x13\xb8\xda\ -\x85\x7fDU\x96\xa8\'D\xb9aJ\x0b\xb0\xecl\x82\xdf\xbe\x81(|G7\xeb\xd3\xcd\xb2\ -U&\x16\xa1@V\xfe\x03\x02-\xce\xcf\xe0\xc7\x04\xc0g\xd6i\xd3\xe9\xf4y|\xf3\ -\x97\xecO\xc6D\x15\x88\x9b\x80\xb5k\xc3\x9e\x9fa\xad\xc5Z\xeb\xdb\xab\xc4\ -\xaf\xf7\xd8\xdb\x0b\xb1\xe29\x1bb\xac\t\x9c\xed\xfe_y8r\x95\x93\x14L0\x05@s\ -\x98\xfc\x12D@\x10\xe2 1: - self.nb.DeletePage(1) - - def InitEditorPage(self): - # init editor - edID = wxNewId() - self.editor = CustomStyledTextCtrl(self.nb, edID, self.log) - self.editor.SetViewEOL(self.preferences['eol_markers']) - self.editor.SetEdgeMode(self.preferences['right_edge_indicator']) - self.editor.SetViewWhiteSpace(self.preferences['whitespace']) - if self.preferences['fontsize'] == 'small': - self.editor.SetZoom(-2) - elif self.preferences['fontsize'] == 'big': - self.editor.SetZoom(2) - else: - self.editor.SetZoom(0) - self.editor.Clear() - self.editor.Enable(0) - self.nb.AddPage(self.editor, 'Editor') - self.nb.SetSelection(0) - - # -------------------------------------------------------------------- - # handlers - # -------------------------------------------------------------------- - - def activateMenuItemsProjectOpen(self, value): - menu = self.mainmenu.GetMenu(self.mainmenu.FindMenu('Project')) - if len(self.projects) > 0 and value: - menu.Enable(wxID_WXDELETEPROJ, value) - menu.Enable(wxID_WXPROJSETTINGS, value) - menu.Enable(wxID_WXPUBLALL, value) - - def activateMenuItemsFileSelected(self, value): - menu = self.mainmenu.GetMenu(self.mainmenu.FindMenu('File')) - if self.project != None: - menu.Enable(wxID_WXREMFILE, value) - else: - menu.Enable(wxID_WXREMFILE, 0) - menu.Enable(wxID_WXCLOSEFILE, value) - menu.Enable(wxID_WXSAVEFILE, value) - menu.Enable(wxID_WXPUBL, value) - menu = self.mainmenu.GetMenu(self.mainmenu.FindMenu('Edit')) - menu.Enable(wxID_WXUNDO, value) - menu.Enable(wxID_WXREDO, value) - menu.Enable(wxID_WXCUTSELECTION, value) - menu.Enable(wxID_WXCOPYSELECTION, value) - menu.Enable(wxID_WXPASTESELECTION, value) - menu.Enable(wxID_WXSELECTALL, value) - menu.Enable(wxID_WXINSERT, value) - menu.Enable(wxID_WXEOLSTO, value) - menu.Enable(wxID_WXFINDREPLACE, value) - menu.Enable(wxID_WXGOTO, value) - self.toolbar.EnableTool(wxID_WXBTNSAVE, value) - self.toolbar.EnableTool(wxID_WXBTNLINK, value) - self.toolbar.EnableTool(wxID_WXBTNIMAGE, value) - self.toolbar.EnableTool(wxID_WXBTNBOLD, value) - self.toolbar.EnableTool(wxID_WXBTNITALIC, value) - self.toolbar.EnableTool(wxID_WXBTNLITERAL, value) - self.toolbar.EnableTool(wxID_WXBTNPASTE, value) - self.toolbar.EnableTool(wxID_WXBTNCOPY, value) - self.toolbar.EnableTool(wxID_WXBTNCUT, value) - self.toolbar.EnableTool(wxID_WXBTNREDO, value) - self.toolbar.EnableTool(wxID_WXBTNUNDO, value) - self.toolbar.EnableTool(wxID_WXBTNPUBLISH, value) - - def CheckEditorChanges(self): - go_ahead = 1 - if self.editor != None: - if self.editor.IsModified: - dlg=wxMessageDialog(self, 'Save changes?', NAME, - wxYES_NO | wxCANCEL | wxICON_QUESTION) - result = dlg.ShowModal() - if result == wxID_YES: - file = self.tree.GetItemText(self.activeitem) - go_ahead = self.editor.SaveFile(file, self.preferences['backup_files']) - if result == wxID_CANCEL: - go_ahead = 0 - dlg.Destroy() - return go_ahead - - def delete_project(self, project): - if project in self.projects: - self.projects.remove(project) - try: - self.save_projects() - except: - customMsgBox(self, '%s:\n%s\n%s' % sys.exc_info(), 'error') - self.init_tree() - - def htmlfile(self, file, dir): - htmlfile = os.path.join(dir, - os.path.splitext(os.path.basename(file))[0] \ - + '.html') - return htmlfile - - def insert_hyperlink(self): - item = self.activeitem - itemimage = self.tree.GetItemImage(item) - file = self.tree.GetItemText(item) - if self.project != None: - dir = self.project.directory - else: - dir = os.path.dirname(file) - go_ahead = 1 - dlg = hyperlinkDlg(self, directory=dir, project=self.project) - dlg.Centre() - if dlg.ShowModal() == wxID_OK: - target = dlg.GetPath() - else: - go_ahead = 0 - dlg.Destroy() - if go_ahead: - selection = self.editor.GetSelectedText() - curpos = self.editor.GetCurrentPos() - if selection != '': - self.editor.BeginUndoAction() - selection = '`%s`' % selection - self.editor.ReplaceSelection(selection + '_') - endpos = self.editor.GetTextLength() - self.editor.GotoPos(endpos) - text = '\n\n.. _%s: %s' % (selection, target) - self.editor.ReplaceSelection(text) - self.editor.GotoPos(curpos + 3) - self.editor.EndUndoAction() - else: - text = '\n\n.. _``: %s\n' % target - self.editor.ReplaceSelection(text) - self.editor.GotoPos(curpos + 7) - - def insert_image(self, directive): - item = self.activeitem - itemimage = self.tree.GetItemImage(item) - file = self.tree.GetItemText(item) - if self.imagedir == None: - if self.project != None: - dir = self.project.directory - else: - dir = os.path.dirname(file) - else: - dir = self.imagedir - dlg = ImageDialog(self, dir) - dlg.Centre() - go_ahead = 1 - if dlg.ShowModal() == wxID_OK: - target = dlg.GetFile() - self.imagedir = os.path.dirname(target) - else: - go_ahead = 0 - dlg.Destroy() - if go_ahead: - if self.project != None: - dir = self.project.directory - else: - dir = os.path.dirname(file) - dlg = wxDirDialog(self, 'Calculate path relative' - ' to which outputdirectory?', dir) - if dlg.ShowModal() == wxID_OK: - dir = dlg.GetPath() - else: - go_ahead = 0 - dlg.Destroy() - if go_ahead: - selection = self.editor.GetSelectedText() - if selection != '' and directive == 'image': - self.editor.BeginUndoAction() - curpos = self.editor.GetCurrentPos() - selection = '|%s|' % selection - self.editor.ReplaceSelection(selection) - endpos = self.editor.GetTextLength() - self.editor.GotoPos(endpos) - text = '\n\n.. %s %s:: %s' % (selection, directive, - quote(relative_path(self.htmlfile(file,dir), - target))) - self.editor.ReplaceSelection(text) - self.editor.GotoPos(curpos + 2) - self.editor.EndUndoAction() - else: - text = '\n\n.. %s:: %s\n\n' % (directive, - quote(relative_path(self.htmlfile(file,dir), - target))) - self.editor.ReplaceSelection(text) - - def load_initial_file(self, file): - if os.path.exists(file): - try: - self.files.append(file) - dir = '' - parent = self.root - self.open_file_in_editor(file) - last = self.tree.AppendItem(parent, file, self.im2) - self.tree.SetPyData(last, None) - self.tree.SetItemBold(self.activeitem, 0) - self.tree.SetItemTextColour(self.activeitem, wxBLACK) - self.activeitem = last - self.tree.SetItemBold(self.activeitem, 1) - self.tree.SetItemTextColour(self.activeitem, wxBLUE) - self.tree.EnsureVisible(self.activeitem) - self.tree.SelectItem(self.activeitem) - parent = self.tree.GetItemParent(self.activeitem) - self.tree.SetItemBold(parent, 1) - self.tree.SetItemTextColour(parent, wxBLUE) - except: - customMsgBox(self, '%s:\n%s\n%s' % sys.exc_info(), 'error') - else: - customMsgBox(self, 'Can not find %s.' % file, 'error') - - def open_file_in_editor(self, file): - if self.nb.GetPageCount() > 1: - self.nb.DeletePage(1) - self.nb.SetSelection(0) - self.editor.LoadFile(file) - self.set_editor_language_code(file) - self.nb.SetPageText(0, 'Editor: %s' % - os.path.basename(file)) - self.editor.Enable(1) - self.activateMenuItemsFileSelected(1) - self.editor.IsModified = 0 - - def project_save(self): - try: - self.save_projects() - self.projectdirty = 0 - except: - customMsgBox(self, '%s:\n%s\n%s' % sys.exc_info(), 'error') - - def publishFile(self, infile, outfile, outdir, writer): - wxBeginBusyCursor() - try: - self.log.Clear() - t = time.localtime(time.time()) - st = time.strftime('%d-%b-%Y, %H:%M:%S', t) - wxLogMessage('%s: Publishing %s' % (st, writer)) - wxLogMessage('SOURCE: %s' % infile) - outfile_fullpath = os.path.join(outdir, outfile) - wxLogMessage('DESTINATION: %s' % outfile_fullpath) - if outfile_fullpath == infile: - customMsgBox(self, 'Destination and source are identical.' - '\nNo processing.', 'wakeup') - warning_lines = error_lines = [] - else: - try: - publish_document(writer, infile, outfile, outdir) - finally: - warning_lines, error_lines = get_errors(self.log.GetValue()) - linecount = self.editor.GetLineCount() - self.editor.MarkerDeleteAll(0) - self.editor.MarkerDeleteAll(1) - if warning_lines != []: - for line in warning_lines: - if line < linecount: - self.editor.MarkerAdd(line, 0) - self.editor.GotoLine(warning_lines[-1]) - if error_lines != []: - for line in error_lines: - if line < linecount: - self.editor.MarkerAdd(line, 1) - self.editor.GotoLine(error_lines[-1]) - self.editor.IsModified = 0 - if os.path.exists(outfile_fullpath): - if self.nb.GetPageCount() > 1: - self.nb.DeletePage(1) - if get_file_extension(outfile) in ['.html', '.htm']: - # init html-viewer page - if wxPlatform == '__WXMSW__': - htmlprv = browser.IEHtmlPanel(self.nb, self, self.log, - 'file://%s' % quote(outfile_fullpath)) - else: - htmlprv = browser.HtmlPanel(self.nb, self, self.log, - outfile_fullpath) - self.nb.AddPage(htmlprv, 'HTML-Viewer: %s' - % outfile) - if warning_lines == error_lines == []: - self.nb.SetSelection(1) - t = time.localtime(time.time()) - st = time.strftime('%d-%b-%Y, %H:%M:%S: ', t) - wxLogMessage('%sFinished.' % st) - finally: - wxEndBusyCursor() - - def save_preferences(self): - cfg = ConfigParser.ConfigParser() - try: - cfg.read(DATA) - if not cfg.has_section('preferences'): - cfg.add_section('preferences') - for pref in self.preferences.keys(): - cfg.set('preferences', pref, - self.preferences[pref]) - f = open(DATA, 'wt') - cfg.write(f) - f.close() - except: - customMsgBox(self, '%s:\n%s\n%s' % sys.exc_info(), 'error') - - def save_projects(self): - cfg = ConfigParser.ConfigParser() - cfg.read(DATA) - for section in cfg.sections(): - if section[:19] == 'docfactory_project:': - cfg.remove_section(section) - for project in self.projects: - section = 'docfactory_project: %s' % project.name - cfg.add_section(section) - cfg.set(section, 'outputdirectory', project.directory) - files = '' - for file in project.files: - files = '%s;%s' % (files, file) - if len(files) > 1: - files = files[1:] - cfg.set(section, 'files', files) - f = open(DATA, 'wt') - cfg.write(f) - f.close() - - def set_editor_language_code(self, file=None): - language_code = 'en' - if self.project != None: - directory = self.project.directory - else: - directory = os.path.split(os.path.abspath(file))[0] - docutils_conf = os.path.join(directory, 'docutils.conf') - if os.path.exists(docutils_conf): - try: - cfg = ConfigParser.ConfigParser() - cfg.read(docutils_conf) - if cfg.has_option('options', 'language_code'): - language_code = cfg.get('options', 'language_code') - except: - print '%s:\n%s\n%s' % sys.exc_info() - self.editor.bibliographic_fields = get_rest_bibl_fields(language_code) - - # -------------------------------------------------------------------- - # event handlers - # -------------------------------------------------------------------- - - def on_app_exit(self, event): - self.Close() - - def on_backup_files(self, event): - self.preferences['backup_files'] = not self.preferences['backup_files'] - - def on_btn_image(self, event): - self.insert_image('image') - - def on_close_window(self, event): - go_ahead = 1 - if self.projectdirty: - dlg=wxMessageDialog(self, 'Save project?', NAME, - wxYES_NO | wxCANCEL | wxICON_QUESTION) - result = dlg.ShowModal() - if result == wxID_YES: - self.project_save() - if result == wxID_CANCEL: - go_ahead = 0 - dlg.Destroy() - - if go_ahead and self.CheckEditorChanges(): - self.Destroy() - - def on_configure_tools(self, event): - dlg = toolsDlg(self) - dlg.Centre() - if dlg.ShowModal() == wxID_OK: - self.tools = dlg.get_tools() - dlg.Destroy() - cfg = ConfigParser.ConfigParser() - try: - cfg.read(DATA) - if cfg.has_section('tools'): - cfg.remove_section('tools') - cfg.add_section('tools') - for tool in self.tools.values(): - cfg.set('tools', str(tool[0]), - '%s;%s;%s' % (tool[1],tool[2],tool[3])) - f = open(DATA, 'wt') - cfg.write(f) - f.close() - except: - customMsgBox(self, '%s:\n%s\n%s' % sys.exc_info(), 'error') - - def on_copy(self, event): - self.editor.Copy() - - def on_cut(self, event): - self.editor.Cut() - - def on_eols_to_cr(self, event): - wxBeginBusyCursor() - self.editor.ConvertEOLs(1) - wxEndBusyCursor() - - def on_eols_to_lf(self, event): - wxBeginBusyCursor() - self.editor.ConvertEOLs(2) - wxEndBusyCursor() - - def on_eols_to_crlf(self, event): - wxBeginBusyCursor() - self.editor.ConvertEOLs(0) - wxEndBusyCursor() - - def on_file_close(self, event): - if self.CheckEditorChanges(): - if self.nb.GetPageCount() > 1: - self.nb.DeletePage(1) - self.nb.SetPageText(0, 'Editor') - self.editor.Clear() - self.editor.Enable(0) - self.activateMenuItemsFileSelected(0) - item = self.activeitem - parent = self.tree.GetItemParent(item) - self.tree.SetItemBold(item, 0) - self.tree.SetItemTextColour(item, wxBLACK) - if parent == self.root: - self.files.remove(self.tree.GetItemText(item)) - self.tree.Delete(item) - self.activeitem = parent - self.tree.SelectItem(self.activeitem) - - def on_file_open(self, event): - - go_ahead = 1 - - if self.CheckEditorChanges(): - - if self.project != None: - dir = self.project.directory - parent = self.tree.GetItemParent(self.activeitem) - if parent == self.root: - parent = self.activeitem - else: - dir = '' - parent = self.root - - wildcard = 'Text (*.txt)|*.txt|' \ - 'All files (*.*)|*.*' - - dlg = wxFileDialog (self, 'Open file', - dir, '', wildcard, - wxOPEN|wxFILE_MUST_EXIST) - if dlg.ShowModal() == wxID_OK: - file = dlg.GetPath() - if parent == self.root: - if file not in self.files: - self.files.append(file) - else: - customMsgBox(self, '%s already in workspace.' % file, - 'wakeup') - go_ahead = 0 - else: - if file not in self.project.files: - self.project.add(file) - self.project_save() - else: - customMsgBox(self, '%s already part of project "%s".' - % (file, self.project.name), - 'wakeup') - go_ahead = 0 - else: - go_ahead = 0 - dlg.Destroy() - - if go_ahead: - self.open_file_in_editor(file) - last = self.tree.AppendItem(parent, file, self.im2) - self.tree.SetPyData(last, None) - self.tree.SetItemBold(self.activeitem, 0) - self.tree.SetItemTextColour(self.activeitem, wxBLACK) - self.activeitem = last - self.tree.SetItemBold(self.activeitem, 1) - self.tree.SetItemTextColour(self.activeitem, wxBLUE) - self.tree.EnsureVisible(self.activeitem) - self.tree.SelectItem(self.activeitem) - parent = self.tree.GetItemParent(self.activeitem) - self.tree.SetItemBold(parent, 1) - self.tree.SetItemTextColour(parent, wxBLUE) - - def on_file_new(self, event): - go_ahead = 1 - - if self.project != None: - dir = self.project.directory - else: - dir = '' - - dlg = wxFileDialog (self, 'Create new file', - dir, '', '*.txt', - wxSAVE|wxOVERWRITE_PROMPT) - if dlg.ShowModal() == wxID_OK: - file = dlg.GetPath() - else: - go_ahead = 0 - dlg.Destroy() - - if go_ahead: - dlg = wxTextEntryDialog( - self, 'Enter a title for this document:', 'Title', '', - wxOK | wxCANCEL) - dlg.Centre() - if dlg.ShowModal() == wxID_OK: - title = dlg.GetValue() - else: - go_ahead = 0 - dlg.Destroy() - - if go_ahead: - try: - f = open(file, 'w') - f.write(len(title)*'='+'\n') - f.write(title+'\n') - f.write(len(title)*'='+'\n') - f.close() - if self.project != None: - self.project.add(file) - self.project_save() - parent = self.tree.GetItemParent(self.activeitem) - if parent == self.root: - parent = self.activeitem - else: - self.files.append(file) - parent = self.root - self.open_file_in_editor(file) - last = self.tree.AppendItem(parent, file, self.im2) - self.tree.SetPyData(last, None) - self.tree.SetItemBold(self.activeitem, 0) - self.tree.SetItemTextColour(self.activeitem, wxBLACK) - self.activeitem = last - self.tree.SetItemBold(self.activeitem, 1) - self.tree.SetItemTextColour(self.activeitem, wxBLUE) - self.tree.EnsureVisible(self.activeitem) - self.tree.SelectItem(self.activeitem) - except: - customMsgBox(self, '%s:\n%s\n%s' % sys.exc_info(), - 'error') - dlg.Destroy() - - def on_file_remove(self, event): - item = self.tree.GetSelection() - file = self.tree.GetItemText(item) - self.activeitem = self.tree.GetItemParent(item) - self.tree.Delete(item) - self.project.remove(file) - self.project_save() - self.nb.SetPageText(0, 'Editor') - self.editor.Clear() - self.editor.Enable(0) - self.activateMenuItemsFileSelected(0) - dlg=wxMessageDialog( - self, 'Delete file %s from disk?' % file, NAME, - wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION) - result = dlg.ShowModal() - if result == wxID_YES: - try: - os.remove(file) - except: - customMsgBox(self, '%s:\n%s\n%s' % sys.exc_info(), - 'error') - dlg.Destroy() - - def on_file_save(self, event): - go_ahead = 1 - file = self.tree.GetItemText(self.activeitem) - wxLogMessage('Saving %s.' % file) - go_ahead = self.editor.SaveFile(file, self.preferences['backup_files']) - if go_ahead: - if self.nb.GetPageCount() > 1: - self.nb.DeletePage(1) - - def on_publish(self, event): - go_ahead = 1 - item = self.activeitem - file = self.tree.GetItemText(item) - if self.editor.IsModified: - wxLogMessage('Saving %s.' % file) - wxBeginBusyCursor() - go_ahead = self.editor.SaveFile(file, self.preferences['backup_files']) - wxEndBusyCursor() - if go_ahead and os.path.exists(file): - dlg = publishDlg(self, infile=file, project=self.project) - dlg.Centre() - if dlg.ShowModal() == wxID_OK: - outfile, outdir, writer = dlg.GetValues() - else: - go_ahead = 0 - dlg.Destroy() - if go_ahead: - self.publishFile(file, outfile, outdir, writer) - - def on_publish_all(self, event): - go_ahead = 1 - item = self.activeitem - file = self.tree.GetItemText(item) - if self.editor.IsModified: - wxLogMessage('Saving %s.' % file) - wxBeginBusyCursor() - go_ahead = self.editor.SaveFile(file, self.preferences['backup_files']) - wxEndBusyCursor() - if go_ahead: - writers = publishers.keys() - writers.sort() - dlg = wxSingleChoiceDialog(self, 'Please select a writer:', - 'Publish "%s"' % self.project.name, - writers, wxOK|wxCANCEL) - dlg.SetSelection(writers.index('HTML')) - dlg.Centre() - if dlg.ShowModal() == wxID_OK: - writer = writers[dlg.GetSelection()] - else: - go_ahead = 0 - dlg.Destroy() - if go_ahead: - self.log.Clear() - files_to_publish = [] - for file in self.project.files: - if os.path.splitext(file)[1] == '.txt': - files_to_publish.append(file) - max = len(files_to_publish) - dlg = wxProgressDialog('Publishing "%s"' % self.project.name, - '', - max, - self, - wxPD_CAN_ABORT | wxPD_APP_MODAL) - keepGoing = true - count = 0 - error_files = [] - while keepGoing and count < max: - infile = files_to_publish[count] - outfile = '%s%s' % (os.path.splitext(os.path.split(infile)[1])[0], - publishers[writer][2]) - outdir = self.project.directory - keepGoing = dlg.Update(count, outfile) - t = time.localtime(time.time()) - st = time.strftime('%d-%b-%Y, %H:%M:%S', t) - wxLogMessage('\n%s: Publishing %s' % (st, writer)) - wxLogMessage('SOURCE: %s' % infile) - outfile_fullpath = os.path.join(outdir, outfile) - wxLogMessage('DESTINATION: %s' % outfile_fullpath) - try: - publish_document(writer, infile, outfile, outdir) - except: - wxLogMessage('ERROR: %s (%s)' % sys.exc_info()[:2]) - error_files.append((infile, sys.exc_info()[1])) - count = count + 1 - dlg.Destroy() - if error_files != []: - msg = 'Due to severe errors the following files have ' \ - 'not been published properly: \n' - for file in error_files: - msg = '%s\n%s\n(%s)\n' % (msg, file[0], file[1]) - msg = '%s\nHINT: You should try to publish the files ' \ - 'in question separately first. If that works, ' \ - 'you can try to publish all files again.' % msg - dlg = wxScrolledMessageDialog(self, msg, "WARNING!") - dlg.Centre() - dlg.ShowModal() - dlg.Destroy() - - def on_find(self, event): - et = event.GetEventType() - if et == wxEVT_COMMAND_FIND_REPLACE or et == wxEVT_COMMAND_FIND_REPLACE_ALL: - replacetxt = event.GetReplaceString() - self.sb.SetStatusText('', 0) - findtxt = event.GetFindString() - length = len(findtxt) - lastpos = self.editor.GetTextLength() - flags = event.GetFlags() - if flags in (1, 3, 5, 7): - if flags == 7: - # whole word / match case - regexp = re.compile(r'\b%s\b' % findtxt) - elif flags == 5: - # no whole word / match case - regexp = re.compile(r'%s' % findtxt) - elif flags == 3: - # whole word / no match case - regexp = re.compile(r'\b%s\b' % findtxt, re.IGNORECASE) - else: - # no whole word / no match case - regexp = re.compile(findtxt, re.IGNORECASE) - else: - regexp = None - print 'Unknown combination of flags.' - if regexp != None: - if et == wxEVT_COMMAND_FIND_REPLACE_ALL: - wxBeginBusyCursor() - self.editor.BeginUndoAction() - origtxt = self.editor.GetText() - if regexp.search(origtxt) != None: - self.editor.SetText(regexp.sub(replacetxt, origtxt)) - self.sb.SetStatusText('Replaced.', 0) - else: - self.sb.SetStatusText('No match found.', 0) - self.editor.EndUndoAction() - wxEndBusyCursor() - else: - currpos = self.editor.GetCurrentPos() - if et == wxEVT_COMMAND_FIND_REPLACE and currpos != 0: - self.editor.ReplaceSelection(replacetxt) - currpos = self.editor.GetCurrentPos() - lastpos = self.editor.GetTextLength() - origtxt = self.editor.GetTextRange(currpos, lastpos) - position = len(regexp.split(origtxt)[0]) - startpos = currpos + position - if startpos < lastpos: - self.editor.GotoPos(startpos + len(regexp.findall(origtxt)[0])) - self.editor.SetAnchor(startpos) - else: - self.sb.SetStatusText('Can not find "%s". Next search will ' - 'start from beginning.' % findtxt, 0) - self.editor.GotoPos(0) - - def on_find_close(self, event): - event.GetDialog().Destroy() - - def on_findreplace_show(self, event): - data = wxFindReplaceData() - dlg = wxFindReplaceDialog(self, data, 'Find & Replace', - wxFR_REPLACEDIALOG) - dlg.data = data - dlg.Show(1) - - def on_font_small(self, event): - self.preferences['fontsize'] = 'small' - self.editor.SetZoom(-2) - self.save_preferences() - - def on_font_normal(self, event): - self.preferences['fontsize'] = 'normal' - self.editor.SetZoom(0) - self.save_preferences() - - def on_font_big(self, event): - self.preferences['fontsize'] = 'big' - self.editor.SetZoom(2) - self.save_preferences() - - def on_format_paragraph(self, event): - self.nb.SetSelection(0) - line_no = self.editor.GetCurrentLine() - self.editor.GotoLine(line_no) - startpos = self.editor.GetCurrentPos() - line = self.editor.GetLine(line_no) - endpos = startpos + len(line) - self.editor.SetSelection(startpos, endpos) - format = event.GetString() - if format in ['Title','Subtitle']: - overline = (len(line)-1)*self.formats[format]+'\n' - else: - overline = '' - underline = (len(line)-1)*self.formats[format]+'\n' - line_below = self.editor.GetLine(line_no+1) - if line != underline and line_below != underline: - self.editor.ReplaceSelection('\n%s%s%s\n' % (overline, - line.strip(' '), - underline)) - self.editor.GotoPos(startpos) - - def on_format_word(self, event): - self.nb.SetSelection(0) - selection = self.editor.GetSelectedText() - if selection != '': - if event.GetId() == wxID_WXBTNBOLD: - symbol = '**' - elif event.GetId() == wxID_WXBTNITALIC: - symbol = '*' - elif event.GetId() == wxID_WXBTNLITERAL: - symbol = '``' - else: - symbol = '' - selection = selection.replace('*','').replace('`','').strip() - selection = '%s%s%s' % (symbol,selection,symbol) - self.editor.ReplaceSelection(selection) - - def on_goto(self, event): - values = [] - for i in range(self.editor.GetLineCount()+1)[1:]: - values.append(str(i)) - dlg = wxSingleChoiceDialog(self, 'Select a line number:', 'Goto line...', - values, wxOK|wxCANCEL) - if dlg.ShowModal() == wxID_OK: - self.editor.GotoLine(int(dlg.GetStringSelection())-1) - dlg.Destroy() - - def on_help_about(self, event): - """ - Event handler for menu - option *Help -> About*. - """ - dlg = aboutDlg(self) - try: - dlg.Centre() - dlg.ShowModal() - finally: - dlg.Destroy() - - def on_insert_figure(self, event): - self.insert_image('figure') - - def on_btn_hyperlink(self, event): - self.insert_hyperlink() - - def on_insert_image(self, event): - self.insert_image('image') - - def on_insert_path(self, event): - item = self.activeitem - itemimage = self.tree.GetItemImage(item) - file = self.tree.GetItemText(item) - if self.project != None: - dir = self.project.directory - else: - dir = os.path.dirname(file) - dlg = wxFileDialog (self, 'Choose file', - dir, '', '*.*', - wxOPEN|wxFILE_MUST_EXIST) - go_ahead = 1 - if dlg.ShowModal() == wxID_OK: - target = dlg.GetPath() - else: - go_ahead = 0 - if go_ahead: - if self.project != None: - dir = self.project.directory - else: - dir = os.path.dirname(file) - dlg = wxDirDialog(self, 'Calculate path relative' - ' to which outputdirectory?', dir) - if dlg.ShowModal() == wxID_OK: - dir = dlg.GetPath() - else: - go_ahead = 0 - dlg.Destroy() - if go_ahead: - self.editor.ReplaceSelection( - quote(relative_path(self.htmlfile(file,dir), target))) - dlg.Destroy() - - def on_notebook_page_changed(self, event): - event.Skip() - - def on_paste(self, event): - self.editor.Paste() - - def on_project_delete(self, event): - available_projects = [] - for project in self.projects: - available_projects.append(project.name) - if available_projects != []: - available_projects.sort() - dlg = wxMultipleChoiceDialog(self, 'Select the projects which you want to' \ - '\ndelete or press "Cancel" to abort.', - 'Delete Projects', - available_projects) - dlg.Centre() - if dlg.ShowModal() == wxID_OK: - selection = dlg.GetValueString() - for project_name in selection: - for project in self.projects: - if project.name == project_name: - self.delete_project(project) - dlg.Destroy() - else: - customMsgBox(self, 'Sorry, I don\'t remember any projects.', - 'info') - - def on_project_new(self, event): - go_ahead = 1 - - other_project_names = [] - for project in self.projects: - other_project_names.append(project.name) - - if self.CheckEditorChanges(): - project = DocProject() - dlg = projectSettingsDlg(self, project, other_project_names) - dlg.Centre() - if dlg.ShowModal() == wxID_CANCEL: - go_ahead = 0 - else: - self.project = project - self.project.name, self.project.directory = dlg.getValues() - dlg.Destroy() - - if go_ahead: - try: - self.projects.append(self.project) - self.save_projects() - self.init_tree() - except: - customMsgBox(self, '%s:\n%s\n%s' % sys.exc_info(), 'error') - - def on_project_settings(self, event): - go_ahead = 1 - - other_project_names = [] - for project in self.projects: - if project.name != self.project.name: - other_project_names.append(project.name) - - dlg = projectSettingsDlg(self, self.project, other_project_names) - dlg.Centre() - if dlg.ShowModal() == wxID_CANCEL: - go_ahead = 0 - else: - name, directory = dlg.getValues() - self.set_editor_language_code() - dlg.Destroy() - - if go_ahead: - sort_tree_new = 0 - if self.project.name != name: - self.projectdirty = 1 - sort_tree_new = 1 - for project in self.projects: - if project.name == self.project.name: - project.name = name - self.project.name = name - if self.project.directory != directory: - self.project.directory = directory - self.projectdirty = 1 - - if self.projectdirty: - self.project_save() - if sort_tree_new: - self.init_tree() - - def on_redo(self, event): - self.editor.Redo() - - def on_run_tool(self, event): - go_ahead = 1 - choices = [] - for tool in self.tools.values(): - choices.append('%s: %s' % (tool[0],tool[1])) - dlg = wxSingleChoiceDialog(self, 'Select a tool...', 'Toolbox', - choices, wxOK|wxCANCEL) - dlg.Centre() - if dlg.ShowModal() == wxID_OK: - tool_id=int(dlg.GetStringSelection().split(':')[0]) - for key in self.tools.keys(): - if self.tools[key][0] == tool_id: - tool_key = key - break - else: - go_ahead = 0 - dlg.Destroy() - if go_ahead: - self.log.Clear() - tool = self.tools[tool_key] - item = self.activeitem - file = self.tree.GetItemText(item) - curdir = os.getcwd() - try: - replmts = {'$[FileDir]': os.path.split(file)[0], - '$[FilePath]': file, - '$[FileName]': os.path.split(file)[1], - '$[FileBase]': os.path.splitext(os.path.basename(file))[0], - '$[ProjectDir]': self.project.directory} - command = tool[2] - for str in replmts.keys(): - command = command.replace(str, replmts[str]) - directory = tool[3] - for str in replmts.keys(): - directory = directory.replace(str, replmts[str]) - except: - go_ahead = 0 - customMsgBox(self, '%s:\n%s\n%s' % sys.exc_info(), 'error') - if go_ahead: - t = time.localtime(time.time()) - st = time.strftime('%d-%b-%Y, %H:%M:%S', t) - wxLogMessage('%s: %s' % (st, tool[1])) - wxLogMessage('COMMAND: %s\nDIRECTORY: %s' % (command, directory)) - try: - os.chdir(directory) - os.system(command) - t = time.localtime(time.time()) - st = time.strftime('%d-%b-%Y, %H:%M:%S', t) - wxLogMessage('%s: Finished.' % st) - except: - customMsgBox(self, '%s:\n%s\n%s' % sys.exc_info(), 'error') - os.chdir(curdir) - - def on_select_all(self, event): - self.editor.SelectAll() - - def on_tree_item_activated(self, event): - item=event.GetItem() - go_ahead = 1 - - if item != self.activeitem \ - and self.tree.GetItemImage(self.activeitem) == self.im2: - go_ahead = self.CheckEditorChanges() - - if go_ahead: - self.nb.SetSelection(0) - if item != self.activeitem: - olditemparent = self.tree.GetItemParent(self.activeitem) - self.tree.SetItemBold(olditemparent, 0) - self.tree.SetItemTextColour(olditemparent, wxBLACK) - self.tree.SetItemBold(self.activeitem, 0) - self.tree.SetItemTextColour(self.activeitem, wxBLACK) - self.activeitem = item - self.tree.SetItemBold(item, 1) - if item != self.root: - self.tree.SetItemTextColour(item, wxBLUE) - else: - go_ahead = 0 - - if go_ahead: - itemparent = self.tree.GetItemParent(item) - itemimage = self.tree.GetItemImage(item) - - # item is file: - if itemimage == self.im2: - # file is part of project: - if self.tree.GetItemImage(itemparent) == self.im1: - self.tree.SetItemBold(itemparent, 1) - self.tree.SetItemTextColour(itemparent, wxBLUE) - project_name = self.tree.GetItemText(itemparent) - for project in self.projects: - if project.name == project_name: - self.project = project - self.activateMenuItemsProjectOpen(1) - # file is not part of project: - else: - self.project = None - self.activateMenuItemsProjectOpen(0) - file=self.tree.GetItemText(item) - if os.path.exists(file): - self.open_file_in_editor(file) - else: - self.editor.Clear() - self.editor.Enable(0) - self.nb.SetPageText(0, 'Editor') - self.activateMenuItemsFileSelected(0) - parent = self.tree.GetItemParent(item) - self.tree.SetItemBold(item, 0) - self.tree.SetItemTextColour(item, wxBLACK) - self.activeitem = parent - dlg=wxMessageDialog(self, '%s does not exist.\nRemove ' - 'from project?' % file, - NAME, wxYES_NO | wxICON_QUESTION) - if dlg.ShowModal() == wxID_YES: - self.tree.Delete(item) - self.project.remove(file) - self.project_save() - dlg.Destroy() - self.tree.SelectItem(self.activeitem) - - # item is project: - elif itemimage == self.im1: - project_name = self.tree.GetItemText(item) - for project in self.projects: - if project.name == project_name: - self.project = project - self.activateMenuItemsProjectOpen(1) - self.nb.SetPageText(0, 'Editor') - self.editor.Clear() - self.editor.Enable(0) - self.activateMenuItemsFileSelected(0) - - # item is neither file nor project: - else: - self.nb.SetPageText(0, 'Editor') - self.editor.Clear() - self.editor.Enable(0) - self.project = None - self.activateMenuItemsProjectOpen(0) - self.activateMenuItemsFileSelected(0) - - def on_undo(self, event): - self.editor.Undo() - - def on_view_eols(self, event): - self.preferences['eol_markers'] = not self.preferences['eol_markers'] - self.editor.SetViewEOL(self.preferences['eol_markers']) - self.save_preferences() - - def on_view_edge(self, event): - self.preferences['right_edge_indicator'] = not self.preferences['right_edge_indicator'] - self.editor.SetEdgeMode(self.preferences['right_edge_indicator']) - self.save_preferences() - - def on_view_ws(self, event): - self.preferences['whitespace'] = not self.preferences['whitespace'] - self.editor.SetViewWhiteSpace(self.preferences['whitespace']) - self.save_preferences() - -#--------------------------------------------------------------------------- - -class FactoryApp(wxApp): - def OnInit(self): - provider = wxSimpleHelpProvider() - wxHelpProvider_Set(provider) - self.projects = [] - if self.init_projects(): - wxInitAllImageHandlers() - if len(sys.argv) > 1: - frame = DocFactoryFrame(self.projects, sys.argv[1]) - else: - frame = DocFactoryFrame(self.projects) - self.SetTopWindow(frame) - return 1 - else: - return 0 - - def init_projects(self): - if os.path.exists(DATA): - try: - cfg = ConfigParser.ConfigParser() - cfg.read(DATA) - for section in cfg.sections(): - if section[:19] == 'docfactory_project:': - project = DocProject() - project.name = section.split(': ')[1] - project.directory = cfg.get(section, 'outputdirectory') - if cfg.has_option(section, 'files'): - project.files = cfg.get(section, 'files').split(';') - if project.files == ['']: - project.files = [] - self.projects.append(project) - except: - f = open('error.txt', 'w') - f.write('%s:\n%s\n%s' % sys.exc_info()) - f.close() - return 0 - return 1 - -#-------------------------------------------------------------------------- - -def main(): - app = FactoryApp(0) - app.MainLoop() - -#-------------------------------------------------------------------------- - -if __name__ == '__main__': - main() - -#-------------------------------------------------------------------------- diff --git a/sandbox/gschwant/docfactory/factory/stylesheets.py b/sandbox/gschwant/docfactory/factory/stylesheets.py deleted file mode 100644 index b2bec5a68..000000000 --- a/sandbox/gschwant/docfactory/factory/stylesheets.py +++ /dev/null @@ -1,528 +0,0 @@ -""" -:author: Dr. Gunnar Schwant -:contact: g.schwant@gmx.de -:version: 0.2.4 -""" - -html_classic = ''' -/* -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:date: $Date$ -:version: $Revision$ -:copyright: This stylesheet has been placed in the public domain. - -Default cascading style sheet for the HTML output of Docutils. -*/ - -.first { - margin-top: 0 } - -.last { - margin-bottom: 0 } - -a.toc-backref { - text-decoration: none ; - color: black } - -dd { - margin-bottom: 0.5em } - -div.abstract { - margin: 2em 5em } - -div.abstract p.topic-title { - font-weight: bold ; - text-align: center } - -div.attention, div.caution, div.danger, div.error, div.hint, -div.important, div.note, div.tip, div.warning, div.admonition { - margin: 2em ; - border: medium outset ; - padding: 1em } - -div.attention p.admonition-title, div.caution p.admonition-title, -div.danger p.admonition-title, div.error p.admonition-title, -div.warning p.admonition-title { - color: red ; - font-weight: bold ; - font-family: sans-serif } - -div.hint p.admonition-title, div.important p.admonition-title, -div.note p.admonition-title, div.tip p.admonition-title, -div.admonition p.admonition-title { - font-weight: bold ; - font-family: sans-serif } - -div.dedication { - margin: 2em 5em ; - text-align: center ; - font-style: italic } - -div.dedication p.topic-title { - font-weight: bold ; - font-style: normal } - -div.figure { - margin-left: 2em } - -div.footer, div.header { - font-size: smaller } - -div.sidebar { - margin-left: 1em ; - border: medium outset ; - padding: 0em 1em ; - background-color: #ffffee ; - width: 40% ; - float: right ; - clear: right } - -div.sidebar p.rubric { - font-family: sans-serif ; - font-size: medium } - -div.system-messages { - margin: 5em } - -div.system-messages h1 { - color: red } - -div.system-message { - border: medium outset ; - padding: 1em } - -div.system-message p.system-message-title { - color: red ; - font-weight: bold } - -div.topic { - margin: 2em } - -h1.title { - text-align: center } - -h2.subtitle { - text-align: center } - -hr { - width: 75% } - -ol.simple, ul.simple { - margin-bottom: 1em } - -ol.arabic { - list-style: decimal } - -ol.loweralpha { - list-style: lower-alpha } - -ol.upperalpha { - list-style: upper-alpha } - -ol.lowerroman { - list-style: lower-roman } - -ol.upperroman { - list-style: upper-roman } - -p.attribution { - text-align: right ; - margin-left: 50% } - -p.caption { - font-style: italic } - -p.credits { - font-style: italic ; - font-size: smaller } - -p.label { - white-space: nowrap } - -p.rubric { - font-weight: bold ; - font-size: larger ; - color: darkred ; - text-align: center } - -p.sidebar-title { - font-family: sans-serif ; - font-weight: bold ; - font-size: larger } - -p.sidebar-subtitle { - font-family: sans-serif ; - font-weight: bold } - -p.topic-title { - font-weight: bold } - -pre.address { - margin-bottom: 0 ; - margin-top: 0 ; - font-family: serif ; - font-size: 100% } - -pre.line-block { - font-family: serif ; - font-size: 100% } - -pre.literal-block, pre.doctest-block { - margin-left: 2em ; - margin-right: 2em ; - background-color: #eeeeee } - -span.classifier { - font-family: sans-serif ; - font-style: oblique } - -span.classifier-delimiter { - font-family: sans-serif ; - font-weight: bold } - -span.interpreted { - font-family: sans-serif } - -span.option { - white-space: nowrap } - -span.option-argument { - font-style: italic } - -span.pre { - white-space: pre } - -span.problematic { - color: red } - -table { - margin-top: 0.5em ; - margin-bottom: 0.5em } - -table.citation { - border-left: solid thin gray ; - padding-left: 0.5ex } - -table.docinfo { - margin: 2em 4em } - -table.footnote { - border-left: solid thin black ; - padding-left: 0.5ex } - -td, th { - padding-left: 0.5em ; - padding-right: 0.5em ; - vertical-align: top } - -th.docinfo-name, th.field-name { - font-weight: bold ; - text-align: left ; - white-space: nowrap } - -h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { - font-size: 100% } - -tt { - background-color: #eeeeee } - -ul.auto-toc { - list-style-type: none } -''' - -html_modern = html_classic + ''' - -/* -Additional styles for "modern"-style of DocFactory. - -:Author: Gunnar Schwant -:Contact: g.schwant@gmx.de -*/ - -.first { - font-size: 10pt } - -.last { - font-size: 10pt } - -a { - text-decoration: none } - -a.reference { - color: #0000BF } - -a:hover { - background-color: #003366 ; - color: white } - -body { - font-family: arial,helvetica,univers ; - font-size: 10pt ; - padding-top: 1cm ; - margin-left:0.5cm ; - margin-right:0.5cm ; - margin-bottom:0.5cm } - -dd { - font-size: 10pt ; - padding-top: 0.1cm -} - -dt { - font-size: 10pt ; - font-weight: bold ; - background-color: #C8DBEB ; - padding-left: 0.1cm ; - padding-top: 0.1cm ; - padding-bottom: 0.1cm } - -div.abstract { - font-size: 10pt } - -div.abstract p.topic-title { - font-size: 10pt } - -div.attention, div.caution, div.danger, div.error, div.hint, -div.important, div.note, div.tip, div.warning { - font-size: 10pt } - -div.attention p.admonition-title, div.caution p.admonition-title, -div.danger p.admonition-title, div.error p.admonition-title, -div.warning p.admonition-title, div.hint p.admonition-title, -div.important p.admonition-title, div.note p.admonition-title, -div.tip p.admonition-title { - margin-top: 0em ; - font-size: 12pt ; - font-family: arial,helvetica,univers } - -div.dedication { - font-size: 10pt } - -div.dedication p.topic-title { - font-size: 10pt } - -div.figure { - font-size: 10pt } - -div.footer, div.header { - font-size: 8pt } - -div.system-messages { - font-size: 10pt } - -div.system-messages h1 { - font-size: 12pt } - -div.system-message { - font-size: 10pt } - -div.system-message p.system-message-title { - font-size: 10pt } - -div.topic { - font-size: 10pt } - -h1, h2, h3, h4, h5, h6 { - padding-top: 0.5cm ; - page-break-after: avoid ; - font-family: arial,helvetica,univers } - -h1 { - font-size: 18pt } - -h1.title { - padding-top: 0cm } - -h2 { - font-size: 16pt } - -h2.subtitle { - padding-top: 0cm } - -h3 { - font-size: 14pt } - -h4 { - font-size: 12pt } - -h5, h6 { - font-size: 10pt } - -hr { - width: 100%; - page-break-after: always } - -li { - padding-top: 1mm ; - padding-bottom: 1mm } - -ol.simple, ul.simple { - font-size: 10pt } - -ol.arabic { - font-size: 10pt } - -ol.loweralpha { - font-size: 10pt } - -ol.upperalpha { - font-size: 10pt } - -ol.lowerroman { - font-size: 10pt } - -ol.upperroman { - font-size: 10pt } - -p.caption { - font-size: 10pt } - -p.credits { - font-style: italic ; - font-size: 8pt } - -p.label { - font-size: 10pt } - -p.topic-title { - font-size: 10pt } - -pre.address { - font-family: arial,helvetica,univers ; - font-size: 10pt } - -pre.line-block { - font-size: 10pt } - -pre.literal-block, pre.doctest-block { - border-width: 1pt ; - border-style: solid ; - border-color: #999999 ; - color: #0000C0 ; - background-color: #ffffe0 ; - font-size: 9pt } - -span.classifier { - font-size: 10pt ; - font-family: arial,helvetica,univers } - -span.classifier-delimiter { - font-size: 10pt ; - font-family: arial,helvetica,univers } - -span.field-argument { - font-size: 10pt } - -span.interpreted { - font-size: 10pt ; - font-family: arial,helvetica,univers } - -span.option-argument { - font-size: 10pt } - -span.problematic { - font-size: 10pt } - -table { - font-size: 10pt ; - border-collapse: collapse ; - border-width: 1.5pt ; - border-color: #003366 } - -table.citation { - font-size: 10pt } - -table.docinfo { - font-size: 10pt } - -table.footnote { - font-size: 8pt ; - text-align: left } - -table.table { - width: 100% } - -th { - border-width: 1.5pt } - -td { - border-width: 1pt } - -td, th { - font-size: 10pt ; - border-style: thin ; - border-color: #003366 } - -td.docinfo-name, th.field-name { - font-size: 10pt } - -h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { - font-size: 10pt } -''' - -tex_classic = ''' -% donot indent first line. -\setlength{\parindent}{0pt} -\setlength{\parskip}{5pt plus 2pt minus 1pt} - -% sloppy -% ------ -% Less strict (opposite to default fussy) space size between words. Therefore -% less hyphenation. -\sloppy - -% fonts -% ----- -% times for pdf generation, gives smaller pdf files. -% -% But in standard postscript fonts: courier and times/helvetica do not fit. -% Maybe use pslatex. -\usepackage{times} - -% pagestyle -\pagestyle{plain} -''' - -tex_fancyhdr2side = ''' -% geometry -\geometry{a4paper,twoside,tmargin=1.5cm, - headheight=1cm,headsep=0.75cm} - -% donot indent first line. -\setlength{\parindent}{0pt} -\setlength{\parskip}{5pt plus 2pt minus 1pt} - -% sloppy -% ------ -% Less strict (opposite to default fussy) space size between words. Therefore -% less hyphenation. -\sloppy - -% fonts -% ----- -% times for pdf generation, gives smaller pdf files. -% -% But in standard postscript fonts: courier and times/helvetica do not fit. -% Maybe use pslatex. -\usepackage{times} -\\renewcommand{\\familydefault}{\sfdefault} - -% pagestyle -\usepackage{fancyhdr} -\pagestyle{fancy} -\\addtolength{\headheight}{\\baselineskip} -\\renewcommand{\sectionmark}[1]{\markboth{#1}{}} -\\renewcommand{\subsectionmark}[1]{\markright{#1}} -\\fancyhf{} -\\fancyhead[LE,RO]{\\bfseries\\textsf{\Large\\thepage}} -\\fancyhead[LO]{\\textsf{\\footnotesize\\rightmark}} -\\fancyhead[RE]{\\textsc{\\textsf{\\footnotesize\leftmark}}} -%\\fancyfoot[LE,RO]{\\bfseries\\textsf{\scriptsize Docutils}} -\\fancyfoot[RE,LO]{\\textsf{\scriptsize\\today}} -''' - -stylesheets = { 'HTML: Classic': html_classic, - 'LaTeX: Classic': tex_classic, - 'HTML: Modern': html_modern, - 'LaTeX: Fancyheader2side': tex_fancyhdr2side} diff --git a/sandbox/gschwant/docfactory/factory/throbimages.py b/sandbox/gschwant/docfactory/factory/throbimages.py deleted file mode 100644 index a0ccf3622..000000000 --- a/sandbox/gschwant/docfactory/factory/throbimages.py +++ /dev/null @@ -1,7340 +0,0 @@ -""" -:author: Dr. Gunnar Schwant -:contact: g.schwant@gmx.de -:version: 0.2.4 -""" - -#---------------------------------------------------------------------- -# This file was generated by encode_bitmaps.py -# -from wxPython.wx import wxImageFromStream, wxBitmapFromImage -import cStringIO - - -catalog = {} -index = [] - -class ImageClass: pass - -def getDocFactory001Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\r`\ -IDATx\x9c\xed\x9bil\x1d\xd7y\x86\x9fsf\xbb+\xef\xc2\xcbU")\x91\x94m\xd9\x94d\ -\xed\xf2\xaaDv\xe2J^\xeaM\xf5\xd2\xdaE\xd1"(j\xa3\x85\xdb\xfe\xc8\xcf\xa0\ -\x08\n\x14]\x8c\x06\x81\xed&\xa9Q\xb4p\x9d\xbaQ\x12;\x8e\x11\xc9Nd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\x80g\xbe\x19\xe7\xbd\xbd\x9f\x7f\x94@\x1f\x1c\x1c\xbc\xc2\x16+T\ -\xb8z\xdc\xb4u\x82\xa9\xa1\x0c\xc7\x0e\xe6y\xe2\xb9\x00]\'l\xde\xda\xbe\x80\ -\x99\xec\x85\xd3+\x98]m\xafP\xe1\xff\r\xe1\xa0M4\x9a\xe7\xa1?\x86\x8d\xf7\ -\xda\xbc\xfcj\xe8\xa2\xcd\x01\xa0_Ao\x15*\\u^\xfc\xf7F\x82f\x1d\xd51\x9f\xe7\ -_\x92\xbc\xf6\xb3K\x9f\x8e\x14\xf0\xad\xca7H\x85\n\x17\xa12\xc5\xaaP\xe1\x12\ -T\x1a\xa4B\x85K\xf0?`M\x96s\\\xcam\xe7\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory001Bitmap(): - return wxBitmapFromImage(getDocFactory001Image()) - -def getDocFactory001Image(): - stream = cStringIO.StringIO(getDocFactory001Data()) - return wxImageFromStream(stream) - -index.append('DocFactory001') -catalog['DocFactory001'] = ImageClass() -catalog['DocFactory001'].getData = getDocFactory001Data -catalog['DocFactory001'].getImage = getDocFactory001Image -catalog['DocFactory001'].getBitmap = getDocFactory001Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory002Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rc\ -IDATx\x9c\xed\x9bi\x8c]\xe5y\xc7\x7f\xef{\xb6\xbb\xce]\xe6\xcej\xcf\x8c=3\ -\x06\x0cc\x1b\xeffubH\xa8\xcdR6\x97\xa5\x85\xaaj\x15U\x05\xb5\xa2\xed\x87|\ -\x8c\xaa\xa8R\xd5\x055\x8a MRT\xb5\xa2\xa44N\x02!(6$\xc6\x06\xc7\x19/\x83\ -\xf1:\xc6\x9e\xc5\xb3\xdc\xd9g\x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xe7\xaa\xd8\xb4b\x04\x10\xbc\xfa\xd6R\x8e\x9c\xaa\ -\xbe\xacf6g \x04\xdc}\xfb\x18\x1b:\xa6p}y\x81\xeeB\xe3\x9b\xbfG?\x9b:F(\xfb\ -\x1a\xaf\xbc\xd5\xc6\x91S\x17\x9e\xe30t\xf8\x9b\xaf\xe7(\x0f\x8e\xf0\xfaw\ -\xfb\xf9\xda?u\xd07\x11\xe5\x9b\xcfF\xb8\xd4\x91A\xb1h\xd1\xf7*\r\xf2\x05A\ -\x08\x08\x05?L\x87\xeb\x82\xedT\x96\xe1?\x0b6\xac)\xf3\xfdggx\xee/\x87p=\xc1\ -\x9f\xff\xf3"\x9e\xfaz\x9c\xb7\xf7_\xfa(\x81><<|\x85,V\xa8p\xf5\xb8a\xfb\x14\ -3#\x19\x8e\x1f\xce\xf3\xd83\x01\xbaO\xda\xbc\xbes\x11s\xd9\x8bO\xaf`~\xd5\ -\xbdB\x85\xff\xf7\x84\x836\xd1h\x9e\x07\xfe\x186\xdfm\xf3\xc2K\xa1\xcb6\x07\ -\x80~\x05\xbcU\xa8p\xd5y\xfe\xdf\x1b\t\x9auT\xc7|\x9e\xfd\x8e\xe4\xe5\x9f.\ -\xect\xa4\x80oT\xfe\x83T\xa8p\x11*S\xac\n\x15.A\xa5A*T\xb8\x04\xff\x03D\xe1\ -\x96sL\xad_\xbf\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory002Bitmap(): - return wxBitmapFromImage(getDocFactory002Image()) - -def getDocFactory002Image(): - stream = cStringIO.StringIO(getDocFactory002Data()) - return wxImageFromStream(stream) - -index.append('DocFactory002') -catalog['DocFactory002'] = ImageClass() -catalog['DocFactory002'].getData = getDocFactory002Data -catalog['DocFactory002'].getImage = getDocFactory002Image -catalog['DocFactory002'].getBitmap = getDocFactory002Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory003Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rd\ -IDATx\x9c\xed\x9bil\x1d\xd7y\x86\x9fsf\xbb+\xef\xc2\xcbU")\x91\x94m\xd9\x94d\ -\xed\xf2\xaaDv\xe2J^\xeaM\xf5\xd2\xdaE\xd1"(j\xa3\x85\xdb\xfe\xc8\xcf\xa0\ -\x08\n\x14]\x8c\x06\x81\xed,5\x8a\x16\x8e\x137Jb\xc71"\xd9\x89,\xd9\x8aBm\ -\x96\xb5R\x96DR\\.w\xf2\x92w\x9d\xb93s\xfa\x83\xael\xc5\x96\xc8\xa2\x92e\xd4\ -\xf7\xf9yqf\xde\xf7\x9b\xef\xfb0\xe7\x9e3G\xfc\xc3\xb7\x94\xa2B\x85\n\x9f\ -\x8a\x1e\xaa\xbe\xda\x16*T\xf8\xfc\xa2\x07+\rR\xa1\xc2E\xd1\xc3\x89\xabm\xe1\ -\x8b\x8d@a`#\xf1.\xf8\xdd\xc5\xc0\xc5\xfc\xec<\x08\x1b\xedw<(\xa0\xac\x02xhW\ -DW\xe2c\x8a\x12>\x92\xb2\xb2P\x88+\xa2\xf3\x7fA\x0f\xc5\xaf\xb6\x85/.\x02\ -\x9f\x86\xc2.\xa2\xee9\xfc\x8f\xd5\xa6\x94 M\x9d\xbc\x1b\'\x17lgF_\x84K\xe0\ -\ny\xf0h\xb2\xdf\xa2\xca\xeb\xb9\xc0\x03\x80n)l\xad\x86nm\x0beB\x97UW\xc3a\ -\xb1\xfb\x0b\x02\xe5\x114C0&\x97\x91\x967_V\x8d\xcb\x81\x1e\xae4\xc8U\xc3b\ -\x94&\xfd9N\xbf^\xcb\xf4`\x04\x10 %RW\x84k\x8aD\xea\x8b\xb4-\x9f\xc4\xb1\x16\ -\xd1\x17\xfc[\x1c\xea.\xbb\x87 \xc34\x15_\xe6\xe4\xcf\xe2L\xa7\x03 \x04\x08\ -\t@\xac\xd1f\xd9\x83\xefP4\xea\x99\xe0\xd6\xcb\xaa\x1bb\x98\x06\xfb\'\x1c\ -\xfbI\x8a\xd8\xc2\x12-k\x0eQ\x08^O\x99\xcfWA\xea\x91\xcf\x97\x9f/\x14!%Hh\ -\xab\x10~\x11\xa9)\x82q\x81\x11\x10(\x04\xa5|\x90\xd1\x93\x92\xfch3\xcb\xef\ -\x91\x98\xc6o\xe9\x0f\xdfw\xc14D\xf8\x1e\xc2-#|\x0f%5\x94n\xa0\xe4\xa7O\x87\ -\x84\xeb \xdd2\xc0\x05cCJ\',\xaeE\xb9\x05\xa4\xc6y\x0f H-6\t\x85:0\x83MD\xe4\ -\'\xef\xe3\xeb&J\xd3\x91N\x11\x84\xc47\xac\xd9\x06\x9bCS\xa0\x88\xfbE\xc2\ -\xf9\xa5HJd\xd31\xae\x8bZ\xd4\x85\xc6\xc9\xc8\x8f\nr^\xf1)\xf5\x91\xbe\x19\ -\x98\xd5\xf4\xca\xf8\xba5\xabU\xb6g\x87\x99\x81O^\x03\xf8f\xf0\x02\xcf\xbf\ -\x8b^e\x0e\\"\x85\x15\xae$\x96r\xc0X\x87\xa1\xbfC,\xe5r\xe3\x1f\xdd\x82\x16\ -\n\x82\xf2)\xe7m\x06\x0e\xf50r<\xcd\xb9\xfd)\xae\xbb+\x8ac\x9c\xa1 \x82\x08\ -\xe5af\xba13\xddx\x85\x12\x025\xfb\xf2\t\x04\xb0SKq\xaa\x9a\xe1\xc3F\x12~\ -\x19k\xa6\x07c\xf2,\xcav\x005\xfb\x820\x02\x14koD\x0bW#\x03\xb7`Y;\xd1R.7>\ -\xb1\x11#\x12\x04\xc0.+&\x8d\x082 \x89\xf9=\x98Sg\xb0f\xbaQ\xb6\x8bR\n\xcc ^\ -\xb0\x1a\xb3\x98F)p\xe2\xad\x94R\x1dsj\x86\x85N\xb57Cnj\x19\xb8\x9d\x08\rJ\ -\x85\x95,\xb2F\x192\xa0$\x8d\xf9\xc5\xa7|\x02\xe9\x03\x18\xb94\xd2\x90\xb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x00\ -IEND\xaeB`\x82' - -def getDocFactory003Bitmap(): - return wxBitmapFromImage(getDocFactory003Image()) - -def getDocFactory003Image(): - stream = cStringIO.StringIO(getDocFactory003Data()) - return wxImageFromStream(stream) - -index.append('DocFactory003') -catalog['DocFactory003'] = ImageClass() -catalog['DocFactory003'].getData = getDocFactory003Data -catalog['DocFactory003'].getImage = getDocFactory003Image -catalog['DocFactory003'].getBitmap = getDocFactory003Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory004Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rd\ -IDATx\x9c\xed\x9bil\\\xd7y\x86\x9fs\xee6+g\xe1p\x95HJ$e[6%Y\xbb\xbc*\x91\x9d\ -\xb8\x92\x97zS\xbd\xb4vQ\xb4\x08\x8a\xdah\xe1\xb6?\xf23(\x82\x02E\x17\xa3A`\ -\xa7Ij\x14-\\\xa7n\x94\xc4\x8ecD\xb2\x13Y\xb2\x15\x85\xda,k\xa5,\x89\xa4\xb8\ -\x0cwr\xc8Y\xef\x9d{\xef\xe9\x0f\xba\xb2UG"]h1\x9cy~\x0e\xce\xbd\xef\xfb\x9d\ -\xef\xfb0g\xce\x99#\xfe\xee[JQ\xa1B\x85\xdf\x88\x1e\xaa\xbe\xd6\x16*T\xf8\ -\xfc\xa2\x07+\rR\xa1\xc2E\xd1\xc3\x89km\xe1\xb7\x13\x81\xc2\xc0F\xe2]\xf0\ -\xb9\x8b\x81\x8by\xf5<\x08\x1b\xed\xffxP@Y\x05\xf0\xd0\xae\x88\xae\xc4\xc7\ -\x14%|$ee\xa1\x10WD\xe7r\xa0\x87\xe2\xd7\xda\xc2o\x1f\x02\x9f\x86\xc2.\xa2\ -\xee9\xfcO\xd4\xa6\x94 M\x9d\xbc\x1b\'\x17lgF_\x84K\xe0\ny\xf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x1a\xcap\xec`\ -\x9e\'\x9e\x0b\xd0u\xc2\xe6\xcd\xed\x0b\x98\xc9\xce\x7fy\x05\xb3\xbb\xf0\x15\ -*|\xe1\x08\x07m\xa2\xd1<\x0f\xfd1l\xbc\xd7\xe6\xa5WB\x9f\xb99\x00\xf4+\xe0\ -\xadB\x85k\xce\x8b\xff\xdeH\xd0\xac\xa3:\xe6\xf3\xfcw$\xaf\xfe\xf4\xffw;R\ -\xc07*\xbfA*T\xb8\x08\x95%V\x85\n\x97\xa0\xd2 \x15*\\\x82\xff\x01\x0e\t\x96s\ -<\xfa\x1bp\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory004Bitmap(): - return wxBitmapFromImage(getDocFactory004Image()) - -def getDocFactory004Image(): - stream = cStringIO.StringIO(getDocFactory004Data()) - return wxImageFromStream(stream) - -index.append('DocFactory004') -catalog['DocFactory004'] = ImageClass() -catalog['DocFactory004'].getData = getDocFactory004Data -catalog['DocFactory004'].getImage = getDocFactory004Image -catalog['DocFactory004'].getBitmap = getDocFactory004Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory005Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rf\ -IDATx\x9c\xed\x9bi\x90\\\xd5y\x86\x9fs\xee\xd6\xeb\xf42=\xab43\xd2\xcc\x08\ -\x10\x8c$\xb4\x8bU\xb6\xc0&\x12K\xd8\x14\x96\x04R\xa9\xa4\\\xa9@%E\x92\x1f\ -\xfe\xe9J\xb9R\x95\xcaB\xc5\xe5\x02\xbc\x84J%Ep\x88e\x1b\x8c)K`\x0b\tdy\xb4!\ -\xb4\x8e\x9043\x9a\xa5g\x9f\xe9\x99^\xef\xed{\xef\xc9\x8f!\x02\x05K\x1a\xf0\ -\x08(\xdc\xcf\xcf\xaes\xef\xfb~\x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\xd3\x91N\x11\x84\ -\xc47\xac\xd9\x06\xbb\x8c\xa6@\x11\xf7\x8b\x84\xf3K\x91\x94\xc8\xa6c\\\x13\ -\xb5\xa8\x0b\x8d\x93\x91\x1f\x14\xe0\x9c\xe2S\xea\x03}30\xab\xe9\x95\xf1ukV\ -\xabl\xcf\x0e3\x03\x1f}\x06\xf0\xcd\xe0\x05\x9e/\x87^e\x0e\xccyp\x85\xdf\x0e\ -K9`\xac\xc3\xd0\xdf"\x96r\xb9\xfe\x8fnB\x0b\x05A\xf9\x94\xf36\x03\x87z\x189\ -\x9e\xe6\xdc\xfe\x14\xd7\xdc\x11\xc51\xceP\x10A\x84\xf203\xdd\x98\x99n\xbcB\ -\t\x81\x9a\xfd\xf2\t\x04\xb0SKq\xaa\x9a\xe1\xfdF\x12~\x19k\xa6\x07c\xf2,\xca\ -v\x005\xfb\x05a\x04(\xd6^\x8f\x16\xaeF\x06n\xc2\xb2v\xa2\xa5\\\xae\x7fl#F$\ -\x08\x80]VL\x1a\x11d@\x12\xf3{0\xa7\xce`\xcdt\xa3l\x17\xa5\x14\x98A\xbc`5f1\ -\x8dR\xe0\xc4[)\xa5:.\xab\x19\x16:\xd5\xde\x0c\xb9\xa9e\xe0v"4(\x15V\xb2\xc8\ -\x1ae\xc8\x80\x924\xe6\x16\x9f\xf2\t\xa4\x0f`\xe4\xd2HC\xe2\x86\x1b\xd0\nc\ -\xf8v\x19aZ8z-2;\x8e\x90\x02{\xe1\n\xbch-\x00F\xfa\x04\xc6\xd4\x00\x08E9\xde\ -L\xb9q\xe9\x9cs\xa6G89\x9f5P\xe1\x12\x18BG\x98U\xe82\x87\x1e\x14\x18\xb1\x14\ -\x19\xab\x80\x07X\xa10m\xb7\xad\xc5\xcbm\'7\xdcM!s\x15\tk\x04\xdd\x9c!\x92=\ -\x8d^\xce0tb\x92\xf1#Y<\xd7G\x0f\xea4nH\xd0\x10\x1b\xa2X\\@!\xb8\x10\xa9<"\ -\xb9S\xa8\xec4\xfd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\xeaI\xb0\xffx\x1d=\xfd\x91\xf3c\xa5T,\ -\xbfz\x92\x8d\xab\x07I\xc5\x0b\x94\xcb\x12%u\xde}\xaf\x9a\x9d\x9d\x8d\xe4\ -\xf2\x06w\xde:\xc4\xfa\x8eI\xca\xbe\xc6+o6r\xf8d\xd5G\xbc\x06,\x8f\x9b\xd7\ -\x8er\xc3\xf2!\xa4\xef"5\x18\xc9D8s\xae\x8a\r\xcb\x86\x00\xc1+o.\xe6\xf0\xc9\ -\xea\xcbjfs\x06B\xc0\x9d\xb7\x8e\xb0\xaec\x02\xd7\x97\x17\xe8\xce5\xbe\xd9w\ -\xf4\xb2\xa1c\x88\xb2\xaf\xf1\xf2\x9bm\x1c>y\xe1}\rC\x87\xbf\xfbz\x8er\xff\ -\x10\xaf}\xb7\x97\xaf\xfdK\x07=cQ\xbe\xf9t\x84Or5P,X\xf0\xbdJ\x83|\xca\x08\ -\x01\xa1\xe0\x07\xd3\xee\xba`;\x95\xed\xf6\xf9`\xdd\xaa2\xdf\x7fz\x8ag\xfez\ -\x00\xd7\x13\xfc\xe5\xbf.\xe0\x89\xaf\xc7yk\xef\'\xbbJ\xa0\x0f\x0e\x0e\xce\ -\xb3\xc5\n\x15>;\xae\xdb:\xc1\xd4P\x86c\x07\xf3<\xf2T\x80\xae\x136\xafm_\xc0\ -L\xf6\xe3/\xaf`v7\xbeB\x85/\x0c\xe1\xa0M4\x9a\xe7\xbe?\x85\x8dw\xda<\xffb\ -\xe8\x137\x07\x80>\x8f\xde*T\xf8\xccy\xf6?\x1a\t\x9auT\xc7|\x9e~N\xf2\xd2O\ -\x7f\xbb\xdb\x91\x02\xbeQ\xf9\rR\xa1\xc2E\xa8,\xb1*T\xb8\x04\x95\x06\xa9P\ -\xe1\x12\xfc/\xf2\x8e\x96s\xb76k\x01\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory005Bitmap(): - return wxBitmapFromImage(getDocFactory005Image()) - -def getDocFactory005Image(): - stream = cStringIO.StringIO(getDocFactory005Data()) - return wxImageFromStream(stream) - -index.append('DocFactory005') -catalog['DocFactory005'] = ImageClass() -catalog['DocFactory005'].getData = getDocFactory005Data -catalog['DocFactory005'].getImage = getDocFactory005Image -catalog['DocFactory005'].getBitmap = getDocFactory005Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory006Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rh\ -IDATx\x9c\xed\x9byp]\xd5}\xc7?\xe7\xdc\xed\xadz\x8b\x9eV[\x92-\xc9\x80A\xb6\ -\xf1nV\'\x86\x84\xda,esYZ\xe8t\xda\xc9t\n\xd3\x0em\xff\xc8\x9f\x99N\xa63\x9d\ -.L3\x19\xa0I\xcat\xda\xa1\xa44N\x02!LlH\x8c\r\x8e#o\x18\xaf2\xb6%Y\xcb\xd3.=\ -\xe9\xad\xf7\xbe{\xef\xe9\x1f\xa2\x06\x97`\xcb \x87\xba}\x9f?\xdf\x9cs\xbf\ -\xdf\xdf9\xbf\xdf\xdc\xf3\xce\xb9G\xfc\xcd\xb7\x94\xa2B\x85\n\xbf\x16=T\xfdE\ -[\xa8P\xe1\x7f/z\xb0R \x15*|*z8\xf1E[\xf8\xff\x81@a`#\xf1.\xf8\xdd\xc5\xc0\ -\xc5\xfc\xcdy\x106\xda\xff\xf0\xa0\x80\xb2\n\xe0\xa1]\x11]\x89\x8f)J\xf8H\ -\xca\xcaB!\xae\x88\xce\x95@\x0f\xc5\xbfh\x0b\xff\xf7\x11\xf84\x14v\x11u\xcf\ -\xe1\x7f,7\xa5\x04i\xea\xe4\xdd8\xb9`;3\xfa"\\\x02W\xc8\x83G\x93\xfd\x16U^\ -\xcf\x05\x1e\x00tKak5tk[(\x13\x9aW]\r\x87\xc5\xeeO\t\x94G\xd0\x0c\xc1\x98\\F\ -Z\xde<\xaf\x1aW\x12=\\)\x90+\x8e\xc5(M\xfas\x9c~\xbd\x96\xe9\xc1\x08 @J\xa4\ -\xae\x08\xd7\x14\x89\xd4\x17i[>\x89c-\xa2/\xf8\x978\xd4\xcd\xbb\x87 \xc34\ -\x15_\xe6\xe4\x8f\xe3L\xa7\x03 \x04\x08\t@\xac\xd1f\xd9\x83\xefP4\xea\x99\ -\xe0\xd6y\xd5\r1L\x83\xfdC\x8e\xfd0Ela\x89\x965\x87(\x04\xaf\xa7\xcc\xd5\x91\ -xz\xe4\xea\xf0yU\x13R\x82\x84\xb6\n\xe1\x17\x91\x9a"\x18\x17\x18\x01\x81BP\ -\xca\x07\x19=)\xc9\x8f6\xb3\xfc\x1e\x89i\xfc\x8a\xfe\xf0}\x17,C\x84\xef!\xdc\ -2\xc2\xf7PRC\xe9\x06J\xfe\xfa\xe5\x90p\x1d\xa4[\x06\xb8\xa0mH\xe9\x84\xc5\ -\xb5(\xb7\x80\xd48\xef\x01\x04\xa9\xc5&\xa1P\x07f\xb0\x89\x88\xfc\xe4s|\xddD\ -i:\xd2)\x82\x90\xf8\x865[`\x97\xd0\x14(\xe2~\x91p~)\x92\x12\xd9t\x8c\xeb\xa2\ -\x16u\xa1q2\xf2\xa3\xc4\x9bS|J}\xa4o\x06f5\xbd2\xben\xcdj\x95\xed\xd9ff\xe0\ -\x93}\x00\xdf\x0c^\xe0y\xae\xe8U\xe6\xc0ew\xaapyX\xca\x01c\x1d\x86\xfe\x0e\ -\xb1\x94\xcb\x8d\xbfw\x0bZ(\x08\xca\xa7\x9c\xb7\x198\xd4\xc3\xc8\xf14\xe7\ -\xf6\xa7\xb8\xee\xae(\x8eq\x86\x82\x08"\x94\x87\x99\xe9\xc6\xcct\xe3\x15J\ -\x08\xd4\xec\xcb\'\x10\xc0N-\xc5\xa9j\x86\x0f\x0bI\xf8e\xac\x99\x1e\x8c\xc9\ -\xb3(\xdb\x01\xd4\xec\x0b\xc2\x08P\xac\xbd\x11-\\\x8d\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\xb2\x04\xdc\ -\x97I\x1f\x0ebVy\xc4;\x04\x8e\xfa\x03\x940.k\xee\xf40{\xae@JT\xf88\x1aI\x04w\ -\xa23\x89\x10\x02\xa1B\x98\xfc\x12\x8fI\x94&\xf1\xbc\xdbX\xb0\xba\x83\x9e\ -\xed\xff\x82=6D,\x15#Q\x1eA\x14\x1a8\xfd\x83\xfd\x14\xc6F\t\xc4cH\xd3\xc4\ -\xc9O1\xbc;M1\xddF\xcbW\x97c\x98\'\xd0\x9d$\x9a\xddB\xd7\x8f\x7f@ql\x143\x1a\ -\xc1\x08\x87A8\xe4{\\\x1aWnB\xf3\x07\x10\xb4\xa03\x81g\x17\xb1\'\xa61\x82\ -\x16\xa6\xd0\xd0\x021J\xfa>\xf0r\x04\xdc6N\xbd\xfa\n\xf9\xe1a\x02\x898\xd2\ -\xb2\x18?p\x8e\xd1\xbd6\xbe[&T_Op\xc3\x9d\xe8v\x06y1\xcdUw\xa2\x14\x04\xab"T\ -\xd5J\xf2#}\x08)\t\xc7\x17\xa1\x07b\x18*\x8d?\xa7\xf8\x8e\xa3\xa4\x87i\xac\ -\xc6\x9f\xeeb\xf4\xec\x18S\xef\x87\x08V\'Y\xb8\xb6\x95\xaa\x9a\xa5\xe0\x841\ -\xfc\xa3\xe4?\xd0X\xb8\xa2\x85\x82w\x00Y\xf2\xd1\xb5\x0e\xca\xa3G\x89\xd7\ -\xd4\x11\xafj \xcf>.\xf7T\\\x0f\xb1\xeb\x8a$E\x85\x8f\x10,Bp/\xba\x18GH\x10"\ -H\x80\xf7P\xf4\x02 5\x9b`\xf5\x03\x04\xac!\xec\xf1\x83h\xac\xc4\x10\x1d\xf4\ -\xedy\x91\xf2\xd8A\x16\xde\xba\x95\xba\x9b\xb7\x80*\xe3\x16\x8b\x0c\xec\xf8g\ -\n\xbd;)\xa4\x97\x13i_\x00~\r\x03\xbb\xff\x13w\xe2}Z\xeex\x8cD\xc7:d\xc0G\ -\xd3\xe2xN\x11\xa5Ob\xea\x9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\xadB\x85/\x9c\xe7\xff\xb5\x91\xa0YGu\xcc\xe7\xd9\x17$\xaf\ -\xfcd~nG\n\xf8F\xe5?H\x85\n\x9fBe\x89U\xa1\xc2E\xa8\x14H\x85\n\x17\xe1\xbf\ -\x00\xd7"\x96s\xaa\x0e\x1d/\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory006Bitmap(): - return wxBitmapFromImage(getDocFactory006Image()) - -def getDocFactory006Image(): - stream = cStringIO.StringIO(getDocFactory006Data()) - return wxImageFromStream(stream) - -index.append('DocFactory006') -catalog['DocFactory006'] = ImageClass() -catalog['DocFactory006'].getData = getDocFactory006Data -catalog['DocFactory006'].getImage = getDocFactory006Image -catalog['DocFactory006'].getBitmap = getDocFactory006Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory007Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rf\ -IDATx\x9c\xed\x9bil\x9c\xc7y\xc7\x7f3\xef\xb5\'\xf7\xe0\xf2\x94HJ$e[6%Y\xb7|\ -*\x91\x9d\xb8\x92\x8f\xfaR}\xb4vQ\xb4\x08\x8a\xdah\xe1\xb6\x1f\xf21(\x82\x02\ -E\x0f\xa3A`\xe7\xaaQ\xb4p\x9d\xbaQ\x12;\x8e\x11\xc9Nd\xc9V\x14\xea\xb2\xac\ -\x8b\x94%\x91\x14\x8f\xe5M.\xb9\xe7\xfb\xee\xfb\xbe\xd3\x0fte\xab\x8e%U\xa2\ -\xe2*\xd8\xdf\xc7\xc5\xcc\xfc\xff\xcf\xcc\xf3`ggv\xc4\xdf}C)*T\xa8\xf0k\xd1C\ -\xd5\x9f\xb7\x85\n\x15\xfe\xff\xa2\x07+\x05R\xa1\xc2g\xa2\x87\x13\x9f\xb7\ -\x85\xdfn\x04\n\x03\x1b\x89w\xde\x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b3\xbec\x8a\xb2\xaf\xf1\xfa;\x8d\x1c\xee\xaa\ -\xfa\x94\xd7\x80\xe5q\xfb\xda1nY>\x8c\xf4]\xa4\x06\xa3\x99\x08\xa7\xcfV\xb1a\ -\xd90 x\xfd\x9d\xc5\x1c\xee\xaa\xbe\xa8f6g \x04\xdc{\xe7(\xeb:&q}y\x9e\xee\ -\xa5\xc677F\x1f\x1b:\x86)\xfb\x1a\xaf\xbd\xd3\xc6\xe1\xae\xf3\xdfg\x18:\xfc\ -\xcdWs\x94\x07\x86y\xf3;}|\xe5\x9f:\xe8\x1d\x8f\xf2\xf5\xe7#\xcc\xc7S@\xb1`\ -\xc1w+\x05r\x95\x11\x02B\xc1\x8f\xa7\xd9u\xc1v*\xc7\xeb\xf3\xc1\xbaUe\xbe\ -\xf7\xfc4/\xfc\xe5 \xae\'\xf8\xf3\x7f^\xc03_\x8d\xf3\xee\xde\xf9yJ\xa0\x0f\r\ -\r\xcd\xcb@\x15*|\x1e\xdc\xb4u\x92\xe9\xe1\x0c\xc7\x0e\xe6y\xe2\xb9\x00\xdd\ -\'l\xde\xdc\xbe\x80\xd9\xec\x95o\xaf`\xeet\xbeB\x85k\x96p\xd0&\x1a\xcd\xf3\ -\xd0\x1f\xc3\xc6{m^z%4o\xc5\x01\xa0\xcf\xdbH\x15*|\x0e\xbc\xf8o\x8d\x04\xcd:\ -\xaac>\xcf\x7fK\xf2\xeaO\xe6\xf7u\xa4\x80\xafU~\x83T\xa8\xf0\x19T\xb6X\x15*\ -\\\x80J\x81T\xa8p\x01\xfe\x1b\xbb\xb6\x96s\xa2\x04\x9a\xd7\x00\x00\x00\x00IE\ -ND\xaeB`\x82' - -def getDocFactory007Bitmap(): - return wxBitmapFromImage(getDocFactory007Image()) - -def getDocFactory007Image(): - stream = cStringIO.StringIO(getDocFactory007Data()) - return wxImageFromStream(stream) - -index.append('DocFactory007') -catalog['DocFactory007'] = ImageClass() -catalog['DocFactory007'].getData = getDocFactory007Data -catalog['DocFactory007'].getImage = getDocFactory007Image -catalog['DocFactory007'].getBitmap = getDocFactory007Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory008Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rc\ -IDATx\x9c\xed\x9bil]\xc7y\x86\x9f\x99\xb3\xdd\x95w\xe1\xe5*\x91\x94H\xca\xb6\ -lJ\xb2vyU";q%/\xf5\xa6zi\xed\xa2h\x11\x14\xb5\xd1\xc2m\x7f\xe4gP\x04\x05\x8a\ -.F\x83\xc0v\x93\xd4(Z\xb8N\x9c(\x89\x1d\xc7\x88d\'\xb2d+\n\xb5Y\xd6F\xca\x92\ -H\x8a\xcb\xe5N^\xf2\xae\xe7\xdcs\xce\xf4\x07]\xc9\xaccK\xa8\xe8-\xb8\xcf\xcf\ -\x8b9\xdf\xfb~3\xf3\xe1\xcc\x9d9#\xfe\xe1[JQ\xa1B\x85\xdf\x8a\x1e\xaa\xfe\ -\xac-T\xa8\xf0\xf9E\x0fV\n\xa4B\x85\x8fD\x0f\'>k\x0b\xbf\x9b\x08\x14\x066\ -\x12o\xde\xef.\x06.\xe6\xa7\xe7A\xd8h\xff\xc7\x83\x02\xca*\x80\x87\xf6\x89\ -\xe8J|LQ\xc2GRV\x16\n\xf1\x89\xe8|\x1a\xe8\xa1\xf8gm\xe1w\x0f\x81OCa\x0fQ\ -\xf7<\xfe\x07\xe6\xa6\x94 M\x9d\xbc\x1b\'\x17lgV_\x82K\xe0\x13\xf2\xe0\xd1d\ -\xbfA\x95\xd7;\xcf\x03\x80n)l\xad\x86\x1em\x1beB\x0b\xaa\xab\xe1\xb0\xd4\xfd\ -9\x81\xf2(\x9a!\x18\x97+H\xcb\x1b\x17T\xe3\xd3D\x0fW\nd\xc1\xb1\x18\xa3I\x7f\ -\x863\xaf\xd623\x14\x01\x04H\x89\xd4\x15\xe1\x9a"\x91\xfa"m+\xa7p\xac%\xf4\ -\x07\xff\x16\x87\xba\x05\xf7\x10d\x84\xa6\xe2\x8bt\xfd4\xceL:\x00B\x80\x90\ -\x00\xc4\x1amV\xdc\xff\x16E\xa3\x9eIn^P\xdd\x10#4\xd8?\xe6\xc4\x8fS\xc4\x16\ -\x97hYw\x84B\xf0Z\xca|1\'\x9a\x1e\xf9b\xfa\xfe\\\x13R\x82\x84\xb6\x06\xe1\ -\x17\x91\x9a"\x18\x17\x18\x01\x81BP\xca\x07\x19\xeb\x92\xe4\xc7\x9aYy\x97\ -\xc44~\xc3@\xf8\x9ey\xcb\x10\xe1{\x08\xb7\x8c\xf0=\x94\xd4P\xba\x81\x92\xbf}\ -9$\\\x07\xe9\x96\x01\xe6\xb5\r)\x9d\xb0\xb8\x1a\xe5\x16\x90\x1a\x17<\x80 \ -\xb5\xd4$\x14\xea\xc0\x0c6\x11\x91\x1f\x8e\xe3\xeb&J\xd3\x91N\x11\x84\xc47\ -\xac\xb9\x02\xbb\x84\xa6@\x11\xf7\x8b\x84\xf3\xcb\x91\x94\xc8\xa6c\\\x13\xb5\ -\xa8\x0bM\x90\x91\x17\'\xdae\xe5\xa7\xd4E}30\xa7\xe9\x95\xf1ukN\xabl\xcf53\ -\x03\x1f~\x06\xf0\xcd\xe0<\xcf\xff_\xf4*s\xf0\x8a\x83T\x98\x8f\xa5\x1c06`\ -\xe8o\x11K\xb9\\\xffG7\xa1\x85\x82\xa0|\xcay\x9b\xc1#\xbd\x8c\x9eLs\xfe`\x8a\ -k\xee\x88\xe2\x18g)\x88 By\x98\x99\x1e\xccL\x0f^\xa1\x84@\xcd\xbd|\x02\x01\ -\xec\xd4r\x9c\xaafx\xbf\x90\x84_\xc6\x9a\xed\xc5\x98:\x87\xb2\x1d@\xcd\xbd \ -\x8c\x00\xc5\xda\xeb\xd1\xc2\xd5\xc8\xc0MX\xd6n\xb4\x94\xcb\xf5\x8fm\xc6\x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e\xf6/\x1d\xf4\x8eG\xf9\xe6\xd3\ -\x11\x16\xf2\n\xa0X\xb4\xe8\xbb\x95\x02\xf9\x84\x10\x02B\xc1\x8b\xdd\xeb\xba\ -`;\x95m\xf5\x85`\xc3\x9a2\xdf{z\x9ag\xfez\x10\xd7\x13\xfc\xe5\xbf.\xe2\x89\ -\xaf\xc7yk\xff\xc2^%\xd0\x87\x86\x86\x164`\x85\n\x9f\x06\xd7m\x9fdz8\xc3\x89\ -\xc3y\x1ey*@\xf7)\x9b\xd7v.b6\xbbp\xcb+\x98\xdb\xa5\xafP\xe1\x0bG8h\x13\x8d\ -\xe6\xb9\xefOa\xf3\x9d6\xcf\xbf\x18Z\xf0\xe2\x00\xd0\x17\x86J\x81T\xa8\xf01\xfc\x0f\xa0J\x96s@\xaf\xd7\x90\x00\x00\x00\ -\x00IEND\xaeB`\x82' - -def getDocFactory008Bitmap(): - return wxBitmapFromImage(getDocFactory008Image()) - -def getDocFactory008Image(): - stream = cStringIO.StringIO(getDocFactory008Data()) - return wxImageFromStream(stream) - -index.append('DocFactory008') -catalog['DocFactory008'] = ImageClass() -catalog['DocFactory008'].getData = getDocFactory008Data -catalog['DocFactory008'].getImage = getDocFactory008Image -catalog['DocFactory008'].getBitmap = getDocFactory008Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory009Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\r]\ -IDATx\x9c\xed\x9by\x8c]\xd5}\xc7?\xe7\xdc\xed\xad\xf3\x96y\xb3\xda3c\xcf\x8c\ -\x01\xc3\xd8\xc6\xbbY\x9d\x18\x12j\xb3\x94\xcdei\xa1\xaaZEUA\xadh\xfbG\xfe\ -\x8c\xaa\xa8R\xd5\x055\x8a [Q\xd5\x8a\x92\xd28\t\x84\xa0\xd8\x90\x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"\xdd\xcb\xcdo!\xc6\x00\x9b\xbaF)\xfb\x1a/\xbd\xd1\xc1\x91S\x17\ -\xdf\xc70t\xf8\xbb\xaf\xe6(\x0f\x8d\xf2\xeaw\x06\xf8\xca\xbft\xd1?\x19\xe5\ -\xebOG\xb8\x12W\xff\xc4\xa2E\xdf\xad\x16H\x85\x11\x02B\xc1\xf7\xbb\xd5u\xc1v\ -\xaa\xdb\xe9\x95`\xc3\x9a2\xdf{z\x96g\xfez\x18\xd7\x13\xfc\xe5\xbf.\xe2\x89\ -\xaf\xc6ys\xff\x95\xb9J\xa0\x8f\x8c\x8c\\\x91\xc0U\xaa\\\t\xae\xdb>\xcd\xech\ -\x86\xe3\x87\xf2<\xf2T\x80\xde\x936\xaf\xee\\\xc4|\xb6\xf2\xcb+X\xd8\xad\xaf\ -R\xe53C8h\x13\x8d\xe6\xb9\xefOa\xf3\x9d6\xcf\xbd\x10\xbab\xc5\x01\xa0_\xb1\ -\xc8U\xaa\\\x01\x9e\xfd\x8ff\x82f\x03\xb51\x9f\xa7\xbf%y\xf1\'W\xe6v\xe4\xaf\ -\x11\xf0\xb5\xea\x7f\x90*U>\x82\xea\x12\xabJ\x95\x8f\xa1Z U\xaa|\x0c\xff\x0b\ -\x84\xde\x96s_\x12\xdfl\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory009Bitmap(): - return wxBitmapFromImage(getDocFactory009Image()) - -def getDocFactory009Image(): - stream = cStringIO.StringIO(getDocFactory009Data()) - return wxImageFromStream(stream) - -index.append('DocFactory009') -catalog['DocFactory009'] = ImageClass() -catalog['DocFactory009'].getData = getDocFactory009Data -catalog['DocFactory009'].getImage = getDocFactory009Image -catalog['DocFactory009'].getBitmap = getDocFactory009Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory010Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBI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\x80\xe2\xf8\x18f4\x82\x11\ -\x0e\x83p\xc8\xf7\xba4\xae\xde\x82\xe6\x0f"hAg\x12\xcf.bO\xce`\x04-L\xa1\xa1\ -\x05b\x94\xf4\x03\xe0\xe5\x08\xb8m\x9c~\xf5\x15\xf2##\x04\x12q\xa4e1q\xf0\x90\t4\xa1\x833\r\xa5$\x9e\tZ\t\ -\xf4"X\xa1\x04\xba\x15E\x1a\x1aV0\x85\xe6\xba(\xd9J\xa6\xf3_\x08\x05\xea\xa9\ -[\xbf\x1d\xdd\xf9)\xa2t\x14\xdfz\x92\x9a\x95\xf7Q<\xd9\x85\xee\xe8\x08\x95\ -\x00/pi\xcd\xdc,\xe8\x19<\xeb\x1b\x98*\x82T\x02M\xafB\xb3_\xc13\x9e\xbc,\x7f\ -U-\xdb\xd1\n{\xf1\xac\x18\x9a\xad\x11\n/&\xd6\xba\x05\xdd\xf9\x0e8G!\xeb\xa1\ -\xf4\x12U\xcb\xb6\x12\xb0\xded\xaa\xf3 M\xdb\xff\x14\xcf\xcf\x93=\xf2\x12\ -\x89\xa6\xd5\x98\xc9\xa5\xc8\xfc.\xc8\x02\xf3|\x06\xa3\xb3{\xe9\xbc\x06\xbc*\ -\x89\xd5\xc2\xc6Q\xc4H\x10$`\x8f\xc2\x81Z\x98Q`X\xa8\r\x1b(\xf5\xbf\x87:\x15\ -\xc2joE\xceL\xe2\x89\x14\xde\x19\x81\x1ek\x84B\x00yp\x08\nA\xb4\xc64V\xc3mh#\ -\x8d0\x1eC\x15\x12\xa8b\x11\xf7\x030\x12\xf5\xf8\xb3\x06\xfa\xe1I(||\xab\xb8\ -\x1ab5\xb0.\x8d\x18\t`9\xed\xb4n\xff\x0b\xb4h\x04|\x1f\x7fb\x08y\xf4,N\xf3"\ -\x9c\x13%\x8cd#\xa2\x9c@\x1c\x98\x81\\\x10\xd92\x88Q\x7f\x13\xdap=\xc2K\x82\ -\x97@\xe5\xd4\xa55\xffWw\xfd\x10r$\x80\x90\x02Ji\x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81\xc8\x85\xb6R*V^;\ -\xc5\xe6\xb5C\xa4\xe2\x05\xcae\x89\x92:\xef\x7fP\xcd\xee\xceFry\x83\xbbo\x1f\ -fc\xc7\x14e_\xe3\xb5\xb7\x1b9r\xaa\xea\x13\xb9\x06,\x8f[\xd7\x8fq\xd3\xcaa\ -\xa4\xef"5\x18\xcdD8{\xbe\x8aM+\x86\x01\xc1ko/\xe5\xc8\xa9\xeaKjfs\x06B\xc0\ -\xdd\xb7\x8f\xb2\xa1c\x12\xd7\x97\x17\xe9^\xae\xbf\xb9\x18}l\xea\x18\xa6\xec\ -k\xbc\xfav\x1bGN]|\x0f\xc3\xd0\xe1o\xbe\x9e\xa3<0\xcc\x1b\xdf\xe9\xe3k\xff\ -\xd4A\xefx\x94o>\x1ba!\xaf\xfc\x89E\x8b\xbe[)\x90yB\x08\x08\x05?\xeaN\xd7\ -\x05\xdb\xa9l\xa3\xcf\x07\x1b\xd6\x94\xf9\xde\xb3\xd3<\xf7\x97\x83\xb8\x9e\ -\xe0\xcf\xffy\x11O}=\xce;\xfb\x17\xf6*\x81>44\xb4\xa0\x02\x15*\xcc\x077l\x9f\ -dz8\xc3\xf1Cy\x1e{&@\xf7I\x9b7v.b6\xbbp\xcb+\x98\xdb\xb5\xafP\xe1\xb7\x9ep\ -\xd0&\x1a\xcd\xf3\xc0\x1f\xc3\xe6\xbbm^|9\xb4\xe0\xc5\x01\xa0/\xb8B\x85\n\ -\xf3\xc0\xf3\xff\xdeH\xd0\xac\xa3:\xe6\xf3\xec\x0b\x92W~\xb20\xb7#\x7f\x1d\ -\x01\xdf\xa8\xfc\x07\xa9P\xe1S\xa8,\xb1*T\xf8\x0c*\x05R\xa1\xc2g\xf0?ir\x96s\ -C-\x0e\xd3\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory010Bitmap(): - return wxBitmapFromImage(getDocFactory010Image()) - -def getDocFactory010Image(): - stream = cStringIO.StringIO(getDocFactory010Data()) - return wxImageFromStream(stream) - -index.append('DocFactory010') -catalog['DocFactory010'] = ImageClass() -catalog['DocFactory010'].getData = getDocFactory010Data -catalog['DocFactory010'].getImage = getDocFactory010Image -catalog['DocFactory010'].getBitmap = getDocFactory010Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory011Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\r`\ -IDATx\x9c\xed\x9by\x8c]\xd5}\xc7?\xe7\xdc\xed\xad\xf3\x96y\xb3\xda3c\xcf\x8c\ -\x01\xc3\xd8\xc6\xbbY\x9d\x18\x12j\xb3\x94\xcdei\xa1\xaaZEUA\xadh\xfbG\xfe\ -\x8c\xaa\xa8R\xd5\x055\x8a\x80&)\xaaZQR\x1a\'\x81\x10\x14\x1b\x12c\x83\xe3\ -\x8c7\x8c\xd71\xb6g\xc6\xb3\xbc\xd9g\xde\xcc[\xef}\xf7\xde\xd3?\x86\x02.\x01\ -[\xd4\xcf\x10\xe7}\xfe|:\xf7\xf7\xfd}\xcf9?\xdd\xf3\xce\xb9G\xfc\xdd\xb7\x94\ -\xa2J\x95*\xbf\x16=T\xfby\xa7P\xa5\xca\x17\x17=X-\x90*U>\x11=\x9c\xf8\xbcS\ -\xf8\xcdF\xa00\xb0\x91x\xe7\xfd\xeeb\xe0b^\xbe\x1c\x84\x8d\xf6\x7frP@Y\x05\ -\xf0\xd0*\xa2+\xf11E\t\x1fIYY(DEt>O\xf4P\xfc\xf3N\xe17\x17\x81OSa\x17Q\xf7\ -\x1c\xfeG\xe6\xa6\x94 M\x9d\xbc\x1b\'\x17\xecdN_\x84K\xa0B9x\xb4\xd8oP\xe3\ -\xf5\x9d\x97\x03\x80n)l\xad\x8e^m\x0beB\x97TW\xc3a\xb1\xfbS\x02\xe514C0!\x97\ -\x91\x967^R\x8d/\x02z\xb8Z \x9f\x19\x8b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d\xf9I\ -\x08\xf8F\xf5?H\x95*\x9f@u\x89U\xa5\xca\xa7P-\x90*U>\x85\xff\x01N\x06\x96s\ -\x10h\xbf\xfe\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory011Bitmap(): - return wxBitmapFromImage(getDocFactory011Image()) - -def getDocFactory011Image(): - stream = cStringIO.StringIO(getDocFactory011Data()) - return wxImageFromStream(stream) - -index.append('DocFactory011') -catalog['DocFactory011'] = ImageClass() -catalog['DocFactory011'].getData = getDocFactory011Data -catalog['DocFactory011'].getImage = getDocFactory011Image -catalog['DocFactory011'].getBitmap = getDocFactory011Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory012Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\r]\ -IDATx\x9c\xed\x9bip]\xd5}\xc0\x7f\xe7\xdc\xed\xadz\x8b\x9eV[\x92-\xc9\x80A\ -\xb6\xf1nV\'\x86\x84\xda,esYZ\xe8t\xda\xc9t\n\xd3\x0em?\xe4c\xa6\x93\xe9L\ -\xa7\x0b\xd3L\x06\xc8R\xa6\xd3\x0e%\xa5q\x12\x08abCblp\x1cy\xc3x\x95\xb1-\ -\xc9Z\x9ev\xe9Io\xbd\xf7\xdd{O?\x88\x18\\\x02\x16\x1d$\x88\xe7\xfd>\xbe9\xf7\ -\xfe\xfe\xffs\xce\x7f\xdey\xe7\xbc#\xfe\xe1[JQ\xa1B\x85\xdf\x8a\x1e\xaa\xfe\ -\xbcC\xa8P\xe1\x8b\x8b\x1e\xac\x14H\x85\n\x1f\x8b\x1eN|\xde!\xfcn"P\x18\xd8H\ -\xbcK>w1p1\x17.\x06a\xa3\xfd\x9f\x18\x14PV\x01<\xb4y\xf1J|LQ\xc2GRV\x16\n1/\ -\x9e/\x02z(\xfey\x87\xf0\xbb\x87\x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!\xaf\xf8\x89E\x8b\xbeW)\x90\xff\'B@(\xf8A\xf7\xb9.\xd8Ne\xdb\xfc\xb3\ -`\xc3\x9a2\xdf\x7fz\x8ag\xfez\x00\xd7\x13\xfc\xe5\xbf.\xe2\x89\xaf\xc7yk\xff\ -\xc2\\%\xf8\r\xfa\xe0\xe0\xe0\x82\n+T\x98\x0b\xd7m\x9f`j(\xc3\x89\xc3y\x1ey*\ -@\xd7)\x9b\xd7v.b&\xbbp\xcb+\x98\xdd\xc5\xafP\xe1\x0bG8h\x13\x8d\xe6\xb9\xef\ -Oa\xf3\x9d6\xcf\xbf\x18Z\xf0\xe2\x00\xd0\x17\xdcX\xa1\xc2\x1cx\xf6?\x1a\t\ -\x9auT\xc7|\x9e~N\xf2\xd2O\xe7\xe7v\xe4\xe5\x10\xf0\x8d\xcao\x90\n\x15>\x86\ -\xca\x12\xabB\x85O\xa0R \x15*|\x02\xff\x0b2\x9a\x96s\xa7\x89\xfa\x81\x00\x00\ -\x00\x00IEND\xaeB`\x82' - -def getDocFactory012Bitmap(): - return wxBitmapFromImage(getDocFactory012Image()) - -def getDocFactory012Image(): - stream = cStringIO.StringIO(getDocFactory012Data()) - return wxImageFromStream(stream) - -index.append('DocFactory012') -catalog['DocFactory012'] = ImageClass() -catalog['DocFactory012'].getData = getDocFactory012Data -catalog['DocFactory012'].getImage = getDocFactory012Image -catalog['DocFactory012'].getBitmap = getDocFactory012Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory013Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\r]\ -IDATx\x9c\xed\x9bil\\\xc7}\xc0\x7f3\xef\xda\x93{pyJ$%\x92\xb2-\x9b\x92\xac[>\ -\x95\xc8N\\\xc9G}\xa9>Z\xbb(Z\x04Em\xb4p\xdb\x0f\xf9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\xfc\x0e\xc8\x02\xf3t\x06\xa3\xb3s\xf1\xbc\x88\xae\nb\xb5\xb0~\x041\ -\x1c\x04\t\xd8#\xb0\xaf\x16\xa6\x15\x18\x16j\xdd:J}\xef\xa1N\x86\xb0\xda[\ -\x91\xd3\x13x"\x85wZ\xa0\xc7\x1a\xa1\x10@\x1e\x18\x84B\x10\xad1\x8d\xd5p\x1b\ -\xdap#\x8c\xc5P\x85\x04\xaaX\xc4\xfd\x00\x8cD=\xfe\x8c\x81~h\x02\n\x1f\xdf*\ -\xae\x86X\r\xacI#\x86\x03XN;\xad[\xff\n-\x1a\x01\xdf\xc7\x1f\x1fD\x1e9\x83\ -\xd3\xbc\x00\xe7x\t#\xd9\x88(\'\x10\xfb\xa6!\x17D\xb6\x0c`\xd4\xdf\x846T\x8f\ -\xf0\x92\xe0%P9uq\xe7\xffy\xd7\x0e"\x87\x03\x08)\xa0\x94\x86\xae$\xfeb9\xa7\ -\xfc\xc8\'\xe0H\x13\xac\x8b\xc3plv\x89\xea\xa7\xa03\x02\x99f\x00D\xa0\x8c\ -\xbc9J$~3\xd9\xdd\xefa\xdfT\xc0N\xa7)\x1fu\xa9\xbf\xed^\x18\xce\xc3\xbe\x00\ -\xf8\xf37g\xf5\xc1\xe7\x9e\x9c7\xd9\x95\x8e\xd1*Ht\x8cS8\xb9\x08\x89\x86\x9f\ -\x9fdz\xeff\x90\ns\xb5\x8f\x9eu\x19\xfc\xee\x10\x85S\xb7P\xf3@#\xc5\xc36\xe6\ -\x8a<\xaa\xb4\x81\xec\xe9\x0c^v\n\'\xf48\xf6\xfb.\xa1%\x163\x9d\xfdL\xef\xea\ - \xd8\xd0\x80?5\x85\x08\x01\xe5[\xc9\xec\x1a\xc1yt\x84\x92\xfa\x03\xec].z\ -\x93\x8eq\x8d\x86}\xa8\x8c\x97.\x92X::\x1b\x83\xd0@\x14\xc8\xfc\xb3\xc0\xed\ -\x17\xb8\x835h\r\r$\xff\xbe\x84\x97YK\xa1+Gyb\x18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\xfb\x02f\xb2\xf3\xbf\xbc\x82\xd9\xdd\ -\xfc\n\x15\xbe4\x84\x836\xd1h\x9e\x07\xfe\x146\xdem\xf3\xe2\xcb\xa1\xcbV\x1c\ -\x00\xfae3W\xa8\xf0)<\xff\x1f\x8d\x04\xcd:\xaac>\xcf\xbe y\xe5\xe7_\xcc\xed\ -\xc8\xb9"\xe0[\x95\xdf \x15*|\x06\x95%V\x85\n\x9fC\xa5@*T\xf8\x1c\xfe\x17\ -\x17.\x96sS\xb0\xcaT\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory013Bitmap(): - return wxBitmapFromImage(getDocFactory013Image()) - -def getDocFactory013Image(): - stream = cStringIO.StringIO(getDocFactory013Data()) - return wxImageFromStream(stream) - -index.append('DocFactory013') -catalog['DocFactory013'] = ImageClass() -catalog['DocFactory013'].getData = getDocFactory013Data -catalog['DocFactory013'].getImage = getDocFactory013Image -catalog['DocFactory013'].getBitmap = getDocFactory013Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory014Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\r`\ -IDATx\x9c\xed\x9bip]\xd5}\xc0\x7f\xe7\xdc\xed\xadz\x8b\x9eV[\x92-\xc9\x80A\ -\xb6\xf1nV\'\x86\x84\xda,esYZ\xe8t\xda\xc9t\n\xd3\x0em?\xe4c\xa6\x93\xe9L\ -\xa7\x0b\xd3L\x06\xd2$e:\xedPR\x1a\'\x81\x10&6$\xc6\x06\xc7\x917\x8cW\x19\ -\xdb\x92\xac\xe5i\x97\x9e\xf4\xd6{\xdf\xbd\xf7\xf4\x83(\xe0\x12\x90\xda\x82\ -\x84\x87\xf7\xfb\xf8\xe6\xdc\xf7\xfb\xff\xcf9\xff\xb9\xe7\x9d\xf3\x8e\xf8\ -\x9bo)E\x85\n\x15~#z\xa8z\xb1C\xa8P\xe1\xf3\x8b\x1e\xac\x14H\x85\n\x1f\x8b\ -\x1eN,v\x08W\x06\x02\x85\x81\x8d\xc4\xbb\xecs\x17\x03\x17s\xe1b\x106\xda\xff\ -\x88A\x01e\x15\xc0C\xfbL\xbc\x12\x1fS\x94\xf0\x91\x94\x95\x85B|&\x9e\xcf#z(\ -\xbe\xd8!|\xfe\x11\xf84\x14\xf6\x11u/\xe1\x7fhnJ\t\xd2\xd4\xc9\xbbqr\xc1vf\ -\xf4e\xb8\x04>\xa3\x18<\x9a\xec\xd7\xa9\xf2z.\x8b\x01@\xb7\x14\xb6VC\xb7\xb6\ -\x832\xa1O\xd5\xab\xe1\xb0\xdc\xfd\x19\x81\xf2\x08\x9a!\x18\x93\xabH\xcb\x1b\ -?U\xc7\xe7\x19=\\)\x909\xb1\x18\xa5I\x7f\x86\xf3\xaf\xd42=\x18\x01\x04H\x89\ -\xd4\x15\xe1\x9a"\x91\xfa"m\xab\'q\xace\xf4\x05\xff\x12\x87\xbaO=\x86 \xc34\ -\x15_\xe0\xecO\xe2L\xa7\x03 \x04\x08\t@\xac\xd1f\xd5\xfdoR4\xea\x99\xe0\xe6O\ -\xd5\x1bb\x98\x06\xfbG\x9c\xfaQ\x8a\xd8\xd2\x12-\x1b\x8eQ\x08^K\x99/\xc6\xc4\ -\xd1#_\x8c<\xff_\x84\x94 \xa1\xadC\xf8E\xa4\xa6\x08\xc6\x05F@\xa0\x10\x94\ -\xf2AF\xcfJ\xf2\xa3\xcd\xac\xbeKb\x1a\xbf\xa6?|\xcfe\xcb\x10\xe1{\x08\xb7\ -\x8c\xf0=\x94\xd4P\xba\x81\x92\xbfy9$\\\x07\xe9\x96\x01.k\x1bR:aq5\xca- 5\ -\xde\x8f\x01\x04\xa9\xe5&\xa1P\x07f\xb0\x89\x88\xfc\xe8\xf7\xf8\xba\x89\xd2t\ -\xa4S\x04!\xf1\rk\xb6\xc0\xe6p\n\x14q\xbfH8\xb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xfb\x1d\xbdl\xe9\x18\xa2\xeck\xbc\xf4F\x1b\ -\xc7\xcf^~\xcf\xc2\xd0\xe1\xaf\xbe\x9e\xa3\xdc?\xc4\xab\xdf\xed\xe5k\xff\xd0\ -A\xcfX\x94o>\x1da1\xaf\xf4\x89%K\xbeW)\x90y"\x04\x84\x82\x1ft\x97\xeb\x82\ -\xedT\xb6\xc9?\r6\xad+\xf3\xfd\xa7\xa7x\xe6\xcf\x07p=\xc1\x9f\xfe\xe3\x12\ -\x9e\xf8z\x9c7\x0f.\xccU\x82\x8fC\x1f\x1c\x1c\\\xd4\x00*T\x00\xb8n\xe7\x04SC\ -\x19N\x1d\xcd\xf3\xc8S\x01\xba\xce\xd8\xbc\xba{\t3\xd9\xc5[^\xc1\xec\xae~\ -\x85\n\x8bN8h\x13\x8d\xe6\xb9\xef\x0fa\xeb\x9d6\xcf\xbd\x10Z\xf4\xe2\x00\xd0\ -\x17;\x80\n\x15\x00\x9e\xfd\xd7F\x82f\x1d\xd51\x9f\xa7\xbf#y\xf1\xa7\x9f\xcd\ -\xed\xc8\xff-\x02\xbeQ\xf9\rR\xa1\xc2\xc7\xb0\xf8\xef\xb0\n\x15>\xc7T\n\xa4B\ -\x85O\xe0\xbf\x00\xfb\xb3\x96s\xe4!\xad\xbd\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory014Bitmap(): - return wxBitmapFromImage(getDocFactory014Image()) - -def getDocFactory014Image(): - stream = cStringIO.StringIO(getDocFactory014Data()) - return wxImageFromStream(stream) - -index.append('DocFactory014') -catalog['DocFactory014'] = ImageClass() -catalog['DocFactory014'].getData = getDocFactory014Data -catalog['DocFactory014'].getImage = getDocFactory014Image -catalog['DocFactory014'].getBitmap = getDocFactory014Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory015Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\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3\ -O\xe7t\xe4\xff\x17\x01\xdf\xa8\xfe\x06\xa9R\xe52,\x9cwY\x95*\x0b\x90\xea\x00\ -\xa9R\xe5c\xf8o\xe0G\x96s<\x06!\xc2\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory015Bitmap(): - return wxBitmapFromImage(getDocFactory015Image()) - -def getDocFactory015Image(): - stream = cStringIO.StringIO(getDocFactory015Data()) - return wxImageFromStream(stream) - -index.append('DocFactory015') -catalog['DocFactory015'] = ImageClass() -catalog['DocFactory015'].getData = getDocFactory015Data -catalog['DocFactory015'].getImage = getDocFactory015Image -catalog['DocFactory015'].getBitmap = getDocFactory015Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory016Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rf\ -IDATx\x9c\xed\x9by\x8c]\xd5}\xc7?\xe7\xdc\xed\xad\xf3\x96y\xb3\xda3c\xcf\x8c\ -\x01\xc3\xd8\xc6\xbbY\x9d\x18\x12j\xb3\x94\xcdei\xa1\xaaZEUA\xadh\xfbG\xfe\ -\x8c\xaa\xa8R\xd5\x055\x8a\x80,EU+JJ\xe3$\x10\x82bCblp\x9c\xf1\x86\xf16cl\ -\xcf\x8cgy\xb3\xcf\xbc\x99\xb7\xde\xfb\xee\xbd\xa7\x7f\x0c58\x04\x16=\x9c\xa8\xb4\x85\x85\ -\x89@a`#\xf1.\xfb\xdd\xc5\xc0\xc5\xfc\xfc<\x08\x1b\xed7<(\xa0\xac\x02xh\x9f\ -\x89\xae\xc4\xc7\x14%|$ee\xa1\x10\x9f\x89\xce\xef\x02z(^i\x0b\x0b\x0f\x81OCa\ -\x1fQ\xf7"\xfe\x87\xc6\xa6\x94 M\x9d\xbc\x1b\'\x17lgV_\x86K\xe03\xf2\xe0\xd1\ -d\xbfA\x95\xd7{\x99\x07\x00\xddR\xd8Z\r=\xda\x0e\xca\x84>U]\r\x87\xe5\xee\ -\xcf\x08\x94G\xd1\x0c\xc1\xb8\\EZ\xde\xf8\xa9j\xfc.\xa1\x87\x17\x0b\xe4#X\ -\x8c\xd1\xa4?\xc3\xb9Wk\x99\x19\x8a\x00\x02\xa4D\xea\x8apM\x91H}\x91\xb6\xd5\ -S8\xd62\xfa\x83\x7f\x8bC\xdd\xa7\xee!\xc8\x08M\xc5\x17\xe9\xfaI\x9c\x99t\x00\ -\x84\x00!\x01\x885\xda\xac\xba\xff-\x8aF=\x93\xdc\xfc\xa9\xea\x86\x18\xa1\ -\xc1\xfe\x11\xa7~\x94"\xb6\xb4D\xcb\x86c\x14\x82\xd7R\xe6\x8b9P\xf4\xc8\x173\ -\xf7\'\x12R\x82\x84\xb6\x0e\xe1\x17\x91\x9a"\x18\x17\x18\x01\x81BP\xca\x07\ -\x19\xeb\x92\xe4\xc7\x9aY}\x97\xc44~\xcd@\xf8\x9e\xcb\x96!\xc2\xf7\x10n\x19\ -\xe1{(\xa9\xa1t\x03%\x7f\xfbrH\xb8\x0e\xd2-\x03\\\xd66\xa4t\xc2\xe2j\x94[@j\ -\\\xf2\x00\x82\xd4r\x93P\xa8\x033\xd8DD~\xf4\x7f|\xddDi:\xd2)\x82\x90\xf8\ -\x865W`W\xd0\x14(\xe2~\x91p~%\x92\x12\xd9t\x8ck\xa2\x16u\xa1\t2\xf2\x83\x812\ -\xaf|J}\xa0o\x06\xe64\xbd2\xben\xcdi\x95\xed\xb9ff\xe0\xa3\xcf\x00\xbe\x19\ -\xbc\xccs\xa5\xd0\xab\xcc\xc1J{XpX\xca\x01c\x13\x86\xfe\x16\xb1\x94\xcb\xf5\ -\x7ft\x13Z(\x08\xca\xa7\x9c\xb7\x19<\xd6\xcb\xe8\xe94\x17\x0f\xa7\xb8\xe6\ -\x8e(\x8eq\x9e\x82\x08"\x94\x87\x99\xe9\xc1\xcc\xf4\xe0\x15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xad\x0c>\xba\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory016Bitmap(): - return wxBitmapFromImage(getDocFactory016Image()) - -def getDocFactory016Image(): - stream = cStringIO.StringIO(getDocFactory016Data()) - return wxImageFromStream(stream) - -index.append('DocFactory016') -catalog['DocFactory016'] = ImageClass() -catalog['DocFactory016'].getData = getDocFactory016Data -catalog['DocFactory016'].getImage = getDocFactory016Image -catalog['DocFactory016'].getBitmap = getDocFactory016Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory017Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\ri\ -IDATx\x9c\xed\x9byl]U~\xc7?\xe7\xdc\xed\xad~\x8b\x9f\xd7\xc4vb;@\xc0I\xc8\ -\x1e\xd6\xcc\x04fh\xc2R\xb6\x94\xa5\x85\xaaj5\xaa\njE\xdb?\xe6\xcfQ5\xaaTuA\ -\x1d\x8d\x80Y\x8a\xaaV\x0c3t230\x0c\x9a\x04fB\x02\x99\x8c\xe3$\x84\xac\x0eIl\ -\xc7\xcb\xf3n?\xfb\xad\xf7\xbe{\xef\xe9\x1f\x86@\xca\x92T\x02\xfc\x10\xfe\ -\xfc\xf9t\xee\xfb~\xbf\xe7\x9e\x9f\xce\xb9\xe7\xe8\x88\x7f\xfa\x8eR,\xb0\xc0\ -\x02\x1f\x89\x1e\xaa\x9eo\x0b\x0b,P\xb9\xe8\xc1\x85\x02Y`\x81\x8fE\x0f\'\xe6\ -\xdbBe!P\x18\xd8H\xbc\x8b~w1p1??\x0f\xc2F\xfb?\x1e\x14PV\x01<\xb4\xcfDW\xe2c\ -\x8a\x12>\x92\xb2\xb2P\x88\xcfD\xe7\x8b\x84\x1e\x8a\xcf\xb7\x85\xcaA\xe0\xd3\ -P\xd8C\xd4=\x8f\xff\x81\xb1)%H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xdb\xefT\xb3\xbb\xb3\x91\\\xde\xe0\xf6\x9b\x87\xd9\ -\xd81E\xd9\xd7x\xe9\xf5F\x8e\x9c\xaa\xfa\x90\xd7\x80\xe5q\xe3\xfa1\xae[9\x8c\ -\xf4]\xa4\x06\xa3\x99\x08g\xcfW\xb1i\xc50 x\xe9\xf5\xa5\x1c9U}I\xcdl\xce@\ -\x08\xb8\xfd\xe6Q6tL\xe2\xfa\xf2"\xdd\xcb\xcd7\xf7\x1f}l\xea\x18\xa6\xeck\ -\xbc\xf8z\x1bGN]|\x9f\xc2\xd0\xe1\x1f\xbe\x99\xa3<0\xcc+\xdf\xef\xe3\x1b\xff\ -\xd6A\xefx\x94o?\x19\xa1\x12\xaf\xee\x89E\x8b~P\x81\xb6\xe6\x17! \x14|\xbf[\ -\\\x17l\xa72\xb6\x1d\xbf\xe8lXS\xe6\x87ON\xf3\xd4\xdf\x0e\xe2z\x82\xbf\xfe\ -\xf7E<\xf6\xcd8o\xec\xff|\xae\x12\xfc\x7f\xd1\x87\x86\x86\xe6\xdb\xc3\x02_"\ -\xae\xd9>\xc9\xf4p\x86\xe3\x87\xf2<\xf4D\x80\xee\x936\xaf\xec\\\xc4l\xb6\xf2\ -\x96W0\xb7\xdb\xbf\xc0\x02\x9f\x1b\xe1\xa0M4\x9a\xe7\x9e?\x87\xcd\xb7\xdb<\ -\xfb|\xa8b\x8b\x03@\x9fo\x03\x0b|\xb9x\xfa\xbf\x1a\t\x9auT\xc7|\x9e|F\xf2\ -\xc2/?\x9b\xdb\x91\x9f\x16\x02\xbe\xb5\xf0\r\xb2\xc0\x02\x1fC\xe5\xcem\x0b,P\ -\x01,\x14\xc8\x02\x0b|\x02\xff\x0b\xa9o\x96s\xa0\x18\xcc\xe5\x00\x00\x00\x00\ -IEND\xaeB`\x82' - -def getDocFactory017Bitmap(): - return wxBitmapFromImage(getDocFactory017Image()) - -def getDocFactory017Image(): - stream = cStringIO.StringIO(getDocFactory017Data()) - return wxImageFromStream(stream) - -index.append('DocFactory017') -catalog['DocFactory017'] = ImageClass() -catalog['DocFactory017'].getData = getDocFactory017Data -catalog['DocFactory017'].getImage = getDocFactory017Image -catalog['DocFactory017'].getBitmap = getDocFactory017Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory018Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rd\ -IDATx\x9c\xed\x9bil]\xc7y\x86\x9f\x99\xb3\xdd\x95w\xe1\xe5*\x91\x94H\xca\xb6\ -lJ\xb2vyU";q%/\xf5\xa6zi\xed\xa2h\x11\x14\xb5\xd1\xc2m\x7f\xe4gP\x04\x05\x8a\ -.F\x83\xc0v\x93\xd4(Z\xb8N\xdd(\x89\x1d\xc7\x88d\'\xb2d+\n\xb5Y\xd6JY\x12Iq\ -\xb9\xdc\xc9K\xde\xf5\x9c{\xce\x99\xfe\xa0#[q,\x11\x85\xadK#|~\x1e\xcc9\xef\ -\xfb}3\x1ff\xce\x0cF\xfc\xc3\xb7\x94b\x81\x05\x16\xf8\xad\xe8\xa1\xeaJ[X`\ -\x81\xf9\x8b\x1e\\(\x90\x05\x16\xf8T\xf4p\xa2\xd2\x16\xe6\x07\x02\x85\x81\ -\x8d\xc4\xbb\xe4\xb9\x8b\x81\x8by\xf5<\x08\x1b\xed7<(\xa0\xac\x02xh\x9f\x8b\ -\xae\xc4\xc7\x14%|$ee\xa1\x10\x9f\x8b\xce\x17\x11=\x14\xaf\xb4\x85\xca#\xf0i\ -(\xec!\xea^\xc0\xff\xd8\xd8\x94\x12\xa4\xa9\x93w\xe3\xe4\x82\xed\xcc\xe8Kp\t\ -|N\x1e<\x9a\xec\xb7\xa8\xf2z.\xf1\x00\xa0[\n[\xab\xa1[\xdbF\x99\xd0g\xaa\xab\ -\xe1\xb0\xd4\xfd)\x81\xf2\x08\x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xed_:\xe8\x19\x8b\xf2\xcdg#\xcc\xe7+{b\ -\xd1\xa2\xef\xcec{W\x17! \x14\xfc(\x1d\xae\x0b\xb63\xbf\xb6\x1d\xbf\xa8lXS\ -\xe6{\xcfN\xf1\xdc_\x0f\xe0z\x82\xbf\xfc\xd7E<\xf5\xf58\xef\xec\xbf:W\t\xfe\ -\xbf\xe8\x83\x83\x83\x95\xf6\xb0\xc0\xef\x007l\x9f`j(\xc3\x89\xc3y\x1e{&@\ -\xd7)\x9b7v.b&;\x7f\x97W0\xbb\xeb\xbf\xc0\x02\x9f;\xe1\xa0M4\x9a\xe7\x81?\ -\x85\xcdw\xdb\xbc\xf8rh\xde\x17\x07\x80^i\x03\x0b\xfcn\xf0\xfc\x7f6\x124\xeb\ -\xa8\x8e\xf9<\xfb\x82\xe4\x95\x9f|>\xb7#?k\x04|c\xe1\x1fd\x81\x05>\x85\xf9?\ -\xc7-\xb0@\x05Y(\x90\x05\x16\xb8\x0c\xff\x07\x8e\x03\x96sM\x85\xe7\xa0\x00\ -\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory018Bitmap(): - return wxBitmapFromImage(getDocFactory018Image()) - -def getDocFactory018Image(): - stream = cStringIO.StringIO(getDocFactory018Data()) - return wxImageFromStream(stream) - -index.append('DocFactory018') -catalog['DocFactory018'] = ImageClass() -catalog['DocFactory018'].getData = getDocFactory018Data -catalog['DocFactory018'].getImage = getDocFactory018Image -catalog['DocFactory018'].getBitmap = getDocFactory018Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory019Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rj\ -IDATx\x9c\xed\x9bil]\xc7y\x86\x9f\x99\xb3\xdd\x95w\xe1\xe5*\x91\x94H\xca\xb6\ -lJ\xb2vyU";q%/\xf5\xa6z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c6\x11\ -\x12\x84\x08\x12\xe0\x1d\x14\xbd\x00H\xcd&X}\x1f\x01k\x08{\xfc \x1a+1D\x07}{\ -\x9e\xa7B\xc1F\xea\xd6=\x8cV\xde\x8e\xf4\ -\xf6#\xcd\x07\xa8[\xfd \x03\xdd\'(\xf5\xf4\x10[\xfc(\x9e\'\xb0\xbb\xcf\x12\n\ -\xd4Q\xb3\xea\x01\xa4\xfb\x13da\x0f\xc8\x04\x9a\xd0\xc1\x99\x82R\x12\xcf\x04\ -\xad\x04z\x11\xacP\x02\xdd\x8a"\r\r+\x98Bs]\x94l%\xd3\xf9/\x84\x02\xf5\xd4\ -\xad\xdd\x8a\xee\xfc\x1cQ:\x82o=N\xcd\xf2{(\x9e\xd8\x8f\xee\xe8\x08\x95\x00/\ -pq\xcd\xdc\x0c\xe8\x19<\xeb[\x98*\x82T\x02M\xafB\xb3_\xc23\x1e\x9fS|U-[\xd1\ -\n\xbb\xf1\xac\x18\x9a\xad\x11\n/$\xd6\xba\t\xdd\xf9\x1e8G \xeb\xa1\xf4\x12U\ -K6\x13\xb0^g\xb2\xf3\x00M[\xff\x14\xcf\xcf\x93=\xfc\x02\x89\xa6\x95\x98\xc9\ -\xc5\xc8\xfc\x0e\xc8\x02\x97\xe9\x19\x8c\xce\xce\xc5\x95\xf6P9b\xb5\xb0~\x04\ -1\x1c\x04\t\xd8#\xb0\xaf\x16\xa6\x15\x18\x16j\xdd:J}\xef\xa0N\x86\xb0\xda[\ -\x91\xd3\x13x"\x85wZ\xa0\xc7\x1a\xa1\x10@\x1e\x18\x84B\x10\xad1\x8d\xd5p\x0b\ -\xdap#\x8c\xc5P\x85\x04\xaaX\xc4}\x0f\x8cD=\xfe\x8c\x81~h\x02\n\x1f\xde*\xae\ -\x86X\r\xacI#\x86\x03XN;\xad[\xff\x02-\x1a\x01\xdf\xc7\x1f\x1fD\x1e9\x83\xd3\ -\xbc\x00\xe7x\t#\xd9\x88(\'\x10\xfb\xa6!\x17D\xb6\x0c`\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ff\x83\xcc3\xcf\'q\xe5\xccu\xf3\xcc\ -S\x01\xe6\x0bd\x9ey>\x85\xff\x01r\x97\x96s\xecS\xe3\x03\x00\x00\x00\x00IEND\ -\xaeB`\x82' - -def getDocFactory019Bitmap(): - return wxBitmapFromImage(getDocFactory019Image()) - -def getDocFactory019Image(): - stream = cStringIO.StringIO(getDocFactory019Data()) - return wxImageFromStream(stream) - -index.append('DocFactory019') -catalog['DocFactory019'] = ImageClass() -catalog['DocFactory019'].getData = getDocFactory019Data -catalog['DocFactory019'].getImage = getDocFactory019Image -catalog['DocFactory019'].getBitmap = getDocFactory019Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory020Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rl\ -IDATx\x9c\xed\x9byp]\xd5}\xc7?\xe7\xdc\xed\xadz\x8b\x9eV[\x92-\xc9\x80A\xb6\ -\xf1n\xcc\xe2\xc4\x90P\x9b\xa5l.K\x0b\x9dN;\x99Na\xda\xa1\xed\x1f\xf93\xd3\ -\xc9t\xa6\xd3\x85i&\x03d)\xd3i\x87\x92\xd28\t\x840\xb1!168\x8e\xbca\xbc\xca\ -\xd8\x96d-O\xbb\xf4\xa4\xb7\xde\xfb\xee\xbd\xa7\x7f\x88\x18\\\x12,:F\xb2A\ -\x9f?\xef\x9c{\xbf\xdf\xef\xb9\xe77\xe7\xdc{\xe6\x88\x7f\xf8\x96R\xcc3\xcf<\ -\xbf\x15=T9\xd7\x16\xe6\x99\xe7\xcaE\x0f\xce\x17\xc8<\xf3\xfcN\xf4pb\xae-\ -\xcc\r\x02\x85\x81\x8d\xc4\xbb\xe8\xba\x8b\x81\x8b9{\x1e\x84\x8d\xf6\x7f<(\ -\xa0\xac\x02xh\x9f\x89\xae\xc4\xc7\x14%|$ee\xa1\x10\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c\x89\x81\x0c\xc7\x0f\xe5y\xf4\xe9\x00\x1d\'m^\xdf\xb1\x80\xa9\xec\ -\xd5\xb3\xbc\x82\xe9]\x80y\xe6\xb9\xec\x84\x836\xd1h\x9e\xfb\xff\x146\xdde\ -\xf3\xc2K\xa1\xab\xae8\x00\xf4\xb960\xcf\xe7\x93\xe7\xfe\xa3\x9e\xa0YCe\xcc\ -\xe7\x99\xe7%/\xff\xf4\xb39\x1d\xf9Y#\xe0\x1b_\xd8o\x90y\xe6\xb9\x14W\xdf\ -\x9c7\xcf<\xb3\xc8|\x81\xcc3\xcf\'\xf0\xbfW+\x96s\x12b\xdf\x03\x00\x00\x00\ -\x00IEND\xaeB`\x82' - -def getDocFactory020Bitmap(): - return wxBitmapFromImage(getDocFactory020Image()) - -def getDocFactory020Image(): - stream = cStringIO.StringIO(getDocFactory020Data()) - return wxImageFromStream(stream) - -index.append('DocFactory020') -catalog['DocFactory020'] = ImageClass() -catalog['DocFactory020'].getData = getDocFactory020Data -catalog['DocFactory020'].getImage = getDocFactory020Image -catalog['DocFactory020'].getBitmap = getDocFactory020Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory021Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rk\ -IDATx\x9c\xed\x9byp]\xd5}\xc7?\xe7\xdc\xed\xadz\x8b\x9eV[\x92-\xc9\x80A\xb6\ -\xf1nV\'\x86\x84\xda,esYZ\xe8t\xda\xc9t\n\xd3\x0em\xff\xc8\x9f\x99N\xa63\x9d\ -.L3\x19H\x93\x94\xe9\xb4CIi\x9c\x04B\x98\xd8\x90\x18\x1b\x1cG\xde0^elK\xb2\ -\x96\xa7]z\xd2[\xef}\xf7\xde\xd3?D\x0c.\t\xd6\x80\x91\x10\xe8\xf3\xe7\x9ds\ -\xef\xf7\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x12\xe5\x9bOG\x98\x8fG\xf3\xc4\xa2E\xdf\x9b\x87\xb6?\x19B@(\xf8~l\xd7\ -\x05\xdb\x99\x1f\xbf\x1d?\xeblXS\xe6\xfbOO\xf0\xcc_\xf7\xe1z\x82\xbf\xfc\xd7\ -E<\xf1\xf58o\xee\x9f\x9d\xa3\x04W\x1a\xbd\xbf\xbf\x7f\xae=,\xf09\xe2\xba\xed\ -cL\x0cd8q8\xcf#O\x05\xe88e\xf3\xea\xceELe\xe7\xdf\xf2\n\xa6w\x03\x16X\xe0\ -\x8a\x11\x0e\xdaD\xa3y\xee\xfbS\xd8|\xa7\xcds/\x84\xe6mq\x00\xe8sm`\x81\xcf\ -\x17\xcf\xfeg=A\xb3\x86\xca\x98\xcf\xd3\xdf\x91\xbc\xf8\xd3O\xe7t\xe4l!\xe0\ -\x1b_\xb8o\x90\x05\x16\x98)\xf3w\xee[`\x81Y`\xa1@\x16X\xe0#\xf8?;\xbf\x96s\ -\x031\xa3\xd0\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory021Bitmap(): - return wxBitmapFromImage(getDocFactory021Image()) - -def getDocFactory021Image(): - stream = cStringIO.StringIO(getDocFactory021Data()) - return wxImageFromStream(stream) - -index.append('DocFactory021') -catalog['DocFactory021'] = ImageClass() -catalog['DocFactory021'].getData = getDocFactory021Data -catalog['DocFactory021'].getImage = getDocFactory021Image -catalog['DocFactory021'].getBitmap = getDocFactory021Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory022Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rk\ -IDATx\x9c\xed\x9byp]\xd5}\xc7?\xe7\xdc\xed\xadz\x8b\x9eV[\x92-\xc9\x80A\xb6\ -\xf1nV\'\x86\x84\xda,esYZ\xe8t\xda\xc9t\n\xd3\x0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\xfd\xfd\xf23\x1e\xf1+\x87\xd8\xb8\xf1\xb5\xf9\xb9\xf6}\x02\ -\x84\x80m\x9b;\xb9u]7\xa9d\x11!g"g\xb3&\x99i\x8b\x91\x89\x08?\xff\xd52\xce\ -\x9d\xaf\xa4\xec\xca\x8b\x9e[\xde:\xc5\xa6\x15\x834\xd5O\xa3<\x85\x8fFgw\x82\ -\x83\'k\xe8\xee\x8b\\h+\xa5b\xe5\xd5\x13l^;@*^\xa0\\\x96(\xa9\xf3\xee{\x95\ -\xecn\xaf\'\x977\xb8\xf3\xd6A6\xb6MP\xf65^y\xb3\x9e\xa3\x1d\x15\x1f\xf1\x1a\ -\xb0000\xd7\x1e\x16\xf8\x1cp\xdd\xf6q&\x073\x9c8\ -\x9c\xe7\x91\xa7\x02t\x9e\xb2ym\xe7"\xa6\xb3\xf3w{\x053\xa7\x02\x0b,\xf0\xa9\ -\t\x07m\xa2\xd1<\xf7\xfd)l\xbe\xd3\xe6\xf9\x17C\xf3\xbe8\x00\xf4\xb96\xb0\ -\xc0\xe7\x83g\xff\xb3\x9e\xa0YCe\xcc\xe7\xe9\xe7$/\xfddvnG~\xd6\x08\xf8\xc6\ -\x17\xe6\x1dd\x81\x05>)\xf3\x7f\r\\`\x81Yd\xa1@\x16X\xe0c\xf8? S\x96sPy\t\ -\xae\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory022Bitmap(): - return wxBitmapFromImage(getDocFactory022Image()) - -def getDocFactory022Image(): - stream = cStringIO.StringIO(getDocFactory022Data()) - return wxImageFromStream(stream) - -index.append('DocFactory022') -catalog['DocFactory022'] = ImageClass() -catalog['DocFactory022'].getData = getDocFactory022Data -catalog['DocFactory022'].getImage = getDocFactory022Image -catalog['DocFactory022'].getBitmap = getDocFactory022Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory023Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x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-\x13y\x04\\q\xbe\xeaT\x06\xbbp\x84\xc6u:\xb1\x1a\x9f\xfe\xbe1N\x9c\x9c\xc0v\ -\xb2\x17\xf5\xf3\xfe\x83.\x0foq\xc8;%\x1aZ\x13\x089\xc6[\xbbK\xf4\xf7\xcb\ -\xcfy\xc4\xaf>b\xe3\xc67\xe7\xf7\x1ax\t\x84\x80m\x9b;\xb9s]7\xa9d\x11!g\xa2f\ -\xb3&\x99i\x8b\x91\x89\x08?\xff\xd52\xce\x9d\xaf\xa4\xec\xca\x8b\x9e[\xde:\ -\xc5\xa6\x15\x834\xd5O\xa3<\x85\x8fFgw\x82\x83\'k\xe8\xee\x8b\\h+\xa5b\xe5\ -\xf5\x13l^;@*^\xa0\\\x96(\xa9\xf3\xc1\x87\x95\xecn\xaf\'\x977\xb8\xf7\xceA6\ -\xb6MP\xf65^\x7f\xa7\x9e\xa3\x1d\x15\x9f\xf2\x1a\xb0000\xd7\x1e\x16\x98\xc7\xdc\xb4}\x9c\xc9\xc1\x0c\'\x0e\ -\xe7y\xe2\xb9\x00\x9d\xa7l\xde\xdc\xb9\x88\xe9\xec\xfc\xdf^\xc1\xcc\xe9\xc0\ -\x02\x0b|f\xc2A\x9bh4\xcfC\x7f\n\x9b\xef\xb5y\xe9\x95\xd05S\x1c\x00\xfa\\\ -\x1bX`~\xf3\xe2\x7f\xd4\x134k\xa8\x8c\xf9<\xff-\xc9\xab?\x99\x9d\xdb\x91s\ -\x85\x80\xaf]\xf3\xef \x0b,\xf0Y\xb9v\xd6\xc2\x05\x16\x98\x05\x16\nd\x81\x05\ -.\xc1\xff\x02\x04\xe7\x96s]oO\x1d\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory023Bitmap(): - return wxBitmapFromImage(getDocFactory023Image()) - -def getDocFactory023Image(): - stream = cStringIO.StringIO(getDocFactory023Data()) - return wxImageFromStream(stream) - -index.append('DocFactory023') -catalog['DocFactory023'] = ImageClass() -catalog['DocFactory023'].getData = getDocFactory023Data -catalog['DocFactory023'].getImage = getDocFactory023Image -catalog['DocFactory023'].getBitmap = getDocFactory023Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory024Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rj\ -IDATx\x9c\xed\x9bYl]\xc7}\xc6\x7f3g\xbb+\xef\xc2\xcbU")\x91\x94m\xd9\x94d\ -\xed\xf2\xaaDv\xe2J^\xeaM\xf5\xd2\xdaE\xd1"(j\xa3\x85\xdb>\xe41(\x82\x02E\ -\x17\xa3A`;K\x8d\xa2\x85\xe3\xc4\x8d\x92\xd8q\x8cHv"K\xb6\xa2P\x0b-k\xa5,\ -\x89\xa4\xb8\\\xee\xe4%\xefz\xce=\xe7L\x1f\xe8\xc8V\x9dX,B\x99\x91\xc2\xdf\ -\xe3\xc5\x9c\xfb}\xdf\xcc\xfc1s\xce`\xc4?}M)\x16X`\x81_\x8b\x1e\xaa\x9co\x0b\ -\x0b,\xf0\xbb\x8b\x1e\\(\x90\x05\x16\xf8\x8d\xe8\xe1\xc4|[\xb8<\x08\x14\x066\ -\x12\xef\xa2\xdf]\x0c\\\xcc\xcf\xce\x83\xb0\xd1\xfe\x8f\x07\x05\x94U\x00\x0f\ -\xed\xb2\xe8J|LQ\xc2GRV\x16\nqYt~\x1f\xd0C\xf1\xf9\xb60\xf7\x08|\xea\n{\x88\ -\xba\xe7\xf1?67\xa5\x04i\xea\xe4\xdd8\xb9`+\xd3\xfa\x12\\\x02\x97\xc9\x83G\ -\x83\xfd\x16\x15^\xf7E\x1e\x00tKakUti\xdb(\x13\x9aS]\r\x87\xa5\xeeO\x08\x94\ -\x87\xd1\x0c\xc1\xa8\\AZ\xde<\xa7\x1a\xbfO\xe8\xe1\xab\xb0@,Fh\xd0\x9f\xe3\ -\xcc\xeb\xd5L\rD\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nd\x81\ -\x05>\x85\xff\x05\xe9l\x96s2)\xef7\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory024Bitmap(): - return wxBitmapFromImage(getDocFactory024Image()) - -def getDocFactory024Image(): - stream = cStringIO.StringIO(getDocFactory024Data()) - return wxImageFromStream(stream) - -index.append('DocFactory024') -catalog['DocFactory024'] = ImageClass() -catalog['DocFactory024'].getData = getDocFactory024Data -catalog['DocFactory024'].getImage = getDocFactory024Image -catalog['DocFactory024'].getBitmap = getDocFactory024Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory025Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rc\ -IDATx\x9c\xed\x9bYl]\xc7}\xc6\x7f3g\xbb+\xef\xc2\xcbU")\x91\x94m\xd9\x94d\ -\xed\xf2\xaaDv\xe2J^\xeaM\xf5\xd2\xdaE\xd1"(j\xa3\x85\xdb>\xe41(\x82\x02E\ -\x17\xa3A`\xbbIj\x14-\\\'N\x94\xc4\x8ecD\xb2\x13Y\xb2\x15\x85\xa2$\xcbZ)K").\ -\x97;y\xc9\xbb\x9es\xcf9\xd3\x07:\xb2U\'\x16\x1f(3f\xf8{\xbc\x98s\xbf\xef\ -\x9b\x99?f\xce\x19\x8c\xf8\xa7o(\xc5"\x8b,\xf2\x1b\xd1C\x95\xf3ma\x91E~w\xd1\ -\x83\x8b\x05\xb2\xc8"\xbf\x15=\x9c\x98o\x0bs\x8b@a`#\xf1.\xfb\xdd\xc5\xc0\ -\xc5\xfc\xec<\x08\x1b\xed\xffyP@Y\x05\xf0\xd0\xae\x8a\xae\xc4\xc7\x14%|$ee\ -\xa1\x10WE\xe7\xf7\t=\x14\x9fo\x0bs\x87\xc0\xa7\xae\xb0\x8f\xa8{\x11\xffcsSJ\ -\x90\xa6N\xde\x8d\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\xdf>\xc4\xc6\xb6I\xca\xbe\xc6\xabo\xd5s\ -\xe4T\xc5\xc7\xbc\x06,\x8f[\xd7\x8fr\xd3\xca!\xa4\xef"5\x18\xc9D8{\xae\x82M+\ -\x86\x00\xc1\xabo-\xe5\xc8\xa9\xca\x8bjfs\x06B\xc0\xdd\xb7\x8f\xb0\xa1m\x02\ -\xd7\x97\x17\xe8^j\xbe\xd9\xff\xe8eS\xdb\x10e_\xe3\x95\xb7Z8r\xea\xc2{\x10\ -\x86\x0e\xff\xf0\xd5\x1c\xe5\xfe!^\xffN/_\xf9\xb76z\xc6\xa2|\xfd\xd9\x08\xf3\ -\xf9\xca\x9dX\xb4\xe8\xbb\xf3&\x9e\x10\x10\n~\x18\xc7u\xc1v\xe6\xd7g\xc7\xb9\ -b\xc3\x9a2\xdf{v\x8a\xe7\xfev\x00\xd7\x13\xfc\xf5\xbf/\xe2\xa9\xaf\xc6y{\xff\ -\xa7s\x95`\xae\xd0\x07\x07\x07\xe7\xda\xc3\x02\x9f\x03n\xd8>\xc1\xd4P\x86\ -\xe3\x87\xf3<\xf6L\x80\xce\x936\xaf\xef\\\xc4Lv\xfen\xaf`\xf6\xd4`\x81\x05.J\ -8h\x13\x8d\xe6y\xe0\xcfa\xf3\xdd6/\xbc\x14\x9a\xf7\xc5\x01\xa0\xcf\xb5\x81\ -\x05>\x1f<\xff_\xf5\x04\xcd\x1a*c>\xcf~K\xf2\xf2O\xae\xce\xed\xc8\xcf\x1a\ -\x02\xbe6o\xdeA\x16X\xe0J3\xff\xd7\xc8\x05\x16\xb8\x0c\x16\nd\x81\x05>\x81\ -\xff\x07\xb2\x94\x96s\xb0\xd3\xbf\xdb\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory026Bitmap(): - return wxBitmapFromImage(getDocFactory026Image()) - -def getDocFactory026Image(): - stream = cStringIO.StringIO(getDocFactory026Data()) - return wxImageFromStream(stream) - -index.append('DocFactory026') -catalog['DocFactory026'] = ImageClass() -catalog['DocFactory026'].getData = getDocFactory026Data -catalog['DocFactory026'].getImage = getDocFactory026Image -catalog['DocFactory026'].getBitmap = getDocFactory026Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory027Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rg\ -IDATx\x9c\xed\x9byp]\xd5}\xc7?\xe7\xdc\xed\xadz\x8b\x9eV[\x92-\xc9\x80A\xb6\ -\xf1nV\'\x86\x84\xda,esYZ\xe8t\xda\xc9t\n\xd3\x0em\xff\xc8\x9f\x99N\xa63\x9d\ -.L3\x19\xc8V\xa6\xd3\x0e%\xa5q\x12\x08abCblp\x1cY\xb60^elK\xb2\x96\xa7]z\xd2\ -[\xef}\xf7\xde\xd3?D\x0c.\x01{\\la\xa3\xcf\x9fo\xce}\xdf\xef\xf7\x9c\xf3\x9b\ -s\xee=s\xc4?|K)\xe6\x99g\x9e\xdf\x89\x1e\xaa\x9ck\x0b\xf3\xcc\xf3\xf9E\x0f\ -\xce\x17\xc8<\xf3|"z81\xd7\x16\xfe\x7f\x08\x14\x066\x12\xef\x9c\xdf]\x0c\\\ -\xcc\xcb\xe7A\xd8h\xff\xc7\x83\x02\xca*\x80\x87vIt%>\xa6(\xe1#)+\x0b\x85\xb8\ -$:_d\xf4P|\xae-\\<\x02\x9f\xba\xc2.\xa2\xee\x19\xfc\x8f\xccM)A\x9a:y7N.\xd8\ -\xca\x8c\xbe\x08\x97\xc0%\xf2\xe0\xd1`\xbfI\x85\xd7s\x8e\x07\x00\xddR\xd8Z\ -\x15\xdd\xda\x16\xca\x84>S]\r\x87\xc5\xee\xcf\t\x94G\xd0\x0c\xc1\x98\\FZ\xde\ -\xfc\x99j\xcc\x03z\xf8\n.\x10\x8bQ\x1a\xf4\xe78\xf9Z5\xd3\x83\x11@\x80\x94H]\ -\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00\x00\x00IEND\xaeB`\x82' - -def getDocFactory027Bitmap(): - return wxBitmapFromImage(getDocFactory027Image()) - -def getDocFactory027Image(): - stream = cStringIO.StringIO(getDocFactory027Data()) - return wxImageFromStream(stream) - -index.append('DocFactory027') -catalog['DocFactory027'] = ImageClass() -catalog['DocFactory027'].getData = getDocFactory027Data -catalog['DocFactory027'].getImage = getDocFactory027Image -catalog['DocFactory027'].getBitmap = getDocFactory027Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory028Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rg\ -IDATx\x9c\xed\x9by\x8c]\xd5}\xc7?\xe7\xdc\xed\xad\xf3\x96y\xb3\xda3c\xcf\x8c\ -\x01\xc3\xd8\xc6\xbbY\x9d\x18\x12j\xb3\x94\xcdei\xa1\xaaZEUA\xadh\xfbG\xfe\ -\x8c\xaa\xa8R\xd5\x055\x8a\x80,EU+JJ\xe3$\x10\x82bCblp\x9c\xf1\x86\xf1:\xc6\ -\x9e\xc5\xb3\xbc\xd9g\xde\xcc[\xef}\xf7\xde\xd3?\x86\x18\\\x12<\xae\xb0\x07\ -\x9b\xf9\xfc\xf9t\xee\xfb~\xbf\xe7\x9c\x9f\xce\xb9\xf7\xe8\x88\x7f\xf8\x96R\ -\xcc3\xcf<\xbf\x15=T9\xd7\x16\xe6\x99\xe7\xf3\x8b\x1e\x9c/\x90y\xe6\xf9\x9d\ -\xe8\xe1\xc4\\[\xf8\xff!P\x18\xd8H\xbc\xf3~w1p1/\x9f\x07a\xa3\xfd\x1f\x0f\n(\ -\xab\x00\x1e\xda%\xd1\x95\xf8\x98\xa2\x84\x8f\xa4\xac,\x14\xe2\x92\xe8\xcc\ -\x03z(>\xd7\x16.\x1e\x81O]a\x17Q\xf7,\xfe\xc7\xe6\xa6\x94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ea\xdb-\x1c>y\xfe\xbd\x07C\x87\xbf\xfbz\x8er\xdf o|\xb7\x87\xaf\xfdK\x1b\ -\xdd\xa3Q\xbe\xf9l\x84/\xd2\x15;\xb1`\xc1\xf7\xae\xd8\xb8B@(\xf8\x91}\xd7\ -\x05\xdb\xb9\xba?;^.\xd6\xad*\xf3\xfdg\'y\xee\xaf\xfbq=\xc1_\xfe\xeb\x02\x9e\ -\xfaz\x9cw\xf6^\x9e\xab\x04\x9f\x17\xf4\x81\x81\x81\xb9\xf60\xcf\xe7\x90\x1b\ -\xb6\x8e39\x98\xe1\xd8\xc1<\x8f=\x13\xa0\xe3\x84\xcd\x1b\xdb\x170\x9d\xfd\ -\xe2l\xaf`\xe6\x14a\x9ey>A8h\x13\x8d\xe6y\xe0Oa\xe3\xdd6/\xbe\x1c\xfa\xc2\ -\x15\x07\x80>\xd7\x06\xe6\xf9|\xf2\xfc\x7f\xd4\x134k\xa8\x8c\xf9<\xfb\x82\ -\xe4\x95\x9f^\x9a\xdb\x91\x9fw\x04|\xe3\x8a}\x07\x99g\x9eK\xcd\x17o\xcd\x9cg\ -\x9e\x8b`\xbe@\xe6\x99\xe7S\xf8_{\xbc\x96s\x8a1j\xe2\x00\x00\x00\x00IEND\xae\ -B`\x82' - -def getDocFactory028Bitmap(): - return wxBitmapFromImage(getDocFactory028Image()) - -def getDocFactory028Image(): - stream = cStringIO.StringIO(getDocFactory028Data()) - return wxImageFromStream(stream) - -index.append('DocFactory028') -catalog['DocFactory028'] = ImageClass() -catalog['DocFactory028'].getData = getDocFactory028Data -catalog['DocFactory028'].getImage = getDocFactory028Image -catalog['DocFactory028'].getBitmap = getDocFactory028Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory029Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rg\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a3\x01\xbc\x0c\xd1\xa3\x97Q\xff\x86\x95 \xa9\xadA\x04%\ -\xa4\xa6\xb0\x13\x02#$P\x08\xca\x05\x9b\xd1S\x92\xc2h3+\xef\x92\x98\xc6\xaf\ -\xe8\x8f\xdcs\xd16D\x04>\xc2\xab \x02\x1f%5\x94n\xa0\xe4o\xde\x0e\t\xcfEz\ -\x15\x80\x8b\xda\x86\x95ND\\\x8d\xf2\x8aH\x8d\x0b\x1e@\x90^j\x12\x0ew`\xdaMD\ -\xe5G\xff\'\xd0M\x94\xa6#\xdd\x12\x08I`X\xb3\x05v\tM\x81"\x11\x94\x88\x14\ -\x96#)\x93\xcb\xc4\xb9&fQ\x17\x1e\'+?\x18\xc09\xe5S\xea\x03}34\xab\xe9W\x08t\ -kV\xab\xe2\xcc63C\x1f}\x06\x08L\xfb"\xcf\xff\xdf\xd1\xab\xcc\x81\xf9\xf60g,\ -\xe5\x82\xb1\x01C\x7f\x93x\xda\xe3\xfa?\xb8\t-l\x83\n\xa8\x14\x1c\x06\x0e\ -\xf70r"\xc3\xf9\x83i\xae\xb9#\x86k\x9c\xa5(l\x84\xf21\xb3\xdd\x98\xd9n\xfcb\ -\x19\x81\x9a]|B!\x9c\xf4r\xdc\xaafx\xbf\x90DP\xc1\x9a\xe9\xc1\x98<\x87r\\@\ -\xcd.\x10F\x88R\xed\xf5h\x91jd\xe8&,k7Z\xda\xe3\xfa\xc76cDm\x00\x9c\x8ab\xd2\ -\x88"C\x92x\xd0\x839u\x16k\xa6\x1b\xe5x(\xa5\xc0\xb4\xf1\xedj\xccR\x06\xa5\ -\xc0M\xb4RNw\\R3"t\xaa\xfd\x19\xf2S+\xc0\xebDhP.\xaef\x895\xca\x90\x01ei\xcc\ --\x9f\n\x08e\x0ea\xe43HC\xe2E\x1a\xd0\x8ac\x04N\x05aZ\xb8z-27\x8e\x90\x02g\ -\xf1*\xfcX-\x00F\xe6$\xc6\xd4\x00\x08E%\xd1L\xa5q\xf9<\x8c\xfe\xfc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\xee\xbcu\x88\x8d\x1d\x93T\x02\x8d\x97\ -\xdfh\xe4\xc8\xa9\xaa\x8fx\rY>7\xaf\x1f\xe5\x86\x95C\xc8\xc0Cj0\x92\x8dr\xf6\ -|\x15\x9bV\x0c\x01\x82\x97\xdfX\xca\x91S\xd5\x97\xd4\xcc\xe5\r\x84\x80;o\x1d\ -aC\xc7\x04^ /\xd2\x9dk\xbe\xd9\xff\xe8eS\xc7\x10\x95@\xe3\xa57\xda8r\xea\xe2\ -\xfb\x0e\x86\x0e\x7f\xf3\xd5<\x95\xfe!^\xfdN/_\xf9\xa7\x0ez\xc6b|\xfd\xe9(W\ -\xe2\xd5:\xb1h\xd1w/\xbb\xd8B@\xd8\xfe\xc0\xb6\xe7\x81\xe3^\x19\x9f\x1d?m6\ -\xac\xa9\xf0\xbd\xa7\xa7x\xe6/\x07\xf0|\xc1\x9f\xff\xf3"\x9e\xf8j\x827\xf7\ -\x7f6W\t>o\xe8\x83\x83\x83\xf3\xeda\x81\xcf\x11\xd7m\x9f`j(\xcb\xf1\xb7\x0b<\ -\xf2T\x88\xae\x93\x0e\xaf\xee\\\xc4L\xee\xca\xdb^\xc1\xeci\xc2\x02\x0b\\ b;\ -\xc4b\x05\xee\xfbc\xd8|\xa7\xc3s/\x84\xaf\xd8\xe2\x00\xd0\xe7\xdb\xc0\x02\ -\x9f/\x9e\xfd\xb7Fl\xb3\x8e\xeax\xc0\xd3\xdf\x92\xbc\xf8\x93O\xe7v\xe4\xe5\ -\x82\x80\xaf]v\xef \x0b,\xf0Yq\xe5\xae\x9d\x0b,0\x07\x16\nd\x81\x05>\x86\xff\ -\x06`P\x96s\xd1\x83=\xe9\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory029Bitmap(): - return wxBitmapFromImage(getDocFactory029Image()) - -def getDocFactory029Image(): - stream = cStringIO.StringIO(getDocFactory029Data()) - return wxImageFromStream(stream) - -index.append('DocFactory029') -catalog['DocFactory029'] = ImageClass() -catalog['DocFactory029'].getData = getDocFactory029Data -catalog['DocFactory029'].getImage = getDocFactory029Image -catalog['DocFactory029'].getBitmap = getDocFactory029Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory030Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rb\ -IDATx\x9c\xed\x9byp]\xd5}\xc7?\xe7\xdc\xed\xadz\x8b\x9eV[\x92-\xc9\x80A\xb6\ -\xf1nV\'\x86\x84\xda,esYZ\xe8t\xda\xc9t\n\xd3\x0em\xff\xc8\x9f\x99N\xa63\x9d\ -.L3\x19\xc8V\xa6\xd3\x0e%\xa5q\x12\x08abCblp\x1cy\x11\xc6\xab\x8c\xad\xc5Z\ -\x9ev\xe9Io\xbd\xf7\xdd{O\xff\x101\xb8\x04\xa4?\x00\xd9\xb5>\x7f\xbe9\xf7}\ -\xbf\xdfs\xceo\xce\xb9\xf7\xcc\x11\xff\xf0-\xa5Xd\x91E~\'z\xa8r\xa1-,\xb2\ -\xc8\xe5\x8b\x1e\\,\x90E\x16\xf9D\xf4pb\xa1-\xcc\x0f\x81\xc2\xc0F\xe2]\xf2\ -\xbb\x8b\x81\x8b\xf9\xc5y\x106\xda\xff\xf1\xa0\x80\xb2\n\xe0\xa1}.\xba\x12\ -\x1fS\x94\xf0\x91\x94\x95\x85B|.:\x8b|\x1c=\x14_h\x0bs#\xf0\xa9+\xec#\xea^\ -\xc0\xff\xc8\xdc\x94\x12\xa4\xa9\x93w\xe3\xe4\x82\xad\xcc\xe8\xcbp\t|N\x1e<\ -\x1a\xec7\xa9\xf0z.\xf1\x00\xa0[\n[\xab\xa2[\xdbA\x99\xd0g\xaa\xab\xe1\xb0\ -\xdc\xfd9\x81\xf2\x08\x9a!\x18\x93\xabH\xcb\x9b?S\x8dE>\x19=|\x05\x14\x88\ -\xc5(\r\xfas\x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e}\x84Mm\x13\xb8\xbe\xbcDw\xbe\xf9f\xff\xa3\ -\x97-mC\x94}\x8dW\xdej\xe1\xd8\x99K\xef9\x18:\xfc\xdd\xd7s\x94\xfb\x87x\xfd{\ -\xbd|\xed_\xda\xe8\x19\x8b\xf2\xcdg#\\\xcdW\xea\xc4\x92%\xdf\xbfb\xe2\x0b\ -\x01\xa1\xe0\x87v]\x17l\xe7\xea\xfa\xec\xf8y\xb1i]\x99\x1f<;\xc5s\x7f=\x80\ -\xeb\t\xfe\xf2_\x97\xf0\xd4\xd7\xe3\xbc}\xf0\x8b\xb9Jp\xb9\xa2\x0f\x0e\x0e.\ -\xb4\x87E.\x03n\xd89\xc1\xd4P\x86\x93G\xf3<\xf6L\x80\xce\xd36\xaf\xef^\xc2L\ -\xf6\xea\xdd^\xc1\xec\xa9\xc2"\x8b\x10\x0e\xdaD\xa3y\x1e\xf8S\xd8z\xb7\xcd\ -\x0b/\x85\xae\xfa\xe2\x00\xd0\x17\xda\xc0"\x97\x07\xcf\xffG=A\xb3\x86\xca\ -\x98\xcf\xb3\xdf\x91\xbc\xfc\xb3\xcf\xe7v\xe4\x95\x86\x80o\\1\xef \x8b,\xf2E\ -\xb3\xb8\x86.\xb2\xc8\xa7\xb0X \x8b,\xf2)\xfc/D\xe4\x96s\x02\xa7\xcb\xe2\x00\ -\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory030Bitmap(): - return wxBitmapFromImage(getDocFactory030Image()) - -def getDocFactory030Image(): - stream = cStringIO.StringIO(getDocFactory030Data()) - return wxImageFromStream(stream) - -index.append('DocFactory030') -catalog['DocFactory030'] = ImageClass() -catalog['DocFactory030'].getData = getDocFactory030Data -catalog['DocFactory030'].getImage = getDocFactory030Image -catalog['DocFactory030'].getBitmap = getDocFactory030Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory031Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x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Factory031Bitmap(): - return wxBitmapFromImage(getDocFactory031Image()) - -def getDocFactory031Image(): - stream = cStringIO.StringIO(getDocFactory031Data()) - return wxImageFromStream(stream) - -index.append('DocFactory031') -catalog['DocFactory031'] = ImageClass() -catalog['DocFactory031'].getData = getDocFactory031Data -catalog['DocFactory031'].getImage = getDocFactory031Image -catalog['DocFactory031'].getBitmap = getDocFactory031Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory032Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rb\ -IDATx\x9c\xed\x9bYl]\xc7y\xc7\x7f3g\xbb+\xef\xc2\xcbU")\x91\x94m\xd9\x94d\ -\xed\xf2\xaaDv\xe2J^\xeaM\xf5\xd2\xdaE\xd1"(j\xa3\x85\xdb>\xe41(\x82\x02E\ -\x17\xa3A`\xa7Ij\x14-\\\xa7n\x94\xc4\x8ecD\xb2\x13Y\xb2\x15\x85\xda,k\xa5,\ -\x89\xa4\xb8\\\xee\xe4%\xefz\xce=\xe7L\x1f\xe8\xd8V\xe9X|\xb0M\x06\xba\xbf\ -\xc7\x839\xe7\xff\xff\xbe\x99\x0f3g\x06#\xfe\xe1[JQ\xa1B\x85OD\x0fU/\xb4\x85\ -\n\x15\x16/z\xb0R \x15*\xfcV\xf4pb\xa1-|2\x02\x85\x81\x8d\xc4\xbb\xec\xb9\ -\x8b\x81\x8b\xf9\xc5y\x106\xda\xff\xf3\xa0\x80\xb2\n\xe0\xa1}.\xba\x12\x1fS\ -\x94\xf0\x91\x94\x95\x85B|.:\x15\xae\x8c\x1e\x8a/\xb4\x85\xb9\x08|\x1a\n\xfb\ -\x88\xba\x97\xf0?66\xa5\x04i\xea\xe4\xdd8\xb9`;3\xfa2\\\x02\x9f\x93\x07\x8f&\ -\xfbM\xaa\xbc\x9e\xcb<\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b1fz0&/\xa2l\x07P\xb3\x13\x84\x11\xa0X{#Z\ -\xb8\x1a\x19\xb8\x05\xcb\xda\x8b\x96r\xb9\xf1\x89\xad\x18\x91 \x00vY1iD\x90\ -\x01I\xcc\xef\xc1\x9c\xba\x805\xd3\x8d\xb2]\x94R`\x06\xf1\x82\xd5\x98\xc54J\ -\x81\x13o\xa5\x94\xea\xb8\xa2fX\xe8T{3\xe4\xa6V\x81\xdb\x89\xd0\xa0TX\xcb2k\ -\x94!\x03J\xd2\x98_|\xca\'\x90>\x82\x91K#\r\x89\x1bn@+\x8c\xe1\xdbe\x84i\xe1\ -\xe8\xb5\xc8\xec8B\n\xec\xa5k\xf0\xa2\xb5\x00\x18\xe93\x18S\x03 \x14\xe5x3\ -\xe5\xc6\x95\x0b\xd0\xfb\x8b\x0b=\xc2\xd9\x85\xf60\x07C\xe8\x08\xb3\n]\xe6\ -\xd0\x83\x02#\x96"c\x15\xf0\x00+\x14\xa6\xed\x8e\x8dx\xb9\xdd\xe4\x86\xbb)d\ -\xae!a\x8d\xa0\x9b3D\xb2\xe7\xd1\xcb\x19\x86\xceL2~"\x8b\xe7\xfa\xe8A\x9d\ -\xc6-\t\x1abC\x14\x8bK(\x04\x97"\x95G$w\x0e\x95\x9d\xa6\xff\xedar\x836B\x033\ -bP}C\x94\xda\xd0\x08vh3\xc2H\xa1\xcb\xbe\r\x83o\xbe\xc0\xf4\xf9\x83\x18\ -\xba\x860\xeb\xd1\xdd(\x03\xfb_\xfaTMe\xed!v\xed]\xc4\xda\x9e\xe6\xc2\x8b\ -\xcf t\x8f\xf6\xfb\x9fBX\x93H\xad\x8e\xbe\x03?\xbdr|m\xf5(k7\xc2\xdc\x86.\ -\xa70\xe5\x10-\xdb\xff\x82X\xfb\x1a|\xd1\x8b\n\xbc\x0b\xb9\x15\xd4o0\xe9{\ -\xfd\x7f(M\x7f\x95`\xb0\x88\xf2\x92L\xf5t\xa13Dj\xd5#\x10\xea\'(\xde\x80\xab\ -\xbcD\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\xa2|\xf3\xd9\ -\x08\x95+t\x1f!\x96,\xf9\xde\xa2M\x87\x10\x10\n~d\xcfu\xc1v\xae\xeem\xc7\xcf\ -\x8aM\xeb\xca|\xff\xd9)\x9e\xfb\xeb\x01\\O\xf0\x97\xff\xba\x84\xa7\xbe\x1e\ -\xe7\xed\x83_\xccU\x82\xdf\x15\xf4\xc1\xc1\xc1\x85\xf6Pa\x01\xb8a\xe7\x04SC\ -\x19N\x1d\xcd\xf3\xd83\x01\xba\xce\xd8\xbc\xbe{\t3\xd9\xca\xf2\xea\xe3T\xb2q\ -\x95\x12\x0e\xdaD\xa3y\x1e\xf8S\xd8z\xb7\xcd\x0b/\x85*\xc5\xf1\t\xe8\x0bm\ -\xa0\xc2\xc2\xf0\xfc\x7f6\x124\xeb\xa8\x8e\xf9<\xfb\x1d\xc9\xcb?\xfd|nG\xfe\ -\xae#\xe0\x1b\x8b\xf6\x1f\xa4B\x85\x85\xa62\xa7V\xa8\xf0)T\n\xa4B\x85O\xe1\ -\xff\x00\x0e\x0c\x96s\xfbJR\xd9\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory032Bitmap(): - return wxBitmapFromImage(getDocFactory032Image()) - -def getDocFactory032Image(): - stream = cStringIO.StringIO(getDocFactory032Data()) - return wxImageFromStream(stream) - -index.append('DocFactory032') -catalog['DocFactory032'] = ImageClass() -catalog['DocFactory032'].getData = getDocFactory032Data -catalog['DocFactory032'].getImage = getDocFactory032Image -catalog['DocFactory032'].getBitmap = getDocFactory032Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory033Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\ra\ -IDATx\x9c\xed\x9bil]\xc7y\x86\x9f\x99\xb3\xdd\x95w\xe1\xe5*\x91\x94H\xca\xb6\ -lJ\xb2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e4{\x8b.-B@(\xf8\xa1-\xd7\x05\xdb\xa9l;~\x1alZW\xe6\xfb\xcfN\xf1\xdc\ -\x9f\x0f\xe0z\x82?\xfd\xc7%<\xf5\xf58o\x1f\xfc|\xae\x12\xfc_C\x1f\x1c\x1c\\h\ -\x0f\x15>Gn\xd89\xc1\xd4P\x86SG\xf3<\xf6L\x80\xae36\xaf\xef^\xc2L\xb6\xb2\ -\xbc\xfa$*Y\xf9\x82\x11\x0e\xdaD\xa3y\x1e\xf8C\xd8z\xb7\xcd\x0b/\x85*\xc5q\ -\x05\xf4\x856P\xe1\xf3\xe5\xf9\x7fm$h\xd6Q\x1d\xf3y\xf6;\x92\x97\x7f\xfa\xd9\ -\xdc\x8e\xfc\xff\x82\x80o,\xba\x7f\x90\n\x15\x16\x0b\x95\xb9\xb5B\x85+P)\x90\ -\n\x15\xae\xc0\x7f\x01\xf2\x91\x96s\xa0O\xc2"\x00\x00\x00\x00IEND\xaeB`\x82'\ - - -def getDocFactory033Bitmap(): - return wxBitmapFromImage(getDocFactory033Image()) - -def getDocFactory033Image(): - stream = cStringIO.StringIO(getDocFactory033Data()) - return wxImageFromStream(stream) - -index.append('DocFactory033') -catalog['DocFactory033'] = ImageClass() -catalog['DocFactory033'].getData = getDocFactory033Data -catalog['DocFactory033'].getImage = getDocFactory033Image -catalog['DocFactory033'].getBitmap = getDocFactory033Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory034Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rW\ -IDATx\x9c\xed\x9byl]U~\xc7?\xe7\xdc\xed\xad~\x8b\x9f\xd7\xc4vb;@\xc0I\xc8\ -\x1e\xd6\xcc\x04fh\xc2R\xb6\x94\xa5\x85\xaaj5\xaa\njE\xdb?\xe6\xcfQ5\xaaTuA\ -\x1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c7$e_\xe3\x957\x1b9~\xb6\xeac^\x03\x96\ -\xc7\xcd\x1bG\xb9a\xf5\x10\xd2w\x91\x1a\x8cd"\\\xb8T\xc5\x96UC\x80\xe0\x957\ -\x97s\xfcl\xf5\x155\xb39\x03!\xe0\xce[G\xd8\xd41\x81\xeb\xcb9\xba\xf3\x8do\ -\xf6\x1b\xbdl\xe9\x18\xa2\xeck\xbc\xfcf\x1b\xc7\xcf\xce\xbd\xc7`\xe8\xf0W_\ -\xcfQ\xee\x1f\xe2\xb5\xef\xf6\xf2\xb5\x7f\xe8\xa0g,\xca7\x9f\x8eP\xb92\xf7\ -\xe9\x88%K\xbe\xb7h\xbaG\x08\x08\x05?\xb4\xe3\xba`;\x95m\xc7\xcf\x82M\xeb\ -\xca|\xff\xe9)\x9e\xf9\xf3\x01\\O\xf0\xa7\xff\xb8\x84\'\xbe\x1e\xe7\xad\x83_\ -\xccU\x82\xdfT\xf4\xc1\xc1\xc1\x85\xf6P\xe1\x0b\xe0\xba\x9d\x13L\re8u4\xcf#O\ -\x05\xe8:c\xf3\xda\xee%\xccd+\xcb\xab\xcbQ\xe9\x9d\xff\'\x84\x836\xd1h\x9e\ -\xfb\xfe\x10\xb6\xdei\xf3\xfc\x8b\xa1Jq\xcc\x03}\xa1\rT\xf8bx\xf6_\x1a\t\x9a\ -uT\xc7|\x9e~N\xf2\xd2O?\x9f\xdb\x91\xff\xd7\x10\xf0\x8dE\xf3\x0fR\xa1\xc2b\ -\xa32\xc7V\xa8p\x19*\x05R\xa1\xc2e\xf8O\xd7%\x96s\x80I\xb1\xb6\x00\x00\x00\ -\x00IEND\xaeB`\x82' - -def getDocFactory034Bitmap(): - return wxBitmapFromImage(getDocFactory034Image()) - -def getDocFactory034Image(): - stream = cStringIO.StringIO(getDocFactory034Data()) - return wxImageFromStream(stream) - -index.append('DocFactory034') -catalog['DocFactory034'] = ImageClass() -catalog['DocFactory034'].getData = getDocFactory034Data -catalog['DocFactory034'].getImage = getDocFactory034Image -catalog['DocFactory034'].getBitmap = getDocFactory034Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory035Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rR\ -IDATx\x9c\xed\x9by\x8c]\xd5}\xc7?\xe7\xdc\xed\xad\xf3\x96y\xb3\xda3c\xcf\x8c\ -\x01\xc3\xd8\xc6\xbbY\x9d\x18\x12j\xb3\x94\xcdei\xa1\xaaZEUA\xadh\xfbG\xfe\ -\x8c\xaa\xa8R\xd5\x055\x8a\x80&)\xaaZQR\x1a\'\x81\x10\x14\x1b\x12c\x83\xe3\ -\x8c7\x8c\xd71\xb6g\xc6\xb3\xbc\xd9g\xde\xcc[\xef}\xf7\xde\xd3?\x86\x1a\\\ -\x88=m\x81\x07\xd1\xfb\xfc\xf9t\xef\xfb|\x7f\xe7\xdc\xa3s\xee=:\xe2o\xbe\xa5\ -\x14U\xaaT\xf9X\xf4Pm\xa5#T\xa9\xf2\xf9E\x0fV\x07H\x95*\xbf\x16=\x9c\xa8l\ -\x00\x81\xc2\xc0F\xe2]\xf2\xbb\x8b\x81\x8b\xf9\xd9e\x106\xda\xff\xc8\xa0\x80\ -\xb2\n\xe0\xa1}*^\x89\x8f)J\xf8H\xca\xcaB!>\x15O\x95\xff;z(^9\xb9\xc0\xa7\ -\xa9\xb0\x87\xa8{\x01\xffC\xcf\xa6\x94 M\x9d\xbc\x1b\'\x17\xecdN_\x82K\xe0S\ -\xca\xe0\xd1b\xbfA\x8d\xd7wI\x06\x00\xddR\xd8Z\x1d\xbd\xda6\xca\x84>Q\xaf\ -\x86\xc3R\xf7\xa7\x04\xcach\x86`B\xae -o\xfcD\x1dU\xfe\xff\xe8\xe1\n\x0e\x10\ -\x8bqZ\xf4g8\xfbj=\xb3\xc3\x11@\x80\x94H]\x11\xae+\x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e\xb0\xb1k\x9a\xb2\xaf\xf1\xca\x9b\xcd\x1c=]\ -\xf3\x91\xac\x01\xcb\xe3\xe6\xf5\xe3\xdc\xb0r\x04\xe9\xbbH\r\xc62\x11\xce]\ -\xa8a\xd3\x8a\x11@\xf0\xca\x9bK9z\xba\xf6\x8a\xcel\xce@\x08\xb8\xf3\xd616tM\ -\xe1\xfa\xf2\x12\xefB\xeb\x9b\xff\x8f~6u\x8dP\xf65^~\xb3\x83\xa3\xa7/=\xbf`\ -\xe8\xf0W_\xcfQ\x1e\x1c\xe1\xb5\xef\xf4\xf3\xb5\x7f\xe8\xa2o"\xca7\x9f\x8eP=\ -*we\xc4\xa2E\xdf\xadx3\t\x01\xa1\xe0\x071\\\x17l\xa7\xfa\xd9\xf1\x93`\xc3\ -\x9a2\xdf{z\x86g\xfe|\x08\xd7\x13\xfc\xe9?.\xe2\x89\xaf\xc7yk\xffgs\x94\xe0\ -\x8b\x8e><<\\\xe9\x0cU>E\xae\xdb>\xc5\xccH\x86\x13\x87\xf3<\xf2T\x80\x9eS6\ -\xaf\xed\\\xc4\\\xb6\xba\xbcZ\x08\xd5V\xfa\r\'\x1c\xb4\x89F\xf3\xdc\xf7\x87\ -\xb0\xf9N\x9b\xe7_\x0cU\x07\xc7\xff\x02\xbd\xd2\x01\xaa|\xba<\xfb\xaf\xcd\ -\x04\xcd\x06jc>O?\'y\xe9\'\x9f\xce\xe9\xc8\xdfT\x04|\xa3\xe2\xef U\xaa|^\xa9\ -\xce\xb5U\xaa\\\x86\xea\x00\xa9R\xe52\xfc\x17\xbb\xb9\x96s\xb1\xdd\x12m\x00\ -\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory035Bitmap(): - return wxBitmapFromImage(getDocFactory035Image()) - -def getDocFactory035Image(): - stream = cStringIO.StringIO(getDocFactory035Data()) - return wxImageFromStream(stream) - -index.append('DocFactory035') -catalog['DocFactory035'] = ImageClass() -catalog['DocFactory035'].getData = getDocFactory035Data -catalog['DocFactory035'].getImage = getDocFactory035Image -catalog['DocFactory035'].getBitmap = getDocFactory035Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory036Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rQ\ -IDATx\x9c\xed\x9bYl]\xc7y\x80\xbf\x99\xb3\xdd\x95w\xe1\xe5*\x91\x94H\xca\xb6\ -lJ\xb2vyU";q%/\xf5\xa6zi\xed\xa2h\x11\x14\xb5\xd1\xc2m\x1f\xf2\x18\x14A\x81\ -\xa2\x8b\xd1 \xb0\xb3\xd5(Z\xb8N\xdd(\x89\x1d\xc7\x88d\'\xb2d+\n\xb5Y\xd6JY\ -\x12Iq\xb9\xdc\xc9K\xde\xf5\x9c{\xce\x99>\xd0\x95\xad\xda\x96\xd8V\xa2*\xe3~\ -\x8f\x17s\xce\xf7\xff\xf3\xdf\xc1\xcc\x99\xc1\x88\xbf\xf9\x96RT\xa8P\xe13\ -\xd1C\xd5W;\x84\n\x15\xfe\xff\xa2\x07+\x03\xa4B\x85\xcfE\x0f\'\xae\x8eX\xa00\ -\xb0\x91x\x17\xfc\xeeb\xe0b\xce_\x0c\xc2F\xfbo1(\xa0\xac\x02xhW\xc4+\xf11E\t\ -\x1fIYY(\xc4\x15\xf1T\xf8\xbf\xa3\x87\xe2\xf3/\x15\xf84\x14v\x11u\xcf\xe1\ -\x7f\xe2\xbf)%HS\'\xef\xc6\xc9\x05\xdb\x99\xd1\x17\xe1\x12\xb8B1x4\xd9oS\xe5\ -\xf5\\\x10\x03\x80n)l\xad\x86nm\x0beB\x97\xd5\xab\xe1\xb0\xd8\xfd9\x81\xf2\ -\x08\x9a!\x18\x93\xcbH\xcb[/\xab\xa3\xc2\xe5C\x0f_\x85\x01b1J\x93\xfe\x02\ -\xa7\xdf\xa8ez0\x02\x08\x90\x12\xa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xf5?\xa1\xd2[_P\xc2A\ -\x9bh4\xcfC\x7f\x08\x1b\xef\xb5y\xe9\x95Pep\xfc/\xd0\xafv\x00\x15\xae\x0c/\ -\xfeK#A\xb3\x8e\xea\x98\xcf\xf3\xdf\x91\xbc\xfa\xb3+s;\xf2\x8b\x8e\x80oT>\ -\xd9*T\xf8\x1c*sn\x85\n\x17\xa12@*T\xb8\x08\xff\t\xa0M\x96s\x18I#\x89\x00\ -\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory036Bitmap(): - return wxBitmapFromImage(getDocFactory036Image()) - -def getDocFactory036Image(): - stream = cStringIO.StringIO(getDocFactory036Data()) - return wxImageFromStream(stream) - -index.append('DocFactory036') -catalog['DocFactory036'] = ImageClass() -catalog['DocFactory036'].getData = getDocFactory036Data -catalog['DocFactory036'].getImage = getDocFactory036Image -catalog['DocFactory036'].getBitmap = getDocFactory036Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory037Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rP\ -IDATx\x9c\xed\x9bi\x8c]\xd5}\xc0\x7f\xe7\xdc\xed\xad\xf3\x96y\xb3\xda\xe3\ -\xb1g\xc6\x80al\xe3\xdd\xacN\x0c\t\xb5Y\xca\xe6\xb2\xb4PU\xad\xa2\xaa\xa0V\ -\xb4\xfd\x90\x8fQ\x15U\xaa\xba\xa0F\x11\x90\xa5\xa8jEIi\x9c\x04BPlH\x8c\r\ -\x8e3\xde0^\xc7\xd8\x9e\x19\xcf\xf2f\x9fy3o\xbd\xf7\xdd{O?\x0c5\xb8\x04{h\ -\xcd\xa3\xd0\xf7\xfb\xf8t\xee\xfd\xfd\xff\xe7\xff\x8e\xce\xb9\xe7\xe8\x88\ -\xbf\xf9\x96RT\xa9R\xe57\xa2\x87j?\xeb\x10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\xb4\xf2\x0e\xa4w\x00i>@\xc3\x9a\x07\x19\xec9I\xa9\xb7\x97\xd8\x92G\xf1<\x81\ -\xdds\x8eP\xa0\x81\xba\xd5\x0f \xdd\x1f#\x0b{A&\xd0\x84\x0e\xce4\x94\x92x&h%\ -\xd0\x8b`\x85\x12\xe8V\x14ihX\xc1\x14\x9a\xeb\xa2d\x1b\x99\xae\xef\x10\n4\ -\xd2\xb0n\x1b\xba\xf33D\xe9(\xbe\xf58u+\xee\xa1x\xf2\x00\xba\xa3#T\x02\xbc\ -\xc0\xe5\x9d\xb9Y\xd03x\xd670U\x04\xa9\x04\x9a^\x83f\xbf\x84g<>\xaf\xfcjZ\ -\xb7\xa1\x15\xf6\xe0Y14[#\x14^H\xacm3\xba\xf3]p\x8eB\xd6C\xe9%j\x96n!`\xbd\ -\xceT\xd7AZ\xb6\xfd1\x9e\x9f\'{\xe4\x05\x12-\xab0\x93K\x90\xf9\x9d\x90\x05\ -\xaag0\xf3Bg\xd7\x92\xca\xd9b\xf5\xb0a\x141\x12\x04\t\xd8\xa3\xb0\xbf\x1ef\ -\x14\x18\x16j\xfdzJ\xfd\xef\xa0N\x85\xb0:\xda\x903\x93x"\x85wF\xa0\xc7\x9a\ -\xa1\x10@\x1e\x1c\x82B\x10\xad9\x8d\xd5t\x0b\xdaH3\x8c\xc7P\x85\x04\xaaX\xc4\ -}\x0f\x8cD#\xfe\xac\x81~x\x12\n\x1f\xde*\xae\x85X\x1d\xacM#F\x02XN\x07m\xdb\ -\xfe\x0c-\x1a\x01\xdf\xc7\x9f\x18B\x1e=\x8b\xb3h\x01\xce\x89\x12F\xb2\x19QN \ -\xf6\xcf@.\x88l\x1d\xc4h\xbc\x01m\xb8\x11\xe1%\xc1K\xa0r\xea\xf2\xce\xff\xf2\ -\xae\x1bB\x8e\x04\x10R@)\r\xddI\xfc%r^\xf9\x91O\xc0\xd1\x16X\x1f\x87\x91\xd8\ -\xdc\x12\xd5OAW\x042\x8b\x00\x10\x812\xf2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\xca3st~\xf9\xbd\xb6}9R\xce\xe0\x94\xce0\xe5\ -\x14\xb0j\x0c\xca\xf6Y\xce\x95\xaff\xd4\xff\xd0a\xe58\xb4\x9c\x9a\xa5aS\x0b\ -\'N\x0e\x11J\x984m\x88\xd0\xf5\xce\x14Gs\xc1\x8a\xd5\xfa\x8b\x82>8X\xb9\x83\ -\xc2|6O)\xdfC\xc7\r\x82rW\x08\xdb1\xf0\x85N$!\xa9_\xe4\xd0\xba\xccf\xd1\xb2\ -\x12{\xbb\xday\xe1\xe5\x16\x8a\xa54\xe9!\x85\xf4\x82\xdc\xbb\xe50\xb5m\x06g\ -\x0f\x05)\xe64\xac\xa8\xe0\xfa/g\t\xd7\xc2s\xffz\x17\xc7\xba\xb3\x18\xba\x86\ -\xb2u\xee\x7f\xb4\x9b\xabn\xd28\xb6\'\xc2\xf4\x84E\xacQ\xb1\xf2KYz\xfbR\x1c8\ -\xbc\x94\xaf\xac\xe9a\xf1\xaa\x085\xf5>\xe9A\x8b\xe3\'g\xb1\x9d\xd2\x858\xd3\ -iEm\x04\xb6\xeb\x18\xaa\\A\xae\xdb6\xc9\xf4p\x86\xe3\x87\xf2<\xf2T\x80\ -\xee\x936\xaf\xedX\xc0l\xb6\xba\xbc\xfa\x9fP\xed\xb5/\x18\xe1\xa0M4\x9a\xe7\ -\xbe?\x84Mw\xda<\xffb\xa8:8\xfe\x17\xe8\x9fu\x00U\xae,\xcf\xfeK3A\xb3\x81\ -\xda\x98\xcf\xd3\xcfI^\xfa\xe9\xa7s;\xf2\xff\x0b\x02\xbeQ\xfdt\xabR\xe5c\xa8\ -\xce\xbdU\xaa\\\x82\xea\x00\xa9R\xe5\x12\xfc\'\x84\xe1\x96s\xc0\xa1{O\x00\ -\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory037Bitmap(): - return wxBitmapFromImage(getDocFactory037Image()) - -def getDocFactory037Image(): - stream = cStringIO.StringIO(getDocFactory037Data()) - return wxImageFromStream(stream) - -index.append('DocFactory037') -catalog['DocFactory037'] = ImageClass() -catalog['DocFactory037'].getData = getDocFactory037Data -catalog['DocFactory037'].getImage = getDocFactory037Image -catalog['DocFactory037'].getBitmap = getDocFactory037Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory038Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rR\ -IDATx\x9c\xed\x9bYl]\xc7y\x80\xbf\x99\xb3\xdd\x95w\xe1\xe5*\x91\x94H\xca\xb6\ -lJ\xb2vyU";q%/\xf5\xa6zi\xed\xa2h\x11\x14\xb5\xd1\xc2m\x1f\xf2\x18\x14A\x81\ -\xa2\x8b\xd1 \xb0\xb3\xd5(Z\xb8N\xdd(\x89\x1d\xc7\x88d\'\xb2d+\nEI\x96\xb5R\ -\x96DR\\.w\xf2\x92w=\xe7\x9es\xa6\x0fte\xab\x8e-:\x11\xe5B\xbd\xdf\xe3\xc5\ -\x9c\xf3\xfd\xff\xfcw0sf0\xe2\xef\xbe\xa1\x14\x15*T\xf8\xb5\xe8\xa1\xea\xcf;\ -\x84\n\x15\xfe\xef\xa2\x07+\x03\xa4B\x85OD\x0f\'\xae\x8cH\xa00\xb0\x91x\x17\ -\xfd\xeeb\xe0b^\xb9\x18\x84\x8d\xf6\xbfbP@Y\x05\xf0\xd0\x16\xc4+\xf11E\t\x1f\ -IYY(\xc4\x82x*\\~\xf4P|\xe1%\x02\x9f\x86\xc2\x1e\xa2\xeey\xfc\x8f\xfc7\xa5\ -\x04i\xea\xe4\xdd8\xb9`;\xb3\xfa\x12\\\x02\x0b\x14\x83G\x93\xfd&U^\xefE1\x00\ -\xe8\x96\xc2\xd6j\xe8\xd1\xb6Q&tY\xbd\x1a\x0eK\xdd\x9f\x12(\x8f\xa2\x19\x82q\ -\xb9\x82\xb4\xbc\xf9\xb2:*,\x1c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P\ -\xe1\xf2\xf0\xfc\xbf5\x124\xeb\xa8\x8e\xf9<\xfb-\xc9\xcb?Y\x98\xdb\x91\xff\ -\xdf\x10\xf0\xb5\xca\'\\\x85\n\x9f@e\x0e\xaeP\xe1S\xa8\x0c\x90\n\x15>\x85\ -\xff\x06iu\x96sI3\xf6x\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory038Bitmap(): - return wxBitmapFromImage(getDocFactory038Image()) - -def getDocFactory038Image(): - stream = cStringIO.StringIO(getDocFactory038Data()) - return wxImageFromStream(stream) - -index.append('DocFactory038') -catalog['DocFactory038'] = ImageClass() -catalog['DocFactory038'].getData = getDocFactory038Data -catalog['DocFactory038'].getImage = getDocFactory038Image -catalog['DocFactory038'].getBitmap = getDocFactory038Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory039Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rU\ -IDATx\x9c\xed\x9bi\x8c]\xd5}\xc0\x7f\xe7\xdc\xed\xad\xf3\x96y\xb3\xda3c\xcf\ -\x8c\x01\xc3\xd8\xc6\xbbY\x9d\x18\x12j\xb3\x94\xcdei\xa1\xaaZEUA\xadh\xfb!\ -\x1f\xa3*\xaaTuA\x8d" KQ\xd5\x8a\x92\xd28\t\x84\xa0\xd8\x90\x18\x1b\x1cg\xbc\ -a\xbc\x8e\xb1=3\x9e\xe5\xcd>\xf3f\xdez\xef\xbb\xf7\x9e~\x18jp\t\xb6\x0b~\xa5\ -\x85\xf7\xfb\xf8t\xee\xff\xf7\xff\x9f\xf3\x8e\xce\xb9\xf7\xe8\x88\xbf\xf9\ -\x96RT\xa9R\xe57\xa2\x87j?\xeb\x14\xaaT\xf9\xbf\x8b\x1e\xacN\x90*U>\x16=\x9c\ -\xa8\xac@\xa00\xb0\x91x\x17\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x12\xac[U\xe6\xfbO\xcf\ -\xf0\xcc\x9f\x0f\xe1z\x82?\xfd\xc7\x05<\xf1\xf58o\xed\xfd\xdf\xb9J\xf0yG\x1f\ -\x1e\x1e\xfe\xacs\xa8\xf2)\xb8n\xeb\x143#\x19\x8e\x1d\xcc\xf3\xc8S\x01zN\xd8\ -\xbc\xb6}\x01s\xd9\xea\xf6\xeaJP\xed\xc5\xff\xe7\x84\x836\xd1h\x9e\xfb\xfe\ -\x106\xdei\xf3\xfc\x8b\xa1\xea\xe4\xb8\x82\xe8\x9fu\x02U>\x1d\xcf\xfeK3A\xb3\ -\x81\xda\x98\xcf\xd3\xcfI^\xfaienG~Q\x11\xf0\x8d\xea\xab\\\x95*\x1fCu-\xaeR\ -\xe5"T\'H\x95*\x17\xe1?\x01N\t\x96s06i\xb5\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory039Bitmap(): - return wxBitmapFromImage(getDocFactory039Image()) - -def getDocFactory039Image(): - stream = cStringIO.StringIO(getDocFactory039Data()) - return wxImageFromStream(stream) - -index.append('DocFactory039') -catalog['DocFactory039'] = ImageClass() -catalog['DocFactory039'].getData = getDocFactory039Data -catalog['DocFactory039'].getImage = getDocFactory039Image -catalog['DocFactory039'].getBitmap = getDocFactory039Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory040Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rT\ -IDATx\x9c\xed\x9bi\x8c]\xe5y\xc7\x7f\xef{\xb6\xbb\xce]\xe6\xcej\xcf\x8c=3\ -\x06\x0cc\x1b\xeffubH\xa8\xcdR6\x97\xa5\x85\xaaj\x15U\x05\xb5\xa2\xed\x87|\ -\x8c\xaa\xa8R\xd5\x055\x8a [Q\xd5\x8a\x92\xd28\t\x84\xa0\xd8\x90\x18\x1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xcc\xbb.\xd8N\ -\xf5\xd8\xb1\x12lXS\xe6\x07O\xcf\xf0\xcc_\x0e\xe1z\x82?\xff\xe7E<\xf1\xf58o\ -\xee\xff\xed<%\xb8R\xd0\x87\x87\x87\xbfh\x1f\xaa|\x06\xae\xdb>\xc5\xccH\x86\ -\x13\x87\xf3<\xf2T\x80\x9eS6\xaf\xee\\\xc4\\\xb6\xba\xbc\xaa$\xd5l\xfe?%\x1c\ -\xb4\x89F\xf3\xdc\xf7\xc7\xb0\xf9N\x9b\xe7^\x08U\x9bc\x01\xd0\xbfh\x07\xaa|6\ -\x9e\xfd\xb7f\x82f\x03\xb51\x9f\xa7\xbf#y\xf1g\x0b\xf3:\xf2JG\xc07\xaa[\xba*\ -U>\x81\xea\x9c\\\xa5\xca\xa7Pm\x90*U>\x85\xff\x062\x9d\x96s,\xcf\xb5\'\x00\ -\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory040Bitmap(): - return wxBitmapFromImage(getDocFactory040Image()) - -def getDocFactory040Image(): - stream = cStringIO.StringIO(getDocFactory040Data()) - return wxImageFromStream(stream) - -index.append('DocFactory040') -catalog['DocFactory040'] = ImageClass() -catalog['DocFactory040'].getData = getDocFactory040Data -catalog['DocFactory040'].getImage = getDocFactory040Image -catalog['DocFactory040'].getBitmap = getDocFactory040Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory041Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rW\ -IDATx\x9c\xed\x9by\x8c]\xd5}\xc7?\xe7\xdc\xed\xad\xf3\x96y\xb3\xda3c\xcf\x8c\ -\x01\xc3\xd8\xc6\xbbY\x9d\x18\x12\xd7f)\x9b\xcb\xd2BU\xb5\x8a\xaa\x82Z\xd1\ -\xf6\x8f\xfc\x19UQ\xa5\xaa\x0bj\x14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f\xe1\x96\ -\x11\xbe\x87\x92\x1aJ7P\xf2\xd7o\x87\x84\xeb \xdd2\xc0%cCJ\',\xaeE\xb9\x05\ -\xa4\xc6\xc5\x18@\x90Zj\x12\nua\x06[\x88\xc8\x8f\xeb\xf8\xba\x89\xd2t\xa4S\ -\x04!\xf1\rka\x82]\xc1S\xa0\x88\xfbE\xc2\xf9\xe5HJd\xd31\xae\x8bZ4\x84\xa6\ -\xc8\xc8\x0f\x0b|U\xf9)\xf5\xa1\xbf\x19X\xf0\xf4\xca\xf8\xba\xb5\xe0U\xb6\ -\x17\x86\x99\x81\x8f?\x03\xf8f\xf0\x92\x98\xab\xfc\xef\xd0k\xcc\xe1\x8a\x89Y\ -\xca\x01c\x03\x86\xfe6\xb1\x94\xcb\x8d\xbfw\x0bZ(\x08\xca\xa7\x9c\xb7\x19>\ -\xd2\xcf\xf8\xc94\x17zR\\\xb75\x8ac\x9c\xa3 \x82\x08\xe5af\xfa03}x\x85\x12\ -\x02\xb5\xb0\xf8\x04\x02\xd8\xa9\xe585\xad\xf0\xc1D\x12~\x19k\xbe\x1fc\xe6<\ -\xcav\x00\xb5\xb0@\x18\x01\x8a\xf57\xa2\x85k\x91\x81[\xb0\xac=h)\x97\x1b\x1f\ -\xdf\x8c\x11\t\x02`\x97\x153F\x04\x19\x90\xc4\xfc~\xcc\xd9sX\xf3}(\xdbE)\x05\ -f\x10/X\x8bYL\xa3\x148\xf1vJ\xa9\xae+z\x86\x85N\xad7Onv\x05\xb8\xdd\x08\rJ\ -\x85\xd5,\xb1&\x185\xa0$\x8d\xab\xcbO\xf9\x04\xd2\x870ri\xa4!q\xc3Mh\x85I|\ -\xbb\x8c0-\x1c\xbd\x1e\x99\x9dBH\x81\xbdx\x15^\xb4\x1e\x00#}\ncv\x18\x84\xa2\ -\x1co\xa5\xdc\xbc\xbcb=\xfd\xa2\xa3G8]11C\xe8\x08\xb3\x06]\xe6\xd0\x83\x02#\ -\x96"c\x15\xf0\x00+\x14\xa6\xe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\xa4\xef"5\x18\xcfD8w\ -\xa1\x86M+F\x01\xc1\xabo-\xe5\xe8\xe9\xda+zfs\x06B\xc0]\xb7\x8f\xb3\xa1k\x1a\ -\xd7\x97\x97\xf8^m~\x0b\x1a\x03l\xea\x1a\xa5\xeck\xbc\xf2V\x07GO_z\x1f\xc1\ -\xd0\xe1\xaf\xbe\x9e\xa3<4\xca\xeb\xdf\x19\xe0k\xff\xd0E\xffd\x94o>\x13\xa1z\ -\xf5\xad\xf2\x88E\x8b\xbe[\xf1\xb2\n\x01\xa1\xe0\x87\xb2\xae\x0b\xb6S\xfd\ -\xecX\t6\xac)\xf3\xbdgfy\xf6\xcf\x87q=\xc1\x9f\xfe\xe3"\x9e\xfcz\x9c\xb7\x0f\ -|6W\t\xbeh\xe8###\x9fw\x0cU~\x03n\xd81\xcd\xech\x86\x13\x87\xf3<\xfat\x80\ -\xdeS6\xaf\xefZ\xc4|\xb6\xba\xbd\xfa4\xa8V\xf5\xff\x19\xe1\xa0M4\x9a\xe7\xfe\ -?\x84\xcdw\xd9\xbc\xf0R\xa8:9>E\xf4\xcf;\x80*\xbf\x19\xcf\xfdk3A\xb3\x81\xda\ -\x98\xcf3\xcfK^\xfe\xc9\xa7s;\xb2\xca\x02\x02\xbeQ}\xb5\xabR\xe5\x13\xa8\xae\ -\xcdU\xaa\\\x86\xea\x04\xa9R\xe52\xfc\x17\x171\x96s\x9fY\xffI\x00\x00\x00\ -\x00IEND\xaeB`\x82' - -def getDocFactory041Bitmap(): - return wxBitmapFromImage(getDocFactory041Image()) - -def getDocFactory041Image(): - stream = cStringIO.StringIO(getDocFactory041Data()) - return wxImageFromStream(stream) - -index.append('DocFactory041') -catalog['DocFactory041'] = ImageClass() -catalog['DocFactory041'].getData = getDocFactory041Data -catalog['DocFactory041'].getImage = getDocFactory041Image -catalog['DocFactory041'].getBitmap = getDocFactory041Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory042Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00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b\xdc}\ -\xfb\x10\x9b;&)\xfb\x1a\xaf\xbe\xd5\xc8\xf1\xb3U\x1f\x8b5`y\xdc\xbaq\x94\x9b\ -V\x0f!}\x17\xa9\xc1H&\xc2\x85KUlY5\x04\x08^}k9\xc7\xcfV_\xd13\x9b3\x10\x02\ -\xee\xbe}\x84M\x1d\x13\xb8\xbe\x9c\xe3;\xdf\xfcf5z\xd9\xd21D\xd9\xd7x\xe5\ -\xad6\x8e\x9f\x9d{\x0f\xc1\xd0\xe1o\xbe\x9e\xa3\xdc?\xc4\xeb\xdf\xeb\xe5k\ -\xff\xd4A\xcfX\x94o>\x1b\xa1r\xe5\xed\xea!\x96,\xf9\xfe\xa2\x95W\x08\x08\x05\ -?\x94s]\xb0\x9d\xcag\xc7\xc5`\xd3\xba2?xv\x8a\xe7\xfer\x00\xd7\x13\xfc\xf9?/\ -\xe1\xa9\xaf\xc7y\xfb\xe0\xe7s\x95\xe0\xff+\xfa\xe0\xe0\xe0\x17\x1dC\x85yp\ -\xc3\xce\t\xa6\x862\x9c:\x9a\xe7\xb1g\x02t\x9d\xb1y}\xf7\x12f\xb2\x95\xed\ -\xd5\xd5\xa4R\xdd\xff#\x84\x836\xd1h\x9e\x07\xfe\x18\xb6\xdem\xf3\xc2K\xa1\ -\xca\xe4\xf8\x1c\xd0\xbf\xe8\x00*\xcc\x8f\xe7\xff\xad\x91\xa0YGu\xcc\xe7\xd9\ -\xefH^\xfe\xd9\xd5\xb9\x1dYa.\x02\xbeQy\xc5\xabP\xe1S\xa8\xac\xd1\x15*|\x06\ -\x95\tR\xa1\xc2g\xf0\xdf\xfb\xb6\x96s\xc2\xab2\x10\x00\x00\x00\x00IEND\xaeB`\ -\x82' - -def getDocFactory042Bitmap(): - return wxBitmapFromImage(getDocFactory042Image()) - -def getDocFactory042Image(): - stream = cStringIO.StringIO(getDocFactory042Data()) - return wxImageFromStream(stream) - -index.append('DocFactory042') -catalog['DocFactory042'] = ImageClass() -catalog['DocFactory042'].getData = getDocFactory042Data -catalog['DocFactory042'].getImage = getDocFactory042Image -catalog['DocFactory042'].getBitmap = getDocFactory042Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory043Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\ra\ -IDATx\x9c\xed\x9bil]\xc7u\xc7\x7f3w{+\xdf\xc2\xc7U")\x91\x94m\xd9\x94d\xed\ -\xf2\xaaDv\xe2J^\xeaM\xf5\xd2\xdaE\xd1"(j\xa3\x85\xdb~\xc8\xc7\xa0\x08\n\x14\ -]\x8c\x06\x81\xed&\xa9Q\xb4p\x9d\xbaQ\x12;\x8e\x11\xc9Nd\xc9V\x14j\xb3\xac\ -\x95\xb2$\x92\xe2\xf2\xb8\x93\x8f|\xeb\xbd\xef\xde;\xfd@G\xb6j[b)\xc96\xd0\ -\xf7\xfbx1\xe7\xfc\xcf93\x83\x99;\x83\x11\x7f\xf7\x1d\xa5\xa8P\xa1\xc2\xa7\ -\xa2\x87\xaa\xbf\xe8\x10*T\xf8\xf2\xa2\x07+\x13\xa4B\x85\xcfD\x0f\'.\xcf\x81\ -@a`#\xf1.\xf8\xeeb\xe0b^\x9e\xf3\xffK\x0c\xc2F\xfb_1(\xa0\xac\x02xhWEW\xe2c\ -\x8a\x12>\x92\xb2\xb2P\x88\xab\xa2S\xe1\x8bC\x0f\xc5\xe7o,\xf0i(\xec"\xea\ -\x9e\xc3\xff\xd8\xd8\x94\x12\xa4\xa9\x93w\xe3\xe4\x82\xed\xcc\xe8\x8bp\t\\~\ -\xb4\x9f\x1a\x83G\x93\xfd\x16U^\xcf\x051\x00\xe8\x96\xc2\xd6j\xe8\xd6\xb6P&t\ -Eu5\x1c\x16\xbb?\'P\x1eA3\x04cr\x19iy\xf3\x15\xd5\xa8\xf0\xc5\xa3\x87/c\x82X\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\x06,\x8f[\xd7\x8er\xd3\xf2!\xa4\xef"5\x18\xc9D8s\ -\xae\x8a\r\xcb\x86\x00\xc1ko/\xe6\xf0\xc9\xeaKjfs\x06B\xc0\xdd\xb7\x8f\xb0\ -\xaec\x02\xd7\x97\x17\xe8\xce5\xbfY\x1f\xbdl\xe8\x18\xa2\xeck\xbc\xfav\x1b\ -\x87O^\xf8\xfe\xc0\xd0\xe1o\xbe\x99\xa3\xdc?\xc4\x1b\xdf\xeb\xe5\x1b\xff\xd4\ -A\xcfX\x94o?\x1b\xa1\xf2\xd4\xed\xea#\x16,\xf8\xfee\x97Y\x08\x08\x05?r\xe3\ -\xba`;\x95c\xc7+\xc1\xbaUe~\xf0\xec\x14\xcf\xfd\xe5\x00\xae\'\xf8\xf3\x7f^\ -\xc0S\xdf\x8c\xf3\xce\xde\xcf\xe7)\xc1\xffw\xf4\xc1\xc1\xc1/:\x86\n\x17\xe1\ -\x86\xad\x13L\re8v0\xcfc\xcf\x04\xe8:a\xf3\xc6\xf6\x05\xccd+\xdb\xab\xcf\x83\ -J\x95\xbf\xe4\x84\x836\xd1h\x9e\x07\xfe\x186\xdem\xf3\xe2\xcb\xa1\xca\xe4\ -\xf8\x1c\xd1\xbf\xe8\x00*\\\x9c\xe7\xff\xbd\x91\xa0YGu\xcc\xe7\xd9\x17$\xaf\ -\xfc\xec\xea\xbc\x8e\xac\xf0\xe9\x08\xf8V\xe5W\xafB\x85\xcf\xa0\xb2VW\xa8p\ -\x11*\x13\xa4B\x85\x8b\xf0?\xe0J\x96s\x1b\xad\x04\x06\x00\x00\x00\x00IEND\ -\xaeB`\x82' - -def getDocFactory043Bitmap(): - return wxBitmapFromImage(getDocFactory043Image()) - -def getDocFactory043Image(): - stream = cStringIO.StringIO(getDocFactory043Data()) - return wxImageFromStream(stream) - -index.append('DocFactory043') -catalog['DocFactory043'] = ImageClass() -catalog['DocFactory043'].getData = getDocFactory043Data -catalog['DocFactory043'].getImage = getDocFactory043Image -catalog['DocFactory043'].getBitmap = getDocFactory043Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory044Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\r_\ -IDATx\x9c\xed\x9byp]\xd5}\xc7?\xe7\xdc\xed\xadz\x8b\x9eV[\x92-\xc9\x80A\xb6\ -\xf1nV\'\x86\x84\xda,esYZ\xe8t\xda\xc9t\n\xd3\x0em\xff\xc8\x9f\x99N\xa63\x9d\ -.L3\x19\xa0I\xcat\xda\xa1$$N\x02!LlH\x8c\r\x8e#o\x18\xaf2\xb6%Y\xcb\xd3.=\ -\xe9\xad\xf7\xbe{\xef\xe9\x1f\xa2\x06\x17\xb0%\xd7\x06\xfex\x9f?\xef\x9c\xdf\ -\xf9~\x7fg\x99s\xee9s\xc4?|G)*T\xa8\xf0\xa9\xe8\xa1\xea/\xdaB\x85\n_^\xf4`e\ -\x82T\xa8\xf0\x99\xe8\xe1\xc4\xe5\x05\n\x14\x066\x12\xef\x82\xef.\x06.\xe6\ -\x15\xb06G\x0f\xc2F\xfb?\x1e\x14PV\x01<\xb4\xab\xa2+\xf11E\t\x1fIYY(\xc4U\ -\xd1\xa9\xf0\xc5\xa3\x87\xe2\xf3\x0f\x12\xf84\x14v\x11u\xcf\xe1\x7fllJ\t\xd2\ -\xd4\xc9\xbbqr\xc1vf\xf4E\xb8\x04\xae\x9c\xdb\x0b\x89c-\xa2/\xf8\xb78\xd4]q\ -\xe3A\x86i*\xbe\xcc\xc9\x9f\xc7\x99N\x07@\x08\x10\x12\x80X\xa3\xcd\xb2\x07\ -\xdf\xa1h\xd43\xc1\xadWT7\xc40\r\xf6O9\xf6\xd3\x14\xb1\x85%Z\xd6\x1c\xa2\x10\ -\xbc\x9e2\x97\xd1\x90\x15\xbe\xf4\xe8\x91\xcb\xe8\xd7\x90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xd0u\xc2\xe6\x8d\xed\x0b\x98\xc9V\xb6W\x9f\'\x95\xd6\xfe\x92\ -\x12\x0e\xdaD\xa3y\x1e\xf8S\xd8x\xb7\xcd\x8b/\x87*\x93\xe3\x0b@\xff\xa2\rT\ -\xf8t\x9e\xff\xcfF\x82f\x1d\xd51\x9fg_\x90\xbc\xf2\x8b\xab\xf3:\xb2\xc2\xc5\ -\x11\xf0\xad\xca/_\x85\n\x9fAe\xcd\xaeP\xe1"T&H\x85\n\x17\xe1\x7f\x00\xc4\ -\xde\x96s\\si\xa2\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory044Bitmap(): - return wxBitmapFromImage(getDocFactory044Image()) - -def getDocFactory044Image(): - stream = cStringIO.StringIO(getDocFactory044Data()) - return wxImageFromStream(stream) - -index.append('DocFactory044') -catalog['DocFactory044'] = ImageClass() -catalog['DocFactory044'].getData = getDocFactory044Data -catalog['DocFactory044'].getImage = getDocFactory044Image -catalog['DocFactory044'].getBitmap = getDocFactory044Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory045Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\r\ -\\IDATx\x9c\xed\x9bil]\xc7y\x86\x9f\x99\xb3\xdd\x95w\xe1\xe5*\x91\x94H\xca\ -\xb6lJ\xb2vyU";q%/\xf5\xa6zi\xed\xa2h\x11\x14\xb5\xd1\xc2m\x7f\xe4gP\x04\x05\ -\x8a.F\x83\xc0\xceV\xa3h\xe1:u\xa3$v\x1c#\x92\x9d\xc8\x92\xad(\xd4fY+eI$\xc5\ -\xe5r\'/y\xd7s\xee9g\xfa\x83\xael\xd5\xb1t\x85J\xb2\x0b\xdc\xe7\xe7\xc17\xe7\ -}\xbf\x99\xf90s\xce`\xc4\xdf}K)\xaaT\xa9\xf2[\xd1C\x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\xd7\xdfY\xcc\ -\xe1\x93\xb5\x97\xd4\xcc\xe6\x0c\x84\x80{\xef\x1cc]\xd7\x14\xae//\xd0\xad4\ -\xbf\xf9w\xf4\xb3\xa1k\x84\xb2\xaf\xf1\xda;\x1d\x1c>y\xe1}\x03C\x87\xbf\xf9z\ -\x8e\xf2\xe0\x08o~\xaf\x9f\xaf\xfdS\x17}\x13Q\xbe\xf9|\x84\xea\xd5\xb6k\x8fX\ -\xb0\xe0\xfb\x97\xdd\xedB@(\xf8q3\xd7\x05\xdb\xa9\xfev\xbc\x12\xac[U\xe6\x07\ -\xcf\xcf\xf0\xc2_\x0e\xe1z\x82?\xff\xe7\x05<\xf3\xf58\xef\xee\xbd6W\t\xaa\\\ -\x88><<\xfcy{\xa8\xf2\tn\xda:\xc5\xccH\x86c\x07\xf3<\xf1\\\x80\x9e\x136on_\ -\xc0\\\xb6\xba\xbd\xfa<\xa8\xf6\xfa\x17\x8cp\xd0&\x1a\xcd\xf3\xd0\x1f\xc3\ -\xc6{m^z%T-\x8e\xcf\x11\xfd\xf36P\xe5B^\xfc\xb7f\x82f\x03\xb51\x9f\xe7\xbf#y\ -\xf5gW\xe7vd\x95\xca\x10\xf0\x8d\xea\xa7_\x95*\x9fAu\xed\xaeR\xe5"T\x0b\xa4J\ -\x95\x8b\xf0\xdf\xa9r\x96sLI-\x87\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory045Bitmap(): - return wxBitmapFromImage(getDocFactory045Image()) - -def getDocFactory045Image(): - stream = cStringIO.StringIO(getDocFactory045Data()) - return wxImageFromStream(stream) - -index.append('DocFactory045') -catalog['DocFactory045'] = ImageClass() -catalog['DocFactory045'].getData = getDocFactory045Data -catalog['DocFactory045'].getImage = getDocFactory045Image -catalog['DocFactory045'].getBitmap = getDocFactory045Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory046Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\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xc4\x16\x97hYw\x94B\xf0F\xca,\xa0p\x15\xfe\xdf\xa3G\x16\xd0\ -\xcf!%Hhk\x10~\x11\xa9)\x82q\x81\x11\x10(\x04\xa5|\x90\xb1.I~\xac\x99\x95\ -\xf7JL\xe3\xb7\x0c\x84\xef\xbfd\x1b"|\x0f\xe1\x96\x11\xbe\x87\x92\x1aJ7P\xf2\ -\xb3\xb7C\xc2u\x90n\x19\xe0\x12mH\xe9\x84\xc5\xf5(\xb7\x80\xd4\xb8\x18\x03\ -\x08RKMB\xa1\x0e\xcc`\x13\x11\xf9\xe9\xf7\xf8\xba\x89\xd2t\xa4S\x04!\xf1\rkn\ -\x82\xcd\xe3)P\xc4\xfd"\xe1\xfcr$%\xb2\xe9\x187D-\xeaB\x13d\xe4\xc7\x85[P~J}\ -\xeco\x06\xe6<\xbd2\xben\xcdy\x95\xed9\x99\x19\xf8t\x1b\xc07\x83\x97\xc4\\\ -\xe1\x8bA\xaf2\x07\xe7\x15Y\xca\x01c\x03\x86\xfe.\xb1\x94\xcb\xcd\x7fp\x1bZ(\ -\x08\xca\xa7\x9c\xb7\x19<\xda\xcb\xe8\xa94\x17\x0e\xa5\xb8ak\x14\xc78GA\x04\ -\x11\xca\xc3\xcc\xf4`fz\xf0\n%\x04jn\xf1\t\x04\xb0S\xcbq\xaa\x9a\xe1\xa3\x89\ -$\xfc2\xd6l/\xc6\xd4y\x94\xed\x00jn\x810\x02\x14koF\x0bW#\x03\xb7aY{\xd0R.7?\ -\xb9\x19#\x12\x04\xc0.+\xa6\x8c\x082 \x89\xf9\xbd\x98\xd3\xe7\xb0f{P\xb6\x8b\ -R\n\xcc ^\xb0\x1a\xb3\x98F)p\xe2\xad\x94R\x1d\xf3z\x86\x85N\xb57Knz\x05\xb8\ -\x9d\x08\rJ\x85\xd5,\xb1\xc6\x186\xa0$\x8d\x85\xe5\xa7|\x02\xe9\xc3\x18\xb94\ -\xd2\x90\xb8\xe1\x06\xb4\xc28\xbe]F\x98\x16\x8e^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xc1\x9f\xff\xf3"\ -\x9e\xfef\x9cw\x0f|1W\t*|6\xfa\xd0\xd0\xd0\xb5\x8e\xa1\x02p\xd3\x8eI\xa6\x87\ -3\x9c<\x92\xe7\xf1g\x03t\x9f\xb6ys\xd7"f\xb3\x95\xed\xd5\xb5\xa4R\xfd/\t\xe1\ -\xa0M4\x9a\xe7\xc1?\x86\xcd\xf7\xd8\xbc\xf4J\xa829\xbe\x04\xe8\xd7:\x80\ns\ -\xbc\xf0o\x8d\x04\xcd:\xaac>\xcf\xbd(y\xf5\xe7W\xe7vd\x85\xff\x1b\x02\xbeU\ -\xf9\x04\xacP\xe1s\xa8\xac\xe1\x15*\\\x86\xca\x04\xa9P\xe12\xfc7\x8e\x06\x96\ -sW\x86?\'\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory046Bitmap(): - return wxBitmapFromImage(getDocFactory046Image()) - -def getDocFactory046Image(): - stream = cStringIO.StringIO(getDocFactory046Data()) - return wxImageFromStream(stream) - -index.append('DocFactory046') -catalog['DocFactory046'] = ImageClass() -catalog['DocFactory046'].getData = getDocFactory046Data -catalog['DocFactory046'].getImage = getDocFactory046Image -catalog['DocFactory046'].getBitmap = getDocFactory046Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory047Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rY\ -IDATx\x9c\xed\x9bil\\\xd7y\x86\x9fs\xee6+g\xe1p\x95HJ$e[6%Y\xbb\xbc*\x91\x9d\ -\xa8\x92\x97zS\xbd\xb4vQ\xb4\x08\x8a\xdah\xe1\xb6?\xf23(\x82\x02E\x17\xa3A`\ -\xbbIj\x14-\\\xa7n\x94\xc4\x8ecD\xb2\x13Y\xb2\x15\x85\xda,k\xa5,\x89\xa4\xb8\ -\x0cwr\xc8Y\xef\x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s\xed>\x96&\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory047Bitmap(): - return wxBitmapFromImage(getDocFactory047Image()) - -def getDocFactory047Image(): - stream = cStringIO.StringIO(getDocFactory047Data()) - return wxImageFromStream(stream) - -index.append('DocFactory047') -catalog['DocFactory047'] = ImageClass() -catalog['DocFactory047'].getData = getDocFactory047Data -catalog['DocFactory047'].getImage = getDocFactory047Image -catalog['DocFactory047'].getBitmap = getDocFactory047Bitmap - - -#---------------------------------------------------------------------- -def getDocFactory048Data(): - return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xc8\x00\x00\x00\x19\x08\x06\ -\x00\x00\x00t:a\x14\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\rZ\ -IDATx\x9c\xed\x9bil]\xc7u\xc7\x7f3w{+\xdf\xc2\xc7U")\x91\x94m\xd9\x94d\xed\ -\xf2\xaaDv\xe2J^\xeaM\xf5\xd2\xdaE\xd1"(j\xa3\x85\xdb~\xc8\xc7\xa0\x08\n\x14\ -]\x8c\x06\x81\xed&\xa9Q\xb4p\x9d8Q\x12;\x8e\x11\xc9Nd\xc9V\x14j\xb3\xac\x95\ -\xb2$\x92\xe2\xf2\xb8\x93\x8f|\xeb\xbd\xef\xde;\xfd@W\xb6JY"P[R\x9b\xf7\xfbx\ -\xee\xdc\xfb?g\xce\x1c\xcc\xcc\x1d\x8c\xf8\xbbo)E\x85\n\x15.\x8a\x1e\xaa\xbe\ -\xda.T\xa8p\xed\xa2\x07+\x05R\xa1\xc2g\xa2\x87\x13\x17\x7f P\x18\xd8H\xbc\ -\x0b\xec.\x06.\xe6\x15p\xedc\x1f\x84\x8d\xf6?|P@Y\x05\xf0\xd0\xbe\x10]\x89\ -\x8f)J\xf8H\xca\xcaB!\xbe\x10\x9d\n\xd7>z(>\xd7(\xf0i(\xec"\xea\x9e\xc3\xff\ -\xd4\xd8\x94\x12\xa4\xa9\x93w\xe3\xe4\x82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afPB\ -\xa0f\'\x9f@\x00;\xb5\x14\xa7\xaa\x19>.$\xe1\x97\xb1fz0&\xcf\xa2l\x07P\xb3\ -\x13\x84\x11\xa0X{3Z\xb8\x1a\x19\xb8\r\xcb\xda\x89\x96r\xb9\xf9\xa9\x8d\x18\ -\x91 \x00vY1iD\x90\x01I\xcc\xef\xc1\x9c:\x835\xd3\x8d\xb2]\x94R`\x06\xf1\x82\ -\xd5\x98\xc54J\x81\x13o\xa5\x94\xea\xb8\xacfX\xe8T{3\xe4\xa6\x96\x81\xdb\x89\ -\xd0\xa0TX\xc9"k\x94!\x03J\xd2\x98_|\xca\'\x90>\x80\x91K#\r\x89\x1bn@+\x8c\ -\xe1\xdbe\x84i\xe1\xe8\xb5\xc8\xec8B\n\xec\x85+\xf0\xa2\xb5\x00\x18\xe9\x13\ -\x18S\x03 \x14\xe5x3\xe5\xc6\xa5Wb\x0cT\xb8\x04z\x84\x93s\x8c\x86\xd0\x11f\ -\x15\xba\xcc\xa1\x07\x05F,E\xc6*\xe0\x01V(L\xdb]k\xf1r\xdb\xc9\rwS\xc8\\G\ -\xc2\x1aA7g\x88dO\xa3\x973\x0c\x9d\x98d\xfcH\x16\xcf\xf5\xd1\x83:\x8d\x1b\ -\x124\xc4\x86(\x16\x17P\x08.D*\x8fH\xee\x14*;M\xff{\xc3\xe4\x06m\x84\x06f\ -\xc4\xa0\xfa\xa6(\xb5\xa1\x11\xec\xd0z\x84\x91B\x97y\xf4 \x18\xd1\x14\x85@\t\ -\x17\x0f7\xe8\xe20JD\r\x11\xcduAi\x9a\xe1C\xe3d\xba\xf3\x004nH\x12o\x0e1zt\ -\x1a=\xacS\xb3*C\xcew\x08\xe5\xba?S\xb3.<\x81Y\xb5\x89\xe1}\xa7\x18\xdc\xb3\ -\x0f\xe5{()8\xb5\xed\x17,}\xec!\x12Z?8G\xe6\x15\x9f\xaeJ\xc4\x02\xc7\xe9\xfe\ -e\x9aP\xadE\xf2\xc6a&\xba\xb2\x8c\x1f\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c7\x10e_\xe3\xf5w\xdb\ -8|\xf2\xc2{\x05\x86\x0e\x7f\xf3\xf5\x1c\xe5\xfe!\xde\xfaN/_\xfb\xa7\x0ez\xc6\ -\xa2|\xf3\xf9\x08\x95+l\xd7\x0eb\xc1\x82\xef~f:\x84\x80P\xf0\x93\xc7\xae\x0b\ -\xb6S\xf9\xed\xf8y\xb0nU\x99\xef=?\xc5\x0b\x7f9\x80\xeb\t\xfe\xfc\x9f\x17\ -\xf0\xcc\xd7\xe3\xbc\xb7\xf7\xca\\%\xa80?\xf4\xc1\xc1\xc1\xab\xed\xc3o%7m\ -\x9d`j(\xc3\xb1\x83y\x9ex.@\xd7\t\x9b\xb7\xb6/`&[Y^]KT\xb2q\x95\x08\x07m\xa2\ -\xd1<\x0f\xfd1l\xbc\xd7\xe6\xe5WC\x95\xe2\xb8\x06\xd1\xaf\xb6\x03\xbf\xad\ -\xbc\xf8\xef\x8d\x04\xcd:\xaac>\xcf\xbf$y\xedg_\xcc\xed\xc8\n\xff;\x04|\xa3\ -\xb2%\xacP\xe13\xa8\xcc\xe9\x15*\\\x82J\x81T\xa8p\t\xfe\x0bW.\x96s\xf9\x9f\ -\x89\xa7\x00\x00\x00\x00IEND\xaeB`\x82' - -def getDocFactory048Bitmap(): - return wxBitmapFromImage(getDocFactory048Image()) - -def getDocFactory048Image(): - stream = cStringIO.StringIO(getDocFactory048Data()) - return wxImageFromStream(stream) - -index.append('DocFactory048') -catalog['DocFactory048'] = ImageClass() -catalog['DocFactory048'].getData = getDocFactory048Data -catalog['DocFactory048'].getImage = getDocFactory048Image -catalog['DocFactory048'].getBitmap = getDocFactory048Bitmap - - diff --git a/sandbox/gschwant/docfactory/setup.py b/sandbox/gschwant/docfactory/setup.py deleted file mode 100755 index a79869899..000000000 --- a/sandbox/gschwant/docfactory/setup.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python - -from distutils.core import setup - -LONG_DESCRIPTION = """\ -DocFactory is a wxPython-GUI for Docutils. It is distributed as -a subpackage of Docutils (docutils.factory). The main front-end -(docfactory.py) is installed as a "script". After installation -you should find it in the scripts-directory of your Python -environment. - -System requirements: - -* Python 2.1.1 or later (http://www.python.org). -* wxPython 2.3.4.2 or later (http://wxpython.org). Be sure to get the - build matching the version of Python you're using. -* Docutils 0.2.2 or later (http://docutils.sourceforge.net). Use the - CVS snapshot. -""" - -def do_setup(): - dist = setup( - name = 'DocFactory', - description = 'wxPython-GUI for Docutils', - long_description = LONG_DESCRIPTION, - url = ('http://docutils.sourceforge.net/sandbox/gschwant/' - 'docfactory/'), - version = '0.2', - author = 'Dr. Gunnar Schwant', - author_email = 'g.schwant@gmx.de', - license = 'BSD (see LICENSE.txt)', - packages = ['docutils.factory'], - package_dir = {'docutils.factory': 'factory'}, - scripts = ['docfactory.py']) - return dist - - -if __name__ == '__main__' : - do_setup() diff --git a/sandbox/gschwant/htmlnav/README.txt b/sandbox/gschwant/htmlnav/README.txt deleted file mode 100644 index 370a8991f..000000000 --- a/sandbox/gschwant/htmlnav/README.txt +++ /dev/null @@ -1,183 +0,0 @@ -================== - README: htmlnav_ -================== - ----------------------------------------------------------- -An HTML writer for docutils which supports navigation-bars ----------------------------------------------------------- - -:Author: Gunnar Schwant -:Contact: g.schwant@gmx.de -:Date: $Date$ - -.. contents:: - -Introduction -============ - -This is the writer which I use to build my homepage: http://schwant.gmxhome.de. -[#]_ The name **htmlnav** is a short term for *HTML with navigation-bars*. - -System Requirements -=================== - -Docutils and everything needed to use docutils has to be -installed. - -Installation -============ - -Perform the usual ``setup.py install`` procedure. - -Usage -===== - -Most parts of the writer are inherited from David Goodger's ``html4css1``. -In fact, if no ``.nav``-files do exist in the destination directory, it -produces the same output as David's writer. - -Short example -------------- - -1. Go to docutils' "``tools``"-directory and create a file called - "``left.nav``" with the following contents:: - - colors | #000000 | #8E8E8E - section | Home - link | Python | http://www.python.org - link | Docutils | http://docutils.sf.net - raw |
- raw | © 2003 MyCompany - -2. Process "``test.txt``" to HTML using "``rst2htmlnav.py``":: - - rst2htmlnav.py test.txt test.html - - Open "``test.html``" in your browser. You will notice the left - navigation-bar. - -3. Create a file called "``right.nav``" in docutils' "``tools``"-directory. - This time the contents are:: - - colors | #000000 | #8E8E8E - section | Contact - link | me@MyCompany.org | mailto:me@mycompany.org - -4. Now perform step 2 again and open "``test.html``" in your browser. - You will notice that there is a right navigation-bar now. - -5. Create a file called "``top.nav``" in docutils' "``tools``"-directory - with the following contents:: - - color | #C8DBEB - cornerpic | ../docs/rst/images/ball1.gif - link | Home | test.html - link | Python | http://www.python.org - link | Docutils | http://docutils.sf.net - link | Search | http://www.google.com - -6. Once again perform step 2 and open "``test.html``" in your browser. - Now a top navigation-bar is there, too. - -.nav-files ----------- - -In order to get navigation-bars in the output-page you have to create -``.nav``-files in the destination directory. There are 4 types of -``.nav``-files: - -[file].nav - This defines the left navigation-bar of the output-file ``[file].html``. - (``[file]`` is the name of the output-file without extension.) - -left.nav - This defines the left navigation-bar of all output-files for which - no ``[file].nav``-file is present. - -right.nav - This defines the right navigation-bar of all output-files. - -top.nav - This defines the top navigation-bar of all output-files. - -.. important:: At least one of the files ``[file].nav`` and ``left.nav`` - has to be present. Otherwise no navigation-bars will be - added to the output file. - -.nav-file-entries ------------------ - -``.nav``-files contain a one-liner for each navigation-bar-entry. -In general such a one-liner is of the form - -:: - - parameter | value 1 | value 2 - -These are the different types of parameters: - -color -~~~~~ - -:Used in: ``top.nav`` -:Value 1: Background-color of all navigation-bars. -:Value 2: Not used. -:Example: ``color | #8E8E8E`` sets the navigation-bars' background-color - to ``#8E8E8E``. (The default color is white.) - -colors -~~~~~~ - -:Used in: ``[file].nav``, ``left.nav``, ``right.nav`` -:Value 1: Background-color of section entries. -:Value 2: Background-color of any other (non-section) entry. -:Example: ``colors | #000000 | #8E8E8E`` sets the background-color to be - ``#000000`` (black) for sections to be ``#8E8E8E`` (gray) for - any other entry. - -cornerpic -~~~~~~~~~ - -:Used in: ``top.nav`` -:Value 1: Path to the graphics file which will be displayed in the upper - left corner of the top navigation-bar. (The *width* of a - corner-picture should be 150 pixel.) -:Value 2: Not used. -:Example: ``cornerpic | pics/home.png`` sets the path of the corner-picture - to ``pics/home.png``. - -raw -~~~ - -:Used in: ``[file].nav``, ``left.nav``, ``right.nav`` -:Value 1: Any kind of text. -:Value 2: Not used. -:Example: ``raw |
`` will create an empty cell (a spacer) in - the navigation-bar. - -section -~~~~~~~ - -:Used in: ``[file].nav``, ``left.nav``, ``right.nav`` -:Value 1: Title of the section. -:Value 2: Not used. -:Example: ``section | Home`` will create a section with title *Home* in - the navigation-bar. - -link -~~~~ - -:Used in: ``[file].nav``, ``left.nav``, ``right.nav``, ``top.nav`` -:Value 1: Text to be displayed. -:Value 2: URL -:Example: ``link | Docutils | http://docutils.sf.net`` creates a link to - Docutils' homepage in the navigation-bar. - -Footnotes -========= - -.. [#] Sorry, my homepage is in german language. However, even if you - don't understand what the text says, you'll get an impression of the - writers output. - -.. _htmlnav: writer/htmlnav.py \ No newline at end of file diff --git a/sandbox/gschwant/htmlnav/rst2htmlnav.py b/sandbox/gschwant/htmlnav/rst2htmlnav.py deleted file mode 100644 index 7d68bfce8..000000000 --- a/sandbox/gschwant/htmlnav/rst2htmlnav.py +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env python - -# Author: Gunnar Schwant -# Contact: g.schwant@gmx.de -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -import locale -try: - locale.setlocale(locale.LC_ALL, '') -except: - pass - -from docutils.core import publish_cmdline, default_description - -description = (default_description) - -publish_cmdline(writer_name='htmlnav', description=description) diff --git a/sandbox/gschwant/htmlnav/setup.py b/sandbox/gschwant/htmlnav/setup.py deleted file mode 100644 index 22a200ce7..000000000 --- a/sandbox/gschwant/htmlnav/setup.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python - -from distutils.core import setup - -def do_setup(): - dist = setup( - name='html-with-navigation-bars-writer', - description='A HTML writer for Docutils which supports navigation bars', - url='http://docutils.sourceforg.net/sandbox/gschwant/htmlwnav/', - version='0.1', - author='Gunnar Schwant', - author_email='g.schwant@gmx.de', - license='Public Domain', - packages=['docutils.writers'], - package_dir={'docutils.writers':'writer'}, - scripts=['rst2htmlnav.py'] - ) - return dist - -if __name__ == '__main__': - do_setup() diff --git a/sandbox/gschwant/htmlnav/writer/htmlnav.py b/sandbox/gschwant/htmlnav/writer/htmlnav.py deleted file mode 100644 index 40b17b778..000000000 --- a/sandbox/gschwant/htmlnav/writer/htmlnav.py +++ /dev/null @@ -1,193 +0,0 @@ -# Author: Gunnar Schwant -# Contact: g.schwant@gmx.de -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -from docutils import writers, nodes, languages -import docutils, html4css1, os - -class Writer(html4css1.Writer): - - def __init__(self): - writers.Writer.__init__(self) - self.translator_class = HTMLTranslator - -class HTMLTranslator(html4css1.HTMLTranslator): - - def __init__(self, document): - html4css1.HTMLTranslator.__init__(self, document) - self.navigation_bgcolor = '#FFFFFF' - self.body_prefix = [self.get_body_prefix()] - self.body_suffix = [self.get_body_suffix()] - - def get_body_prefix(self): - navtop = os.path.join(os.path.split(self.settings._destination)[0], - 'top.nav') - navright = os.path.join(os.path.split(self.settings._destination)[0], - 'right.nav') - if os.path.exists(navright): - colspan = 3 - width = '70%' - else: - colspan = 2 - width = '85%' - navleft = '%s%s' % (os.path.splitext(self.settings._destination)[0], - '.nav') - bgcolor = color1 = color2 = self.navigation_bgcolor - cornerpic = None - if not os.path.exists(navleft): - navleft = os.path.join(os.path.split(self.settings._destination)[0], - 'left.nav') - if os.path.exists(navleft): - if os.path.exists(navtop): - f = open(navtop, 'rt') - lines = f.readlines() - f.close() - for line in lines: - val = line.split('|') - for i in range(len(val)): - val[i] = val[i].strip() - if val[0] == 'color': - bgcolor = color1 = color2 = val[1] - self.navigation_bgcolor = bgcolor - if val[0] == 'cornerpic': - cornerpic = val[1] - body_prefix = '\n\n\n' - if os.path.exists(navtop): - body_prefix = body_prefix + '\n' \ - '' % body_prefix - f = open(navleft, 'rt') - lines = f.readlines() - f.close() - body_prefix = '%s\n\n\n\n' \ - % (body_suffix, color2, val[2], val[1]) - elif val[0] == 'colors': - (color1, color2) = (val[1], val[2]) - elif val[0] == 'section': - body_suffix = '%s\n' \ - % (body_suffix, val[1]) - else: - body_suffix = '%s%s' % (body_suffix, - val[1]) - elif val[0] == 'raw': - body_suffix = '%s\n' \ - % (body_suffix, color2, val[1]) - body_suffix = '%s\n
  ' % (body_prefix, - bgcolor, bgcolor, - colspan) - body_prefix = body_prefix + '\n' - body_prefix = '%s\n' % body_prefix - for line in lines: - val = line.split('|') - for i in range(len(val)): - val[i] = val[i].strip() - if val[0] == 'link': - body_prefix = '%s\n' \ - % (body_prefix, val[2], val[1]) - elif val[0] == 'raw': - body_prefix = '%s\n' \ - % (body_prefix, val[1]) - body_prefix = '%s\n
  ' \ - % (body_prefix, width) - else: - body_prefix = '\n\n' - return body_prefix - - def get_body_suffix(self): - bgcolor = color1 = color2 = self.navigation_bgcolor - navleft = '%s%s' % (os.path.splitext(self.settings._destination)[0], - '.nav') - if not os.path.exists(navleft): - navleft = os.path.join(os.path.split(self.settings._destination)[0], - 'left.nav') - navright = os.path.join(os.path.split(self.settings._destination)[0], - 'right.nav') - if os.path.exists(navleft) and os.path.exists(navright): - f = open(navright, 'rt') - lines = f.readlines() - f.close() - body_suffix = '  
 %s
 ' \ - % (body_suffix, color1) - if color1 != bgcolor: - body_suffix = '%s%s' \ - '
 %s
\n\n\n' \ - '\n' % body_suffix - elif os.path.exists(navleft): - body_suffix = '\n\n\n' - else: - body_suffix = '\n\n' - return body_suffix diff --git a/sandbox/ianb/extractor/default.css b/sandbox/ianb/extractor/default.css deleted file mode 100644 index 05e43aab5..000000000 --- a/sandbox/ianb/extractor/default.css +++ /dev/null @@ -1,245 +0,0 @@ -/* -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:date: $Date$ -:version: $Revision$ -:copyright: This stylesheet has been placed in the public domain. - -Default cascading style sheet for the HTML output of Docutils. -*/ - -.topic { - margin-left: 5em; -} - -.topic-title { - margin-left: -1em; -} - -body { - background-color: #eeeeee; - font-family: Arial, sans-serif; -} - -em { - font-family: Times New Roman, Times, serif; -} - -li { - list-style-type: circle; -} - -a.target { - color: blue } - -a.toc-backref { - text-decoration: none ; - color: black } - -a:hover { - background-color: #cccccc; -} - -cite { - font-style: normal; - font-family: monospace; - font-weight: bold; -} - -dd { - margin-bottom: 0.5em } - -div.abstract { - margin: 2em 5em } - -div.abstract p.topic-title { - font-weight: bold ; - text-align: center } - -div.attention, div.caution, div.danger, div.error, div.hint, -div.important, div.note, div.tip, div.warning { - // margin: 2em ; - background-color: #cccccc; - align: center; - //width: 60%; - // border: medium outset ; - padding: 3px; - } - -div.attention p.admonition-title, div.caution p.admonition-title, -div.danger p.admonition-title, div.error p.admonition-title, -div.warning p.admonition-title { - color: red ; - font-weight: bold ; - font-family: sans-serif; - text-align: center } - -div.hint p.admonition-title, div.important p.admonition-title, -div.note p.admonition-title, div.tip p.admonition-title { - font-weight: bold ; - font-family: sans-serif; - text-align: center } - -div.dedication { - margin: 2em 5em ; - text-align: center ; - font-style: italic } - -div.dedication p.topic-title { - font-weight: bold ; - font-style: normal } - -div.figure { - margin-left: 2em } - -div.footer, div.header { - font-size: smaller } - -div.system-messages { - margin: 5em } - -div.system-messages h1 { - color: red } - -div.system-message { - border: medium outset ; - padding: 1em } - -div.system-message p.system-message-title { - color: red ; - font-weight: bold } - -div.topic { - margin: 2em } - -h1, h2, h3, h4, h5, h6 { - font-family: Helvetica, Arial, sans-serif; - border: thin solid black; - background-color: #cccccc; - -moz-border-radius: 8px; - padding: 4px; - } - -h1.title { - text-align: center; - background-color: #444499; - color: #eeeeee; - border: medium solid black; - -moz-border-radius: 20px; - } - -h2.subtitle { - text-align: center } - -hr { - width: 75% } - -ol.simple, ul.simple { - margin-bottom: 1em } - -ol.arabic { - list-style: decimal } - -ol.loweralpha { - list-style: lower-alpha } - -ol.upperalpha { - list-style: upper-alpha } - -ol.lowerroman { - list-style: lower-roman } - -ol.upperroman { - list-style: upper-roman } - -p.caption { - font-style: italic } - -p.credits { - font-style: italic ; - font-size: smaller } - -p.first { - margin-top: 0 } - -p.label { - white-space: nowrap } - -p.topic-title { - font-weight: bold } - -pre.address { - margin-bottom: 0 ; - margin-top: 0 ; - font-family: serif ; - font-size: 100% } - -pre.line-block { - font-family: serif ; - font-size: 100% } - -pre.literal-block, pre.doctest-block { - margin-left: 2em ; - margin-right: 2em ; - background-color: #ffffff; - border: thin black solid; - padding: 5px; -} - -span.classifier { - font-family: sans-serif ; - font-style: oblique } - -span.classifier-delimiter { - font-family: sans-serif ; - font-weight: bold } - -span.interpreted { - font-family: sans-serif } - -span.option-argument { - font-style: italic } - -span.pre { - white-space: pre } - -span.problematic { - color: red } - -table { - margin-top: 0.5em ; - margin-bottom: 0.5em } - -table.citation { - border-left: solid thin gray ; - padding-left: 0.5ex } - -table.docinfo { - margin: 2em 4em } - -table.footnote { - border-left: solid thin black ; - padding-left: 0.5ex } - -td, th { - padding-left: 0.5em ; - padding-right: 0.5em ; - vertical-align: top } - -td > p:first-child, th > p:first-child { - margin-top: 0em } - -th.docinfo-name, th.field-name { - font-weight: bold ; - text-align: left ; - white-space: nowrap } - -h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { - font-size: 100% } - -tt { - //background-color: #eeeeee; - color: #000066 } - -ul.auto-toc { - list-style-type: none } diff --git a/sandbox/ianb/extractor/extractor.py b/sandbox/ianb/extractor/extractor.py deleted file mode 100644 index 697c47d8b..000000000 --- a/sandbox/ianb/extractor/extractor.py +++ /dev/null @@ -1,339 +0,0 @@ -#!/usr/bin/env python -""" -This module extracts the documentation from a module, and converts -it into a single reST document. - -Usage: - ./extractor.py some_module.py > some_module.txt -For more: - ./extractor.py --help - -The document is based on the module's docstring -- no other -documentation is implicitly included. - -Other documentation can be explicitly included by using the directives -``.. inline:: function_or_class`` or ``.. inline-all::``. - -The first directive includes the docstring from that function or -class. When the directive is encountered inside a class, it can refer -either to the global or local namespace, as in ``..inline:: -Document.add_child`` or ``.. inline:: add_child``. - -The second directive will include all children of the module or class, -except those which start with a ``"_"`` (i.e., private), those that -have ``:ignore:`` anywhere in their docstring, or those that have -already been included. - -You can also force a docstring to be ignored by using -``.. ignore:: function_or_class``. This is useful for properties, -whose documentation will not be extracted, or other times when -you want to document the function or class separately from its -docstring. - -TODO ----- - -* Allow docstrings to override the normal function argument - list (e.g., to hide non-public optional arguments). -* Some sort of table of contents support. - -""" - - -import os, re, sys -from docutils.readers.python import moduleparser - -class Document: - - def __init__(self, node, module): - self.node = node - self.parts = [] - self.children = {} - self.module = module - - def add_child(self, child): - self.children[child.name] = child - self.parts.append(child) - - def process(self): - for child in self.node.children: - self.process_node(child) - - def process_node(self, node): - if isinstance(node, moduleparser.Docstring): - self.parts.append(node.text) - elif isinstance(node, moduleparser.Class): - self.add_child(Class(node, self.module)) - elif isinstance(node, moduleparser.Function): - self.add_child(Function(node, self.module)) - - def documentation(self, context=None): - if context is None: - return Document.documentation(self, DocContext()) - newParts = [] - for part in self.parts: - if type(part) is type(""): - doc = self.module.substitute(part, self, context) - newParts.append(doc + "\n") - continue - if part.name.startswith('_') \ - and not part.name.startswith('__'): - continue - if context.seen(part): - continue - doc = part.documentation(context) - if doc.lower().find(':ignore:') != -1: - continue - newParts.append(indent(doc)) - context.setSeen(self) - return '\n'.join(newParts) - -class DocContext: - - def __init__(self): - self.partsSeen = {} - - def seen(self, obj): - return self.partsSeen.has_key(obj) - - def setSeen(self, obj): - self.partsSeen[obj] = 1 - -class Module(Document): - - def __init__(self, filename, text=None): - self.filename = filename - if text is None: - text = open(filename).read() - self.module_text = text - self.name = os.path.splitext(os.path.basename(filename))[0] - node = moduleparser.parse_module(text, filename) - Document.__init__(self, node, self) - self.imports = [] - self.subber = InlineSubstitution(self) - self.process() - - def substitute(self, s, currentNode=None, context=None): - return self.subber.substitute(s, currentNode, context) - - def process_node(self, node): - if isinstance(node, moduleparser.Import): - self.imports.append((node.names, node.from_name)) - else: - Document.process_node(self, node) - - def documentation(self, context=None): - return "%s\n%s\n\n%s" % \ - (self.name, - "=" * len(self.name), - Document.documentation(self, context=None)) - - def importText(self, im): - if im[1]: - return 'from %s import %s' % (im[1], im[0]) - else: - return 'import %s' % im[0] - -class InlineSubstitution: - - def __init__(self, rootNode): - self.rootNode = rootNode - - _inlineRE = re.compile(r'( *).. +inline:: *(.*)') - _inlineAllRE = re.compile(r'( *).. +inline-all:: *') - _ignoreRE = re.compile(r'( *).. ignore:: *(.*)\n?') - - def substitute(self, s, currentNode=None, context=None): - if currentNode is None: - currentNode = self.rootNode - s = self._ignoreRE.sub( - lambda m, cur=currentNode, con=context, : self._ignoreSubber(m, cur, con), - s) - s = self._inlineRE.sub( - lambda m, cur=currentNode, con=context: self._inlineSubber(m, cur, con), - s) - s = self._inlineAllRE.sub( - lambda m, cur=currentNode, con=context: self._inlineAllSubber(m, cur, con), - s) - return s - - def _inlineSubber(self, match, currentNode, context): - level = len(match.group(1)) - name = match.group(2).strip().split('.') - child = self._getChild(name, currentNode) - return indent(self.substitute(child.documentation(context), child), level) - - def _ignoreSubber(self, match, currentNode, context): - name = match.group(2).strip().split('.') - child = self._getChild(name, currentNode) - context.setSeen(child) - return '' - - def _getChild(self, name, currentNode): - nameList = name - obj = currentNode - while 1: - if not nameList: - return obj - if not obj.children.has_key(nameList[0]): - if currentNode is self.rootNode: - raise NameError, '%s not found' % '.'.join(name) - else: - return self._getChild(name, self.rootNode) - obj = obj.children[nameList[0]] - nameList = nameList[1:] - - def _inlineAllSubber(self, match, currentNode, context): - level = len(match.group(1)) - children = currentNode.children.keys() - children.sort() - children = [currentNode.children[name] for name in children] - allDocs = [] - for child in children: - if child.name.startswith('_'): - continue - doc = child.documentation(context) - if doc.lower().find(':ignore:') != -1: - continue - allDocs.append(self.substitute(doc, child)) - return indent('\n'.join(allDocs), level) - - - -class Function(Document): - - def __init__(self, node, module): - Document.__init__(self, node, module) - self.name = node.name - self.parameters = [] - self.process() - - def process_node(self, node): - if isinstance(node, moduleparser.ParameterList): - for parameter in node.children: - self.process_parameter(parameter) - else: - Document.process_node(self, node) - - def process_parameter(self, param): - ## @@: handle defaults, *args, etc. - if param.name == 'self': - return - if param.children: - val = ('default', (param.name, param.children[0].text)) - elif isinstance(param, moduleparser.ExcessPositionalArguments): - val = ('*', param.name) - elif isinstance(param, moduleparser.ExcessKeywordArguments): - val = ('**', param.name) - else: - val = ('normal', param.name) - self.parameters.append(val) - - def documentation(self, context): - d = "`%s(%s)`:\n" % (self.name, - ', '.join([self.parameterText(p) - for p in self.parameters])) - doc = Document.documentation(self, context) - if not doc: - doc = "Not documented." - return d + indent(doc) + "\n" - - def parameterText(self, param): - t, name = param - if t == 'normal': - return name - elif t == 'default': - return '%s=%s' % (name[0], name[1]) - elif t == '*': - return '*%s' % name - elif t == '**': - return '**%s' % name - else: - assert 0 - -class Class(Document): - - def __init__(self, node, module): - Document.__init__(self, node, module) - self.bases = [] - self.name = node.name - for attr, value in node.attlist(): - if attr == 'bases': - self.bases = value - self.process() - - def documentation(self, context): - if self.bases: - base = 'class `%s(%s)`:' % (self.name, self.bases) - else: - base = 'class `%s`:' % self.name - return base + "\n" + indent(Document.documentation(self, context)) - - -def indent(text, amount=4): - return '\n'.join([(' '*amount) + line for line in text.split('\n')]) - -def create_documentation(filename, output): - if type(output) is type(""): - output = open(output, 'w') - mod = Module(filename) - doc = mod.documentation() - if doc.lower().find(':ignore:') == -1: - output.write(mod.documentation()) - -######################################## -## Command-line interface -######################################## - -def main(options, args): - for arg in args: - if os.path.isdir(arg) and options.recurse: - main(options, [os.path.join(arg, f) for f in os.listdir(arg)]) - continue - if options.recurse and not arg.endswith('.py'): - continue - filename = os.path.splitext(arg)[0] + ".txt" - filename = os.path.join(options.output, filename) - filename = os.path.normpath(filename) - if not options.quiet: - sys.stdout.write('%s -> %s ...' % (os.path.normpath(arg), - filename)) - sys.stdout.flush() - create_documentation(arg, filename) - if not options.quiet: - sys.stdout.write('done.\n') - sys.stdout.flush() - -if __name__ == '__main__': - try: - from optparse import OptionParser - except ImportError: - from optik import OptionParser - parser = OptionParser() - parser.add_option('-r', '--recurse', - action="store_true", - dest="recurse", - default=0, - help="recurse into subdirectories") - parser.add_option('-o', '--output', - dest="output", - help="write documentation to FILE (or directory)", - metavar="FILE") - parser.add_option('-q', '--quiet', - dest="quiet", - default=0, - action="store_true", - help="be quiet") - (options, args) = parser.parse_args() - if len(args) == 1 and options.output \ - and not os.path.isdir(options.output): - if options.output == '-': - options.output = sys.stdout - create_documentation(args[0], options.output) - else: - if not options.output: - options.output = '.' - main(options, args) - - - diff --git a/sandbox/ianb/wiki/Wiki.py b/sandbox/ianb/wiki/Wiki.py deleted file mode 100644 index 1c90cfa99..000000000 --- a/sandbox/ianb/wiki/Wiki.py +++ /dev/null @@ -1,251 +0,0 @@ -""" -The Wiki module primarily exports the `WikiPage` class: -""" - -import os, re, time -from docutils import core, io -from docutils import readers - -__all__ = ['WikiPage', 'allPages', 'recentPages', - 'searchTitles', 'search', 'css'] - -## All the Wiki pages will be kept in this directory: -pageDir = '/usr/home/ianb/w/pypaper/pages/' - -class WikiPage(object): - """ - WikiPage is a class to represent one page in a WikiWikiWeb [#]_. - The page may or may not yet exist -- that is, it may not yet - have content. - - .. [#] http://c2.com/cgi-bin/wiki - - It has the following properties and methods: - - `html`: - A read-only property giving the HTML for the page. - If the page does not yet have content the text - ``"This page has not yet been created"`` is returned. - `text`: - The text for the page. To save new text, simply - assign to this property. - `title`: - The title of the page. - `name`: - The name of the page -- a canonical identifier. - Related to the title, but not necessarily the - same. - .. ignore: html - .. ignore: text - .. ignore: setText - .. ignore: title - - """ - - def __init__(self, pageName): - """ - Each page has a name, which is a unique identifier, for example - ``"FrontPage"``, which identifies the page in the URL and - for linking. - """ - self.name = pageName - - def basePath(self): - """ - :Ignore: yes - Returns the base path (sans extension) for this page - """ - return _basePath(self.name) - - basePath = property(basePath) - - def exists(self): - """Does this page have content yet?""" - return _exists(self.name) - - def html(self): - """Returns text of HTML for page (HTML fragment only)""" - if self.exists(): - html = open(self.basePath + ".html").read() - html = self._subWikiLinks(html) - return html - else: - return 'This page has not yet been created.' - - html = property(html) - - def preview(self, text): - """Returns an HTML preview of the text""" - return self._subWikiLinks(self._convertText(text)) - - _wikiLinkRE = re.compile(r'(]* href=")!(.*?)("[^>]*>)(.*?)()', - re.I+re.S) - - def _subWikiLinks(self, text): - return self._wikiLinkRE.sub(self._subLink, ' %s ' % text) - - def _subLink(self, match): - if _exists(match.group(2)): - return match.group(1) + match.group(2) + match.group(3) + match.group(4) + match.group(5) - else: - return '%s%s%s%s?%s' \ - % (match.group(4), match.group(1), match.group(2), - match.group(3), match.group(5)) - - def text(self): - """ - The text of the page. ReStructuredText is used, though the - parsing is internal to the module. You can assign to this - property to save new text for the page. - """ - if self.exists(): - return open(self.basePath + ".txt").read() - else: - return '' - - def setText(self, text): - """Sets the text for the page (and updates cached HTML at the - same time)""" - f = open(self.basePath + ".txt", 'w') - f.write(text) - f.close() - f = open(self.basePath + ".html", 'w') - f.write(self._convertText(text)) - f.close() - - def _convertText(self, text): - return self._cleanHTML(core.publish_string( - source=text, - reader=Reader(), - parser_name='restructuredtext', - writer_name='html')) - - def _cleanHTML(self, html): - return html[html.find(''):html.find('')] - - text = property(text, setText) - - def searchMatches(self, text): - """ - :Ignore: yes - """ - return self.searchTitleMatches(text) \ - or self.text().lower().find(text.lower()) != -1 - - def searchTitleMatches(self, text): - """ - :Ignore: yes - """ - return self.title().lower().find(text.lower()) != -1 - - def modifiedDate(self): - """Date modified (integer timestamp)""" - return os.stat(self.basePath + ".txt").st_mtime - - modifiedDate = property(modifiedDate) - - def modifiedDateText(self): - """Text representation of modified date""" - return time.strftime("%a %m/%d/%y", time.gmtime(self.modifiedDate())) - - modifiedDateText = property(modifiedDateText) - - def title(self): - """Page title""" - return self.name - - title = property(title) - -""" -Methods for searching the wiki pages: -""" - -def allPages(): - """All pages with content in the system""" - return [WikiPage(page[:-4]) - for page in os.listdir(pageDir) - if page.endswith('.txt')] - -def recentPages(): - """All pages, sorted by date modified, most recent first""" - pages = allPages() - pages.sort(lambda a, b: cmp(b.modifiedDate(), a.modifiedDate())) - return pages - -def searchTitles(text): - """Search page titles for ``text``, returning list of pages""" - return [page for page in allPages() - if page.searchTitleMatches(text)] - -def search(text): - """Search titles and bodies of pages for ``text``, returning list - of pages""" - return [page for page in allPages() - if page.searchMatches(text)] - - -def _basePath(name): - return os.path.join(pageDir, name) - -def _exists(name): - return os.path.exists(_basePath(name) + ".html") - -""" -There is one module global to be printed at the top of -every Wiki page: - - `css`: - The HTML to put the proper CSS at the top of the page. This - should be put in the ```` section of the page. -""" - -try: - f = open('default.css') -except IOError: - css = "" -else: - css = '\n' % f.read() - f.close() - -######################################## -## reST-specific stuff -######################################## - - -from docutils import nodes -from docutils.readers import standalone -from docutils.transforms import Transform - -class WikiLinkResolver(nodes.SparseNodeVisitor): - ":Ignore: yes" - - def visit_reference(self, node): - if node.resolved or not node.hasattr('refname'): - return - refname = node['refname'] - node.resolved = 1 - node['class'] = 'wiki' - # I put a ! here to distinguish Wiki links from other - # links -- Wiki links have to be fixed up at view time, - # to distinguish between dangling and resolved Wiki - # links. - node['refuri'] = '!' + refname - del node['refname'] - -class WikiLink(Transform): - ":Ignore: yes" - - default_priority = 800 - - def apply(self): - visitor = WikiLinkResolver(self.document) - self.document.walk(visitor) - -class Reader(standalone.Reader): - ":Ignore: yes" - - supported = standalone.Reader.supported + ('wiki',) - - default_transforms = standalone.Reader.default_transforms \ - + (WikiLink,) - diff --git a/sandbox/ianb/wiki/docs/Wiki.txt b/sandbox/ianb/wiki/docs/Wiki.txt deleted file mode 100644 index c63094529..000000000 --- a/sandbox/ianb/wiki/docs/Wiki.txt +++ /dev/null @@ -1,54 +0,0 @@ -Wiki -==== - -The Wiki module primarily exports the `WikiPage` class: - - class `WikiPage(object)`: - WikiPage is a class to represent one page in a WikiWikiWeb [#]_. - The page may or may not yet exist -- that is, it may not yet - have content. - - .. [#] http://c2.com/cgi-bin/wiki - - It has the following properties and methods: - - `html`: - A read-only property giving the HTML for the page. - If the page does not yet have content the text - ``"This page has not yet been created"`` is returned. - `text`: - The text for the page. To save new text, simply - assign to this property. - `title`: - The title of the page. - `name`: - The name of the page -- a canonical identifier. - Related to the title, but not necessarily the - same. - `exists()`: - Does this page have content yet? - `modifiedDate()`: - Date modified (integer timestamp) - `modifiedDateText()`: - Text representation of modified date - `preview(text)`: - Returns an HTML preview of the text - -There are also several searching methods: - - `allPages()`: - All pages with content in the system - `recentPages()`: - All pages, sorted by date modified, most recent first - `search(text)`: - Search titles and bodies of pages for ``text``, returning list - of pages - `searchTitles(text)`: - Search page titles for ``text``, returning list of pages - -There is one module global to be printed at the top of -every Wiki page: - - `css`: - The HTML to put the proper CSS at the top of the page. This - should be put in the ```` section of the page. \ No newline at end of file diff --git a/sandbox/mly/restblog/Makefile b/sandbox/mly/restblog/Makefile deleted file mode 100755 index d3403e589..000000000 --- a/sandbox/mly/restblog/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -DOCUTILTOOLPATH = /home/mly/palanga/python/docutils/docutils/tools/ -HTML = $(DOCUTILTOOLPATH)html.py -MAIN_INDEX = ./main_index.py -DATE_INDEX = ./date_index.py -SUBJ_INDEX = ./subj_index.py -KEYW_INDEX = ./keyw_index.py - -.SUFFIXES: .html .txt - -blogs := $(patsubst %.txt,%.html,$(wildcard *.txt)) - -all: $(blogs) index.html date_index.html subject_index.html keyword_index.html - -index.html: $(blogs) - $(MAIN_INDEX) - -date_index.html: $(blogs) - $(DATE_INDEX) - -subject_index.html: $(blogs) - $(SUBJ_INDEX) - -keyword_index.html: $(blogs) - $(KEYW_INDEX) - -# --trim-footnote-reference-space ersätter --snap... och funkar även i -# HTML - -.txt.html: - $(HTML) -len -o iso-8859-1 $< > $@ - -install: - scp *.html default.css thinkwar@thinkware.se:/home/t/thinkwar/www/home/magnus/blog/ - -clean: - rm *~ *.html diff --git a/sandbox/mly/restblog/README.txt b/sandbox/mly/restblog/README.txt deleted file mode 100755 index 132c2272c..000000000 --- a/sandbox/mly/restblog/README.txt +++ /dev/null @@ -1,5 +0,0 @@ -This is just a very early start of a web log -system. No documentation yet. Mail me for more -info: - - magnus@thinkware.se diff --git a/sandbox/mly/restblog/date_index.py b/sandbox/mly/restblog/date_index.py deleted file mode 100755 index f430fb08f..000000000 --- a/sandbox/mly/restblog/date_index.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/python -tt - -# date_index.py -# -# Create chronological index for reStructuredBlog -# -# (C) Magnus Lyckå, Thinkware AB, 2003 - -import glob, restblog -import cPickle as pickle - -IX_FILE_NAME = 'date_index.dat' - -try: - db = pickle.load(file(IX_FILE_NAME)) -except: - db = {'filenames':[], 'index':[]} - -for fn in glob.glob(restblog.source_pattern): - if not fn in db['filenames']: - db['filenames'].append(fn) - meta = restblog.Metadata(fn) - db['index'].append((meta.timestamp(), - meta.targetname(), - meta.subject())) -db['index'].sort() -db['index'].reverse() -pickle.dump(db, file(IX_FILE_NAME, 'w')) - -body = ['Index By Date\n--------------------\n\n'] -oldMonthYear = '' -for ts, fn, subj in db['index']: - monthYear = ts.strftime('%B %Y') - if monthYear != oldMonthYear: - body.append("\n\n%s\n.............................\n\n" % monthYear) - oldMonthYear = monthYear - body.append("* `%s %s`__\n\n__ %s\n" % ( - ts.strftime('%Y-%m-%d %H:%M'), subj, fn)) -restblog.makepage('date_index', "\n".join(body)) diff --git a/sandbox/mly/restblog/default.css b/sandbox/mly/restblog/default.css deleted file mode 100755 index f396362af..000000000 --- a/sandbox/mly/restblog/default.css +++ /dev/null @@ -1,43 +0,0 @@ -body {color: #600; background-color: #fed; - margin-left: 10%; margin-right: 10%; - text-align: left; - font-family: Verdana, Arial, sans-serif} -/*p { text-indent: 2em; margin-top: 0; margin-bottom: 0; }*/ -.title, .subtitle {text-align: center} -h1, h2, h3, h4, h5, h5 {font-family: Times, Times-New, Serif;} -pre.address {font-family: Verdana, Arial, sans-serif} -table{margin-top: 1em; margin-bottom: 1em} -table.table {text-align: center} -table.field-list{margin-top: 0.3em; margin-bottom: 0.3em} -.topic-title {margin-top: 1em} -tr {text-align: left} -th {text-align: left} -td {text-align: left} -dt {font-weight: bold; margin-top: 0.5em; margin-bottom: 0.2em} -dd p {margin-top: 0em} -dl, ol, ul {margin-top: 0.3em} -blockquote.last {margin-top: 0em} -.literal-block {color: #006; background-color: #def; - font-family: courier, monospace} -.literal {color: #006 ; font-family: courier, monospace} -.literal-block {margin-left: 10%; margin-right: 10%; - padding: 1ex} -div.document { - float:left; - width:70%; - background:#ffe; - border:2px solid #630; - margin:5px; - padding:10px; -} - -hr.footer { float:left; width:0%; height:0%} - -div.footer { - float:right; - width:20%; - background:#cfc; - border:2px solid #630; - margin:5px; - padding:10px; -} diff --git a/sandbox/mly/restblog/keyw_index.py b/sandbox/mly/restblog/keyw_index.py deleted file mode 100755 index 34261a721..000000000 --- a/sandbox/mly/restblog/keyw_index.py +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/python - -pass diff --git a/sandbox/mly/restblog/main_index.py b/sandbox/mly/restblog/main_index.py deleted file mode 100755 index ed1b68cea..000000000 --- a/sandbox/mly/restblog/main_index.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/python -tt - -# main_index.py -# -# Create main index for reStructuredBlog -# -# (C) Magnus Lyckå, Thinkware AB, 2003 - -import glob, restblog -import cPickle as pickle - -BLOGS_TO_SHOW = 5 - -db = [] -for fn in glob.glob(restblog.source_pattern): - meta = restblog.Metadata(fn) - db.append((meta.timestamp(), fn)) - -db.sort() -db.reverse() - -name = "Magnus Lyckå's Web Log".decode('latin1') -body = ['%s\n%s' % (name, '-'*len(name))] -body.append('*Here are my latest web logs*') -for ts, fn in db[:5]: - body.append("-----\n\n*%s*" % ts.strftime('%Y-%m-%d %H:%M')) - body.append(".. include:: %s" % fn) -restblog.makepage('index', "\n\n".join(body)) diff --git a/sandbox/mly/restblog/restblog.py b/sandbox/mly/restblog/restblog.py deleted file mode 100755 index 3c7862de5..000000000 --- a/sandbox/mly/restblog/restblog.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/python -tt - -# restblog.py -# -# Base functions for reStructuredBlog -# -# (C) Magnus Lyckå, Thinkware AB, 2003 -import mx.DateTime, locale, os -locale.setlocale(locale.LC_ALL, 'C') # I want English month names etc -from docutils.core import publish_string, default_description - -source_pattern = 'blog*.txt' -timestamp_format = '%Y-%m-%d %H:%M' - -class Metadata: - def __init__(self, fn): - self.fn = fn - - def timestamp(self): - return mx.DateTime.localtime(os.stat(self.fn)[-2]) - - def subject(self): - return file(self.fn).readline().strip() - - def targetname(self): - return self.fn[:-3]+'html' - -def makepage(fn, text): - #text = ('%s\n' - # '%s') - #file(fn+'.html', 'w').write(text % (title, body)) - file(fn+'.html', 'w').write(publish_string(text, writer_name='html')) diff --git a/sandbox/mly/restblog/subj_index.py b/sandbox/mly/restblog/subj_index.py deleted file mode 100755 index 34261a721..000000000 --- a/sandbox/mly/restblog/subj_index.py +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/python - -pass diff --git a/sandbox/mwh/README b/sandbox/mwh/README deleted file mode 100644 index 99910158e..000000000 --- a/sandbox/mwh/README +++ /dev/null @@ -1,2 +0,0 @@ -Just the one file at the moment: advopostwriter.py which subclasses -writers.html4css1.Writer to format reST like I like my advogato entries. diff --git a/sandbox/mwh/advopostwriter.py b/sandbox/mwh/advopostwriter.py deleted file mode 100644 index e2f98be0d..000000000 --- a/sandbox/mwh/advopostwriter.py +++ /dev/null @@ -1,59 +0,0 @@ -from docutils.writers import html4css1 -from docutils import nodes - -class Writer(html4css1.Writer): - W_init = html4css1.Writer.__init__ - def __init__(self): - self.W_init() - self.translator_class = MyHTMLTranslator - -def find_visible_child(node, starting_index, direction): - if direction == "forwards": - step = 1 - end = len(node) - else: - step = -1 - end = -1 - for i in range(starting_index, end, step): - if not isinstance(node[i], nodes.Invisible): - return node[i] - else: - return None - -class MyHTMLTranslator(html4css1.HTMLTranslator): - def visit_title(self, node): - self.body.append(self.starttag(node, 'b', '', - STYLE="font-variant: small-caps")) - self.context.append('\n') - def visit_document(self, node): - pass - def depart_document(self, node): - pass - def visit_paragraph(self, node): - if isinstance(node.parent, nodes.section): - index = node.parent.index(node) - prev = find_visible_child(node.parent, index - 1, "backwards") - if isinstance(prev, nodes.title): - self.body.append(self.starttag(node, 'blockquote', '\n')) - else: - self.body.append('

\n') - else: - html4css1.HTMLTranslator.visit_paragraph(self, node) - - def depart_paragraph(self, node): - if isinstance(node.parent, nodes.section): - index = node.parent.index(node) - next = find_visible_child(node.parent, index + 1, "forwards") - if not next: - self.body.append('\n\n') - else: - self.body.append("\n"); - else: - # this tends to include "

"s which advogato then - # discards. I don't care that much... - html4css1.HTMLTranslator.depart_paragraph(self, node) - - def visit_section(self, node): - pass - def depart_section(self, node): - pass diff --git a/sandbox/oliverr/docbook/README.txt b/sandbox/oliverr/docbook/README.txt deleted file mode 100644 index 33603c848..000000000 --- a/sandbox/oliverr/docbook/README.txt +++ /dev/null @@ -1,14 +0,0 @@ -2002-06-24 - -A DocBook writer for Docutils. - -It works okay so far, but still needs a bunch of work. - -The main missing pieces are bibliography elements, footnotes, -and citations. - -See docbook.py for more information. - -Ollie Rutherfurd -oliver@rutherfurd.net - diff --git a/sandbox/oliverr/docbook/rst2docbook.py b/sandbox/oliverr/docbook/rst2docbook.py deleted file mode 100644 index 75699c8c9..000000000 --- a/sandbox/oliverr/docbook/rst2docbook.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python - -# Author: Ollie Rutherfurd -# Contact: oliver@rutherfurd.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -A minimal front end to the Docutils Publisher, producing DocBook XML. -""" - -import locale -try: - locale.setlocale(locale.LC_ALL, '') -except: - pass - -from docutils.core import publish_cmdline, default_description - - -description = ('Generates DocBook XML documents from standalone reStructuredText ' - 'sources. ' + default_description) - -publish_cmdline(writer_name='docbook', description=description) - - -# :indentSize=4:lineSeparator=\n:noTabs=true:tabSize=4: diff --git a/sandbox/oliverr/docbook/setup.py b/sandbox/oliverr/docbook/setup.py deleted file mode 100644 index 2e57dc93d..000000000 --- a/sandbox/oliverr/docbook/setup.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python - -from distutils.core import setup - -def do_setup(): - dist = setup( - name='docbook-xml-writer', - description='A DocBook XML Writer for Docutils', - url='http://docutils.sourceforg.net/sandbox/oliverr/docbook/', - version='0.1', - author='Ollie Rutherfurd', - author_email='oliver@rutherfurd.net', - license='Public Domain', - packages=['docutils.writers'], - package_dir={'docutils.writers':'writer'}, - scripts=['rst2docbook.py'] - ) - return dist - - -if __name__ == '__main__': - do_setup() - -#:indentSize=4:lineSeparator=\n:maxLineLen=76:noTabs=true:tabSize=4:wrap=hard: diff --git a/sandbox/oliverr/docbook/writer/docbook.py b/sandbox/oliverr/docbook/writer/docbook.py deleted file mode 100644 index a7e3e5dda..000000000 --- a/sandbox/oliverr/docbook/writer/docbook.py +++ /dev/null @@ -1,1046 +0,0 @@ -#!/usr/bin/env python - -""" -:Author: Ollie Rutherfurd -:Contact: oliver@rutherfurd.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This module has been placed in the public domain. - -DocBook document tree Writer. - -This Writer converts a reST document tree to a subset -of DocBook. - -.. Note:: This is an unfinished work in progress. - -Document Types -============== - -This writer can create 3 types of DocBook documents: - -1. "article" *(default)* -2. "book" -3. "chapter" - -.. Note:: When creating a "book" document, all first-level - sections are output as "chapter" elements instead - of "section" as in "article" and "chapter". - -Mappings -======== - -Option List ------------ - -As there is no direct equivlent for a listing of program options -in DocBook_, as defined in reST_, a table containing the -option list contents is generated. - -Field List ----------- - -Like `Option List`_, there is not direct equivlent for -a Field List in DocBook, so this is done using a -"variablelist". - -.. NOTE:: It might be better to switch Definition List - to glossary or something similar, so Field List - and Definition List are generating the same type - of output. - -Bibliography Elements ---------------------- - -Here's how reST's bibliography elements are mapped -to DocBook elements: - -+--------------+---------------------------------------------+ -| reST Element | DocBook Element | -+==============+=============================================+ -| author | {doctype}info/author/othername | -| | or | -| | {doctype}info/authorgroup/author/othername | -| | if nested under ``authors`` | -+--------------+---------------------------------------------+ -| authors | {doctype}info/authorgroup/ | -+--------------+---------------------------------------------+ -| contact | {doctype}info/author/email | -+--------------+---------------------------------------------+ -| copyright | {doctype}info/legalnotice | -+--------------+---------------------------------------------+ -| date | {doctype}info/date | -+--------------+---------------------------------------------+ -| organization | {doctype}info/orgname | -+--------------+---------------------------------------------+ -| revision | concatenated with ``version`` into | -| | {doctype}info/edition | -+--------------+---------------------------------------------+ -| status | {doctype}info/releaseinfo | -+--------------+---------------------------------------------+ -| version | concatenated with ``revision`` into | -| | {doctype}info/edition | -+--------------+---------------------------------------------+ - -Note: ``{doctype}`` is the type of the DocBook document -being generated, one of the following: ``article``, -``book``, or ``chapter``. - -Todo -==== - -- Inline images -- need to figure out how to identify an inline image -- list item marks are not guarenteed to be what was specified (if they - are it is be coincidence, however unless one starts out of order - they should match most of the time). -- sidebar subtitle needs to go into sidebarinfo - -Should para, note, etc... not in a section at the start -of the document be stuffed into an untitled ``section``? - -""" - -__docformat__ = 'reStructuredText' - -import re -import string -from docutils import writers, nodes, languages -from types import ListType - -class Writer(writers.Writer): - - settings_spec = ( - 'DocBook-Specific Options', - None, - (('Set DocBook document type. ' - 'Choices are "article", "book", and "chapter". ' - 'Default is "article".', - ['--doctype'], - {'default': 'article', - 'metavar': '', - 'type': 'choice', - 'choices': ('article', 'book', 'chapter',) - } - ), - ) - ) - - output = None - """Final translated form of `document`.""" - - def translate(self): - visitor = DocBookTranslator(self.document) - self.document.walkabout(visitor) - self.output = visitor.astext() - - -class DocBookTranslator(nodes.NodeVisitor): - - XML_DECL = '\n' - - DOCTYPE_DECL = """\n""" - - def __init__(self, document): - nodes.NodeVisitor.__init__(self, document) - self.language = languages.get_language( - document.settings.language_code) - self.doctype = document.settings.doctype - self.doc_header = [ - self.XML_DECL % (document.settings.output_encoding,), - self.DOCTYPE_DECL % (self.doctype,), - '<%s>\n' % (self.doctype,), - ] - self.doc_footer = [ - '\n' % (self.doctype,) - ] - self.body = [] - self.section = 0 - self.context = [] - self.colnames = [] - self.footnotes = {} - self.footnote_map = {} - self.docinfo = [] - - def astext(self): - return ''.join(self.doc_header - + self.docinfo - + self.body - + self.doc_footer) - - def encode(self, text): - """Encode special characters in `text` & return.""" - # @@@ A codec to do these and all other - # HTML entities would be nice. - text = text.replace("&", "&") - text = text.replace("<", "<") - text = text.replace('"', """) - text = text.replace(">", ">") - return text - - def rearrange_footnotes(self): - """ - Replaces ``foonote_reference`` placeholders with - ``footnote`` element content as DocBook and reST - handle footnotes differently. - - DocBook defines footnotes inline, whereas they - may be anywere in reST. This function replaces the - first instance of a ``footnote_reference`` with - the ``footnote`` element itself, and later - references of the same a footnote with - ``footnoteref`` elements. - """ - for (footnote_id,refs) in self.footnote_map.items(): - ref_id, context, pos = refs[0] - context[pos] = ''.join(self.footnotes[footnote_id]) - for ref_id, context, pos in refs[1:]: - context[pos] = '' \ - % (footnote_id,) - - def attval(self, text, - transtable=string.maketrans('\n\r\t\v\f', ' ')): - """Cleanse, encode, and return attribute value text.""" - return self.encode(text.translate(transtable)) - - def starttag(self, node, tagname, suffix='\n', infix='', **attributes): - """ - Construct and return a start tag given a node - (id & class attributes are extracted), tag name, - and optional attributes. - """ - atts = {} - for (name, value) in attributes.items(): - atts[name.lower()] = value - - for att in ('id',): # node attribute overrides - if node.has_key(att): - atts[att] = node[att] - - attlist = atts.items() - attlist.sort() - parts = [tagname.lower()] - for name, value in attlist: - if value is None: # boolean attribute - # According to the HTML spec, ```` is good, - # ```` is bad. - # (But the XHTML (XML) spec says the opposite. ) - parts.append(name.lower()) - elif isinstance(value, ListType): - values = [str(v) for v in value] - parts.append('%s="%s"' % (name.lower(), - self.attval(' '.join(values)))) - else: - parts.append('%s="%s"' % (name.lower(), - self.attval(str(value)))) - return '<%s%s>%s' % (' '.join(parts), infix, suffix) - - def emptytag(self, node, tagname, suffix='\n', **attributes): - """Construct and return an XML-compatible empty tag.""" - return self.starttag(node, tagname, suffix, infix=' /', **attributes) - - def visit_Text(self, node): - self.body.append(self.encode(node.astext())) - - def depart_Text(self, node): - pass - - def visit_attention(self, node): - self.body.append(self.starttag(node, 'note')) - self.body.append('\n%s\n' - % (self.language.labels[node.tagname],)) - - def depart_attention(self, node): - self.body.append('\n') - - # author is handled in ``visit_docinfo()`` - def visit_author(self, node): - raise nodes.SkipNode - - # authors is handled in ``visit_docinfo()`` - def visit_authors(self, node): - raise nodes.SkipNode - - def visit_block_quote(self, node): - self.body.append(self.starttag(node, 'blockquote')) - - def depart_block_quote(self, node): - self.body.append('\n') - - def visit_bullet_list(self, node): - self.body.append(self.starttag(node, 'itemizedlist')) - - def depart_bullet_list(self, node): - self.body.append('\n') - - def visit_caption(self, node): - # NOTE: ideally, this should probably be stuffed into - # the mediaobject as a "caption" element - self.body.append(self.starttag(node, 'para')) - - def depart_caption(self, node): - self.body.append('') - - def visit_caution(self, node): - self.body.append(self.starttag(node, 'caution')) - self.body.append('\n%s\n' - % (self.language.labels[node.tagname],)) - - def depart_caution(self, node): - self.body.append('\n') - - # reST seems to handle citations as a labled - # footnotes, whereas DocBook doesn't from what - # I can tell, so I'm not sure how to give DocBook - # citations that result in equivlent output - # as the docutils html writer. - # - # Currently, citations are handled as footnotes, - # using the citation label as the footnote label - # which seems functionally equivlent, but the - # DocBook stylesheets for generating HTML output - # don't seem to be using the label for foonotes - # so this doesn't work. - # - # So I'm at a bit of a loss as to how to - # handle citations. Any ideas or suggestions would - # be welcome. - - # TODO: citation - def visit_citation(self, node): - self.visit_footnote(node) - - def depart_citation(self, node): - self.depart_footnote(node) - - # TODO: citation_reference - def visit_citation_reference(self, node): - self.visit_footnote_reference(node) - - def depart_citation_reference(self, node): - pass - - def visit_classifier(self, node): - self.body.append(' : ') - self.body.append(self.starttag(node, 'type')) - - def depart_classifier(self, node): - self.body.append('\n') - - def visit_colspec(self, node): - self.colnames.append('col_%d' % (len(self.colnames) + 1,)) - atts = {'colname': self.colnames[-1]} - self.body.append(self.emptytag(node, 'colspec', **atts)) - - def depart_colspec(self, node): - pass - - def visit_comment(self, node, sub=re.compile('-(?=-)').sub): - """Escape double-dashes in comment text.""" - self.body.append('\n' % sub('- ', node.astext())) - raise nodes.SkipNode - - # contact is handled in ``visit_docinfo()`` - def visit_contact(self, node): - raise nodes.SkipNode - - # copyright is handled in ``visit_docinfo()`` - def visit_copyright(self, node): - raise nodes.SkipNode - - def visit_danger(self, node): - self.body.append(self.starttag(node, 'caution')) - self.body.append('\n%s\n' - % (self.language.labels[node.tagname],)) - - def depart_danger(self, node): - self.body.append('\n') - - # date is handled in ``visit_docinfo()`` - def visit_date(self, node): - raise nodes.SkipNode - - # TODO: decoration - def visit_decoration(self, node): - pass - - def depart_decoration(self, node): - pass - - def visit_definition(self, node): - # "term" is not closed in depart_term - self.body.append('\n') - self.body.append(self.starttag(node, 'listitem')) - - def depart_definition(self, node): - self.body.append('\n') - - def visit_definition_list(self, node): - self.body.append(self.starttag(node, 'variablelist')) - - def depart_definition_list(self, node): - self.body.append('\n') - - def visit_definition_list_item(self, node): - self.body.append(self.starttag(node, 'varlistentry')) - - def depart_definition_list_item(self, node): - self.body.append('\n') - - def visit_description(self, node): - self.body.append(self.starttag(node, 'entry')) - - def depart_description(self, node): - self.body.append('\n') - - def visit_docinfo(self, node): - """ - Collects all docinfo elements for the document. - - Since reST's bibliography elements don't map very - cleanly to DocBook, rather than maintain state and - check dependencies within the different visitor - fuctions all processing of bibliography elements - is dont within this function. - - .. NOTE:: Skips processing of all child nodes as - everything should be collected here. - """ - - # XXX There are a number of fields in docinfo elements - # which don't map nicely to docbook elements and - # reST allows one to insert arbitrary fields into - # the header, We need to be able to handle fields - # which either don't map or nicely or are unexpected. - # I'm thinking of just using DocBook to display these - # elements in some sort of tabular format -- but - # to collecting them is not straight-forward. - # Paragraphs, links, lists, etc... can all live within - # the values so we either need a separate visitor - # to translate these elements, or to maintain state - # in any possible child elements (not something I - # want to do). - - docinfo = ['<%sinfo>\n' % self.doctype] - - authors = [] - author = '' - contact = '' - date = '' - legalnotice = '' - orgname = '' - releaseinfo = '' - revision,version = '','' - - for n in node: - if isinstance(n, nodes.author): - author = n.astext() - elif isinstance(n, nodes.authors): - for a in n: - authors.append(a.astext()) - elif isinstance(n, nodes.contact): - contact = n.astext() - elif isinstance(n, nodes.copyright): - legalnotice = n.astext() - elif isinstance(n, nodes.date): - date = n.astext() - elif isinstance(n, nodes.organization): - orgname = n.astext() - elif isinstance(n, nodes.revision): - revision = 'Revision ' + n.astext() - elif isinstance(n, nodes.status): - releaseinfo = n.astext() - elif isinstance(n, nodes.version): - version = 'Version ' + n.astext() - elif isinstance(n, nodes.field): - # XXX - import sys - print >> sys.stderr, "I don't do 'field' yet" - # since all child nodes are handled here raise an exception - # if node is not handled, so it doesn't silently slip through. - else: - print dir(n) - print n.astext() - raise self.unimplemented_visit(n) - - # can only add author if name is present - # since contact is associate with author, the contact - # can also only be added if an author name is given. - if author: - docinfo.append('\n') - docinfo.append('%s\n' % author) - if contact: - docinfo.append('%s\n' % contact) - docinfo.append('\n') - - if authors: - docinfo.append('\n') - for name in authors: - docinfo.append( - '%s\n' % name) - docinfo.append('\n') - - if revision or version: - edition = version - if edition and revision: - edition += ', ' + revision - elif revision: - edition = revision - docinfo.append('%s\n' % edition) - - if date: - docinfo.append('%s\n' % date) - - if orgname: - docinfo.append('%s\n' % orgname) - - if releaseinfo: - docinfo.append('%s\n' % releaseinfo) - - if legalnotice: - docinfo.append('\n') - docinfo.append('%s\n' % legalnotice) - docinfo.append('\n') - - if len(docinfo) > 1: - docinfo.append('\n' % self.doctype) - - self.docinfo = docinfo - - raise nodes.SkipChildren - - def depart_docinfo(self, node): - pass - - def visit_doctest_block(self, node): - self.body.append('\n') - self.body.append(self.starttag(node, 'programlisting')) - - def depart_doctest_block(self, node): - self.body.append('\n') - self.body.append('\n') - - def visit_document(self, node): - pass - - def depart_document(self, node): - self.rearrange_footnotes() - - def visit_emphasis(self, node): - #self.body.append(self.starttag(node, 'emphasis')) # XXX - self.body.append('') - - def depart_emphasis(self, node): - self.body.append('') - - def visit_entry(self, node): - tagname = 'entry' - atts = {} - if node.has_key('morerows'): - atts['morerows'] = node['morerows'] - if node.has_key('morecols'): - atts['namest'] = self.colnames[self.entry_level] - atts['nameend'] = self.colnames[self.entry_level \ - + node['morecols']] - self.entry_level += 1 # for tracking what namest and nameend are - self.body.append(self.starttag(node, tagname, '', **atts)) - - def depart_entry(self, node): - self.body.append('\n') - - def visit_enumerated_list(self, node): - # TODO: need to specify "mark" type used for list items - self.body.append(self.starttag(node, 'orderedlist')) - - def depart_enumerated_list(self, node): - self.body.append('\n') - - def visit_error(self, node): - self.body.append(self.starttag(node, 'caution')) - self.body.append('\n%s\n' - % (self.language.labels[node.tagname],)) - - def depart_error(self, node): - self.body.append('\n') - - # TODO: wrap with some element (filename used in DocBook example) - def visit_field(self, node): - self.body.append(self.starttag(node, 'varlistentry')) - - def depart_field(self, node): - self.body.append('\n') - - # TODO: see if this should be wrapped with some element - def visit_field_argument(self, node): - self.body.append(' ') - - def depart_field_argument(self, node): - pass - - def visit_field_body(self, node): - # NOTE: this requires that a field body always - # be present, which looks like the case - # (from docutils.dtd) - self.body.append(self.context.pop()) - self.body.append(self.starttag(node, 'listitem')) - - def depart_field_body(self, node): - self.body.append('\n') - - def visit_field_list(self, node): - self.body.append(self.starttag(node, 'variablelist')) - - def depart_field_list(self, node): - self.body.append('\n') - - def visit_field_name(self, node): - self.body.append(self.starttag(node, 'term')) - # popped by visit_field_body, so "field_argument" is - # content within "term" - self.context.append('\n') - - def depart_field_name(self, node): - pass - - def visit_figure(self, node): - self.body.append(self.starttag(node, 'informalfigure')) - self.body.append('
') - - def depart_figure(self, node): - self.body.append('
') - self.body.append('\n') - - # TODO: footer (this is where 'generated by docutils' arrives) - # if that's all that will be there, it could map to "colophon" - def visit_footer(self, node): - raise nodes.SkipChildren - - def depart_footer(self, node): - pass - - def visit_footnote(self, node): - self.footnotes[node['id']] = [] - atts = {'id': node['id']} - if isinstance(node[0], nodes.label): - # FIXME: this fails with the second auto-sequenece character - # used in the test document ``test.txt``. - atts['label'] = node[0].astext() - self.footnotes[node['id']].append( - self.starttag(node, 'footnote', **atts)) - - # replace body with this with a footnote collector list - # which will hold all the contents for this footnote. - # This needs to be kept separate so it can be used to replace - # the first ``footnote_reference`` as DocBook defines - # ``footnote`` elements inline. - self._body = self.body - self.body = self.footnotes[node['id']] - - def depart_footnote(self, node): - # finish footnote and then replace footnote collector - # with real body list. - self.footnotes[node['id']].append('\n') - self.body = self._body - self._body = None - - def visit_footnote_reference(self, node): - if node.has_key('refid'): - refid = node['refid'] - else: - refid = self.document.nameids[node['refname']] - - # going to replace this footnote reference with the actual - # footnote later on, so store the footnote id to replace - # this reference with and the list and position to replace it - # in. Both list and position are stored in case a footnote - # reference is within a footnote, in which case ``self.body`` - # won't really be ``self.body`` but a footnote collector - # list. - refs = self.footnote_map.get(refid, []) - refs.append((node['id'], self.body, len(self.body),)) - self.footnote_map[refid] = refs - - # add place holder list item which should later be - # replaced with the contents of the footnote element - # and it's child elements - self.body.append('') - - raise nodes.SkipNode - - # TODO: header - - # ??? does anything need to be done for generated? - def visit_generated(self, node): - pass - - def depart_generated(self, node): - pass - - def visit_hint(self, node): - self.body.append(self.starttag(node, 'note')) - self.body.append('\n%s\n' - % (self.language.labels[node.tagname],)) - - def depart_hint(self, node): - self.body.append('\n') - - def visit_image(self, node): - atts = node.attributes.copy() - atts['fileref'] = atts['uri'] - alt = None - del atts['uri'] - if atts.has_key('alt'): - alt = atts['alt'] - del atts['alt'] - if atts.has_key('height'): - atts['depth'] = atts['height'] - del atts['height'] - # NOTE: using win32 port of xsltproc and docbook-stylesheets-1.51.1 - # I'm getting the following error when transforming: - # Error C:\home\igor\src\gnome-xml\xpath.c:8023: Undefined - # namespace prefix xmlXPathCompiledEval: evaluation failed - # When I switched to version 1.49 of the docbook-stylesheets - # I didn't have this problem. - self.body.append('') - self.body.append('') - self.body.append(self.emptytag(node, 'imagedata', **atts)) - self.body.append('') - if alt: - self.body.append('' \ - '%s\n' % alt) - self.body.append('') - - def depart_image(self, node): - pass - - def visit_important(self, node): - self.body.append(self.starttag(node, 'important')) - - def depart_important(self, node): - self.body.append('') - - # @@@ Incomplete, pending a proper implementation on the - # Parser/Reader end. - def visit_interpreted(self, node): - self.body.append('\n') - - def depart_interpreted(self, node): - self.body.append('\n') - - def visit_label(self, node): - # getting label for "footnote" in ``visit_footnote`` - # because label is an attribute for the ``footnote`` - # element. - if isinstance(node.parent, nodes.footnote): - raise nodes.SkipNode - # TODO: handle citation label - elif isinstance(node.parent, nodes.citation): - raise nodes.SkipNode - - def depart_label(self, node): - pass - - def visit_legend(self, node): - # TODO: explain why this is empty.... - pass - - def depart_legend(self, node): - pass - - def visit_line_block(self, node): - self.body.append(self.starttag(node, 'literallayout')) - - def depart_line_block(self, node): - self.body.append('\n') - - def visit_list_item(self, node): - self.body.append(self.starttag(node, 'listitem')) - - def depart_list_item(self, node): - self.body.append('\n') - - def visit_literal(self, node): - self.body.append('') - - def depart_literal(self, node): - self.body.append('') - - def visit_literal_block(self, node): - self.body.append(self.starttag(node, 'programlisting')) - - def depart_literal_block(self, node): - self.body.append('\n') - - def visit_note(self, node): - self.body.append(self.starttag(node, 'note')) - self.body.append('\n%s\n' - % (self.language.labels[node.tagname],)) - - def depart_note(self, node): - self.body.append('\n') - - def visit_option(self, node): - self.body.append(self.starttag(node, 'command')) - if self.context[-1]: - self.body.append(', ') - - def depart_option(self, node): - self.context[-1] += 1 - self.body.append('') - - def visit_option_argument(self, node): - self.body.append(node.get('delimiter', ' ')) - self.body.append(self.starttag(node, 'replaceable', '')) - - def depart_option_argument(self, node): - self.body.append('') - - def visit_option_group(self, node): - self.body.append(self.starttag(node, 'entry')) - self.context.append(0) - - def depart_option_group(self, node): - self.context.pop() - self.body.append('\n') - - def visit_option_list(self, node): - self.body.append(self.starttag(node, 'informaltable', frame='all')) - self.body.append('\n') - self.body.append('\n') - self.body.append('\n') - self.body.append('\n') - self.body.append('\n') - # FIXME: shouldn't hardcode everything... - self.body.append('Option\n') - self.body.append('Description\n') - self.body.append('\n') - self.body.append('\n') - self.body.append('\n') - - def depart_option_list(self, node): - self.body.append('') - self.body.append('\n') - self.body.append('\n') - - def visit_option_list_item(self, node): - self.body.append(self.starttag(node, 'row')) - - def depart_option_list_item(self, node): - self.body.append('\n') - - def visit_option_string(self, node): - pass - - def depart_option_string(self, node): - pass - - # organization is handled in ``visit_docinfo()`` - def visit_organization(self, node): - raise nodes.SkipNode - - def visit_paragraph(self, node): - self.body.append(self.starttag(node, 'para', '')) - - def depart_paragraph(self, node): - self.body.append('\n') - - # TODO: problematic - visit_problematic = depart_problematic = lambda self, node: None - - def visit_raw(self, node): - if node.has_key('format') and node['format'] == 'docbook': - self.body.append(node.astext()) - raise node.SkipNode - - def visit_reference(self, node): - atts = {} - if node.has_key('refuri'): - atts['url'] = node['refuri'] - self.context.append('ulink') - elif node.has_key('refid'): - atts['linkend'] = node['refid'] - self.context.append('link') - elif node.has_key('refname'): - atts['linkend'] = self.document.nameids[node['refname']] - self.context.append('link') - self.body.append(self.starttag(node, self.context[-1], '', **atts)) - - def depart_reference(self, node): - self.body.append('' % (self.context.pop(),)) - - # revision is handled in ``visit_docinfo()`` - def visit_revision(self, node): - raise nodes.SkipNode - - def visit_row(self, node): - self.entry_level = 0 - self.body.append(self.starttag(node, 'row')) - - def depart_row(self, node): - self.body.append('\n') - - def visit_section(self, node): - if self.section == 0 and self.doctype == 'book': - self.body.append(self.starttag(node, 'chapter')) - else: - self.body.append(self.starttag(node, 'section')) - self.section += 1 - - def depart_section(self, node): - self.section -= 1 - if self.section == 0 and self.doctype == 'book': - self.body.append('\n') - else: - self.body.append('\n') - - def visit_sidebar(self, node): - self.body.append(self.starttag(node, 'sidebar')) - - def depart_sidebar(self, node): - self.body.append('\n') - - # author is handled in ``visit_docinfo()`` - def visit_status(self, node): - raise nodes.SkipNode - - def visit_strong(self, node): - # self.body.append(self.starttag(node, 'emphasis', role='strong')) # XXX - self.body.append('') - - def depart_strong(self, node): - self.body.append('') - - def visit_substitution_definition(self, node): - raise nodes.SkipNode - - def visit_substitution_reference(self, node): - self.unimplemented_visit(node) - - def visit_subtitle(self, node): - self.body.append(self.starttag(node, 'subtitle')) - - def depart_subtitle(self, node): - self.body.append('\n') - if isinstance(node.parent, nodes.sidebar): - self.body.append('\n') - - # TODO: system_message - visit_system_message = depart_system_message = lambda self, node: None - - def visit_table(self, node): - self.body.append( - self.starttag(node, 'informaltable', frame='all') - ) - - def depart_table(self, node): - self.body.append('\n') - - # TODO: target - visit_target = depart_target = lambda self,node: None - - def visit_tbody(self, node): - self.body.append(self.starttag(node, 'tbody')) - - def depart_tbody(self, node): - self.body.append('\n') - - def visit_term(self, node): - self.body.append(self.starttag(node, 'term')) - self.body.append('') - - def depart_term(self, node): - # Leave the end tag "term" to ``visit_definition()``, - # in case there's a classifier. - self.body.append('') - - def visit_tgroup(self, node): - self.colnames = [] - atts = {'cols': node['cols']} - self.body.append(self.starttag(node, 'tgroup', **atts)) - - def depart_tgroup(self, node): - self.body.append('\n') - - def visit_thead(self, node): - self.body.append(self.starttag(node, 'thead')) - - def depart_thead(self, node): - self.body.append('\n') - - def visit_tip(self, node): - self.body.append(self.starttag(node, 'tip')) - - def depart_tip(self, node): - self.body.append('\n') - - def visit_title(self, node): - # HACK: sidebar subtitle needs to go into sidebarinfo - # so it's easier to put the title in there too - if isinstance(node.parent, nodes.sidebar): - if isinstance(node.parent.children[1], nodes.subtitle): - self.body.append('') - self.body.append(self.starttag(node, 'title', '')) - - def depart_title(self, node): - self.body.append('\n') - - # XXX just a hack for now - def visit_title_reference(self, node): - #self.body.append(self.starttag(node, 'emphasis')) # XXX - self.body.append('') - - # XXX just a hack for now - def depart_title_reference(self, node): - self.body.append('') - - def visit_topic(self, node): - # TODO: map dedication to dedication - - # Table of Contents generation handled by DocBook - if node.get('class') == 'contents': - raise nodes.SkipChildren - elif node.get('class') == 'abstract': - self.body.append(self.starttag(node, 'abstract')) - self.context.append('abstract') - # generic "topic" element - # XXX I don't really know what else to do with it. - elif node.get('class','') == '': - self.body.append(self.starttag(node, 'section')) - self.context.append('section') - else: - # XXX debug code - print 'class:', node.get('class') - print node.__class__.__name__ - print node - print `node` - print dir(node) - self.unimplemented_visit(node) - - def depart_topic(self, node): - if len(self.context): - self.body.append('\n' % (self.context.pop(),)) - - # QUESTION: what to do for "transition"? - def visit_transition(self, node): - pass - - def depart_transition(self, node): - pass - - # author is handled in ``visit_docinfo()`` - def visit_version(self, node): - raise nodes.SkipNode - - def visit_warning(self, node): - self.body.append(self.starttag(node, 'warning')) - - def depart_warning(self, node): - self.body.append('\n') - - def unimplemented_visit(self, node): - raise NotImplementedError('visiting unimplemented node type: %s' - % node.__class__.__name__) - -# :collapseFolds=0:folding=sidekick:indentSize=4: -# :lineSeparator=\n:noTabs=true:tabSize=4: diff --git a/sandbox/oliverr/ht/README.txt b/sandbox/oliverr/ht/README.txt deleted file mode 100644 index 96dacfedb..000000000 --- a/sandbox/oliverr/ht/README.txt +++ /dev/null @@ -1,20 +0,0 @@ -================= -.ht Writer README -================= - -:Date: $Date$ - -This writer generates an .ht (HTML Template) file from reST for -consumption by ht2html_. - -* `hthtml.py `_ is the Writer. -* `rst2ht.py `_ is the front end script. - -Written by Ollie Rutherfurd, oliver@rutherfurd.net - -See http://www.rutherfurd.net/articles/rst-ht2html.html for information on -using this writer with ht2html_. - -.. _ht2html: http://ht2html.sourceforge.net/ - -.. :lineSeparator=\n:maxLineLen=76:noTabs=true:tabSize=4:wrap=hard: diff --git a/sandbox/oliverr/ht/TODO.txt b/sandbox/oliverr/ht/TODO.txt deleted file mode 100644 index a91834c5f..000000000 --- a/sandbox/oliverr/ht/TODO.txt +++ /dev/null @@ -1,10 +0,0 @@ -========= -TODO List -========= - -:Date: $Date$ - -* convert all chars > 128 to &#n;? -* add an option to try to break document to use all of page - below sections? - diff --git a/sandbox/oliverr/ht/hthtml.py b/sandbox/oliverr/ht/hthtml.py deleted file mode 100644 index 0e09e7eb2..000000000 --- a/sandbox/oliverr/ht/hthtml.py +++ /dev/null @@ -1,134 +0,0 @@ -# Author: Ollie Rutherfurd -# Contact: oliver@rutherfurd.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -Simple .ht (HyperText Template) document tree Writer. - -.ht tmeplate files are essentially normal HTML, with -an option set of RFC 2822-like headers at the top of -the file. There must be at least one blank line between -the last header and the start of the body HTML. - -See http://ht2html.sf.net/ for more information on -.ht files and ht2html.. -""" - -__docformat__ = 'reStructuredText' - -import os -from docutils import nodes -from docutils import writers -from docutils.writers.html4css1 import HTMLTranslator - - -class Writer(writers.Writer): - - supported = ('ht',) - """Formats this writer supports.""" - - settings_spec = ( - '.ht template-Specific Options', - None, - (('Specify base section (i.e. if 3, a top-level section ' - 'would be written as H3, 2nd level H4, etc...). Default is 3.', - ['--base-section'], - {'choices': ['1','2','3','4'], - 'default': '3', - 'metavar': ''}), - ('Specify a stylesheet URL, used verbatim. Default is ' - '"default.css".', - ['--stylesheet'], - {'default': 'default.css', 'metavar': ''}), - ('Specify a stylesheet file, relative to the current working ' - 'directory. The path is adjusted relative to the output HTML ' - 'file. Overrides --stylesheet.', - ['--stylesheet-path'], - {'metavar': ''}), - ('Format for footnote references: one of "superscript" or ' - '"brackets". Default is "superscript".', - ['--footnote-references'], - {'choices': ['superscript', 'brackets'], 'default': 'superscript', - 'metavar': ''}), - ('Remove extra vertical whitespace between items of bullet lists ' - 'and enumerated lists, when list items are "simple" (i.e., all ' - 'items each contain one paragraph and/or one "simple" sublist ' - 'only). Default: enabled.', - ['--compact-lists'], - {'default': 1, 'action': 'store_true'}), - ('Disable compact simple bullet and enumerated lists.', - ['--no-compact-lists'], - {'dest': 'compact_lists', 'action': 'store_false'}),)) - - relative_path_settings = ('stylesheet_path',) - - output = None - - def __init__(self): - writers.Writer.__init__(self) - self.translator_class = HTTranslator - - def translate(self): - visitor = self.translator_class(self.document) - self.document.walkabout(visitor) - self.output = visitor.astext() - self.stylesheet = visitor.stylesheet - self.body = visitor.body - - -class HTTranslator(HTMLTranslator): - - def __init__(self, document): - - # I don't believe we can embed any style content - # the header, so always link to the stylesheet. - document.settings.embed_stylesheet = 0 - document.settings.base_section = int(document.settings.base_section) - - HTMLTranslator.__init__(self, document) - # ht2html likes having a title, so add a default one - self.headers = {'title': 'None'} - stylesheet = self.get_stylesheet_reference(os.getcwd()) - if stylesheet: - self.headers['stylesheet']= stylesheet - # using first author found for .ht 'Author' header - self.has_author = 0 - - def astext(self): - headers = ''.join(['%s: %s\n' % (k,v) \ - for (k,v) in self.headers.items()]) - # kludge! want footer, but not '' - body = self.body_pre_docinfo + self.docinfo + self.body + \ - self.body_suffix[:-1] - - return ''.join([headers + '\n'] + body) - - def visit_author(self, node): - if not self.headers.has_key('author'): - self.headers['author'] = self.encode(node.astext()) - HTMLTranslator.visit_author(self, node) - - def visit_contact(self, node): - if not self.headers.has_key('author-email'): - self.headers['author-email'] = self.encode(node.astext()) - HTMLTranslator.visit_contact(self, node) - - def visit_title(self, node): - """Only 6 section levels are supported by HTML.""" - if isinstance(node.parent, nodes.topic): - HTMLTranslator.visit_title(self, node) - elif self.section_level == 0: - HTMLTranslator.visit_title(self, node) - # document title - title = node.astext() - self.headers['title'] = self.encode(title) - else: - # offset section level to account for ``base_section``. - self.section_level += (self.settings.base_section - 1) - HTMLTranslator.visit_title(self, node) - self.section_level -= (self.settings.base_section - 1) - - -# :indentSize=4:lineSeparator=\n:noTabs=true:tabSize=4: diff --git a/sandbox/oliverr/ht/rst2ht.py b/sandbox/oliverr/ht/rst2ht.py deleted file mode 100644 index 7da7f1c2c..000000000 --- a/sandbox/oliverr/ht/rst2ht.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python - -# Author: Ollie Rutherfurd -# Contact: oliver@rutherfurd.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -A minimal front end to the Docutils Publisher, producing an .ht -(HTML Template) file. -""" - -import locale -try: - locale.setlocale(locale.LC_ALL, '') -except: - pass - -from docutils.core import publish_cmdline, default_description - - -description = ('Generates .ht (HTML Template) documents from standalone reStructuredText ' - 'sources. ' + default_description) - -publish_cmdline(writer_name='hthtml', description=description) - - -# :indentSize=4:lineSeparator=\n:noTabs=true:tabSize=4: diff --git a/sandbox/paultremblay/README.txt b/sandbox/paultremblay/README.txt deleted file mode 100644 index 4fde07092..000000000 --- a/sandbox/paultremblay/README.txt +++ /dev/null @@ -1,36 +0,0 @@ -============================ - README: Docutils Extensions -============================ - -:Author: Paul Tremblay - -:Contact: phthenry@earthlink.net - -:Date: $Date$ - -:Web site: http://docutils.sourceforge.net/ - - - -======== -Overview -======== - -This directory contains a number of modules that add functionality to -docutils. - -1. The package docutils_nest adds functionality to docutils. XML authors - and developers might find it useful. Others will not find it useful. - - As its name implies, docutils_nest allows users to add nested inline - structure to a rst document. - - See the README.txt in /docutils_nest. - -2. rst_to_docbook - - This script has not been written. It will convert rst to docbook, - using xml tools such as xslt. - - - diff --git a/sandbox/paultremblay/docutils_nest/README.txt b/sandbox/paultremblay/docutils_nest/README.txt deleted file mode 100644 index 9908f8bb5..000000000 --- a/sandbox/paultremblay/docutils_nest/README.txt +++ /dev/null @@ -1,238 +0,0 @@ -.. WARNING TO PAUL: DON'T EDIT THIS FILE - -README: |scriptName| -^^^^^^^^^^^^^^^^^^^^^ -:Author: Paul Tremblay - -:Contact: phthenry@earthlink.net - -:Date: $Date$ - -:Web site: http://docutils.sourceforge.net/ - -.. contents:: - -.. |scriptName| replace:: docultils-nest-xml.py - -.. |moduleName| replace:: docutils_nest - -======== -Overview -======== - -The script |scriptName| extends the power of docultils by allowing XML authors -and developers to include nested inline markup in their documents. While -docutils allows for infinite nesting on the block level, it limits inline -markup to one level. The script |scriptName| elminates this shortcomming. An -XML author could write a document in rst format, and then with |scriptName| -translate it to robust XML, which he could then further transform to docbook -or any other form of XML he desired. Any type of XML markup is possible using -|script_name|. - -In addition to allowing for nested markup, |scriptName| allows you to choose -any type of inline markup you wish. - -Because users of docutils expressed differences as to how they wanted to mark -inline text, |scriptName| allows you to customize the markup. - -Quick Example -============= - -You wantd to include a comment with emphasized text in your final XML -document. You type:: - - [:comment: Maybe I should include *The Sun Also Rises?*] - - -You then issue the command: - -|scriptName| --output my_document.rst - -The output is:: - - Maye I should include The Sun Also - Rises? - - -Installation -============ - -1. Install python. (http://www.python.org) - -2. Install the docutils package. (http://docutils.sourceforge.net/) - -3. Install the PyXml package. (http://pyxml.sourceforge.net/) - -4. Install the |moduleName|. You will need to have cvs installed on -your machine. - - 1. Open a shell. Type - - :: - - cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/docutils login - - When asked for a password, simpy hit return. - - - 2. Download the |moduleName|. Type - - :: - - cvs -z3 - -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/docutils co - sandbox/paultremblay - - This command will download the directory sandbox/paultremblay to your - current directory. Change to the directory /sandbox/paultremblay. - - 3. Run the configuration script to set the path and location of the configuration file. - - :: - - python configure.py target = - - If no target is provided (or you choose not to run the configuration file), - the configuration file will be placed in /etc/|moduleName|. - - - 4. Install the modules in the usual way: - - python setup.py build - - python setup.py install - - -Use -=== - -|scriptName| ``--output file.rst`` - -You *must* specify an output option. - -In addition, you can specify any options you would if running docutils-xml.py: - -|scriptName| --indents --quiet --output otupt.xml file.rst - - -How to markup your document -=========================== - -By default, the nested_inline module uses the following structure to markup text:: - - [:some-tag test example: text [:nested: more text [text with brackets]]] - -This markup gets converted to:: - - text - -You begin inline markup with an opening bracket followed by a colon, with no - space. You then fill in the arguments by typing in words after the colon. A - colon marks the end of the beginning tag and begins the text. A closing - bracket marks the end of the inline text. - -Note that you can nest your markup to as many levels as you wish. You can also -use brackets just as you norally would and not worry that nest_inline will -confuse regular brackets with text meant to be treated as markup. However, the -brackets must be matched. Consider this markup: - -[:math-formula-containing-closing-bracket: 2x ] ] - -You might mean for the first closing bracket to be part of the formula, but -the nested_inline module will think it marks the end of your inline text. The -script will produce this output:: - - 2x] - -In order to overcome this problem, escape the first closing bracket -with literal markup:: - - [:math-forumula-containing-closing-bracket: 2x ``]`` ] - -Errors -====== - -The module nested_inline will not produce invalid XML. If you write a file -that has the potential to result in ill-formed XML, nested_inline produces an -error message, along with an error tag. Consider the following document:: - - - .. If the script converted the brackets to tag, you would get - - .. text - - *[:markup: text*] - -The result is:: - - [:markup: text] - -Customizing Markup -================== - -The nested_inline module reads from a customization file in order to determine how inline text is marked up. Change this document in order to change how you want to markup your text. - -The configuration file takes 6 values: - -- start-role: the way to mark the start of a role. The default is ":". - -- end-role: the way to mark the end of a role. The default is ":". - -- start-group: the way to mark the start of a group. The default is "[". - -- end-group: the way to mark the end of a group. The default is "]". - -- tag-name: the name of the inline tag. The default is "inline". - -- warning: the name of the warning messge for errors. The default is "problematic". - -Let's say you wanted to markup your text using parenethesis rather than brackets, and that you wanted your role to go outside of the parenthesis. You want your tag name to be "inline-tag", and your warning to be "warning." Your configuration file would look like this:: - - - - - - - - - - - - -You would then markup your text as:: - - :comment:(This is a comment with *italics*) - -The output would be:: - - This is a comment with italics - -Project Files & Directories -=========================== - -* README.txt: You're reading it. - -*|moduleName|: Contains all the modules for the script to run - -*doc: The documentation for the module, including a copy of this -README.txt. - -*scripts: the script |scriptName|. - -*test_files: Files to test the script. - - -Getting Help -============ - -Contact me. - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: diff --git a/sandbox/paultremblay/docutils_nest/configure.py b/sandbox/paultremblay/docutils_nest/configure.py deleted file mode 100644 index baa44d3c1..000000000 --- a/sandbox/paultremblay/docutils_nest/configure.py +++ /dev/null @@ -1,146 +0,0 @@ - -# /usr/bin/env python - -import sys, os -import docutils_nest.options_trem - -""" - -The configuration script gets the target from the command line. It creates a file with the configuration variable, and a short script for the rest of script to be able to read and locate he configuration files. - -""" - -def configure(): - target = get_target() - make_var_file(target) - make_location(target) - -def get_target(): - """ - This functions uses a module I wrote to parse options. If no options are - determined on the command line, the function returnst the default - /etc/nest_docutis - - """ - options_dict = { - 'target': [1, 't'], - } - options_obj = docutils_nest.options_trem.ParseOptions(sys.argv, - options_dict) - opt_dict, args = options_obj.parse_options() - if opt_dict == 0: - sys.stderr.write('invalid way to run configure:\n' - 'python configure.py --target ' - ) - sys.exit(1) - target = opt_dict.get('target') - if not target: - target = default_target() - return target - -def default_target(): - sys.stdout.write('using default /etc for configuration directory\n') - return '/etc' - -def make_var_file(target): - write_obj = open('var_file', 'w') - # write_obj.write('[global]\n') - write_obj.write(target) - write_obj.close() - -def make_location(target): - write_obj = open('docutils_nest/location.py', 'w') - write_obj.write( - """ -def get_location(): - return '%s' - - - """ - % target) - - -if __name__ == '__main__': - configure() - - - - - -""" -# /usr/bin/env python - -import sys, os -import options_trem - - -def configure(): - target = get_target() - change_setup(target) - change_script(target) - -def get_target(): - options_dict = { - 'target': [1, 't'], - } - options_obj = options_trem.ParseOptions(sys.argv, - options_dict) - opt_dict, args = options_obj.parse_options() - if opt_dict == 0: - sys.stdout.write('Will use the default configuration of /etc/nest_docutils\n') - return '/etc/docutils_nest' - target = opt_dict.get('target') - if not target: - return '/etc/docutils_nest' - return target - -def change_setup(target): - read_obj = open('setup.py', 'r') - write_obj = open('temp', 'w') - line = 1 - while line: - line = read_obj.readline() - index = line.find('data_files=') - if index > -1: - write_obj.write('data_files = [("%s", ["data/configure.xml"])],\n' % target) - else: - write_obj.write(line) - read_obj.close() - write_obj.close() - read_obj = open('temp', 'r') - write_obj = open('setup.py', 'w') - line = 1 - while line: - line = read_obj.readline() - write_obj.write(line) - read_obj.close() - write_obj.close() - - -def change_script(target): - - read_obj = open('docutils_nest/nest_docutils.py', 'r') - write_obj = open('temp', 'w') - line = 1 - while line: - line = read_obj.readline() - index = line.find('$configure$') - if index > -1: - write_obj.write("ext_location = '%s' # $configure$" % \ - target) - else: - write_obj.write(line) - read_obj.close() - write_obj.close() - read_obj = open('temp', 'r') - write_obj = open('docutils_nest/nest_docutils.py', 'w') - line = 1 - while line: - line = read_obj.readline() - write_obj.write(line) - read_obj.close() - write_obj.close() - -if __name__ == '__main__': - configure() -""" diff --git a/sandbox/paultremblay/docutils_nest/data/configure.xml b/sandbox/paultremblay/docutils_nest/data/configure.xml deleted file mode 100644 index 9d60fd139..000000000 --- a/sandbox/paultremblay/docutils_nest/data/configure.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/sandbox/paultremblay/docutils_nest/doc/README.txt b/sandbox/paultremblay/docutils_nest/doc/README.txt deleted file mode 100644 index 6d62f8764..000000000 --- a/sandbox/paultremblay/docutils_nest/doc/README.txt +++ /dev/null @@ -1,236 +0,0 @@ -README: |scriptName| -^^^^^^^^^^^^^^^^^^^^^ -:Author: Paul Tremblay - -:Contact: phthenry@earthlink.net - -:Date: $Date$ - -:Web site: http://docutils.sourceforge.net/ - -.. contents:: - -.. |scriptName| replace:: docultils-nest-xml.py - -.. |moduleName| replace:: docutils_nest - -======== -Overview -======== - -The script |scriptName| extends the power of docultils by allowing XML authors -and developers to include nested inline markup in their documents. While -docutils allows for infinite nesting on the block level, it limits inline -markup to one level. The script |scriptName| elminates this shortcomming. An -XML author could write a document in rst format, and then with |scriptName| -translate it to robust XML, which he could then further transform to docbook -or any other form of XML he desired. Any type of XML markup is possible using -|script_name|. - -In addition to allowing for nested markup, |scriptName| allows you to choose -any type of inline markup you wish. - -Because users of docutils expressed differences as to how they wanted to mark -inline text, |scriptName| allows you to customize the markup. - -Quick Example -============= - -You wantd to include a comment with emphasized text in your final XML -document. You type:: - - [:comment: Maybe I should include *The Sun Also Rises?*] - - -You then issue the command: - -|scriptName| --output my_document.rst - -The output is:: - - Maye I should include The Sun Also - Rises? - - -Installation -============ - -1. Install python. (http://www.python.org) - -2. Install the docutils package. (http://docutils.sourceforge.net/) - -3. Install the PyXml package. (http://pyxml.sourceforge.net/) - -4. Install the |moduleName|. You will need to have cvs installed on -your machine. - - 1. Open a shell. Type - - :: - - cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/docutils login - - When asked for a password, simpy hit return. - - - 2. Download the |moduleName|. Type - - :: - - cvs -z3 - -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/docutils co - sandbox/paultremblay - - This command will download the directory sandbox/paultremblay to your - current directory. Change to the directory /sandbox/paultremblay. - - 3. Run the configuration script to set the path and location of the configuration file. - - :: - - python configure.py target = - - If no target is provided (or you choose not to run the configuration file), - the configuration file will be placed in /etc/|moduleName|. - - - 4. Install the modules in the usual way: - - python setup.py build - - python setup.py install - - -Use -=== - -|scriptName| ``--output file.rst`` - -You *must* specify an output option. - -In addition, you can specify any options you would if running docutils-xml.py: - -|scriptName| --indents --quiet --output otupt.xml file.rst - - -How to markup your document -=========================== - -By default, the nested_inline module uses the following structure to markup text:: - - [:some-tag test example: text [:nested: more text [text with brackets]]] - -This markup gets converted to:: - - text - -You begin inline markup with an opening bracket followed by a colon, with no - space. You then fill in the arguments by typing in words after the colon. A - colon marks the end of the beginning tag and begins the text. A closing - bracket marks the end of the inline text. - -Note that you can nest your markup to as many levels as you wish. You can also -use brackets just as you norally would and not worry that nest_inline will -confuse regular brackets with text meant to be treated as markup. However, the -brackets must be matched. Consider this markup: - -[:math-formula-containing-closing-bracket: 2x ] ] - -You might mean for the first closing bracket to be part of the formula, but -the nested_inline module will think it marks the end of your inline text. The -script will produce this output:: - - 2x] - -In order to overcome this problem, escape the first closing bracket -with literal markup:: - - [:math-forumula-containing-closing-bracket: 2x ``]`` ] - -Errors -====== - -The module nested_inline will not produce invalid XML. If you write a file -that has the potential to result in ill-formed XML, nested_inline produces an -error message, along with an error tag. Consider the following document:: - - - .. If the script converted the brackets to tag, you would get - - .. text - - *[:markup: text*] - -The result is:: - - [:markup: text] - -Customizing Markup -================== - -The nested_inline module reads from a customization file in order to determine how inline text is marked up. Change this document in order to change how you want to markup your text. - -The configuration file takes 6 values: - -- start-role: the way to mark the start of a role. The default is ":". - -- end-role: the way to mark the end of a role. The default is ":". - -- start-group: the way to mark the start of a group. The default is "[". - -- end-group: the way to mark the end of a group. The default is "]". - -- tag-name: the name of the inline tag. The default is "inline". - -- warning: the name of the warning messge for errors. The default is "problematic". - -Let's say you wanted to markup your text using parenethesis rather than brackets, and that you wanted your role to go outside of the parenthesis. You want your tag name to be "inline-tag", and your warning to be "warning." Your configuration file would look like this:: - - - - - - - - - - - - -You would then markup your text as:: - - :comment:(This is a comment with *italics*) - -The output would be:: - - This is a comment with italics - -Project Files & Directories -=========================== - -* README.txt: You're reading it. - -*|moduleName|: Contains all the modules for the script to run - -*doc: The documentation for the module, including a copy of this -README.txt. - -*scripts: the script |scriptName|. - -*test_files: Files to test the script. - - -Getting Help -============ - -Contact me. - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: diff --git a/sandbox/paultremblay/docutils_nest/docutils_nest/__init__.py b/sandbox/paultremblay/docutils_nest/docutils_nest/__init__.py deleted file mode 100644 index b3d0c915b..000000000 --- a/sandbox/paultremblay/docutils_nest/docutils_nest/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -''' -modules for rtf2xml -''' diff --git a/sandbox/paultremblay/docutils_nest/docutils_nest/inline_to_xml.py b/sandbox/paultremblay/docutils_nest/docutils_nest/inline_to_xml.py deleted file mode 100644 index 316a47233..000000000 --- a/sandbox/paultremblay/docutils_nest/docutils_nest/inline_to_xml.py +++ /dev/null @@ -1,459 +0,0 @@ -import re, sys, os -import docutils_nest.well_formed_xml - -""" - - -""" - -class InlineToXML: - - """ - - """ - - - - def __init__( self, - start_role = ':', - end_role = ':', - start_group = '[', - end_group = ']', - place = 'inside', - tag_name = 'inline', - warning = 'problematic' - ): - - """ - - Required: - - nothing - - Options: - - start_role -- the text delimeter that marks the beginning of a role - - end_role -- the text delimeter that marks the end of a role - - start_group -- the text delimeter that marks the start of a group - - end_group -- the text delimiter that marks the end of a group - - place -- whether the role goes inside or outside of the group - - warning -- a string of text to describe problems - - warning_level -- will do away with this - - - """ - self.__start_role = str(start_role) - self.__end_role = str(end_role) - self.__start_group = str(start_group) - self.__end_group = str(end_group) - self.__place = str(place) - exp = self.__make_split_exp() - self.__split_exp = re.compile(exp) - exp = self.__role_exp_func() - self.__start_exp = re.compile(exp) - self.__token_list = [] - self.__reg_bracket = 0 # found regular brackets - self.__bracket_type = [] - self.__tag_name, self.__warning = self.__make_tag_names(tag_name, warning) - - def __make_tag_names(self, tag_name, warning): - tags = [tag_name, warning] - counter = 0 - for name in tags: - new_string = '' - counter += 1 - for char in name: - if not char.isalnum(): - char = '_' - new_string += char - first = new_string[:1] - is_letter = first.isalpha() - if not is_letter: - new_string = 'a' + new_string - if counter == 1: - new_tag_name = new_string - else: - new_warning = new_string - return new_tag_name, new_warning - - def __escape_value(self, value): - - """ - - Required: - - value -- a string - - Returns - - a string of escaped values - - Logic: - - Certain characters have special values in regular expressions. If - the user is using any of these special expressions, then they must - be escaped. - - - """ - special = ['[', ']', '(', ')', '{', '}', '.'] - if value in special: - value = '\\%s' % value - return value - - def __make_split_exp(self): - - """ - - Requires: - - nothing - - Returns: - - nothing - - Logic: - - Use the object values to form a regular expression that will be - used to split a string into tokens. The expression will be - different if the role is inside or outside the group. - - - """ - start_group = self.__escape_value(self.__start_group) - end_group = self.__escape_value(self.__end_group) - start_role = self.__escape_value(self.__start_role) - end_role = self.__escape_value(self.__end_role) - if self.__place == 'inside': - #\[:[^\[\]]+:\s?|\[|\] - exp = '(%s%s[^%s%s]+%s\s?|%s|%s)' % \ - (start_group, - start_role, - start_group, - end_group, - end_role, - start_group, - end_group - ) - - - else: - # :[^\[\]]+:\[|[|] - exp = '(%s[^%s%s]+%s%s|%s|%s)' %\ - (start_role, - start_group, - end_group, - end_role, - start_group, - start_group, - end_group - ) - return exp - - def __role_exp_func(self): - """ - - Requires: - - nothing - - Returns - - nothing - - Logic: - - Make a regular expression to marke the beginning of a group - - """ - start_group = self.__escape_value(self.__start_group) - end_group = self.__escape_value(self.__end_group) - start_role = self.__escape_value(self.__start_role) - end_role = self.__escape_value(self.__end_role) - if self.__place == 'inside': - exp = '%s%s(.*?)%s' % \ - (start_group, - start_role, - end_role - ) - else: - exp = '%s(.*?)%s%s' % \ - (start_role, - end_role, - start_group - ) - return exp - - - - def __well_formed_func(self, my_string): - """ - - Required: - - my_string --string to check - - Returns: - - 0 if the string can be convert to tags, and 0 otherwise - - Logic: - - Use the external module well_formed_xml to test that the tags are - balanced. If they are balanced, the module returns 1. Othewise it - returns 0 - - - """ - well_formed_obj = docutils_nest.well_formed_xml.WellFormed() - well_formed = well_formed_obj.well_formed(my_string) - return well_formed - - - - def __open_tag(self, my_string): - """ - - Requires: - - my_string --string to parse - - Returns: - - A string of arguments for an opening tag. - - Logic: - - Use a simple split expression to turn a string of values with a - space bewteen them into arguments: word1 word2 word3 => - arg1="word1" arg2="word2" arg3="word3" - - """ - arguments = my_string.split() - counter = 0 - final_string = '' - for argument in arguments: - counter += 1 - final_string += 'arg%s="%s" ' % (counter, argument) - final_string = final_string.replace(':', '') - return final_string[:-1] # chop off last space - - - - def __process_inside_group(self, inner_list): - """ - - Requires: - - inner_list -- a list of two values. The first is a string starting - and ending with a colon. :arg1 arg2: - - Returns: - - A string of tagged text. If the string can be converted to XML (or - tagged), then it is tagged: - - [':word1 word2:', 'text'] => text - - If the string cannot be tagged, it makes the following: - - [':word1 word2:', 'text'] => 'text' - - If the token is an opening bracket and a colon, make a new list => - [:word1: text] => [[:word1:, text]] - - If the token is a simple opening bracket, simply set the regular - bracket tag to true. - - If the token is a closed bracket, and the regular bracket is not - true, get the last item in the group. ([:word1: text]). Process - this list and get a string back. If there the list still has - items, add it to the text part: - - returned string = text - - list = [[:arg2:, "more text]] - - Becomes: - - list = [[:arg2:, 'more text '] - - Otherwise, add the token either to the final string, or to the - text portion of the list. - - """ - final_string = '' - for token in tokens: - start_role = self.__start_role_func(token) - ##print repr(token) - ##if token == ']' and not self.__reg_bracket: - if token == self.__end_group and self.__bracket_type and \ - self.__bracket_type[-1] == 'inline': - - inside_string = self.__token_list.pop() - parsed_string = self.__process_inside_group(inside_string) - if self.__token_list: - self.__token_list[-1][1] += parsed_string - else: - final_string += parsed_string - - self.__bracket_type.pop() - - # check for solitary closing brackets - elif token == self.__end_group and not self.__bracket_type: - sys.stderr.write('ending bracket may cause unwanted results\n') - if self.__token_list: - self.__token_list[-1][1] += token - else: - final_string += token - elif start_role: - self.__token_list.append([]) - self.__token_list[-1].append(token) - self.__bracket_type.append('inline') # inline bracket group - self.__token_list[-1].append('') - else: - # first test if you should add or pop list type - if token == self.__end_group: - ##self.__bracket_type.pop() - try: - self.__bracket_type.pop() - except IndexError: - pass - elif token[0:1] == self.__start_group: - self.__bracket_type.append('regular') # regular bracket group - - # now add the string to the right place - if self.__token_list: - self.__token_list[-1][1] += token # add to middle group - else: - final_string += token - if self.__token_list: - warning = 'WARNING Brackets not closed out\n' - warning += self.__token_list[0][0] + self.__token_list[0][1] - sys.stderr.write(repr(warning)) - warning = '<%s description="Brackets not closed properly"/>' % ( - self.__warning) - final_string += warning + self.__token_list[0][0] + self.__token_list[0][1] - self.__token_list = [] - - return final_string - - def make_tags(self, my_string): - my_list = re.split(self.__split_exp, my_string) - my_string = self.__tag(my_list) - return my_string - - - -if __name__ == '__main__': - start_role = ':' - end_role = ':' - start_group = '[' - end_group = ']' - place = 'inside' - - test_obj = InlineToXML( - start_role = start_role, - end_role = end_role, - place = place, - start_group = start_group, - end_group = end_group - ) - the_test_string = '[:role: test22 [:role2: text2]][]' - return_string = test_obj.make_tags(the_test_string) - print '@%s@' % return_string - - start_role = ':' - end_role = ':' - start_group = '[' - end_group = ']' - place = 'outside' - - test_obj = InlineToXML( - start_role = start_role, - end_role = end_role, - place = place, - start_group = start_group, - end_group = end_group - ) - - the_test_string = ':role:[ test :role2:[ text2]]' - return_string = test_obj.make_tags(the_test_string) - print return_string diff --git a/sandbox/paultremblay/docutils_nest/docutils_nest/nest_docutils.py b/sandbox/paultremblay/docutils_nest/docutils_nest/nest_docutils.py deleted file mode 100644 index 61941fbb1..000000000 --- a/sandbox/paultremblay/docutils_nest/docutils_nest/nest_docutils.py +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/env python -import sys, os -import docutils_nest.nested_inline -import docutils_nest.read_config -import docutils_nest.options_trem -import docutils_nest.location - -""" -converst an XML file to nested tags - - -""" -outer_dir = docutils_nest.location.get_location() -doc_nest_dir = os.path.join(outer_dir, '.docutils_nest') - - -class GetOptions: - def __init__(self, sys_string): - self.__sys_string = sys_string - - def get_options(self): - options_dict = { - 'output': [1,'o'] - } - options_obj = docutils_nest.options_trem.ParseOptions( - system_string = self.__sys_string, - options_dict = options_dict, - ) - - options, arguments = options_obj.parse_options() - output = '' - file = '' - if options == 0: - sys.stderr.write('Script will quit because of invalid options') - sys.exit(1) - output = options.get('output') - - if not output: - sys.stderr.write('must provide output for script to work\n') - sys.exit(1) - if arguments: - file = arguments[0] - - if not file: - sys.stderr.write('must provide a file for script to work\n') - sys.exit(1) - - return file, output - -class GetConfig: - - def __init__(self, file): - self.__file = file - - def get_config(self): - config_obj = docutils_nest.read_config.Configure(self.__file) - config_values = config_obj.read_configs() - return config_values - -class MakeTags: - def __init__( self, - file, - output, - config_values - - ): - self.__file = file - self.__output = output - self.__start_role = config_values.get('start_role') - self.__end_role = config_values.get('end_role') - self.__start_group = config_values.get('start_group') - self.__end_group = config_values.get('end_group') - self.__place_of_role = config_values.get('place_of_role') - self.__tag_name = config_values.get('tag_name') - self.__warning = config_values.get('warning') - - def make_tags(self): - convert_obj = docutils_nest.nested_inline.InlineBrackets( - file = self.__file, - output = self.__output, - start_role = self.__start_role, - end_role = self.__end_role, - start_group = self.__start_group, - end_group = self.__end_group, - place = self.__place_of_role, - tag_name = self.__tag_name, - warning = self.__warning - ) - convert_obj.make_tags() - - - - -class NestDocutils: - - def __init__(self, file, output): - self.__file = file - self.__output = output - - def nest_tags(self): - config_file = os.path.join(doc_nest_dir, 'configure.xml') - config_obj = GetConfig(config_file) - config_values = config_obj.get_config() - tags_obj = MakeTags(self.__file, self.__output, config_values) - tags_obj.make_tags() - -if __name__ == '__main__': - - # file = '/home/paul/lib/python/paul/restructure_tools/test_inline.xml' - # output = '/home/paul/paultemp/brackets_to_tags.temp.xml' - # nest_obj = NestDocutils(file, output) - # nest_obj.nest_tags() - # sys.exit(0) - options_obj = GetOptions(sys.argv) - file, output = options_obj.get_options() - config_file = os.path.join(doc_nest_dir, 'configure.xml') - config_obj = GetConfig(config_file) - config_values = config_obj.get_config() - tags_obj = MakeTags(file, output, config_values) - tags_obj.make_tags() - command = 'xmlvalid -c -v %s' % output - os.system(command) - diff --git a/sandbox/paultremblay/docutils_nest/docutils_nest/nest_utils.py b/sandbox/paultremblay/docutils_nest/docutils_nest/nest_utils.py deleted file mode 100644 index c158334f9..000000000 --- a/sandbox/paultremblay/docutils_nest/docutils_nest/nest_utils.py +++ /dev/null @@ -1,181 +0,0 @@ -""" - -This script converts a document marked up as rst to XML. It uses the -docutils-xml.py conversion tools, and then performs one more transformation to -convert text specially marked up to XML as well. - -NOTE: This is not part of the official docutils package. Rather, it is my own -extension. - -""" - -import os, sys -import docutils_nest.nest_docutils -import docutils_nest.rst_options - -class RstWithInline: - - def __init__(self, file, output, docutils_opts = []): - self.__file = file - self.__output = output - self.__docutils_opts = docutils_opts - - def convert(self): - - """ - - Requires: - - nothing - - Returns: - - nothing - - Logic: - - First convert the txt file to a temp XML file. Then convert this - temp file, chagning inline marked-up text to tags. - - """ - temp_file = self.__convert_restructure() - self.__convert_inline(temp_file) - - - - - def __convert_restructure(self): - """ - - Requires: - - nothing - - Returns: - - nothing - - Logic: - - Use the docuitls-xml script to convert the file from rst to XML - - - """ - import locale - try: - locale.setlocale(locale.LC_ALL, '') - except: - pass - ##--no-doctype - argv = self.__docutils_opts - argv.append('--no-doctype') - argv.append(self.__file) # input file - restructure_temp = '/tmp/restructure_text_temp' # temp output - argv.append(restructure_temp) - - - from docutils.core import publish_cmdline, default_description - - # I think this is just for the description at the beginning of the - # resulting file - description = ('Generates Docutils-native XML from standalone ' - 'reStructuredText sources. \n' - 'From script resruct_to_tei.py ' + default_description) - - # invoke the method for coversion - publish_cmdline(writer_name='xml', description=description, - argv = argv) - - return restructure_temp - # os.rename(restructure_temp, self.__output) - - def __convert_inline(self, temp): - - """ - - Requires: - - temp -- a valid, XML file converted from docutils-xml.py - - Returns: - - nothing - - Logic: - - Use the module nest_docutils to transform text marked up as inline to XML. - - """ - nest_obj = docutils_nest.nest_docutils.NestDocutils(temp, self.__output) - nest_obj.nest_tags() - - - - -def print_help_message(): - sys.stdout.write( - '\n\n' - 'Use For rst_convert_with_inline:\n' - '=================================' - '\n\n' - 'python rst_convert_with_inline.py [docuitls options] --output file.txt\n' - '(--output *must* be provided!)\n' - '\n\n' - 'An invalid docutils options will cause an error.\n' - 'Hold on while the docutils help message prints out...' - '\n\n' - ) - - - import locale - try: - locale.setlocale(locale.LC_ALL, '') - except: - pass - argv = ['--help'] - - from docutils.core import publish_cmdline, default_description - - # I think this is just for the description at the beginning of the - # resulting file - description = ('Generates Docutils-native XML from standalone ' - 'reStructuredText sources. \n' - 'From script resruct_to_tei.py ' + default_description) - - # invoke the method for coversion - publish_cmdline(writer_name='xml', description=description, - argv = argv) - -def convert_file(): - - options_dict = { - 'output': [1] - } - opt_obj = docutils_nest.rst_options.OptionsRst(sys.argv, options_dict) - inline_opts, args, doc_opts = opt_obj.parse_options() - if inline_opts == 0: - print_help_message() - sys.stderr.write('Script will now quite because of illegal options\n') - sys.exit(1) - try: - file = args[0] - except IndexError: - sys.stderr.write('You must provide a file for the script to convert.\n' - 'Script will now quit' - ) - sys.exit(1) - output = inline_opts.get('output') - if not output: - sys.stderr.write('You must provide an output option for the script to work\n' - 'Script will now quit\n' - ) - sys.exit(1) - convert_obj = RstWithInline(file, output, docutils_opts = doc_opts) - convert_obj.convert() - -if __name__ == '__main__': - # # file = os.path.join(nest_inline_location, 'nest_inline/test_files/simple1.txt') - # # output = os.path.join(nest_inline_location, 'nest_inline/output.xml') - convert_file() - - nest_inline_location = '/home/paul/lib/python/' diff --git a/sandbox/paultremblay/docutils_nest/docutils_nest/nested_inline.py b/sandbox/paultremblay/docutils_nest/docutils_nest/nested_inline.py deleted file mode 100644 index 7937f070e..000000000 --- a/sandbox/paultremblay/docutils_nest/docutils_nest/nested_inline.py +++ /dev/null @@ -1,352 +0,0 @@ -import os, re, sys, codecs - -import xml.sax.saxutils -import xml.sax - -# turn on this line if you want to disablenamespaces -##from xml.sax.handler import feature_namespaces - -##import paul.restructure_tools.handle_inline_text -import docutils_nest.inline_to_xml -# # import txt_to_xml.brackets_to_xml - -""" - -Inline -^^^^^^ - -:author: Paul Tremblay - -:revision: - - :revnumber: .2 - - :date: 2003-05-03 - - :revremark: When I first started writing this document. - - :revnumber: .21 - - :date: 2003-05-06 - - :revremark: Turned off namespaces. Tried "to get rid of using import .. - from" construction, since I don't understand it. - - :revnumber: .22 - - :date: 2003-05-09 - - :revremark: Documented the module. Escaped brackets such as \[. Escaped any - bracket in an attribute. - - :revnumber: .23 - - :date: 2003-05-31 - - :revremark: The user can now choose his or her own way to define groups. - -======== -Overview -======== - -This module gets a file and changes brackets to inline tags: - - - - Text [:word1 word2 word3: Text [:word1 word2: Text2 [regular bracket]]Text3] - - - - - - - - Text Text Text2 [regular bracket]Text3 - - - - -""" - - - - -class InlineHandler(xml.sax.saxutils.DefaultHandler): - """ - - Class for handling the XML file. SAX uses the methods in this class to - handle the data. - - - """ - def __init__( self, - write_obj, - start_role = ':', - end_role = ':', - start_group = '[', - end_group = ']', - place = 'inside', - tag_name = 'inline', - warning = 'problematic' - - ): - - """ - - - Requires: - - write_obj -- a write object - - Returns: - - nothing - - - Logic: - - Set the necessary parameters: - - self.__write_obj --the object for outputing text - - self.__name --name of current element - - self.__character --string containg characters in current - element. - - self.__in_block --whether the text is in a block element. - - self.__block_tags -- a list of tags that include blocks of - text. In other words, all tags except those tags that surround - inline items. - - self.__block_tags -- the string of all text and elements in - the current block. - - self.__handl_br_text_obj -- an object to handle all block text - that contains an open bracket. - - """ - self.__write_obj = write_obj - self.__name = '' - self.__character = '' - self.__in_block = 0 - self.__block_tags = ['paragraph', 'author', 'date', 'revision', - 'version'] - self.__block_tag_string = '' - # self.__handle_br_text_obj = \ - # rst_bracket_inline.handle_bracket_string.Inline() - self.__handle_br_text_obj = \ - docutils_nest.inline_to_xml.InlineToXML( - start_role = start_role, - end_role = end_role, - start_group = start_group, - end_group = end_group, - place = place, - tag_name = tag_name, - warning = warning - ) - - def startElement(self, name, attrs): - """ - - Logic: - - The SAX driver uses this function when if finds a beginning tag. - - Escape all opening and closing brackets for the values of - attributes, so they won't be processed. - - Make a string from the opening tag. If you are in a block element, - add this string to the block element string. Otherwise, write the - string to the file. - - - - """ - self.__name = name - if name in self.__block_tags: - self.__in_block = 1 - open_tag = '<%s' % name - keys = attrs.keys() - for key in keys: - att = key - value = attrs[key] - # kind of a kludge. Only escape text that is going to be unescaped - # later on - if self.__in_block: - value = value.replace('[', '\000') - value = value.replace(']', '\001') - open_tag += ' %s="%s"' % (att, value) - open_tag += '>' - if self.__in_block: - self.__block_tag_string += open_tag - else: - self.__write_obj.write(open_tag) - - - def characters(self, character): - """ - - Logic: - - The SAX driver uses this function when it finds text. - - If the text is between two literal tags, then I want to escape all - opening and closing brackts to that they are not processed. - - If the text is not between two literal tags, I want to escape a - backlash followed by a bracket. - - (Note: The only way that a file processed by docutils-xml will - pass on a backslash followed by a bracket is if the original file - has *2* backslashes followed by a bracket.) - - Add the changed string to the block test string. - - If the text is not in a block (which I don't think should happen), - it simply outputs it to the file. - - """ - - character = character.replace('&', '&') - character = character.replace('<', '<') - character = character.replace('>', '>') - if self.__in_block: - if self.__name == 'literal': - character = character.replace('[', '\000') - character = character.replace(']', '\001') - # replace escaped backslashes not in literal - else: - character = character.replace('\\]', '\001') - self.__block_tag_string += character - else: - self.__write_obj.write(character) - - - def endElement(self, name): - """ - - Logic: - - The SAX driver uses the function when it finds an end tag. It - pases to this function the name of the end element. - - If the name is a block element, the function checks if it has any - starting brackets. If it does, the string should be processed with - the handle bracket module. - - The text that has been escaped is not unescaped, and the string is - written to the output file. - - If the tag does not indicate the end of a block, but you are in a - block tag, add the text to the block string. - - If the text has nothing to do with a block, simly output it to the - file. - - - """ - - - if name in self.__block_tags: - self.__block_tag_string += '' % name - # handle all the text - if '[' in self.__block_tag_string: - tagged_text = \ - self.__handle_br_text_obj.make_tags(self.__block_tag_string) - else: - tagged_text = self.__block_tag_string - tagged_text = tagged_text.replace('\000', '[') - tagged_text = tagged_text.replace('\001', ']') - self.__write_obj.write(tagged_text) - self.__in_block = 0 - self.__block_tag_string = '' - elif self.__in_block: - self.__block_tag_string += '' % name - else: - self.__write_obj.write('' % name) - - - - -class InlineBrackets: - - def __init__( self, - file, - output, - start_role = ':', - end_role = ':', - start_group = '[', - end_group = ']', - place = 'inside', - tag_name = 'inline', - warning = 'problematic' - - ): - - - """ - - - Requires: - - file --file to be read - - output --file to output to - - - Returns: - - Nothing. Outputs a file - - Logic: - - Set up a write object. - - Create an instance of the InlineHandler for sax to use. - - Pass this instance to the SAX driver. - - Use the SAX driver to handle the file. - - - """ - self.__output = output - self.__file = file - self.__start_role = start_role - self.__end_role = end_role - self.__start_group = start_group - self.__end_group = end_group - self.__place = place - self.__tag_name = tag_name - self.__warning = warning - - def make_tags(self): - (utf8_encode, utf8_decode, utf8_reader, utf8_writer) = codecs.lookup("utf-8") - write_obj = utf8_writer(open(self.__output, 'w')) - parser = xml.sax.make_parser() - # turn on this line if you want to disable namespaces - ##parser.setFeature(feature_namespaces, 0) - inline_handler = InlineHandler( write_obj = write_obj, - start_role = self.__start_role, - end_role = self.__end_role, - start_group = self.__start_group, - end_group = self.__end_group, - place = self.__place, - tag_name = self.__tag_name, - warning = self.__warning - ) - parser.setContentHandler(inline_handler) - parser.parse(self.__file) - write_obj.close() - - - -if __name__ == '__main__': - file = '/home/paul/lib/python/paul/restructure_tools/test_inline.xml' - output = '/home/paul/paultemp/brackets_to_tags.temp.xml' - obj = InlineBrackets(file, output = output, warning = '5fuck:? yo&<>u') - obj.make_tags() - command = 'xmlvalid -c -v %s' % output - os.system(command) diff --git a/sandbox/paultremblay/docutils_nest/docutils_nest/options_trem.py b/sandbox/paultremblay/docutils_nest/docutils_nest/options_trem.py deleted file mode 100644 index 6cf60a3db..000000000 --- a/sandbox/paultremblay/docutils_nest/docutils_nest/options_trem.py +++ /dev/null @@ -1,386 +0,0 @@ -import sys -class ParseOptions: - - """ - - Requires: - - system_string --The string from the command line - - options_dict -- a dictionary with the key equal to the opition, and - a list describing that option. (See below) - - - Returns: - - A tupple. The first item in the tupple is a dictionary containing - the arguments for each options. The second is a list of the - arguments. - - If invalid options are passed to the module, 0,0 is returned. - - Examples: - - Your script has the option '--indents', and '--output=file'. - - You want to give short option names as well: - - --i and -o=file - - Use this: - - options_dict = {'output': [1, 'o'], - 'indents': [0, 'i'] - } - - options_obj = ParseOptions( - system_string = sys.argv, - options_dict = options_dict - ) - - options, arguments = options_obj.parse_options() - print options - print arguments - - The result will be: - - - {indents:None, output:'/home/paul/file'}, ['/home/paul/input'] - - - """ - def __init__(self, system_string, options_dict): - self.__system_string = system_string[1:] - long_list = self.__make_long_list_func(options_dict) - # # print long_list - short_list = self.__make_short_list_func(options_dict) - # # print short_list - self.__legal_options = long_list + short_list - # # print self.__legal_options - self.__short_long_dict = self.__make_short_long_dict_func(options_dict) - # # print self.__short_long_dict - self.__opt_with_args = self.__make_options_with_arg_list(options_dict) - # # print self.__opt_with_args - self.__options_okay = 1 - - - - def __make_long_list_func(self, options_dict): - """ - Required: - - options_dict -- the dictionary mapping options to a list - - Returns: - - a list of legal options - - - - - """ - legal_list = [] - keys = options_dict.keys() - for key in keys: - key = '--' + key - legal_list.append(key) - return legal_list - - def __make_short_list_func(self, options_dict): - """ - Required: - - options_dict --the dictionary mapping options to a list - - Returns: - - a list of legal short options - - """ - legal_list = [] - keys = options_dict.keys() - for key in keys: - values = options_dict[key] - try: - legal_list.append('-' + values[1]) - except IndexError: - pass - - return legal_list - - - - def __make_short_long_dict_func(self, options_dict): - """ - Required: - - options_dict --the dictionary mapping options to a list - - Returns: - - a dictionary with keys of short options and values of long options - - """ - short_long_dict = {} - keys = options_dict.keys() - for key in keys: - values = options_dict[key] - try: - short = '-' + values[1] - long = '--' + key - short_long_dict[short] = long - except IndexError: - pass - - return short_long_dict - - def __make_options_with_arg_list(self, options_dict): - """ - Required: - - options_dict --the dictionary mapping options to a list - - Returns: - - a list of options that take arguments. - - """ - opt_with_arg = [] - keys = options_dict.keys() - for key in keys: - values = options_dict[key] - try: - if values[0]: - opt_with_arg.append('--' + key) - except IndexError: - pass - - return opt_with_arg - - - def __sub_short_with_long(self): - """ - Required: - - nothing - - Returns: - - a new system string - - Logic: - - iterate through the system string and replace short options with long options - - - """ - new_string = [] - sub_list = self.__short_long_dict.keys() - for item in self.__system_string: - if item in sub_list: - item = self.__short_long_dict[item] - new_string.append(item) - return new_string - - - - def __pair_arg_with_option(self): - - """ - - Required: - - nothing - - Returns - - nothing (changes value of self.__system_string) - - Logic: - - iterate through the system string, and match arguments with options: - - old_list = ['--foo', 'bar'] - - new_list = ['--foo=bar' - - """ - opt_len = len(self.__system_string) - new_system_string = [] - counter = 0 - slurp_value = 0 - for arg in self.__system_string: - - # previous value was an option with an argument, so this arg is - # actually an argument that has already been added - counter += 1 - if slurp_value: - slurp_value = 0 - continue - - # not an option--an argument - if arg[0] != '-': - new_system_string.append(arg) - - # option and argument already paired - elif '=' in arg: - new_system_string .append(arg) - else: - # this option takes an argument - if arg in self.__opt_with_args: - # option is the last in the list - if counter + 1 > opt_len: - sys.stderr.write('option "%s" must take an argument\n' % arg) - new_system_string.append(arg) - self.__options_okay = 0 - else: - # the next item in list is also an option - if self.__system_string[counter][0] == '-': - sys.stderr.write('option "%s" must take an argument\n' % arg) - new_system_string.append(arg) - self.__options_okay = 0 - # the next item in the list is the argument - else: - new_system_string.append(arg + '=' + self.__system_string[counter]) - slurp_value = 1 - # this option does not take an argument - else: - new_system_string.append(arg) - return new_system_string - - - def __get_just_options(self): - - """ - - Requires: - - nothing - - Returns: - - list of options - - Logic: - - Iterate through the self.__system string, looking for the last - option. The options are everything in the sysem string before the - last option. - - Check to see that the options contain no arguments. - - - """ - highest = 0 - counter = 0 - found_options = 0 - for item in self.__system_string: - if item[0] == '-': - highest = counter - found_options = 1 - counter += 1 - - if found_options: - just_options = self.__system_string[:highest + 1] - arguments = self.__system_string[highest + 1:] - else: - just_options = [] - arguments = self.__system_string - - if found_options: - for item in just_options: - if item[0] != '-': - sys.stderr.write('%s is an argument in an option list\n' % item) - self.__options_okay = 0 - return just_options, arguments - - - def __is_legal_option_func(self): - - """ - Requires: - - nothing - - Returns: - - nothing - - Logic: - - Check each value in the newly creatd options list to see if it - matches what the user describes as a legal option. - - - """ - illegal_options = [] - for arg in self.__system_string: - if '=' in arg: - temp_list = arg.split('=') - arg = temp_list[0] - if arg not in self.__legal_options and arg[0] == '-': - illegal_options.append(arg) - - if illegal_options: - self.__options_okay = 0 - sys.stderr.write('The following options are not permitted:\n') - for not_legal in illegal_options: - sys.stderr.write('%s\n' % not_legal) - - - def __make_options_dict(self, options): - options_dict = {} - for item in options: - if '=' in item: - option, arg = item.split('=') - else: - option = item - arg = None - - if option[0] == '-': - option = option[1:] - if option[0] == '-': - option = option[1:] - - options_dict[option] = arg - - return options_dict - - def parse_options(self): - self.__system_string = self.__sub_short_with_long() - # # print 'subbed list is %s' % self.__system_string - self.__system_string = self.__pair_arg_with_option() - # # print 'list with pairing is %s' % self.__system_string - options, arguments = self.__get_just_options() - # # print 'options are %s ' % options - # # print 'arguments are %s ' % arguments - self.__is_legal_option_func() - if self.__options_okay: - options_dict = self.__make_options_dict(options) - # # print options_dict - return options_dict, arguments - - else: - return 0,0 - - - - -if __name__ == '__main__': - this_dict = { - 'indents': [0, 'i'], - 'output': [1, 'o'], - 'test3': [1, 't'], - } - test_obj = ParseOptions(system_string = sys.argv, - options_dict = this_dict - ) - - options, the_args = test_obj.parse_options() - print options, the_args - - """ - this_options = ['--foo', '-o'] - this_opt_with_args = ['--foo'] - - """ diff --git a/sandbox/paultremblay/docutils_nest/docutils_nest/read_config.py b/sandbox/paultremblay/docutils_nest/docutils_nest/read_config.py deleted file mode 100644 index 84ac7b4ad..000000000 --- a/sandbox/paultremblay/docutils_nest/docutils_nest/read_config.py +++ /dev/null @@ -1,143 +0,0 @@ -import os, re, sys, codecs - -import xml.sax.saxutils -import xml.sax - -# turn on this line if you want to disablenamespaces -##from xml.sax.handler import feature_namespaces - - -config_values = { - 'start_role' : ':', - 'end_role' : ':', - 'start_group' : '[', - 'end_group' : ']', - 'place_of_role' : 'inside', - 'tag_name' : 'inline', - 'warning' : 'problematic', - -} - - -class ConfigHandler(xml.sax.saxutils.DefaultHandler): - """ - - Class for handling the XML file. SAX uses the methods in this class to - handle the data. - - - """ - def __init__(self): - - """ - - - Requires: - - - Returns: - - nothing - - - Logic: - - - """ - self.__allowed = [ - 'start-role', 'end-role', 'start-group', 'end-group', 'place-of-role', - 'tag-name', 'warning', 'configure' - ] - - - - def startElement(self, name, attrs): - """ - - Logic: - - The SAX driver uses this function when if finds a beginning tag. - - - - """ - if name in self.__allowed: - values = attrs.values() - config_values[name] = values - - else: - sys.stderr.write('%s not a valid option\n' % name) - - - def characters(self, character): - """ - - Logic: - - The SAX driver uses this function when it finds text. - - """ - pass - - - - def endElement(self, name): - """ - - Logic: - - - """ - - pass - - - - -class Configure: - - def __init__(self, file): - - - """ - - - Requires: - - - - Returns: - - - Logic: - - Set up a write object. - - Create an instance of the InlineHandler for sax to use. - - Pass this instance to the SAX driver. - - Use the SAX driver to handle the file. - - - """ - file_exists = os.path.exists(file) - if not file_exists: - raise IOError, 'file %s does not exist' % file - self.__file = file - - def read_configs(self): - parser = xml.sax.make_parser() - # turn on this line if you want to disable namespaces - ##parser.setFeature(feature_namespaces, 0) - config_handler = ConfigHandler() - parser.setContentHandler(config_handler) - parser.parse(self.__file) - return config_values - - - -if __name__ == '__main__': - file = '/home/paul/docutils-extensions/configure.xml' - obj = Configure(file) - obj.read_configs() diff --git a/sandbox/paultremblay/docutils_nest/docutils_nest/rst_options.py b/sandbox/paultremblay/docutils_nest/docutils_nest/rst_options.py deleted file mode 100644 index b0d3737bf..000000000 --- a/sandbox/paultremblay/docutils_nest/docutils_nest/rst_options.py +++ /dev/null @@ -1,106 +0,0 @@ -""" - -Parse options from the command line in order to convert an rst text to XML. - -This script separates the options a script needs from the options that docuitls needs. - -Takes a system string. Returns a dictionary of options for docutils inline, a list of argumetns for docutils-inline, and a string for docutils. - -""" - -import sys, os -import options_trem - -class OptionsRst: - - def __init__(self, sys_argv, script_options): - - - self.__sys_argv = sys_argv - self.__rst_options_dict = { - 'pep-references': [], - 'rfc-references': [], - 'tab-width': [1], - 'newlines': [], - 'indents': [], - 'no-xml-declaration': [], - 'no-doctype': [], - 'generator': [0,'g'], - 'no-generator': [], - 'date': [0,'d'], - 'time': [0,'t'], - 'no-datestamp': [], - 'source-link': [0, 's'], - 'source-url': [1], - 'no-source-link': [], - 'toc-entry-backlinks': [], - 'toc-top-backlinks': [], - 'no-toc-backlinks': [], - 'footnote-backlinks': [], - 'no-footnote-backlinks': [], - 'report': [1, 'r'], - 'verbose': [0,'v'], - 'quiet': [0, 'q'], - 'halt': [1], - 'strict': [], - 'debug': [], - 'no-debug': [], - 'warnings': [], - 'input-encoding': [1, 'i'], - 'output-encoding': [1, 'o'], - 'language': [1, 'l'], - 'config': [1], - 'version': [0, 'V'], - 'help': [0, 'h'], - } - - - self.__inline_options_dict = script_options - self.__rst_options_list = self.__rst_options_dict.keys() - self.__inline_options_list = self.__inline_options_dict.keys() - - self.__both_options = {} - self.__both_options.update(self.__rst_options_dict) - self.__both_options.update(self.__inline_options_dict) - - def parse_options(self): - opts, args = self.__get_raw_options() - if opts == 0: - return 0, 0, 0 - doc_opts, inline_opts = self.__split_options(opts) - return inline_opts, args, doc_opts - - def __get_raw_options(self): - raw_obj = options_trem.ParseOptions( - options_dict = self.__both_options, - system_string = self.__sys_argv - ) - - options, arguments = raw_obj.parse_options() - return options, arguments - - def __split_options(self, options): - inline_options = {} - docutils_options = [] - keys = options.keys() - for key in keys: - if key in self.__rst_options_list: - if options[key] == None: - docutils_options.append('--%s' % key) - else: - docutils_options.append('--%s=%s' % (key, options[key])) - - else: - inline_options[key] = options[key] - - return docutils_options, inline_options - - - - -if __name__ == '__main__': - this_options_dict = { - 'output': [1], - } - test_obj = OptionsRst(sys.argv, this_options_dict) - test_obj.parse_options() diff --git a/sandbox/paultremblay/docutils_nest/docutils_nest/well_formed_xml.py b/sandbox/paultremblay/docutils_nest/docutils_nest/well_formed_xml.py deleted file mode 100644 index 643565382..000000000 --- a/sandbox/paultremblay/docutils_nest/docutils_nest/well_formed_xml.py +++ /dev/null @@ -1,73 +0,0 @@ -import xml.parsers.expat - -""" - -well_formed module -^^^^^^^^^^^^^^^^^^ - -======== -Overview -======== - -Takes a string, and returns either a zero or one, depending if the string has -balanced tags. - - -""" - -class WellFormed: - - def __init__(self): - pass - - def well_formed(self, my_string): - """ - - Requires: - - my_string --string to test for well-formedness - - Returns: - - 1, if the tags are balanced, and 0 if the tags are not - - Logic: - - Enclose the string around an artifical root element. - - Change the encoding, if necessary. - - Try to parse the string with expat. If there is success, return 1. - Otherwise, catch the exception and return 0. - - """ - enclosing_tag = 'doc-string-test6685866' - my_string = '<%s>%s' % (enclosing_tag, my_string, enclosing_tag) - try: - if isinstance(my_string, type(u"")): - my_string = my_string.encode("utf-8") - parser = xml.parsers.expat.ParserCreate() - parser.Parse(my_string, 1) - return 1 - except xml.parsers.expat.ExpatError: - return 0 - - -if __name__ == '__main__': - test_strings = [ - 'simplest test', - 'simplest fail test', - '&text\u201ctext,', - '&text<text,', - '&text<text,', - ] - test_obj = WellFormed() - for test_string in test_strings: - well_formed = test_obj.well_formed(test_string) - if well_formed: - print '%s is well formed' % test_string - else: - print '%s is not well formed' % test_string - - - diff --git a/sandbox/paultremblay/docutils_nest/options_trem.py b/sandbox/paultremblay/docutils_nest/options_trem.py deleted file mode 100644 index 09eb3e4f4..000000000 --- a/sandbox/paultremblay/docutils_nest/options_trem.py +++ /dev/null @@ -1,377 +0,0 @@ -import sys -class ParseOptions: - - """ - - Requiries: - - system_string --The string from the command line - - options_dict -- a dictionary with the key equal to the opition, and - a list describing that option. (See below) - - - Returns: - - A tupple. The first item in the tupple is a dictionary containing - the arguments for each options. The second is a list of the - arguments. - - If invalid options are passed to the module, 0,0 is returned. - - Examples: - - Your script has the option '--indents', and '--output=file'. - - You want to give short option names as well: - - --i and -o=file - - Use this: - - options_dict = {'output': [1, 'o'], - 'indents': [0, 'i'] - } - - options_obj = ParseOptions( - system_string = sys.argv, - options_dict = options_dict - ) - - options, arguments = options_obj.parse_options() - print options - print arguments - - The result will be: - - - {indents:None, output:'/home/paul/file'}, ['/home/paul/input'] - - - """ - def __init__(self, system_string, options_dict): - self.__system_string = system_string[1:] - long_list = self.__make_long_list_func(options_dict) - # # print long_list - short_list = self.__make_short_list_func(options_dict) - # # print short_list - self.__legal_options = long_list + short_list - # # print self.__legal_options - self.__short_long_dict = self.__make_short_long_dict_func(options_dict) - # # print self.__short_long_dict - self.__opt_with_args = self.__make_options_with_arg_list(options_dict) - # # print self.__opt_with_args - self.__options_okay = 1 - - - - def __make_long_list_func(self, options_dict): - """ - Required: - - options_dict -- the dictionary mapping options to a list - - Returns: - - a list of legal options - - - - - """ - legal_list = [] - keys = options_dict.keys() - for key in keys: - key = '--' + key - legal_list.append(key) - return legal_list - - def __make_short_list_func(self, options_dict): - """ - Required: - - options_dict --the dictionary mapping options to a list - - Returns: - - a list of legal short options - - """ - legal_list = [] - keys = options_dict.keys() - for key in keys: - values = options_dict[key] - try: - legal_list.append('-' + values[1]) - except IndexError: - pass - - return legal_list - - - - def __make_short_long_dict_func(self, options_dict): - """ - Required: - - options_dict --the dictionary mapping options to a list - - Returns: - - a dictionary with keys of short options and values of long options - - """ - short_long_dict = {} - keys = options_dict.keys() - for key in keys: - values = options_dict[key] - try: - short = '-' + values[1] - long = '--' + key - short_long_dict[short] = long - except IndexError: - pass - - return short_long_dict - - def __make_options_with_arg_list(self, options_dict): - """ - Required: - - options_dict --the dictionary mapping options to a list - - Returns: - - a list of options that take arguments. - - """ - opt_with_arg = [] - keys = options_dict.keys() - for key in keys: - values = options_dict[key] - try: - if values[0]: - opt_with_arg.append('--' + key) - except IndexError: - pass - - return opt_with_arg - - - def __sub_short_with_long(self): - """ - Required: - - nothing - - Returns: - - a new system string - - Logic: - - iterate through the system string and replace short options with long options - - - """ - new_string = [] - sub_list = self.__short_long_dict.keys() - for item in self.__system_string: - if item in sub_list: - item = self.__short_long_dict[item] - new_string.append(item) - return new_string - - - - def __pair_arg_with_option(self): - - """ - - Required: - - nothing - - Returns - - nothing (changes value of self.__system_string) - - Logic: - - iterate through the system string, and match arguments with options: - - old_list = ['--foo', 'bar'] - - new_list = ['--foo=bar' - - """ - opt_len = len(self.__system_string) - new_system_string = [] - counter = 0 - slurp_value = 0 - for arg in self.__system_string: - - # previous value was an option with an argument, so this arg is - # actually an argument that has already been added - if slurp_value: - slurp_value = 0 - continue - counter += 1 - - # not an option--an argument - if arg[0] != '-': - new_system_string.append(arg) - - # option and argument already paired - elif '=' in arg: - new_system_string .append(arg) - else: - # this option takes an argument - if arg in self.__opt_with_args: - # option is the last in the list - if counter + 1 > opt_len: - sys.stderr.write('option "%s" must take an argument\n' % arg) - new_system_string.append(arg) - self.__options_okay = 0 - else: - # the next item in list is also an option - if self.__system_string[counter][0] == '-': - sys.stderr.write('option "%s" must take an argument\n' % arg) - new_system_string.append(arg) - self.__options_okay = 0 - # the next item in the list is the argument - else: - new_system_string.append(arg + '=' + self.__system_string[counter]) - slurp_value = 1 - # this option does not take an argument - else: - new_system_string.append(arg) - return new_system_string - - - def __get_just_options(self): - - """ - - Requires: - - nothing - - Returns: - - list of options - - Logic: - - Iterate through the self.__system string, looking for the last - option. The options are everything in the sysem string before the - last option. - - Check to see that the options contain no arguments. - - - """ - highest = 0 - counter = 0 - for item in self.__system_string: - if item[0] == '-': - highest = counter - counter += 1 - - just_options = self.__system_string[:highest + 1] - arguments = self.__system_string[highest + 1:] - - for item in just_options: - if item[0] != '-': - sys.stderr.write('%s is an argument in an option list\n' % item) - self.__options_okay = 0 - return just_options, arguments - - - def __is_legal_option_func(self): - - """ - Requires: - - nothing - - Returns: - - nothing - - Logic: - - Check each value in the newly creatd options list to see if it - matches what the user describes as a legal option. - - - """ - illegal_options = [] - for arg in self.__system_string: - if '=' in arg: - temp_list = arg.split('=') - arg = temp_list[0] - if arg not in self.__legal_options and arg[0] == '-': - illegal_options.append(arg) - - if illegal_options: - self.__options_okay = 0 - sys.stderr.write('The following options are not permitted:\n') - for not_legal in illegal_options: - sys.stderr.write('%s\n' % not_legal) - - - def __make_options_dict(self, options): - options_dict = {} - for item in options: - if '=' in item: - option, arg = item.split('=') - else: - option = item - arg = None - - if option[0] == '-': - option = option[1:] - if option[0] == '-': - option = option[1:] - - options_dict[option] = arg - - return options_dict - - def parse_options(self): - self.__system_string = self.__sub_short_with_long() - # # print 'subbed list is %s' % self.__system_string - self.__system_string = self.__pair_arg_with_option() - # # print 'list with pairing is %s' % self.__system_string - options, arguments = self.__get_just_options() - # # print 'options are %s ' % options - # # print 'arguments are %s ' % arguments - self.__is_legal_option_func() - if self.__options_okay: - options_dict = self.__make_options_dict(options) - # # print options_dict - return options_dict, arguments - - else: - return 0,0 - - - - -if __name__ == '__main__': - this_dict = { - 'indents': [0, 'i'], - 'output': [1, 'o'], - } - test_obj = ParseOptions(system_string = sys.argv, - options_dict = this_dict - ) - - options, the_args = test_obj.parse_options() - - """ - this_options = ['--foo', '-o'] - this_opt_with_args = ['--foo'] - - """ diff --git a/sandbox/paultremblay/docutils_nest/read_config.py b/sandbox/paultremblay/docutils_nest/read_config.py deleted file mode 100644 index f7eaddaee..000000000 --- a/sandbox/paultremblay/docutils_nest/read_config.py +++ /dev/null @@ -1,144 +0,0 @@ -import os, re, sys, codecs - -import xml.sax.saxutils -import xml.sax - -# turn on this line if you want to disablenamespaces -##from xml.sax.handler import feature_namespaces - - -config_values = { - 'start_role' : ':', - 'end_role' : ':', - 'start_group' : '[', - 'end_group' : ']', - 'place_of_role' : 'inside', - 'tag_name' : 'inline', - 'warning' : 'problematic', - -} - - -class ConfigHandler(xml.sax.saxutils.DefaultHandler): - """ - - Class for handling the XML file. SAX uses the methods in this class to - handle the data. - - - """ - def __init__(self): - - """ - - - Requires: - - - Returns: - - nothing - - - Logic: - - - """ - self.__allowed = [ - 'start-role', 'end-role', 'start-group', 'end-group', 'place-of-role', - 'tag-name', 'warning', 'configure' - ] - - - - def startElement(self, name, attrs): - """ - - Logic: - - The SAX driver uses this function when if finds a beginning tag. - - - - """ - if name in self.__allowed: - values = attrs.values() - config_values[name] = values - - else: - sys.stderr.write('%s not a valid option\n' % name) - - - def characters(self, character): - """ - - Logic: - - The SAX driver uses this function when it finds text. - - """ - pass - - - - def endElement(self, name): - """ - - Logic: - - - """ - - pass - - - - -class Configure: - - def __init__(self, file): - - - """ - - - Requires: - - - - Returns: - - - Logic: - - Set up a write object. - - Create an instance of the InlineHandler for sax to use. - - Pass this instance to the SAX driver. - - Use the SAX driver to handle the file. - - - """ - file_exists = os.path.exists(file) - if not file_exists: - sys.stderr.write('file does not exist\n') - sys.exit(1) - self.__file = file - - def read_configs(self): - parser = xml.sax.make_parser() - # turn on this line if you want to disable namespaces - ##parser.setFeature(feature_namespaces, 0) - config_handler = ConfigHandler() - parser.setContentHandler(config_handler) - parser.parse(self.__file) - return config_values - - - -if __name__ == '__main__': - file = '/home/paul/docutils-extensions/configure.xml' - obj = Configure(file) - obj.read_configs() diff --git a/sandbox/paultremblay/docutils_nest/scripts/docutils-nest-xml.py b/sandbox/paultremblay/docutils_nest/scripts/docutils-nest-xml.py deleted file mode 100755 index 788f34190..000000000 --- a/sandbox/paultremblay/docutils_nest/scripts/docutils-nest-xml.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python - -import sys, os -import docutils_nest.nest_utils -import docutils_nest.rst_options - - -def convert_file(): - options_dict = { - 'output': [1] - } - opt_obj = docutils_nest.rst_options.OptionsRst(sys.argv, options_dict) - inline_opts, args, doc_opts = opt_obj.parse_options() - if inline_opts == 0: - print_help_message() - sys.stderr.write('Script will now quite because of illegal options\n') - sys.exit(1) - try: - file = args[0] - except IndexError: - sys.stderr.write('You must provide a file for the script to convert.\n' - 'Script will now quit' - ) - sys.exit(1) - output = inline_opts.get('output') - if not output: - sys.stderr.write('You must provide an output option for the script to work\n' - 'Script will now quit\n' - ) - sys.exit(1) - convert_obj = docutils_nest.nest_utils.RstWithInline(file, output, docutils_opts = doc_opts) - convert_obj.convert() - -if __name__ == '__main__': - convert_file() - - diff --git a/sandbox/paultremblay/docutils_nest/setup.py b/sandbox/paultremblay/docutils_nest/setup.py deleted file mode 100644 index 88c123e55..000000000 --- a/sandbox/paultremblay/docutils_nest/setup.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python - -import os, sys -from distutils.core import setup - - -# get the location for the data -var_file_exists = os.path.isfile('var_file') -if not var_file_exists: - sys.stderr.write('Please run python configure.py first\n') - sys.exit(1) -read_obj = open('var_file', 'r') -lines = read_obj.readlines() -target = lines[0] -data_location = os.path.join(target, '.docutils_nest') -read_obj.close() - - -setup(name="docutils_nest", - version=".1", - description="Add nested inline markup to an rst file.", - author="Paul Tremblay", - author_email="phthenry@earthlink.net", - packages=['docutils_nest'], - data_files = [(data_location, ["data/configure.xml"])], - scripts=["scripts/docutils-nest-xml.py"], - ) - diff --git a/sandbox/paultremblay/docutils_nest/test_files/test.txt b/sandbox/paultremblay/docutils_nest/test_files/test.txt deleted file mode 100644 index 824823a33..000000000 --- a/sandbox/paultremblay/docutils_nest/test_files/test.txt +++ /dev/null @@ -1,10 +0,0 @@ -Simple Doc -^^^^^^^^^^ - -:author: Paul Tremblay - -Start the body - -A paragraph with inline markup. [:comment: I should have read *The Sun Also Rises.*] Another sentence. - -A paragraph with deeper nesting inline markup. [:comment: I should have read *The Sun A/home/pusetup.pylso Rises* [:note: note text [:date: 6/01/03]]] diff --git a/sandbox/paultremblay/rst_to_docbook/README.txt b/sandbox/paultremblay/rst_to_docbook/README.txt deleted file mode 100644 index 426b8b6e2..000000000 --- a/sandbox/paultremblay/rst_to_docbook/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -The rst_to_docbook module translates an rst document to docbook. It -uses XML tools, namely SAX and xslt. diff --git a/sandbox/paultremblay/rst_to_docbook/configure.py b/sandbox/paultremblay/rst_to_docbook/configure.py deleted file mode 100644 index 41070820b..000000000 --- a/sandbox/paultremblay/rst_to_docbook/configure.py +++ /dev/null @@ -1,138 +0,0 @@ -# /usr/bin/env python - -import sys, os -import rst_to_docbook.options_trem - -""" - -The configuration script gets the target from the command line. It creates a -file with the configuration variable, and a short script for the rest of -script to be able to read and locate he configuration files. - -""" - -def configure(): - target, processor = get_target() - if processor == None: - sys.stderr.write('Since you need an xslt processor to run this script, the configuration will now quit\n' - ) - try: - os.remove('var_file') - except: - pass - sys.exit(1) - make_var_file(target) - make_location(target) - make_configuration_file(processor) - -def get_target(): - """ - This functions uses a module I wrote to parse options. If no options are - determined on the command line, the function returnst the default - /etc/nest_docutis - - """ - options_dict = { - 'target': [1, 't'], - 'processor': [1, 'p'], - } - options_obj = rst_to_docbook.options_trem.ParseOptions(sys.argv, - options_dict) - opt_dict, args = options_obj.parse_options() - if opt_dict == 0: - sys.stderr.write('invalid options for configure.py\n' - 'use python configure --target ' - ' --processor ' - - ) - sys.exit(1) - target = opt_dict.get('target') - if not target: - target = default_target() - processor = opt_dict.get('processor') - processor = determine_processor(processor) - return target, processor - -def default_target(): - sys.stdout.write('using default \'/etc\' for the configuration directory\n') - return '/etc' - -def determine_processor(processor = None): - sys.stdout.write('determining xslt processor...\n') - if processor == None: - processor = 'xmllint' - if processor == 'xalan': - file = 'test_files/simple.xml' - xsl_file = 'test_files/simple.xsl' - output = 'output.xml' - command = 'java org.apache.xalan.xslt.Process \ - -Ts -in %s -xsl %s -out %s' % (file, xsl_file, output) - error = os.system(command) - if error: - sys.stderr.write('xalan does not appear to be set up correctly ' - ' on your system\n' - 'The command "java org.apache.xalan.xslt.Process" failed\n' - 'Is the CLASSPATH set for xalan?\n' - 'Configuraton will now quit\n' - ) - sys.exit(1) - else: - return 'xalan' - elif processor == '4suite': - try: - from Ft.Xml import InputSource - from Ft.Xml.Xslt.Processor import Processor - return '4suite' - except: - sys.stderr.write('4suite does not appear to be set up correctly on your system\n' - 'Could not find the Ft.Xml libraries\n' - 'Script cannot work without an xslt procesor!\n' - ) - sys.exit(1) - elif processor == 'xsltproc' or processor == 'xmllint': - try: - import libxml2 - import libxslt - return 'xmllint' - except: - sys.stderr.write('You either choose xmllint as your processor, or xmllint was tested because not other\n' - 'processor was found\n' - 'However, the libraries "libxml2" and or "libxslt" cannot be found.\n' - ) - - else: - sys.stderr.write('The processor "%s" is not a valid choice for this script\n' % processor) - return None - - - - -def make_var_file(target): - write_obj = open('var_file', 'w') - # write_obj.write('[global]\n') - write_obj.write(target) - write_obj.close() - -def make_location(target): - write_obj = open('rst_to_docbook/location.py', 'w') - write_obj.write( - """ -def get_location(): - return '%s' - - - """ - % target) - -def make_configuration_file(processor): - write_obj = open('data/configure.xml', 'w') - write_obj.write(""" - - - - """ % processor - ) - -if __name__ == '__main__': - configure() - diff --git a/sandbox/paultremblay/rst_to_docbook/data/configure.xml b/sandbox/paultremblay/rst_to_docbook/data/configure.xml deleted file mode 100644 index 4aa25c259..000000000 --- a/sandbox/paultremblay/rst_to_docbook/data/configure.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sandbox/paultremblay/rst_to_docbook/data/xslt_stylesheets/reStruct_field_names.xsl b/sandbox/paultremblay/rst_to_docbook/data/xslt_stylesheets/reStruct_field_names.xsl deleted file mode 100644 index 04f365cd9..000000000 --- a/sandbox/paultremblay/rst_to_docbook/data/xslt_stylesheets/reStruct_field_names.xsl +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/paultremblay/rst_to_docbook/data/xslt_stylesheets/reStruct_field_names_tokenize.xsl b/sandbox/paultremblay/rst_to_docbook/data/xslt_stylesheets/reStruct_field_names_tokenize.xsl deleted file mode 100644 index 6de06c068..000000000 --- a/sandbox/paultremblay/rst_to_docbook/data/xslt_stylesheets/reStruct_field_names_tokenize.xsl +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/paultremblay/rst_to_docbook/data/xslt_stylesheets/reStruct_to_docbook.xsl b/sandbox/paultremblay/rst_to_docbook/data/xslt_stylesheets/reStruct_to_docbook.xsl deleted file mode 100644 index 18ab27fdd..000000000 --- a/sandbox/paultremblay/rst_to_docbook/data/xslt_stylesheets/reStruct_to_docbook.xsl +++ /dev/null @@ -1,343 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - none - - - -

no source--a manuscript

-
- -
- - - - - - - - -
- - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - written by - - Paul Tremblay - - - - - - - - - - - - - - -

- -

-
- -

- -

-
-
-
- - - - - - - - - - - - <xsl:apply-templates/> - - - - - - - 1 - - - - - - - - - - - - - - - - 2 - - - - - - - - - - - - - - - 3 - - - - - - - - - - - - - - - 4 - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -05:00 - - - - - 24hour - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -05:00 - - - - - 24hour - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/sandbox/paultremblay/rst_to_docbook/data/xslt_stylesheets/reStructure_to_docbook.xsl b/sandbox/paultremblay/rst_to_docbook/data/xslt_stylesheets/reStructure_to_docbook.xsl deleted file mode 100644 index ec76bdd03..000000000 --- a/sandbox/paultremblay/rst_to_docbook/data/xslt_stylesheets/reStructure_to_docbook.xsl +++ /dev/null @@ -1,387 +0,0 @@ - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - written by - - Paul Tremblay - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <xsl:apply-templates/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <xsl:apply-templates/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -05:00 - - - - - 24hour - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -05:00 - - - - - 24hour - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/sandbox/paultremblay/rst_to_docbook/rst_to_docbook/__init__.py b/sandbox/paultremblay/rst_to_docbook/rst_to_docbook/__init__.py deleted file mode 100644 index b3d0c915b..000000000 --- a/sandbox/paultremblay/rst_to_docbook/rst_to_docbook/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -''' -modules for rtf2xml -''' diff --git a/sandbox/paultremblay/rst_to_docbook/rst_to_docbook/convert_rst_to_docbook.py b/sandbox/paultremblay/rst_to_docbook/rst_to_docbook/convert_rst_to_docbook.py deleted file mode 100644 index 6634d86af..000000000 --- a/sandbox/paultremblay/rst_to_docbook/rst_to_docbook/convert_rst_to_docbook.py +++ /dev/null @@ -1,194 +0,0 @@ -#!/usr/bin/env python - -# configure rst_2_dbk_dir by hand -configure_dir = '' - -import sys, os, tempfile, codecs -import docutils_nest.nest_utils -import docutils_nest.rst_options -import rst_to_docbook.xsl_convert, rst_to_docbook.location -import rst_to_docbook.read_config - -""" -Module for convert rst documents to docbook -""" - -# read input file - - - - - -class ConvertRstToDoc: - - def __init__(self, doc_debug = 0): - outer_dir = rst_to_docbook.location.get_location() - self.__rst_2_dbk_dir = os.path.join(outer_dir, '.rst_to_docbook') - config_file = os.path.join(self.__rst_2_dbk_dir, 'configure.xml') - self.__xslt_processor = self.__get_configs(config_file) - if doc_debug: - self.__setup_debug() - else: - self.__debug = 0 - - - - def __setup_debug(self): - self.__debug_dir = os.path.join(self.__rst_2_dbk_dir, 'debug') - if not (os.path.isdir(self.__debug_dir)): - os.mkdir(self.__debug_dir) - list_of_files = os.listdir(self.__debug_dir) - sys.stdout.write('Removing files from %s...\n' % self.__debug_dir) - for file in list_of_files: - file = os.path.join(self.__debug_dir, file) - sys.stdout.write('%s\n' % file) - os.remove(file) - self.__debug = 1 - - - def __get_configs(self, config_file): - config_obj = rst_to_docbook.read_config.Configure(config_file) - config_dict = config_obj.read_configs() - processor = config_dict.get('xslt-processor') - processor = processor[0] - return processor - - - def convert_to_docbook(self): - # get file, output, and the docutils_options - file, output, docutils_options = self.__handle_options() - docutils_nest_file = tempfile.mktemp() - main_temp_file = tempfile.mktemp() - self.__convert_to_nest_utils( file, - output = docutils_nest_file, - docutils_options = docutils_options) - self.__copy_file(docutils_nest_file, main_temp_file) - if self.__debug: - new_file = os.path.join(self.__debug_dir, 'converted_to_nest_utils_info') - self.__copy_file(docutils_nest_file, new_file) - - os.remove(docutils_nest_file) - - # convert with first xslt - converted_string_file = tempfile.mktemp() - self.__string_to_attributes(main_temp_file, converted_string_file) - self.__copy_file(converted_string_file, main_temp_file) - if self.__debug: - new_file = os.path.join(self.__debug_dir, 'converted_string_info') - self.__copy_file(converted_string_file, new_file) - os.remove(converted_string_file) - - # convert with second xslt - converted_arg_file = tempfile.mktemp() - self.__convert_args(main_temp_file, converted_arg_file) - self.__copy_file(converted_arg_file, main_temp_file) - if self.__debug: - new_file = os.path.join(self.__debug_dir, 'converted_to_args_info') - self.__copy_file(converted_arg_file, new_file) - os.remove(converted_arg_file) - - # final convert with xslt - docbook_file = tempfile.mktemp() - self.__xsl_convert_to_docbook(main_temp_file, docbook_file) - self.__copy_file(docbook_file, main_temp_file) - if self.__debug: - new_file = os.path.join(self.__debug_dir, 'converted_to_docbook_info') - self.__copy_file(docbook_file, new_file) - os.remove(docbook_file) - - # write to output - self.__copy_file(main_temp_file, output) - os.remove(main_temp_file) - - - def __handle_options(self): - options_dict = { - 'output': [1], - 'doc_debug': [], - } - opt_obj = docutils_nest.rst_options.OptionsRst(sys.argv, options_dict) - inline_opts, args, doc_opts = opt_obj.parse_options() - if inline_opts == 0: - self.__print_help_message() - sys.stderr.write('Script will now quite because of illegal options\n') - sys.exit(1) - try: - file = args[0] - except IndexError: - sys.stderr.write('You must provide a file for the script to convert.\n' - 'Script will now quit' - ) - sys.exit(1) - output = inline_opts.get('output') - if not output: - sys.stderr.write('You must provide an output option for the script to work\n' - 'Script will now quit\n' - ) - sys.exit(1) - return file, output, doc_opts - - def __convert_to_nest_utils(self, file, output, docutils_options): - - sys.stdout.write('converting to nest-utils.xml ...\n') - convert_obj = docutils_nest.nest_utils.RstWithInline(file, output, docutils_opts = docutils_options) - convert_obj.convert() - - def __string_to_attributes(self, file, output): - xsl_file = os.path.join(self.__rst_2_dbk_dir, - 'xslt_stylesheets', 'reStruct_field_names_tokenize.xsl' - ) - sys.stdout.write('converting string in nest-utils ' - 'with xslt...\n') - trans_obj = rst_to_docbook.xsl_convert.XslConvert(processor = self.__xslt_processor) - trans_obj.transform(file = file, - xsl_file = xsl_file, - output = output) - - def __convert_args(self, file, output): - xsl_file = os.path.join(self.__rst_2_dbk_dir, - 'xslt_stylesheets', 'reStruct_field_names.xsl' - ) - sys.stdout.write('converting args in nest-utils ' - 'with xslt...\n') - trans_obj = rst_to_docbook.xsl_convert.XslConvert(processor = self.__xslt_processor) - trans_obj.transform(file = file, - xsl_file = xsl_file, - output = output) - def __xsl_convert_to_docbook(self, file, output): - sys.stdout.write('doing final converstion with xslt...\n') - xsl_file = os.path.join(self.__rst_2_dbk_dir, - 'xslt_stylesheets', 'reStructure_to_docbook.xsl' - ) - # reStructure_to_docbook.xsl - trans_obj = rst_to_docbook.xsl_convert.XslConvert(processor = self.__xslt_processor) - trans_obj.transform(file = file, - xsl_file = xsl_file, - output = output) - - def __copy_file(self, file, output): - (utf8_encode, utf8_decode, utf8_reader, utf8_writer) = codecs.lookup("utf-8") - write_obj = utf8_writer(open(output, 'w')) - read_obj = open(file, 'r') - line = 1 - while line: - line = read_obj.readline() - write_obj.write(line) - read_obj.close() - write_obj.close() - - def __print_help_message(self): - sys.stderr.write('script will now quit') - sys.exit(1) - -if __name__ == '__main__': - if len(sys.argv) == 1: - file = '/home/paul/Documents/in_progress/cvs/sandbox/paultremblay/rst_to_docbook/test_files/test_simple.rst' - file = '/home/paul/Documents/in_progress/cvs/sandbox/paultremblay/rst_to_docbook/test_files/reStructure_docbook_example.rst' - sys.argv.append('--indents') - sys.argv.append('--doc_debug') - sys.argv.append('--output') - sys.argv.append('output.xml') - sys.argv.append('%s' % file) - test_obj = ConvertRstToDoc(doc_debug = 1) - test_obj.convert_to_docbook() - diff --git a/sandbox/paultremblay/rst_to_docbook/rst_to_docbook/location.py b/sandbox/paultremblay/rst_to_docbook/rst_to_docbook/location.py deleted file mode 100644 index c74dd5ecf..000000000 --- a/sandbox/paultremblay/rst_to_docbook/rst_to_docbook/location.py +++ /dev/null @@ -1,6 +0,0 @@ - -def get_location(): - return '/etc' - - - \ No newline at end of file diff --git a/sandbox/paultremblay/rst_to_docbook/rst_to_docbook/options_trem.py b/sandbox/paultremblay/rst_to_docbook/rst_to_docbook/options_trem.py deleted file mode 100644 index 7176b165d..000000000 --- a/sandbox/paultremblay/rst_to_docbook/rst_to_docbook/options_trem.py +++ /dev/null @@ -1,387 +0,0 @@ -# WARNING TO PAUL: DON'T EDIT THIS FILE use update.py instead. -import sys -class ParseOptions: - - """ - - Requires: - - system_string --The string from the command line - - options_dict -- a dictionary with the key equal to the opition, and - a list describing that option. (See below) - - - Returns: - - A tupple. The first item in the tupple is a dictionary containing - the arguments for each options. The second is a list of the - arguments. - - If invalid options are passed to the module, 0,0 is returned. - - Examples: - - Your script has the option '--indents', and '--output=file'. - - You want to give short option names as well: - - --i and -o=file - - Use this: - - options_dict = {'output': [1, 'o'], - 'indents': [0, 'i'] - } - - options_obj = ParseOptions( - system_string = sys.argv, - options_dict = options_dict - ) - - options, arguments = options_obj.parse_options() - print options - print arguments - - The result will be: - - - {indents:None, output:'/home/paul/file'}, ['/home/paul/input'] - - - """ - def __init__(self, system_string, options_dict): - self.__system_string = system_string[1:] - long_list = self.__make_long_list_func(options_dict) - # # print long_list - short_list = self.__make_short_list_func(options_dict) - # # print short_list - self.__legal_options = long_list + short_list - # # print self.__legal_options - self.__short_long_dict = self.__make_short_long_dict_func(options_dict) - # # print self.__short_long_dict - self.__opt_with_args = self.__make_options_with_arg_list(options_dict) - # # print self.__opt_with_args - self.__options_okay = 1 - - - - def __make_long_list_func(self, options_dict): - """ - Required: - - options_dict -- the dictionary mapping options to a list - - Returns: - - a list of legal options - - - - - """ - legal_list = [] - keys = options_dict.keys() - for key in keys: - key = '--' + key - legal_list.append(key) - return legal_list - - def __make_short_list_func(self, options_dict): - """ - Required: - - options_dict --the dictionary mapping options to a list - - Returns: - - a list of legal short options - - """ - legal_list = [] - keys = options_dict.keys() - for key in keys: - values = options_dict[key] - try: - legal_list.append('-' + values[1]) - except IndexError: - pass - - return legal_list - - - - def __make_short_long_dict_func(self, options_dict): - """ - Required: - - options_dict --the dictionary mapping options to a list - - Returns: - - a dictionary with keys of short options and values of long options - - """ - short_long_dict = {} - keys = options_dict.keys() - for key in keys: - values = options_dict[key] - try: - short = '-' + values[1] - long = '--' + key - short_long_dict[short] = long - except IndexError: - pass - - return short_long_dict - - def __make_options_with_arg_list(self, options_dict): - """ - Required: - - options_dict --the dictionary mapping options to a list - - Returns: - - a list of options that take arguments. - - """ - opt_with_arg = [] - keys = options_dict.keys() - for key in keys: - values = options_dict[key] - try: - if values[0]: - opt_with_arg.append('--' + key) - except IndexError: - pass - - return opt_with_arg - - - def __sub_short_with_long(self): - """ - Required: - - nothing - - Returns: - - a new system string - - Logic: - - iterate through the system string and replace short options with long options - - - """ - new_string = [] - sub_list = self.__short_long_dict.keys() - for item in self.__system_string: - if item in sub_list: - item = self.__short_long_dict[item] - new_string.append(item) - return new_string - - - - def __pair_arg_with_option(self): - - """ - - Required: - - nothing - - Returns - - nothing (changes value of self.__system_string) - - Logic: - - iterate through the system string, and match arguments with options: - - old_list = ['--foo', 'bar'] - - new_list = ['--foo=bar' - - """ - opt_len = len(self.__system_string) - new_system_string = [] - counter = 0 - slurp_value = 0 - for arg in self.__system_string: - - # previous value was an option with an argument, so this arg is - # actually an argument that has already been added - counter += 1 - if slurp_value: - slurp_value = 0 - continue - - # not an option--an argument - if arg[0] != '-': - new_system_string.append(arg) - - # option and argument already paired - elif '=' in arg: - new_system_string .append(arg) - else: - # this option takes an argument - if arg in self.__opt_with_args: - # option is the last in the list - if counter + 1 > opt_len: - sys.stderr.write('option "%s" must take an argument\n' % arg) - new_system_string.append(arg) - self.__options_okay = 0 - else: - # the next item in list is also an option - if self.__system_string[counter][0] == '-': - sys.stderr.write('option "%s" must take an argument\n' % arg) - new_system_string.append(arg) - self.__options_okay = 0 - # the next item in the list is the argument - else: - new_system_string.append(arg + '=' + self.__system_string[counter]) - slurp_value = 1 - # this option does not take an argument - else: - new_system_string.append(arg) - return new_system_string - - - def __get_just_options(self): - - """ - - Requires: - - nothing - - Returns: - - list of options - - Logic: - - Iterate through the self.__system string, looking for the last - option. The options are everything in the sysem string before the - last option. - - Check to see that the options contain no arguments. - - - """ - highest = 0 - counter = 0 - found_options = 0 - for item in self.__system_string: - if item[0] == '-': - highest = counter - found_options = 1 - counter += 1 - - if found_options: - just_options = self.__system_string[:highest + 1] - arguments = self.__system_string[highest + 1:] - else: - just_options = [] - arguments = self.__system_string - - if found_options: - for item in just_options: - if item[0] != '-': - sys.stderr.write('%s is an argument in an option list\n' % item) - self.__options_okay = 0 - return just_options, arguments - - - def __is_legal_option_func(self): - - """ - Requires: - - nothing - - Returns: - - nothing - - Logic: - - Check each value in the newly creatd options list to see if it - matches what the user describes as a legal option. - - - """ - illegal_options = [] - for arg in self.__system_string: - if '=' in arg: - temp_list = arg.split('=') - arg = temp_list[0] - if arg not in self.__legal_options and arg[0] == '-': - illegal_options.append(arg) - - if illegal_options: - self.__options_okay = 0 - sys.stderr.write('The following options are not permitted:\n') - for not_legal in illegal_options: - sys.stderr.write('%s\n' % not_legal) - - - def __make_options_dict(self, options): - options_dict = {} - for item in options: - if '=' in item: - option, arg = item.split('=') - else: - option = item - arg = None - - if option[0] == '-': - option = option[1:] - if option[0] == '-': - option = option[1:] - - options_dict[option] = arg - - return options_dict - - def parse_options(self): - self.__system_string = self.__sub_short_with_long() - # # print 'subbed list is %s' % self.__system_string - self.__system_string = self.__pair_arg_with_option() - # # print 'list with pairing is %s' % self.__system_string - options, arguments = self.__get_just_options() - # # print 'options are %s ' % options - # # print 'arguments are %s ' % arguments - self.__is_legal_option_func() - if self.__options_okay: - options_dict = self.__make_options_dict(options) - # # print options_dict - return options_dict, arguments - - else: - return 0,0 - - - - -if __name__ == '__main__': - this_dict = { - 'indents': [0, 'i'], - 'output': [1, 'o'], - 'test3': [1, 't'], - } - test_obj = ParseOptions(system_string = sys.argv, - options_dict = this_dict - ) - - options, the_args = test_obj.parse_options() - print options, the_args - - """ - this_options = ['--foo', '-o'] - this_opt_with_args = ['--foo'] - - """ diff --git a/sandbox/paultremblay/rst_to_docbook/rst_to_docbook/output.xml b/sandbox/paultremblay/rst_to_docbook/rst_to_docbook/output.xml deleted file mode 100644 index 222f109c0..000000000 --- a/sandbox/paultremblay/rst_to_docbook/rst_to_docbook/output.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - Example of reStructure document that can be converted to docbook - - - - - - - -

- Paul -

- -
- - - - - Tremblay - - - - - - -

- - phthenry@earthlink.net - -

- -
- - - -
- none -

no source--a manuscript

- - - - -
- - Using snippets of code - -

- How to represent a snippet of code: -

- - - - - - - - - <p> - Processing a variable - </p> - - - - - if var = 5 - self.__process(var) - - - - -

- Keep in mind that the docbook should look like: -

- - <example> - <title>A formal example</title> - <programlisting> - if var = 5 - self.__process(var) - </programlisting> -</example> - - -
-
diff --git a/sandbox/paultremblay/rst_to_docbook/rst_to_docbook/read_config.py b/sandbox/paultremblay/rst_to_docbook/rst_to_docbook/read_config.py deleted file mode 100644 index 187ab1a48..000000000 --- a/sandbox/paultremblay/rst_to_docbook/rst_to_docbook/read_config.py +++ /dev/null @@ -1,131 +0,0 @@ -import os, re, sys, codecs - -import xml.sax.saxutils -import xml.sax - -# turn on this line if you want to disablenamespaces -##from xml.sax.handler import feature_namespaces - -config_values = {} - - - -class ConfigHandler(xml.sax.saxutils.DefaultHandler): - """ - - Class for handling the XML file. SAX uses the methods in this class to - handle the data. - - - """ - def __init__(self): - - """ - - - Requires: - - - Returns: - - nothing - - - Logic: - - - """ - self.__allowed = [ 'configuration', 'xslt-processor', ] - - - - def startElement(self, name, attrs): - """ - - Logic: - - The SAX driver uses this function when if finds a beginning tag. - - - - """ - if name in self.__allowed: - values = attrs.values() - config_values[name] = values - - else: - sys.stderr.write('%s not a valid option\n' % name) - - - def characters(self, character): - """ - - Logic: - - The SAX driver uses this function when it finds text. - - """ - pass - - - - def endElement(self, name): - """ - - Logic: - - - """ - - pass - - - - -class Configure: - - def __init__(self, file): - - - """ - - - Requires: - - - - Returns: - - - Logic: - - Set up a write object. - - Create an instance of the InlineHandler for sax to use. - - Pass this instance to the SAX driver. - - Use the SAX driver to handle the file. - - - """ - file_exists = os.path.exists(file) - if not file_exists: - raise IOError, 'file %s does not exist' % file - self.__file = file - - def read_configs(self): - parser = xml.sax.make_parser() - # turn on this line if you want to disable namespaces - ##parser.setFeature(feature_namespaces, 0) - config_handler = ConfigHandler() - parser.setContentHandler(config_handler) - parser.parse(self.__file) - return config_values - - - -if __name__ == '__main__': - file = '/home/paul/docutils-extensions/configure.xml' - obj = Configure(file) - obj.read_configs() diff --git a/sandbox/paultremblay/rst_to_docbook/rst_to_docbook/xsl_convert.py b/sandbox/paultremblay/rst_to_docbook/rst_to_docbook/xsl_convert.py deleted file mode 100644 index 3fba134a3..000000000 --- a/sandbox/paultremblay/rst_to_docbook/rst_to_docbook/xsl_convert.py +++ /dev/null @@ -1,145 +0,0 @@ -# WARNING TO PAUL: DON'T EDIT THIS FILE use update.py instead. -import sys, os, tempfile - - - - -""" - - -""" - - -class XslConvert: - - def __init__(self, processor = 'xsltproc'): - - """ - - - - """ - self.__determine_processor(processor) - - - - def __determine_processor(self, processor): - if processor == 'xsltproc' or processor == 'xmllint': - self.__processor = 'xmllint' - elif processor == '4suite': - self.__processor = '4suite' - elif processor == 'xalan': - self.__processor = 'xalan' - else: - sys.stderr.write('%s not a valid processor choice\n' % processor) - sys.exit(1) - - def transform(self, file, xsl_file, output, params = {}): - """ - Requires: - - file -- the file to parse - - xsl_file --the xsl style sheet - - Returns: - - nothing - - Logic: - - Check for the existence of the files and the stylesheet. Determine - the processor to be used, and let the othe methods do the processing. - - """ - - if not (os.path.exists(file)): - sys.stderr.write('"%s" does not exist\n' % file) - sys.exit(1) - if not (os.path.exists(xsl_file)): - sys.stderr.write('"%s" does not exist\n' % xsl_file) - sys.exit(1) - - if self.__processor == 'xmllint': - self.__transform_xmllint(file, xsl_file, output, params) - if self.__processor == 'xalan': - self.__transform_xalan(file, xsl_file, output, params) - - elif self.__processor == '4suite': - self.__transform_4suite(file, xsl_file, output, params) - - def __transform_xmllint(self, file, xsl_file, output, params = {}): - import libxml2 - import libxslt - - new_params = {} - keys = params.keys() - for key in keys: - new_params[key] = '"%s"' % params[key] - params = new_params - - - - xml_doc = file - # parse stylesheet - styledoc = libxml2.parseFile(xsl_file) - style = libxslt.parseStylesheetDoc(styledoc) - # parse doc - doc = libxml2.parseFile(xml_doc) - result = style.applyStylesheet(doc, params) - style.saveResultToFilename(output, result, 0) - style.freeStylesheet() - doc.freeDoc() - result.freeDoc() - - - - def __transform_4suite(self, file, xsl_file, output, params): - - import codecs - from Ft.Xml import InputSource - from Ft.Xml.Xslt.Processor import Processor - - document = InputSource.DefaultFactory.fromUri(file) - stylesheet = InputSource.DefaultFactory.fromUri(xsl_file) - # there's also a fromString() method - - processor = Processor() - processor.appendStylesheet(stylesheet) - result = processor.run(document, topLevelParams=params) - (utf8_encode, utf8_decode, utf8_reader, utf8_writer) = codecs.lookup("utf-8") - write_obj = utf8_writer(open(output, 'w')) - write_obj.write(result) - write_obj.close() - - def __transform_xalan(self, file, xsl_file, output, params): - command = 'java org.apache.xalan.xslt.Process \ - -Ts -in %s -xsl %s -out %s' % (file, xsl_file, output) - - param_string = '' - keys = params.keys() - for key in keys: - param_string += ' %s "%s"' % (key, params[key]) - - command += ' -PARAM %s' % param_string - print command - os.system(command) - - - -if __name__ == '__main__': - test_xml_dir = '/home/paul/lib/python/xml_tools_trem/test_files/xml_files' - test_xsl_dir = '/home/paul/lib/python/xml_tools_trem/test_files/xsl_stylesheets' - output_dir = '/home/paul/paultemp' - - file = 'simple.xml' - xsl_file = 'simple1.xsl' - output = 'output.xml' - - - test_file = os.path.join(test_xml_dir, file) - test_xsl = os.path.join(test_xsl_dir, xsl_file) - test_output = os.path.join(output_dir, output) - - test_obj = XslConvert('xalan') - test_obj.transform (test_file, test_xsl, test_output, params = {'test-param': 'changed in xalan'}) diff --git a/sandbox/paultremblay/rst_to_docbook/scripts/rst2docbook.py b/sandbox/paultremblay/rst_to_docbook/scripts/rst2docbook.py deleted file mode 100644 index ccc52fa15..000000000 --- a/sandbox/paultremblay/rst_to_docbook/scripts/rst2docbook.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python -import sys, os -import rst_to_docbook.convert_rst_to_docbook -import rst_to_docbook.options_trem - -class Convert: - - def __init__(self): - pass - - def convert(self): - debug_doc = self.__parse_options() - - convert_obj = rst_to_docbook.convert_rst_to_docbook.ConvertRstToDoc(doc_debug = debug_doc) - convert_obj.convert_to_docbook() - - def __parse_options(self): - if '--debug-doc' in sys.argv: - sys.argv.remove('--debug-doc') - return 1 - return 0 - -if __name__ == '__main__': - execute_obj = Convert() - execute_obj.convert() diff --git a/sandbox/paultremblay/rst_to_docbook/setup.py b/sandbox/paultremblay/rst_to_docbook/setup.py deleted file mode 100644 index 4a93d0880..000000000 --- a/sandbox/paultremblay/rst_to_docbook/setup.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python -import sys, os -from distutils.core import setup - -from distutils.core import setup - - -# get the location for the data -var_file_exists = os.path.isfile('var_file') -if not var_file_exists: - sys.stderr.write('Please run python configure.py first\n') - sys.exit(1) -read_obj = open('var_file', 'r') -lines = read_obj.readlines() -data_location = lines[0] -data_xslt_location = os.path.join(data_location, '.rst_to_docbook', 'xslt_stylesheets') -data_config_location = os.path.join(data_location, '.rst_to_docbook') -read_obj.close() - - - -setup(name="rst_to_docbook", - version=".1", - description="convert rst to docbook.", - author="Paul Tremblay", - author_email="phthenry@earthlink.net", - packages=['rst_to_docbook'], - data_files = [(data_xslt_location, - [ - 'data/xslt_stylesheets/reStruct_field_names_tokenize.xsl', - 'data/xslt_stylesheets/reStruct_field_names.xsl', - 'data/xslt_stylesheets/reStruct_to_docbook.xsl', - 'data/xslt_stylesheets/reStructure_to_docbook.xsl' - ] - ), - (data_config_location, ['data/configure']) - - ], - scripts=["scripts/rst2docbook.py"], - ) - -## os.remove('var_file') - - diff --git a/sandbox/paultremblay/rst_to_docbook/test_files/reStructure_docbook_example.rst b/sandbox/paultremblay/rst_to_docbook/test_files/reStructure_docbook_example.rst deleted file mode 100644 index 304f8f4ab..000000000 --- a/sandbox/paultremblay/rst_to_docbook/test_files/reStructure_docbook_example.rst +++ /dev/null @@ -1,65 +0,0 @@ -.. WARNING TO PAUL: DON'T EDIT THIS FILE use update.py instead. -Example of reStructure document that can be converted to docbook -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. author: Paul Tremblay Won't work like that - -:author: - - :first: Paul - - :surname: Tremblay - - :email: phthenry@earthlink.net - - -:revision: - - :revnumber: 01 - - :date: 2003-04-24 - - :revremark: When I first started writing this document. - -:revision: - - :revnumber: 02 - - :date: 2003-05-01 - - :revremark: Made the following changes - -.. start body - -======================== -Using snippets of code -======================== - -How to represent a snippet of code: - -:example program: - - :title: Processing a variable - - :: - - if var = 5 - self.__process(var) - - -Keep in mind that the docbook should look like: - -:: - - - A formal example - - if var = 5 - self.__process(var) - - - -.. end of example - - - diff --git a/sandbox/paultremblay/rst_to_docbook/test_files/simple.xml b/sandbox/paultremblay/rst_to_docbook/test_files/simple.xml deleted file mode 100644 index 16b68e755..000000000 --- a/sandbox/paultremblay/rst_to_docbook/test_files/simple.xml +++ /dev/null @@ -1,3 +0,0 @@ - - text - diff --git a/sandbox/paultremblay/rst_to_docbook/test_files/simple.xsl b/sandbox/paultremblay/rst_to_docbook/test_files/simple.xsl deleted file mode 100644 index 8e15469c1..000000000 --- a/sandbox/paultremblay/rst_to_docbook/test_files/simple.xsl +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - diff --git a/sandbox/paultremblay/rst_to_docbook/test_files/test_simple.rst b/sandbox/paultremblay/rst_to_docbook/test_files/test_simple.rst deleted file mode 100644 index c314721ba..000000000 --- a/sandbox/paultremblay/rst_to_docbook/test_files/test_simple.rst +++ /dev/null @@ -1,11 +0,0 @@ -.. simple test file - -:author: Paul Tremblay - -Main body - -:custom-field arg1 arg2: - - body of block custom field - - more body [:role arg1 arg2: inline [:role2 arg1 arg2: more inline]] last of body diff --git a/sandbox/pobrien/LinuxFormat/LXFwriter.py b/sandbox/pobrien/LinuxFormat/LXFwriter.py deleted file mode 100644 index 13e39d3d8..000000000 --- a/sandbox/pobrien/LinuxFormat/LXFwriter.py +++ /dev/null @@ -1,984 +0,0 @@ -"""Linux Format writer.""" - -__author__ = "Patrick K. O'Brien " -__cvsid__ = "$Id$" -__revision__ = "$Revision$"[11:-2] - - -__docformat__ = 'reStructuredText' - - -import sys -import os -import time -import re -from types import ListType - -import docutils -from docutils import nodes, utils, writers, languages - - -class Writer(writers.Writer): - - supported = ('lxf', 'LinuxFormat') - """Formats this writer supports.""" - - output = None - """Final translated form of `document`.""" - - def __init__(self): - writers.Writer.__init__(self) - self.translator_class = Translator - - def translate(self): - visitor = self.translator_class(self.document) - self.document.walkabout(visitor) - self.output = visitor.astext() - - -class Translator(nodes.NodeVisitor): - """Produces Linux Format Magazine output.""" - - words_and_spaces = re.compile(r'\S+| +|\n') - - def __init__(self, document): - nodes.NodeVisitor.__init__(self, document) - self.settings = settings = document.settings - lcode = settings.language_code - self.language = languages.get_language(lcode) - self.head = [] - self.body = [] - self.foot = [] - self.part = self.body - self.section_level = 0 - self.context = [] - self.topic_class = '' - self.colspecs = [] - self.compact_p = 1 - self.compact_simple = None - self.in_bullet_list = False - self.in_docinfo = False - self.in_sidebar = False - self.sidebar_start = False - self.filterNewlines = True - - def astext(self): - """Return the final formatted document as a string.""" - return ''.join(self.head + ['\n///BODY COPY START///'] + - self.body + ['///END BODY COPY///\n'] + self.foot) - - def encode(self, text): - if self.filterNewlines: - text = text.replace('\n', ' ') - return text - - def visit_Text(self, node): - self.part.append(self.encode(node.astext())) - - def depart_Text(self, node): - pass - - def visit_address(self, node): - raise NotImplementedError, node.astext() - self.visit_docinfo_item(node, 'address', meta=None) - - def depart_address(self, node): - self.depart_docinfo_item() - - def visit_admonition(self, node, name): - raise NotImplementedError, node.astext() - self.part.append(self.starttag(node, 'div', CLASS=name)) - self.part.append('

' - + self.language.labels[name] + '

\n') - - def depart_admonition(self): - raise NotImplementedError, node.astext() - self.part.append('\n') - - def visit_attention(self, node): - self.visit_admonition(node, 'attention') - - def depart_attention(self, node): - self.depart_admonition() - - def visit_author(self, node): - raise NotImplementedError, node.astext() - self.visit_docinfo_item(node, 'author') - - def depart_author(self, node): - self.depart_docinfo_item() - - def visit_authors(self, node): - pass - - def depart_authors(self, node): - pass - - def visit_block_quote(self, node): - raise NotImplementedError, node.astext() - self.part.append(self.starttag(node, 'blockquote')) - - def depart_block_quote(self, node): - raise NotImplementedError, node.astext() - self.part.append('\n') - - def check_simple_list(self, node): - raise NotImplementedError, node.astext() - """Check for a simple list that can be rendered compactly.""" - visitor = SimpleListChecker(self.document) - try: - node.walk(visitor) - except nodes.NodeFound: - return None - else: - return 1 - - def visit_bullet_list(self, node): - self.in_bullet_list = True - - def depart_bullet_list(self, node): - self.in_bullet_list = False - - def visit_caption(self, node): - self.part.append('\n///CAPTION///') - self.visit_paragraph(node) - - def depart_caption(self, node): - self.depart_paragraph(node) - - def visit_caution(self, node): - self.visit_admonition(node, 'caution') - - def depart_caution(self, node): - self.depart_admonition() - - def visit_citation(self, node): - raise NotImplementedError, node.astext() - self.part.append(self.starttag(node, 'table', CLASS='citation', - frame="void", rules="none")) - self.part.append('\n' - '\n' - '\n' - '') - self.footnote_backrefs(node) - - def depart_citation(self, node): - raise NotImplementedError, node.astext() - self.part.append('\n' - '\n\n') - - def visit_citation_reference(self, node): - raise NotImplementedError, node.astext() - href = '' - if node.has_key('refid'): - href = '#' + node['refid'] - elif node.has_key('refname'): - href = '#' + self.document.nameids[node['refname']] - self.part.append(self.starttag(node, 'a', '[', href=href, - CLASS='citation-reference')) - - def depart_citation_reference(self, node): - raise NotImplementedError, node.astext() - self.part.append(']') - - def visit_classifier(self, node): - raise NotImplementedError, node.astext() - self.part.append(' : ') - self.part.append(self.starttag(node, 'span', '', CLASS='classifier')) - - def depart_classifier(self, node): - raise NotImplementedError, node.astext() - self.part.append('') - - def visit_colspec(self, node): - self.colspecs.append(node) - - def depart_colspec(self, node): - pass - - def write_colspecs(self): - raise NotImplementedError, node.astext() - width = 0 - for node in self.colspecs: - width += node['colwidth'] - for node in self.colspecs: - colwidth = int(node['colwidth'] * 100.0 / width + 0.5) - self.part.append(self.emptytag(node, 'col', - width='%i%%' % colwidth)) - self.colspecs = [] - - def visit_comment(self, node): - raise nodes.SkipNode - - def visit_contact(self, node): - raise NotImplementedError, node.astext() - self.visit_docinfo_item(node, 'contact', meta=None) - - def depart_contact(self, node): - self.depart_docinfo_item() - - def visit_copyright(self, node): - raise NotImplementedError, node.astext() - self.visit_docinfo_item(node, 'copyright') - - def depart_copyright(self, node): - self.depart_docinfo_item() - - def visit_danger(self, node): - self.visit_admonition(node, 'danger') - - def depart_danger(self, node): - self.depart_admonition() - - def visit_date(self, node): - raise NotImplementedError, node.astext() - self.visit_docinfo_item(node, 'date') - - def depart_date(self, node): - self.depart_docinfo_item() - - def visit_decoration(self, node): - pass - - def depart_decoration(self, node): - pass - - def visit_definition(self, node): - raise NotImplementedError, node.astext() - self.part.append('\n') - self.part.append(self.starttag(node, 'dd', '')) - if len(node): - node[0].set_class('first') - node[-1].set_class('last') - - def depart_definition(self, node): - raise NotImplementedError, node.astext() - self.part.append('\n') - - def visit_definition_list(self, node): - raise NotImplementedError, node.astext() - self.part.append(self.starttag(node, 'dl')) - - def depart_definition_list(self, node): - raise NotImplementedError, node.astext() - self.part.append('\n') - - def visit_definition_list_item(self, node): - pass - - def depart_definition_list_item(self, node): - pass - - def visit_description(self, node): - raise NotImplementedError, node.astext() - self.part.append(self.starttag(node, 'td', '')) - if len(node): - node[0].set_class('first') - node[-1].set_class('last') - - def depart_description(self, node): - raise NotImplementedError, node.astext() - self.part.append('') - - def visit_docinfo(self, node): - self.in_docinfo = True - - def depart_docinfo(self, node): - self.in_docinfo = False - - def visit_docinfo_item(self, node, name, meta=1): - raise NotImplementedError, node.astext() - if meta: - self.head.append('\n' - % (name, self.attval(node.astext()))) - self.part.append(self.starttag(node, 'tr', '')) - self.part.append('%s:\n' - % self.language.labels[name]) - if len(node): - if isinstance(node[0], nodes.Element): - node[0].set_class('first') - if isinstance(node[0], nodes.Element): - node[-1].set_class('last') - - def depart_docinfo_item(self): - raise NotImplementedError, node.astext() - self.part.append('\n') - - def visit_doctest_block(self, node): - raise NotImplementedError, node.astext() - self.part.append(self.starttag(node, 'pre', CLASS='doctest-block')) - - def depart_doctest_block(self, node): - raise NotImplementedError, node.astext() - self.part.append('\n\n') - - def visit_document(self, node): - pass - - def depart_document(self, node): - pass - - def visit_emphasis(self, node): - self.part.append('/') - - def depart_emphasis(self, node): - self.part.append('/') - - def visit_entry(self, node): - raise NotImplementedError, node.astext() - if isinstance(node.parent.parent, nodes.thead): - tagname = 'th' - else: - tagname = 'td' - atts = {} - if node.has_key('morerows'): - atts['rowspan'] = node['morerows'] + 1 - if node.has_key('morecols'): - atts['colspan'] = node['morecols'] + 1 - self.part.append(self.starttag(node, tagname, '', **atts)) - self.context.append('\n' % tagname.lower()) - if len(node) == 0: # empty cell - self.part.append(' ') - else: - node[0].set_class('first') - node[-1].set_class('last') - - def depart_entry(self, node): - raise NotImplementedError, node.astext() - self.part.append(self.context.pop()) - - def visit_enumerated_list(self, node): - raise NotImplementedError, node.astext() - """ - The 'start' attribute does not conform to HTML 4.01's strict.dtd, but - CSS1 doesn't help. CSS2 isn't widely enough supported yet to be - usable. - """ - atts = {} - if node.has_key('start'): - atts['start'] = node['start'] - if node.has_key('enumtype'): - atts['class'] = node['enumtype'] - # @@@ To do: prefix, suffix. How? Change prefix/suffix to a - # single "format" attribute? Use CSS2? - old_compact_simple = self.compact_simple - self.context.append((self.compact_simple, self.compact_p)) - self.compact_p = None - self.compact_simple = (self.settings.compact_lists and - (self.compact_simple - or self.topic_class == 'contents' - or self.check_simple_list(node))) - if self.compact_simple and not old_compact_simple: - atts['class'] = (atts.get('class', '') + ' simple').strip() - self.part.append(self.starttag(node, 'ol', **atts)) - - def depart_enumerated_list(self, node): - raise NotImplementedError, node.astext() - self.compact_simple, self.compact_p = self.context.pop() - self.part.append('\n') - - def visit_error(self, node): - self.visit_admonition(node, 'error') - - def depart_error(self, node): - self.depart_admonition() - - def visit_field(self, node): - if self.in_docinfo: - self.part = self.foot - - def depart_field(self, node): - self.part = self.body - - def visit_field_body(self, node): - pass - - def depart_field_body(self, node): - pass - - def visit_field_list(self, node): - raise NotImplementedError, node.astext() - - def depart_field_list(self, node): - raise NotImplementedError, node.astext() - - def visit_field_name(self, node): - if self.in_docinfo and node.astext() == 'Next': - self.part.append('\n\n///NEXT MONTH///') - raise nodes.SkipNode - else: - raise NotImplementedError, node.astext() - - def depart_field_name(self, node): - pass - - def visit_figure(self, node): - self.part = self.foot - self.part.append('\n\n///PIC///\n') - - def depart_figure(self, node): - self.part = self.body - - def visit_footer(self, node): - raise NotImplementedError, node.astext() - self.context.append(len(self.part)) - - def depart_footer(self, node): - raise NotImplementedError, node.astext() - start = self.context.pop() - footer = (['\n', - self.starttag(node, 'div', CLASS='footer')] - + self.part[start:] + ['\n']) - self.body_suffix[:0] = footer - del self.part[start:] - - def visit_footnote(self, node): - raise NotImplementedError, node.astext() - self.part.append(self.starttag(node, 'table', CLASS='footnote', - frame="void", rules="none")) - self.part.append('\n' - '\n' - '') - self.footnote_backrefs(node) - - def footnote_backrefs(self, node): - raise NotImplementedError, node.astext() - if self.settings.footnote_backlinks and node.hasattr('backrefs'): - backrefs = node['backrefs'] - if len(backrefs) == 1: - self.context.append('') - self.context.append('' % (backrefs[0], node['id'])) - else: - i = 1 - backlinks = [] - for backref in backrefs: - backlinks.append('%s' - % (backref, i)) - i += 1 - self.context.append('(%s) ' % ', '.join(backlinks)) - self.context.append('' % node['id']) - else: - self.context.append('') - self.context.append('' % node['id']) - - def depart_footnote(self, node): - raise NotImplementedError, node.astext() - self.part.append('\n' - '\n\n') - - def visit_footnote_reference(self, node): - raise NotImplementedError, node.astext() - href = '' - if node.has_key('refid'): - href = '#' + node['refid'] - elif node.has_key('refname'): - href = '#' + self.document.nameids[node['refname']] - format = self.settings.footnote_references - if format == 'brackets': - suffix = '[' - self.context.append(']') - elif format == 'superscript': - suffix = '' - self.context.append('') - else: # shouldn't happen - suffix = '???' - self.content.append('???') - self.part.append(self.starttag(node, 'a', suffix, href=href, - CLASS='footnote-reference')) - - def depart_footnote_reference(self, node): - raise NotImplementedError, node.astext() - self.part.append(self.context.pop() + '') - - def visit_generated(self, node): - pass - - def depart_generated(self, node): - pass - - def visit_header(self, node): - raise NotImplementedError, node.astext() - self.context.append(len(self.part)) - - def depart_header(self, node): - raise NotImplementedError, node.astext() - start = self.context.pop() - self.body_prefix.append(self.starttag(node, 'div', CLASS='header')) - self.body_prefix.extend(self.part[start:]) - self.body_prefix.append('
\n\n') - del self.part[start:] - - def visit_hint(self, node): - self.visit_admonition(node, 'hint') - - def depart_hint(self, node): - self.depart_admonition() - - def visit_image(self, node): - name = str(node.attributes['uri']) - self.part.append(name) - pass - - def depart_image(self, node): - pass - - def visit_important(self, node): - self.visit_admonition(node, 'important') - - def depart_important(self, node): - self.depart_admonition() - - def visit_label(self, node): - raise NotImplementedError, node.astext() - self.part.append(self.starttag(node, 'td', '%s[' % self.context.pop(), - CLASS='label')) - - def depart_label(self, node): - raise NotImplementedError, node.astext() - self.part.append(']%s' % self.context.pop()) - - def visit_legend(self, node): - raise NotImplementedError, node.astext() - self.part.append(self.starttag(node, 'div', CLASS='legend')) - - def depart_legend(self, node): - raise NotImplementedError, node.astext() - self.part.append('\n') - - def visit_line_block(self, node): - raise NotImplementedError, node.astext() - - def depart_line_block(self, node): - raise NotImplementedError, node.astext() - - def visit_list_item(self, node): - if self.in_bullet_list: - self.part.append('\n* ') - - def depart_list_item(self, node): - pass - - def visit_literal(self, node): - self.part.append('///code///') - - def depart_literal(self, node): - self.part.append('///code ends///') - - def visit_literal_block(self, node): - self.part.append('\n///CODE///\n') - self.filterNewlines = False - - def depart_literal_block(self, node): - self.part.append('\n///END CODE///\n') - self.filterNewlines = True - - def visit_meta(self, node): - raise NotImplementedError, node.astext() - self.head.append(self.emptytag(node, 'meta', **node.attributes)) - - def depart_meta(self, node): - pass - - def visit_note(self, node): - self.visit_admonition(node, 'note') - - def depart_note(self, node): - self.depart_admonition() - - def visit_option(self, node): - raise NotImplementedError, node.astext() - if self.context[-1]: - self.part.append(', ') - - def depart_option(self, node): - raise NotImplementedError, node.astext() - self.context[-1] += 1 - - def visit_option_argument(self, node): - raise NotImplementedError, node.astext() - self.part.append(node.get('delimiter', ' ')) - self.part.append(self.starttag(node, 'var', '')) - - def depart_option_argument(self, node): - raise NotImplementedError, node.astext() - self.part.append('') - - def visit_option_group(self, node): - raise NotImplementedError, node.astext() - atts = {} - if len(node.astext()) > 14: - atts['colspan'] = 2 - self.context.append('\n ') - else: - self.context.append('') - self.part.append(self.starttag(node, 'td', **atts)) - self.part.append('') - self.context.append(0) # count number of options - - def depart_option_group(self, node): - raise NotImplementedError, node.astext() - self.context.pop() - self.part.append('\n') - self.part.append(self.context.pop()) - - def visit_option_list(self, node): - raise NotImplementedError, node.astext() - self.part.append( - self.starttag(node, 'table', CLASS='option-list', - frame="void", rules="none")) - self.part.append('\n' - '\n' - '\n') - - def depart_option_list(self, node): - raise NotImplementedError, node.astext() - self.part.append('\n\n') - - def visit_option_list_item(self, node): - raise NotImplementedError, node.astext() - self.part.append(self.starttag(node, 'tr', '')) - - def depart_option_list_item(self, node): - raise NotImplementedError, node.astext() - self.part.append('\n') - - def visit_option_string(self, node): - raise NotImplementedError, node.astext() - self.part.append(self.starttag(node, 'span', '', CLASS='option')) - - def depart_option_string(self, node): - raise NotImplementedError, node.astext() - self.part.append('') - - def visit_organization(self, node): - raise NotImplementedError, node.astext() - self.visit_docinfo_item(node, 'organization') - - def depart_organization(self, node): - raise NotImplementedError, node.astext() - self.depart_docinfo_item() - - def visit_paragraph(self, node): - if self.in_sidebar and self.sidebar_start: - self.part.append('///BOX BODY///') - self.sidebar_start = False - if not self.in_bullet_list: - self.part.append('\n') - - def depart_paragraph(self, node): - self.part.append('\n') - - def visit_problematic(self, node): - raise NotImplementedError, node.astext() - if node.hasattr('refid'): - self.part.append('' % (node['refid'], - node['id'])) - self.context.append('') - else: - self.context.append('') - self.part.append(self.starttag(node, 'span', '', CLASS='problematic')) - - def depart_problematic(self, node): - raise NotImplementedError, node.astext() - self.part.append('') - self.part.append(self.context.pop()) - - def visit_raw(self, node): - raise NotImplementedError, node.astext() - if node.get('format') == 'html': - self.part.append(node.astext()) - # Keep non-HTML raw text out of output: - raise nodes.SkipNode - - def visit_reference(self, node): - pass - - def depart_reference(self, node): - pass - - def visit_revision(self, node): - raise NotImplementedError, node.astext() - self.visit_docinfo_item(node, 'revision', meta=None) - - def depart_revision(self, node): - self.depart_docinfo_item() - - def visit_row(self, node): - raise NotImplementedError, node.astext() - self.part.append(self.starttag(node, 'tr', '')) - - def depart_row(self, node): - raise NotImplementedError, node.astext() - self.part.append('\n') - - def visit_section(self, node): - self.section_level += 1 - - def depart_section(self, node): - self.section_level -= 1 - - def visit_sidebar(self, node): - self.part = self.foot - self.in_sidebar = True - self.sidebar_start = True - self.part.append('\n\n///BOXOUT///\n') - - def depart_sidebar(self, node): - self.part.append('///END BOX BODY///\n') - self.in_sidebar = False - self.part = self.body - - def visit_status(self, node): - raise NotImplementedError, node.astext() - self.visit_docinfo_item(node, 'status', meta=None) - - def depart_status(self, node): - self.depart_docinfo_item() - - def visit_strong(self, node): - self.part.append('*') - - def depart_strong(self, node): - self.part.append('*') - - def visit_substitution_definition(self, node): - """Internal only.""" - raise nodes.SkipNode - - def visit_substitution_reference(self, node): - self.unimplemented_visit(node) - - def visit_subtitle(self, node): - if self.in_sidebar: - self.part.append('///BOXOUT SUBHEAD///\n') - else: - self.part = self.head - self.part.append('\n///DESCRIPTION///\n') - - def depart_subtitle(self, node): - self.part.append('\n') - if self.in_sidebar: - pass - else: - self.part = self.body - - def visit_system_message(self, node): - raise NotImplementedError, node.astext() - if node['level'] < self.document.reporter['writer'].report_level: - # Level is too low to display: - raise nodes.SkipNode - self.part.append(self.starttag(node, 'div', CLASS='system-message')) - self.part.append('

') - attr = {} - backref_text = '' - if node.hasattr('id'): - attr['name'] = node['id'] - if node.hasattr('backrefs'): - backrefs = node['backrefs'] - if len(backrefs) == 1: - backref_text = ('; backlink' - % backrefs[0]) - else: - i = 1 - backlinks = [] - for backref in backrefs: - backlinks.append('%s' % (backref, i)) - i += 1 - backref_text = ('; backlinks: %s' - % ', '.join(backlinks)) - if node.hasattr('line'): - line = ', line %s' % node['line'] - else: - line = '' - if attr: - a_start = self.starttag({}, 'a', '', **attr) - a_end = '' - else: - a_start = a_end = '' - self.part.append('System Message: %s%s/%s%s (%s%s)%s

\n' - % (a_start, node['type'], node['level'], a_end, - node['source'], line, backref_text)) - - def depart_system_message(self, node): - raise NotImplementedError, node.astext() - self.part.append('\n') - - def visit_table(self, node): - raise NotImplementedError, node.astext() - self.part.append( - self.starttag(node, 'table', CLASS="table", - frame='border', rules='all')) - - def depart_table(self, node): - raise NotImplementedError, node.astext() - self.part.append('\n') - - def visit_target(self, node): - raise NotImplementedError, node.astext() - if not (node.has_key('refuri') or node.has_key('refid') - or node.has_key('refname')): - self.part.append(self.starttag(node, 'a', '', CLASS='target')) - self.context.append('') - else: - self.context.append('') - - def depart_target(self, node): - raise NotImplementedError, node.astext() - self.part.append(self.context.pop()) - - def visit_tbody(self, node): - raise NotImplementedError, node.astext() - self.write_colspecs() - self.part.append(self.context.pop()) # '\n' or '' - self.part.append(self.starttag(node, 'tbody', valign='top')) - - def depart_tbody(self, node): - raise NotImplementedError, node.astext() - self.part.append('\n') - - def visit_term(self, node): - raise NotImplementedError, node.astext() - self.part.append(self.starttag(node, 'dt', '')) - - def depart_term(self, node): - """ - Leave the end tag to `self.visit_definition()`, in case there's a - classifier. - """ - raise NotImplementedError, node.astext() - pass - - def visit_tgroup(self, node): - raise NotImplementedError, node.astext() - # Mozilla needs : - self.part.append(self.starttag(node, 'colgroup')) - # Appended by thead or tbody: - self.context.append('\n') - - def depart_tgroup(self, node): - pass - - def visit_thead(self, node): - raise NotImplementedError, node.astext() - self.write_colspecs() - self.part.append(self.context.pop()) # '\n' - # There may or may not be a ; this is for to use: - self.context.append('') - self.part.append(self.starttag(node, 'thead', valign='bottom')) - - def depart_thead(self, node): - raise NotImplementedError, node.astext() - self.part.append('\n') - - def visit_tip(self, node): - self.visit_admonition(node, 'tip') - - def depart_tip(self, node): - self.depart_admonition() - - def visit_title(self, node): - """Only 2 section levels are supported.""" - if isinstance(node.parent, nodes.topic): - if self.topic_class == 'abstract': - self.part = self.head - self.part.append('\n///STRAP///') - raise nodes.SkipNode - elif self.in_sidebar: - # sidebar title - self.part.append('///BOXOUT HEAD///\n') - elif self.section_level == 0: - # document title - self.part = self.head - self.part.append('///TITLE///\n') - else: - self.part.append('\n///CROSSHEAD///\n') - - def depart_title(self, node): - self.part.append('\n') - if not self.in_sidebar: - self.part = self.body - - def visit_title_reference(self, node): - raise NotImplementedError, node.astext() - self.part.append(self.starttag(node, 'cite', '')) - - def depart_title_reference(self, node): - raise NotImplementedError, node.astext() - self.part.append('') - - def visit_topic(self, node): - self.topic_class = node.get('class') - - def depart_topic(self, node): - self.topic_class = '' - self.part = self.body - - def visit_transition(self, node): - raise NotImplementedError, node.astext() - self.part.append(self.emptytag(node, 'hr')) - - def depart_transition(self, node): - pass - - def visit_version(self, node): - raise NotImplementedError, node.astext() - self.visit_docinfo_item(node, 'version', meta=None) - - def depart_version(self, node): - self.depart_docinfo_item() - - def visit_warning(self, node): - self.visit_admonition(node, 'warning') - - def depart_warning(self, node): - self.depart_admonition() - - def unimplemented_visit(self, node): - raise NotImplementedError('visiting unimplemented node type: %s' - % node.__class__.__name__) - - -class SimpleListChecker(nodes.GenericNodeVisitor): - - """ - Raise `nodes.SkipNode` if non-simple list item is encountered. - - Here "simple" means a list item containing nothing other than a single - paragraph, a simple list, or a paragraph followed by a simple list. - """ - - def default_visit(self, node): - raise nodes.NodeFound - - def visit_bullet_list(self, node): - pass - - def visit_enumerated_list(self, node): - pass - - def visit_list_item(self, node): - children = [] - for child in node.get_children(): - if not isinstance(child, nodes.Invisible): - children.append(child) - if (children and isinstance(children[0], nodes.paragraph) - and (isinstance(children[-1], nodes.bullet_list) - or isinstance(children[-1], nodes.enumerated_list))): - children.pop() - if len(children) <= 1: - return - else: - raise nodes.NodeFound - - def visit_paragraph(self, node): - raise nodes.SkipNode - - def invisible_visit(self, node): - """Invisible nodes should be ignored.""" - pass - - visit_comment = invisible_visit - visit_substitution_definition = invisible_visit - visit_target = invisible_visit - visit_pending = invisible_visit diff --git a/sandbox/pobrien/LinuxFormat/__init__.py b/sandbox/pobrien/LinuxFormat/__init__.py deleted file mode 100644 index db6003cf3..000000000 --- a/sandbox/pobrien/LinuxFormat/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# Orbtech python package. \ No newline at end of file diff --git a/sandbox/pobrien/LinuxFormat/rest2lxf.py b/sandbox/pobrien/LinuxFormat/rest2lxf.py deleted file mode 100755 index 720cc3a0a..000000000 --- a/sandbox/pobrien/LinuxFormat/rest2lxf.py +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env python - -"""Generates Linux Format articles.""" - -__author__ = "Patrick K. O'Brien " -__cvsid__ = "$Id$" -__revision__ = "$Revision$"[11:-2] - -import locale -try: - locale.setlocale(locale.LC_ALL, '') -except: - pass - -from docutils.core import publish_cmdline, default_description - -from LXFwriter import Writer - - -def main(): - description = ("Generates Linux Format articles. " + default_description) - publish_cmdline(writer=Writer(), description=description) - - -if __name__ == '__main__': - main() diff --git a/sandbox/pobrien/OpenOffice/OOdirectives.py b/sandbox/pobrien/OpenOffice/OOdirectives.py deleted file mode 100644 index 5cf89b459..000000000 --- a/sandbox/pobrien/OpenOffice/OOdirectives.py +++ /dev/null @@ -1,77 +0,0 @@ -"""Custom directives""" - -__author__ = "Patrick K. O'Brien " -__cvsid__ = "$Id$" -__revision__ = "$Revision$"[11:-2] - -import sys -import os - -from docutils import nodes -from docutils.parsers.rst import directives -from docutils.parsers.rst.languages import en - -registry = directives._directive_registry -registry['index'] = ('OOdirectives', 'index_directive') -registry['include-code'] = ('OOdirectives', 'include_code') -registry['include-output'] = ('OOdirectives', 'include_output') - -en.directives['index'] = 'index' -en.directives['include-code'] = 'include-code' -en.directives['include-output'] = 'include-output' - - -#class index_entry(nodes.General, nodes.Element): pass -class index_entry(nodes.Inline, nodes.TextElement): pass - - -def index_directive(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - #nodes = [] - #for entry in content: - # nodes.append(index_entry(entry, entry)) - #return nodes - entries = '\n'.join(content) - return [index_entry(entries,entries)] - -index_directive.content = 1 - - -def include_code(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - #obj = state_machine.document.attributes - #print >> sys.stderr, obj - #print >> sys.stderr, dir(obj) - document = state_machine.document - dirname = getDocDir(document) - fname = os.path.join(dirname, arguments[0]) - code = open(fname).read() - return [nodes.literal_block(code, code)] - -include_code.arguments = (0, 1, 0) - - -def include_output(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - document = state_machine.document - dirname = getDocDir(document) - fname = os.path.join(dirname, arguments[0]) - cmd = os.environ['PYTHON'] + ' ' + fname - f_input, f_output = os.popen4(cmd) - output = f_output.read() - f_output.close() - return [nodes.literal_block(output, output)] - -include_output.arguments = (0, 1, 0) - - -def getDocDir(document): - source = document.current_source - if source is None: - return os.getcwd() - else: - dirname = os.path.dirname(os.path.abspath(source)) - if dirname is None: - return os.getcwd() - else: - return dirname diff --git a/sandbox/pobrien/OpenOffice/OOtext.py b/sandbox/pobrien/OpenOffice/OOtext.py deleted file mode 100644 index ee7509e9b..000000000 --- a/sandbox/pobrien/OpenOffice/OOtext.py +++ /dev/null @@ -1,707 +0,0 @@ -"""Text used in the creation of the XML files.""" - -__author__ = "Patrick K. O'Brien " -__cvsid__ = "$Id$" -__revision__ = "$Revision$"[11:-2] - - -# Can't have blank line at beginning of XML - -manifest = ''' - - - -%s -%s - -''' - -# The pictures list gets populated by OOwriter as it comes across -# images in the document. -pictures = [] - -m_xml_format = '' - -m_tif_format = '' - -m_png_format = '' - -content_header = ''' - - - - - - - - - -''' - -content_footer = ''' - - -''' - -styles = ''' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -10 - - - - - - - -10 - - - - - - - -Author Template - -Manning Publications Co. - - -10 - - - - - - -Author Template - -Manning Publications Co. - - - -10 - - - - - - - -''' - -# Temporary style info: - -''' - -''' diff --git a/sandbox/pobrien/OpenOffice/OOwriter.py b/sandbox/pobrien/OpenOffice/OOwriter.py deleted file mode 100644 index 7fbd6b1c2..000000000 --- a/sandbox/pobrien/OpenOffice/OOwriter.py +++ /dev/null @@ -1,780 +0,0 @@ -"""OpenOffice writer - -The output is an OpenOffice.org 1.0-compatible document.""" - -__author__ = "Patrick K. O'Brien " -__cvsid__ = "$Id$" -__revision__ = "$Revision$"[11:-2] - -# Based on work orginally created by: -# Author: Aahz -# Contact: aahz@pythoncraft.com - -__docformat__ = 'reStructuredText' - -import sys -from warnings import warn -import re - -import docutils -from docutils import nodes, utils, writers, languages - -import OOtext - -import Image # from the Python Imaging Library - -section_styles = [ - '.ch title', - '.head 1', - '.head 2', - '.head 3alone', - ] - - -class Writer(writers.Writer): - - supported = ('OpenOffice') - """Formats this writer supports.""" - - output = None - """Final translated form of `document`.""" - - def __init__(self): - writers.Writer.__init__(self) - self.translator_class = Translator - - def translate(self): - visitor = self.translator_class(self.document) - self.document.walkabout(visitor) - self.output = visitor.astext() - - -class Translator(nodes.NodeVisitor): - - header = [OOtext.content_header] - footer = [OOtext.content_footer] - - start_para = '\n\n' - end_para = '\n\n' - - start_charstyle = '' - end_charstyle = '' - - line_break = '\n' - re_spaces = re.compile(' +') - spaces = '' - - re_annotation = re.compile(r'#\d+(?:, #\d+)*$') - - def __init__(self, document): - nodes.NodeVisitor.__init__(self, document) - self.settings = document.settings - self.body = [] - self.section_level = 0 - self.skip_para_tag = False - self.para_styles = ['.body'] - self.compact_p = 1 - self.compact_simple = None - self.context = [] - self.inBulletList = False - self.inEnumList = False - self.bodyOne = False - - def astext(self): - """Return the final formatted document as a string.""" - return ''.join(self.header + self.body + self.footer) - - def encode(self, text): - """Encode special characters in `text` & return.""" - # @@@ A codec to do these and all other HTML entities would be nice. - text = text.replace("&", "&") - text = text.replace("<", "<") - text = text.replace('"', """) - text = text.replace(">", ">") - return text - - def compress_spaces(self, line): - while 1: - match = self.re_spaces.search(line) - if match: - start, end = match.span() - numspaces = end - start - line = line[:start] + (self.spaces % numspaces) + line[end:] - else: - break - return line - - def fix_annotation(self, line): - match = self.re_annotation.search(line) - if match: - pos = match.start() - line = line[:pos] + '|' + line[pos:] - return line - - def visit_Text(self, node): - self.body.append(self.encode(node.astext())) - - def depart_Text(self, node): - pass - - def visit_admonition(self, node, name): - self.skip_para_tag = False - self.para_styles.append('.CALLOUT') - - def depart_admonition(self): - self.para_styles.pop() - self.bodyOne = True - - def visit_attention(self, node): - self.visit_admonition(node, 'attention') - - def depart_attention(self, node): - self.depart_admonition() - -## def visit_(self, node): -## pass - -## def depart_(self, node): -## pass - - def visit_author(self, node): - pass - - def depart_author(self, node): - pass - - def visit_authors(self, node): - pass - - def depart_authors(self, node): - pass - - def visit_block_quote(self, node): - self.skip_para_tag = True - self.body.append(self.start_para % '.quotes') - - def depart_block_quote(self, node): - self.body.append(self.end_para) - self.skip_para_tag = False - self.bodyOne = True - - def visit_bullet_list(self, node): - self.inBulletList = True - self.body.append('\n\n') - - def depart_bullet_list(self, node): - self.body.append('\n') - self.inBulletList = False - self.bodyOne = True - - def visit_caption(self, node): - pass - - def depart_caption(self, node): - pass - - def visit_caution(self, node): - self.visit_admonition(node, 'caution') - - def depart_caution(self, node): - self.depart_admonition() - - def visit_citation(self, node): - self.body.append(self.starttag(node, 'table', CLASS='citation', - frame="void", rules="none")) - self.footnote_backrefs(node) - - def depart_citation(self, node): - self.body.append('\n' - '\n\n') - - def visit_citation_reference(self, node): - href = '' - if node.has_key('refid'): - href = '#' + node['refid'] - elif node.has_key('refname'): - href = '#' + self.document.nameids[node['refname']] - self.body.append(self.starttag(node, 'a', '[', href=href, - CLASS='citation-reference')) - - def depart_citation_reference(self, node): - self.body.append(']') - - def visit_classifier(self, node): - self.body.append(' : ') - self.body.append(self.starttag(node, 'span', '', CLASS='classifier')) - - def depart_classifier(self, node): - self.body.append('') - - def visit_colspec(self, node): - self.colspecs.append(node) - - def depart_colspec(self, node): - pass - - def write_colspecs(self): - width = 0 - for node in self.colspecs: - width += node['colwidth'] - for node in self.colspecs: - colwidth = int(node['colwidth'] * 100.0 / width + 0.5) - self.body.append(self.emptytag(node, 'col', - colwidth='%i%%' % colwidth)) - self.colspecs = [] - - def visit_comment(self, node): - raise nodes.SkipNode - - def visit_date(self, node): - pass - - def depart_date(self, node): - pass - - def visit_decoration(self, node): - pass - - def depart_decoration(self, node): - pass - - def visit_definition(self, node): - self.body.append('\n') - self.body.append(self.starttag(node, 'dd', '')) - if len(node) and isinstance(node[0], nodes.paragraph): - node[0].set_class('first') - - def depart_definition(self, node): - self.body.append('\n') - - def visit_definition_list(self, node): - print node.astext() - self.body.append(self.starttag(node, 'dl')) - - def depart_definition_list(self, node): - self.body.append('\n') - - def visit_definition_list_item(self, node): - pass - - def depart_definition_list_item(self, node): - pass - - def visit_description(self, node): - self.body.append(self.starttag(node, 'td', '')) - if len(node) and isinstance(node[0], nodes.paragraph): - node[0].set_class('first') - - def depart_description(self, node): - self.body.append('') - - def visit_docinfo(self, node): - raise nodes.SkipNode - - def depart_docinfo(self, node): - pass - - def visit_doctest_block(self, node): - self.visit_literal_block(node) - - def visit_document(self, node): - pass - - def depart_document(self, node): - pass - - def visit_emphasis(self, node): - self.body.append(self.start_charstyle % 'italic') - - def depart_emphasis(self, node): - self.body.append(self.end_charstyle) - - def visit_entry(self, node): - if isinstance(node.parent.parent, nodes.thead): - tagname = 'th' - else: - tagname = 'td' - atts = {} - if node.has_key('morerows'): - atts['rowspan'] = node['morerows'] + 1 - if node.has_key('morecols'): - atts['colspan'] = node['morecols'] + 1 - self.body.append(self.starttag(node, tagname, '', **atts)) - self.context.append('\n' % tagname.lower()) - if len(node) == 0: # empty cell - self.body.append(' ') - elif isinstance(node[0], nodes.paragraph): - node[0].set_class('first') - - def depart_entry(self, node): - self.body.append(self.context.pop()) - - def visit_enumerated_list(self, node): - self.inEnumList = True - self.body.append('\n\n') - - def depart_enumerated_list(self, node): - self.body.append('\n') - self.inEnumList = False - self.bodyOne = True - - def visit_error(self, node): - self.visit_admonition(node, 'error') - - def depart_error(self, node): - self.depart_admonition() - - def visit_field(self, node): - self.body.append(self.starttag(node, 'tr', '', CLASS='field')) - - def depart_field(self, node): - self.body.append('\n') - - def visit_field_body(self, node): - self.body.append(self.starttag(node, 'td', '', CLASS='field-body')) - if len(node) and isinstance(node[0], nodes.paragraph): - node[0].set_class('first') - - def depart_field_body(self, node): - self.body.append('\n') - - def visit_field_list(self, node): - self.body.append(self.starttag(node, 'table', frame='void', - rules='none', CLASS='field-list')) - self.body.append('\n' - '\n' - '\n') - - def depart_field_list(self, node): - self.body.append('\n\n') - - def visit_field_name(self, node): - atts = {} - if self.in_docinfo: - atts['class'] = 'docinfo-name' - else: - atts['class'] = 'field-name' - if len(node.astext()) > 14: - atts['colspan'] = 2 - self.context.append('\n ') - else: - self.context.append('') - self.body.append(self.starttag(node, 'th', '', **atts)) - - def depart_field_name(self, node): - self.body.append(':') - self.body.append(self.context.pop()) - - def visit_figure(self, node): -## self.body.append('\n') - self.body.append(self.start_para % '.figure') - - def depart_figure(self, node): - self.body.append(self.end_para) - self.bodyOne = True - - def visit_footnote(self, node): - raise nodes.SkipNode - - def footnote_backrefs(self, node): - warn("footnote backrefs not available") - - def depart_footnote(self, node): - pass - - def visit_footnote_reference(self, node): - name = node['refid'] - id = node['id'] - number = node['auto'] - for footnote in self.document.autofootnotes: - if name == footnote['name']: - break - self.body.append('\n' % id) - self.body.append('\n' % number) - self.body.append('\n') - self.body.append(self.start_para % '.body') - for child in footnote.children: - if isinstance(child, nodes.paragraph): - self.body.append(child.astext()) - self.body.append(self.end_para) - self.body.append('\n') - self.body.append('') - raise nodes.SkipNode - - def depart_footnote_reference(self, node): - pass - - def visit_generated(self, node): - pass - - def depart_generated(self, node): - pass - - def visit_header(self, node): - self.context.append(len(self.body)) - - def depart_header(self, node): - start = self.context.pop() - self.body_prefix.append(self.starttag(node, 'div', CLASS='header')) - self.body_prefix.extend(self.body[start:]) - self.body_prefix.append('
\n\n') - del self.body[start:] - - def visit_hint(self, node): - self.visit_admonition(node, 'hint') - - def depart_hint(self, node): - self.depart_admonition() - - def visit_image(self, node): - name = str(node.attributes['uri']) - image = Image.open(name) - format = image.format - dpi = 96.0 - width, height = image.size - width /= dpi - height /= dpi - scale = None - if 'scale' in node.attributes: - scale = node.attributes['scale'] - if scale is not None: - factor = scale / 100.0 - width *= factor - height *= factor - # Add to our list so that rest2oo.py can create the manifest. - if format == 'PNG': - OOtext.pictures.append((name, OOtext.m_png_format % name)) - elif format == 'TIFF': - OOtext.pictures.append((name, OOtext.m_tif_format % name)) - else: - print '*** Image type not recognized ***', repr(name) - #self.body.append('\n') - self.body.append('') - self.body.append('Figure X.X\n') - - def depart_image(self, node): - pass - - def visit_important(self, node): - self.visit_admonition(node, 'important') - - def depart_important(self, node): - self.depart_admonition() - - def visit_index_entry(self, node): - index_format = '\n' - self.body.append(self.start_para % '.body') - entries = node.astext().split('\n') - for entry in entries: - self.body.append(index_format % self.encode(entry)) - self.body.append(self.end_para) - raise nodes.SkipNode - - def visit_interpreted(self, node): - # @@@ Incomplete, pending a proper implementation on the - # Parser/Reader end. - #self.body.append(node['role'] + ':') - self.body.append(node.astext()) - raise nodes.SkipNode - - def depart_interpreted(self, node): - pass - - # Don't need footnote labels/numbers - def visit_label(self, node): - print "!" - raise nodes.SkipNode - - def visit_legend(self, node): - self.body.append(self.starttag(node, 'div', CLASS='legend')) - - def depart_legend(self, node): - self.body.append('\n') - - def visit_line_block(self, node): - self.body.append(self.start_para % '.quotes') - lines = node.astext() - lines = lines.split('\n') - lines = self.line_break.join(lines) - self.body.append(lines) - self.body.append(self.end_para) - raise nodes.SkipNode - - def visit_list_item(self, node): - self.body.append('') - - def depart_list_item(self, node): - self.body.append('\n') - - def visit_literal(self, node): - self.body.append(self.start_charstyle % 'code') - - def depart_literal(self, node): - self.body.append(self.end_charstyle) - - def visit_literal_block(self, node): - self.body.append(self.start_para % '.code first') - self.body.append(self.end_para) - lines = self.encode(node.astext()) - lines = lines.split('\n') - while lines[-1] == '': - lines.pop() - for line in lines: - self.body.append(self.start_para % '.code') - line = self.fix_annotation(line) - line = self.compress_spaces(line) - self.body.append(line) - self.body.append(self.end_para) - self.body.append(self.start_para % '.code last') - self.body.append(self.end_para) - self.bodyOne = True - raise nodes.SkipNode - - def visit_note(self, node): - self.visit_admonition(node, 'note') - - def depart_note(self, node): - self.depart_admonition() - - def visit_option(self, node): - if self.context[-1]: - self.body.append(', ') - - def depart_option(self, node): - self.context[-1] += 1 - - def visit_option_argument(self, node): - self.body.append(node.get('delimiter', ' ')) - self.body.append(self.starttag(node, 'var', '')) - - def depart_option_argument(self, node): - self.body.append('') - - def visit_option_group(self, node): - atts = {} - if len(node.astext()) > 14: - atts['colspan'] = 2 - self.context.append('\n ') - else: - self.context.append('') - self.body.append(self.starttag(node, 'td', **atts)) - self.body.append('') - self.context.append(0) # count number of options - - def depart_option_group(self, node): - self.context.pop() - self.body.append('\n') - self.body.append(self.context.pop()) - - def visit_option_list(self, node): - self.body.append( - self.starttag(node, 'table', CLASS='option-list', - frame="void", rules="none")) - self.body.append('\n' - '\n' - '\n') - - def depart_option_list(self, node): - self.body.append('\n\n') - - def visit_option_list_item(self, node): - self.body.append(self.starttag(node, 'tr', '')) - - def depart_option_list_item(self, node): - self.body.append('\n') - - def visit_option_string(self, node): - self.body.append(self.starttag(node, 'span', '', CLASS='option')) - - def depart_option_string(self, node): - self.body.append('') - - def visit_paragraph(self, node): - style = self.para_styles[-1] - if self.inBulletList: - style = '.bullet' - elif self.inEnumList: - style = '.numlist' - elif node.astext().startswith('(annotation)'): - style = '.code NOTATION' - elif self.bodyOne or node.astext().startswith('#'): - if style == '.body': - style = '.body1' - self.bodyOne = False - if not self.skip_para_tag: - self.body.append(self.start_para % style) - - def depart_paragraph(self, node): - if not self.skip_para_tag: - self.body.append(self.end_para) - - def visit_problematic(self, node): - if node.hasattr('refid'): - self.body.append('' % (node['refid'], - node['id'])) - self.context.append('') - else: - self.context.append('') - self.body.append(self.starttag(node, 'span', '', CLASS='problematic')) - - def depart_problematic(self, node): - self.body.append('') - self.body.append(self.context.pop()) - - def visit_raw(self, node): - if node.has_key('format') and node['format'] == 'html': - self.body.append(node.astext()) - raise nodes.SkipNode - - def visit_reference(self, node): - pass - - def depart_reference(self, node): - pass - - def visit_revision(self, node): - pass - - def depart_revision(self, node): - pass - - def visit_row(self, node): - self.body.append(self.starttag(node, 'tr', '')) - - def depart_row(self, node): - self.body.append('\n') - - def visit_section(self, node): - self.section_level += 1 - self.bodyOne = True - - def depart_section(self, node): - self.section_level -= 1 - - def visit_strong(self, node): - self.body.append('') - - def depart_strong(self, node): - self.body.append('') - - def visit_table(self, node): - self.body.append( - self.starttag(node, 'table', CLASS="table", - frame='border', rules='all')) - - def depart_table(self, node): - self.body.append('\n') - - def visit_target(self, node): - if not (node.has_key('refuri') or node.has_key('refid') - or node.has_key('refname')): - self.body.append(self.starttag(node, 'a', '', CLASS='target')) - self.context.append('') - else: - self.context.append('') - - def depart_target(self, node): - self.body.append(self.context.pop()) - - def visit_tbody(self, node): - self.write_colspecs() - self.body.append(self.context.pop()) # '\n' or '' - self.body.append(self.starttag(node, 'tbody', valign='top')) - - def depart_tbody(self, node): - self.body.append('\n') - - def visit_term(self, node): - self.body.append(self.starttag(node, 'dt', '')) - - def depart_term(self, node): - """ - Leave the end tag to `self.visit_definition()`, in case there's a - classifier. - """ - pass - - def visit_tgroup(self, node): - # Mozilla needs : - self.body.append(self.starttag(node, 'colgroup')) - # Appended by thead or tbody: - self.context.append('\n') - - def depart_tgroup(self, node): - pass - - def visit_thead(self, node): - self.write_colspecs() - self.body.append(self.context.pop()) # '\n' - # There may or may not be a ; this is for to use: - self.context.append('') - self.body.append(self.starttag(node, 'thead', valign='bottom')) - - def depart_thead(self, node): - self.body.append('\n') - - def visit_tip(self, node): - self.visit_admonition(node, 'tip') - - def depart_tip(self, node): - self.depart_admonition() - - def visit_title(self, node): - """Only 4 section levels are supported by this writer.""" - title_tag = self.start_para % section_styles[self.section_level] - self.body.append(title_tag) - - def depart_title(self, node): - self.body.append(self.end_para) - - def visit_topic(self, node): - if node.has_key('class') and node['class'] == 'contents': - raise nodes.SkipNode - else: - pass - - def depart_topic(self, node): - pass - - def visit_warning(self, node): - self.visit_admonition(node, 'warning') - - def depart_warning(self, node): - self.depart_admonition() - - def visit_system_message(self, node): - print node.astext() - - def depart_system_message(self, node): - pass - - def unknown_visit(self, node): - print "Failure processing at line", node.line - print "Failure is", node.astext() - raise NotImplementedError('visiting unimplemented node type: %s' - % node.__class__.__name__) - - -""" - - - -""" diff --git a/sandbox/pobrien/OpenOffice/__init__.py b/sandbox/pobrien/OpenOffice/__init__.py deleted file mode 100644 index db6003cf3..000000000 --- a/sandbox/pobrien/OpenOffice/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# Orbtech python package. \ No newline at end of file diff --git a/sandbox/pobrien/OpenOffice/rest2oo.py b/sandbox/pobrien/OpenOffice/rest2oo.py deleted file mode 100755 index 6d7278b93..000000000 --- a/sandbox/pobrien/OpenOffice/rest2oo.py +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python - -__author__ = "Patrick K. O'Brien " -__cvsid__ = "$Id$" -__revision__ = "$Revision$"[11:-2] - -import sys -import zipfile -from cStringIO import StringIO - -from docutils import core, io - -import OOdirectives -import OOtext -import OOwriter - - -def main(): - pub = core.Publisher(writer=OOwriter.Writer()) - pub.set_reader('standalone', None, 'restructuredtext') - settings = pub.get_settings() - pub.source = io.FileInput(settings, source_path=sys.argv[1]) - pub.destination = io.StringOutput(settings) - content = pub.publish() - - xml_manifest_list = [ - ('content.xml', content), - ('styles.xml', OOtext.styles) - ] - - xml_entries = [] - for docname, _ in xml_manifest_list: - xml_entries.append(OOtext.m_xml_format % docname) - - image_manifest_list = OOtext.pictures - - image_entries = [] - for name, format in image_manifest_list: - image_entries.append(format) - - manifest = OOtext.manifest % ('\n '.join(image_entries), '\n '.join(xml_entries)) - xml_manifest_list.append(('META-INF/manifest.xml', manifest)) - - zip = zipfile.ZipFile(sys.argv[2], "w") - for docname, contents in xml_manifest_list: - zinfo = zipfile.ZipInfo(docname) - zip.writestr(zinfo, contents) - for name, format in image_manifest_list: - zip.write(name, 'Pictures/' + name) - zip.close() - -if __name__ == '__main__': - main() diff --git a/sandbox/pobrien/OpenOffice/rest2oopseudo.py b/sandbox/pobrien/OpenOffice/rest2oopseudo.py deleted file mode 100755 index 75565eac5..000000000 --- a/sandbox/pobrien/OpenOffice/rest2oopseudo.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python - -""" -A minimal front end to the Docutils Publisher, producing pseudo-XML. -""" - -__author__ = "Patrick K. O'Brien " -__cvsid__ = "$Id$" -__revision__ = "$Revision$"[11:-2] - -import locale -try: - locale.setlocale(locale.LC_ALL, '') -except: - pass - -from docutils.core import publish_cmdline, default_description - -import OOdirectives - -description = ('Generates pseudo-XML from standalone reStructuredText ' - 'sources (for testing purposes). ' + default_description) - -publish_cmdline(description=description) diff --git a/sandbox/pobrien/OpenOffice/rest2ooxml.py b/sandbox/pobrien/OpenOffice/rest2ooxml.py deleted file mode 100755 index 671052845..000000000 --- a/sandbox/pobrien/OpenOffice/rest2ooxml.py +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env python - -"""Generates the OpenOffice.org content.xml file outside of a .swx zip -file. Useful for debugging the OOwriter.""" - -__author__ = "Patrick K. O'Brien " -__cvsid__ = "$Id$" -__revision__ = "$Revision$"[11:-2] - -import locale -try: - locale.setlocale(locale.LC_ALL, '') -except: - pass - -from docutils.core import publish_cmdline, default_description - -from OOwriter import Writer - - -def main(): - description = ("Generates OpenOffice.org XML. " + default_description) - publish_cmdline(writer=Writer(), description=description) - - -if __name__ == '__main__': - main() diff --git a/sandbox/pobrien/WriterTemplate.py b/sandbox/pobrien/WriterTemplate.py deleted file mode 100644 index 868c8434a..000000000 --- a/sandbox/pobrien/WriterTemplate.py +++ /dev/null @@ -1,1081 +0,0 @@ -"""Template for creating a new writer.""" - -__author__ = "Patrick K. O'Brien " -__cvsid__ = "$Id$" -__revision__ = "$Revision$"[11:-2] - - -__docformat__ = 'reStructuredText' - - -import sys -import os -import time -import re -from types import ListType - -import docutils -from docutils import nodes, utils, writers, languages - - -class Writer(writers.Writer): - - supported = ('SomeFormat') - """Formats this writer supports.""" - - output = None - """Final translated form of `document`.""" - - def __init__(self): - writers.Writer.__init__(self) - self.translator_class = Translator - - def translate(self): - visitor = self.translator_class(self.document) - self.document.walkabout(visitor) - self.output = visitor.astext() - - -class Translator(nodes.NodeVisitor): - """Modify this to suite your needs.""" - - words_and_spaces = re.compile(r'\S+| +|\n') - - def __init__(self, document): - nodes.NodeVisitor.__init__(self, document) - self.settings = settings = document.settings - lcode = settings.language_code - self.language = languages.get_language(lcode) - self.head = [] - self.body = [] - self.foot = [] - self.section_level = 0 - self.context = [] - self.topic_class = '' - self.colspecs = [] - self.compact_p = 1 - self.compact_simple = None - self.in_docinfo = None - - def astext(self): - """Return the final formatted document as a string.""" - raise NotImplementedError - return ''.join(self.head + self.body + self.foot) - - def visit_Text(self, node): - raise NotImplementedError, node.astext() - self.body.append(node.astext()) - - def depart_Text(self, node): - pass - - def visit_address(self, node): - raise NotImplementedError, node.astext() - self.visit_docinfo_item(node, 'address', meta=None) - - def depart_address(self, node): - self.depart_docinfo_item() - - def visit_admonition(self, node, name): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'div', CLASS=name)) - self.body.append('

' - + self.language.labels[name] + '

\n') - - def depart_admonition(self): - raise NotImplementedError, node.astext() - self.body.append('\n') - - def visit_attention(self, node): - self.visit_admonition(node, 'attention') - - def depart_attention(self, node): - self.depart_admonition() - - def visit_author(self, node): - raise NotImplementedError, node.astext() - self.visit_docinfo_item(node, 'author') - - def depart_author(self, node): - self.depart_docinfo_item() - - def visit_authors(self, node): - pass - - def depart_authors(self, node): - pass - - def visit_block_quote(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'blockquote')) - - def depart_block_quote(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n') - - def check_simple_list(self, node): - raise NotImplementedError, node.astext() - """Check for a simple list that can be rendered compactly.""" - visitor = SimpleListChecker(self.document) - try: - node.walk(visitor) - except nodes.NodeFound: - return None - else: - return 1 - - def visit_bullet_list(self, node): - raise NotImplementedError, node.astext() - atts = {} - old_compact_simple = self.compact_simple - self.context.append((self.compact_simple, self.compact_p)) - self.compact_p = None - self.compact_simple = (self.settings.compact_lists and - (self.compact_simple - or self.topic_class == 'contents' - or self.check_simple_list(node))) - if self.compact_simple and not old_compact_simple: - atts['class'] = 'simple' - self.body.append(self.starttag(node, 'ul', **atts)) - - def depart_bullet_list(self, node): - raise NotImplementedError, node.astext() - self.compact_simple, self.compact_p = self.context.pop() - self.body.append('\n') - - def visit_caption(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'p', '', CLASS='caption')) - - def depart_caption(self, node): - raise NotImplementedError, node.astext() - self.body.append('

\n') - - def visit_caution(self, node): - self.visit_admonition(node, 'caution') - - def depart_caution(self, node): - self.depart_admonition() - - def visit_citation(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'table', CLASS='citation', - frame="void", rules="none")) - self.body.append('\n' - '\n' - '\n' - '') - self.footnote_backrefs(node) - - def depart_citation(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n' - '\n\n') - - def visit_citation_reference(self, node): - raise NotImplementedError, node.astext() - href = '' - if node.has_key('refid'): - href = '#' + node['refid'] - elif node.has_key('refname'): - href = '#' + self.document.nameids[node['refname']] - self.body.append(self.starttag(node, 'a', '[', href=href, - CLASS='citation-reference')) - - def depart_citation_reference(self, node): - raise NotImplementedError, node.astext() - self.body.append(']') - - def visit_classifier(self, node): - raise NotImplementedError, node.astext() - self.body.append(' : ') - self.body.append(self.starttag(node, 'span', '', CLASS='classifier')) - - def depart_classifier(self, node): - raise NotImplementedError, node.astext() - self.body.append('') - - def visit_colspec(self, node): - self.colspecs.append(node) - - def depart_colspec(self, node): - pass - - def write_colspecs(self): - raise NotImplementedError, node.astext() - width = 0 - for node in self.colspecs: - width += node['colwidth'] - for node in self.colspecs: - colwidth = int(node['colwidth'] * 100.0 / width + 0.5) - self.body.append(self.emptytag(node, 'col', - width='%i%%' % colwidth)) - self.colspecs = [] - - def visit_comment(self, node, - sub=re.compile('-(?=-)').sub): - raise NotImplementedError, node.astext() - """Escape double-dashes in comment text.""" - self.body.append('\n' % sub('- ', node.astext())) - # Content already processed: - raise nodes.SkipNode - - def visit_contact(self, node): - raise NotImplementedError, node.astext() - self.visit_docinfo_item(node, 'contact', meta=None) - - def depart_contact(self, node): - self.depart_docinfo_item() - - def visit_copyright(self, node): - raise NotImplementedError, node.astext() - self.visit_docinfo_item(node, 'copyright') - - def depart_copyright(self, node): - self.depart_docinfo_item() - - def visit_danger(self, node): - self.visit_admonition(node, 'danger') - - def depart_danger(self, node): - self.depart_admonition() - - def visit_date(self, node): - raise NotImplementedError, node.astext() - self.visit_docinfo_item(node, 'date') - - def depart_date(self, node): - self.depart_docinfo_item() - - def visit_decoration(self, node): - pass - - def depart_decoration(self, node): - pass - - def visit_definition(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n') - self.body.append(self.starttag(node, 'dd', '')) - if len(node): - node[0].set_class('first') - node[-1].set_class('last') - - def depart_definition(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n') - - def visit_definition_list(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'dl')) - - def depart_definition_list(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n') - - def visit_definition_list_item(self, node): - pass - - def depart_definition_list_item(self, node): - pass - - def visit_description(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'td', '')) - if len(node): - node[0].set_class('first') - node[-1].set_class('last') - - def depart_description(self, node): - raise NotImplementedError, node.astext() - self.body.append('') - - def visit_docinfo(self, node): - raise NotImplementedError, node.astext() - self.context.append(len(self.body)) - self.body.append(self.starttag(node, 'table', CLASS='docinfo', - frame="void", rules="none")) - self.body.append('\n' - '\n' - '\n') - self.in_docinfo = 1 - - def depart_docinfo(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n\n') - self.in_docinfo = None - start = self.context.pop() - self.body_pre_docinfo = self.body[:start] - self.docinfo = self.body[start:] - self.body = [] - - def visit_docinfo_item(self, node, name, meta=1): - raise NotImplementedError, node.astext() - if meta: - self.head.append('\n' - % (name, self.attval(node.astext()))) - self.body.append(self.starttag(node, 'tr', '')) - self.body.append('%s:\n' - % self.language.labels[name]) - if len(node): - if isinstance(node[0], nodes.Element): - node[0].set_class('first') - if isinstance(node[0], nodes.Element): - node[-1].set_class('last') - - def depart_docinfo_item(self): - raise NotImplementedError, node.astext() - self.body.append('\n') - - def visit_doctest_block(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'pre', CLASS='doctest-block')) - - def depart_doctest_block(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n\n') - - def visit_document(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'div', CLASS='document')) - - def depart_document(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n') - - def visit_emphasis(self, node): - raise NotImplementedError, node.astext() - self.body.append('') - - def depart_emphasis(self, node): - raise NotImplementedError, node.astext() - self.body.append('') - - def visit_entry(self, node): - raise NotImplementedError, node.astext() - if isinstance(node.parent.parent, nodes.thead): - tagname = 'th' - else: - tagname = 'td' - atts = {} - if node.has_key('morerows'): - atts['rowspan'] = node['morerows'] + 1 - if node.has_key('morecols'): - atts['colspan'] = node['morecols'] + 1 - self.body.append(self.starttag(node, tagname, '', **atts)) - self.context.append('\n' % tagname.lower()) - if len(node) == 0: # empty cell - self.body.append(' ') - else: - node[0].set_class('first') - node[-1].set_class('last') - - def depart_entry(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.context.pop()) - - def visit_enumerated_list(self, node): - raise NotImplementedError, node.astext() - """ - The 'start' attribute does not conform to HTML 4.01's strict.dtd, but - CSS1 doesn't help. CSS2 isn't widely enough supported yet to be - usable. - """ - atts = {} - if node.has_key('start'): - atts['start'] = node['start'] - if node.has_key('enumtype'): - atts['class'] = node['enumtype'] - # @@@ To do: prefix, suffix. How? Change prefix/suffix to a - # single "format" attribute? Use CSS2? - old_compact_simple = self.compact_simple - self.context.append((self.compact_simple, self.compact_p)) - self.compact_p = None - self.compact_simple = (self.settings.compact_lists and - (self.compact_simple - or self.topic_class == 'contents' - or self.check_simple_list(node))) - if self.compact_simple and not old_compact_simple: - atts['class'] = (atts.get('class', '') + ' simple').strip() - self.body.append(self.starttag(node, 'ol', **atts)) - - def depart_enumerated_list(self, node): - raise NotImplementedError, node.astext() - self.compact_simple, self.compact_p = self.context.pop() - self.body.append('\n') - - def visit_error(self, node): - self.visit_admonition(node, 'error') - - def depart_error(self, node): - self.depart_admonition() - - def visit_field(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'tr', '', CLASS='field')) - - def depart_field(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n') - - def visit_field_body(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'td', '', CLASS='field-body')) - if len(node): - node[0].set_class('first') - node[-1].set_class('last') - - def depart_field_body(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n') - - def visit_field_list(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'table', frame='void', - rules='none', CLASS='field-list')) - self.body.append('\n' - '\n' - '\n') - - def depart_field_list(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n\n') - - def visit_field_name(self, node): - raise NotImplementedError, node.astext() - atts = {} - if self.in_docinfo: - atts['class'] = 'docinfo-name' - else: - atts['class'] = 'field-name' - if len(node.astext()) > 14: - atts['colspan'] = 2 - self.context.append('\n ') - else: - self.context.append('') - self.body.append(self.starttag(node, 'th', '', **atts)) - - def depart_field_name(self, node): - raise NotImplementedError, node.astext() - self.body.append(':') - self.body.append(self.context.pop()) - - def visit_figure(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'div', CLASS='figure')) - - def depart_figure(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n') - - def visit_footer(self, node): - raise NotImplementedError, node.astext() - self.context.append(len(self.body)) - - def depart_footer(self, node): - raise NotImplementedError, node.astext() - start = self.context.pop() - footer = (['\n', - self.starttag(node, 'div', CLASS='footer')] - + self.body[start:] + ['\n']) - self.body_suffix[:0] = footer - del self.body[start:] - - def visit_footnote(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'table', CLASS='footnote', - frame="void", rules="none")) - self.body.append('\n' - '\n' - '') - self.footnote_backrefs(node) - - def footnote_backrefs(self, node): - raise NotImplementedError, node.astext() - if self.settings.footnote_backlinks and node.hasattr('backrefs'): - backrefs = node['backrefs'] - if len(backrefs) == 1: - self.context.append('') - self.context.append('' % (backrefs[0], node['id'])) - else: - i = 1 - backlinks = [] - for backref in backrefs: - backlinks.append('%s' - % (backref, i)) - i += 1 - self.context.append('(%s) ' % ', '.join(backlinks)) - self.context.append('' % node['id']) - else: - self.context.append('') - self.context.append('' % node['id']) - - def depart_footnote(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n' - '\n\n') - - def visit_footnote_reference(self, node): - raise NotImplementedError, node.astext() - href = '' - if node.has_key('refid'): - href = '#' + node['refid'] - elif node.has_key('refname'): - href = '#' + self.document.nameids[node['refname']] - format = self.settings.footnote_references - if format == 'brackets': - suffix = '[' - self.context.append(']') - elif format == 'superscript': - suffix = '' - self.context.append('') - else: # shouldn't happen - suffix = '???' - self.content.append('???') - self.body.append(self.starttag(node, 'a', suffix, href=href, - CLASS='footnote-reference')) - - def depart_footnote_reference(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.context.pop() + '') - - def visit_generated(self, node): - pass - - def depart_generated(self, node): - pass - - def visit_header(self, node): - raise NotImplementedError, node.astext() - self.context.append(len(self.body)) - - def depart_header(self, node): - raise NotImplementedError, node.astext() - start = self.context.pop() - self.body_prefix.append(self.starttag(node, 'div', CLASS='header')) - self.body_prefix.extend(self.body[start:]) - self.body_prefix.append('
\n\n') - del self.body[start:] - - def visit_hint(self, node): - self.visit_admonition(node, 'hint') - - def depart_hint(self, node): - self.depart_admonition() - - def visit_image(self, node): - raise NotImplementedError, node.astext() - atts = node.attributes.copy() - atts['src'] = atts['uri'] - del atts['uri'] - if not atts.has_key('alt'): - atts['alt'] = atts['src'] - if isinstance(node.parent, nodes.TextElement): - self.context.append('') - else: - self.body.append('

') - self.context.append('

\n') - self.body.append(self.emptytag(node, 'img', '', **atts)) - - def depart_image(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.context.pop()) - - def visit_important(self, node): - self.visit_admonition(node, 'important') - - def depart_important(self, node): - self.depart_admonition() - - def visit_label(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'td', '%s[' % self.context.pop(), - CLASS='label')) - - def depart_label(self, node): - raise NotImplementedError, node.astext() - self.body.append(']%s' % self.context.pop()) - - def visit_legend(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'div', CLASS='legend')) - - def depart_legend(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n') - - def visit_line_block(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'pre', CLASS='line-block')) - - def depart_line_block(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n\n') - - def visit_list_item(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'li', '')) - if len(node): - node[0].set_class('first') - - def depart_list_item(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n') - - def visit_literal(self, node): - raise NotImplementedError, node.astext() - """Process text to prevent tokens from wrapping.""" - self.body.append(self.starttag(node, 'tt', '', CLASS='literal')) - text = node.astext() - for token in self.words_and_spaces.findall(text): - if token.strip(): - # Protect text like "--an-option" from bad line wrapping: - self.body.append('%s' - % self.encode(token)) - elif token in ('\n', ' '): - # Allow breaks at whitespace: - self.body.append(token) - else: - # Protect runs of multiple spaces; the last space can wrap: - self.body.append(' ' * (len(token) - 1) + ' ') - self.body.append('
') - # Content already processed: - raise nodes.SkipNode - - def visit_literal_block(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'pre', CLASS='literal-block')) - - def depart_literal_block(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n\n') - - def visit_meta(self, node): - raise NotImplementedError, node.astext() - self.head.append(self.emptytag(node, 'meta', **node.attributes)) - - def depart_meta(self, node): - pass - - def visit_note(self, node): - self.visit_admonition(node, 'note') - - def depart_note(self, node): - self.depart_admonition() - - def visit_option(self, node): - raise NotImplementedError, node.astext() - if self.context[-1]: - self.body.append(', ') - - def depart_option(self, node): - raise NotImplementedError, node.astext() - self.context[-1] += 1 - - def visit_option_argument(self, node): - raise NotImplementedError, node.astext() - self.body.append(node.get('delimiter', ' ')) - self.body.append(self.starttag(node, 'var', '')) - - def depart_option_argument(self, node): - raise NotImplementedError, node.astext() - self.body.append('') - - def visit_option_group(self, node): - raise NotImplementedError, node.astext() - atts = {} - if len(node.astext()) > 14: - atts['colspan'] = 2 - self.context.append('\n ') - else: - self.context.append('') - self.body.append(self.starttag(node, 'td', **atts)) - self.body.append('') - self.context.append(0) # count number of options - - def depart_option_group(self, node): - raise NotImplementedError, node.astext() - self.context.pop() - self.body.append('\n') - self.body.append(self.context.pop()) - - def visit_option_list(self, node): - raise NotImplementedError, node.astext() - self.body.append( - self.starttag(node, 'table', CLASS='option-list', - frame="void", rules="none")) - self.body.append('\n' - '\n' - '\n') - - def depart_option_list(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n\n') - - def visit_option_list_item(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'tr', '')) - - def depart_option_list_item(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n') - - def visit_option_string(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'span', '', CLASS='option')) - - def depart_option_string(self, node): - raise NotImplementedError, node.astext() - self.body.append('') - - def visit_organization(self, node): - raise NotImplementedError, node.astext() - self.visit_docinfo_item(node, 'organization') - - def depart_organization(self, node): - raise NotImplementedError, node.astext() - self.depart_docinfo_item() - - def visit_paragraph(self, node): - raise NotImplementedError, node.astext() - # Omit

tags if this is an only child and optimizable. - if (self.compact_simple or - self.compact_p and (len(node.parent) == 1 or - len(node.parent) == 2 and - isinstance(node.parent[0], nodes.label))): - self.context.append('') - else: - self.body.append(self.starttag(node, 'p', '')) - self.context.append('

\n') - - def depart_paragraph(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.context.pop()) - - def visit_problematic(self, node): - raise NotImplementedError, node.astext() - if node.hasattr('refid'): - self.body.append('' % (node['refid'], - node['id'])) - self.context.append('') - else: - self.context.append('') - self.body.append(self.starttag(node, 'span', '', CLASS='problematic')) - - def depart_problematic(self, node): - raise NotImplementedError, node.astext() - self.body.append('') - self.body.append(self.context.pop()) - - def visit_raw(self, node): - raise NotImplementedError, node.astext() - if node.get('format') == 'html': - self.body.append(node.astext()) - # Keep non-HTML raw text out of output: - raise nodes.SkipNode - - def visit_reference(self, node): - raise NotImplementedError, node.astext() - if node.has_key('refuri'): - href = node['refuri'] - elif node.has_key('refid'): - href = '#' + node['refid'] - elif node.has_key('refname'): - href = '#' + self.document.nameids[node['refname']] - self.body.append(self.starttag(node, 'a', '', href=href, - CLASS='reference')) - - def depart_reference(self, node): - raise NotImplementedError, node.astext() - self.body.append('') - - def visit_revision(self, node): - raise NotImplementedError, node.astext() - self.visit_docinfo_item(node, 'revision', meta=None) - - def depart_revision(self, node): - self.depart_docinfo_item() - - def visit_row(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'tr', '')) - - def depart_row(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n') - - def visit_section(self, node): - raise NotImplementedError, node.astext() - self.section_level += 1 - self.body.append(self.starttag(node, 'div', CLASS='section')) - - def depart_section(self, node): - raise NotImplementedError, node.astext() - self.section_level -= 1 - self.body.append('\n') - - def visit_status(self, node): - raise NotImplementedError, node.astext() - self.visit_docinfo_item(node, 'status', meta=None) - - def depart_status(self, node): - self.depart_docinfo_item() - - def visit_strong(self, node): - raise NotImplementedError, node.astext() - self.body.append('') - - def depart_strong(self, node): - raise NotImplementedError, node.astext() - self.body.append('') - - def visit_substitution_definition(self, node): - """Internal only.""" - raise nodes.SkipNode - - def visit_substitution_reference(self, node): - self.unimplemented_visit(node) - - def visit_subtitle(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'h2', '', CLASS='subtitle')) - - def depart_subtitle(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n') - - def visit_system_message(self, node): - raise NotImplementedError, node.astext() - if node['level'] < self.document.reporter['writer'].report_level: - # Level is too low to display: - raise nodes.SkipNode - self.body.append(self.starttag(node, 'div', CLASS='system-message')) - self.body.append('

') - attr = {} - backref_text = '' - if node.hasattr('id'): - attr['name'] = node['id'] - if node.hasattr('backrefs'): - backrefs = node['backrefs'] - if len(backrefs) == 1: - backref_text = ('; backlink' - % backrefs[0]) - else: - i = 1 - backlinks = [] - for backref in backrefs: - backlinks.append('%s' % (backref, i)) - i += 1 - backref_text = ('; backlinks: %s' - % ', '.join(backlinks)) - if node.hasattr('line'): - line = ', line %s' % node['line'] - else: - line = '' - if attr: - a_start = self.starttag({}, 'a', '', **attr) - a_end = '' - else: - a_start = a_end = '' - self.body.append('System Message: %s%s/%s%s (%s%s)%s

\n' - % (a_start, node['type'], node['level'], a_end, - node['source'], line, backref_text)) - - def depart_system_message(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n') - - def visit_table(self, node): - raise NotImplementedError, node.astext() - self.body.append( - self.starttag(node, 'table', CLASS="table", - frame='border', rules='all')) - - def depart_table(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n') - - def visit_target(self, node): - raise NotImplementedError, node.astext() - if not (node.has_key('refuri') or node.has_key('refid') - or node.has_key('refname')): - self.body.append(self.starttag(node, 'a', '', CLASS='target')) - self.context.append('') - else: - self.context.append('') - - def depart_target(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.context.pop()) - - def visit_tbody(self, node): - raise NotImplementedError, node.astext() - self.write_colspecs() - self.body.append(self.context.pop()) # '\n' or '' - self.body.append(self.starttag(node, 'tbody', valign='top')) - - def depart_tbody(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n') - - def visit_term(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'dt', '')) - - def depart_term(self, node): - """ - Leave the end tag to `self.visit_definition()`, in case there's a - classifier. - """ - raise NotImplementedError, node.astext() - pass - - def visit_tgroup(self, node): - raise NotImplementedError, node.astext() - # Mozilla needs : - self.body.append(self.starttag(node, 'colgroup')) - # Appended by thead or tbody: - self.context.append('\n') - - def depart_tgroup(self, node): - pass - - def visit_thead(self, node): - raise NotImplementedError, node.astext() - self.write_colspecs() - self.body.append(self.context.pop()) # '\n' - # There may or may not be a ; this is for to use: - self.context.append('') - self.body.append(self.starttag(node, 'thead', valign='bottom')) - - def depart_thead(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n') - - def visit_tip(self, node): - self.visit_admonition(node, 'tip') - - def depart_tip(self, node): - self.depart_admonition() - - def visit_title(self, node): - raise NotImplementedError, node.astext() - """Only 6 section levels are supported by HTML.""" - if isinstance(node.parent, nodes.topic): - self.body.append( - self.starttag(node, 'p', '', CLASS='topic-title')) - if node.parent.hasattr('id'): - self.body.append( - self.starttag({}, 'a', '', name=node.parent['id'])) - self.context.append('

\n') - else: - self.context.append('

\n') - elif self.section_level == 0: - # document title - self.head.append('%s\n' - % self.encode(node.astext())) - self.body.append(self.starttag(node, 'h1', '', CLASS='title')) - self.context.append('\n') - else: - self.body.append( - self.starttag(node, 'h%s' % self.section_level, '')) - atts = {} - if node.parent.hasattr('id'): - atts['name'] = node.parent['id'] - if node.hasattr('refid'): - atts['class'] = 'toc-backref' - atts['href'] = '#' + node['refid'] - self.body.append(self.starttag({}, 'a', '', **atts)) - self.context.append('\n' % (self.section_level)) - - def depart_title(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.context.pop()) - - def visit_title_reference(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'cite', '')) - - def depart_title_reference(self, node): - raise NotImplementedError, node.astext() - self.body.append('') - - def visit_topic(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.starttag(node, 'div', CLASS='topic')) - self.topic_class = node.get('class') - - def depart_topic(self, node): - raise NotImplementedError, node.astext() - self.body.append('\n') - self.topic_class = '' - - def visit_transition(self, node): - raise NotImplementedError, node.astext() - self.body.append(self.emptytag(node, 'hr')) - - def depart_transition(self, node): - pass - - def visit_version(self, node): - raise NotImplementedError, node.astext() - self.visit_docinfo_item(node, 'version', meta=None) - - def depart_version(self, node): - self.depart_docinfo_item() - - def visit_warning(self, node): - self.visit_admonition(node, 'warning') - - def depart_warning(self, node): - self.depart_admonition() - - def unimplemented_visit(self, node): - raise NotImplementedError('visiting unimplemented node type: %s' - % node.__class__.__name__) - - -class SimpleListChecker(nodes.GenericNodeVisitor): - - """ - Raise `nodes.SkipNode` if non-simple list item is encountered. - - Here "simple" means a list item containing nothing other than a single - paragraph, a simple list, or a paragraph followed by a simple list. - """ - - def default_visit(self, node): - raise nodes.NodeFound - - def visit_bullet_list(self, node): - pass - - def visit_enumerated_list(self, node): - pass - - def visit_list_item(self, node): - children = [] - for child in node.get_children(): - if not isinstance(child, nodes.Invisible): - children.append(child) - if (children and isinstance(children[0], nodes.paragraph) - and (isinstance(children[-1], nodes.bullet_list) - or isinstance(children[-1], nodes.enumerated_list))): - children.pop() - if len(children) <= 1: - return - else: - raise nodes.NodeFound - - def visit_paragraph(self, node): - raise nodes.SkipNode - - def invisible_visit(self, node): - """Invisible nodes should be ignored.""" - pass - - visit_comment = invisible_visit - visit_substitution_definition = invisible_visit - visit_target = invisible_visit - visit_pending = invisible_visit diff --git a/sandbox/pobrien/dwArticle/__init__.py b/sandbox/pobrien/dwArticle/__init__.py deleted file mode 100644 index db6003cf3..000000000 --- a/sandbox/pobrien/dwArticle/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# Orbtech python package. \ No newline at end of file diff --git a/sandbox/richard/ZReST/.cvsignore b/sandbox/richard/ZReST/.cvsignore deleted file mode 100644 index 533a4ce06..000000000 --- a/sandbox/richard/ZReST/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -*.pyc -*.pyo -*.tgz diff --git a/sandbox/richard/ZReST/Makefile b/sandbox/richard/ZReST/Makefile deleted file mode 100644 index 1f78c66e8..000000000 --- a/sandbox/richard/ZReST/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -FILES = ZReST.py __init__.py refresh.txt version.txt TODO.txt README.txt -DTML = dtml/manage_addZReSTForm.dtml dtml/manage_editForm.dtml -VERSION := $(shell cat version.txt) - -all: ${FILES} ${DTML} - rm -rf dist - mkdir dist - mkdir dist/ZReST - mkdir dist/ZReST/dtml - cp ${FILES} dist/ZReST - cp ${DTML} dist/ZReST/dtml - (cd dist; tar zcf ZReST-${VERSION}.tgz ZReST) - mv dist/ZReST-${VERSION}.tgz . - rm -rf dist - diff --git a/sandbox/richard/ZReST/README.txt b/sandbox/richard/ZReST/README.txt deleted file mode 100644 index 28b0af78a..000000000 --- a/sandbox/richard/ZReST/README.txt +++ /dev/null @@ -1,45 +0,0 @@ ----------------------------------- -ReStructuredText Document for Zope ----------------------------------- - -Requirements -============ - -To use this product, you will need: - -python2.1+ - see http://www.python.org/ -Zope 2.5+ - see http://www.zope.org/ -A docutils snapshot from later than 21 August 2002 - see http://docutils.sourceforge.net/#development-snapshots - -Installation -============ - -To install this product, unpack it so the ZReST directory is in the Zope -lib/python/Products directory. You should then restart Zope. - -You will now be able to add objects of type "ReStructuredText Document". - -Usage -===== - -See the docutils user documentation section: - - http://docutils.sourceforge.net/#user-documentation - -I recommend starting with the ReST "primer": - - http://docutils.sourceforge.net/docs/rst/quickstart.html - - -Footnotes -========= - -This product was written by Richard Jones, rjones@ekit-inc.com. - -Please direct questions about ReStructureText to the docutils mailing lists. - -This package is placed in the Public Domain. - diff --git a/sandbox/richard/ZReST/TODO.txt b/sandbox/richard/ZReST/TODO.txt deleted file mode 100644 index 6860c9423..000000000 --- a/sandbox/richard/ZReST/TODO.txt +++ /dev/null @@ -1,6 +0,0 @@ -* charset configuration, defaulting to 'latin-1' - -* add "level" and "header" args to render / as_html - - - level indicates the header level to start at - - header boolean turns page header tags on/off diff --git a/sandbox/richard/ZReST/ZReST.py b/sandbox/richard/ZReST/ZReST.py deleted file mode 100644 index e130cf18e..000000000 --- a/sandbox/richard/ZReST/ZReST.py +++ /dev/null @@ -1,288 +0,0 @@ -# -# $Id$ -# -''' ReStructuredText Product for Zope - -This Product stores two texts - a "source" text in ReStructureText format, -and a HTML "formatted" version of that text. - -''' -import docutils.core, docutils.io - -from Globals import InitializeClass, DTMLFile -from OFS.SimpleItem import Item -from OFS.PropertyManager import PropertyManager -from OFS.History import Historical, html_diff -from Acquisition import Implicit -from Persistence import Persistent -from AccessControl import ClassSecurityInfo -from AccessControl import ModuleSecurityInfo -from DateTime.DateTime import DateTime -modulesecurity = ModuleSecurityInfo() - -modulesecurity.declareProtected('View management screens', - 'manage_addZReSTForm') -manage_addZReSTForm = DTMLFile('dtml/manage_addZReSTForm', globals()) - -modulesecurity.declareProtected('Add Z Roundups', 'manage_addZReST') -def manage_addZReST(self, id, file='', REQUEST=None): - """Add a ZReST product """ - # validate the instance_home - self._setObject(id, ZReST(id)) - self._getOb(id).manage_upload(file) - if REQUEST: - return self.manage_main(self, REQUEST) - -class Warnings: - def __init__(self): - self.messages = [] - def write(self, message): - self.messages.append(message) - -class ZReST(Item, PropertyManager, Historical, Implicit, Persistent): - '''An instance of this class provides an interface between Zope and - ReStructuredText for one text. - ''' - meta_type = 'ReStructuredText Document' - security = ClassSecurityInfo() - - def __init__(self, id): - self.id = id - self.title = id - self.stylesheet = 'default.css' - self.report_level = '2' - self.source = self.formatted = '' - - # define the properties that define this object - _properties = ( - {'id':'stylesheet', 'type': 'string', 'mode': 'w', - 'default': 'default.css'}, - {'id':'report_level', 'type': 'string', 'mode': 'w', 'default': '2'}, - ) - property_extensible_schema__ = 0 - - # define the tabs for the management interface - manage_options= ( {'label': 'Edit', 'action':'manage_main'}, - {'label': 'View', 'action':'index_html'}, - {'label': 'Source', 'action':'source_txt'}, - ) \ - + PropertyManager.manage_options \ - + Historical.manage_options \ - + Item.manage_options - - # access to the source text and formatted text - security.declareProtected('View', 'index_html') - def index_html(self, REQUEST=None): - ''' Getting the formatted text - ''' - REQUEST.RESPONSE.setHeader('content-type', 'text/html') - return self.formatted - security.declareProtected('View', 'source_txt') - def source_txt(self, REQUEST=None): - ''' Getting the source text - ''' - REQUEST.RESPONSE.setHeader('content-type', 'text/plain') - return self.source - - # edit form, which is also the primary interface - security.declareProtected('Edit ReStructuredText', 'manage_editForm') - manage_main = DTMLFile('dtml/manage_editForm', globals()) - - # edit action - security.declareProtected('Edit ReStructuredText', 'manage_edit') - def manage_edit(self, data, SUBMIT='Change',dtpref_cols='50', - dtpref_rows='20', REQUEST=None): - '''Alias index_html to roundup's index - ''' - if self._size_changes.has_key(SUBMIT): - return self._er(data, SUBMIT, dtpref_cols, dtpref_rows, REQUEST) - if data != self.source: - self.source = data - self.render() - - if REQUEST: - message="Saved changes." - return self.manage_main(self, REQUEST, manage_tabs_message=message) - - # handle edit window size changes - _size_changes = { - 'Bigger': (5,5), - 'Smaller': (-5,-5), - 'Narrower': (0,-5), - 'Wider': (0,5), - 'Taller': (5,0), - 'Shorter': (-5,0), - } - def _er(self, data, SUBMIT, dtpref_cols, dtpref_rows, REQUEST): - dr,dc = self._size_changes[SUBMIT] - rows=max(1,int(dtpref_rows)+dr) - cols=max(40,int(dtpref_cols)+dc) - e=(DateTime('GMT') + 365).rfc822() - resp=REQUEST['RESPONSE'] - resp.setCookie('dtpref_rows',str(rows),path='/',expires=e) - resp.setCookie('dtpref_cols',str(cols),path='/',expires=e) - return self.manage_main(self, REQUEST, __str__=self.quotedHTML(data), - dtpref_cols=cols, dtpref_rows=rows) - security.declarePrivate('quotedHTML') - def quotedHTML(self, - text=None, - character_entities=( - (('&'), '&'), - (("<"), '<' ), - ((">"), '>' ), - (('"'), '"'))): #" - if text is None: text=self.read_raw() - for re,name in character_entities: - if text.find(re) >= 0: text=name.join(text.split(re)) - return text - - - # handle uploads too - security.declareProtected('Edit ReStructuredText', 'manage_upload') - def manage_upload(self, file='', REQUEST=None): - ''' Replaces the current source with the upload. - ''' - if isinstance(file, type('')): - self.source = file - else: - self.source = file.read() - self.render() - - if REQUEST: - message="Saved changes." - return self.manage_main(self, REQUEST, manage_tabs_message=message) - - security.declarePrivate('render') - def render(self): - ''' Render the source to HTML - ''' - # format with strings - pub = docutils.core.Publisher() - pub.set_reader('standalone', None, 'restructuredtext') - pub.set_writer('html') - - # go with the defaults - pub.get_settings() - - # this is needed, but doesn't seem to do anything - pub.settings._destination = '' - - # use the stylesheet chosen by the user - pub.settings.stylesheet = self.stylesheet - - # set the reporting level to something sane - pub.settings.report_level = int(self.report_level) - - # don't break if we get errors - pub.settings.halt_level = 6 - - # remember warnings - pub.settings.warning_stream = Warnings() - - # input - pub.source = docutils.io.StringInput( - source=self.source, encoding=pub.settings.input_encoding) - - # output - not that it's needed - pub.destination = docutils.io.StringOutput( - encoding=pub.settings.output_encoding) - - # parse! - document = pub.reader.read(pub.source, pub.parser, pub.settings) - self.warnings = ''.join(pub.settings.warning_stream.messages) - - if document.children: - item = document.children[0] - if item.tagname == 'title': - self.title = str(item.children[0]) - - # do the format - self.formatted = pub.writer.write(document, pub.destination) - - - security.declareProtected('Edit ReStructuredText', 'PUT', 'manage_FTPput') - def PUT(self, REQUEST, RESPONSE): - ''' Handle HTTP PUT requests - ''' - data = REQUEST.get('BODY', '') - if data != self.source: - if data.startswith('.. '): - data = data.splitlines() - new = [] - for i in range(len(data)): - line = data[i] - if not line.startswith('.. '): - break - if line.startswith('.. stylesheet='): - self.stylesheet = line.split('=')[1] - elif line.startswith('.. report_level='): - self.report_level = line.split('=')[1] - else: - pass # ignore - data = '\n'.join(new) + '\n'.join(data[i:]) - self.source = data - self.render() - RESPONSE.setStatus(204) - return RESPONSE - - manage_FTPput = PUT - - def manage_FTPget(self): - ''' Get source for FTP download - ''' - self.REQUEST.RESPONSE.setHeader('Content-Type', 'text/plain') - s = [ - '.. This is a ReStructuredText Document. Initial comment lines ' - '(".. ") will be stripped.', - '.. stylesheet='+self.stylesheet, - '.. report_level='+self.report_level - ] - if self.warnings: - s.append('.. ') - s.append('.. ' + '\n.. '.join(self.warnings.splitlines())) - s.append('.. ') - return '\n'.join(s) + '\n' + self.source - - def __str__(self): - ''' Stringfy .. return the source - ''' - return self.quotedHTML(self.source) - - def PrincipiaSearchSource(self): - ''' Support for searching - the document's contents are searched. - ''' - return self.source - - def manage_historyCompare(self, rev1, rev2, REQUEST, - historyComparisonResults=''): - return ZReST.inheritedAttribute('manage_historyCompare')( - self, rev1, rev2, REQUEST, - historyComparisonResults=html_diff(rev1.source, rev2.source)) - -InitializeClass(ZReST) -modulesecurity.apply(globals()) - - -# -# $Log$ -# Revision 1.6 2002/11/28 03:44:50 goodger -# updated -# -# Revision 1.5 2002/11/05 05:27:56 goodger -# fixed Reader name -# -# Revision 1.4 2002/10/18 05:10:33 goodger -# Refactored names (options -> settings; etc.); updated. -# -# Revision 1.3 2002/08/15 05:02:41 richard -# pull out the document title too -# -# Revision 1.2 2002/08/15 04:36:56 richard -# FTP interface and Reporter message snaffling -# -# Revision 1.1 2002/08/14 05:15:37 richard -# Zope ReStructuredText Product -# -# -# -# vim: set filetype=python ts=4 sw=4 et si diff --git a/sandbox/richard/ZReST/__init__.py b/sandbox/richard/ZReST/__init__.py deleted file mode 100644 index e3feaf4ae..000000000 --- a/sandbox/richard/ZReST/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# -# $Id$ -# -__version__='1.0' - -# product initialisation -import ZReST -def initialize(context): - context.registerClass( - ZReST, meta_type = 'ReStructuredText Document', - constructors = ( - ZReST.manage_addZReSTForm, ZReST.manage_addZReST - ) - ) - - -# -# $Log$ -# Revision 1.2 2002/08/15 04:36:56 richard -# FTP interface and Reporter message snaffling -# -# Revision 1.1 2002/08/14 05:15:37 richard -# Zope ReStructuredText Product -# -# -# -# vim: set filetype=python ts=4 sw=4 et si diff --git a/sandbox/richard/ZReST/dtml/manage_addZReSTForm.dtml b/sandbox/richard/ZReST/dtml/manage_addZReSTForm.dtml deleted file mode 100644 index 971e63160..000000000 --- a/sandbox/richard/ZReST/dtml/manage_addZReSTForm.dtml +++ /dev/null @@ -1,45 +0,0 @@ - - - - -

-You may optionally select a file to upload from your local computer by -clicking the Browse button. -

- -
- - - - - - - - - - - - - -
-
- Id -
-
- -
-
- File -
-
- -
- -
- -
-
-
- - diff --git a/sandbox/richard/ZReST/dtml/manage_editForm.dtml b/sandbox/richard/ZReST/dtml/manage_editForm.dtml deleted file mode 100644 index e302893f9..000000000 --- a/sandbox/richard/ZReST/dtml/manage_editForm.dtml +++ /dev/null @@ -1,88 +0,0 @@ - - - -

-You may edit the source for this document using the form below. You -may also upload the source for this document from a local file. Click -the browse button to select a local file to upload. -

- - -
-&dtml-warnings;
-
-
- -

Help: ReStructuredText - primer - for beginners, - quick - reference for the more advanced and - home page for all - the details. -

- -
- - - - - - - - - - - -
-
- -
-
-
- - Locked by WebDAV - - - -    - - - - -
-
-
- -
- - - - - - - - - -
-
- File   -
-
- -
-
- - Locked by WebDAV - - - -
-
-
- - diff --git a/sandbox/richard/ZReST/refresh.txt b/sandbox/richard/ZReST/refresh.txt deleted file mode 100644 index 01ee0fa7b..000000000 --- a/sandbox/richard/ZReST/refresh.txt +++ /dev/null @@ -1 +0,0 @@ -This is a flag that tells Zope that the product may be auto-refreshed. diff --git a/sandbox/richard/ZReST/version.txt b/sandbox/richard/ZReST/version.txt deleted file mode 100644 index d3827e75a..000000000 --- a/sandbox/richard/ZReST/version.txt +++ /dev/null @@ -1 +0,0 @@ -1.0 diff --git a/sandbox/richard/pythonpoint/example_slides.txt b/sandbox/richard/pythonpoint/example_slides.txt deleted file mode 100644 index 8633bafcc..000000000 --- a/sandbox/richard/pythonpoint/example_slides.txt +++ /dev/null @@ -1,38 +0,0 @@ -Presentation Cover ------------------- - -*Richard Jones, Another Author* - -http://docutils.sf.net/ is cool. - -*Some very important conference, March 2002* - -Second slide ------------- - -- blah, blah blah blah blah. blah, blah blah blah blah. -- blah, blah blah blah blah. - -Another slide -------------- - -bare para blah, blah blah blah blah. blah, blah blah blah blah. - -definition term - blah, blah blah blah blah. blah, blah blah blah blah. -another one - note, don't have more than one para in here! - -bare para blah, blah blah blah blah. blah, blah blah blah blah. - -Another slide -------------- - -hi, another para - -- ooh, bullet points -- yeah! -- woo! **bold** and *italics* are OK! - -don't nest _anything_ ... PLATYPUS can't deal with it. That means no -indented bullets, no multiple paras in bullets or definitions... diff --git a/sandbox/richard/pythonpoint/pythonpoint.py b/sandbox/richard/pythonpoint/pythonpoint.py deleted file mode 100644 index d2c0b9418..000000000 --- a/sandbox/richard/pythonpoint/pythonpoint.py +++ /dev/null @@ -1,328 +0,0 @@ -import cStringIO, cgi, sys, urllib -import docutils.core, docutils.io -from docutils import writers, nodes, languages - -class Writer(writers.Writer): - - settings_spec = () - settings_default_overrides = {} - output = None - - def translate(self): - visitor = DumbPythonPointFormatter(self.document) - self.document.walkabout(visitor) - self.output = visitor.astext() - #self.head_prefix = visitor.head_prefix - #self.head = visitor.head - #self.body_prefix = visitor.body_prefix - #self.body = visitor.body - #self.body_suffix = visitor.body_suffix - -class DumbPythonPointFormatter(nodes.NodeVisitor): - - def __init__(self, document): - nodes.NodeVisitor.__init__(self, document) - self.section = 0 - self.closers = [] - self.slidenum = 0 - self.body = [] - self.w = self.body.append - self.suppress_para = 0 - - def astext(self): - return ''.join(self.body) - - def visit_reference(self, node): - pass - def depart_reference(self, node): - pass - - def visit_document(self, node): - self.w('\n' - '\n' - '
\n') - def depart_document(self, node): - self.w('
\n' - '
\n') - - def visit_section(self, node): - if node.attributes.has_key('dupname'): - name = node.attributes['dupname'] - else: - name = node.attributes['name'] - self.slidenum += 1 - self.w('\n' - '\n'%(self.slidenum, name)) - def depart_section(self, node): - self.w('\n\n') - - def visit_title(self, node): - self.w('') - self.suppress_para = 1 - def depart_title(self, node): - self.suppress_para = 0 - self.w('\n') - - def visit_paragraph(self, node): - if not self.suppress_para: self.w('') - def depart_paragraph(self, node): - if not self.suppress_para: self.w('\n') - - # Simple lists - def visit_bullet_list(self, node): - pass - def depart_bullet_list(self, node): - pass - def visit_enumerated_list(self, node): - pass - def depart_enumerated_list(self, node): - pass - - def visit_list_item(self, node): - self.w('') - self.suppress_para = 1 - def depart_list_item(self, node): - self.suppress_para = 0 - self.w('\n') - - # Definition List - def visit_definition_list(self, node): - pass - def depart_definition_list(self, node): - pass - def visit_definition_list_item(self, node): - pass - def depart_definition_list_item(self, node): - pass - - def visit_term(self, node): - self.w('') - def depart_term(self, node): - self.w('') - - def visit_classifier(self, node): - self.w('') - def depart_classifier(self, node): - self.w('') - - def visit_definition(self, node): - self.w('\n') - self.suppress_para = 1 - def depart_definition(self, node): - self.suppress_para = 0 - self.w('\n') - - def visit_field(self, node): - self.w('') - def depart_field(self, node): - self.w('\n') - - def visit_field_body(self, node): - self.suppress_para = 1 - return - def depart_field_body(self, node): - self.suppress_para = 0 - - def visit_field_list(self, node): - return - def depart_field_list(self, node): - return - - def visit_field_name(self, node): - self.w('') - - def depart_field_name(self, node): - self.w(':') - self.w('') - - # Literal Block - def visit_literal_block(self, node): - self.w('') - self.suppress_para = 1 - def depart_literal_block(self, node): - self.suppress_para = 0 - self.w('\n') - - # Block Quote - def visit_block_quote(self, node): - self.w('') - def depart_block_quote(self, node): - self.w('\n') - - def visit_image(self, node): - ''' EMPTY - uri CDATA #REQUIRED - alt CDATA #IMPLIED - height NMTOKEN #IMPLIED - width NMTOKEN #IMPLIED - scale NMTOKEN #IMPLIED - ''' - attrs = node.attributes - l = ['src="%(uri)s"'%attrs] - # TODO: scale - self.w(''%node.attributes['uri']) - def depart_image(self, node): - pass - - # - # Tables: - # NOT IN DOM YET - # - def visit_table(self, node): - ''' - +------------------------+------------+----------+----------+ - | Header row, column 1 | Header 2 | Header 3 | Header 4 | - | (header rows optional) | | | | - +========================+============+==========+==========+ - | body row 1, column 1 | column 2 | column 3 | column 4 | - +------------------------+------------+----------+----------+ - | body row 2 | Cells may span columns. | - +------------------------+------------+---------------------+ - | body row 3 | Cells may | - Table cells | - +------------------------+ span rows. | - contain | - | body row 4 | | - body elements. | - +------------------------+------------+---------------------+ - ''' - self.w('\n') - def depart_table(self, node): - self.w('
\n') - - def visit_tgroup(self, node): - pass - def depart_tgroup(self, node): - pass - - def visit_colspec(self, node): - pass - def depart_colspec(self, node): - pass - - def visit_row(self, node): - self.body.append(self.starttag(node, 'tr', '')) - - def depart_row(self, node): - self.body.append('\n') - - def visit_thead(self, node): - self.thead = 1 - def depart_thead(self, node): - self.thead = 0 - def visit_tbody(self, node): - self.thead = 1 - def depart_tbody(self, node): - self.thead = 0 - - def visit_entry(self, node): - if self.thead: - s = 'th ' - else: - s = 'td ' - attrs = node.attributes - if attrs.has_key('morecols'): - s = s + 'colspan=%d '%(attrs['morecols']+1) - if attrs.has_key('morerows'): - s = s + 'rowspan=%d '%(attrs['morerows']+1) - self.w('<%svalign="top" align="left">'%s) - - def depart_entry(self, node): - if self.thead: - self.w('\n') - else: - self.w('\n') - - def visit_emphasis(self, node): - self.w('') - def depart_emphasis(self, node): - self.w('') - - def visit_strong(self, node): - self.w('') - def depart_strong(self, node): - self.w('') - - def visit_interpreted(self, node): - pass #raise NotImplementedError, node - def depart_interpreted(self, node): - pass #raise NotImplementedError, node - - def visit_literal(self, node): - self.w('
') - def depart_literal(self, node): - self.w('
') - - def visit_reference(self, node): - attrs = node.attributes - doc = self.document - ok = 1 - if attrs.has_key('refuri'): - self.w(''%attrs['refuri']) - elif doc.explicit_targets.has_key(attrs['refname']): - # an external reference has been defined - ref = doc.explicit_targets[attrs['refname']] - if ref.attributes.has_key('refuri'): - self.w(''%ref.attributes['refuri']) - else: - self.w(''%attrs['refname']) - elif doc.implicit_targets.has_key(attrs['refname']): - # internal reference - name = attrs['refname'] - self.w(''%urllib.quote(name)) - else: - self.w('target "%s" ' - 'undefined'%attrs['refname']) - - def depart_reference(self, node): - self.w('') - - def visit_footnote_reference(self, node): - raise NotImplementedError, node - - def visit_substitution_reference(self, node): - pass - def depart_substitution_reference(self, node): - pass - - def visit_problematic(self, node): - raise NotImplementedError, node - def depart_problematic(self, node): - raise NotImplementedError, node - - def visit_system_message(self, node): - print >>sys.stderr, '%s: %s'%(node.attributes['type'], node[0][0].data) - def depart_system_message(self, node): - pass - - def visit_comment(self, node): - pass - def depart_comment(self, node): - pass - - def visit_Text(self, node): - self.w(cgi.escape(node.data)) - def depart_Text(self, node): - pass - -def main(filename, debug=0): - pub = docutils.core.Publisher() - pub.set_reader('standalone', None, 'restructuredtext') - pub.writer = Writer() - pub.get_settings() - pub.settings._destination = '' - pub.source = docutils.io.StringInput(source=open(filename).read(), - encoding='latin-1') - pub.destination = docutils.io.StringOutput(encoding='latin-1') - document = pub.reader.read(pub.source, pub.parser, pub.settings) - pub.apply_transforms(document) - - if debug == 1: - print document.pformat() - else: - print pub.writer.write(document, pub.destination) - -if __name__ == '__main__': - if len(sys.argv) > 2: - main(sys.argv[1], debug=1) - else: - main(sys.argv[1]) - diff --git a/sandbox/richard/pythonpoint/readme.txt b/sandbox/richard/pythonpoint/readme.txt deleted file mode 100644 index 3f889e361..000000000 --- a/sandbox/richard/pythonpoint/readme.txt +++ /dev/null @@ -1,5 +0,0 @@ -This generates an XML slideshow usable by PythonPoint. - - http://www.reportlab.com/demos/pythonpoint/pythonpoint.html - -See the example slides.stx for information - and restrictions. diff --git a/sandbox/simonb/inline_target.txt b/sandbox/simonb/inline_target.txt deleted file mode 100644 index f54aaa2aa..000000000 --- a/sandbox/simonb/inline_target.txt +++ /dev/null @@ -1,48 +0,0 @@ -.. Note:: This functionality has been implemented as `embedded URIs - `_. - - -Sample usage of inline targets ------------------------------- - -Here is some sample text, that tests an syntax for inline targets. -There has been a lot of discussion starting here__ -__ - -This just has been an anonymous reference, that immediately got resolved. -Please note, that this can be mixed freely__ with "real" anonymous__ -links__ __ and the inlined target will always__ -be assigned to the anonymous link immediately in front of it. - -regular anonymous links should not be disturbed. They should get resolved -without noticing that there has been an immediately resolved one inbetween. - - __ anonlink1.html - __ anonlink2.html - __ anonlink3.html - -As a not yet discussed feature I have the equivalent construct for named -links. this example_ _ shows how this works. You can refer -a second time to example_ as usual. - -I wonder what happenes here__ - __ - -Of course you can `add links to multiple words`__ __. -So `the implementation`_ is kind of consistent with the usual link -syntax. I am not sure if the added space and the doubling of the -underscores is worth it just to avoid long words. -It introduces a lot of line noise. Changing this in `the -implementation`_ _ -should be fairly trivial: I'd guess that adjsuting te regex in two places -would do the trick. - -Some real use: Bookmark lists: - -- `Cool Modifications`__ __ -- `Cool Image Manipulation`__ __ -- `Cool Homepage`__ __ -- `Cool Comics`__ __ -- `something with a Cool long URL`__ __ diff --git a/sandbox/tibs/pysource/.cvsignore b/sandbox/tibs/pysource/.cvsignore deleted file mode 100644 index 52e4e6114..000000000 --- a/sandbox/tibs/pysource/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -*.pyc -*.pyo diff --git a/sandbox/tibs/pysource/__init__.py b/sandbox/tibs/pysource/__init__.py deleted file mode 100755 index 66239ca01..000000000 --- a/sandbox/tibs/pysource/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -"""Extract information from Python files, for DOCUTILS/reST purposes - -:Author: Tibs -:Version: 0.1 -""" diff --git a/sandbox/tibs/pysource/buildhtml.py b/sandbox/tibs/pysource/buildhtml.py deleted file mode 100755 index f620a7a02..000000000 --- a/sandbox/tibs/pysource/buildhtml.py +++ /dev/null @@ -1,354 +0,0 @@ -"""Convenience mechanisms for writing HTML - -Similar in concept to buildtree.py (qv), but very different in the details. -""" - -import sys -import string - -__docformat__ = "reST" - -EMPTY = ["br","hr"] -"""Elements that do not (may not) have content. -""" - -INLINE = ["em","strong","samp","code","tt","text"] -"""Elements that may occur 'inline' - within a paragraph, etc. - -Note that we include the 'pseudo-element' "text". -""" - -NEWLINE_AFTER = ["html","head","body","table","address"] - -LISTS = ["ol","ul","dl"] - - -# ---------------------------------------------------------------------- -class BuildHTML: - - def __init__(self,stream=None): - """Instantiate a BuildHTML instance. - - `stream` should be either something that "looks like" a file - instance (specifically, it has to have a "write" method), or - else `None` if we want to default to sys.stdout - """ - - self.stream = stream or sys.stdout - self.stack = [] - """A stack of tag names (e.g., ["html","body","h1","p"]) - """ - self.last = None - """The last element we were told to add to our output. - """ - self.fancy = 0 - - def write_doctype(self): - """Write out the DOCTYPE element at the start of the HTML file. - - For the moment, we don't provide any flexibility in this... - """ - self.stream.write('\n') - - def finish(self): - """Call this to indicate we have finished. - - It will grumble if anything is left unclosed - i.e., if there - is still stuff on the internal stack. - """ - if len(self.stack) > 0: - raise ValueError,"Items still outstanding on stack: %s"%\ - self._stack_as_string() - - def _maybe_write_newline(self,tag,before=1): - """Decide whether to write a newline before or after an element. - """ - if before: - if tag not in INLINE: - self.stream.write("\n") - else: - if tag in NEWLINE_AFTER: - self.stream.write("\n") - - def add(self,tag,*args,**keywords): - """Write an HTML element at the current level. - - For instance:: - - build.add("em","Some simple text.") - - If `tag` is "text" then it will automagically be converted - to ordinary inline text (even though there is no such HTML - element). - - Otherwise, this produces (for instance):: - - Some simple text. - - See `write` (which this uses) for more details of the arguments. - """ - self._maybe_write_newline(tag) - self.stream.write(self.element(tag,*args,**keywords)) - self.last = "/"+tag - - def start(self,tag,*args,**keywords): - """Write out the start of an HTML element, and start a new level. - - `tag` should be the name of an HTML element (a tag), or "comment". - - For instance:: - - build.start("li","some text") - - might cause:: - -
  • some text - - to be written out. Note that the element's closing tag is *not* - written out - see `end()` for that. - - If `args` are given, they are assumed to be (things that resolve - to) more text elements (i.e., strings). For instance:: - - build.start("li","some text", - build.element("strong","and emphasis"), - "and plain text again") - - See `write` (which this uses) for more details of the use of the - `tag` and `keywords` arguments. - """ - if tag in EMPTY: - raise ValueError,"Cannot start an 'empty' element (%s)"%tag - elif tag == "text": - raise ValueError,"Cannot start 'text'" - elif tag == "html" and len(self.stack) > 0: - raise ValueError,\ - "Cannot insert 'html' except at root of stack" - - self._maybe_write_newline(tag,before=1) - self.stream.write(self.start_tag(tag,**keywords)) - content = self._content(tag,args) - if content: - self.stream.write(content) - self._stack_add(tag) - self.last = tag - - def end(self,tag,*args): - """Write out the end of an HTML element, and finish the current level. - - `tag` should be the name of an HTML element (a tag), or "comment". - - For instance:: - - build.end("ul") - - Otherwise, for the moment at least, the `tag` being ended - must be the last tag that was begun (in the future, we *might* - support automatic "unrolling" of the stack, but not at the - moment). - - NB: if `args` are given, they will also be treated as closing - tags, in order - thus, for example:: - - build.end("td","tr","table") - - is exactly equivalent to:: - - build.end("td") - build.end("tr") - build.end("table") - - (Hmm - I'm not sure if that last is a good idea. Still, I *do* - use it for that specific instance, which is a relatively common - thing to want to do, and it does save "wasting" two fairly - uninteresting lines of code.) - """ - if tag in EMPTY: - raise ValueError,"Cannot start an 'empty' element (%s)"%tag - - if tag == "text": - raise ValueError,"Cannot end 'text'" - - self._stack_remove(tag) - self.stream.write(self.end_tag(tag)) - self._maybe_write_newline(tag,before=0) - - if args: - for item in args: - self.end(item) - self.last = "/"+args[-1] - else: - self.last = "/"+tag - - def start_tag(self,tag,**keywords): - """Construct and return a start tag. - - `tag` should be the name of an HTML element (a tag) - - `tag` may not be "text". - - `keywords` should be attributes for the tag. - """ - if tag == "comment": - return "" - else: - return ""%tag - - def element(self,tag,*args,**keywords): - """Construct and return a complete HTML element. - - `tag` should be the name of an HTML element (a tag), or "text". - - If `tag` is "text" then `keywords` is ignored, and the result - of concatenating `args` is returned. - - Otherwise: - - - an opening tag is composed from `tag` and `keywords` - (see `start_tag()`) - - the result of concatentating `args` is appended to that - - a closing tag (see `end_tag()`) is appended to that - - and the result is returned. - - Within `args`, non-strings are coerced to their representations. - """ - content = self._content(tag,args) - if tag == "text": - return content - else: - return self.start_tag(tag,**keywords) + content + \ - self.end_tag(tag) - - - def _content(self,tag,args): - """Return the *content* of an element. - - `tag` is not currently used, but *might* be useful later on? - """ - content = "" - if args: - for item in args: - if type(item) == type(""): - content += item - else: - content += `item` - return content - - def escape(self,text): - """Return `text` as valid HTML - - (that is, with any "special" characters escaped) - """ - # Hmm - paranoia, just in case - if type(text) != type(""): return text - - text = string.replace(text, "&", "&") - text = string.replace(text, "<", "<") - text = string.replace(text, '"', """) - text = string.replace(text, ">", ">") - - if self.fancy: - text = string.replace(text, " ", "°") - text = string.replace(text, "\n", "¶\n") - return text - - def last_tag(self): - """Return the last element we were asked to add to our output. - - Note that if we just closed element "XX" (for instance), then - we will return "/XX". - """ - return self.last - - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Stack queries - - def _in_list(self): - """Are we *immediately* within a list - - (i.e., the first child element of a list) - """ - return self.stack[-1] in LISTS - - - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Stack maintenance - - def _stack_ends(self,name): - """Return true if the stack ends with the named entity. - """ - return self.stack[-1] == name - - def _stack_add(self,name): - """Add a new level to the stack. - """ - self.stack.append(name) - - def _stack_remove(self,name): - """Remove the last level from the stack - - (but only if it is of the right sort). - """ - if len(self.stack) == 0: - raise ValueError,"Cannot end %s - nothing outstanding to end"%\ - (name) - if name != self.stack[-1]: - raise ValueError,"Cannot end %s - last thing begun was %s"%\ - (name,self.stack[-1]) - del self.stack[-1] - - def _stack_as_string(self): - names = [] - for name in self.stack: - names.append(name) - return string.join(names,",") - - -# ---------------------------------------------------------------------- -if __name__ == "__main__": - build = BuildHTML() - - print "Building a page" - build.start("html") - build.start("body") - build.add("h1","Fred") - build.start("p") - build.add("text","This is some text.") - build.add("strong","Really.") - build.start("p","Another paragraph") - build.end("body") - build.end("html") - build.finish() - - print - print "Building a broken page" - try: - build.start("html") - build.start("body") - build.add("h1","Fred") - build.start("p") - build.finish() - except ValueError,detail: - print "ValueError:",detail diff --git a/sandbox/tibs/pysource/buildtree.py b/sandbox/tibs/pysource/buildtree.py deleted file mode 100755 index 977226f8d..000000000 --- a/sandbox/tibs/pysource/buildtree.py +++ /dev/null @@ -1,403 +0,0 @@ -"""This module explores a different approach to building doctree elements... - -The "normal" way of building a DOCUTILS tree involves, well, building a tree -structure. So one might do:: - - section = docutils.nodes.section() - section += docutils.nodes.title(text="Title") - para = docutils.nodes.paragraph() - section += para - para += docutils.nodes.Text("Some ") - para += docutils.nodes.strong(text="strong text.") - -That's all very nice, if one is *thinking* in terms of a tree structure, -but it is not, for me, a very natural way to construct a text. - - (OK - I *know* in practice one would also have imported `paragraph`, - etc., from `docutils.nodes`, but that is not my point.) - -This module allows one to use a more LaTex style of construction, with -begin and end delimitors for DOCUTILS nodes. Thus the above example becomes:: - - build.start("section") - build.add("title","Title") - build.start("paragraph","Some ") - build.add("strong","Strong text.") - build.end("section") - -(As a convenience, paragraphs are automatically ended.) - -A slightly shorter, and possibly more obfuscated, way of writing this -would be:: - - build.start("section",build.make("title","Title") - build.start("paragraph","Some ",build.make("strong","Strong text.")) - build.end("section") - -Sometimes I think that sort of approach makes more sense, sometimes not. -""" # we need a " to keep [X]Emacs Python mode happy. - -import string -import docutils.nodes -import docutils.utils - -__docformat__ = "reST" - - -# ---------------------------------------------------------------------- -class group(docutils.nodes.Element): - """Group is a way of grouping together elements. - - Compare it to HTML
    and , or to TeX (?check?) - \begingroup and \endgroup. - - It takes the special attribute `style`, which indicates what - sort of thing it is grouping - for instance, "docstring" or - "attributes". - - Although it (should be) supplied by the standard DOCUTILS tree, - reST itself does not use `group`. It is solely used by - extensions, such as ``pysource``. - - In the default HTML Writer, `group` renders invisibly - (that is, it has no effect at all on the formatted output). - """ - - pass - - -# ---------------------------------------------------------------------- -class BuildTree: - - def __init__(self, with_groups=1, root=None): - self.stack = [] - """A stack of tuples of the form ("classname",classinstance). - """ - - self.root = root - """A memory of the first item on the stack (notionally, the - "document") - we need this because if we `start` a document, - fill it up, and then `end` it, that final `end` will remove - the appropriate instance from the stack, leaving no record. - Thus this is that record. - """ - if root is not None: - self._stack_add(root) - - self.with_groups = with_groups - - def finish(self): - """Call this to indicate we have finished. - - It will grumble if anything is left unclosed, but will - return the "root" instance of the DOCUTILS tree we've been - building if all is well... - """ - if len(self.stack) > 0: - raise ValueError,"Items still outstanding on stack: %s"%\ - self._stack_as_string() - else: - return self.root - - def add(self,thing,*args,**keywords): - """Add a `thing` DOCUTILS node at the current level. - - For instance:: - - build.add("paragraph","Some simple text.") - - If `thing` is "text" then it will automagically be converted - to "Text" (this makes life easier for the user, as all of the - other DOCUTILS node classes they are likely to use start with a - lowercase letter, and "Text" is the sole exception). - - See `make` (which this uses) for more details of the arguments. - """ - if thing == "group" and not self.with_groups: - return - - instance = self.make(thing,*args,**keywords) - self._stack_append(instance) - - def addsubtree(self,subtree): - """Add a DOCUTILS subtree to the current item. - """ - self._stack_append(subtree) - - def current(self): - """Return the "current" item. - - That is, return the item to which `add()` will add DOCUTILS nodes. - """ - return self._stack_current() - - def start(self,thing,*args,**keywords): - """Add a `thing` DOCUTILS node, starting a new level. - - `thing` should be either the name of a docutils.nodes class, or - else a class itself. - - If `thing` is "text" then it will automagically be converted - to "Text" (this makes life easier for the user, as all of the - other DOCUTILS node classes they are likely to use start with a - lowercase letter, and "Text" is the sole exception). - - For instance:: - - build.start("bullet_list") - - As a convenience, if `thing` is a paragraph, and if the current - item is another paragraph, this method will end the old paragraph - before starting the new. - - Note that if `thing` is "document", some extra magic is worked - internally. If the keywords `warninglevel` and `errorlevel` are - given, they will be passed to a docutils.utils.Reporter instance, - as well as being passed down to the `document` class's initialiser. - - See `make` (which this uses) for more details of the arguments. - """ - name = self._nameof(thing) - - if name == "group" and not self.with_groups: - return - - if name == "paragraph" and self._stack_ends("paragraph"): - self.end("paragraph") - - if name == "document": - if self.root: - return - if len(self.stack) > 0: - raise ValueError,\ - "Cannot insert 'document' except at root of stack" - warninglevel = keywords.get("warninglevel",2) - errorlevel = keywords.get("errorlevel",4) - reporter = docutils.utils.Reporter('fubar', warninglevel, - errorlevel) - instance = docutils.nodes.document(reporter,"en") - else: - instance = self.make(thing,*args,**keywords) - - if len(self.stack) == 0: - self.root = instance - else: - self._stack_append(instance) - - self._stack_add(instance) - - def end(self,thing): - """End the level started below a `thing` DOCUTILS node. - - `thing` should be either the name of a docutils.nodes class, or - else a class itself. - - For instance:: - - build.end("bullet_list") - - As a convenience, if the last item constructed was actually - a paragraph, and `thing` is the container for said paragraph, - then the paragraph will be automatically ended. - - Otherwise, for the moment at least, the `thing` being ended - must be the last thing that was begun (in the future, we *might* - support automatic "unrolling" of the stack, but not at the - moment). - """ - name = self._nameof(thing) - - if thing == "group" and not self.with_groups: - return - - if self._stack_ends("paragraph") and name != "paragraph": - self.end("paragraph") - - self._stack_remove(name) - - def make(self,thing,*args,**keywords): - """Return an instance of `docutils.nodes.thing` - - Attempts to regularise the initialisation of putting initial - text into an Element and a TextElement... - - `thing` should be either the name of a docutils.nodes class, or - else a class itself (so, for instance, one might call - ``build.make("paragraph")`` or - ``build.make(docutils.nodes.paragraph)``), - or else None. - - If `thing` is "text" then it will automagically be converted - to "Text" (this makes life easier for the user, as all of the - other DOCUTILS node classes they are likely to use start with a - lowercase letter, and "Text" is the sole exception). - - If `thing` is an Element subclass, then the arguments are just - passed straight through - any *args list is taken to be children - for the element (strings are coerced to Text instances), and any - **keywords are taken as attributes. - - If `thing` is an TextElement subclass, then if the first - item in *args is a string, it is passed down as the `text` - parameter. Any remaining items from *args are used as child - nodes, and any **keywords as attributes. - - If `thing` is a Text subclass, then a single argument is expected - within *args, which must be a string, to be used as the Text's - content. - - For instance:: - - n1 = build.make("paragraph","Some ", - build.make("emphasis","text"), - ".",align="center") - n2 = build.make(None,"Just plain text") - """ - - #print "make: %s, %s, %s"%(thing,args,keywords) - - # Temporary special case - since group is not (yet) in docutils.nodes... - if thing == "group": - thing = group - - if thing == None: - dps_class = docutils.nodes.Text - elif type(thing) == type(""): - if thing == "text": - thing = "Text" - try: - dps_class = getattr(docutils.nodes,thing) - except AttributeError: - raise ValueError,"docutils.nodes does not define '%s'"%thing - else: - dps_class = thing - - # NB: check for TextElement before checking for Element, - # since TextElement is itself a subclass of Element! - if issubclass(dps_class,docutils.nodes.TextElement): - # Force the use of the argument list as such, by insisting - # that the `rawsource` and `text` arguments are empty strings - args = self._convert_args(args) - dps_instance = dps_class("","",*args,**keywords) - elif issubclass(dps_class,docutils.nodes.Element): - # Force the use of the argument list as such, by insisting - # that the `rawsource` arguments is an empty string - args = self._convert_args(args) - dps_instance = dps_class("",*args,**keywords) - elif issubclass(dps_class,docutils.nodes.Text): - if len(args) > 1: - raise ValueError,\ - "Text subclass %s may only take one argument"%\ - self._nameof(thing) - elif len(args) == 1: - text = args[0] - else: - text = "" - if keywords: - raise ValueError,\ - "Text subclass %s cannot use keyword arguments"%\ - self._nameof(thing) - dps_instance = dps_class(text) - else: - raise ValueError,"%s is not an Element or TextElement"%\ - self._nameof(thing) - - #print " ",dps_instance - return dps_instance - - def _convert_args(self,args): - """Return the arguments, with strings converted to Texts. - """ - newargs = [] - for arg in args: - if type(arg) == type(""): - newargs.append(docutils.nodes.Text(arg)) - else: - newargs.append(arg) - return newargs - - def __getattr__(self,name): - """Return an appropriate DOCUTILS class, for instantiation. - """ - return getattr(docutils.nodes,name) - - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - def _nameof(self,thing): - if thing is None: - return "Text" - elif type(thing) == type(""): - return thing - else: - return thing.__name__ - - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Stack maintenance - - def _stack_ends(self,name): - """Return true if the stack ends with the named entity. - """ - return self.stack[-1][0] == name - - def _stack_add(self,instance): - """Add a new level to the stack. - """ - self.stack.append((instance.__class__.__name__,instance)) - - def _stack_remove(self,name): - """Remove the last level from the stack - - (but only if it is of the right sort). - """ - if len(self.stack) == 0: - raise ValueError,"Cannot end %s - nothing outstanding to end"%\ - (name) - if name != self.stack[-1][0]: - raise ValueError,"Cannot end %s - last thing begun was %s"%\ - (name,self.stack[-1][0]) - del self.stack[-1] - - def _stack_append(self,instance): - """Append an instance to the last item on the stack. - """ - if len(self.stack) > 0: - self.stack[-1][1].append(instance) - else: - raise ValueError,"Cannot add %s to current level" \ - " - nothing current"%(instance.__class__.__name__) - - def _stack_current(self): - """Return the "current" element from the stack - - That is, the element to which we would append any new instances - with `_stack_append()` - """ - return self.stack[-1][1] - - def _stack_as_string(self): - names = [] - for name,inst in self.stack: - names.append(name) - return string.join(names,",") - - -# ---------------------------------------------------------------------- -if __name__ == "__main__": - build = BuildTree() - #print build.make("paragraph",text="fred") - #print build.paragraph(text="fred") - - print "Building a section" - build.start("section") - build.add("title","Fred") - build.start("paragraph") - build.add("text","This is some text.") - build.add("strong","Really.") - build.start("paragraph","Another paragraph") - build.end("section") - print build.finish() - - #print "Building a broken section" - #build.start("section") - #build.add("title","Fred") - #build.start("paragraph") - #print build.finish() diff --git a/sandbox/tibs/pysource/doc/readme.rtxt b/sandbox/tibs/pysource/doc/readme.rtxt deleted file mode 100644 index 5710eaa53..000000000 --- a/sandbox/tibs/pysource/doc/readme.rtxt +++ /dev/null @@ -1,189 +0,0 @@ -pysource -======== - -:Author: Tibs (tibs@tibsnjoan.co.uk) -:Date: $Date$ -:Revision: $Revision$ -:Version: 0.1 - -Ahem ----- -This file needs updating - unless this notice has disappeared, treat the -rest of the file as out-of-date... - -History -------- -2002-04: - -* Name changed from 'pydps' to 'pysource' (in line with a suggestion - made a while back on the Doc-SIG by David Goodger). - - It's not that that's a great name, just that it's better than 'pydps' - (especially now that 'dps' has become 'docutils'), and the rather more - obvious 'pydoc' is already taken. Any suggestions for a better name will - be gratefully received! - -* Converted from the old 'dps' and 'restructuredtext' packages to the - new 'docutils' package. - -* All previous history is elided with the change of name and first release... - -Obtaining the package ---------------------- -The latest version of 'pysource' may be found in the Docutils sandbox -(tarball_ and browsable_). - -.. _tarball: http://docutils.sourceforge.net/docutils-sandbox-snapshot.tgz -.. _browsable: http://docutils.sourceforge.net/sandbox/tibs/pysource/ - -I hope to keep a copy of the current "released" version at - - http://www.tibsnjoan.co.uk/reST/pysource.tgz - -Purpose -------- -This module provides code to - - * parse a Python file using the Python Compiler module, which is - standard with Python 2.2 and later, and available in the Tools - directory in earlier versions, - * extract relevant information, including docstrings, - * and ultimately produce (in the first instance) HTML documentation - therefrom. - -As a subsidiary capability, it can read a restructuredtext file and produce -HTML from that. - -There are obviously other tools which perform similar tasks - see the -accompanying file whythis.rtxt for some comparisons, and an -explanation of why I think it is worth developing this tool -independently. - - -*** TO HERE *** - -Usage ------ -The command ``python pysource/pysource.py --help`` gives the following -information:: - - """The command line interface to docutil's Python documentation extractor. - - Usage: ``pysource.py []`` - - is the path to a package or module. - - is the path to the output file. If it's not given, then - output will be written to a file with the same name as the input - file, but defaulting to the current directory, and with extension - derived from the type of output: - - - show -> ``.show`` - - ast -> ``.ast`` - - xml -> ``.xml`` - - html -> ``.html`` - - pretty -> ``.pretty`` - - (unless --stdout is requested). The default is --html. - - Note that progress messages (and ``verb`` information) are written - to ``sys.stderr``. - """ - - are: - - -v, --verbose Report on progress in more detail - -q, --quiet Suppress normal progress messages - -t, --text The input file is a plain (text) reST file - -s, --show Output basic information about the input - -a, --ast Output a representation of the AST - -x, --xml Output an XML representation of the input - -h, --html Output an HTML representation of the input [default] - -p, --pretty Output a 'pretty' representation of the input - -d, --doctest Treat a reST file as doctest input. - -h, --help Show 'help' information - -n, --new Use David Goodger's HTML Writer (sort of) - --stdout Write output to stdout, instead of a file - -I recommend use of the ``--pretty`` option for gaining an understanding of the -DPS tree itself. - -Limitations and dependencies ----------------------------- -This is beta software, and is still, to some extent, a proof and exploration of -concept. - -The following limitations are obvious: - - * Its concept of a "package" is rather limited - it doesn't understand - sub-packages (i.e., it only copes with a "flat" directory structure). - * It only produces a single HTML file - a more sophisticated approach - is clearly needed, particularly for large packages (or even large - modules). - * It is not fully integrated with the Docutils HTML Writer, which it - should be using in preference to my own home-grown approach. - * The Docutils tree that it produces could use some improvement - in - particular the Python specific nodes need various design decisions - to be made. - -Also: - - * It doesn't throw away as much information as it should. - * It doesn't check all assignments for use of global values. - * It doesn't handle all Python entities that it should. - * The HTML it produces is pretty yuck, and is *designed* not - to look terribly nice (although you should remember not to - ask my opinion of the HTML output by pydoc). - * Autonumbered footnote resolution is done by the HTML writer, - which means that it will likely go wrong if it needs to do - anything with Python source that contains autonumbered - footnotes in docstrings(!). But it does work (I believe) - for .rtxt files. - * Various other Docutils tree transforms that should be applied - are not yet performed. - -Subtler things: - - * The ``--doctest`` mode just pretends that the whole file is - a single doctest string (i.e., just as if doctest had found - it as a docstring in a Python file). - - That's quite sensible, except that the current doctest doesn't - know that it should ignore literal blocks, and thus may find - apparent Python code where it shouldn't. - -It depends on: - - * The latest versions of Docutils, as of the - time it was uploaded (I generally track these fairly well, - so am normally using the latest versions whilst developing). - These should have been installed (using the setup scripts - they provide). - * Python 2.0 or above - * Tools/compiler for the current Python. For Pythons before - 2.2a4 (I think it was) this should be installed using the - setup script it provides (after that it comes as standard). - -I develop it with Python 2.1 on Windows/NT and with Python 2.2 on -Debian GNU/Linux. - -Refactoring warning -------------------- -It is my aim to refactor this code to follow David Goodger's - - Reader - Transformer - Writer - -model more closely than it currently does. And there is also lots of -tidying up to do (especially in `visit.py`). - -Interesting things to do ------------------------- -Run it over docutils/spec/reStructuredText.txt. - -Run it over docutils/docutils. - -Run it over pysource/visit.py. - -Run it over the standard string module, and compare the result with that -of ``pydoc``. - diff --git a/sandbox/tibs/pysource/doc/whythis.rtxt b/sandbox/tibs/pysource/doc/whythis.rtxt deleted file mode 100644 index 0307654a2..000000000 --- a/sandbox/tibs/pysource/doc/whythis.rtxt +++ /dev/null @@ -1,122 +0,0 @@ -Why pysource? -============= - -There is the question of why a new tool is needed to go with Docutils and -reStructuredText, when there are several existing tools which could have been -adopted. - -Perhaps the main reason is simply as a "proof of concept" - even if pysource -itself is not adopted as *the* tool for use in documenting Python source files -(and I certainly would not advocate that it be the only one, as other tools -present their own particular advantages), it *is* worth doing as a "proof of -concept" - as an examplar that it is possible to do the job. - -Three existing tools deserve particular consideration: - - - pydoc - - HappyDoc - - PyPaSax - -pydoc ------ - -pydoc is Ka-Ping Yee's classic application. It is now (as of Python 2.1) -included in the standard Python library, where it also provides the backbone -for the "help" command. - -pydoc uses introspection of "live" objects to determine information - that is, -it requires that the modules to be documented be imported. This can be a -limiting factor - sometimes it is not advisable to import a module, and -sometimes it is simply not possible. - -It provides output as HTML, and also has a rather output mode for use at -a terminal. - -.. note: - I've still to work out how to make pydoc work as a standalone tool - (i.e., at the terminal prompt) for documenting my own Python code - - for instance, doing ``pydoc.py pysource/visit.py``, which, at best, - doesn't seem to see any documentation! - -HappyDoc --------- - - http://happydoc.sourceforge.net/ - -HappyDoc is a seriously neat tool, and one of the longest standing in the -arena. It is a mature tool, and: - - - supports several forms of structured text within docstrings - notably - plain text, "raw" text, StructuredTextClassic and StructuredTextNG. - - - allows the extraction of documentation from comments as well as from - docstrings. - - - supports several forms of output - notably HTML, SGML and XML DocBook, - plain text, and Dia files. - - - has documented mechanisms for adding new import and export filters. - - - has sophisticated control over the actual details of export (HTML options, - single or multiple files, etc.) - -I would expect it to add support for reStructuredText in the near future. - -PyPaSax -------- - - http://www.logilab.org/pypasax/ - -PyPaSax is a Python module that uses the python parser to generate Sax2 events, -and thus enables the visualisation of a python document as an XML tree. This is -used at Logilab for documenting the source code of Narval. Logilab are also -working on an XSL transformation to generate XMI from the generated XML, which -should allow interface to UML tools. - -This is a very interesting approach to the problem of extracting information -from Python modules, but it is currently relatively "coarse grained" - it does -not, for instance, pay attention to docstrings. - -pysource --------- - -http://docutils.sourceforge.net/sandbox/pysource/ (or from the tarball_). - -.. _tarball: http://docutils.sourceforge.net/docutils-sandbox-snapshot.tgz - -pysource is intended as a proof-of-concept implementation of the concepts in -the Docutils PEPs. - -It parses Python files using the Compiler module, honouring the __docformat__ -module value to decide whether docstrings are in reStructuredText or plain -text. - -It uses Docutils to organise the information so gained, and the results of -parsing the Python code are integrated with the parsed docstring text into a -single Docutils nodes tree. - -The initial version of pysource supports the output of XML (which is a native -ability of Docutils itself), and HTML. Since it is intended that pysource -integrate closely with Docutils, additional output formats will occur as new -Writers are added to Docutils itself. - -See also --------- -pep-0256: Docstring Processing System Framework - - This includes a closer analysis of why pydoc is not directly suitable - for the purposes of Docutils. - -pep-0257: Docstring conventions - - This describes the high-level structure of docstrings. - -pep-0258: Docutils Design Specification - - This includes a description of what a tool such as pysource should - actually do - what docstrings to extract and from where, and how to - decide what format is used within said docstrings. - -pep-0287: reStructuredText Standard Docstring Format - - The PEP for reStructuredText itself. diff --git a/sandbox/tibs/pysource/group-notes.txt b/sandbox/tibs/pysource/group-notes.txt deleted file mode 100644 index 6c3f281f9..000000000 --- a/sandbox/tibs/pysource/group-notes.txt +++ /dev/null @@ -1,220 +0,0 @@ -Adding , losing and their ilk -====================================================== - -:Author: Tibs -:Date: 2001-11-18 - -Background ----------- -I am currently writing software that will take information from -Python source files, produce a DPS node tree therefrom, and allow -the user to generate HTML from that. - -My initial implementation produced a *variant* of the DPS node -tree, which contained many structures that related closely to the -information derived from Python - for instance, something like:: - - - - This is a very silly class. - - - - -For various reasons, the (implicit) DTD wasn't shaping up very -like that proposed by David Goodger, so I asked about the -possibility of amending the "standard" DTD. This led to a -discussion of how the flow of information through a DPS processor -should actually work, with the result being David's diagram -[#diagram]_:: - - +--------+ +--------+ +------------+ +--------+ - | READER | --> | linker | --> | transforms | --> | WRITER | - +--------+ +--------+ +------------+ +--------+ - | TOC, index, | - | etc. (optional) | - +--------+ +--------+ - | PARSER | | filer | - +--------+ +--------+ - -David also made the point that, within this plan, the result of -the ``linker`` phase is a normal DPS tree, which can be -transformed with any of the "standard" transformation tools (for -instance, to resolve automatic footnotes), and then output with -any writer. - -Whilst David's diagram is not *quite* how I see the process, it's -close enough for this purpose. Thus pydps [#pydps]_ might be shown -as:: - - +--------+ +--------------+ +------------+ +---------+ - | READER | --> | transform.py | --> | transforms | --> | html.py | - +--------+ +--------------+ +------------+ +---------+ - | | - +----------+ +---------------+ - | visit.py | | buildhtml.py | - +----------+ +---------------+ - -The "READER" is implicit in the main utility (currently -``pydps.py``), and locates the relevant Python files. It then -uses ``visit.py`` to generate a tree representing the Python code -(the Python ``compiler`` module, standard with Python 2.2 and -above, but in ``Tools`` before that, is used). - -``transform.py`` (which, by David's diagrams, should maybe be -called ``link``) transforms that information into a proper DPS -node tree. At the time of writing, no transformations are done. - -Finally, HTML is output from the DPS node tree by ``html.py``. - -So, in summary: - - 1. ``transform.py`` generates a *normal* DPS tree. It doesn't - use any "odd" nodes (except - but we'll discuss - that later on). This means that it should be possible to - plug in any other writer, and produce a different format as - output - a very significant advantage. - - 2. ``html.py`` expects to be given a *normal* DPS tree. This - means that it should be usable by any other utility that - also provides a normal DPS tree - again an advantage. - -The problem ------------ -But there is a clash in requirements here. Whilst it is very nice -to be able to represent the Python information as "normal" DPS -(guaranteeing that anyone can do useful things with it), there is -some need to transfer information that goes beyond that. There -are two main reasons for wanting to do this: - - * Data mining - * Presentation - -For the first, although DPS/reST/pydps is primarily about -producing human-viewable documentation, it might also be nice to -be able to extract parts of it automatically, for various -purposes - for instance, retrieve just the information about -which classes inherit from other. This information will, in part, -be obvious from the text chosen within the document (a title like -"Class Fred" might be taken to be useful, for instance!), but it -would be nice to give a bit more help. - -For the second, it's relatively difficult to produce better -layout for DPS Python documentation without more information to -work on. If one uses the (rather garish) default presentation -produced by pydps (and no, I'm not saying that's a *nice* -presentation, but it is the one I've got as an example), it is -clearly useful to be able to: - - 1. group together the package/class/method/etc title and its - full name/path/whatever - - 2. group together a method or function's signature and its - docstring - -David's original approach to this was to introduce a host of -Python specific tags into ``nodes.py`` [#nodes]_ - for instance:: - - package_section - module_section - ... - instance_attribute_section - ... - parameter_item - parameter_tuple - ... - package - module - class_attribute - -There are several problems with approach. Perhaps the most -serious is that *all* generic DPS writers need to understand -this host of elements that are only relevant to Python. Clearly, -someone writing a writer for other purposes may be reluctant to -go to this (to them) redundant effort. - -From my point of view, an immediate problem is that the set of -elements is not *quite* what I want - which means working towards -a set of patches for ``nodes.py`` and the relevant DTD, and -getting David to agree to them (well, that last is a useful -process to have in place, but still). Since I'm not likely to get -it right immediately, this is a repetitive process. - -Lastly, one might imagine someone from another programming -language domain adopting DPS/reST. One can expect them to be -frustrated if the set of constructs provided for Python doesn't -quite match the set of constructs required to describe their -language in a natural manner. - -Luckily (!), I have a counter proposal, which hopefully keeps the -baby and just loses the bath water. - -Groups and "style" ------------------- -The first thing that I realised was that, for convenience of -output at least, I wanted to be able to group elements together - -or, in terms of the DPS tree, insert an arbitrary "subroot" -within the tree to 'abstract' a branch of the tree. - -This is particularly useful for linking together the parts of the -text that deal with (for instance) attribution, or unusual -globals, without having to embed yet another section. - -There is, of course, precedent. HTML provides
    and - -one for "structural" elements, and one for inline elements (I -forget which is which), and TeX and LaTeX are well-known for -their use of grouping (e.g., the ``\begin{xxx}`` and -``\end{xxx}`` in LaTeX). - -I don't consider it worth making the
    / distinction in -the context of a tree - it is perfectly evident what is beingp -grouped from the elements themselves. - -Once one has a element, it is natural to annotate it with -*what* it is a group of/for. I chose the arbitrary term "style" - -partly because it is not used in HTML/XML for any purpose I am -aware of. - -And once one has the "style" attribute, it becomes possible to -use it elsewhere - most notably in
    elements, saving the -need for a myriad of different sections for different purposes. - -In these instances, it is perhaps acting more like the "class" -attribute in HTML - indicating, to some extent, meaning, but -aimed mostly at presentation (via CSS). - -The other obvious place to use it is in the automatically -generated text for things like names, where (at least -pre-"combing"/transformation) one is "pretending" to have -assigned a role (just as a person might in a docstring) (but see -[#style]_). - -Summary -------- -Current DPS defines many element types for use in Python code -representation. - -However, there are major advantages in only using the "simple" -DPS nodes for all purposes. - -This becomes simple and practical given a single extra, general -purpose, element: . - -Furthermore, adding a standard attribute called "style" (or -perhaps "role" - see [#style]_) seems to fulfil any other -outstanding requirements. - -References ----------- -.. [#diagram] in email by David Goodger to Doc-SIG, dated - 21 September 2001 04:31, "Re: [Doc-SIG] DPS components". - -.. [#style] Hmm - maybe "style" should be "role", to match - with the way that a ``:role:`of something``` gets handled... - -.. [#pydps] Normally to be found at - http://www.tibsnjoan.co.uk/reST/pydps.tgz, - although note that this is not currently up-to-date. - -.. [#nodes] dps/dps/nodes.py in the DPS distribution - (``dps.nodes`` if one is importing it). diff --git a/sandbox/tibs/pysource/html.py b/sandbox/tibs/pysource/html.py deleted file mode 100755 index 398151a0e..000000000 --- a/sandbox/tibs/pysource/html.py +++ /dev/null @@ -1,1163 +0,0 @@ -"""Output DOCUTILS nodes as HTML. - -This is a quick-and-dirty approach to writing out HTML derived from -a DOCUTILS node tree. It maintains a minimum of state, and doesn't attempt -any particular intelligence about the tree structure. - - Note: for debugging purposes some HTML elements are output with - "style" attributes - this is so I can track which elements were - written for what purpose, and is temporary. - - (Use of "class" attributes to make CSS usage easier is a - separate consideration, to be made later on.) - -Use of this should ultimately be replaced by use of David's new mechanisms -from the docutils module - but they didn't exist when I started, so we'll live -with this for a little longer. -""" - -import time -import buildhtml - -__docformat__ = "reST" - -class HTMLError(Exception): - pass - - -# ---------------------------------------------------------------------- -class Writer: - """Encapsulate the HTML writing stuff in a class - - - it makes it easier to handle values we want to keep around - """ - - colours = {"Information": "#FF0000", - "Warning" : "#FF0000", - "Error" : "#FF0000", - "Fatal" : "#FF0000", - "WarningBG" : "Silver", # (was "lightgrey" or #DDDDDD) - "default" : "#FFFFCC", - } - """Colours to use to distinguish various contexts - - Note that the HTML4 spec defines the following colours: - - * Black = "#000000" - * Silver = "#C0C0C0" - * Gray = "#808080" - * White = "#FFFFFF" - * Maroon = "#800000" - * Red = "#FF0000" - * Purple = "#800080" - * Fuchsia = "#FF00FF" - * Green = "#008000" - * Lime = "#00FF00" - * Olive = "#808000" - * Yellow = "#FFFF00" - * Navy = "#000080" - * Blue = "#0000FF" - * Teal = "#008080" - * Aqua = "#00FFFF" - """ #" - - role_text = {"package" : "Package", - "module" : "Module", - "class" : "Class", - "method" : "Method", - "function" : "Function", - "module_attribute" : "Module attribute", - "class_attribute" : "Class attribute", - "instance_attribute": "Instance attribute", - "variable" : "Name", - "parameter" : "Argument", - "type" : "Type", - "exception_class" : "Exception class", - "exception" : "Exception", - "warning_class" : "Warning class", - "warning" : "Warning"} - """If an interpreted text has a role, we want to write that role - out. We thus need a dictionary to relate role names to the text - to be written out. - """ - - fancy = 0 - """Do we want fancy presentation?""" - - want_contents = 0 - """Do we *want* contents for this document? - """ - - language = "en" - """The language that we believe our document to be - destined for. - """ - - showwarnings = 1 - """Should we show warnings, or try to continue silently? - """ - - showinforms = 1 - """Should we show informational messages, or ignore them? - """ - - visible_targets = 0 - """Show link target names - """ - - visible_links = 0 - """Show link references (although not all of the possible links - we produce). - """ - - def __init__(self): - - # The current document tree - unset it here just in case... - self.document = None - - # Our HTML builder - ditto - self.html = None - - # Our method cache - we seed it with the entry for "#text" - # because we can't deduce the method name from that tag - # ("write_#text" is not a valid Python name!) - self.method_cache = {"#text":self.write_text} - - def __call__(self,document,stream): - """Output an HTML representation of `document` to `stream`. - - Arguments: - - * document -- the DOCUTILS tree we are to output as HTML - * stream -- something like a File, with a write method - """ - - self.document = document - self.html = buildhtml.BuildHTML(stream) - - # Reset things (i.e., so we can be called more than once) - - # The header level to use for
    titles - # (i.e.,

    ,

    , etc). - self.level = 0 - - # Have we output Contents for this document? - self.got_contents = 0 - - # Are we within the body of a field list item? - self.infield = 0 - - # Or in a paragraph? (note - only in the sense that the DOCUTILS - # tree says that we're in a paragraph) - self.in_paragraph = 0 - - # Footnote autonumbers - self.auto_footnote = 0 - """The current auto-numbered footnote's number. - This will be stored as attribute "auto-index" on - the footnote itself, by `find_auto_footnotes()`. - """ - self.auto_footnote_names = {} - """A dictionary linking an auto-numbered footnote label - to the corresponding (generated) footnote number. This - is populated by `find_auto_footnotes()`. - """ - self.auto_footnote_list = [] - """A list of the auto-numbered footnote numbers that - are used for non-named footnotes. This list is then - used to populate the [#]_ footnote references. It is - populated by `find_auto_footnotes()`. - """ - self.auto_footnote_index = 0 - """An index into `self.auto_footnote_list`. - """ - self.auto_footnote_target = 0 - """This is used to record the numbering for the "link" end - of footnotes - i.e., the number for autonumbered references. - """ - - self.find_auto_footnotes(document) - - # Table location - self.in_table_header = 0 - self.in_table_body = 0 - - # And now down to work... - self.html.write_doctype() - self.html.start("html") - - # Hmm - have we been handed a "document" rooted tree, - # or a DOM-like tree that has "document" as its single child? - if document.tagname == "document": - self.write_html(document,stream) - else: - for element in document: - self.write_html(element,stream) - - self.html.end("html") - self.html.finish() - - def find_auto_footnotes(self,element): - """Locate and number autonumbered footnotes... - """ - - if element.tagname == "#text": - return - elif element.tagname == "footnote": - # This is a footnote body - it is the footnote bodies - # that determine their order and numbering... - name = auto = None - if element.hasattr("name"): - name = element["name"] - if element.hasattr("auto"): - auto = element["auto"] - self.auto_footnote += 1 - element["auto-index"] = self.auto_footnote - if auto: - if name: - if not self.auto_footnote_names.has_key(name): - self.auto_footnote_names[name] = self.auto_footnote - else: - # Well, what should we do? - # Removing it seems the best bet... - del self.auto_footnote_names[name] - else: - self.auto_footnote_list.append(self.auto_footnote) - - for node in element: - self.find_auto_footnotes(node) - - def write_document(self,element,stream): - document_is_section = 0 - if element.hasattr("title"): - title = self.html.escape(element["title"]) - else: - firstchild = element[0] - if firstchild.tagname == "title": - title = self.html.escape(firstchild.astext()) - document_is_section = 1 - elif firstchild.hasattr("title"): - title = self.html.escape(firstchild["title"]) - else: - title = "Document produced by pysource" - - self.html.start("head") - self.html.add("title",title) - self.html.end("head") - - self.html.start("body") - if document_is_section: - # There is no internal
    - instead we just - # have a whose first element is - # So, given that, pretend we ARE a section... - self.write_section(element,stream) - else: - for node in element: - self.write_html(node,stream) - - self.html.add("hr") - self.html.start("p") - self.html.add("em","Automatically generated by ", - self.html.element("code","pysource"), - " on %s\n"%time.ctime(time.time())) - self.html.end("p") - self.html.end("body") - - def write_text(self,element,stream): - """Write out plain text. - """ - self.html.add("text",self.html.escape(element.astext())) - - def write_html(self,element,stream): - """Write out the HTML representation of `element` on `stream`. - """ - - name = element.tagname - try: - method = self.method_cache[name] - except KeyError: - method = getattr(self,"write_%s"%name,self.write_unknown) - self.method_cache[name] = method - method(element,stream) - - def write_unknown(self,element,stream): - """Write out an element which we don't recognise. - """ - - self.html.add("p",self.html.element("comment","just a spacer")) - - self.html.start("font","<%s"%element.tagname,color="red") - for name,value in element.attlist(): - self.html.add("text"," %s='%s'"%(name,self.html.escape(value))) - self.html.add("text",">") - self.html.end("font") - - for node in element: - self.write_html(node,stream) - - self.html.add("font","</%s>"%element.tagname, - color="red") - - def write_section(self,element,stream): - """Write a section - i.e., something with a title - """ - - self.level += 1 - - if element.hasattr("name"): - # Lazily, escape the name so we don't have to worry - # about single quotes in it... - name=self.html.escape(element["name"]) - - # Hmm - we *want* to write "\n\n<a name='...'></a>" - # which isn't *quite* what this does - maybe have a specialised - # call in buildhtml.py? - self.html.add("text",self.html.element("a",name=name)) - if self.visible_links: - self.html.start("font",color="green") - self.html.add("text","<%s>"%name) - self.html.end("font") - - for node in element: - self.write_html(node,stream) - - self.level -= 1 - - def write_title(self,element,stream): - if 1 <= self.level <= 6: - self.html.start("h%d"%self.level) - for node in element: - self.write_html(node,stream) - self.html.end("h%d"%self.level) - else: - # Put a warning here? - self.html.start("p") - self.html.start("font",size="-1",color="red") - self.html.add("text","[problem: header level='%d']"%self.level) - self.html.end("font") - self.html.start("strong") - for node in element: - self.write_html(node,stream) - self.html.end("strong") - self.html.end("p") - - def write_transition(self,element,stream): - self.html.start("p", # hmm - strictly not legal... - self.html.element("hr")) - - def write_enumerated_list(self,element,stream): - typedict = {"arabic" : "1", - "roman" : "i", - "Roman" : "I", - "alpha" : "a", - "Alpha" : "A"} - try: - enumtype = typedict[element["enumtype"]] - except: - enumtype = "1" - - # Does this match how DOCUTILS nodes work? - if element.hasattr("start"): - self.html.start("ol",type=enumtype,start=element["start"]) - else: - self.html.start("ol",type=enumtype) - for node in element: - self.write_html(node,stream) - self.html.end("ol") - - def write_bullet_list(self,element,stream): - # Hmm - the translation is fairly arbitrary - # - but at least consistent - bulletdict = {"*" : "disc", - "-" : "circle", - "+" : "square"} - try: - bullet = bulletdict[element["bullet"]] - except: - bullet = None - - if bullet: - self.html.start("ul",type=bullet) - else: - self.html.start("ul") - for node in element: - self.write_html(node,stream) - self.html.end("ul") - - def write_definition_list(self,element,stream): - self.html.start("dl") - for node in element: - self.write_html(node,stream) - self.html.end("dl") - - def write_definition_list_item(self,element,stream): - # Nothing special to do for this one - for node in element: - self.write_html(node,stream) - - def write_term(self,element,stream): - self.html.start("dt") - self.html.start("strong") - for node in element: - self.write_html(node,stream) - self.html.add("text"," ") # to separate consecutive parts, - # in option lists - self.html.end("strong") - self.html.end("dt") - - def write_list_item(self,element,stream): - self.html.start("li") - for node in element: - self.write_html(node,stream) - self.html.end("li") - - def write_option_list(self,element,stream): - self.html.start("dl") - for node in element: - self.write_html(node,stream) - self.html.end("dl") - - def write_option_list_item(self,element,stream): - for node in element: - self.write_html(node,stream) - - def write_option(self,element,stream): - self.html.start("dt") - self.html.start("strong") - for node in element: - self.write_html(node,stream) - self.html.add("text"," ") # to separate consecutive parts, - # in option lists - self.html.end("strong") - self.html.end("dt") - - def write_definition(self,element,stream): - self.html.start("dd") - for node in element: - self.write_html(node,stream) - self.html.end("dd") - - def write_short_option(self,element,stream): - self.html.start("samp") - for node in element: - self.write_html(node,stream) - self.html.end("samp") - - def write_long_option(self,element,stream): - self.html.start("samp") - for node in element: - self.write_html(node,stream) - self.html.end("samp") - - def write_vms_option(self,element,stream): - self.html.start("samp") - for node in element: - self.write_html(node,stream) - self.html.end("samp") - - def write_option_argument(self,element,stream): - self.html.start("samp") - for node in element: - self.write_html(node,stream) - self.html.end("samp") - - def write_description(self,element,stream): - self.html.start("dd") - for node in element: - self.write_html(node,stream) - self.html.end("dd") - - def write_field_list(self,element,stream): - """Write out a fieldlist. - """ - # The colour is for debugging purposes only! - self.html.start("table",width="100%",bgcolor="palegreen") - - self.infield = 1 - for node in element: - self.write_html(node,stream) - self.infield = 0 - - self.html.end("table") - - def write_field(self,element,stream): - self.html.start("tr",valign="top",dps="field") - for node in element: - self.write_html(node,stream) - self.html.end("tr") - - def write_field_name(self,element,stream): - self.html.start("td",dps="field_name") - self.html.start("strong") - for node in element: - self.write_html(node,stream) - self.html.end("strong") - self.html.end("td") - - def write_field_body(self,element,stream): - self.infield = 1 - self.paranum = 0 - self.html.start("td",dps="field_body") - for node in element: - self.write_html(node,stream) - self.html.end("td") - self.infield = 0 - - def write_biblio_field(self,element,stream,name): - """Write out a document bibliographic datum. - """ - self.infield = 1 - # The colour is for debugging purposes only! - self.html.start("table",width="100%",bgcolor="palegreen") - self.html.start("tr",valign="top") - self.html.start("td",dps="biblio_field") - self.html.add("strong",name) - - if len(element) != 1: - raise HTMLError,"Found %d children in field %s"%\ - (len(element),name) - - self.write_field_body(element[0],stream) - - self.html.end("td","tr","table") - self.infield = 0 - - def write_subtitle(self,element,stream): - self.write_biblio_field(element,stream,"Subtitle") - - def write_author(self,element,stream): - self.write_biblio_field(element,stream,"Author") - - def write_authors(self,element,stream): - self.write_biblio_field(element,stream,"Authors") - - def write_organization(self,element,stream): - self.write_biblio_field(element,stream,"Organisation") - - def write_organisation(self,element,stream): - self.write_biblio_field(element,stream,"Organisation") - - def write_contact(self,element,stream): - self.write_biblio_field(element,stream,"Contact") - - def write_version(self,element,stream): - self.write_biblio_field(element,stream,"Version") - - def write_status(self,element,stream): - self.write_biblio_field(element,stream,"Status") - - def write_date(self,element,stream): - self.write_biblio_field(element,stream,"Date") - - def write_revision(self,element,stream): - self.write_biblio_field(element,stream,"Revision") - - def write_copyright(self,element,stream): - self.write_biblio_field(element,stream,"Copyright") - - def write_abstract(self,element,stream): - self.write_biblio_field(element,stream,"Abstract") - - def write_reference(self,element,stream): - """Write a link - the "pointer" to a target. - - Doesn't yet handle "indirect" links... - """ - if element.hasattr("refuri"): - name = self.html.escape(element["refuri"]) - self.html.start("a",href=name) - elif element.hasattr("refname"): - # Escape the name to match what we do with titles... - name = "#"+self.html.escape(element["refname"]) - self.html.start("a",href=name) - else: - self.write_unknown(element,stream) - return - for node in element: - self.write_html(node,stream) - self.html.end("a") - if self.visible_links: - self.html.start("font",color="green") - self.html.add("text","<%s>"%name) - self.html.end("font") - - def write_target(self,element,stream): - """Write the target end of a link. - - Ultimately, the user should be able to choose to fold these into - the document (i.e., into the "link" itself). - """ - try: - name = element["name"] - except: - name = "**no target name**" - - ##if not self.in_paragraph: - ## self.html.start("p") - - # Provide some "debugging" information - if self.visible_targets: - self.html.start("font",color="green") - self.html.start("strong") - self.html.start("em") - self.html.add("text",name) - self.html.end("em") - self.html.end("strong") - self.html.end("font") - - self.html.add("a",name=self.html.escape(name)) - - if element.has_key("refuri"): - uri = self.html.escape(element["refuri"]) - self.html.add("text",": ") - self.html.add("a",element["refuri"],href=uri) - - ##if not self.in_paragraph: - ## self.html.end("p") - - def write_footnote(self,element,stream): - """Write out the body of a footnote. - - It's not entirely clear how to do this in HTML, so we'll - just try for something distinctive... - """ - name = auto = index = None - if element.hasattr("name"): - name = element["name"] - if element.hasattr("auto"): - auto = element["auto"] - if element.hasattr("auto-index"): - index = element["auto-index"] - - if auto and index == None: - raise HTMLError,"Footnote auto-numbering has not been done" - - if name and auto: - self.html.start("p") - self.html.add("a",name=self.html.escape(name)) - self.html.add("text"," ") - self.html.add("a",name=`index`) - self.html.end("p") - elif name: - self.html.start("p") - self.html.add("a",name=self.html.escape(name)) - self.html.end("p") - elif auto: - self.html.start("p") - self.html.add("a",name=`index`) - self.html.end("p") - else: - self.write_message(stream,level=2, - text="Footnote doesn't have name" - " or auto attributes") - - self.html.start("table",align="center",width="80%") - self.html.start("tr") - self.html.start("td") - - # Automatically numbered footnotes don't contain an explicit - # <label> element, so we have to do it by hand... - if auto: - self.write_label(element,stream,index) - - for node in element: - self.write_html(node,stream) - - self.html.end("td","tr","table") - - def write_label(self,element,stream,index=None): - """Write out the label for a footnote. - """ - self.html.add("p", - self.html.element("hr")) - - self.html.start("p","Footnote ") - if index == None: - self.html.add("strong",element.astext()) - else: - self.html.add("strong",`index`) - self.html.end("p") - self.html.add("br") - self.html.add("hr") - - def write_footnote_reference(self,element,stream): - """Write out the link to a footnote. - """ - name = auto = None - if element.hasattr("refname"): - name = element["refname"] - if element.hasattr("auto"): - auto = element["auto"] - - if auto: - if name: - if self.auto_footnote_names.has_key(name): - number = self.auto_footnote_names[name] - else: - self.write_message(stream,level=2, - text="Autonumber footnote name" - " '%s' doesn't match a" - " footnote"%name) - number = 0 - else: - try: - number = self.auto_footnote_list[self.auto_footnote_index] - self.auto_footnote_index += 1 - except IndexError: - # Hmm - probably a [#]_ with no footnotes for it to - # point to - best we can do is write *something* out - self.html.start("font",color=self.colours["Error"]) - self.html.add("text","[") - self.html.add("strong","#") - self.html.add("text","]") - self.html.end("font") - return - - if auto: - self.html.start("a",href="#%d"%number) - self.html.add("text","[") - self.html.add("strong",`number`) - self.html.add("text","]") - self.html.end("a") - elif name: - self.html.start("a",href="#%s"%self.html.escape(name)) - self.html.add("text","[") - self.html.add("strong",element.astext()) - self.html.add("text","]") - self.html.end("a") - else: - self.write_unknown(element,stream) - return - - - def write_comment(self,element,stream): - """Write out a comment - """ - # Technically, this may not be enough, as we don't know what - # they might *have* in the comment - but in practice, it's - # likely to do... - self.html.start("comment") - for node in element: - self.write_html(node,stream) - self.html.end("comment") - - def write_paragraph(self,element,stream): - """Write a new paragraph. - - This is a method simply because I do odd things inside - a field body, to make it "look" better. - """ - if self.html.last_tag() not in ["li","dd","td","th"]: - self.html.start("p") - write_slash_p = 1 - else: - write_slash_p = 0 - - for node in element: - self.write_html(node,stream) - - if write_slash_p: - self.html.end("p") - return - - - self.in_paragraph = 1 - if self.infield: - self.write_field_paragraph(element,stream) - else: - self.html.start("p") - for node in element: - self.write_html(node,stream) - self.html.end("p") - self.in_paragraph = 0 - - def write_field_paragraph(self,element,stream): - """Write a new paragraph inside a field body. - """ - started_row = 0 - if self.paranum > 0: - self.html.start("tr") - self.html.add("td") # an empty column... - self.html.start("td",dps="paragraph") - started_row = 1 - self.paranum += 1 - for node in element: - self.write_html(node,stream) - if self.paranum > 1: - self.html.end("td") - if started_row: - self.html.end("tr") - - def write_table(self,element,stream): - """Write out a table - initially in a very visible manner - """ - self.html.start("table",border="1",align="center") - for node in element: - self.write_html(node,stream) - self.html.end("table") - - def write_tgroup(self,element,stream): - for node in element: - self.write_html(node,stream) - - def write_colspec(self,element,stream): - for node in element: - self.write_html(node,stream) - - def write_rowspec(self,element,stream): - for node in element: - self.write_html(node,stream) - - def write_thead(self,element,stream): - """Write out a table header section - """ - self.html.start("thead") - self.in_table_header = 1 - for node in element: - self.write_html(node,stream) - self.in_table_header = 0 - self.html.end("thead") - - def write_tbody(self,element,stream): - """Write out a table body section - """ - self.html.start("tbody") - self.in_table_body = 1 - for node in element: - self.write_html(node,stream) - self.in_table_body = 0 - self.html.end("tbody") - - def write_row(self,element,stream): - """Write out a table row. - """ - if self.in_table_header: - self.html.start("tr",valign="top",align="left") - else: - self.html.start("tr",valign="top") - for node in element: - self.write_html(node,stream) - self.html.end("tr") - - def write_entry(self,element,stream): - """Write out the equivalent of a table "entry" (e.g., HTML <td>) - """ - keywords = {} - if element.hasattr("morecols"): - keywords["colspan"] = element["morecols"]+1 - if element.hasattr("morerows"): - keywords["rowspan"] = element["morerows"]+1 - keywords["dps"] = "entry" - self.html.start("td",**keywords) - - if self.in_table_header: - self.html.start("strong") - - if len(element) == 0: - # Since we're writing a table with a border, it looks better if - # even an empty entry has *some* content - a non-breaking space - # will suffice to make sure the entry is properly bordered - self.html.add("text"," ") - else: - for node in element: - self.write_html(node,stream) - - if self.in_table_header: - self.html.end("strong") - - self.html.end("td") - - def write_message(self,stream,level=2,text=None,element=None): - names = {1: "Information", - 2: "Warning", - 3: "Error", - 4: "Fatal"} - - if level == 0 and not self.showinforms: - return - elif level == 1 and not self.showwarnings: - return - - try: - name = names[level] - colour = self.colours[name] - except: - name = "Unrecognised warning level %d"%level - colour = self.colours["Fatal"] - bgcolour = self.colours["WarningBG"] - - self.html.start("table",width="100%%",bgcolor=bgcolour) - self.html.start("tr") - self.html.start("td") - self.html.start("font",color=colour) - self.html.add("strong",name) - self.html.end("font") - self.html.end("td","tr") - - self.html.start("tr") - self.html.start("td") - if text: - self.html.add("text",text) - if element: - for node in element: - self.write_html(node,stream) - self.html.end("td","tr") - self.html.end("table") - - def write_problematic(self,element,stream): - self.html.start("a",href="#%s"%element["refid"]) - self.html.start("font",color="red") - for node in element: - self.write_html(node,stream) - self.html.end("font") - self.html.end("a") - - def write_system_message(self,element,stream): - try: - target = element["refid"] - except: - target = None - if target: - self.html.add("a","",name="%s"%target) - self.write_message(stream,level=element["level"],element=element) - - def write_group(self,element,stream): - """By default, we don't do anything with <group> tags. - """ - for node in element: - self.write_html(node,stream) - - def write_emphasis(self,element,stream): - self.html.start("em") - for node in element: - self.write_html(node,stream) - self.html.end("em") - - def write_strong(self,element,stream): - self.html.start("strong") - for node in element: - self.write_html(node,stream) - self.html.end("strong") - - def write_interpreted(self,element,stream): - if element.hasattr("refname"): - self.html.start("a",href="#"+self.html.escape(element["refname"])) - inref = 1 - else: - inref = 0 - - self.html.start("samp",style="interpreted") - if element.hasattr("role"): - role = element["role"] - if self.role_text.has_key(role): - self.html.add("text","%s "%self.role_text[role]) - - for node in element: - self.write_html(node,stream) - self.html.end("samp") - - if inref: - self.html.end("a") - if self.visible_links: - self.html.start("font",color="green") - self.html.add("text","<%s>"%element["refname"]) - self.html.end("font") - - def write_literal(self,element,stream): - self.html.start("samp",style="literal") - for node in element: - self.write_html(node,stream) - self.html.end("samp") - - def write_literal_block(self,element,stream): - self.html.start("pre") - for node in element: - self.write_html(node,stream) - self.html.end("pre") - - def write_doctest_block(self,element,stream): - self.html.start("pre",style="doctest") - for node in element: - self.write_html(node,stream) - self.html.end("pre") - - def write_block_quote(self,element,stream): - self.html.start("blockquote") - for node in element: - self.write_html(node,stream) - self.html.end("blockquote") - - -# ---------------------------------------------------------------------- -class PythonWriter(Writer): - """A Writer that understands how Python is represented using DOCUTILS. - - Note that as a princple, I don't believe that "modes" should add extra - DOCUTILS nodes - in other words, any DOCUTILS tree should be presentable by - the default writer (albeit maybe not very well). - """ - - python_colours = {"package" : "Aqua", - "module" : "#FFFF00", - "class" : "#99CCFF", # Python blue - "method" : "#AAFFAA", - "function" : "#FFAAFF", - "docstring" : "#FFFFCC", # pale yellow-ish - "generator" : "pink", - } - - def write_group(self,element,stream): - """Write out a group according to its style. - """ - - try: - style = element["style"] - except: - style = None - - if style == "docstring": - self.write_docstring(element,stream) - elif style == "generator": - self.html.start("table",bgcolor=self.python_colours["generator"], - width="100%") - self.html.start("tr") - self.html.start("td") - - for node in element: - self.write_html(node,stream) - - self.html.end("td") - self.html.end("tr") - self.html.end("table") - else: - for node in element: - self.write_html(node,stream) - - def write_docstring(self,element,stream): - """Write out a docstring - """ - - self.html.start("table",bgcolor=self.python_colours["docstring"], - width="100%") - self.html.start("tr") - self.html.start("td") - - # Within a docstring, we want traditional HTML headers, - # starting at <h2> and working downwards - self.level = 1 - - for node in element: - self.write_html(node,stream) - - self.html.end("td") - self.html.end("tr") - self.html.end("table") - - def write_section(self,element,stream): - """Write a section - i.e., something with a title - """ - - try: - style = element["style"] - except: - style = None - - if style in ["package","module","class","method","function"]: - self.write_py_section(element,stream,style) - else: - Writer.write_section(self,element,stream) - - def write_py_section(self,element,stream,style): - """Write out the HTML for a Python section. - """ - - self.level += 1 - - try: - colour = self.python_colours[style] - except: - colour = self.colours["default"] - - self.html.start("table",width="100%",cellspacing="0") - - # First row - full width, coloured - self.html.start("tr",bgcolor=colour) - self.html.add("td",self.html.element("hr"),colspan="2") - self.html.end("tr") - - # Now, if the section has a <title> and a <group> with - # style="details", we want to treat them specially - and - # we *know* that they should, if present, be the first - # two child elements... - # Optional first-and-a-halfth row - offset = self.write_py_section_details(element,stream,colour) - - if len(element.children) > offset: - # Second row - left hand margin coloured, "body" not - self.html.start("tr") - self.html.add("td"," ",width="1%",bgcolor=colour) - self.html.start("td",width="99%") - - # More detail needed here? - for node in element.children[offset:]: - self.write_html(node,stream) - - self.html.end("td") - self.html.end("tr") - - # Third row - full width coloured - self.html.start("tr",bgcolor=colour) - self.html.add("td",self.html.element("hr"),colspan="2") - self.html.end("tr") - - if self.got_contents: - # Fourth row - full width coloured - self.html.start("tr",bgcolor=colour) - self.html.add("td"," ") - self.html.start("td",align="right") - self.html.add("text","Return to ") - self.html.add("a","Contents",href="#contents") - self.html.end("td") - self.html.end("tr") - - self.html.end("table") - - self.level -= 1 - - def write_py_section_details(self,element,stream,colour): - """Deal with the title and details for a Python section. - - Returns the offset within the <section> elements children - at which we should continue processing... - """ - offset = 0 - if element[0].tagname == "title": - offset = 1 - self.html.start("tr",bgcolor=colour) - self.html.start("td",colspan="2") - self.html.start("table",width="100%") - self.html.start("tr",valign="top") - self.html.start("td") - # Hmm. It doesn't work too well using <h2>..<h6> as header - # elements for nested module, class, etc. Let's do this - # by "hand" - self.html.start("font",size="+2") - for node in element[0]: - self.write_html(node,stream) - self.html.end("font") - self.html.end("td") - self.html.end("tr") - - if element[1].tagname == "group" and \ - element[1].hasattr("style") and \ - element[1]["style"] == "details": - offset = 2 - self.html.start("tr") - self.html.start("td",align="right") - self.write_html(element[1],stream) - self.html.end("td") - self.html.end("tr") - self.html.end("table") - self.html.end("td") - self.html.end("tr") - return offset diff --git a/sandbox/tibs/pysource/notes/notes.py b/sandbox/tibs/pysource/notes/notes.py deleted file mode 100755 index a7fd81f51..000000000 --- a/sandbox/tibs/pysource/notes/notes.py +++ /dev/null @@ -1,115 +0,0 @@ -"""Notes (i.e., me working things out...) - -Given the following Python:: - - def func(a,b=1,c='jim',d=None,e=[],f={'a':1},g=(1,2,3)): - -the tree produced by compiler looks like:: - - <Function> 'func' 'a' 'b' 'c' 'd' 'e' 'f' 'g' - <Const> 1 - <Const> 'jim' - <Name> 'None' - <List> - <Dict> - <Const> 'a' - <Const> 1 - <Tuple> - <Const> 1 - <Const> 2 - <Const> 3 0 - -If one has:: - - def func2(a,*args,**kargs): - -one gets:: - - <Function> 'func2' 'a' 'args' 'kargs' 3 None - -and lastly:: - - def func3((a,b,c),d): - -gives:: - - <Function> 'func3' 'a' 'b' 'c' 'd' 0 None - - -`compiler.misc` defines `flatten(tup)` - maybe I should try it? - -""" - - -# compiler.transformer contains this useful set of comments: -# -# -# The output tree has the following nodes: -# -# Source Python line #'s appear at the end of each of all of these nodes -# If a line # doesn't apply, there will be a None instead. -# -# module: doc, node -# stmt: [ node1, ..., nodeN ] -# function: name, argnames, defaults, flags, doc, codeNode -# lambda: argnames, defaults, flags, codeNode -# classdef: name, bases, doc, codeNode -# pass: -# break: -# continue: -# for: assignNode, listNode, bodyNode, elseNode -# while: testNode, bodyNode, elseNode -# if: [ (testNode, suiteNode), ... ], elseNode -# exec: expr1Node, expr2Node, expr3Node -# from: modname, [ name1, ..., nameN ] -# import: [ name1, ..., nameN ] -# raise: expr1Node, expr2Node, expr3Node -# tryfinally: trySuiteNode, finSuiteNode -# tryexcept: trySuiteNode, [ (exprNode, assgnNode, suiteNode), ... ], elseNode -# return: valueNode -# const: value -# print: [ node1, ..., nodeN ] [, dest] -# printnl: [ node1, ..., nodeN ] [, dest] -# discard: exprNode -# augassign: node, op, expr -# assign: [ node1, ..., nodeN ], exprNode -# ass_tuple: [ node1, ..., nodeN ] -# ass_list: [ node1, ..., nodeN ] -# ass_name: name, flags -# ass_attr: exprNode, attrname, flags -# list: [ node1, ..., nodeN ] -# dict: [ (key1, val1), ..., (keyN, valN) ] -# not: exprNode -# compare: exprNode, [ (op, node), ..., (op, node) ] -# name: name -# global: [ name1, ..., nameN ] -# backquote: node -# getattr: exprNode, attrname -# call_func: node, [ arg1, ..., argN ] -# keyword: name, exprNode -# subscript: exprNode, flags, [ sub1, ..., subN ] -# ellipsis: -# sliceobj: [ node1, ..., nodeN ] -# slice: exprNode, flags, lowerNode, upperNode -# assert: expr1, expr2 -# -# Compiled as "binary" ops: -# tuple: [ node1, ..., nodeN ] -# or: [ node1, ..., nodeN ] -# and: [ node1, ..., nodeN ] -# bitor: [ node1, ..., nodeN ] -# bitxor: [ node1, ..., nodeN ] -# bitand: [ node1, ..., nodeN ] -# -# Operations easily evaluateable on constants: -# <<: exprNode, shiftNode -# >>: exprNode, shiftNode -# +: leftNode, rightNode -# -: leftNode, rightNode -# *: leftNode, rightNode -# /: leftNode, rightNode -# %: leftNode, rightNode -# power: leftNode, rightNode -# unary+: node -# unary-: node -# invert: node diff --git a/sandbox/tibs/pysource/notes/notes.txt b/sandbox/tibs/pysource/notes/notes.txt deleted file mode 100644 index 548d792a1..000000000 --- a/sandbox/tibs/pysource/notes/notes.txt +++ /dev/null @@ -1,7 +0,0 @@ -Paul Moore's summary of backquoted markup possibilities:: - - `xxxxx`_ - named hyperlink reference (type 2) - `xxxxx`__ - anonymous hyperlink reference (type 2) - _`xxxx` - inline hyperlink targets - `/xxx/` - substitution reference - `xxxxx` - interpreted text diff --git a/sandbox/tibs/pysource/notes/roles.txt b/sandbox/tibs/pysource/notes/roles.txt deleted file mode 100644 index b063e026d..000000000 --- a/sandbox/tibs/pysource/notes/roles.txt +++ /dev/null @@ -1,61 +0,0 @@ -The following is taken from the DPS document pysource-reader.txt:: - - Interpreted Text - ================ - - DTD elements: package, module, class, method, function, - module_attribute, class_attribute, instance_attribute, variable, - parameter, type, exception_class, warning_class. - - In Python docstrings, interpreted text is used to classify and mark up - program identifiers, such as the names of variables, functions, - classes, and modules. If the identifier alone is given, its role is - inferred implicitly according to the Python namespace lookup rules. - For functions and methods (even when dynamically assigned), - parentheses ('()') may be included:: - - This function uses `another()` to do its work. - - For class, instance and module attributes, dotted identifiers are used - when necessary:: - - class Keeper(Storer): - - """ - Extend `Storer`. Class attribute `instances` keeps track of - the number of `Keeper` objects instantiated. - """ - - instances = 0 - """How many `Keeper` objects are there?""" - - def __init__(self): - """ - Extend `Storer.__init__()` to keep track of instances. - - Keep count in `self.instances` and data in `self.data`. - """ - Storer.__init__(self) - self.instances += 1 - - self.data = [] - """Store data in a list, most recent last.""" - - def storedata(self, data): - """ - Extend `Storer.storedata()`; append new `data` to a list - (in `self.data`). - """ - self.data = data - - To classify identifiers explicitly, the role is given along with the - identifier in either prefix or suffix form:: - - Use :method:`Keeper.storedata` to store the object's data in - `Keeper.data`:instance_attribute:. - - The role may be one of 'package', 'module', 'class', 'method', - 'function', 'module_attribute', 'class_attribute', - 'instance_attribute', 'variable', 'parameter', 'type', - 'exception_class', 'exception', 'warning_class', or 'warning'. Other - roles may be defined. diff --git a/sandbox/tibs/pysource/notes/scope.txt b/sandbox/tibs/pysource/notes/scope.txt deleted file mode 100644 index 1ad889c1b..000000000 --- a/sandbox/tibs/pysource/notes/scope.txt +++ /dev/null @@ -1,19 +0,0 @@ -On finding names -================ - -We are not trying for a general solution to the problem of "find the item -that is being referred to" - we are just trying to provide useful links -between <interpreted> items in docstrings and those things that they -might reasonably be expected to be referring to. - -Some rules thus occur. - -1. We will not show attributes, docstring or not, if they are not - - a. At module level (so a ModuleValue) - b. Within a class (so a ClassValue) - c. Within a method called __init__ or __new__. - - So discard any attributes that do not match these criteria. - -Hmm - is that the only rule? Can it be so simple? diff --git a/sandbox/tibs/pysource/notes/string.html b/sandbox/tibs/pysource/notes/string.html deleted file mode 100755 index e09c30e2b..000000000 --- a/sandbox/tibs/pysource/notes/string.html +++ /dev/null @@ -1,225 +0,0 @@ - -<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"> -<html><head><title>Python: module string - - - - -
     
     
    string
    index
    c:\python21\lib\string.py
    -

    A collection of string operations (most are no longer used in Python 1.6).

    -Warning: most of the code you see here isn't normally used nowadays.  With
    -Python 1.6, many of these functions are implemented as methods on the
    -standard string object. They used to be implemented by a built-in module
    -called strop, but strop is now obsolete itself.

    -Public module variables:

    -whitespace -- a string containing all characters considered whitespace
    -lowercase -- a string containing all characters considered lowercase letters
    -uppercase -- a string containing all characters considered uppercase letters
    -letters -- a string containing all characters considered letters
    -digits -- a string containing all characters considered decimal digits
    -hexdigits -- a string containing all characters considered hexadecimal digits
    -octdigits -- a string containing all characters considered octal digits
    -punctuation -- a string containing all characters considered punctuation
    -printable -- a string containing all characters considered printable

    - -

    - - - - -
     
    Functions
                
    _float = float(...)
    float(x) -> floating point number

    -Convert a string or number to a floating point number, if possible.
    -
    _int = int(...)
    int(x[, base]) -> integer

    -Convert a string or number to an integer, if possible.  A floating point
    -argument will be truncated towards zero (this does not include a string
    -representation of a floating point number!)  When converting a string, use
    -the optional base.  It is an error to supply a base when converting a
    -non-string.
    -
    _long = long(...)
    long(x) -> long integer
    -long(x, base) -> long integer

    -Convert a string or number to a long integer, if possible.  A floating
    -point argument will be truncated towards zero (this does not include a
    -string representation of a floating point number!)  When converting a
    -string, use the given base.  It is an error to supply a base when
    -converting a non-string.
    -
    atof(s)
    atof(s) -> float

    -Return the floating point number represented by the string s.
    -
    atoi(s, base=10)
    atoi(s [,base]) -> int

    -Return the integer represented by the string s in the given
    -base, which defaults to 10.  The string s must consist of one
    -or more digits, possibly preceded by a sign.  If base is 0, it
    -is chosen from the leading characters of s, 0 for octal, 0x or
    -0X for hexadecimal.  If base is 16, a preceding 0x or 0X is
    -accepted.
    -
    atol(s, base=10)
    atol(s [,base]) -> long

    -Return the long integer represented by the string s in the
    -given base, which defaults to 10.  The string s must consist
    -of one or more digits, possibly preceded by a sign.  If base
    -is 0, it is chosen from the leading characters of s, 0 for
    -octal, 0x or 0X for hexadecimal.  If base is 16, a preceding
    -0x or 0X is accepted.  A trailing L or l is not accepted,
    -unless base is 0.
    -
    capitalize(s)
    capitalize(s) -> string

    -Return a copy of the string s with only its first character
    -capitalized.
    -
    capwords(s, sep=None)
    capwords(s, [sep]) -> string

    -Split the argument into words using split, capitalize each
    -word using capitalize, and join the capitalized words using
    -join. Note that this replaces runs of whitespace characters by
    -a single space.
    -
    center(s, width)
    center(s, width) -> string

    -Return a center version of s, in a field of the specified
    -width. padded with spaces as needed.  The string is never
    -truncated.
    -
    count(s, *args)
    count(s, sub[, start[,end]]) -> int

    -Return the number of occurrences of substring sub in string
    -s[start:end].  Optional arguments start and end are
    -interpreted as in slice notation.
    -
    expandtabs(s, tabsize=8)
    expandtabs(s [,tabsize]) -> string

    -Return a copy of the string s with all tab characters replaced
    -by the appropriate number of spaces, depending on the current
    -column, and the tabsize (default 8).
    -
    find(s, *args)
    find(s, sub [,start [,end]]) -> in

    -Return the lowest index in s where substring sub is found,
    -such that sub is contained within s[start,end].  Optional
    -arguments start and end are interpreted as in slice notation.

    -Return -1 on failure.
    -
    index(s, *args)
    index(s, sub [,start [,end]]) -> int

    -Like find but raises ValueError when the substring is not found.
    -
    join(words, sep=' ')
    join(list [,sep]) -> string

    -Return a string composed of the words in list, with
    -intervening occurrences of sep.  The default separator is a
    -single space.

    -(joinfields and join are synonymous)
    -
    joinfields = join(words, sep=' ')
    join(list [,sep]) -> string

    -Return a string composed of the words in list, with
    -intervening occurrences of sep.  The default separator is a
    -single space.

    -(joinfields and join are synonymous)
    -
    ljust(s, width)
    ljust(s, width) -> string

    -Return a left-justified version of s, in a field of the
    -specified width, padded with spaces as needed.  The string is
    -never truncated.
    -
    lower(s)
    lower(s) -> string

    -Return a copy of the string s converted to lowercase.
    -
    lstrip(s)
    lstrip(s) -> string

    -Return a copy of the string s with leading whitespace removed.
    -
    maketrans(...)
    maketrans(frm, to) -> string

    -Return a translation table (a string of 256 bytes long)
    -suitable for use in string.translate.  The strings frm and to
    -must be of the same length.
    -
    replace(s, old, new, maxsplit=-1)
    replace (str, old, new[, maxsplit]) -> string

    -Return a copy of string str with all occurrences of substring
    -old replaced by new. If the optional argument maxsplit is
    -given, only the first maxsplit occurrences are replaced.
    -
    rfind(s, *args)
    rfind(s, sub [,start [,end]]) -> int

    -Return the highest index in s where substring sub is found,
    -such that sub is contained within s[start,end].  Optional
    -arguments start and end are interpreted as in slice notation.

    -Return -1 on failure.
    -
    rindex(s, *args)
    rindex(s, sub [,start [,end]]) -> int

    -Like rfind but raises ValueError when the substring is not found.
    -
    rjust(s, width)
    rjust(s, width) -> string

    -Return a right-justified version of s, in a field of the
    -specified width, padded with spaces as needed.  The string is
    -never truncated.
    -
    rstrip(s)
    rstrip(s) -> string

    -Return a copy of the string s with trailing whitespace
    -removed.
    -
    split(s, sep=None, maxsplit=-1)
    split(s [,sep [,maxsplit]]) -> list of strings

    -Return a list of the words in the string s, using sep as the
    -delimiter string.  If maxsplit is given, splits into at most
    -maxsplit words.  If sep is not specified, any whitespace string
    -is a separator.

    -(split and splitfields are synonymous)
    -
    splitfields = split(s, sep=None, maxsplit=-1)
    split(s [,sep [,maxsplit]]) -> list of strings

    -Return a list of the words in the string s, using sep as the
    -delimiter string.  If maxsplit is given, splits into at most
    -maxsplit words.  If sep is not specified, any whitespace string
    -is a separator.

    -(split and splitfields are synonymous)
    -
    strip(s)
    strip(s) -> string

    -Return a copy of the string s with leading and trailing
    -whitespace removed.
    -
    swapcase(s)
    swapcase(s) -> string

    -Return a copy of the string s with upper case characters
    -converted to lowercase and vice versa.
    -
    translate(s, table, deletions='')
    translate(s,table [,deletions]) -> string

    -Return a copy of the string s, where all characters occurring
    -in the optional argument deletions are removed, and the
    -remaining characters have been mapped through the given
    -translation table, which must be a string of length 256.  The
    -deletions argument is not allowed for Unicode strings.
    -
    upper(s)
    upper(s) -> string

    -Return a copy of the string s converted to uppercase.
    -
    zfill(x, width)
    zfill(x, width) -> string

    -Pad a numeric string x with zeros on the left, to fill a field
    -of the specified width.  The string x is never truncated.
    -
    -

    - - - - -
     
    Data
                _StringType = <type 'string'>
    -__file__ = r'c:\Python21\Lib\string.pyc'
    -__name__ = 'string'
    -_idmap = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./...\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff'
    -_idmapL = None
    -digits = '0123456789'
    -hexdigits = '0123456789abcdefABCDEF'
    -letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
    -lowercase = 'abcdefghijklmnopqrstuvwxyz'
    -octdigits = '01234567'
    -printable = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c'
    -punctuation = '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'
    -uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    -whitespace = '\t\n\x0b\x0c\r '
    - \ No newline at end of file diff --git a/sandbox/tibs/pysource/notes/thoughts.txt b/sandbox/tibs/pysource/notes/thoughts.txt deleted file mode 100644 index 59691717b..000000000 --- a/sandbox/tibs/pysource/notes/thoughts.txt +++ /dev/null @@ -1,170 +0,0 @@ -Thoughts on pysource -==================== - -:Author: Tibs -:Date: 19 Sep 2002 - -.. - - [This is the contents of an email sent from Tibs to me, to tie up - -- or at least identify -- loose ends. When Tibs writes "you", - he's referring to me. It is published with Tibs' permission. I - mostly agree with what Tibs has written. I've added my own notes, - indented in square brackets, like this one. - - --David Goodger] - -Well, having looked back at the pysource sources, I'm confirmed -in my opinion that, if I were to start work on the project again, -I would probably start a new version of pysource from scratch, -using what I have learned (essentially, the content of visit.py), -and taking advantage of all the new technology that is in the -modern DOCUTILS. - -Thus I would (at least): - -1. produce a "frontend" using Optik -2. rewrite visit.py more neatly -3. construct DOCUTILS nodes to match pysource.dtd -4. *possibly* meld those into the classes in visit.py - (but possibly not - some of the stuff in visit.py - seems to me to be, of necessity, a bit messy as it - is constructing stuff, and thus it may be premature - to "DOCUTILS" it before it is necessary). -5. produce an example transform to amend the Python - specific DOCUTILS tree into a generic DOCUTILS - tree. - -That's a fair amount of work, and I'm not convinced that I can -find the sustained effort [1]_, especially if you might be -willing to take the task on (and if I would have been refactoring -anyway, a whole different head may be a significant benefit). - -.. [1] I believe that's called "British understatement". - -Some comments on pysource.txt and pysource.dtd ----------------------------------------------- - -I believe that a node is a Good Thing. It's a natural -construct (if one believes that the other nodes are good things -as well!), and it allows the "transform" of the Python specific -tree to be done more sensibly. - - [I think I finally understand what Tibs is getting at here. I - thought he meant to have a node in an otherwise - standard Docutils doctree, which just contained the raw docstring. - Instead, I believe he means that the Python-specific Docutils - doctree elements like and - (see pysource.dtd), should each have a - element which contains ``%structure.model;``, instead of the - current ``%structure.model;`` directly inside the element. In - other words, a element would be a simple container for - all the parsed elements of the docstring. On second thought, each - Python-specific section element would still have to have - ``%structure.model;``, in order to contain subsections. A - would contain s, which would - contain s, and so on. - - So a element may be useful as a convenience to - transforms. It would be a trivial change anyhow. - - The initial (internal) data structure resulting from the parsing - of Python modules & packages is a completely different beast. It - should contain nodes, along with , , - , etc., nodes. But these should *not* be subclasses of - docutils.nodes.Node, and this tree should not be a "Docutils - document tree". It should be a separate, parallel structure. - Document tree nodes (docutils.nodes.Node objects) are not suited - for this work. - - --DG] - -I recommend some initial "surgery" on the initial parse tree to -make finding the docstrings for nodes easier. - -I reckon that one produces a Python-specific doctree, and then -chooses one of several transforms to produce generic doctrees. - -By the way, I still vote for "static" introspection - that is, -without actually importing the module. It does limit what one can -do in some respects, but there are modules one might want to -document that one does not wish to import (and indeed, at work we -have some Python files that essentially cannot be introspected in -this manner with any ease - they are "designed" to be imported by -other modules after ``sys.path`` has been mangled suitably, and -just don't work stand-alone). - -I've tried to expand out the ideas you had on how the "pysource" -tool should work below. - - although it occurs to me that this is all terribly obvious, - really. Oh well... - -The pysource tool ------------------ - -The "input mode" should be the "Python Source Reader". - - You can see where I'm starting from in pysource.txt. - -This produces, as its output, a Python-specific doctree, -containing extra nodes as defined in pysource.dtd (etc.). - -One of the tasks undertaken by the Python Source Reader is to -decide what to do with docstrings. For each Python file, it -discovers (from ``__docformat__``) if the input parser is -"reStructuredText". If it is, then the contents of each docstring -in that file will be parsed as such, including sorting out -interpreted text (i.e., rendering it into links across the tree). -If it is not, then each docstring will be treated as a literal -block. - - This admits the posibility of adding other parsers *for - docstrings* at a later date - which I suspect is how HappyDoc - does it. It is just necessary to publicise the API for the - Docstring class, and then someone else can provide alternate - plugins. - -The output of the Python Source Reader is thus a Python-specific -doctree, with all docstrings fully processed (as appropriate), -and held inside elements. - -The next stage is handled by the Layout Transformer. - - [What I call "stylist transforms". --DG] - -This determines the layout of the document to be produced - the -*kind* or *style* of output that the user wants (e.g., PyDoc -style, LibRefMan style, generic docutils style, etc.). - -Each layout is represented by a class that walks the -Python-specific doctree, replacing the Python-specific nodes with -appropriate generic nodes. The output of the Layout Transformer -is thus a generic doctree. - -The final stage is thus a normal DOCUTILS Writer - since it is -taking input that is a generic doctree, this makes perfect -sense. This also means that we get maximum leverage from existing -Writers, which is essential (not just a Good Thing). - -As you point out, some layouts will probably only be appropriate -for some output formats. Well, that's OK. On the other hand, if -the output of the Layout stage *is* a generic doctree, we're not -likely to get fatal errors by putting it through the wrong -Writer, so we needn't worry too much. - -Thus one might envisage a command line something like:: - - pysource --layout:book --format:html this_module - -Of course, other command line switches would be options for -particular phases (e.g., to use frames or not for HTML output). I -can see wanting a series of configuration files that one could -reference, to save specifying lots of switches. - -One specific thing to be decided, particularly for HTML, is -whether one is outputting a "cluster" of files (e.g., as javadoc -does). I reckon this can be left for later on, though (as can -such issues as saying "other interesting sources are *over -there*, so reference them if you can" - e.g., the Python -library). diff --git a/sandbox/tibs/pysource/pysource.py b/sandbox/tibs/pysource/pysource.py deleted file mode 100755 index a62c96ebb..000000000 --- a/sandbox/tibs/pysource/pysource.py +++ /dev/null @@ -1,262 +0,0 @@ -#! /usr/bin/env python -"""A simple command line interface for the pysource package - -This will become more interesting later on... -""" - -import os -import sys -import getopt - -import docutils.nodes -import docutils.utils - -# Local modules -import utils -import visit -import html - -import transform - -__docformat__ = "reST" - - -# ---------------------------------------------------------------------- -def rest_document(filename): - """Return an reST document. - """ - - from docutils.parsers.rst import Parser - - file = open(filename) - try: - text = file.read() - finally: - file.close() - - parser = Parser() - docroot = docutils.utils.new_document() - parser.parse(text,docroot) - return docroot - - -# ---------------------------------------------------------------------- -# I don't much like the Unix command line style (I always thought the -# VMS approach was much more flexible and sensible), but it *does* seem -# to be what people expect these days... - -options = [ - # long option, short, description - ("verbose", "v", "Report on progress in more detail"), - ("quiet", "q", "Suppress normal progress messages"), - ("text", "t", "The input file is a plain (text) reST file"), - ("show", "s", "Output basic information about the input"), - ("ast", "a", "Output a representation of the AST"), - ("xml", "x", "Output an XML representation of the input"), - ("html", "h", "Output an HTML representation of the input [default]"), - ("pretty", "p", "Output a 'pretty' representation of the input"), - ("doctest", "d", "Treat a reST file as doctest input."), - ("help", "h", "Show 'help' information"), - ("new", "n", "Use David Goodger's HTML Writer (sort of)"), - ("stdout", "", "Write output to stdout, instead of a file"), - ] - -def print_usage(): - docstring = visit.Docstring(main.__doc__) - docstring.show(sys.stdout) - print - print " are:" - print - for longopt, shortopt, description in options: - if shortopt: - print " -%s, --%-9s %s"%(shortopt,longopt,description) - else: - print " --%-9s %s"%(longopt,description) - -def main(): - """The command line interface to docutil's Python documentation extractor. - - Usage: ``pysource.py []`` - - is the path to a package or module. - - is the path to the output file. If it's not given, then - output will be written to a file with the same name as the input - file, but defaulting to the current directory, and with extension - derived from the type of output: - - - show -> ``.show`` - - ast -> ``.ast`` - - xml -> ``.xml`` - - html -> ``.html`` - - pretty -> ``.pretty`` - - (unless --stdout is requested). The default is --html. - - Note that progress messages (and ``verb`` information) are written - to ``sys.stderr``. - """ - - if len(sys.argv) <= 1: - print "Not enough arguments" - print_usage() - return - - shortopts = ''.join([option[1] for option in options]) - longopts = [option[0] for option in options] - try: - opts, args = getopt.getopt(sys.argv[1:], shortopts, longopts) - except getopt.GetoptError,detail: - print "Problem with options:",detail - print_usage() - return - - verbose = 0 - quiet = 0 - input_format = "python" - output_format = "html" - want_docutilstree = 1 - new_writer = 0 - write_stdout = 0 - - for opt, arg in opts: - if opt in ["-?","--help"]: - print_usage() - return - elif opt in ["-n","--new"]: - new_writer = 1 - output_format = "html" - print >>sys.stderr, "Using new HTML Writer" - elif opt in ["-v","--verbose"]: - verbose = 1 - elif opt in ["-q","--quiet"]: - quiet = 1 - elif opt in ["-t","--text"]: - input_format = "text" - elif opt in ["-s","--show"]: - output_format = "show" - want_docutilstree = 0 - elif opt in ["-a","--ast"]: - output_format = "ast" - want_docutilstree = 0 - elif opt in ["-x","--xml"]: - output_format = "xml" - elif opt in ["-h","--html"]: - output_format = "html" - elif opt in ["-d","--doctest"]: - output_format = "doctest" - elif opt in ["-p","--pretty"]: - output_format = "pretty" - elif opt == "--stdout": - write_stdout = 1 - else: - raise getopt.GetoptError, "getopt should have saved us!" - - if len(args) == 0 or len(args) > 2: - print "Please specify an input and an (optional) output" - print_usage() - return - - if input_format == "text" and \ - output_format not in ["xml","html","pretty","doctest"]: - print "--text only supports --xml, --html, --pretty or --doctest" - print_usage() - return - - if input_format == "text" and output_format == "doctest" \ - and len(args) == 2: - print "--doctest does not accept an output file" - # Should it? - print_usage() - return - - if write_stdout and len(args) == 2: - print "It doesn't make sense to specify --stdout and an output file" - print_usage() - return - - filename = args[0] - if len(args) == 2: - if not quiet: - print >>sys.stderr, "... Output will go to",args[1] - outstream = open(args[1],"w") - elif write_stdout: - if not quiet: - print >>sys.stderr, "... Output will go to standard output" - outstream = sys.stdout - else: - head,tail = os.path.split(filename) - base,ext = os.path.splitext(tail) - outname = "%s.%s"%(base,output_format) - if not quiet: - print >>sys.stderr, "... Output will go to",outname - outstream = open(outname,"w") - - try: - if output_format == "doctest": - from doctest import Tester - if not quiet: print >>sys.stderr, "*** Doctesting the document" - t = Tester(globs={},verbose=verbose) - (fail,total) = t.runstring(open(filename).read(),filename) - if not quiet and not verbose: - print >>sys.stderr, "*** ", - if fail: - print "%d of"%fail, - if total == 1: - print "1 example", - else: - print "%d examples"%total, - if fail: - print "failed" - else: - print "passed" - elif input_format == "text": - if not quiet: print >>sys.stderr, "*** Making the document" - document = rest_document(filename) - else: - if os.path.isdir(filename): - print >>sys.stderr, "*** Parsing the Python package",filename - thing = visit.Package(None, filename) - else: - print >>sys.stderr, "*** Parsing the Python file",filename - thing = visit.Module(None, filename) - - if want_docutilstree: - if not quiet: - print >>sys.stderr, "*** Making the document" - with_groups = not new_writer - process = transform.Process(with_groups) - document = process(thing) - - if output_format == "show": - thing.show(outstream) - elif output_format == "ast": - thing.show_ast(outstream) - print - elif output_format == "pretty": - outstream.write(document.pformat(indent=" ")) - elif output_format == "xml": - if not quiet: print >>sys.stderr, "*** Producing a DOM tree" - domtree = document.asdom() - if not quiet: print >>sys.stderr, " Writing XML" - domtree.writexml(outstream,indent="", addindent=" ",newl="\n") - elif output_format == "html": - if not quiet: print >>sys.stderr, "*** Writing HTML" - if new_writer: - from docutils.writers.html4css1 import Writer - writer = Writer() - writer.write(document,outstream) - elif input_format == "text": - writer = html.Writer() - writer(document,outstream) - else: - writer = html.PythonWriter() - writer(document,outstream) - finally: - if outstream != sys.stdout: - outstream.close() - - -# ---------------------------------------------------------------------- -if __name__ == "__main__": - main() diff --git a/sandbox/tibs/pysource/rjhack.py b/sandbox/tibs/pysource/rjhack.py deleted file mode 100755 index 6046312ac..000000000 --- a/sandbox/tibs/pysource/rjhack.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python - -# Author: Richard Jones -# Contact: richard@users.sourceforge.net -# Revision: $Revision$ -# Date: $Date$ -# Copyright: This module has been placed in the public domain. - -""" -A front end to the Docutils Publisher, taking Python source and producing HTML. -""" - -import os, locale -try: - locale.setlocale(locale.LC_ALL, '') -except: - pass - -import visit, transform - -from docutils.parsers.rst import Parser -class SourceParser(Parser): - supported = ('pysource',) - settings_spec = ( - 'PySource Parser Options', - None, - (('Be verbose while parsing', ['--verbose-parse'], - {'action': 'store_true'}), - )) + Parser.settings_spec - def parse(self, filename, document): - if os.path.isdir(filename): - thing = visit.Package(document.settings, filename) - else: - thing = visit.Module(document.settings, filename) - process = transform.Process(with_groups=0, document=document) - process(thing) - -from docutils.readers import Reader -class SourceReader(Reader): - def read(self, source, parser, settings): - self.source = source - if not self.parser: - self.parser = parser - self.settings = settings - # we want the input as the filename, not the file content - self.source.source.close() - self.input = self.source.source_path - self.parse() - return self.document - -from docutils.core import publish_cmdline, default_description -description = ('Generates (X)HTML documents from Python sources. ' - + default_description) -parser = SourceParser() -reader = SourceReader(parser, 'pysource') -publish_cmdline(reader=reader, parser=parser, writer_name='html', - description=description) - diff --git a/sandbox/tibs/pysource/test/readme.txt b/sandbox/tibs/pysource/test/readme.txt deleted file mode 100644 index a6af4576d..000000000 --- a/sandbox/tibs/pysource/test/readme.txt +++ /dev/null @@ -1,27 +0,0 @@ -Files in the ``test`` directory -------------------------------- - -This directory is intended to contain various test file. They are (hopefully) -named in a consistent manner: - -README.txt - This file. - -``*.rtxt`` - Sample reST text files, suitable for checking odd things. - -``*.py`` - Sample Python test files, ditto. - -``*.doctest`` - Files that contain "semiliterate testing" [1]_ -- that is, - descriptive text (written with reST) surrounding doctest blocks. - The idea is that these files should be passed to (for instance) - pydps.py (or whatever it is called at the moment) to be tested by - Tim Peters' doctest - for instance:: - - pydps/pydps.py --text --doctest simple.doctest - - - -.. [1] a semi-lame reference to literate programming, I'm afraid. diff --git a/sandbox/tibs/pysource/test/test.doctest b/sandbox/tibs/pysource/test/test.doctest deleted file mode 100644 index bc91115ad..000000000 --- a/sandbox/tibs/pysource/test/test.doctest +++ /dev/null @@ -1,12 +0,0 @@ -The following is some Python code: - - >>> a = 1 - >>> a - 1 - -and here is some more: - - >>> a + 1 - 3 - -and that's all. diff --git a/sandbox/tibs/pysource/test/test.py b/sandbox/tibs/pysource/test/test.py deleted file mode 100755 index b3e380526..000000000 --- a/sandbox/tibs/pysource/test/test.py +++ /dev/null @@ -1,124 +0,0 @@ -"""A simple test file for input to ast-mining.py. - -But it isn't a "raw" string, so: - - \\*escape* \\`with` "\\\\" -""" - -__docformat__ = "reST" - -import string - -one = 1 - -"""Documentation after `one` (intervening blank line)""" - -two,three = 2,3 -"""Documenatation after ``two,three=2,3``""" - -four,five = two,three - -six = [four,five] -"""Documentation after ``six=[four,five]``""" - -global gmodule -gmodule = 1 -"""Global at the module level""" - -def func(a,b=1,c='jim',d=None,e=[],f={'a':1},g=(1,2,3)): - r"""Function at the module level - - This *is* a "raw" string, so: - - \*escape* \`with` "\\" - """ - - from string import lstrip,rstrip - - a = 3 - - global gfunc - gfunc = 1 - """Global referenced only within `func()`""" - - global one - one = 2 - - class InFunc: - pass - - def infunc(): - """Function defined inside function `func()`""" - global ginner - ginner = 1 - """Global referenced only within `infunc()`""" - - class Silly: - pass - - def silly_fn(): - pass - -def func2(a,*args,**kargs): - pass - -def func3((a,b,c),d): - pass - -class Fred: - """Class at the module level.""" - - a = 1 - """Documentation for class value `a`""" - - global gclass - gclass = 2 - """Global referenced only within `Fred`""" - - def __init__(self): - """Initialisation for `Fred`""" - self.b = 2 - """`self.b` within `Fred.__init__()`""" - - c = 3 - """Local variable within `Fred.__init__()`""" - - global gmeth - gmeth = 3 - """Global referenced only within a method""" - - global gagain - gagain = 3 - - class Insider: - """Class defined inside `Fred.__init__()`""" - - a = 'jim' - """Local name within class inside `Fred.__init__()`""" - - global gclass2 - gclass2 = 4 - """Global referenced only within a class within a method""" - - global gunused - global gagain - - def fred(self): - global gunused2,gfunc2 - gfunc2 = 5 - """Global referenced only within a method in a - class in a method - """ - - def fredinner(): - global ginner2 - global gagain - ginner2 = 6 - gagain = 6 - - infredinner = 7 - -class Jim(Fred): - pass - - diff --git a/sandbox/tibs/pysource/test/test.rtxt b/sandbox/tibs/pysource/test/test.rtxt deleted file mode 100644 index f28a3d4e2..000000000 --- a/sandbox/tibs/pysource/test/test.rtxt +++ /dev/null @@ -1,442 +0,0 @@ -pydps test document -=================== - -:Author: Tibs -:Version: 0.1 -:Eggs: Green -:Ham: Green - -This is intended to be a simple test document, with "something of everything". -It is *not* intended to trawl for *problems*, but just to check I've got the -writing out of just about everything supported in the HTML writer. - - :Author: Tibs - :Version: 0.1 - :Eggs: Green - :Ham: Green - :Parameter i: integer - -Lists ------ -1. A list -2. Some more -3. - - * What's this? - - and this? - + and this? - -i. And this is Roman - -a. And this is alpha - -A. And so is this - -I. What is this? - -.. Just a comment, honest. - That's all. - -A title - and some text. -And another - and more text. - -Short options: - --a option a - --b file option b - --cname option c - -Long options: - ---aaaa option aaaa ---bbbb=file option bbbb ---cccc name option cccc ---d-e-f-g option d-e-f-g ---h_i_j_k option h_i_j_k - -VMS/DOS-style options: - -/A option A -/B file option B -/Cstring option C - -Mixed short, long, and VMS/DOS options: - --a option a ---bbbb=file option bbbb -/C option C ---dddd name option dddd --e string option e -/F file option F - -Aliased options: - --a, --aaaa, /A option a, aaaa, A --b file, --bbbb=file, /B file option b, bbbb, B - -Multiple lines in descriptions, aligned: - --a option a, line 1 - line 2 --b file option b, line 1 - line 2 - -Multiple lines in descriptions, not aligned: - --a option a, line 1 - line 2 --b file option b, line 1 - line 2 - -Some edge cases: - ---option=arg arg too many arguments - ---option=arg=arg too many arguments - --aletter arg too many arguments (-a letter) - -/Aletter arg too many arguments (/A letter) - --a=b can't use = for short arguments - -/A=b can't use = for DOS/VMS arguments? - ---option= argument missing - ---=argument option missing - --- everything missing - -- this should be a bullet list item - -+ bullet - -.. Comments swallow up all indented text following. - - (Therefore this is not a) block quote. - -- bullet - - If we want a block quote after this bullet list item, - we need to use an empty comment: - -.. - - Block quote. - -Other blocks ------------- - -:: - - Anonymous literal block - -This is a literal block:: - - This here. - -And we don't need colons :: - - Not really. - -Of course, **I** like Python: - - >>> print " Indented block & output." - Indented block & output. - -Or maybe I don't:: - - >>> print " Indented block & output." - Indented block & output. - -Footnotes ---------- - -Autonumbered footnotes -...................... -[#]_ is the first auto-numbered footnote reference. -[#]_ is the second auto-numbered footnote reference. - -.. [#] Auto-numbered footnote 1. -.. [#] Auto-numbered footnote 2. -.. [#] Auto-numbered footnote 3. - -[#]_ is the third auto-numbered footnote reference. - -Autonumbered and named footnotes -................................ -[#six]_ is a reference to the sixth auto-numbered footnote. - -.. [#four] Fourth auto-numbered footnote. -.. [#five] Fifth auto-numbered footnote. -.. [#six] Sixth auto-numbered footnote. - -[#five]_ is a reference to the fifth auto-numbered footnote. -[#four]_ is a reference to the fourth auto-numbered footnote. -[#six]_ is another reference to the sixth auto-numbered footnote. - -Here are some internal cross-references to the implicit targets -generated by the footnotes: four_, five_, six_. - -Mixed anonymous and labelled auto-numbered footnotes -.................................................... -[#ten]_ should be 10, [#]_ should be 7, -[#]_ should be 9, [#]_ is one too many, -[#eight]_ should be 8, and [#twelve]_ doesn't exist, -nor does [#eleven]_. - -.. [#] Auto-numbered footnote 7. -.. [#eight] Auto-numbered footnote 8. -.. [#] Auto-numbered footnote 9. -.. [#ten] Auto-numbered footnote 10. -.. [#eleven] Auto-numbered footnote 11. -.. [#eleven] Auto-numbered footnote 11 again (duplicate). - -Inline stuff ------------- -(**strong**) but not (**) or '(** ' or x**2 or \\**kwargs or ** - -(however, '**kwargs' will trigger a warning and may be problematic) - -Strong asterisk: ***** - -Strong double asterisk: ****** - -``literal`` -``lite\\ral`` - -``literal ``TeX quotes'' & \\backslash`` but not "``" or `` - -(however, ``standalone TeX quotes'' will trigger a warning -and may be problematic) - -Find the ```interpreted text``` in this paragraph! - -`interpreted` -:role:`interpreted` - -`interpreted` but not \\`interpreted` [`] or ({[`] or [`]}) or ` - -`interpreted`-text `interpreted`: text `interpreted`:text `text`'s interpreted - -http://www.standalone.hyperlink.com - -one-slash-only:/absolute.path - -mailto:someone@somewhere.com - -news:comp.lang.python - -An email address in a sentence: someone@somewhere.com. - -ftp://ends.with.a.period. - -(a.question.mark@end?) - -Tables ------- - -+-------------------------------------+ -| A table with one cell and one line. | -+-------------------------------------+ - -+-----------------------+ -| A malformed table. | -+-----------------------+ - -+------------------------+ -| A well-formed | table. | -+------------------------+ - -+------------------------+ -| This +----------+ too! | -+------------------------+ - -+--------------------------+ -| A table with three rows, | -+------------+-------------+ -| and two | columns. | -+------------+-------------+ -| First and last rows | -| contain column spans. | -+--------------------------+ - -+------------+-------------+---------------+ -| A table | two rows in | and row spans | -| with three +-------------+ to left and | -| columns, | the middle, | right. | -+------------+-------------+---------------+ - -+------------+-------------+---------------+ -| A table | | two rows in | and funny | -| with 3 +--+-------------+-+ stuff. | -| columns, | the middle, | | | -+------------+-------------+---------------+ - -+-----------+-------------------------+ -| W/NW cell | N/NE cell | -| +-------------+-----------+ -| | Middle cell | E/SE cell | -+-----------+-------------+ | -| S/SE cell | | -+-------------------------+-----------+ - -+--------------+-------------+ -| A bad table. | | -+--------------+ | -| Cells must be rectangles. | -+----------------------------+ - -+-------------------------------+ -| A table with two header rows, | -+------------+------------------+ -| the first | with a span. | -+============+==================+ -| Two body | rows, | -+------------+------------------+ -| the second with a span. | -+-------------------------------+ - -+-------------------------------+ -| A table with two head/body | -+=============+=================+ -| row | separators. | -+=============+=================+ -| That's bad. | | -+-------------+-----------------+ - -The traditional: - - +------------------------+------------+----------+----------+ - | Header row, column 1 | Header 2 | Header 3 | Header 4 | - +========================+============+==========+==========+ - | body row 1, column 1 | column 2 | column 3 | column 4 | - +------------------------+------------+----------+----------+ - | body row 2 | Cells may span columns. | - +------------------------+------------+---------------------+ - | body row 3 | Cells may | - Table cells | - +------------------------+ span rows. | - contain | - | body row 4 | | - body elements. | - +------------------------+------------+---------------------+ - -+-----------------+--------+ -| A simple table | cell 2 | -+-----------------+--------+ -| cell 3 | cell 4 | -+-----------------+--------+ -No blank line after table. - -+-----------------+--------+ -| A simple table | cell 2 | -+-----------------+--------+ -| cell 3 | cell 4 | -+-----------------+--------+ - Unexpected indent and no blank line after table. - -+------------------------------+ -| This table contains another. | -| | -| +-------------------------+ | -| | A table within a table. | | -| +-------------------------+ | -+------------------------------+ - -+------------------+--------+ -| A simple table | | -+------------------+--------+ -| with empty cells | | -+------------------+--------+ - -Links and so on ---------------- -.. _target: - -(internal hyperlink) - -.. _one-liner: http://structuredtext.sourceforge.net - -.. _starts-on-this-line: http:// - structuredtext. - sourceforge.net - -.. _entirely-below: - http://structuredtext. - sourceforge.net - -.. _target1: Not a proper hyperlink target - -.. _a long target name: - -.. _`a target name: including a colon (quoted)`: - -.. _a target name\: including a colon (escaped): - -.. _target2: http://www.python.org/ - -(indirect external hyperlink) - -Duplicate indirect links (different URIs): - -.. _target3: first - -.. _target3: second - -Duplicate indirect links (same URIs): - -.. _target4: first - -.. _target4: first - -Directives ----------- -.. Attention:: Directives at large. - -.. Note:: This is a note. - -.. Tip:: 15% if the - service is good. - -- .. WARNING:: Strong prose may provoke extreme mental exertion. - Reader discretion is strongly advised. -- .. Error:: Does not compute. - -.. Caution:: - - Don't take any wooden nickels. - -.. DANGER:: Mad scientist at work! - -.. Important:: - - Wash behind your ears. - - Clean up your room. - - Call your mother. - - Back up your data. - -.. image:: images/ball.gif - -.. image:: - picture.png - [height=100 width=200 scale=50] - -.. figure:: picture.png - - A picture with a caption. - -.. figure:: picture.png - - A picture with a caption and a legend. - - +-----------------------+-----------------------+ - | Symbol | Meaning | - +=======================+=======================+ - | .. image:: tent.png | Campground | - +-----------------------+-----------------------+ - | .. image:: waves.png | Lake | - +-----------------------+-----------------------+ - | .. image:: peak.png | Mountain | - +-----------------------+-----------------------+ diff --git a/sandbox/tibs/pysource/test/testassign.py b/sandbox/tibs/pysource/test/testassign.py deleted file mode 100755 index e4d70a356..000000000 --- a/sandbox/tibs/pysource/test/testassign.py +++ /dev/null @@ -1,12 +0,0 @@ -class Jim: - - def __init__(self): - a = 1 - a = [2,3] - a,b = 4,5 - a,b = [6,7] - a,self.a = 8,9 - a = b = self.a = 10 - a,b = c,d = 11,12 - self.a,self.b = 13,14 - self.a = self.b = 15 diff --git a/sandbox/tibs/pysource/test/testfunc.py b/sandbox/tibs/pysource/test/testfunc.py deleted file mode 100755 index 4a887b098..000000000 --- a/sandbox/tibs/pysource/test/testfunc.py +++ /dev/null @@ -1,34 +0,0 @@ -# Stuff needed to make the examples compile... -class Fred: - def __getitem__(self,index): - pass -a = Fred() -b = [1,2,3,4] -d = Fred() - -def func1(a,b=1,c='jim',d=None,e=[],f={'a':1,a:1},g=(1,2,3)): - pass - -def func2(a,*args,**kargs): - pass - -def func2a(a,*args): - pass - -def func2b(a,**kargs): - pass - -def func3((a,b,c),d): - pass - -def func4(a=a,b=Fred,c=Fred()): - pass - -def func5(a=[x for x in [1,2,3] if x > 2], - b=[(x,y) for x in [1,2,3] for y in [3,4,5]]): - pass - -def func6(a=b[1:2],c=d[1,4:6,...,8:9:10], - e=lambda x: x*2, - f=lambda x,a=a: func5(x,a)): - pass diff --git a/sandbox/tibs/pysource/test/testinterpreted.py b/sandbox/tibs/pysource/test/testinterpreted.py deleted file mode 100755 index 00eb59311..000000000 --- a/sandbox/tibs/pysource/test/testinterpreted.py +++ /dev/null @@ -1,44 +0,0 @@ -"""Test interpreted text - -This module (`testinterpreted`) contains one :class:`Fred` -(and one hopes `Fred` will also work) and a function *and* -a method called `fred`. - -NB: the above sentence *should*, when transformed into HTML -or some other output format, hopefully, contain text something -like:: - - contains one class Fred - -i.e., the ``:class:`Fred``` should probably cause the "insertion" -of the word "class". Or so I think. -""" #' - -__docformat__ = "reST" - -class Fred: - """This class (`Fred`), in :module:`testinterpreted`, contains - a method `fred`. - """ - - jim = None - """A class value, a default. - """ - - def fred(self): - """This method (`fred`) is in class `Fred` - """ - fred = 3 - """This name (`fred`) is in :function:`fred` in class `Fred`. - """ - -def fred(fred): - """This function (:function:`fred`) is *not* in class `Fred`. - - It has one argument, :parameter:`fred`. - - If I just say `fred`, what *should* that resolve to? - """ - fred.jim = 3 - """We assume that `fred` must be something with a `jim` attribute... - """ diff --git a/sandbox/tibs/pysource/test/testinterpreted2.py b/sandbox/tibs/pysource/test/testinterpreted2.py deleted file mode 100755 index 59dac777a..000000000 --- a/sandbox/tibs/pysource/test/testinterpreted2.py +++ /dev/null @@ -1,37 +0,0 @@ -""" -This is the example from David Goodger's DPS document pysource-reader.txt. -""" - -__docformat__ = "restructuredtext" - -class Keeper(Storer): - - """ - Extend `Storer`. Class attribute `instances` keeps track of - the number of `Keeper` objects instantiated. - """ - - instances = 0 - """How many `Keeper` objects are there?""" - - def __init__(self): - """ - Extend `Storer.__init__()` to keep track of instances. - - Keep count in `self.instances` and data in `self.data`. - """ - Storer.__init__(self) - self.instances += 1 - - self.data = [] - """Store data in a list, most recent last.""" - - def storedata(self, data): - """ - Extend `Storer.storedata()`; append new `data` to a list - (in `self.data`). - - Use :method:`Keeper.storedata` to store the object's data in - `Keeper.data`:instance_attribute:. - """ - self.data = data diff --git a/sandbox/tibs/pysource/test/testsimp.py b/sandbox/tibs/pysource/test/testsimp.py deleted file mode 100755 index 7dfeb4202..000000000 --- a/sandbox/tibs/pysource/test/testsimp.py +++ /dev/null @@ -1,12 +0,0 @@ -a = 'b' -class Fred: - """A *silly* demonstration.""" - - def __init__(self, b=1, c='jim', d=None, f={'a':1,a:1}, - g=[x for x in [1,2,3] if x > 2]): - """Initialise ourselves.""" - self.list = g - - def __call__(self,a): - """Call ourselves.""" - pass diff --git a/sandbox/tibs/pysource/test/testyield.py b/sandbox/tibs/pysource/test/testyield.py deleted file mode 100755 index e3fd1d2d0..000000000 --- a/sandbox/tibs/pysource/test/testyield.py +++ /dev/null @@ -1,8 +0,0 @@ -from __future__ import generators -from string import lower as lll -from string import lower as lll, upper as uuu, lower, lower as xxx - -def fred(): - a = 1 - yield a - diff --git a/sandbox/tibs/pysource/transform.py b/sandbox/tibs/pysource/transform.py deleted file mode 100755 index f93f17ed4..000000000 --- a/sandbox/tibs/pysource/transform.py +++ /dev/null @@ -1,358 +0,0 @@ -"""Transfer the structure from visit.py into a DOCUTILS node tree. - -TODO: ensure that the encoding of individual items makes sense. - -This should probably be using David's new mechanisms from the docutils module -to build the DOCUTILS tree - but they were written after this was coded, and -I've still to investigate them. -""" - -import string - -import docutils.nodes -import docutils.utils - -import visit -import utils -import buildtree - -__docformat__ = "reST" - - -# ---------------------------------------------------------------------- -class Process: - """The infrastucture that knows how to produce our DOCUTILS node tree. - """ - - def __init__(self, with_groups=1, document=None): - """Instantiate our transformation to a DOCUTILS tree. - - At the moment, whilst we are considering both my own old HTML - output and also moving towards David Goodger's DOCUTILS HTML output, - we have the ``with_groups`` argument - if this is false then - buildtree will not output "group" elements... - """ - self.current_module = None - self.dps = buildtree.BuildTree(with_groups=with_groups, root=document) - - def __call__(self,thing): - """Produce a DOCUTILS 'document' node and attach our information to it - """ - self.dps.start("document") - - if thing.__class__ == visit.Package: - self.add_package(thing) - elif thing.__class__ == visit.Module: - self.add_module(thing) - else: - raise ValueError,"Argument must be a Package or Module,"\ - " not a %s"%thing.__class__.__name__ - - self.dps.end("document") - document = self.dps.finish() - - # David's HTML writer requires the document to have a "source" - # attribute - so add a temporary one (something better should - # be done later on - see what David does!) - document["source"] = "pysource" - return document - - def add_package(self,thing): - """Process a package and produce DOCUTILS nodes for it. - """ - - self.dps.start("section",style="package") - self.dps.add("target",name=thing.label()) - self.dps.add("title",self.title(thing)) - - self.dps.start("group",style="details") - self.dps.add("paragraph","Path: "+thing.directory) - self.dps.end("group") - - for mod in thing.getModules(): - self.add_module(mod) - - self.dps.end("section") - - def add_module(self,thing): - """Process a module and produce DOCUTILS nodes for it. - """ - - self.current_module = thing - - self.dps.add("target",name=thing.label()) - self.dps.start("section",style="module") - self.dps.add("title",self.title(thing)) - - self.dps.start("group",style="details") - self.dps.start("paragraph","Full name: ") - self.dps.add("emphasis",thing.fullname) - self.dps.end("paragraph") - self.dps.add("paragraph","Path: "+thing.filename) - self.dps.end("group") - - self.add_generic(thing) - - obscure = thing.getObscureGlobals() - if obscure: - self.dps.start("group",style="obscure_globals") - self.dps.start("paragraph") - self.dps.add("strong","Globals in obscure places") - self.dps.start("bullet_list") - - for name,places in thing.getObscureGlobals(): - self.dps.start("list_item") - self.dps.start("paragraph") - self.dps.add("literal",name) - self.dps.add("text"," defined and used in") - if len(places) == 1: - self.dps.add("text"," ") - self.dps.add("literal",places[0]) - else: - self.dps.add("text",":") - self.dps.start("bullet_list") - for place in places: - self.dps.add("list_item", - self.dps.make("literal",place)) - self.dps.end("bullet_list") - self.dps.end("list_item") - self.dps.end("bullet_list") - self.dps.end("group") - - self.dps.end("section") - - def add_generic(self,thing): - """Basic stuff, common to just about all things - """ - - # Side effects, all is side effects... - self.add_docstring(thing) - self.add_imports(thing) - self.add_attributes(thing) - self.add_classes(thing) - self.add_functions(thing) - - def add_docstring(self,thing): - is_function = (thing.__class__ in [visit.Method,visit.Function]) - - if not thing.docstring and not is_function: - return - - self.dps.start("group",style="docstring") - - if is_function: - args = thing.getArgs() - self.dps.start("paragraph") - # Make the function/method name easily findable... - self.dps.start("literal",style="funcall") - self.dps.add("text",thing.name) - self.dps.end("literal") - # And then we have the arguments... - self.dps.add("target",name=thing.args_label()) - self.dps.start("literal",style="funargs") - self.dps.add("text","(%s)"%string.join(args,", ")) - self.dps.end("literal") - self.dps.end("paragraph") - - if thing.docstring: - # Insert the docstring into our tree structure - thing.docstring.add_to_DPS(self.dps) - - self.dps.end("group") - - # ############################################################# - # Should we sort things alphabetically within each list, below? - # - maybe yes for some, but no for others... - # ############################################################# - - def add_imports(self,thing): - """Work out a description of any imports. - - `thing` is the visitor node that we are to use to construct - DOCUTILS nodes. - """ - - imports = thing.getImports() - froms = thing.getFromImports() - - if not imports and not froms: - return - - self.dps.add("target",name=thing.label()) - self.dps.start("group",style="imports") - self.dps.start("paragraph") - self.dps.add("strong","Imports:") - self.dps.start("bullet_list") - - if imports: - names = imports.keys() - names.sort() - for name in names: - self.dps.start("list_item") - self.dps.start("paragraph","import ") - self._add_import(name,imports) - self.dps.end("list_item") - - if froms: - #print froms - modnames = froms.keys() - modnames.sort() - for modname in modnames: - self.dps.start("list_item") - self.dps.start("paragraph","from ") - self.dps.add("literal",modname) - self.dps.add("text"," import ") - dict = froms[modname] - names = dict.keys() - names.sort() - uselist = len(names) > 1 - if uselist: - self.dps.start("bullet_list") - for name in names: - if uselist: - self.dps.start("list_item") - self._add_import(name,dict) - self.dps.end("list_item") - else: - self._add_import(name,dict) - if uselist: - self.dps.end("bullet_list") - self.dps.end("list_item") - - self.dps.end("bullet_list") - self.dps.end("group") - - def _add_import(self,name,import_dict): - self.dps.add("literal",name) - aslist = import_dict[name] - if len(aslist) == 1 and aslist[0] == None: - self.dps.add("text"," (as "); - self.dps.add("emphasis","itself"); - self.dps.add("text",")"); - else: - self._add_aslist(aslist) - - def _add_aslist(self,aslist): - self.dps.add("text"," as ") - another = 0 - for name in aslist: - if another: - self.dps.add("text",", ") - else: - another = 1 - if name is None: - self.dps.add("emphasis","itself") - else: - self.dps.add("literal",name) - - def add_attributes(self,thing): - attributes = thing.getAttributeNames() - if not attributes: - return - - # We don't do attributes for functions, or for methods that are - # not called "__init__" or "__new__" (the DOCUTILS spec doesn't require - # retention of attributes in "__new__" methods, but it seems sensible - # to me, and I'm not sure they were around when the DOCUTILS spec was - # first written...) - if thing.__class__ == visit.Function: - return - if thing.__class__ == visit.Method and \ - thing.name not in ("__init__","__new__"): - return - - self.dps.start("group",style="attributes") - self.dps.start("paragraph") - self.dps.add("strong","Attributes:") - self.dps.start("bullet_list") - - for name in attributes: - self.dps.start("list_item") - nameinst = thing.getAttribute(name) - self.dps.start("paragraph") - self.dps.add("target",name=nameinst.label()) - self.dps.add("literal",nameinst.getAsString()) - if nameinst.isGlobal(): - self.dps.add("text"," ") - self.dps.add("emphasis","(global)") - if nameinst.__class__ == visit.InstanceValue and \ - nameinst.see_also: - self.dps.add("text"," - see also class instance ") - self.dps.add("a",nameinst.our_class.name, - href="#"+nameinst.our_class.label()) - self.add_docstring(nameinst) - self.dps.end("list_item") - - self.dps.end("bullet_list") - self.dps.end("group") - - def add_classes(self,thing): - class_names = thing.getClassNames() - for name in class_names: - class_instance = thing.getClass(name) - self.add_class(class_instance) - - def add_class(self,thing): - """Process a class and produce DOCUTILS nodes for it. - """ - - self.dps.add("target",name=thing.label()) - self.dps.start("section",style="class") - self.dps.add("title",self.title(thing)) - - self.dps.start("group",style="details") - self.dps.start("paragraph","Full name: ") - self.dps.add("emphasis",thing.fullname) - - names = thing.getBaseNames() - if names: - self.dps.start("paragraph","Inherits from: ") - done_one = 0 - for name in names: - if done_one: - self.dps.add("text",", ") - else: - done_one = 1 - self.dps.add("literal",name) - self.dps.end("group") - - self.add_generic(thing) - self.dps.end("section") - - def add_functions(self,thing): - """Add information about any functions or methods. - """ - - func_names = thing.getFunctionNames() - for name in func_names: - fun_instance = thing.getFunction(name) - self.add_function(fun_instance) - - def add_function(self,thing): - """Process a function or method and produce DOCUTILS nodes for it. - """ - - if thing.__class__ == visit.Method: - style = "method" - else: - style = "function" - self.dps.add("target",name=thing.label()) - self.dps.start("section",style=style) - self.dps.add("title",self.title(thing)) - - self.dps.start("group",style="details") - self.dps.start("paragraph","Full name: ") - self.dps.add("emphasis",thing.fullname) - self.dps.end("group") - - if thing.generator: - self.dps.start("group",style="generator") - self.dps.add("paragraph","%s %s is actually a generator"%\ - (thing.__class__.__name__,thing.name)) - self.dps.end("group") - - self.add_generic(thing) - self.dps.end("section") - - def title(self,thing): - return "%s %s"%(thing.__class__.__name__,thing.name) diff --git a/sandbox/tibs/pysource/utils.py b/sandbox/tibs/pysource/utils.py deleted file mode 100755 index 8823c9265..000000000 --- a/sandbox/tibs/pysource/utils.py +++ /dev/null @@ -1,474 +0,0 @@ -"""Utilities for pysource -""" - -import types -import string -import compiler - -# We'd better have at least *one* module in this package that demonstrates -# *not* using reST for our docstrings... -__docformat__ = "none" - - -# ---------------------------------------------------------------------- -PLAINTEXT = "plaintext" -RESTRUCTUREDTEXT = "restructuredtext" - -canonical_format = { "plaintext" : PLAINTEXT, - "plain" : PLAINTEXT, - "none" : PLAINTEXT, - "rst" : RESTRUCTUREDTEXT, - "rest" : RESTRUCTUREDTEXT, - "rtxt" : RESTRUCTUREDTEXT, - "restructuredtext" : RESTRUCTUREDTEXT, - } - -def docformat(text): - """Interpret a module's __docformat__ string. - - Returns a tuple of (format,language) - """ - if text == None: - return PLAINTEXT,"en" - - words = string.split(string.lower(text)) - - #print words - - if len(words) == 0: - return PLAINTEXT,"en" - elif len(words) > 2: - raise ValueError,"__docformat__ may be at most two 'words'" - - if len(words) == 2: - language = string.lower(words[1]) - else: - language = "en" - - try: - format = canonical_format[string.lower(words[0])] - except KeyError: - legal = canonical_format.keys() - legal.sort() - raise ValueError,"__docformat__ should be one of %s"%legal - - return format,language - - -# ---------------------------------------------------------------------- -def flatten(item): - """Retrieve some simpler representation of our AST. - - (and it's not meant to be 'theoretically' wonderful, just something - I can look at to work out how an AST works...) - """ - if isinstance(item,compiler.ast.Node): - things = [item.__class__.__name__] - children = item.getChildren() - for child in children: - things.append(flatten(child)) - return things - else: - return [item] - - -# ---------------------------------------------------------------------- -def treeprint(stream,item,indent=0): - """Simple pretty printer for the AST.""" - if isinstance(item,compiler.ast.Node): - stream.write("\n%s<%s>"%(" "*indent,item.__class__.__name__)) - - children = item.getChildren() - for child in children: - treeprint(stream,child,indent+2) - - # Fake our docstring as a sub-node (it's *really* more an attribute) - if hasattr(item,"docstring"): - stream.write("\n%s %s"%(" "*indent,item.docstring)) - - # And ditto for a remembered assignment expression - if hasattr(item,"assign_expr"): - stream.write("\n%s "%(" "*indent)) - treeprint(stream,item.assign_expr,indent+4) - else: - stream.write(" ") - stream.write(`item`) - - -# ---------------------------------------------------------------------- -def find_attr_docs(tree,verbose=0): - """Find candidates for documented attributes - - Note that after this, it may be that the AST will not garbage collect - its own nodes properly anymore, as we are adding in cross-linkages. - """ - - if not isinstance(tree,compiler.ast.Node): - return - - children = tree.getChildren() - - # Might as well get our recursion done with first... - for child in children: - find_attr_docs(child,verbose) - - # I believe that only Stmt nodes can have Assign and Discard - # nodes as children - if not isinstance(tree,compiler.ast.Stmt): - return - - if len(children) == 0: - return - - pairs = [] - last = children[0] - for item in children[1:]: - pairs.append((last,item)) - last = item - - for this,next in pairs: - if isinstance(this,compiler.ast.Assign) and \ - isinstance(next,compiler.ast.Discard): - if verbose: - print - print - print "*** Attribute docstring candidate" - treeprint(this,4) - treeprint(next,4) - print - - nextexpr = next.expr - if isinstance(nextexpr,compiler.ast.Const): - if type(nextexpr.value) == types.StringType: - docstring = nextexpr.value - else: - if verbose: - print - print "... Discarded constant is not a string" - continue - else: - if verbose: - print - print "... Discarded expression is not a constant" - continue - - # If there is more than one assignment attached to - # the node, we are not interested - if len(this.nodes) > 1: - if verbose: - print - print "... (but there are too many assignments in the )" - continue - - target = this.nodes[0] - if isinstance(target,compiler.ast.AssName): - # Let's be cheeky and glue the docstring on... - target.docstring = docstring - elif isinstance(target,compiler.ast.AssAttr): - # Let's be cheeky and glue the docstring on... - target.docstring = docstring - else: - if verbose: - print - print "... (but the assignment is to a tuple/list/etc.)" - continue - - if verbose: - print - print "Becomes:" - treeprint(this,4) - - -# ---------------------------------------------------------------------- -def find_attr_vals(tree,verbose=0): - """Find attributes whose values we're interested in. - - Clearly, when this is working, it could do with being "folded" into - `find_attr_docs()`. - - Note that after this, it may be that the AST will not garbage collect - its own nodes properly anymore, as we are adding in cross-linkages. - """ - - if not isinstance(tree,compiler.ast.Node): - return - - children = tree.getChildren() - - # Might as well get our recursion done with first... - for child in children: - find_attr_vals(child,verbose) - - # I believe that only Stmt nodes can have Assign and Discard - # nodes as children - if not isinstance(tree,compiler.ast.Stmt): - return - - for this in children: - if isinstance(this,compiler.ast.Assign): - if verbose: - print - print - print "*** Assignment - name/value candidate" - treeprint(this,4) - print - - # If there is more than one assignment attached to - # the node, we are not interested - if len(this.nodes) > 1: - if verbose: - print - print "... (but there are too many assignments in the )" - continue - - target = this.nodes[0] - if isinstance(target,compiler.ast.AssName) or \ - isinstance(target,compiler.ast.AssAttr): - # Let's be cheeky and glue the associated expression on... - target.assign_expr = this.expr - else: - if verbose: - print - print "... (but the assignment is to a tuple/list/etc.)" - continue - - if verbose: - print - print "Becomes:" - treeprint(this,4) - - -# ---------------------------------------------------------------------- -def stringify_arg(thing): - """Return a string representation of a function argument. - - This just works for tuples of (strings or tuples (of strings ...) ...) - """ - if type(thing) == types.StringType: - return thing - elif type(thing) == types.TupleType: - innards = [] - for item in thing: - innards.append(stringify_arg(item)) - return "(" + string.join(innards,",") + ")" - else: - raise ValueError,"Tried to stringify type %s"%type(thing) - - -# ---------------------------------------------------------------------- -def merge_args(args,defaults): - """Merge together arguments and defaults from an argument list. - - Returns a list of argument strings. - """ - if args == None: - return [] - - if defaults == None: - defaults = [] - - # This is horrible - do it nicely later on! - argstrs = [] - for item in args: - argstrs.append(stringify_arg(item)) - - pos = len(args) - len(defaults) - next = 0 - for index in range(pos,len(args)): - thing = defaults[next] - thing = stringify_expr(thing) - argstrs[index] = "%s=%s"%(argstrs[index],thing) - next = next + 1 - return argstrs - - -# ---------------------------------------------------------------------- -def stringify_expr(thing): - """Return a very simple string representation of an expression node - - Specifically, this function aims to support stringifying things - which can be on the RHS of an assignment - is that *actually* the - same as stringifying expression nodes? - """ - - # Humph - saving typing may be a good thing... - strify = stringify_expr - - #print thing.__class__.__name__ - - if thing == None: - return 'None' - elif isinstance(thing,compiler.ast.Add): - return strify(thing.left) + " + " + strify(thing.right) - elif isinstance(thing,compiler.ast.And): - exprs = [] - for node in thing.nodes: - exprs.append(strify(node)) - return string.join(exprs," && ") - elif isinstance(thing,compiler.ast.AssAttr): - # Attribute as target of assignment - if thing.flags == compiler.consts.OP_ASSIGN: - return strify(thing.expr) + "." + thing.attrname - else: - raise ValueError,"Unexpected flag %d in %s"%(thing.flags,`thing`) - elif isinstance(thing,compiler.ast.AssName): - # Name as target of assignment, but this also means name - # as target of "in" assignment (e.g., "x in [1,2,3]"), - # which is why *we're* interested in it (since this can - # occur in list comprehensions, which can occur as the - # RHS of assignments) - if thing.flags == compiler.consts.OP_ASSIGN: - return thing.name - else: - raise ValueError,"Unexpected flag %d in %s"%(thing.flags,`thing`) - elif isinstance(thing,compiler.ast.Backquote): - return "`" + strify(thing.expr) + "`" - elif isinstance(thing,compiler.ast.Bitand): - exprs = [] - for node in thing.nodes: - exprs.append(strify(node)) - return string.join(exprs," & ") - elif isinstance(thing,compiler.ast.Bitor): - exprs = [] - for node in thing.nodes: - exprs.append(strify(node)) - return string.join(exprs," | ") - elif isinstance(thing,compiler.ast.Bitxor): - exprs = [] - for node in thing.nodes: - exprs.append(strify(node)) - return string.join(exprs," ^ ") - elif isinstance(thing,compiler.ast.CallFunc): - # Yuck - this is getting complicated! - # (for an example, see method `hyperlink_target` in - # restructuredtext/states.py) - str = strify(thing.node) + "(" - arglist = [] - if thing.args: - for arg in thing.args: - arglist.append(strify(arg)) - if thing.star_args: - arglist.append("*"+strify(thing.star_args)) - if thing.dstar_args: - arglist.append("**"+strify(thing.dstar_args)) - if arglist: - str += string.join(arglist,", ") - return str+")" - elif isinstance(thing,compiler.ast.Compare): - str = strify(thing.expr) + " " - for op,val in thing.ops: - str += op + " " + strify(val) - return str - elif isinstance(thing,compiler.ast.Const): - # Try not to let long strings take up too much room... - value = thing.value - if type(value) == type("") and len(value) > 50: - value = value[:47] + "..." - # Make Python decide for us if it needs quotes round it - # (and, if so, what sort) - return `value` - elif isinstance(thing,compiler.ast.Dict): - innards = [] - for key,val in thing.items: - key = strify(key) - val = strify(val) - innards.append(key+":"+val) - return "{" + string.join(innards,", ") + "}" - elif isinstance(thing,compiler.ast.Div): - return strify(thing.left) + " / " + strify(thing.right) - elif isinstance(thing,compiler.ast.Ellipsis): - return "..." - elif isinstance(thing,compiler.ast.Getattr): - return strify(thing.expr) + "." + thing.attrname - elif isinstance(thing,compiler.ast.Invert): - # Bitwise negation - return "~" + strify(thing.expr) - elif isinstance(thing,compiler.ast.Keyword): - # An 'arg=value' within a function call - return thing.name + "=" + strify(thing.expr) - elif isinstance(thing,compiler.ast.Lambda): - str = "lambda " - if thing.flags != 0: - str += " "%thing.flags - str += string.join(merge_args(thing.argnames,thing.defaults),", ") - str += ": " - str += strify(thing.code) - return str - elif isinstance(thing,compiler.ast.LeftShift): - return strify(thing.left) + " << " + strify(thing.right) - elif isinstance(thing,compiler.ast.List): - innards = [] - for item in thing.nodes: - innards.append(strify(item)) - return "[" + string.join(innards,", ") + "]" - elif isinstance(thing,compiler.ast.ListComp): - str = "["+strify(thing.expr) - for node in thing.quals: - str += " "+strify(node) - return str+"]" - elif isinstance(thing,compiler.ast.ListCompFor): - str = "for "+strify(thing.assign) - str += " in "+strify(thing.list) - if thing.ifs: - for node in thing.ifs: - str += " "+strify(node) - return str - elif isinstance(thing,compiler.ast.ListCompIf): - return "if "+strify(thing.test) - elif isinstance(thing,compiler.ast.Mod): - return strify(thing.left) + "%" + strify(thing.right) - elif isinstance(thing,compiler.ast.Mul): - return strify(thing.left) + " * " + strify(thing.right) - elif isinstance(thing,compiler.ast.Name): - return thing.name - elif isinstance(thing,compiler.ast.Not): - return "not " + strify(thing.expr) - elif isinstance(thing,compiler.ast.Or): - exprs = [] - for node in thing.nodes: - exprs.append(strify(node)) - return string.join(exprs," || ") - elif isinstance(thing,compiler.ast.Power): - return strify(thing.left) + " ** " + strify(thing.right) - elif isinstance(thing,compiler.ast.RightShift): - return strify(thing.left) + " >> " + strify(thing.right) - elif isinstance(thing,compiler.ast.Slice): - if thing.flags != compiler.consts.OP_APPLY: - raise ValueError,"Unexpected flag %d in %s"%(thing.flags,`thing`) - return strify(thing.expr) + "[" + \ - strify(thing.lower) + ":" + strify(thing.upper) + "]" - elif isinstance(thing,compiler.ast.Sliceobj): - slicelist = [] - for idx in thing.nodes: - slicelist.append(strify(idx)) - return string.join(slicelist,":") - elif isinstance(thing,compiler.ast.Sub): - return strify(thing.left) + " - " + strify(thing.right) - elif isinstance(thing,compiler.ast.Subscript): - if thing.flags != compiler.consts.OP_APPLY: - raise ValueError,"Unexpected flag %d in %s"%(thing.flags,`thing`) - str = strify(thing.expr) + "[" - sublist = [] - for sub in thing.subs: - sublist.append(strify(sub)) - return str + string.join(sublist,", ") + "]" - elif isinstance(thing,compiler.ast.Tuple): - innards = [] - for item in thing.nodes: - innards.append(strify(item)) - return "(" + string.join(innards,", ") + ")" - elif isinstance(thing,compiler.ast.UnaryAdd): - return "+" + strify(thing.expr) - elif isinstance(thing,compiler.ast.UnarySub): - return "-" + strify(thing.expr) - else: - return _whatsthis(thing) - -def _whatsthis(thing): - # Wrong, but what else can we do? - import sys - print >>sys.stderr,"stringify_expr - don't recognise %s %s"%\ - (thing.__class__.__name__,thing) - return `thing` - - diff --git a/sandbox/tibs/pysource/visit.py b/sandbox/tibs/pysource/visit.py deleted file mode 100755 index ec5a2992f..000000000 --- a/sandbox/tibs/pysource/visit.py +++ /dev/null @@ -1,2074 +0,0 @@ -#! /usr/bin/env python -"""Extract information from a Python file (module) for the DOCUTILS - -An example of using Jeremy Hylton's compiler module. - -Originally based on an example *by* Jeremy Hylton. In the introduction -to that example, he said: - - Here's a trivial example program that extracts some information - about methods and attributes from a class and its methods. - I wasn't exhaustive here. I'll get attributes assigned to by - `self.x` in a method body and I'll get method definitions in - the class body. I don't deal with obvious things like attributes - defined at the class level. - -I'm expanding it, initially as a bigger example, and also so I get to -understand how things work! - -Note: there should be an example Python file called test.py in the -same directory as this module - it's meant to be a suitable input -for testing/learning purposes. - -:Author: Tibs -:Version: Whatever. Oh, 0.4, then -:Date: 2002-January-18 - -Aims for DOCUTILS ------------------ -1. Locate all modules, classes, functions, methods and their docstrings. -2. "Filter" these to leave the ones that DOCUTILS is interested in. -3. Annotate functions and methods with their arguments. -4. Locate all assignments which have docstrings. -5. Similarly "filter" these. -6. Locate all uses of `global` assignments. -7. Filter out those which are not obvious from the module level, - so that the user can be warned about them. -8. Produce a tree structure suitable for DOCUTILS processing, containing - the suitable results of the above. - -(At least some of) 1, 3 and 4 have already been done. - -Still to do ------------ -* *all* sorts of assignment should be visited, so that - we can tie down the use of globals properly. -* the option of ignoring _name and __name things should be - available (should this be the default?) -* Some consideration should be given to freeing up this mess of things - when they are all finished with - there are so many interconnections - that automatic deletion is unlikely to work well -* other things as they occur to me -* Finish off InstanceValue (its potential link to the class that defines it) - -Names and fullnames -------------------- -A "name" is taken to be the name as presented in Python code. Note that -for class instance attribute references (e.g., "self.fred"), the name is -includes the class reference, dot and attribute name (e.g., "self.fred"). - -A "fullname" includes the full path to the name as well - that is, -including all of the elements required to "reach" this item. Thus, for -instance, a method Fred in class Jim in module Bill would be:: - - Bill.Jim.Fred - -whilst a name A defined within Fred would be:: - - Bill.Jim.Fred:A - -Note that if Fred contains a reference to self.B, then that would (for the -moment at least) be written as:: - - Bill.Jim.Fred:self.B - -Within an eventual HTML document, such fullnames become anchor and link -names for nodes. For that purpose, they will be transformed so that they -do not contain "." or ":", but are still not accidentally confusable with -legitimate Python names. Thus the last example would be transformed to:: - - Bill-Jim-Fred--self-B - -Note that we also have a "special" label, artificially "generated" - that -is, there is a single label for all arguments to a function or method, -which is formed of the label for the function or method, followed by -*three* hyphens, and then the text "args" - so, for example: - - Bill-Jim---args - -Special cases -------------- -Notes on special cases in name resolution: - -- obviously I should be taking account of explicit roles. - -- if it can't find the name directly via the "scope", it should be looking - up in the module - so the ScopeMixin needs to provide support for that... - -- the module name should be recognised as, in some sense, within the - module's "parent" - even if there is no such beast. - -- that generalises - in general, an object's own name should be visible - to its docstring, I think - so, for instance:: - - digit = 3 - '''We store the current digit of pi in `digit`''' - - (yes, I know that's poor documentation, but even so) - -- .name in a method (where is the first argument to said - method) should be regarded as being a name in the class containing - the method, in some sense (but what sense?) -""" #" - -import os -import sys -import string -import compiler - -from docutils.parsers.rst import Parser - -# Local modules -import utils -import visit - -__docformat__ = "reST" - - -# ---------------------------------------------------------------------- -def make_Docstring(text, settings): - """A factory function to handle non-existant docstrings. - """ - if text: - return Docstring(text, settings) - else: - return None - -class Docstring: - """We use this to represent a docstring, parsed and unparsed. - """ - - def __init__(self, text, settings, debug=0): - """Instantiate a new Docstring from its text. - """ - self.text = self._trim(text) - """The text of the docstring. - """ - self.document = None - """The result of parsing the docstring, if requested. - (thus, only non-None if we *are* parsing docstrings in - the containing module). - """ - self.settings = settings - """The docutils settings to apply to new document parsers. - """ - - self.debug = debug - - def _trim(self,docstring): - """Trim leading space appropriately from the docstring text. - - When the docstring is read from the source file, it is likely - to have all but the first line indented with respect to the - first - for example, consider this docstring. - - Before it is *used* for anything (e.g., typing it out to be - read by the user), it is necessary to adjust for this. The - way to do this is well-defined (???where???). - - Returns the adjusted text. - """ - - # Remove any confusing tabs - follow the normal Python rules - # - and split into convenient lines - lines = string.split(string.expandtabs(docstring),"\n") - - # Find significant indentation - firstline = lines[0] - if firstline and firstline[0] == " ": - oldlen = len(firstline) - firstline = string.lstrip(firstline) - indent = oldlen - len(firstline) - else: - indent = 0 - for line in lines[1:]: - oldlen = len(line) - lin = string.lstrip(line) - if lin: - indent = oldlen - len(lin) - break - - # And remove it... - newlines = [firstline] - for line in lines[1:]: - oldlen = len(line) - lin = string.lstrip(line) - if lin: - extra = oldlen - len(lin) - indent - if extra > 0: - lin = " "*extra + lin - newlines.append(lin) - - # Don't introduce a trailing blank line if they did some - # variant of the following layout:: - # """Some text - # """ - if newlines and newlines[-1] == "": - del newlines[-1] - - # And lastly, reassemble it back into text again - return string.join(newlines,"\n") - - def show(self,stream,spaces=""): - # Not optimised for efficiency... - lines = string.split(self.text,"\n") - - # For the moment, don't try to format it very nicely at all... - stream.write('%s"""%s\n'%(spaces,lines[0])) - for line in lines[1:]: - stream.write(spaces+line+"\n") - stream.write('%s"""\n'%spaces) - - def parse(self,parser): - """Parse our text with the given parser. - """ - import docutils - self.document = docutils.utils.new_document(self.text, self.settings) - parser.parse(self.text,self.document) - - def add_to_DPS(self,dps): - """Add this docstring content to a DOCUTILS subtree. - - Calls the appropriate things from `dps`, which is a - builtree.BuildTree instance. - """ - if self.document: - for child in self.document.children: - dps.addsubtree(child) - else: - dps.start("literal_block") - dps.add("text",self.text) - dps.end("literal_block") - - # :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - # Experimental node code... - # Copied from transform.py, and not adjusted yet (except superficially - # and stupidly) for its position in this class. - # - despite the comments in the docstring, it doesn't *do* anything yet... - - def transform_interpreted(self,thing): - """Deal with nodes in this docstring. - - The intent is to find any nodes, try to locate the - relevant Python value, and insert an appropriate cross-reference. - - `thing` is the `Module`, `Class`, `Function`, `Method` or - `Name` instance to which this docstring is "attached". It - is used to resolve the names. - """ - if self.debug: - print "\n*** Locating items for %s"%thing.fullname - self.show(sys.stdout," ") - self.locate_interpreted(self.document,thing) - - def locate_interpreted(self,element,thing): - """Deal with finding "interpreted" nodes in a document subtree. - """ - for node in element: - if node.tagname == "#text": - continue - elif node.tagname == "interpreted": - self.treat_interpreted(node,thing) - else: - self.locate_interpreted(node,thing) - - def treat_interpreted(self,element,thing): - """Do something interesting with an "interpreted" node. - """ - if element.has_key("role"): - role = element["role"] - else: - role = None - - name = element.astext() - - #if role: - # print "... :%s: %s"%(role,name) - #else: - # print "... %s"%name - - # Attempt to work out what this item refers to - target = thing.scope_find_name(name,role=role,indent="...") - if target: - element["refname"] = target - - -# ---------------------------------------------------------------------- -class ScopeMixin: - """Learning about how to represent scope. - - The idea of this mixin class is to work out the best way of representing - scope, so that I can use the results when working out exactly what an - item in a docstring refers to. - - Note that I do not intend (at least, for the moment) to worry about Python - before 2.2 - i.e., before embedded scope became non-optional. This is - purely laziness on my part... - """ - - scope_debug = 0 - - def scope_init(self): - """Call at the end of `__init__` to initilise our experiments - """ - - self.scope_module = None - """Which Module we are in. - """ - - self.scope_parent = None - """The *immediate* parent entity. - Note that for a method, this will be the class defining it. - - (Ultimately, it might be better if this were a weak reference.) - """ - - self.scope_encloser = None - """The innermost enclosing block. Note that for a method, - this should *not* be the class, but the innermost enclosing - function/method/module/whatever (whatever?). - """ - - self.scope_defines = [] - """A list of the names *defined* by this entity - (by assignment, definition or whatever). - - The list is ordered by last occurrence of the name. - """ - - self.scope_fullname = {} - """The key is the name from `self.scope_defines`, the value is the - "full" name for the defined value. - """ - - self.scope_children = {} - """A dictionary of the entities defined by this entity. - - The keys are the entity name (so correspond to those in - `self.scope_defines`), and the values are NULL if the entity - is defined by simple assignment, otherwise the relevant - "scope" instance (e.g., a Method or Class). - """ - - self.scope_globals = [] - """A list of names which are declared global in this scope. - """ - - def scope_define_parent(self,parent=None,module=None): - """Define our parent and encloser. - """ - self.scope_module = module - self.scope_parent = parent - self.scope_encloser = parent - if isinstance(self,Method): - while isinstance(self.scope_encloser,Class): - self.scope_encloser = self.scope_encloser.scope_parent - - def scope_define_name(self,name,fullname,child=None): - """Add a name that is defined in this scope. - - - `name` is the obvious name of the name being defined. - - `fullname` is the "path" to it, starting at the module. - - `child` is the class representing that name - e.g., a Class - or Name instance. - - Note - remember that functions/methods "define" their arguments... - - HOWEVER we are not trying for a general solution to the problem of - "find the item that is being referred to" - we are just trying to - provide useful links between items in docstrings and - those things that they might reasonably be expected to be referring to. - - Furthermore, we know that we will not show attributes, docstring or - not, if they are not - - a. At module level (so a ModuleValue) - b. Within a class (so a ClassValue) - c. Within a method called __init__ or __new__. - d. An argument (we always want to know about arguments). - - So we discard any attributes that do not match these criteria... - """ - if self.scope_debug: - if name in self.scope_defines: - redef = "(re)" - else: - redef = " " - print "%-15s %-30s %sdefined in %s"%(child.__class__.__name__, - name,redef,self.name) - - # Should we ignore this name? - if isinstance(child,Name): - if self.__class__ not in [Package,Module,Class] and \ - not (self.__class__ == Method and - self.name in ["__init__","__new__"]) and \ - child.__class__ != Argument: - return - # Remember to ensure the name is always at the END of the list - # (even if it was already there) - if name in self.scope_defines: - self.scope_defines.remove(name) - self.scope_defines.append(name) - self.scope_fullname[name] = fullname - self.scope_children[name] = child - - def scope_define_global(self,name): - """Indicate that a name is actually global. - - Note that it is entirely possible that the name is also present - in `self.scope_defines` - being global should be remembered as taking - precedence. - """ - if self.scope_debug: - if name in self.scope_defines: - redef = "(re)" - else: - redef = " " - print "%-10s %-30s %sdefined in %s"%("[Global]", - name,redef,self.name) - if name not in self.scope_globals: - self.scope_globals.append(name) - - def scope_get_object(self,name): - """Return the defined object corresponding to `name`, or None. - """ - try: - return self.scope_children[name] - except: - return None - - def scope_get_type(self,name): - """Return the "type" of the defined object corresponding to `name`. - """ - try: - return self.scope_children[name].__class__.__name__ - except: - return None - - def scope_name_in_self(self,name): - """Return true if the `name` is defined by ourselves. - """ - return name in self.scope_defines - - def scope_name_in_encloser(self,name): - """Return true if the `name` is defined by our encloser. - - (If we don't *have* an encloser - e.g., we're a module - then - it obviously returns false.) - """ - if self.scope_encloser: - return name in self.scope_encloser.scope_defines - else: - return 0 - - def scope_name_in_module(self,name): - """Return true if the `name` is defined by our module. - """ - if self.scope_module: - return name in self.scope_module.scope_defines - else: - return 0 - - def scope_up_is_module(self): - """Is our encloser the module? - """ - return self.scope_module == self.scope_encloser - - # We need a dictionary to relate role names to the classes we use - # A value of None against a key means that we are not attempting - # to handle this yet. - roles = {"package" : "Package", - "module" : "Module", - "class" : "Class", - "method" : "Method", - "function" : "Function", - "module_attribute" : "ModuleValue", - "class_attribute" : "ClassValue", - "instance_attribute": "InstanceValue", - "variable" : "Name", - "parameter" : "Argument", - "type" : None, - "exception_class" : None, - "exception" : None, - "warning_class" : None, - "warning" : None} - - def scope_obj_role_match(self,what,role): - """Decide if the role (if any) makes sense with respect to `what`. - - `what` is the object we thing might be our item of interest, - and `role` is the role we're looking for, or None if we're not - particular. - """ - if role: - if what.__class__.__name__ == self.roles[role]: - return 1 - else: - return 0 - else: - return 1 - - def scope_class_role_match(self,class_name,role): - """Decide if the role (if any) makes sense with respect to `what`. - - `what` is the class name of the object we thing might be our item - of interest, and `role` is the role we're looking for, or None if - we're not particular. - """ - if role: - if class_name == self.roles[role]: - return 1 - else: - return 0 - else: - return 1 - - def scope_callable_match(self,what,need_callable): - """Does the callable state of the `what` match our needs? Do we care? - """ - if need_callable: - return what.is_callable() - else: - return 1 - - def scope_find_name(self,name,role=None,indent=" "): - """A first pass at looking up names in scope. - - - `name` is the text that the user has enclosed in backquotes, - to make it interpreted - - `role`, if given, specifies exactly what sort of name the - user determines it to be. - - This makes no attempt to do anything beyond looking up a - simple name - it doesn't try to deal with (for instance) - a "()" at the end of the name, nor does it try to cope - with dotted names in any clever way. - - Returns either the label for the referenced entity (which is - a translation of its `fullname` into something legal as an - XML name), or None. - """ - if name.endswith("()"): - name = name[:-2] - need_callable = 1 - else: - need_callable = 0 - - if self.scope_debug: - print indent, - if role: - print ":%s:"%role, - - # Is it a reference to ourself? - if name == self.name and \ - self.scope_obj_role_match(self,role) and \ - self.scope_callable_match(self,need_callable): - if self.scope_debug: - print "%s '%s' IS %s %s"%\ - (self.__class__.__name__,name, - self.__class__.__name__,self.name) - return self.label() - - # Is it a reference to one of our children? - if self.scope_name_in_self(name): - what = self.scope_get_type(name) - whom = self.scope_children[name] - if self.scope_class_role_match(what,role) and \ - self.scope_callable_match(whom,need_callable): - if self.scope_debug: - print "%s '%s' found HERE in %s %s"%\ - (what,name,self.__class__.__name__,self.name) - if whom.__class__ == Argument: - return self.args_label() - else: - return whom.label() - - # Is it a reference to one of our encloser's children? - if self.scope_name_in_encloser(name): - what = self.scope_encloser.scope_get_type(name) - whom = self.scope_encloser.scope_children[name] - if self.scope_class_role_match(what,role) and \ - self.scope_callable_match(whom,need_callable): - if self.scope_debug: - print "%s '%s' found UP in %s %s"%\ - (what,name,self.scope_encloser.__class__.__name__, - self.scope_encloser.name) - if whom.__class__ == Argument: - return self.scope_encloser.args_label() - else: - return whom.label() - - # Is it a reference to our encloser? - if self.scope_encloser and name == self.scope_encloser.name: - # I'm not sure about this one - *should* we be able to "see" - # the name of our encloser? Or is what I'm *really* after - # the name of the *parent*? - # - # Specific instance - consider a method M in class C - # - should `C` in `M`s docstring refer to class C, - # even if class C is *not* defined at module level? - if self.scope_obj_role_match(self.scope_encloser,role) and \ - self.scope_callable_match(self.scope_encloser,need_callable): - if self.scope_debug: - print "%s '%s' IS %s %s"%\ - (self.scope_encloser.__class__.__name__,name, - self.scope_encloser.__class__.__name__, - self.scope_encloser.name) - return self.scope_encloser.label() - - # Is it a reference to a child of our module? - if not self.scope_up_is_module() and self.scope_name_in_module(name): - what = self.scope_module.scope_get_type(name) - whom = self.scope_module.scope_children[name] - if self.scope_class_role_match(what,role) and \ - self.scope_callable_match(whom,need_callable): - if self.scope_debug: - print "%s '%s' found GLOBAL in %s %s"%\ - (what,name,self.scope_module.__class__.__name__, - self.scope_module.name) - # Modules don't have arguments... - return whom.label() - - # Is it a reference to our module itself? - if name == self.scope_module.name: - if self.scope_obj_role_match(self.scope_module,role) and \ - not need_callable: - if self.scope_debug: - print "%s '%s' IS %s %s"%\ - (self.scope_module.__class__.__name__,name, - self.scope_module.__class__.__name__, - self.scope_module.name) - return self.scope_module.label() - - if self.scope_debug: - print "'%s' not in %s %s"%(name,self.__class__.__name__,self.name), - if self.scope_encloser: - print "or %s %s"%(self.scope_encloser.__class__.__name__, - self.scope_encloser.name), - if self.scope_up_is_module(): - print - else: - print "or %s %s"%(self.scope_module.__class__.__name__, - self.scope_module.name) - return None - - def scope_show(self,indent=""): - print "%s%s %s"%(indent,self.__class__.__name__,self.name), - if self.scope_encloser and self.scope_encloser != self.scope_parent: - print "<>"%(self.scope_encloser.__class__.__name__, - self.scope_encloser.name) - else: - print - - extra_indent = indent+" " - - if self.scope_globals: - print "%sglobals %s"%(extra_indent,self.scope_globals) - - for name in self.scope_defines: - child = self.scope_children[name] - if child: - child.scope_show(extra_indent) - - -# ---------------------------------------------------------------------- -class Base(ScopeMixin): - """A simple base class for common functionality. - """ - - verbose = 0 - - def __init__(self, settings, name, fullname, docstring=None): - self.settings = settings - """ The parser settings - """ - - self.name = name - """The name of this scope entity. - """ - - self.fullname = fullname - """The fully qualified name of this entity - - for instance, for a method `fred` in a class `Jim` - in a module `bob`, this would be "bob.Jim.fred" - """ - - self.docstring = make_Docstring(docstring, settings) - """The docstring for this scope, or None. - Note that, at least for the moment, we're only supporting - one docstring for an entity. This may need to change for - proper DOCUTILS support (but I [1]_, personally, hope not). - - .. [1] "I" being Tibs, at this point, and at this time [2]_. - .. [2] "This time" being April 2002. - """ - - self.imports = {} - """Import statements within this scope. The key is the - name of each module being imported, the value is a list - of the names "as" which the module is imported, with - `None` meaning "as itself". - """ - - self.from_imports = {} - """From import statements within this - scope. The key is the , the value a dictionary - like that used for `self.imports`. - """ - - self.classes = {} - """Classes defined within this scope. The key is the - class name, the value is the Class instance for this ``class``. - """ - - self.functions = {} - """Functions or methods defined within this scope. The key is the - function name, the value is the Function or Method instance - for this ``def``. - """ - - self.attributes = {} - """Attributes assigned to within a scope. The key is the - attribute name, the value is the Name instance for this ``name``. - """ - - self.children = [] - """A list of all of the items contained herein which might - have, or have children which have, docstrings - i.e., packages, - modules, classes, functions, methods. - """ - - self.class_list = [] - """A list of the class names defined in this scope, in order. - """ - - self.function_list = [] - """A list of the function/method names defined in this scope, in order. - """ - - self.attribute_list = [] - """A list of the attribute names defined in this scope, in order. - """ - - self.globals = {} - """The names mentioned in global statements within a scope. - The key is the name, the value doesn't matter. - """ - - self.parser = None - """We may need a reStructuredText parser to handle our docstrings - - if so, we'll generate one "on demand".""" - - def getParser(self): - """Retrieve a reStructuredText parser, for docstring usage. - """ - if not self.parser: - self.parser = Parser() - return self.parser - - def parse_docstrings(self,parser): - """If we are meant to, parse our docstrings. - """ - if self.docstring: - self.docstring.parse(parser) - for child in self.children: - child.parse_docstrings(parser) - - def is_callable(self): - """Does it make sense to call an object of this type? - """ - return 0 - - def label(self): - """Return an XML-legal name for this object. - - Note that we implicitly assume that all objects have their - output XML/HTML representation written to the same file - - i.e., that we do not have to worry about references that - are anything beyond simple names. - """ - str = string.replace(self.fullname,".","-") - str = string.replace(str,":","--") - return str - - def addGlobal(self,name): - self.globals[name] = name - - def addClass(self,klass): - self.classes[klass.name] = klass - self.class_list.append(klass.name) - self.children.append(klass) - - def addFunction(self,func): - self.functions[func.name] = func - self.function_list.append(func.name) - self.children.append(func) - - def addAttribute(self,name,instance): - self.attributes[name] = instance - self.attribute_list.append(name) - self.children.append(instance) - - def addImport(self,names): - """Remember an import statement. - - `names` is a list of ``(name,as)`` tuples, where ``name`` - is the name of the item being imported, and ``as`` is either - None of else the name "as" which this item is being imported - - Note we aren't even *trying* to remember its exact locality. - """ - for name,as in names: - if not self.imports.has_key(name): - self.imports[name] = [as] - else: - if as not in self.imports[name]: - self.imports[name].append(as) - - def addFromImport(self,modname,names): - """Remember a from import statement. - - `modname` is the name of the module "from" which things are - being imported. - - `names` is a list of ``(name,as)`` tuples, where ``name`` - is the name of the item being imported, and ``as`` is either - None of else the name "as" which this item is being imported - - Note we aren't even *trying* to remember its exact locality. - """ - if not self.from_imports.has_key(modname): - self.from_imports[modname] = {} - - dict = self.from_imports[modname] - for name,as in names: - if not dict.has_key(name): - dict[name] = [as] - else: - if as not in dict[name]: - dict[name].append(as) - - def isGlobal(self,name): - return self.globals.has_key(name) - - def getClassNames(self): - return self.class_list - #return self.classes.keys() - - def getClass(self,name): - return self.classes[name] - - def getFunctionNames(self): - return self.function_list - #return self.functions.keys() - - def getFunction(self,name): - return self.functions[name] - - def getAttributeNames(self): - return self.attribute_list - #return self.attributes.keys() - - def getAttribute(self,name): - return self.attributes[name] - - def getAttributeDocstring(self,name): - """Return an attribute docstring, or None - """ - return self.attributes[name] - - def getImports(self): - """Return our "import"s, but not in any particular order. - """ - return self.imports - - def getFromImports(self): - """Return our "from ... import"s, but not in any particular order. - """ - return self.from_imports - - def getFromImportNames(self,name): - return self.from_imports[name] - - def getSelf(self): - """Return the name used for "self". Doesn't do much elsewhere. - - (Actually, for a method *or* a function, it returns the name - of the first argument.) - """ - return None - - def _show_body(self,stream,indent=0): - spaces = indent*" " - - if self.docstring: - self.docstring.show(stream,spaces+" ") - - if self.imports: - names = self.imports.keys() - stream.write("%s Import %s\n"%(spaces,string.join(names,", "))) - - if self.from_imports: - modnames = self.from_imports.keys() - for mod in modnames: - names = self.from_imports[mod] - stream.write("%s From %s import %s\n"%\ - (spaces,mod,string.join(names,", "))) - - # Should we sort things alphabetically within each list? - - if self.verbose: - globals = self.globals.keys() - if globals: - stream.write("%s Global statements\n"%spaces) - for name in globals: - stream.write("%s %s\n"%(spaces,name)) - - attributes = self.attributes.keys() - if attributes: - stream.write("%s Attributes\n"%spaces) - for name in attributes: - self.attributes[name].show(stream,indent+4) - - class_names = self.classes.keys() - if class_names: - for name in class_names: - self.classes[name].show(stream,indent+2) - - func_names = self.functions.keys() - if func_names: - for name in func_names: - self.functions[name].show(stream,indent+2) - - def show(self,stream,indent=0): - """Override as necessary.""" - stream.write("%s%s %s\n"%(" "*indent,self.__class__.__name__, - self.name)) - self._show_body(stream,indent) - - # :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - # Experimental node code... - def find_docstrings(self): - """Find each docstring in our subtree. - """ - if self.docstring: - self.docstring.transform_interpreted(self) - for child in self.children: - child.find_docstrings() - # :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - - -# ---------------------------------------------------------------------- -class Package(Base): - """The representation of a Python package. - - Unlike the other children of `Base`, this class actually visits - its members itself - that is, it is self-constructing. - """ - - def __init__(self,settings,directory,parent=None,debug=0): - """Instantiate a new package. - - If this is a "sub" package, then `parent` should be a Package - instance, within which we may be found... - - `settings` will give the parsing settings -- `verbose_parse` will - cause the generation of a message for each stage of the production - of our data, and `debug` will give a message for each "entity" - in the AST that we visit. - """ - - self.settings = settings - self.verbose = settings.verbose_parse - self.debug = debug - - path = os.path.expanduser(directory) # expand "~" - path = os.path.expandvars(directory) # expand "$fred" or "%fred%" - path = os.path.abspath(path) # expand to a 'full' path - path = os.path.normpath(path) # sort out "/fred" versus "/fred/" - self.directory = path - """The `directory` is our best guess as to the actual - path to the package.""" - - # Take the package name to be the final component - base,name = os.path.split(path) - if parent: - fullname = parent.fullname + "." + name - Base.__init__(self,settings,name,fullname) - else: - # With no parent, our name and fullname are the same. - Base.__init__(self,settings,name,name) - - self.modules = {} - """Remember the modules (or Python files, really) - in this package. The key is the module name, the - value the Module instance for this module. - """ - - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Experimental scope setup - self.scope_init() - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - self.parse_modules() - - def parse_modules(self): - """Locate our constituent modules and parse them. - """ - files = os.listdir(self.directory) - - if "__init__.py" not in files: - raise ValueError,\ - "Directory %s does not contain an __init__.py file"%\ - self.directory - - # Parsing the __init__.py file may give us further information, - # such as an __all__ value, which we may later want to use to - # determine which files to read and parse, and which to ignore - path = os.path.join(self.directory,"__init__.py") - self.addModule(Module(self.settings,path,package=self, debug=self.debug)) - - # But, for the moment, just parse all the Python files... - for file in files: - name,ext = os.path.splitext(file) - if name == "__init__": - continue - elif ext in [".py",".pyw"]: - path = os.path.join(self.directory,file) - self.addModule(Module(self.settings,path,package=self, - debug=self.debug)) - - def addModule(self,mod): - self.modules[mod.name] = mod - self.children.append(mod) - - def getModuleNames(self): - return self.modules.keys() - - def getModule(self,name): - return self.modules[name] - - def getModules(self): - """Return a list of Module instances. - """ - return self.modules.values() - - def show(self,stream,indent=0): - stream.write("%sPackage %s"%(" "*indent,self.name)) - if self.directory: - stream.write("(in %s)\n"%self.directory) - else: - stream.write("\n") - - names = self.modules.keys() - names.sort() - for name in names: - self.modules[name].show(stream) - - def show_ast(self,stream): - """Print out a representation of our ASTs. - """ - names = self.modules.keys() - names.sort() - for name in names: - self.modules[name].show_ast(stream) - - -# ---------------------------------------------------------------------- -class Module(Base): - """The representation of a Python module. - - This class also knows how to *parse* a Python module. - - Still known to be missing: - - - visitLambda (I shudder) - - should we also do visitExec? - - - visitAssign - - visitAugAssign - - These last two are needed to allow us to link a Name with its value(s). - - If attribute docstrings are to be found, then the AST on which we - act must first have been processed with `find_attr_docs()`. - - Note we also need to visit the *other* sorts of assignment, so - we can update our Module with any globals used therein... - """ - - def __init__(self,settings,filename,docstring=None,package=None,debug=0): - """Instantiate a new module. - - If this is a module within a package, then `package` should be - a Package instance. - - `settings` will give the parsing settings -- `verbose_parse` will - cause the generation of a message for each stage of the production - of our data, and `debug` will give a message for each "entity" - in the AST that we visit. - """ - self.settings = settings - self.package = package - self.verbose = settings.verbose_parse - self.debug = debug - - self.docformat,self.language = utils.docformat("plaintext") - - filename = os.path.expanduser(filename) # expand "~" - filename = os.path.expandvars(filename) # expand "$fred" or "%fred%" - filename = os.path.abspath(filename) # expand to a 'full' path - filename = os.path.normpath(filename) # and tidy up - self.filename = filename - """The `filename` is our best guess as to the actual - path to the module.""" - - dir,file = os.path.split(filename) - name,ext = os.path.splitext(file) - - if package: - fullname = package.fullname + "." + name - Base.__init__(self,settings, name,fullname,docstring) - else: - # Without a package, our name and fullname are the same - Base.__init__(self,settings, name,name,docstring) - - self.ast = None - """The parse tree, as produced by compiler. - """ - - self.globals_used = {} - """Remember the globals promulgated on this module - (that is, occurrences of a global statement, associated - with assignment *to* the named global, within the same - scope). - - The key is the global name, the value a list of - (scope,superscope) pairs. - """ - - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Experimental scope setup - self.scope_init() - self.scope_define_parent(parent=package,module=self) - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - # Now, parse ourselves! - self.parse_module() - - # And then perform our "finishing off" operations - self.determine_docformat() - - if self.verbose: - print >>sys.stderr, \ - " >> docformat: %s, language %s"%(self.docformat, - self.language) - - if self.docformat == utils.RESTRUCTUREDTEXT: - if self.verbose: - print >>sys.stderr," .. parsing docstrings in module",\ - self.name - parser = self.getParser() - self.parse_docstrings(parser) - if self.verbose: - print >>sys.stderr," .. finding nodes" - self.find_docstrings() - - def parse_module(self): - """Parse ourselves (!) - """ - if self.verbose: print >>sys.stderr, "*** Parsing file",self.filename - self.ast = compiler.parseFile(self.filename) - - # "Comb" the tree to sort out attribute docstrings - if self.verbose: print >>sys.stderr, " Locating attribute docstrings" - utils.find_attr_docs(self.ast) - - # And to link names and their values in assignments - if self.verbose: print >>sys.stderr, " Locating attribute values" - utils.find_attr_vals(self.ast) - - if self.verbose: print >>sys.stderr, " Walking the tree" - compiler.walk(self.ast,self) - - def determine_docformat(self): - """Call this after reading in the module, before "using" it. - - This detects whether there is a module value called __docformat__, and - if so, inspect its value. - """ - if self.attributes.has_key("__docformat__"): - name = self.attributes["__docformat__"] - try: - value = name.actualLastValue() - except ValueError, detail: - print >>sys.stderr, "Ignoring __docformat__" - print >>sys.stderr, detail - return - self.docformat,self.language = utils.docformat(value) - - def addGlobalUsed(self,name,where): - if self.globals_used.has_key(name): - self.globals_used[name].append(where) - else: - self.globals_used[name] = [where] - - def getObscureGlobals(self): - """Return a list of (name,[fullname]) tuples - """ - globals = self.globals_used.keys() - globals.sort() - attributes = self.attributes.keys() - obscure = [] - for name in globals: - if name not in attributes: - wherelist = self.globals_used[name] - obscure.append( (name,wherelist) ) - return obscure - - # ---------------------------------------------------------------------- - # Extraction code - - def _scopes(self,scope,superscope): - str = "" - if scope: - str = str + " in %-8s %-12s"%(scope.__class__.__name__, - `scope.name`) - if superscope: - str = str + " in %-8s %-12s"%(superscope.__class__.__name__, - `superscope.name`) - return str - - def _report(self,what,name,scope,superscope): - print >>sys.stderr,\ - "%-8s %-12s"%(what,name) + self._scopes(scope,superscope) - - def visitModule(self,node,scope=None,superscope=None): - """Visit a Module node - heh, this must be us! - - We expect `scope` and `superscope` both to be None - """ - if self.debug: - self._report("Module",self.filename,scope,superscope) - - self.docstring = make_Docstring(node.doc, self.settings) - - # Visit our children with ourselves as their scope - self.visit(node.node,self) - - def visitClass(self,node,scope=None,superscope=None): - """Visit a Class node - - `scope` is the scope of this Class, and `superscope` is - that scope's scope (if any). - - We don't yet cope well with things like:: - - class Fred(docutils.nodes) - - - this will need fixing. - """ - if self.debug: - self._report("Class",node.name,scope,superscope) - - if scope: - fullname = "%s.%s"%(scope.fullname,node.name) - else: - fullname = node.name - - # If we were nice, we'd resolve the - # Getattr(Getattr(Name('docutils'), 'nodes'), '_TextElement') - # that we get for something like docutils.nodes into something - # easier to deal with... - cls = Class(self.settings,node.name,fullname,node.bases,node.doc) - if scope: - scope.addClass(cls) - - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Experimental scope work - if scope: - cls.scope_define_parent(scope,self) - scope.scope_define_name(node.name,fullname,cls) - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - # Visit our children with ourselves as their scope, - # and our scope as their superscope - self.visit(node.code,cls,scope) - - def visitFunction(self,node,scope=None,superscope=None): - """Visit a Function node (nb: this means "function or method") - - `scope` is the scope of this Function, and `superscope` is - that scope's scope (if any). - """ - if self.debug: - if isinstance(scope,Class): - self._report("Method",node.name,scope,superscope) - else: - self._report("Function",node.name,scope,superscope) - - fullname = "%s.%s"%(scope.fullname,node.name) - - if isinstance(scope,Class): - fun = Method(self.settings,node.name,fullname, - node.argnames,node.defaults,node.flags,node.doc) - else: - fun = Function(self.settings,node.name,fullname, - node.argnames,node.defaults,node.flags,node.doc) - scope.addFunction(fun) - - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Experimental scope work - fun.scope_define_parent(scope,self) - scope.scope_define_name(node.name,fullname,fun) - for argname in node.argnames: - fullname = "%s.%s:%s"%(scope.fullname,node.name,argname) - name = Argument(self.settings,argname,fullname) - name.scope_define_parent(fun,self) - fun.scope_define_name(argname,fullname,name) - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - # Visit our children with this function as the scope, and - # our scope as the superscope - self.visit(node.code,fun,scope) - - def visitAssAttr(self,node,scope,superscope=None): - """Visit an attribute assignment node. - - For example:: - - self.a = 1 - - Note that this is assignment to a *single* attribute only. - - `scope` is the scope of this assignment, and `superscope` is - that scope's scope (if any). - """ - if self.debug: - self._report("attr",node.attrname,scope,superscope) - - # An AssAttr contains: - # .expr - the expression on the LH of the dot - # .attrname - the attribute name on the RH of the dot - # .flags - # We're (to a first approximation) only interested in - # assignments of the form ., where "" - # is whatever name was passed down as the first argument - # to a containing method. - if isinstance(node.expr,compiler.ast.Name): - fullname = "%s:%s.%s"%(scope.fullname,node.expr.name,node.attrname) - selfname = "%s.%s"%(node.expr.name,node.attrname) - if node.expr.name == scope.getSelf(): - what = InstanceValue - else: - what = Name # hmm, this feels wrong, but I do want to distinguish - - if hasattr(node,"docstring"): - #name = what(node.attrname,fullname,node.expr.name,node.docstring) - name = what(selfname,fullname,node.expr.name,node.docstring) - else: - #name = what(node.attrname,fullname,node.expr.name) - name = what(selfname,fullname,node.expr.name) - if hasattr(node,"assign_expr"): - name.setValue(node.assign_expr) - scope.addAttribute(selfname,name) - - if node.expr.name == scope.getSelf() and scope.__class__ == Class: - name.set_class(scope) - - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # We should do *something* for our experimental scope - # work at this point - but I guess it would be to add - # this name to the class that contains the method in - # which we are - and if we're actually in a *function* - # which is to be assigned to a class at run-time (for - # instance), that is a bit difficult (!). So ignore - # this case for now... - # OR maybe we should be adding in "fullname" and not - # "name" each time we add something to the scope. - name.scope_define_parent(scope,self) - scope.scope_define_name(selfname,fullname,name) - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - else: - # What to do here??? - # - it's presumably something like fred[3].attr, so I guess - # we don't want to do anything very clever with it, at least - # for the moment. - - print - print ">>> Unhandled AST node <<<" - print " visitAssAttr: %s"%(node) - print " i.e.: %s"%(utils.stringify_expr(node)) - print " location: Module %s, %s %s, %s %s"%\ - (self.scope_module.name, - scope.__class__.__name__,scope.name, - superscope.__class__.__name__,superscope.name) - print - - # Hmm - what scope and superscope does the - # subexpression *really* want... - # - is there any point (from a DPV point of view) - # in following down the innards of the expression? - self.visit(node.expr,scope,superscope) - - def visitAssName(self,node,scope=None,superscope=None): - """Visit a name assignment node. - - For example:: - - a = 1 - - Note that this is assignment to a *single* name only. - - `scope` is the scope of this assignment, and `superscope` is - that scope's scope (if any). - """ - if self.debug: - self._report("name",node.name,scope,superscope) - - # For the moment, allow any assignments - later we may restrict - # this (e.g., to Module, Class, __init__ method) - if scope: - fullname = "%s:%s"%(scope.fullname,node.name) - else: - fullname = node.name - - if scope.__class__ == Module: - what = ModuleValue - elif scope.__class__ == Class: - what = ClassValue - else: - what = Name - - if hasattr(node,"docstring"): - name = what(self.settings,node.name,fullname, - docstring=node.docstring) - else: - name = what(self.settings,node.name,fullname) - if hasattr(node,"assign_expr"): - name.setValue(node.assign_expr) - if scope.isGlobal(node.name): - name.setGlobal() - scope.addAttribute(node.name,name) - - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Experimental scope work - if scope: - name.scope_define_parent(scope,self) - scope.scope_define_name(node.name,fullname,name) - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - # Hmm - check whether the name is a global, and if so, - # tell our Module about it... - if scope.isGlobal(node.name): - self.addGlobalUsed(node.name,scope.fullname) - - def visitAssTuple(self,node,scope=None,superscope=None): - """Visit a tuple assignment statement. - - For example: - - a, b, c = 1, 2, 3 - - Although we're not directly interested in these for docstring - purposes, we *may* want to know that a variable has participated - in one (why?). - """ - for item in node.nodes: - self.visit(item,scope,superscope) - - def visitAssList(self,node,scope=None,superscope=None): - """Visit a list assignment statement. - - For example: - - a, b, c = [1, 2, 3] - - Although we're not directly interested in these for docstring - purposes, we *may* want to know that a variable has participated - in one (why?). - """ - for item in node.nodes: - self.visit(item,scope,superscope) - - def visitGlobal(self,node,scope=None,superscope=None): - """Visit a global statement node - - `scope` is the scope of this global, and `superscope` is - that scope's scope (if any). - """ - if self.debug: - for name in node.names: - self._report("global",name,scope,superscope) - - for name in node.names: - scope.addGlobal(name) - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Experimental scope work - scope.scope_define_global(name) - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - def visitYield(self,node,scope=None,superscope=None): - """Visit a yield statement. - - The presence of a yield statement within a function indicates - that it is a generator (well, unless that statement is - unreachable - but we shall not worry about that, at least - for the moment!). - - `scope` is the scope of this statement, and `superscope` is - that scope's scope (if any). - """ - if self.debug: - self._report("yield",node.value,scope,superscope) - - # So tell our scope that it is (probably) a generator - scope.generator = 1 - - # There seems little point in visiting our value, but on - # the other hand, why not - self.visit(node.value,scope,superscope) - - - def visitImport(self,node,scope=None,superscope=None): - """Visit an import statement node - - `scope` is the scope of this import statement, and - `superscope` is that scope's scope (if any). - """ - if self.debug: - self._report("import","",scope,superscope) - print >>sys.stderr, "%8s %12s %s"%(" "," ",node.names) - - if scope: - scope.addImport(node.names) - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Experimental scope work - for item in node.names: - fullname = scope.fullname + "." + item[0] - name = ImportName(self.settings,item[0],fullname) - name.scope_define_parent(scope,self) - scope.scope_define_name(item[0],fullname,name) - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - def visitFrom(self,node,scope=None,superscope=None): - """Visit a from .. import statement node - - The rules for `scope` and `superscope` should be identical - to those for `visitImport()`. - """ - if self.debug: - self._report("from",node.modname,scope,superscope) - print >>sys.stderr, "%8s %12s %s"%(" "," ",node.names) - - if scope is not None: - scope.addFromImport(node.modname,node.names) - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Experimental scope work - for item in node.names: - fullname = scope.fullname + "." + item[0] - name = ImportName(self.settings,item[0],fullname) - name.scope_define_parent(scope,self) - scope.scope_define_name(item[0],fullname,name) - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - # ---------------------------------------------------------------------- - - def _prt(self,stream,indent,name,place): - stream.write("%sGlobal %-10s in %s\n"%(" "*indent,name,place)) - - def _and(self,stream,indent,name,place): - stream.write("%s %-10s and in %s\n"%(" "*indent," "*len(name), - place)) - - def _show_odd_globals(self,stream,indent=0): - """Show which global names are defined and used below module level - - Obviously (!) we are only interested in things which are not - already known to be module level attributes - we want to warn - the user about things that are defined in non-obvious places. - """ - obscure = self.getObscureGlobals() - done_header = 0 - for name,wherelist in obscure: - if not done_header: - stream.write("Globals defined *and used* below" - " the top level:\n") - done_header = 1 - self._prt(stream,indent+2,name,wherelist[0]) - for place in wherelist[1:]: - self._and(stream,indent+2,name,place) - - def show(self,stream,indent=0): - stream.write("%sModule %s"%(" "*indent,self.name)) - if self.filename: - stream.write("(in file %s)\n"%self.filename) - else: - stream.write("\n") - self._show_body(stream,indent) - self._show_odd_globals(stream,indent) - - def show_ast(self,stream): - """Print out a representation of our AST. - """ - stream.write("AST for module %s\n"%self.name) - utils.treeprint(stream,self.ast) - -# ---------------------------------------------------------------------- -class Class(Base): - """The representation of a Python class.""" - - def __init__(self,settings,name,fullname,bases,docstring): - Base.__init__(self,settings,name,fullname,docstring) - - self.bases = bases or [] - """A list of the base classes for this class.""" - - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Experimental scope setup - self.scope_init() - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - def is_callable(self): - """Does it make sense to call an object of this type? - - NB: it only makes sense to call this *after* the class has - been parsed! - """ - return self.functions.has_key("__call__") - - def show(self,stream,indent=0): - basestr = "" - if self.bases: - names = self.getBaseNames() - basestr = "(" + string.join(names,",") + ")" - stream.write("%sClass %s%s\n"%(" "*indent,self.name,basestr)) - self._show_body(stream,indent) - - def getBaseNames(self): - names = [] - for base in self.bases: - # Unfortunately, we don't yet cope with base classes - # like "docutils.nodes" in our visitor... - # Make the best of it we can, for now - try: - names.append(base.name) - except: - names.append("???") - return names - - # Is it worth doing this? - addMethod = Base.addFunction - getMethodNames = Base.getFunctionNames - - -# ---------------------------------------------------------------------- -class Function(Base): - """The representation of a Python function (and thus also of a method). - - But see also `Method`. - """ - - def __init__(self,settings,name,fullname,args,defaults,flags,docstring): - Base.__init__(self,settings,name,fullname,docstring) - - self.args = args - """The arguments for this function or method.""" - - self.defaults = defaults - """The defaults (if any) for the latter arguments. - - Note that if there are 4 arguments, and only the last - 2 have defaults, then this list will be 2 items long. - """ - - self.flags = flags - """Used to indicate \*args and \**kwargs. - """ - - self.generator = 0 - """Set to true if this function appears to be a generator - (i.e., it contains a "yield" statement). Obscure code that - doesn't actually *reach* the yield statement - for instance:: - - def fred(): - print "3" - if 1: return - yield "2" - - will also, incorrectly, be recognised as a generator - tough. - """ - - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Experimental scope setup - self.scope_init() - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - def is_callable(self): - """Does it make sense to call an object of this type? - """ - return 1 - - def args_label(self): - """Return the specialised label we use for all of our arguments. - """ - return self.label() + "---args" - - def getArgs(self): - """Return a representation of our arguments as a list (of strings). - - This is then suitable for joining with commas and displaying. - """ - args = utils.merge_args(self.args,self.defaults) - if not args: - return args - - # The file compiler/consts.py defines CO_VARARGS=1 and - # CO_VARKEYWORDS=2. - - # The method Transformer.com_arglist() in file compiler/transformer.py - # handles a function's argument list. - - # According to that, if there's a "*args" item, then "flags" gets the - # CO_VARARGS bit set, and if there's a "**args" item, then "flags" gets - # the CO_VARKEYWORDS bit set. In either case, we *know* they've got to - # be the last arguments, so we can count backwards (as we do for - # default arguments). - - if self.flags & compiler.consts.CO_VARKEYWORDS: - # If it's there, this must always be the last one... - args[-1] = "**" + args[-1] - - if self.flags & compiler.consts.CO_VARARGS: - # But this one might be last OR last but one - if self.flags & compiler.consts.CO_VARKEYWORDS: - args[-2] = "*" + args[-2] - else: - args[-1] = "*" + args[-1] - - return args - - def show(self,stream,indent=0): - stream.write("%s%s %s(%s)\n"%(" "*indent,self.__class__.__name__, - self.name, - string.join(self.getArgs(),", "))) - self._show_body(stream,indent) - - def getSelf(self): - """For a method, return the name used for "self". - - (Actually, for a method *or* a function, return the name of - the first argument - we need it on functions as well in case - someone is defining a function later to be assigned to a class - and used as a method.) - """ - if len(self.args) > 0: - return self.args[0] - else: - return None - - -# ---------------------------------------------------------------------- -class Method(Function): - """Just to get the class name right, I'm afraid... - """ - pass - - -# ---------------------------------------------------------------------- -class Name(ScopeMixin): - """Information about use of a name in assignment. - - STILL UNDER CONSTRUCTION - - Test using pysource.py's "--show" option... - - - We are not interested in *all* names, nor in all information - about them... - - (We *could* inherit from Base, but that really brings too much other - stuff that we don't need with it - and it doesn't *quite* seem worth - having a mixin class (although the more I work with this, the more - that seems a wrong decision - maybe next refactor time will change - things.) - """ - - def __init__(self,settings,name,fullname,selfname=None,docstring=None): - """Instantiate a new Name. - - * `settings` -- the settings for the parser - * `name` -- the name of this, erm, name - * `fullname` -- the "fully qualified" name - this is the "path" from - our top-level entity down to this name (e.g., module.class.name) - * `selfname` -- if this is an instance attribute, the string used - as the "self" equivalent - * `docstring` -- the docstring for this name, if any. - """ - - self.name = name - """The name of this, erm, name. - """ - - self.fullname = fullname - """The fully qualified name of this name - - for instance, for a name `fred` in a class `Jim` - in a module `bob`, this would be "bob.Jim.fred" - """ - - self.docstring = make_Docstring(docstring, settings) - """The docstring for this name, or None. - Note that, at least for the moment, we're only supporting - one docstring for an entity. See the equivalent comment - in `Base`. - """ - - self.firstuse = None - """Remember the first use of this name - i.e., what is - assigned to it. The value stored is the AST expression - assigned to our name. - """ - - self.lastuse = None - """Also remember the last use of this name. The value - stored is the AST expression, as for firstuse. - """ - - self.reused = 0 - """Assume it has not been assigned to more than once. - If it has, then we can't *really* report on its 'content', - and `self.firstuse` should be ignored. - """ - - self.selfname = selfname - """If this name is referred to as something like 'self.name' - then we want to remember the string used as 'self' (since the - user *might* be using something else). This will be ``None`` - if there is no 'prefix'. - """ - - self.isglobal = 0 - """True if this name is global to its module. - """ - - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Experimental scope setup - self.scope_init() - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - def parse_docstrings(self,parser): - """If we are meant to, parse our docstrings. - - (The oddly plural name is for compatibility with those things - that inherit from `Base` - another reason for thinking that a - mixin class may be about due...) - """ - if self.docstring: - self.docstring.parse(parser) - - # :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - # Experimental node code... - def find_docstrings(self): - """Find each docstring in our subtree. - - (The oddly plural name is for compatibility with those things - that inherit from `Base` - another reason for thinking that a - mixin class may be about due...) - """ - if self.docstring: - self.docstring.transform_interpreted(self) - # :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - - def is_callable(self): - """Does it make sense to call an object of this type? - """ - return 0 - - def label(self): - """Return an XML-legal name for this object. - - Note that we implicitly assume that all objects have their - output XML/HTML representation written to the same file - - i.e., that we do not have to worry about references that - are anything beyond simple names. - - (another duplicate of a method in Base) - """ - str = string.replace(self.fullname,".","-") - str = string.replace(str,":","--") - return str - - def setValue(self,expr): - self.lastuse = expr - if not self.firstuse: - self.firstuse = expr - else: - self.reused = 1 - - def setGlobal(self): - self.isglobal = 1 - - def isGlobal(self): - return self.isglobal - - def getDocstring(self): - return self.docstring - - def getSelfName(self): - return self.selfname - - def getValueString(self): - if self.reused or not self.firstuse: - return None - else: - return utils.stringify_expr(self.firstuse) - - def getLastValueString(self): - """Return the stringified value of this name, or None. - """ - return utils.stringify_expr(self.lastuse) - - def actualLastValue(self): - """Return the actual value assigned to this name. - - If the value assigned is a constant, then return it, otherwise - raise a ValueError (we can't just return NULL because that *is* - a sensible constant!). - """ - thing = self.lastuse - # See utils.stringify_expr() for information on what we think - # we're doing here... - if isinstance(thing,compiler.ast.Const): - return thing.value - else: - raise ValueError,"Value assigned to %s is not a constant:\n" \ - "(%s)"%(self.getSelfName(),self.getLastValueString()) - - def getAsString(self): - str = self.name - val = self.getValueString() - if val: - str += " = " + val - return str - - def show(self,stream,indent=0): - """Override as necessary.""" - stream.write("%s%s %s"%(" "*indent,self.__class__.__name__, - self.getAsString())) - if self.isglobal: - stream.write(" (global)\n") - else: - stream.write("\n") - if self.docstring: - self.docstring.show(stream," "*(indent+2)) - - -# ---------------------------------------------------------------------- -class Argument(Name): - """An argument to a method or function. - - This is a separate class just to get the class name right, I'm afraid... - """ - pass - - -# ---------------------------------------------------------------------- -class ModuleValue(Name): - """A name defined by assignment at the top level of a module. - - This is a separate class just to get the class name right, I'm afraid... - """ - pass - - -# ---------------------------------------------------------------------- -class ClassValue(Name): - """A name defined by assignment within a class definition. - - This is a separate class just to get the class name right, I'm afraid... - """ - pass - - -# ---------------------------------------------------------------------- -class InstanceValue(Name): - """An instance defined by assignment within a method - e.g., self.thing - - TO DO: Hmm - I need to actually *implement* the use of `self.our_class` - and `self.see_also`. - """ - - def __init__(self,*args,**kws): - Name.__init__(self,*args,**kws) - - self.our_class = None - """If we are self.thing in a method, then "self" refers to a class - (the one enclosing the method!), and this will be a reference to it. - """ - - self.see_also = None - """If the class already defined a `ClassInstance` of this name, - then we'll ultimately want a reference to that class here, so - that our output can say "see also class instance XXX". - """ - - def set_class(self,klass): - """Indicate which Class we really belong to. - """ - self.our_class = klass - - -# ---------------------------------------------------------------------- -class ImportName(Name): - """A name assigned by "import" or "from ... import" - - Should we distinguish these? ((yes)) - - This is a separate class just to get the class name right, I'm afraid... - - NB: we don't yet deal with "import ... as ..." - """ - - def is_callable(self): - """Does it make sense to call an object of this type? - - Unfortunately, if it's something imported with "from ... import" - there is no simple way of knowing - so maybe err on the side of - assuming so. - - ((Note that this is actually a good argument for separating out - the two sorts of import, since we know *modules* are not callable, - and "import" just makes modules visible.)) - """ - return 1 - - -# ---------------------------------------------------------------------- -def test_parse_module(filename): - print "Reading file %s"%filename - return Module(filename,debug=0) - -def test_show_ast(thing): - print - print "AST" - print "===" - thing.show(sys.stdout) - -def test_show_scopes(thing): - print - print "Scopes" - print "======" - thing.scope_show() - -def test(): - print "Testing pysource/visit.py" - if len(sys.argv) <= 1: - print "Usage: pysource/visit.py " - return - filename = sys.argv[1] - thing = test_parse_module(filename) - test_show_ast(thing) - test_show_scopes(thing) - -if __name__ == "__main__": - test() diff --git a/sandbox/wilk/french/docutils.conf b/sandbox/wilk/french/docutils.conf deleted file mode 100644 index 5ebb1b126..000000000 --- a/sandbox/wilk/french/docutils.conf +++ /dev/null @@ -1,3 +0,0 @@ -[options] - -language-code: fr diff --git a/sandbox/wilk/french/quickstart-fr.txt b/sandbox/wilk/french/quickstart-fr.txt deleted file mode 100644 index d6d0691ce..000000000 --- a/sandbox/wilk/french/quickstart-fr.txt +++ /dev/null @@ -1,375 +0,0 @@ -Introduction à ReStructuredText -=============================== - -:Auteur: Richard Jones -:Version: 1.10 -:Traduction: William Dode - -.. contents:: - - -Ce texte contient des liens de la forme "(quickref__)". Ils sont -relatifs au manuel de référence utilisateur `Quick reStructuredText`_. -S'ils ne fonctionnent pas, référez vous au document `master quick -reference`_. - -__ -.. _Quick reStructuredText: http://docutils.sourceforge.net/docs/rst/quickref.html -.. _master quick reference: - http://docutils.sourceforge.net/docs/rst/quickref.html - - -Structure ---------- - -Pour commencer, il me semble que "Structured Text" n'est pas tout à fait la -bonne appellation. Nous devrions plutôt le nommer "Relaxed Text" qui contient -quelques schémas logiques. Ces schémas sont interprétés par un convertisseur -HTML pour produire "Very Structured Text" (un texte très structuré) qui pourra -être utilisé par un navigateur web. - -Le schéma le plus simple est le **paragraphe** (quickref__). -C'est un bloc de texte séparé par des lignes vides (une seule suffit). -Les paragraphes doivent avoir le même décalage -- c'est à dire des espaces -à gauche. Ces paragraphes produiront un texte décalé. Par exemple:: - - Ceci est un paragraphe. - Très court. - - Le texte de ce paragraphe sera décalé, - généralement utilisé pour des citations. - - En voilà un autre - -Le résultat donne : - - Ceci est un paragraphe. - Très court. - - Le texte de ce paragraphe sera décalé, - généralement utilisé pour des citations. - - En voilà un autre - -__ http://docutils.sourceforge.net/docs/rst/quickref.html#paragraphs - -Styles de texte ---------------- - -(quickref__) - -__ http://docutils.sourceforge.net/docs/rst/quickref.html#inline-markup - -Dans les paragraphes et le corps du texte, nous pouvons utiliser -des marqueurs pour *italique* avec "``*italique*``" ou **gras** -avec "``**gras**``". - -Si l'on souhaite qu'un texte apparaisse dans une police à chasse -fixe "````doubles apostrophes inversées````". -Notez qu'aucun traitement supplémentaire n'est apporté entre deux -doubles apostrophes inversées -- les astérisques, comme dans "``*``", -sont donc conservées en l'état. - -Si vous souhaitez utiliser un de ces caractères "spéciaux" dans -le texte, il n'y a généralement pas de problème -- reStructuredText -est assez malin. -Par exemple, cet astérisque * est traité correctement. Si vous -souhaitez par contre \*entourer un texte par des astérisques* -**sans** qu'il soit en italique, il est nécessaire d'indiquer que -l'astérisque ne doit pas être interprété. Pour cela il suffit de placer -une barre oblique inversée juste avant lui, comme ça "``\*``" (quickref__), ou -en l'entourant de doubles apostrophes inversées (litteral), comme cela :: - - ``\*`` - -__ http://docutils.sourceforge.net/docs/rst/quickref.html#escaping - -Listes ------- - -Il y a trois types de listes: **numérotées**, **avec puces** et -de **définitions**. Dans chaque cas, nous pouvons avoir autant -de paragraphes, sous-listes, etc. que l'on souhaite, tant que -le décalage à gauche est aligné sur la première ligne. - -Les listes doivent toujours démarrer un nouveau paragraphe --- c'est à dire qu'il doit y avoir un saut de ligne juste avant. - -Listes **numérotées** (par des nombres, lettres, chiffres romains; -quickref__) - -__ http://docutils.sourceforge.net/docs/rst/quickref.html#enumerated-lists - - En démarrant une ligne avec un numéro ou une lettre suivie d'un - point ".", une parenthèse droite ")" ou entouré par des parenthèses - -- comme vous préférez. Toutes ces formes sont reconnues:: - - 1. nombres - - A. Lettres en majuscule - qui continue sur plusieurs ligne - - avec deux paragraphes et tout ! - - a. lettres minuscules - - 3. avec une sous-liste qui démarre à un nombre différent - 4. faites attention à garder une séquence de nombre correcte ! - - I. majuscules en chiffres romains - - i. minuscules en chiffres romains - - (1) des nombres à nouveau - - 1) et encore - - Le résultat (note : Tous les styles de listes ne sont pas toujours - supportés par tous les navigateurs, vous ne verrez donc pas forcément - les effets complets) : - - 1. nombres - - A. Lettres en majuscule - qui continue sur plusieurs ligne - - avec deux paragraphes et tout ! - - a. lettres minuscules - - 3. avec une sous-liste qui démarre à un nombre différent - 4. faites attention à garder une séquence de nombre correcte ! - - I. majuscules en chiffres romains - - i. minuscules en chiffres romains - - (1) des nombres à nouveau - - 1) et encore - -Listes **à puces** (quickref__) - -__ http://docutils.sourceforge.net/docs/rst/quickref.html#bullet-lists - - De la même manière que pour les listes numérotées, il faut démarrer - la première ligne avec une puce -- soit "-", "+" ou "*":: - - * une puce "*" - - - une sous-liste avec "-" - - + à nouveau une sous-liste - - - une autre option - - Le résultat: - - * une puce "*" - - - une sous-liste avec "-" - - + à nouveau une sous-liste - - - une autre option - -Les listes de **définitions** (quickref__) - -__ http://docutils.sourceforge.net/docs/rst/quickref.html#definition-lists - - Comme les deux autres, les listes de définitions consistent en un - terme et la définition de ce terme. Le format est le suivant:: - - Quoi - Les listes de définitions associent un terme avec une définition. - - *Comment* - Le terme est une phrase d'une ligne, et la définition est d'un - ou plusieurs paragraphes ou éléments, décalés par rapport au terme. - Les lignes vides ne sont pas autorisées entre le terme et la définition. - - Le résultat: - - Quoi - Les listes de définitions associent un terme avec une définition. - - *Comment* - Le terme est une phrase d'une ligne, et la définition est d'un - ou plusieurs paragraphes ou éléments, décalés par rapport au terme. - Les lignes vides ne sont pas autorisées entre le terme et la définition. - -Préformatage -------------- -(quickref__) - -__ http://docutils.sourceforge.net/docs/rst/quickref.html#literal-blocks - -Pour inclure un texte préformaté sans traitement -il suffit de terminer le paragraphe par "``::``". Le texte préformaté est -terminé lorsqu'une ligne retombe au niveau du décalage précédent. Par exemple:: - - Un exemple:: - - Espaces, nouvelles lignes, lignes vides, et toutes sortes de marqueurs - (comme *ceci* ou \cela) sont préservés dans les bloc préformatés. - - Regardez ici, je suis descendu d'un niveau. - (mais pas assez) - - Fin de l'exemple - -Le résultat: - - Un exemple:: - - Espaces, nouvelles lignes, lignes vides, et toutes sortes de marqueurs - (comme *ceci* ou \cela) sont préservés dans les bloc préformatés. - - Regardez ici, je suis descendu d'un niveau. - (mais pas assez) - - Fin de l'exemple - -Notez que si le paragraphe contient seulement "``::``", il est ignoré. - - :: - - Ceci est un texte préformaté, - le paragraphe "::" est ignoré. - -Sections --------- -(quickref__) - -__ http://docutils.sourceforge.net/docs/rst/quickref.html#section-structure - -Pour diviser un texte en plusieurs sections, nous utilisons des -**en-têtes de section**. C'est à dire une seule ligne de texte (d'un -ou plusieurs mots) avec un ornement : juste en dessous et éventuellement -dessus aussi, avec des tirets "``-----``", égal "``=====``", tildes -"``~~~~~``" ou n'importe quel de ces caractères ``= - ` : ' " ~ ^ _ * + # < >`` -qui vous semble convenir. Un ornement simplement en dessous n'a pas la -même signification qu'un ornement dessus-dessous avec le même caractère. -Les ornements doivent avoir au moins la taille du texte. Soyez cohérent, -les ornements identiques sont censés être du même niveau:: - - Chapitre 1 - ========== - - Section 1.1 - ----------- - - Sous-section 1.1.1 - ~~~~~~~~~~~~~~~~~~ - - Section 1.2 - ----------- - - Chapitre 2 - ========== - -Le résultat de cette structure, sous la forme pseudo-XML:: - -

    - - Chapitre 1 - <section> - <title> - Section 1.1 - <section> - <title> - Sous-section 1.1.1 - <section> - <title> - Section 1.2 - <section> - <title> - Chapitre 2 - -(Pseudo-XML utilise une indentation et n'as pas de balises finale. Il -n'est pas possible de montrer le résultat, comme dans les autres exemples, -du fait que les sections ne peuvent être utilisées à l'intérieur d'un -paragraphe décalé. Pour un exemple concret, comparez la structure de -ce document avec le résultat.) - -Notez que les en-têtes de section sont utilisable comme cible de liens, -simplement en utilisant leur nom. Pour créer un lien sur la section Listes_, -j'écris "``Listes_``". Si le titre comporte des espaces, il est nécessaire -d'utiliser les doubles apostrophes inversées "```Styles de texte`_``". - -Pour indiquer le titre du document, utilisez un style d'ornement unique -en début de document. Pour indiquer un sous-titre de document, utilisez -un autre ornement unique juste après le titre. -Par exemple:: - - ================= - Titre du document - ================= - ---------- - Sous-titre - ---------- - - Titre de la section - =================== - - ... - -Notez que "Titre du document" et "Titre de la section" utilisent le signe -égal, mais sont différents et sans relation. Le texte et l'ornement peuvent -être de la même taille pour des questions d'esthétisme. - - -Images ------- -(quickref__) - -__ http://docutils.sourceforge.net/docs/rst/quickref.html#directives - -Pour inclure une image dans votre document, vous devez utiliser la directive__ -``image``. -Par exemple:: - - .. image:: images/biohazard.png - -Le résultat: - -.. image:: images/biohazard.png - -La partie ``images/biohazard.png`` indique le chemin d'accès au fichier -de l'image qui doit apparaître. Il n'y a pas de restriction sur l'image -(format, taille etc). Si l'image doit apparaître en HTML et que vous -souhaitez lui ajouter des informations:: - - .. image:: images/biohazard.png - :height: 100 - :width: 200 - :scale: 50 - :alt: texte alternatif - -Consultez la documentation__ complète de la directive image pour plus d'informations. - -__ ../../spec/rst/directives.html -__ ../../spec/rst/directives.html#images - - -Et ensuite ? ------------- - -Cette introduction montre les possibilités les plus courantes de reStructuredText, -mais il y en a bien d'autres à explorer. Le manuel de référence utilisateur -'Quick reStructuredText`_ est recommandé pour aller plus loin. Pour les détails complets -consultez `reStructuredText Markup Specification`_ [#]_. - -Les utilisateurs ayant besoin d'aide avec Docutils ou reStructuredText peuvent -`poster un message`_ sur la liste de diffusion `Docutils-Users mailing list`_. -Le `Docutils project web site`_ comporte davantage d'informations. - -.. [#] Si ce lien relatif ne fonctionne pas, consultez le document principal: - http://docutils.sourceforge.net/spec/rst/reStructuredText.html. - -.. _reStructuredText Markup Specification: - ../../spec/rst/reStructuredText.html -.. _poster un message: mailto:docutils-users@lists.sourceforge.net -.. _Docutils-Users mailing list: - http://lists.sourceforge.net/lists/listinfo/docutils-users -.. _Docutils project web site: http://docutils.sourceforge.net/ diff --git a/web/PyBanner016.png b/web/PyBanner016.png deleted file mode 100644 index 3c79b2ef7..000000000 Binary files a/web/PyBanner016.png and /dev/null differ diff --git a/web/default.css b/web/default.css deleted file mode 100644 index f5fa65b01..000000000 --- a/web/default.css +++ /dev/null @@ -1,18 +0,0 @@ -/* -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:date: $Date$ -:version: $Revision$ -:copyright: This stylesheet has been placed in the public domain. - -Default cascading style sheet for Docutils web pages. -*/ - -/* Most of the style rules are in here: */ -@import url(tools/stylesheets/default.css); - -body { - background-color: #F0F0FF } - -p img { - vertical-align: text-top } diff --git a/web/docutils.conf b/web/docutils.conf deleted file mode 100644 index 79c897b0d..000000000 --- a/web/docutils.conf +++ /dev/null @@ -1,4 +0,0 @@ -[options] - -# Files in the homepage's root directory want their own stylesheet: -stylesheet-path: ./default.css diff --git a/web/index.txt b/web/index.txt deleted file mode 100644 index 7c27f8ba2..000000000 --- a/web/index.txt +++ /dev/null @@ -1,436 +0,0 @@ -.. This document is *not* meant to be a model for good - reStructuredText usage. It is full of external hyperlinks, and - makes extensive use of anonymous hyperlink syntax, which is not - easy to follow from the source text. Please refer to the processed - HTML instead: http://docutils.sourceforge.net/index.html - -========================================== - Docutils: Python Documentation Utilities -========================================== - -:Date: $Date$ - -.. topic:: DOCUTILS PROJECT COORDINATOR LOOKING FOR WORK - - `The coordinator of the Docutils project, David Goodger, is looking - for a job, contract work, or consulting work. Does your company - need an experienced Python programmer and sysadmin? Know of - anybody who does? Please follow this link for more info. - <http://starship.python.net/~goodger/cv/>`__ - -The purpose of the Docutils project is to create a set of tools for -processing plaintext documentation into useful formats, such as HTML, -XML, and TeX. Several sources will be supported: - -- Standalone files (implemented). -- Inline documentation from Python modules and packages, extracted - with namespace context. -- `PEPs (Python Enhancement Proposals)`_ (implemented). -- And others as discovered. - -.. contents:: - - -Getting Started -=============== - -To get up & running quickly, see the Quick-Start_ section of the -README_ file. - -.. _Quick-Start: README.html#quick-start - - -Feedback -======== - -To the developers of an open source project, feedback is a great -motivator and very welcome. We're working on Docutils in our own way, -pushing it along a more-or-less linear path that makes sense to us, -but may not necessarily be useful to everyone else. Community -feedback helps steer development in immediately useful directions. - -In other words: if you tell us what you need, you may just get it! If -you really need something, please consider contributing_ to Docutils -in some way. - -Please post any feedback to the appropriate `mailing list`_, or `email -the project coordinator`__ directly. - -.. _contributing: `Please Contribute!`_ -__ mailto_ - - -Project Status -============== - -The Docutils project began with the merging of the reStructuredText__ -parser and the `Python Docstring Processing System`__ projects. The -merge has been completed, and those projects are now inactive. - -__ http://structuredtext.sourceforge.net/ -__ http://docstring.sourceforge.net/ - -Docutils currently consists of a reStructuredText_ parser, readers for -standalone files and PEPs_, and writers for HTML, LaTeX, -Docutils-native XML, plus pseudo-XML for testing purposes. Writers -for DocBook XML and PDF have been started, and a Python source reader -(docstring extraction with context) is also under way. There is a lot -of design and implementation work to do, which could greatly benefit -from a joint effort with existing projects. The project `To Do list`_ -is brimming over with ideas. - -This project should be considered highly experimental; we're learning -as we go. APIs are subject to change at any time. - -.. _PEPs: `PEPs (Python Enhancement Proposals)`_ - - -Requirements ------------- - -- Python 2.2 or later [#]_ must already be installed to run the code - and the test suite. The latest release is recommended (currently - 2.2.2). Python is available from http://www.python.org/. - -- Docutils uses Greg Ward's Optik_/optparse option processing package. - It is included in the Docutils distribution. - -.. [#] Python 2.1 may be used providing the compiler package is - installed. The compiler package can be found in the Tools/ - directory of Python's source distribution. - -.. _Optik: http://optik.sourceforge.net/ - - -Development Snapshots ---------------------- - -Development snapshots of the project files are available as .tgz -tarballs. They are generated automatically from CVS, usually within -an hour of a change being checked in. The snapshots are highly -recommended over the "official" releases, as they contain the latest -features and bug fixes. However, they may contain transient bugs or -incompatibilities. - -- `Snapshot of Docutils code, tests, documentation, and - specifications`__ -- `Snapshot of the Sandbox`__ (experimental, contributed code; see - `The Sandbox`_ below for details) -- `Snapshot of DocFactory project files`__ (this is a subset of the - Sandbox snapshot above; you don't need both) -- `Snapshot of web files`__ (the files that generate this web site) - -__ http://docutils.sourceforge.net/docutils-snapshot.tgz -__ http://docutils.sourceforge.net/docutils-sandbox-snapshot.tgz -__ http://docutils.sourceforge.net/docfactory-snapshot.tgz -__ http://docutils.sourceforge.net/docutils-web-snapshot.tgz - -`Anonymous CVS access`_ is available. You can also `browse the CVS -repository`_ and read the latest README_, HISTORY_, COPYING_, and FAQ_ -files. - - -Project Releases ----------------- - -Putting together an official "Release" of Docutils is a significant -effort, so it isn't done that often. Please note that the -`development snapshots`_ above contain the latest versions of project -files, and are strongly recommended. - -The `latest project release package`_ (Docutils 0.3, 2002-06-24) and -past project releases can be downloaded from the `project files -page`_. - - -.. _mailing list: - -Mailing Lists -------------- - -Users who have questions or need assistance with Docutils or -reStructuredText should first check the `Docutils FAQ`_. If the -question or problem is not answered there, please `post a message`__ -to the `Docutils-Users mailing list`__. - -Developers can keep up to date and help out by joining the mailing -lists. - -High-level discussions take place on the `Python Documentation Special -Interest Group (Doc-SIG) mailing list`__ (email to -Doc-SIG@python.org). - -Two lists have been set up specifically for developers of the Docutils -project: - -- Docutils-develop__, for implementation discussions - (email to docutils-develop@lists.sourceforge.net). -- Docutils-checkins__, to monitor CVS checkin messages (automatically - generated; normally read-only). - -The Doc-SIG_ has greater exposure and is therefore a better forum for -general discussions (such as reStructuredText syntax or the high-level -Docutils project model), whereas the Docutils-specific lists are more -focused on the implementation. - -.. _FAQ: -.. _Docutils FAQ: FAQ.html -__ mailto:docutils-users@lists.sourceforge.net -__ http://lists.sourceforge.net/lists/listinfo/docutils-users -__ http://mail.python.org/mailman/listinfo/doc-sig -__ http://lists.sourceforge.net/lists/listinfo/docutils-develop -__ http://lists.sourceforge.net/lists/listinfo/docutils-checkins - - -User Documentation -================== - -The latest working documents may be accessed individually below, or -from the ``docs`` directory of the `development snapshots`_ above. -They are also distributed with the `latest project release package`_, -but those may not be completely up to date. - -- `A ReStructuredText Primer`__ (HTML file, or `text source`__) -- `Quick reStructuredText`__ (user reference) -- `Docutils Front-End Tools`__ - -Also see the `Docutils FAQ`_. - -__ docs/rst/quickstart.html -__ docs/rst/quickstart.txt -__ docs/rst/quickref.html -__ docs/tools.html - - -Developer Documentation -======================= - -Specification -------------- - -PEPs (Python Enhancement Proposals) -``````````````````````````````````` - -- `PEP 287: reStructuredText Docstring Format`__ proposes a standard - markup syntax. [`PEP 287`__ in the `master repository`_] -- `PEP 257: Docstring Conventions`__ addresses docstring style and - touches on content. [`PEP 257`__ in the `master repository`_] -- `PEP 256: Docstring Processing System Framework`__ presents a - high-level generic processing proposal. [`PEP 256`__ in the `master - repository`_] -- `PEP 258: Docutils Design Specification`__ documents design issues - and implementation details for Docutils (this project), a specific - docstring processing system. [`PEP 258`__ in the `master - repository`_] - -Please note that PEPs in the `master repository`_ may not be current, -whereas the local versions are. - -__ spec/pep-0287.html -__ http://www.python.org/peps/pep-0287.html -__ spec/pep-0257.html -__ http://www.python.org/peps/pep-0257.html -__ spec/pep-0256.html -__ http://www.python.org/peps/pep-0256.html -__ spec/pep-0258.html -__ http://www.python.org/peps/pep-0258.html - - -Docutils Internals -`````````````````` - -- Notes__ (includes the Docutils `To Do list`_ and `Project - Policies`__) -- `The Docutils Document Tree`__ (incomplete) -- `Docutils Transforms`__ -- `Docstring Semantics`__ (incomplete) -- `Docutils Generic DTD`__ -- `OASIS XML Exchange Table Model Declaration Module`__ (CALS tables - DTD module) -- `Python Source Reader`_ (incomplete) -- `Docutils Python DTD`_ (experimental) - -__ spec/notes.html -__ spec/notes.html#project-policies -__ spec/doctree.html -__ spec/transforms.html -__ spec/semantics.html -__ spec/docutils.dtd -__ spec/soextblx.dtd -.. _Python Source Reader: spec/pysource.html -.. _Docutils Python DTD: spec/pysource.dtd - - -reStructuredText -```````````````` - -Please also see the `reStructuredText home page`__. - -- `An Introduction to reStructuredText`__ (includes the Goals__ and - History__ of reStructuredText) -- `reStructuredText Markup Specification`__ -- `reStructuredText Directives`__ -- `reStructuredText Interpreted Text Roles`__ -- `A Record of reStructuredText Syntax Alternatives`__ -- `Problems With StructuredText`__ - -__ rst.html -__ spec/rst/introduction.html -__ spec/rst/introduction.html#goals -__ spec/rst/introduction.html#history -__ spec/rst/reStructuredText.html -__ spec/rst/directives.html -__ spec/rst/interpreted.html -__ spec/rst/alternatives.html -__ spec/rst/problems.html - - -How-To's --------- - -- `Docutils Internationalization`__ -- `Creating reStructuredText Directives`__ - -__ spec/howto/i18n.html -__ spec/howto/rst-directives.html - - -The Sandbox -=========== - -The Sandbox__ is a place to play around, to try out and share ideas. -It's a part of the CVS repository but it isn't distributed as part of -Docutils releases (you can get a recent tarball from the `development -snapshots`_). Each developer who wants to play in it should create -their own subdirectory (suggested name: SourceForge ID, or given name -+ family initial). - -Please feel free to `visit the sandbox`__. - -It's OK to make a mess in the Sandbox! But please, play nice. - -__ -__ sandbox/ - - -Sandbox Projects ----------------- - -Anyone is welcome to contribute to any of these projects. Interested -developers are welcome to take on any projects which appear to be -dormant. Please direct any email to -docutils-develop@lists.sourceforge.net. - -* ZReST_, by Richard Jones, is a "ReStructuredText Document for Zope" - application that is complete and ready to install. - -* PySource_, by Tony Ibbs, is an experimental Python source Reader. - In some form, it will soon become part of core Docutils. There is - some related code in David Goodger's sandbox (pysource_reader_) and - a `Python Source Reader`_ document. - -* Docutils interface to PythonPoint_, also by Richard Jones, produces - PDF presentations using ReportLabs. - -* Engelbert Gruber has begun `LaTeX Writer`_ and `ReportLabs/PDF - Writer`_ components. - -* Oliver Rutherfurd has begun a `DocBook Writer`_ component and - `HT2HTML integration`_ component. - -* Gunnar Schwant's DocFactory_ is a wxPython GUI application for - Docutils. - -* Aahz has begun an `OpenOffice.org Writer`_. - -* Ian Bicking is working on code for a Wiki_. - -* Bill Bumgarner has written a `simple HTML writer`_ that doesn't rely - on CSS (stylesheets). - -.. _ZReST: sandbox/richard/ZReST/ -.. _PySource: sandbox/tibs/pysource/ -.. _pysource_reader: sandbox/davidg/pysource_reader/ -.. _PythonPoint: sandbox/richard/pythonpoint/ -.. _LaTeX Writer: sandbox/grubert/latex/ -.. _ReportLabs/PDF Writer: sandbox/grubert/rlpdf/ -.. _DocBook Writer: sandbox/oliverr/docbook/ -.. _HT2HTML integration: sandbox/oliverr/ht/ -.. _DocFactory: sandbox/gschwant/docfactory/doc/ -.. _OpenOffice.org Writer: sandbox/aahz/OO/ -.. _Wiki: sandbox/ianb/wiki/ -.. _simple HTML writer: sandbox/bbum/DocArticle/ - - -Please Contribute! -================== - -Please help this project succeed by contributing. We're looking for -all kinds of contributions: testing, ideas, code, bug reports, -administration, tasty snacks, computer equipment, and large sums of -money. There's a `To Do list`_ full of interesting ideas awaiting a -champion. If you're interested in participating in any way, please -`contact the project coordinator`__. - -__ mailto_ - - -Project Links -============= - -- `Project Summary page`__: `released files`__, `bug reports`__, - patches__, `mailing lists`__, and news__. -- `Docutils CVS repository`__ -- Project coordinator and architect: `David Goodger`_ -- Please direct discussions to the `Python Documentation Special - Interest Group (Doc-SIG)`__: doc-sig@python.org. -- Powered by |Python|__ -- Hosted by |SourceForge|__ - - __ http://sourceforge.net/projects/docutils/ - __ `project files page`_ - __ http://sourceforge.net/tracker/?group_id=38414&atid=422030 - __ http://sourceforge.net/tracker/?group_id=38414&atid=422032 - __ http://sourceforge.net/mail/?group_id=38414 - __ http://sourceforge.net/news/?group_id=38414 - - __ CVS_ - - __ Doc-SIG_ - - __ http://www.python.org/ - .. |Python| image:: PyBanner016.png - .. :border: 0 - - __ http://sourceforge.net/ - .. |SourceForge| image:: - http://sourceforge.net/sflogo.php?group_id=38414 - :alt: SourceForge Logo - .. :border: 0 - -.. _project files page: - http://sourceforge.net/project/showfiles.php?group_id=38414 -.. _Anonymous CVS access: http://sourceforge.net/cvs/?group_id=38414 -.. _CVS: -.. _browse the CVS repository: - http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/docutils/ -.. _To Do list: spec/notes.html#to-do -.. _README: README.html -.. _HISTORY: HISTORY.html -.. _COPYING: COPYING.html -.. _master repository: http://www.python.org/peps/ -.. _mailto: -.. _David Goodger: mailto:goodger@users.sourceforge.net -.. _Doc-SIG: http://www.python.org/sigs/doc-sig/ - -.. _latest project release package: - http://prdownloads.sourceforge.net/docutils/docutils-0.3.tar.gz - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: diff --git a/web/mirror/setext.txt b/web/mirror/setext.txt deleted file mode 100644 index 48d0ee6db..000000000 --- a/web/mirror/setext.txt +++ /dev/null @@ -1,27 +0,0 @@ -========================= - Setext Documents Mirror -========================= - -Here are `local copies of some Setext documents`__, made available to -document the prehistory of the Docutils_ project (and especially the -reStructuredText_ markup). - -__ -.. _Setext mirror: setext/ -.. _Docutils: ../ -.. _reStructuredText: ../rst.html - -The source for the original Setext (structure-enhanced text) documents -was http://www.bsdi.com/setext/, but it seems to have disappeared from -the Web. The files in the "`Setext mirror`_" are all the files -relating to Setext that I have (including `a tarball of the lot`__). - -__ setext/setext.tgz - -I have not been able to locate the originators of Setext, Ian Feldman -or Tony Sanders. If you know how to contact them, or if you know of -an official repository for the Setext documents, please `inform me`__. - -__ mailto:goodger@users.sourceforge.net - -David Goodger, 2002-03-25 diff --git a/web/rst.png b/web/rst.png deleted file mode 100644 index 1bc546c7b..000000000 Binary files a/web/rst.png and /dev/null differ diff --git a/web/rst.txt b/web/rst.txt deleted file mode 100644 index 42e8eaaf3..000000000 --- a/web/rst.txt +++ /dev/null @@ -1,225 +0,0 @@ -==================== - |reStructuredText| -==================== -------------------------------------------------- - Markup Syntax and Parser Component of Docutils_ -------------------------------------------------- - -:Date: $Date$ - -.. contents:: - -reStructuredText is an easy-to-read, what-you-see-is-what-you-get -plaintext markup syntax and parser system. It is useful for in-line -program documentation (such as Python docstrings), for quickly -creating simple web pages, and for standalone documents. -reStructuredText is designed for extensibility for specific -application domains. The reStructuredText parser is a component of -Docutils_. reStructuredText is a revision and reinterpretation of the -StructuredText_ and Setext_ lightweight markup systems. - -The primary goal of reStructuredText is to define and implement a -markup syntax for use in Python docstrings and other documentation -domains, that is readable and simple, yet powerful enough for -non-trivial use. The intended purpose of the markup is the conversion -of reStructuredText documents into useful structured data formats. - -See statemachine.py_ for an example of a Python module fully -documented using reStructuredText. - - -User Documentation -================== - -- `A ReStructuredText Primer`__ (HTML file, or `text source`__). -- `Quick reStructuredText`__ (user reference) - -Users who have questions or need assistance with Docutils or -reStructuredText should `post a message`__ to the `Docutils-Users -mailing list`__. - -__ docs/rst/quickstart.html -__ docs/rst/quickstart.txt -__ docs/rst/quickref.html -__ mailto:docutils-users@lists.sourceforge.net -__ http://lists.sourceforge.net/lists/listinfo/docutils-users - - -Developer Documentation -======================= - -Specification -------------- - -- `An Introduction to reStructuredText`__ (includes the Goals__ and - History__ of reStructuredText) -- `reStructuredText Markup Specification`__ -- `reStructuredText Directives`__ -- `A Record of reStructuredText Syntax Alternatives`__ -- `Problems With StructuredText`__ - -__ spec/rst/introduction.html -__ spec/rst/introduction.html#goals -__ spec/rst/introduction.html#history -__ spec/rst/reStructuredText.html -__ spec/rst/directives.html -__ spec/rst/alternatives.html -__ spec/rst/problems.html - - -How-To's --------- - -- `Creating reStructuredText Directives`__ - -__ spec/howto/rst-directives.html - - -Testimonials -============ - -The following testimonials are excerpts from unsolicited posts to -mailing lists and the comp.lang.python newsgroup. Being excerpts, -there's often context missing, which sometimes tones down the message. - -`Ueli Schlaepfer on Doc-SIG, 2002-03-28`__: - -__ http://mail.python.org/pipermail/doc-sig/2002-March/002526.html - - I have adopted reST as my tool of choice for producing notes while - doing lab work (mostly in a matlab environment). Since then, the - quality of such documentation has increased noticeably, mostly for - two reasons: - - - I no longer need to switch to another tool, so the threshold has - fallen to very low. Note that "another tool" means Winword... - - Still, I have a powerful set of markup constructs at my - fingertips that let me create the kind of documents I need with - more ease than any other tool I can think of. - - Thanks to reST/DPS [now Docutils --ed], I'll soon be able to go - ahead and apply the same tools for extracting documentation out of - my Python code. Hey, that's a printable and a browsable version - *for free*! Personally, I consider this a large benefit. - - ... All essential constructs for everyday use are there, and much - more if needed. ... - -`Guido van Rossum, enthusiastic about PEP 287 but a bit hasty (see the -follow-ups) on Python-Dev, 2002-04-02`__: - -__ http://mail.python.org/pipermail/python-dev/2002-April/022131.html - - Good PEP, David! What's the next step? Should the processing - code be incorporated in the standard library? Should we start - converting the standard library docs to reStructuredText? - -`Timothy Delaney on comp.lang.python, 2002-04-03`__: - -__ http://mail.python.org/pipermail/python-list/2002-April/096013.html - - I read through all the reStructuredText docs, comparing the text - versions to the html versions. I found the text versions to be - *very* easy to read, whilst making it obvious in most cases when - something was "special". - - I particularly like the system of doing hyperlinks... - - Definitely +1 from me ... I would really like a standard, clean - docstring format. Might make it easier to get my next project - done in Python... - -`Guido van Rossum on Python-Dev, 2002-04-03`__: - -__ http://mail.python.org/pipermail/python-dev/2002-April/022212.html - - I think that reStructuredText is a good format for marking up - docstrings; it's probably as good as it gets given the - requirements (a fairly elaborate feature set, yet more readable - "in the raw" than HTML). - -`Richard Jones on comp.lang.python, 2002-04-03`__: - -__ http://mail.python.org/pipermail/python-list/2002-April/096117.html - - How I see it is that ReST is a middle ground between markup and - non-. It has markup, and you can use it to the extreme. Or you - can follow some simple conventions (the most basic form of markup) - and not worry about all the finer detail stuff. The difference - between:: - - @section{The Section Title} - - and:: - - The Section Title - ----------------- - - Is pretty clearly to me that the second doesn't *look* like - markup, even though it is. - -`Guido van Rossum on Python-Dev, 2002-04-04`__: - -__ http://mail.python.org/pipermail/python-dev/2002-April/022247.html - - Structured text is really a great idea for certain situations; - reST is a much better implementation of the idea than any versions - I've seen before. - -`Max M on comp.lang.python, 2002-04-05`__: - -__ http://mail.python.org/pipermail/python-list/2002-April/096656.html - - Any programmer can learn the basics in 15 minutes or less. - - And it really is very very easy to write documents in it. I do - belive that if I were ever to write a book (again) I would write - it in ReST. - - And as far as I can tell from the specs, ReST solves most of the - problems I have had with structured text. A few things gets a - little more complicated and some get simpler. All in all a good - bargain. - - I would certainly use it. I also hope that it gets integrated - into Zope. - -`David Abrahams on Python-Dev, 2002-04-06`__: - -__ http://mail.python.org/pipermail/python-dev/2002-April/022443.html - - Incidentally, I'm really excited about reST. I've been looking - for a tolerable markup for C++ comments, and reST looks like it - might fit the bill. - -`Eric Jones on Python-Dev, 2002-08-01`__: - -__ http://mail.python.org/pipermail/python-dev/2002-August/027198.html - - I would very much like to see reStructuredText, or some minor - variation on it, move forward as a "standard" for doc-strings very - soon. I have long lamented not having a prescribed format *and* - an associated processing tool suite included in the standard - library. Even if the format isn't perfect (I think it looks very - good), it is time to pick a reasonable candidate and go. - -This being the Internet, there were plenty of people opposed to the -idea of reStructuredText, some vehemently. Discovering *those* gems -is left as an exercise for the reader. - -.. _Docutils: index.html -.. _StructuredText: - http://dev.zope.org/Members/jim/StructuredTextWiki/FrontPage/ -.. _Setext: mirror/setext.html -.. _statemachine.py: docutils/statemachine.py - -.. |reStructuredText| image:: rst.png - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: -- cgit v1.2.1