Activity for Docutils: Documentation Utilities

  • Günter Milde Günter Milde modified ticket #61

    Add usemap option to image directive

  • Günter Milde Günter Milde posted a comment on ticket #61

    As an "image map" is only supported by HTML output and a rarely used feature, the cost of increased complexity and documentation needs exceeds the benefits for Docutils. Possible workarounds are raw HTML and embedded SVG images (cf. the solved [feature-requests:#100]).

  • Günter Milde Günter Milde modified ticket #66

    patch to make figure and table captions hyperlink targets

  • Günter Milde Günter Milde modified a comment on ticket #95

    See also [feature-requests:#60] for allowing multi-term definitions in the doctree and writer support. It is solved by commit [r9747] which changes the DTD, documentation, and nodes.definition_list_item.content_model to allow multiple terms for one definition.

  • Günter Milde Günter Milde posted a comment on ticket #95

    The syntax implemented in the proposed patch has one drawback explained by David Goodger in the original docutils-users thread: Perhaps we could define definition list items as one term per line, so this input: term 1 term 2 definition would produce this output: <definition_list> <definition_list_item> <term> term 1 <term> term 2 <definition> <paragraph> definition The current output is: <paragraph> term 1 term 2 <system_message level="3" line="3" source="<stdin>" type="ERROR"> <paragraph> Unexpected...

  • Günter Milde Günter Milde posted a comment on ticket #60

    A possible syntax for reStructuredText input of multi-term definition lists is proposed in [patches:#95].

  • Günter Milde Günter Milde modified a comment on ticket #18

    Fixed by applying [patches:#47].

  • Günter Milde Günter Milde modified ticket #18

    Attributes in the main document are overriden

  • Günter Milde Günter Milde posted a comment on ticket #18

    Fixed by appliying [patches:47].

  • Günter Milde Günter Milde modified ticket #44

    Add :figname: option to the figure directive

  • Günter Milde Günter Milde posted a comment on ticket #44

    The rST syntax for internal hyperlink targets applies a "name/label" to the following element. It can be used to name a figure element: .. _figure-label: .. figure:: myfile.png :name: imagelabel Figure caption. creates the HTML snippet: <figure id="figure-label"> <img alt="myfile.png" id="imagelabel" src="myfile.png" /> <figcaption> <p>Figure caption.</p> </figcaption> </figure> A "figname" directive option would provide an alternative way to name a figure element: -1 There should be one-- and preferably...

  • Günter Milde Günter Milde posted a comment on ticket #493

    @aa-turner: Do the tests still fail on Windows?

  • Günter Milde Günter Milde committed [r9916] on Code

    Refactor HTML4 writer tests.

  • Günter Milde Günter Milde committed [r9915] on Code

    HTML4 writer: catch/report errors when reading image file.

  • Günter Milde Günter Milde committed [r9914] on Code

    Use writer instances instead of names in test scripts.

  • Günter Milde Günter Milde committed [r9913] on Code

    Refactor HTML5 writer tests.

  • Günter Milde Günter Milde committed [r9912] on Code

    HTML writer: Fix part "html_head" if "output_encoding" setting is 'unicode'.

  • Günter Milde Günter Milde committed [r9911] on Code

    Revert test template file extension from "rst" to "txt".

  • Günter Milde Günter Milde committed [r9910] on Code

    Review "docutils.utils" after type hint addition.

  • Günter Milde Günter Milde posted a comment on ticket #493

    @aa-turner: Could you create a patch that just Changes the default root_prefix to '' (the empty string), and only applies the root_prefix behaviour when it is non-empty (i.e. a user has configured the setting) I agree that this is easier to explain (while the current implementation does not need a conditional). As the change is also backwards-compatible we can implement it without advance warning.

  • Günter Milde Günter Milde modified a comment on ticket #486

    status: open --> open-fixed Fixed in [r9657], so the 0.22 sdist will come with tox.ini Thank you for the report.

  • Günter Milde Günter Milde modified a comment on ticket #486

    status: open --> open-fixed Fixed in [r9657]. Thank you for the report.

  • Günter Milde Günter Milde committed [r9909] on Code

    Refactor "Include" directive class.

  • engelbert gruber engelbert gruber committed [r9908] on Code

    Fix file corruption on rename to rst

  • Günter Milde Günter Milde posted a comment on ticket #210

    Aside from verbosity, I'm unsure of the argument to change this. Readabilty counts. Verbosity can be managed with a type alias, This was my first idea. The best name for such a type alias would be "Node" (for any node in a document tree). The name was already take by a class documented as "Abstract base class of nodes in a document tree." So, instead [r9901] makes sure that all methods and attributes that are common to "Element" and "Text" are also defined for "Node": Node.children is now an empty...

  • engelbert gruber engelbert gruber committed [r9907] on Code

    rename README.txt to rst

  • Adam  Turner Adam Turner modified a comment on ticket #187

    nut i would only apply on svn ... might be not what's wanted

  • Adam  Turner Adam Turner modified a comment on ticket #187

    i could apply the rename this week ... nag me

  • Adam  Turner Adam Turner modified a comment on ticket #187

    infrastructure docutils-update.local should prefer .rst but falls back on .txt ./docs/user/Makefile.docutils-update has fixed filenames but is only one file

  • Adam  Turner Adam Turner modified a comment on ticket #187

    sandbox/infrastructure/docutils-update.local errors will pop up when run , no problem to me

  • engelbert gruber engelbert gruber committed [r9906] on Code

    rename txt to rst

  • Adam  Turner Adam Turner modified ticket #210

    Typing and `docutils.nodes.Node`

  • Adam  Turner Adam Turner created ticket #210

    Typing and `docutils.nodes.Node`

  • engelbert gruber engelbert gruber modified ticket #187

    Rename .txt files to .rst

  • engelbert gruber engelbert gruber posted a comment on ticket #187

    applied the patch

  • Günter Milde Günter Milde committed [r9905] on Code

    Small code updates to "modern" syntax constructs.

  • Günter Milde Günter Milde committed [r9904] on Code

    Add type hints to ``docutils.parsers.rst.directives``.

  • Günter Milde Günter Milde committed [r9903] on Code

    Fix type hints (typing.TypeAlias is new in Python 3.12).

  • Günter Milde Günter Milde committed [r9902] on Code

    Fix CSS for HTML5: right align code line numbers.

  • Günter Milde Günter Milde committed [r9901] on Code

    Use base class "Node" instead of `Element | Node` in type hints.

  • engelbert gruber engelbert gruber committed [r9900] on Code

    Fixes and cleanup

  • engelbert gruber engelbert gruber committed [r9899] on Code

    log tryout of sdist install from testpypi

  • engelbert gruber engelbert gruber committed [r9898] on Code

    use = as section title underlining

  • engelbert gruber engelbert gruber committed [r9897] on Code

    change command line option --use-macro-references to the pair

  • engelbert gruber engelbert gruber committed [r9896] on Code

    remove stale parts

  • engelbert gruber engelbert gruber committed [r9895] on Code

    add description

  • engelbert gruber engelbert gruber posted a comment on ticket #187

    infrastructure docutils-update.local should prefer .rst but falls back on .txt ./docs/user/Makefile.docutils-update has fixed filenames but is only one file On Sun, 11 Aug 2024 at 13:57, engelbert gruber grubert@users.sourceforge.net wrote: sandbox/infrastructure/docutils-update.local errors will pop up when run , no problem to me On Fri, 9 Aug 2024 at 11:35, Günter Milde milde@users.sourceforge.net wrote: We would need to adapt background scripts, too. I am unsure whether the following changes correctly...

  • engelbert gruber engelbert gruber posted a comment on ticket #187

    i could apply the rename this week ... nag me On Tue, 13 Aug 2024 at 12:42, engelbert gruber grubert@users.sourceforge.net wrote: infrastructure docutils-update.local should prefer .rst but falls back on .txt ./docs/user/Makefile.docutils-update has fixed filenames but is only one file On Sun, 11 Aug 2024 at 13:57, engelbert gruber grubert@users.sourceforge.net wrote: sandbox/infrastructure/docutils-update.local errors will pop up when run , no problem to me On Fri, 9 Aug 2024 at 11:35, Günter Milde...

  • engelbert gruber engelbert gruber committed [r9894] on Code

    move release.sh into attic

  • engelbert gruber engelbert gruber committed [r9893] on Code

    remove antique

  • engelbert gruber engelbert gruber committed [r9892] on Code

    remove unused file

  • engelbert gruber engelbert gruber posted a comment on ticket #187

    nut i would only apply on svn ... might be not what's wanted On Tue, 13 Aug 2024 at 12:43, engelbert gruber grubert@users.sourceforge.net wrote: i could apply the rename this week ... nag me On Tue, 13 Aug 2024 at 12:42, engelbert gruber grubert@users.sourceforge.net wrote: infrastructure docutils-update.local should prefer .rst but falls back on .txt ./docs/user/Makefile.docutils-update has fixed filenames but is only one file On Sun, 11 Aug 2024 at 13:57, engelbert gruber grubert@users.sourceforge.net...

  • engelbert gruber engelbert gruber committed [r9891] on Code

    FIX do not generate .rst.html files

  • engelbert gruber engelbert gruber committed [r9890] on Code

    FIX mostly man is used

  • engelbert gruber engelbert gruber committed [r9889] on Code

    rename README and TODO to rst

  • engelbert gruber engelbert gruber committed [r9888] on Code

    move htmlfile.lst to in use section

  • engelbert gruber engelbert gruber committed [r9887] on Code

    add URI-reference

  • engelbert gruber engelbert gruber committed [r9886] on Code

    add support and preference for rst-files

  • engelbert gruber engelbert gruber committed [r9885] on Code

    rename to .rst

  • engelbert gruber engelbert gruber committed [r9884] on Code

    move unused scripts in used section

  • Günter Milde Günter Milde committed [r9883] on Code

    Clarify documentation of the "URI reference" data type in elements and directives.

  • Günter Milde Günter Milde modified a comment on ticket #493

    The second commit in the patch goes further, by rejecting absolute paths when used in relative references. This is optional, but as I argue above I think allowing absolute paths in relative references leads to surprising behaviour the resolution is easy if you want to keep using absolute paths (just use file:///). Using the "file" scheme does not work if you want to generate HTML and LaTeX/PDF output from the same source with the HTML to be served via https and linking to images. The rejection of...

  • Günter Milde Günter Milde posted a comment on ticket #493

    The second commit in the patch goes further, by rejecting absolute paths when used in relative references. This is optional, but as I argue above I think allowing absolute paths in relative references leads to surprising behaviour the resolution is easy if you want to keep using absolute paths (just use file:///). Using file does not work if you want to generate HTML that should be served via https and * create two output versions with/without embedding images from the same source, or * read the...

  • Günter Milde Günter Milde modified a comment on ticket #493

    I am in favour of using unquote(). Now it seems that (at least from wikipedia) this scheme of using | is not standardised/used, and might just be a Python quirk The "|" seems to be not Python specific, however, it is obsolete. Wiki says: On Microsoft Windows systems, the normal colon (:) after a device letter has sometimes been replaced by a vertical bar (|) in file URLs. This reflected the original URL syntax, which made the colon a reserved character in a path part. Since Internet Explorer 4, file...

  • Günter Milde Günter Milde modified a comment on ticket #493

    I think we have two options. (1) support absolute paths on every platform, document as such. (2) make absolute paths return an error on Linux. (3) support URI-references: full URI | relative reference (relative to a "base URI"), e.g.be an "absolute path reference" (starting with one slash) or a "relative path reference" (not starting with a slash). The first restores backwards compatibility, the second is needlessly restrictive and hard to explain. The third is consistent with what we document. The...

  • Günter Milde Günter Milde modified a comment on ticket #493

    The parsing is correct: The image argument is a "URI reference": A URI-reference is either a URI or a relative reference. If the URI-reference's prefix does not match the syntax of a scheme followed by its colon separator, then the URI-reference is a relative reference. (RFC 3986) Hence, the example ~~~ .. image:: S:/Development/data/circle-broken.svg ~~~ describes an image accessible under scheme "S". Our problem is, that we cannot easily use relative paths (to keep flexibility regarding where to...

  • Günter Milde Günter Milde modified a comment on ticket #493

    I think we have two options. (1) support absolute paths on every platform, document as such. (2) make absolute paths return an error on Linux. (3) support URI-references: URI | absolute (POSIX) path | relative (POSIX) path The first restores backwards compatibility, the second is needlessly restrictive and hard to explain. The third is consistent with what we document. It is also in line with "root-prefix" only being used if a path starts with "/". The different handling of Windows system paths is...

  • Günter Milde Günter Milde modified a comment on ticket #493

    The parsing is correct: The image argument is a "URI reference": A URI-reference is either a URI or a relative reference. If the URI-reference's prefix does not match the syntax of a scheme followed by its colon separator, then the URI-reference is a relative reference. (RFC 3986) Hence, the example ~~~ .. image:: S:/Development/data/circle-broken.svg ~~~ describes an image accessible under scheme "S". Our problem is, that we cannot easily use relative paths (to keep flexibility regarding where to...

  • engelbert gruber engelbert gruber posted a comment on ticket #187

    sandbox/infrastructure/docutils-update.local errors will pop up when run , no problem to me On Fri, 9 Aug 2024 at 11:35, Günter Milde milde@users.sourceforge.net wrote: We would need to adapt background scripts, too. I am unsure whether the following changes correctly describe the behaviour after applying this patch : --- a/sandbox/infrastructure/docutils-update.local+++ b/sandbox/infrastructure/docutils-update.local@@ -14,10 +14,10 @@ # # ATTENTION #-# Any .html document with a corresponding .txt...

  • Günter Milde Günter Milde posted a comment on ticket #493

    I think we should use Path.as_uri() instead of .as_posix(). Done in [r9882].

  • Günter Milde Günter Milde committed [r9882] on Code

    Fixup [r9880]. Use `to_uri()` to get image URI in test sample.

  • Günter Milde Günter Milde posted a comment on ticket #493

    Your analysis with "the uri_parts.scheme not in ('', 'file') check" beeing "the root cause" of the test failure is correct. This check was introduced in [r9501] "Refactor "_html_base" writer." However, even before (since introduction of image embedding in 0.18), the drive part was split from the path. To verify this, try PS> echo ".. image:: S:/Development/docutils/docutils/test/data/circle.svg" | python rst2html5.py --link-stylesheet --image-loading embed from a directory in a different drive. BTW:...

  • Adam  Turner Adam Turner posted a comment on ticket #493

    the second is needlessly restrictive and hard to explain. Suppose a user has a directive .. image:: /media/circle.svg. By default this will load the file under /media/circle.svg, as the user might expect if they think they are using filesystem paths, and don't realise the nuances of URI references. At some later date, this user sets root_prefix to /home/user/project/. The image directive will stop working, as it now looks for a file under /home/user/project/media/circle.svg. I think this behaviour...

  • Günter Milde Günter Milde modified a comment on ticket #493

    I think we have two options. (1) support absolute paths on every platform, document as such. (2) make absolute paths return an error on Linux. (3) support URI-references: URI | absolute (POSIX) path | relative (POSIX) path The first restores backwards compatibility, the second is needlessly restrictive and hard to explain. The third is consistent with what we document. It is also in line with "root-prefix" only being used if a path starts with "/". The different handling of Windows system paths is...

  • Günter Milde Günter Milde posted a comment on ticket #493

    I think we have two options. (1) support absolute paths on every platform, document as such. (2) make absolute paths return an error on Linux. (3) support URI-references: URI | absolute (POSIX) path | relative (POSIX) path The first restores backwards compatibility, the second is needlessly restrictive and hard to explain. The third is consistent with what we document. It is also in line with "root-prefix" only being used if a path starts with "/". The different handling of Windows system paths is...

  • Günter Milde Günter Milde committed [r9881] on Code

    Smaller fixups (formatting, comments)

  • Günter Milde Günter Milde modified a comment on ticket #46

    We could say: If you want the telephone number to become a hyperlink, you can use a valid "tel:" URI (like tel:+35/12345.6789-33). If the link text should be different from the "href" value, use a "hyperlinke reference", either regular, anonymous or embedded. Example:: :contact: `1234`__ :address: at home ... __ tel:+33/456-1234 Would this suffice?

  • Günter Milde Günter Milde modified a comment on ticket #46

    I would not want an "explicit mode" different from what is already implemented: The rST support for "standalone hyperlinks" is specified in http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#standalone-hyperlinks Although not listed explicitely, "tel:" is among the "known schemes, per the Official IANA Registry of URI Schemes" and indeed, the example tel:+45/123-4567 is converted to the XML <reference refuri="tel:+45/123-4567">tel:+45/123-4567</reference>. If a different URI and display...

  • Adam  Turner Adam Turner posted a comment on ticket #493

    The parsing is correct: The image argument is a "URI reference" ... The issue here now becomes why the tests were not failing on Linux, I believe. Both Windows and Linux would have had an absolute path (e.g. .. image:: /home/user/development/docutils/docutils/test/data/circle-broken.svg). On Windows, this failed due to misinterpreting the drive letter as a scheme. However, because the default root_prefix is /, when an absolute path is used on Unix, the scheme is '', imagepath.startswith('/') is True,...

  • Günter Milde Günter Milde modified a comment on ticket #493

    The parsing is correct: The image argument is a "URI reference": A URI-reference is either a URI or a relative reference. If the URI-reference's prefix does not match the syntax of a scheme followed by its colon separator, then the URI-reference is a relative reference. (RFC 3986) Hence, the example ~~~ .. image:: S:/Development/data/circle-broken.svg ~~~ describes an image accessible under scheme "S". Our problem is, that we cannot easily use relative paths (to keep flexibility regarding where to...

  • Günter Milde Günter Milde committed [r9880] on Code

    Next try to fix Windows test failure because of image URI -> path conversion.

  • Günter Milde Günter Milde posted a comment on ticket #187

    We would need to adapt background scripts, too. I am unsure whether the following changes correctly describe the behaviour after applying this patch : --- a/sandbox/infrastructure/docutils-update.local +++ b/sandbox/infrastructure/docutils-update.local @@ -14,10 +14,10 @@ # # ATTENTION # -# Any .html document with a corresponding .txt file is regenerated -# if the .txt has changed, but no new .html files will be generated. +# Any .html document with a corresponding .rst file is regenerated +# if...

  • Adam  Turner Adam Turner committed [r9879] on Code

    Improve diff on test failure for ``test_html*_parts``

  • Günter Milde Günter Milde committed [r9878] on Code

    Fixups for nodes.py.

  • Günter Milde Günter Milde posted a comment on ticket #493

    The parsing is correct: The image argument is a "URI reference": A URI-reference is either a URI or a relative reference. If the URI-reference's prefix does not match the syntax of a scheme followed by its colon separator, then the URI-reference is a relative reference. (RFC 3986) Hence, the example ~~~ .. image:: S:/Development/data/circle-broken.svg ~~~ describes an image accessible under scheme "S". Our problem is, that we cannot easily use relative paths (to keep flexibility regarding where to...

  • Adam  Turner Adam Turner committed [r9877] on Code

    Move unused ``version_identifier()`` to a test helper

  • Adam  Turner Adam Turner committed [r9876] on Code

    Add type hints to ``docutils.utils``

  • Adam  Turner Adam Turner committed [r9875] on Code

    Add type hints to ``docutils.utils.urischemes``

  • Adam  Turner Adam Turner committed [r9874] on Code

    Add type hints to ``docutils.writers``

  • Adam  Turner Adam Turner committed [r9873] on Code

    Add type hints to ``docutils.parsers``

  • Adam  Turner Adam Turner committed [r9872] on Code

    Add type hints to ``docutils.readers``

  • Adam  Turner Adam Turner posted a comment on ticket #187

    I have recreated the branch/patch for the rename, please have a look: https://github.com/AA-Turner/docutils/pull/17 https://github.com/AA-Turner/docutils/pull/17.patch All .txt files in docutils/, web/, and sandbox/infrastructure/ have been renamed. Writer template files remain unchanged. A

  • Adam  Turner Adam Turner committed [r9871] on Code

    Fix Ruff

  • Adam  Turner Adam Turner committed [r9870] on Code

    Fix Ruff

  • Adam  Turner Adam Turner committed [r9869] on Code

    Fix comprehension syntax

  • Adam  Turner Adam Turner posted a comment on ticket #493

    Sorry, another failure. The root cause of this one seems to be the uri_parts.scheme not in ('', 'file') check. On Windows, we get the following, because drives in absolute paths are parsed as URI schemes: >>> uri 'S:/Development/docutils/docutils/test/data/circle-broken.svg' >>> urllib.parse.urlparse(uri).scheme 's' We could do something like Path(uri).is_file(), but that has the problems with using pathlib that you mentioned earlier... Full failure below, also on https://github.com/AA-Turner/docutils/actions/runs/10308701375/job/28536730749...

  • Adam  Turner Adam Turner modified ticket #493

    Test failure on Windows with embedded images

  • Adam  Turner Adam Turner posted a comment on ticket #58

    As another update, I have recently made several improvements to the draft conversion files (see [r9856] and [r9868]) that I've been working on over the last couple of weeks. I also have written to Günter (@milde) privately to resolve some other matters, relating to migrating issues and the authors map. A

1 >