<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to support-requests</title><link href="https://sourceforge.net/p/docutils/support-requests/" rel="alternate"/><link href="https://sourceforge.net/p/docutils/support-requests/feed.atom" rel="self"/><id>https://sourceforge.net/p/docutils/support-requests/</id><updated>2023-04-18T20:43:25.037000Z</updated><subtitle>Recent changes to support-requests</subtitle><entry><title>#6 What is the proper way to register transform settings?</title><link href="https://sourceforge.net/p/docutils/support-requests/6/?limit=25#13ba" rel="alternate"/><published>2023-04-18T20:43:25.037000Z</published><updated>2023-04-18T20:43:25.037000Z</updated><author><name>Günter Milde</name><uri>https://sourceforge.net/u/milde/</uri></author><id>https://sourceforge.net56f92ff76b8312283bdfce350f685525b8c1bf29</id><summary type="html">&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;</summary></entry><entry><title>What is the proper way to register transform settings?</title><link href="https://sourceforge.net/p/docutils/support-requests/6/" rel="alternate"/><published>2021-08-23T21:27:31.621000Z</published><updated>2021-08-23T21:27:31.621000Z</updated><author><name>Clément Pit-Claudel</name><uri>https://sourceforge.net/u/createsoftware/</uri></author><id>https://sourceforge.net1e399da3fcab27d55a1e571e1d4d1f65dd599022</id><summary type="html">&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;</summary></entry><entry><title>#5 escaping smart quotes along with literal backslash inside</title><link href="https://sourceforge.net/p/docutils/support-requests/5/?limit=25#72c3" rel="alternate"/><published>2020-09-08T14:24:48.576000Z</published><updated>2020-09-08T14:24:48.576000Z</updated><author><name>Günter Milde</name><uri>https://sourceforge.net/u/milde/</uri></author><id>https://sourceforge.netba51eb726b22d928ccffce0b4a3e69868a1a5d15</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;: open --&amp;gt; closed&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</summary></entry><entry><title>#4 How to programatically use the commandline parameters?</title><link href="https://sourceforge.net/p/docutils/support-requests/4/?limit=25#af89" rel="alternate"/><published>2020-09-08T14:20:46.850000Z</published><updated>2020-09-08T14:20:46.850000Z</updated><author><name>Günter Milde</name><uri>https://sourceforge.net/u/milde/</uri></author><id>https://sourceforge.netd55cf8924a779b5af140e77c80e1672ea62c7495</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;: open --&amp;gt; closed&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</summary></entry><entry><title>#5 escaping smart quotes along with literal backslash inside</title><link href="https://sourceforge.net/p/docutils/support-requests/5/?limit=25#027e" rel="alternate"/><published>2019-06-24T16:07:40.230000Z</published><updated>2019-06-24T16:07:40.230000Z</updated><author><name>Günter Milde</name><uri>https://sourceforge.net/u/milde/</uri></author><id>https://sourceforge.net3a5d146e17b70705db792edf63565d0eca75bd62</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;The recommended method is to use inline literals like &lt;code&gt;'\'&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The problem is that the escaping backslashes must reach the "smartquotes" transform.  This means you need to double the escaping in case your rST source is in a Python string (e.g. a docstring) unless you use r"raw strings".&lt;br/&gt;
The next problem is that up to version 0.15, smartquotes need one more doubling of backslashes (see &lt;a href="https://sourceforge.net/p/docutils/bugs/332/"&gt;https://sourceforge.net/p/docutils/bugs/332/&lt;/a&gt; and &lt;a href="https://sourceforge.net/p/docutils/bugs/353/"&gt;https://sourceforge.net/p/docutils/bugs/353/&lt;/a&gt;) so it might be "\'\\\'" or r"'\'". However, this will change in further Docutils versions.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>escaping smart quotes along with literal backslash inside</title><link href="https://sourceforge.net/p/docutils/support-requests/5/" rel="alternate"/><published>2019-04-16T14:25:02.832000Z</published><updated>2019-04-16T14:25:02.832000Z</updated><author><name>Magic Xu</name><uri>https://sourceforge.net/u/madjxatw/</uri></author><id>https://sourceforge.net3f5ec723e51d533cc51048a487b2f66d8fa6dbb9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I want to get &lt;code&gt;'\'&lt;/code&gt; (a backslash within a pair of apostrophes) in html output without turnning off smartquotes funtionality. I tried to escape the apostrophes and backslash  with &lt;code&gt;\\'\\\\'&lt;/code&gt; but got &lt;code&gt;'\’&lt;/code&gt;, where the ending apostrophe didn't  get escaped. Anybody know how to sort it out?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>escaping smart quotes along with literal backslash inside</title><link href="https://sourceforge.net/p/docutils/support-requests/5/" rel="alternate"/><published>2019-04-16T14:25:02.832000Z</published><updated>2019-04-16T14:25:02.832000Z</updated><author><name>Magic Xu</name><uri>https://sourceforge.net/u/madjxatw/</uri></author><id>https://sourceforge.netf060b749fabb002b016ee35fb30f108c21566feb</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Ticket 5 has been modified: escaping smart quotes along with literal backslash inside&lt;br/&gt;
Edited By: Günter Milde (milde)&lt;br/&gt;
Status updated: u'open' =&amp;gt; u'closed'&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#4 How to programatically use the commandline parameters?</title><link href="https://sourceforge.net/p/docutils/support-requests/4/?limit=25#162e" rel="alternate"/><published>2017-09-12T20:43:46.293000Z</published><updated>2017-09-12T20:43:46.293000Z</updated><author><name>David Goodger</name><uri>https://sourceforge.net/u/goodger/</uri></author><id>https://sourceforge.net96e5f68909812c3a5bb1011c1a8ff126e9c377fe</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;For an example using publish_string, see&lt;br/&gt;
&lt;a href="http://docutils.sourceforge.net/docs/api/publisher.html#configuration"&gt;http://docutils.sourceforge.net/docs/api/publisher.html#configuration&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#4 How to programatically use the commandline parameters?</title><link href="https://sourceforge.net/p/docutils/support-requests/4/?limit=25#7838" rel="alternate"/><published>2017-09-12T20:13:43.733000Z</published><updated>2017-09-12T20:13:43.733000Z</updated><author><name>Sebastián López</name><uri>https://sourceforge.net/u/selobu/</uri></author><id>https://sourceforge.netc6babb92beaf0b739f102d29fd421b7cd5be957e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;It would be helpful to know how it will be the programatically use of the command line&lt;/p&gt;
&lt;p&gt;using by docutils.core Publish&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;rst2s5.py --theme medium-black slides.txt slides.html
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;and an equivalent code could be&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;docutils.core&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;publish_string&lt;/span&gt;

&lt;span class="n"&gt;variable_string&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;some text&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;========='&lt;/span&gt;
&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;publish_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;variable_string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;writer_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'rst2s5'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;And again how to pass the theme keyyword. That's because  the front end (https://github.com/marianoguerra/rst2html5) also uses the publish_cmdline(writer_name='html', description=description)&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#4 How to programatically use the commandline parameters?</title><link href="https://sourceforge.net/p/docutils/support-requests/4/?limit=25#f90b" rel="alternate"/><published>2017-09-12T18:34:05.796000Z</published><updated>2017-09-12T18:34:05.796000Z</updated><author><name>David Goodger</name><uri>https://sourceforge.net/u/goodger/</uri></author><id>https://sourceforge.neta2b1e9e41bb44a2f7908ab7012e6022dc07a88b9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Those documents refer to the core Docutils code. But you seem to be using a third-party front-end tool. If you need help for that tool, you should ask its author.&lt;/p&gt;
&lt;p&gt;Note that core Docutils also has a rst2html5.py front end. It is NOT the same as the one you referenced (https://github.com/marianoguerra/rst2html5). I don't know how that one works or if it is compatible, and we cannot help you with specifics about that tool.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>