summaryrefslogtreecommitdiff
path: root/docutils/writers/html4css1
Commit message (Collapse)AuthorAgeFilesLines
* Wrap definition lists with "details" class argument in a <div>milde2022-11-281-1/+1
| | | | | | | | with the "id" and "class" values of the list node. Enables setting an "anchor" or a "class" value for "detail disclosure elments". git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9282 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Refactor HTMLTranslator initialization and parts setup.milde2022-11-131-1/+1
| | | | | | | | | | | | | | | | | Use utils.xml_declaration(). Don't write charset (encoding) declaration if the intended output encoding is not known. Copy "meta" part content into "head" in `depart_document()` (i.e. after collecting all items). Obsoletes auxiliary method `add_meta()`. Remove it. Changes to the HTML output (no space character before closing tag of XML declaration, order of metadata elements) don't affect the HTML semantics, styling, and rendering. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9240 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove unused imports.milde2022-03-051-3/+2
| | | | | | flake8 rule F401 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9037 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid line break after binary operator.milde2022-03-051-22/+23
| | | | | | | | | Breaking before binary operators is the recommended style in PEP 8 (changed in April 2016). flake8 rule W504 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9035 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid too long lines.milde2022-03-051-3/+3
| | | | | | flake8 rule E501: line too long (N > 79 characters) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9030 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ensure 2 blank lines around top-level functions and classes.milde2022-03-041-0/+1
| | | | | | | | flake8 rules E302: expected 2 blank lines, found 1 E305: expected 2 blank lines after class or function definition git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9026 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix (some) missing blank linesmilde2022-03-041-4/+4
| | | | | | | | flake8 rules E301: expected 1 blank line, found 0 E306: expected 1 blank line before a nested definition, found 0 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9024 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ensure at least two spaces before inline comment.milde2022-03-041-3/+3
| | | | | | | | | flake 8 rule E261 Exceptions for modules sheduled for removal or with 3rd-party origin and for data collections. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9021 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix unexpected spaces around equals indicating keyword arguments.milde2022-03-031-34/+34
| | | | | | flake8 rule E251 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9020 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix whitespace before/after delimiters and colon.milde2022-03-031-7/+7
| | | | | | | | | | | | | | Flake rules E201 whitespace after '(' E202 whitespace before '}' E203 whitespace before ':' E211 whitespace before '(' Exception: : as binary operator in extended slices (cf. https://www.python.org/dev/peps/pep-0008/#pet-peeves). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9015 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix code indentationmilde2022-01-291-35/+36
| | | | | | | | | | | | | | | | | | | | Check conformance to our coding policies with flake8. Fix the following problems: E111 indentation is not a multiple of four E114 indentation is not a multiple of four (comment) E115 expected an indented block (comment) E116 unexpected indentation (comment) E117 over-indented E121 continuation line under-indented for hanging indent E122 continuation line missing indentation or outdented E124 closing bracked does not match visual indentaion E127 continuation line over-indented for visual indent E128 continuation line under-indented for visual indent E131 continuation line unaligned for hanging indent git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8994 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update IO error handling.milde2022-01-271-2/+2
| | | | | | | | | | | | In Python3.3, IOError has been merged into OSError. https://docs.python.org/3/library/exceptions.html#OSError Move code for recording dependencies in an "else" clause after error handling. Remove duplicate code in core.py. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8989 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Leftovers and fixes after the big clean-up.milde2022-01-271-1/+1
| | | | | | Patch set by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8985 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop string prefix "u".milde2022-01-261-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8983 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove unused importsmilde2022-01-261-1/+0
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8979 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use "x not in y" over "not x in y"milde2022-01-261-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8978 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [bug:#443].milde2022-01-261-2/+1
| | | | | | | | Add "html writers" to `docutils.writers._html_base.Writer.config_section_dependencies`. Now, it works "out of the box" for writers inheriting from `_html_base`. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8967 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Change http://docutils.sf.net -> https://docutils.sourceforge.iomilde2022-01-201-1/+1
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8954 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use "with ... as" when opening resources.milde2022-01-111-2/+1
| | | | | | | | Also drop codecs wrapper and encoding of paths with "sys.getfilesystemencoding" (automatically done in Python 3). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8940 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix/silence DeprecationWarnings and RessourceWarnings.milde2022-01-061-5/+5
| | | | | | | Found by Tomasz Kłoczko running "pytest" (cf. feature-request #81) and by running `python3 -W all alltests.py`. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8933 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix spellingmilde2021-10-221-2/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8860 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* HTML5: Improve accessibility of section headings.milde2021-06-301-7/+29
| | | | | | | | | | | | | | | | Mark the internal back-refences from section headings to the ToC with DPub-ARIA role "doc-backref". Use "aria-level" instead of a class argument value for section headings with nesting level > 6 (for level 1 to 6, the level is determined by the HTML tag). Mind that in HTML5, heading level 1 is reserved for the document title and section headings start with level 2. Add functional test sample for deeply nested sections. Merge functional tests for additonal HTML5 features. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8786 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* HTML5: Support details disclosure elementsmilde2021-06-301-1/+17
| | | | | | | Items of a definition list with class argument "details" are converted to `details disclosure elements`. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8783 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* HTML5: ARIA roles for citations and citation-references.milde2021-06-251-1/+13
| | | | | | | | | | Use <div> with DPub ARIA role "doc-biblioentry" for citations. Wrapping citations in a list (required for elements with role "doc-biblioentry"). Use role "doc-biblioref" for citation-references. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8779 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Complete visit_* / depart_* method pairs in html4css.HTMLTranslator.milde2021-06-251-3/+37
| | | | | | | Always add both methods of a visit/depart pair, also if only one method is changed from the parent class. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8776 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Code simplification in writers.milde2021-06-251-2/+14
| | | | | | | | | | | Use node[...] instead of node.get(...) for basic attributes. Remove HTMLTranslator.topic_classes auxiliary attribute. HTML5: Do not add "compound-first", "compound-middle", or "compound-last" to elements nested in a compound. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8774 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Review settings_spec.milde2021-05-171-87/+33
| | | | | | | Common options for HTML writers. Minor changes for xetex writer and docutils-cli.py. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8722 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update comments and advertised future changes.milde2021-03-201-6/+7
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8638 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Revert "html5 writer: wrap image elements in <p> unless inline or in figure."milde2021-01-261-29/+2
| | | | | | This wrapper is not required as we can set the display to "block" with CSS. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8607 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Implement feature request #40 Option to embed images as data URI.milde2020-11-271-0/+9
| | | | | | | | | | | | | | | If the new "embed_image" configuration setting is true, the image can be read from the local file system, and its MIME type can be determined, it is base64 encoded and included as a data URI. TODO: * Add an "embed" option to the "image" directive to allow embedding of individual images? * Use direct inlinging for SVG in HTML5? git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8581 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* html writer: Drop spurious suffix after <object> starttag.milde2020-04-031-1/+1
| | | | | | | Also backported to html4css1 to fix possible spurious whitespace after inline images. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8513 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* html5 writer: wrap image elements in <p> unless inline or in figure.milde2020-04-031-0/+99
| | | | | | | | | | | | | | In HTML, <img> is by default an inline element. The rST "image" directive generates block-level elements (unless used in a "substitution" directive). Wrapping in a container enables more advanced CSS styling. A paragraph as wrapper fits well with Docutils wrapping inline content in paragraphs by default. No change for the "html4css1" writer (ensure backwards compatibility). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8510 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix ticket [ patches/147 ] code duplication.milde2018-11-291-5/+2
| | | | | | Thanks to Takeshi KOMIYA for reporting the issue. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8242 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix :width: option for the table directives.milde2017-10-191-1/+4
| | | | | | | | | | * add table width argument in docutils.dtd * support table width argument in html and latex writers * fix support in "csv-table" directive * add test cases. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8187 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop compatibility code for Python 2.4 and 2.5.milde2017-08-111-3/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8163 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Replace untranslable term "sollbruchstelle" with English approximation.milde2017-02-131-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8035 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Apply [ 125 ] respect automatic table column sizing also in html4css1.milde2017-02-131-28/+30
| | | | | | Add a table with "auto"-width columns to the functional tests. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8033 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* HTML writers: Outsourcing of common code to _html_base.py.milde2016-11-291-1023/+76
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7977 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Rename html_plain writer to html5_polyglott.milde2016-08-181-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7969 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Implement feature request [ 48 ]milde2016-07-262-4/+20
| | | | | | | Add :align: option to the table directives. Thanks to Takeshi KOMIYA for the patch. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7952 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use https in default MathJax URL (report Alan G Isaac).milde2016-05-241-2/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7939 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Rename html_base writer to html_plain, move xhtml11 writer back to sandbox.milde2015-08-121-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7901 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Do not use <sup> and <sub> tags inside <pre> (parsed-literal blocks).milde2015-03-302-6/+28
| | | | | | | | | | | New approach: use <span class="subscript"> ... and CSS in literal blocks, as <sup> and <sub> are explicitely forbidden in XHTML 1 http://www.w3.org/TR/xhtml1/#prohibitions (but the validator does not check this) Also: fix target in SVG image functional test. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7856 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* HTML4 writer: Wrap literal blocks in a <span> to support sub- and superscript milde2015-03-261-0/+2
| | | | | | (not allowed in <pre> but possible in parsed-literal). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7855 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Small fixes to the writer aliases, supported formats, and front-end tools.milde2015-03-171-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7847 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix setup.py and tests after addition of writers/html_base and mv of math.css.milde2015-03-101-1/+6
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7817 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* New basic HTML writer: generates polyglott HTML 5 / XHTML 1.1 (transitional)milde2015-03-101-276/+0
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7815 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* New CSS 2.1 style-sheet for xhtml11 writer.milde2015-03-061-5/+9
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7809 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Make the insertion of "admonition" class in the HTML writermilde2015-02-271-0/+1
| | | | | | (keeps doctree clean). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7808 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [ 266 ] creating labels/class values in description list items.milde2015-02-261-1/+7
| | | | | | | Also clarify the documentation of "class" directive and internal hyperlink targets applying to the next element also if at the end of an indented block. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7804 929543f6-e4f2-0310-98a6-ba3bd3dd1d04