Skip to content
This repository has been archived by the owner on Mar 25, 2022. It is now read-only.

Run AutoStructify after Sphinx's Locale transform #192

Closed
wants to merge 1 commit into from
Closed

Run AutoStructify after Sphinx's Locale transform #192

wants to merge 1 commit into from

Conversation

jpmckinney
Copy link

This is a better solution than #52

Note that you'd need to test on an unreleased version of commonmark.py to get this PR readthedocs/commonmark.py#225 and you'd need to have already merged #187, as otherwise translations are broken for other reasons.

@jpmckinney
Copy link
Author

Nevermind – the problem is elsewhere (also, the code should, at least, have - 1 not + 1).

@jpmckinney jpmckinney closed this Jan 13, 2020
@jpmckinney jpmckinney deleted the fix-default-priority branch January 13, 2020 23:25
@jpmckinney
Copy link
Author

jpmckinney commented Jan 14, 2020

Noting for posterity that the problem was that:

  • reStructured Text within eval_rst blocks will be parsed as Markdown, after translation by the Locale transform.

  • There is no way for it to be parsed as RST. The node would need to communicate its desired parser for that to work, but in any case Sphinx's publish_msgstr method and Locale transform look to to the document to determine the desired parser, not each node.

  • To have complex content within an eval_rst block, it needs to instead be further embedded within a markdown block (from this module) and written as Markdown, e.g.

    .. note::
    
       .. markdown::
    
          A [link](http://example.com).
    
    

This will render, e.g. if translated to French, as "Un lien." within a note admonition.

On the other hand:

```eval_rst
.. note::

   A `link <http://example.com>`__.

will render, if translated to French, as "Un lien <http://example.com>__."

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant