From: Guenter M. <mi...@us...> - 2023-11-14 08:50:26
|
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 <eng...@gm...> 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 |