From: Günter M. <mi...@us...> - 2022-11-30 21:24:35
|
> I suppose I'm still unclear on the delineation between reader and parser. The components are explained in chapter [Docutils Project Model](https://docutils.sourceforge.io/docs/peps/pep-0258.html#docutils-project-model) in PEP 258. When using the core API ([the Docutils publisher](https://docutils.sourceforge.io/docs/api/publisher.html)), settings are automatically set up for the specified components. For details, see the docstrings of the `docutils.core.publish_*()` functions, [Docutils Runtime Settings](https://docutils.sourceforge.io/docs/api/runtime-settings.html), or the more detailed [Runtime Settings Processing](https://docutils.sourceforge.io/docs/api/runtime-settings.html). To find out which components define which settings, you can also just call `docutils --help`. Suggestions for improving the documentation are welcome. --- ** [bugs:#460] default settings do not provide required settings values** **Status:** open **Labels:** standalone reader **Created:** Sat Nov 12, 2022 02:17 AM UTC by Ryan de Kleer **Last Updated:** Wed Nov 16, 2022 06:32 PM UTC **Owner:** nobody # Platform Windows 10 Python 3.7 docutils 0.19.1b.dev # Issue Generating a document with the standalone reader fails with default settings. # Example ```python from docutils.readers import standalone from docutils.parsers import rst from docutils import io from docutils.frontend import get_default_settings from docutils import __version__ rst_src = """ A Document ---------- Simple but enough. """ def try_this(): print(__version__) src = io.StringInput(rst_src) parser = rst.Parser() reader = standalone.Reader(parser=parser) settings = get_default_settings(reader) document = reader.read(src, parser, settings) try_this() ``` Results in: ```python 0.19.1b.dev Traceback (most recent call last): line 19, in try_this document = reader.read(src, parser, settings) ... File "docutils/parsers/rst/states.py", line 607, in init_customizations if settings.pep_references: AttributeError: 'Values' object has no attribute 'pep_references' ``` --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |