Figure out a way to support tab-size / aligning columns #51
Labels
🙅 no/wontfix
This is not (enough of) an issue for this project
👎 phase/no
Post cannot or will not be acted on
Initial checklist
Problem
Other programming languages allow using different “tab stops”, e.g., columns of 2, 3, 4, 8 spaces.
tab
(size) toone
#48), so we can make columns of 2, 3, or 4.Tab stops of 8 don’t work, as everything turns into code:
Tab stops of 4 work perfectly (although indenting block quotes doesn‘t work):
Tab stops of 3 don’t work well due to indented code and the locked sizes of footnotes and block quotes.
Finally, tab stops of 2 work really well, assuming you use 4 spaces for footnotes and indented code:
To summarize, considering constructs:
fences
default totrue
#49), and this newtabSize
feature could throw whenfences: false
?Concluding, we can drop 8, as it won‘t work. Leaving us with 2, 3, and 4.
Given that lists don’t matter and we can ignore HTML, now left with:
3 isn’t great to align things in monospace it seems. And well, it isn’t popular either. So let’s ditch that too. Leaving us with 2 and 4, which both do align as a nice grid.
There is another problem with lists: when they start with indented code. As we’re assuming here that a tab key is used which expands to an X amount of spaces to align, as follows:
This actually renders:
(note the included spaces, “part” of the code).
Perhaps lists should, like block quotes, not be indented with a tab either? But just one space? This is quite a change. And a bit related to #48.
Solution
I’m leaning to think that:
options.indentStyle = 'tab' | 'space'
, default:'space'
options.indentList = boolean | 'mixed'
, default: nowtrue
,false
with Change list item indent fromtab
(size) toone
#48. (false
is current'one'
,true
is current'tab'
,'mixed'
is false for tight lists and true for loose lists, to match Markdown Style Guide)true
/'mixed'
withfences: false
(because a first child code interferes with the tab, note: that this currently is broken as it doesn’t roundtrip)options.indentSize = 2 | 4
, default:4
. Only affects actual spaces, so w/indentStyle: 'space'
. As indented code and footnotes require 4 spaces, it only affects lists w/options.indentList
. But it would affect MDX JSXunified-engine
could start supporting loading an.editorconfig
?Alternatives
The text was updated successfully, but these errors were encountered: