<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 6: What is the proper way to register transform settings?</title><link>https://sourceforge.net/p/docutils/support-requests/6/</link><description>Recent changes to 6: What is the proper way to register transform settings?</description><atom:link href="https://sourceforge.net/p/docutils/support-requests/6/feed.rss" rel="self"/><language>en</language><lastBuildDate>Tue, 18 Apr 2023 20:43:25 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/docutils/support-requests/6/feed.rss" rel="self" type="application/rss+xml"/><item><title>#6 What is the proper way to register transform settings?</title><link>https://sourceforge.net/p/docutils/support-requests/6/?limit=25#13ba</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;The "clean" way would be a custom parser component.&lt;br/&gt;
Sub-classing &lt;code&gt;docutils.parsers.rst.Parser&lt;/code&gt; is easy, &lt;br/&gt;
specifying the custom parser to the generic &lt;code&gt;docutils&lt;/code&gt; CLI is easy, too,&lt;br/&gt;
the tricky part may be to convince Sphinx, Pelican, Nikola, etc. to use it.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Günter Milde</dc:creator><pubDate>Tue, 18 Apr 2023 20:43:25 -0000</pubDate><guid>https://sourceforge.net56f92ff76b8312283bdfce350f685525b8c1bf29</guid></item><item><title>What is the proper way to register transform settings?</title><link>https://sourceforge.net/p/docutils/support-requests/6/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;I have a Python package that defines custom Docutils directives and roles.  It does not need a custom reader, writer, or parser: it just uses &lt;code&gt;directives.register_directive&lt;/code&gt; or &lt;code&gt;roles.register_canonical_role&lt;/code&gt;.  Then, it runs transforms registered using &lt;code&gt;nodes.pending&lt;/code&gt; nodes.&lt;/p&gt;
&lt;p&gt;These transforms take settings.  What is the proper way to register them?  One issue I'm running into is that although custom components can declare a &lt;code&gt;settings_spec&lt;/code&gt;, transforms cannot.&lt;/p&gt;
&lt;p&gt;When I'm calling docutils myself, it's easy to use the &lt;code&gt;settings_spec&lt;/code&gt; provided by &lt;code&gt;docutils.core.publish_*&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;But when I'm calling docutils through Sphinx, Pelican, Nikola, etc, I don't have control on that parameter.  So, what is the recommended way to tell Docutils about these additional settings?  Should I override the &lt;code&gt;settings_spec&lt;/code&gt; of the default &lt;code&gt;OptionsParser&lt;/code&gt;?&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Clément Pit-Claudel</dc:creator><pubDate>Mon, 23 Aug 2021 21:27:31 -0000</pubDate><guid>https://sourceforge.net1e399da3fcab27d55a1e571e1d4d1f65dd599022</guid></item></channel></rss>