<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to 97: --disable-tab-expansion flag</title><link href="https://sourceforge.net/p/docutils/feature-requests/97/" rel="alternate"/><link href="https://sourceforge.net/p/docutils/feature-requests/97/feed.atom" rel="self"/><id>https://sourceforge.net/p/docutils/feature-requests/97/</id><updated>2024-03-05T16:40:53.478000Z</updated><subtitle>Recent changes to 97: --disable-tab-expansion flag</subtitle><entry><title>#97 --disable-tab-expansion flag</title><link href="https://sourceforge.net/p/docutils/feature-requests/97/?limit=25#169f/7fb7" rel="alternate"/><published>2024-03-05T16:40:53.478000Z</published><updated>2024-03-05T16:40:53.478000Z</updated><author><name>Günter Milde</name><uri>https://sourceforge.net/u/milde/</uri></author><id>https://sourceforge.netfe5f5ee8a0ef668a6679f4b07c4eadc089dfcacf</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Two minor points:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You can add a class value to a literal block preceding it with a "class" directive ("rst-class" with Sphinx):&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;..&lt;/span&gt; &lt;span class="ow"&gt;class&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt; testme

::

   a literal block
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;TABs are converted to spaces in literal blocks, too :(&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</summary></entry><entry><title>#97 --disable-tab-expansion flag</title><link href="https://sourceforge.net/p/docutils/feature-requests/97/?limit=25#52ea/00ba" rel="alternate"/><published>2023-12-12T16:14:18.758000Z</published><updated>2023-12-12T16:14:18.758000Z</updated><author><name>Günter Milde</name><uri>https://sourceforge.net/u/milde/</uri></author><id>https://sourceforge.nete6c3cd45e4d75a47eb3598632d53b4fc083a1bd6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;The negative value for the TAB expansion width is only supported for literal inclusions, not for the main document or included rST files.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#97 --disable-tab-expansion flag</title><link href="https://sourceforge.net/p/docutils/feature-requests/97/?limit=25#e46f" rel="alternate"/><published>2023-11-09T17:04:17.728000Z</published><updated>2023-11-09T17:04:17.728000Z</updated><author><name>Günter Milde</name><uri>https://sourceforge.net/u/milde/</uri></author><id>https://sourceforge.netaf0d1e4403e3db5e005a1198f6362c9c5332b2d1</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;A patch-set was posted to the "docutils-develop" mail list on 2023-10-29. See the thread in the &lt;a class="" href="https://sourceforge.net/p/docutils/mailman/docutils-develop/?viewmonth=202310"&gt;archive&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#97 --disable-tab-expansion flag</title><link href="https://sourceforge.net/p/docutils/feature-requests/97/?limit=25#169f" rel="alternate"/><published>2023-07-16T10:27:37.777000Z</published><updated>2023-07-16T10:27:37.777000Z</updated><author><name>toastal</name><uri>https://sourceforge.net/u/toastal/</uri></author><id>https://sourceforge.net060fdb77dedaf15dd55b6b07d7e031bca1638db2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Understanding my ask a bit more now:&lt;/p&gt;
&lt;p&gt;I want a code block options for &lt;code&gt;:tab-width: -1&lt;/code&gt;, tho preferably I want this on a global flag because I do not want &lt;code&gt;docutils&lt;/code&gt; to convert my tabs to spaces so my code is a) easier to copy from a post and b) so the reader may adjust the tab widths while reading.&lt;/p&gt;
&lt;p&gt;Tab conversion was unexpected as reStructuredText seemed to have no issues allowing me to use tabs as indentation for block as well as indentation inside &lt;code&gt;code-block&lt;/code&gt;s. Documentation was also confusing where some things (e.g. directives, CLI flags) had tab-width options that allowed values &amp;lt;1 whereas others did not.&lt;/p&gt;
&lt;p&gt;I considered trying to use a literal block, &lt;code&gt;::&lt;/code&gt;, as a workaround, but without the ability to add classes there would be no way to discern a “code block” literal from a literal literal. My best idea for a workaround for now is, for HTML at least, do a post-processing phase that finds all code blocks and runs their contents through GNU unexpand. This is obviously not ideal. Using the &lt;code&gt;code-block&lt;/code&gt; will still keep the document readable &amp;amp; allows Tree-sitter to highlight the children, so this hack will have to do.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#97 --disable-tab-expansion flag</title><link href="https://sourceforge.net/p/docutils/feature-requests/97/?limit=25#52ea" rel="alternate"/><published>2023-07-16T09:41:13.297000Z</published><updated>2023-07-16T09:41:13.297000Z</updated><author><name>toastal</name><uri>https://sourceforge.net/u/toastal/</uri></author><id>https://sourceforge.net07595f43177c67b3fcd58ac0c620c05b61d81aa2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;[restructuredtext parser]&lt;/span&gt;
&lt;span class="na"&gt;tab-width&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;-1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Did not work in a docutils.conf file either.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#97 --disable-tab-expansion flag</title><link href="https://sourceforge.net/p/docutils/feature-requests/97/?limit=25#d270" rel="alternate"/><published>2023-07-16T09:33:02.772000Z</published><updated>2023-07-16T09:33:02.772000Z</updated><author><name>toastal</name><uri>https://sourceforge.net/u/toastal/</uri></author><id>https://sourceforge.net65ea501ee4769cc4474eae6285adc125e23781e3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;docutils: error: Error in option "--tab-width":&lt;br/&gt;
   ValueError: negative value; must be positive or zero&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;No luck actually trying.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#97 --disable-tab-expansion flag</title><link href="https://sourceforge.net/p/docutils/feature-requests/97/?limit=25#95f3" rel="alternate"/><published>2023-07-16T09:31:59.949000Z</published><updated>2023-07-16T09:31:59.949000Z</updated><author><name>toastal</name><uri>https://sourceforge.net/u/toastal/</uri></author><id>https://sourceforge.net89ef69b58525f21a3931ce551300a3d4432e334a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;A negative value prevents expansion of hard tabs.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Found somewhere else in the docs. Not it the &lt;code&gt;--help&lt;/code&gt; text. Missing from &lt;a href="https://docutils.sourceforge.io/docs/user/config.html#tab-width" rel="nofollow"&gt;https://docutils.sourceforge.io/docs/user/config.html#tab-width&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>--disable-tab-expansion flag</title><link href="https://sourceforge.net/p/docutils/feature-requests/97/" rel="alternate"/><published>2023-07-16T09:21:39.753000Z</published><updated>2023-07-16T09:21:39.753000Z</updated><author><name>toastal</name><uri>https://sourceforge.net/u/toastal/</uri></author><id>https://sourceforge.net67e6e06db5581a9dd0891e9d6fa1ee6dee41c8e4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;Spaces are recommended for indentation, but tabs may also be used. Tabs will be converted to spaces. Tab stops are at every 8th column (processing systems may make this value configurable).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Why tho? By converting tabs to spaces, we lose the accessibility aspect that tabs provide by letting the reader decide what’s comfortable to them as tab-width should be configurable on the reader’s side, not the writer’s. Some programming languages, like Go, tabs are overwhelmingly preferred &amp;amp; sometimes even required. Copying some code would not work.&lt;/p&gt;
&lt;p&gt;I would like to see a &lt;code&gt;--disable-tab-expansion&lt;/code&gt; flag that lets the author choose how they want their output to be output.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>