Re: [PATCH 0/9] Allow literal tabs in reStructuredText

Guenter Milde via Docutils-develop <[email protected]>
Newsgroups gmane.text.docutils.devel
Message-ID <[email protected]>
Dear Jarret, dear Docutils developers,

thank you for the TAB patch set. A review/test is on my TODO list.

On 2023-10-31, Jarret "Jax" Renker via Docutils-develop wrote:
> On Tuesday, October 31st, 2023 at 1:49 PM, engelbert gruber <[email protected]> wrote:

>> * python discourages usage hardtabs and space mixing, because becomes
>>   painful (IMHO)

> Sure, but other languages, e.g. Makefile, mandate tabs and so do some
> styleguides.

I agree that there is a case for preserving TAB characters in literal
blocks and code blocks (in extension to what is already possible with
included files). 

>> * python philosophy : explicit is better then implicit ... would an
>>   option :hard-tabs: keep be more in line ?

> I'm fine with that.  I planned (re)using the tab_width option of
> docutils.conf (setting it to -1 preserves tabs, like its cousin does
> for the include directive) but introducing a new option is also ok.

The "tab-width" setting is also important to tell the "visible
indentation" of lines that start between tab stops:

"""\
* bullet list

\tThe nesting of this paragraph depends on the ``tab-width`` setting:
\tSecond paragraph of the first item with ``--tab-width 2``,
\tblock quote nested in first item with ``--tab-width`` > 2, but
\tblock quote following the list with ``--tab-width 1``.
"""
      
So we have the choice of

a)  tab-width: <positive integer>
    expand-tabs: <boolean>
    
b)  tab-width: <integer>  
       Negative values preserve TAB characters in "code"
       and "literal" blocks. Other TABs are expanded to abs(tab_width).
       
I prefer b), because it does not increase the number of settings 
and is compatible with the "include" directive's ``:tab-width:`` option.

Günter



_______________________________________________
Docutils-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-develop

Please use "Reply All" to reply to the list.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.