Berthold Höllmann schrieb: > I have a small rst file that goes: > > --8<---------------cut here---------------start------------->8--- > .. |BMF| replace:: :file:`BMF` > .. |BRF| replace:: :file:`BRF` > .. |aa| replace:: :command:`display` > > |BMF| and |BRF| > --8<---------------cut here---------------end--------------->8--- > > When I process my project I get: > > --8<---------------cut here---------------start------------->8--- > Sphinx v0.5.1, building html > loading pickled environment... done > building [html]: targets for 1 source files that are out of date > updating environment: 0 added, 1 changed, 0 removed > reading sources... aa > WARNING: /data/tmp/hoel/GLPy/doc/brf2ansysload/aa.rst:1: (ERROR/3) Error in > "replace" directive: may contain a single paragraph only. > WARNING: /data/tmp/hoel/GLPy/doc/brf2ansysload/aa.rst:1: (WARNING/2) > Substitution definition "BMF" empty or invalid. > > .. |BMF| replace:: :file:`BMF` > WARNING: /data/tmp/hoel/GLPy/doc/brf2ansysload/aa.rst:3: (ERROR/3) Error in > "replace" directive: may contain a single paragraph only. > WARNING: /data/tmp/hoel/GLPy/doc/brf2ansysload/aa.rst:3: (WARNING/2) > Substitution definition "aa" empty or invalid. > > .. |aa| replace:: :command:`display` > > WARNING: /data/tmp/hoel/GLPy/doc/brf2ansysload/aa.rst:5: (ERROR/3) Undefined > substitution referenced: "BMF". > pickling environment... done > ... > --8<---------------cut here---------------end--------------->8--- > > What is going wrong here? Why is it complaining on the first and third > `replace` only?
Hi, I've debugged this, and it seems like a docutils problem. The "file" role is registered as a "canonical" role, i.e. not language dependent. Therefore a system message is generated, and the content of the parsed replacement is not a single paragraph, but a paragraph and a system message. I've now switched to registering custom roles as "local", which should circumvent this problem. Georg --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en -~----------~----~----~----~------~----~------~--~---
