-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support tables #132
Comments
Would it not be more robust to just go full markdown and require |
Given the prevalence of tab-aligned lists in Vim documentation (and the fact that dashes are used as a heading marker already), I don't think this is going to work (robustly). My current idea is to add Unfortunately, the use of "columnar" material in Vim documentation is a mess. I think we cannot do this without getting chrisbra involved. |
That's also an option, but it requires updating a lot of docs. If the
We would require a |
I think there's no way around updating docs, given how lackadaisical vanilla vim docs are about proper markup. (For example, it's used in a bunch of lists of filenames for ... reasons. See, e.g.,
(And I just noticed an issue with this in the current parser: if optionlinks are used for table headers, e.g., |
Personally, I think it's worth doing. We don't even have to update everything immediately, since tables aren't currently parsed anyway, we just need the grammar to not produce |
And a general cleanup (and doc ownership) is necessary IMO to ensure proper flow layout compatibility. We (I) already took the first step with removing parsing errors; adding language annotations would be a natural next step, too. TL;DR: If we want to be able to fully parse our docs (which we do), we must take ownership and tighten up the markup to ensure our tools work. Upstream doesn't care, after all. |
Hi folks, I'm doing some experimental parsing work (external to tree-sitter), and have some observations that might hopefully be helpful. Generally, I think moving towards '|' (as suggested above) would be easier to parse and less bug-prone than tabs. However, given the vast amount of existing documentation, I think it might be worth thinking about an (old) vimdoc to (new) vimdoc converter. With that in mind, I'm looking at the existing 'syntax' and asking two questions: a) can the existing material be parsed at all, and b) what would be the best way to support such a tool in a way that minimises the work that a human would need to do? If that requires a small amount of extra syntax to help the tool, it might be a worthwhile addition. Using It's possible to automate this 'visual' recognition of columns under the condition that the whitespace before an aligned column (if any) must have at least one tab and/or 2+ spaces in it. Although this reduces false positives, they are still a potential problem: in each case, the question is not whether this can be done, but whether it should. It is necessary to have some sort of clue that tabular layout is intended or, alternatively, that one should not be inferred. A column header is one such clue, but '~' at the end of a line is sometimes used for other purposes. See, eg., line 616 of windows.txt ("WinScrolled and WinResized autocommands ~"). I'd also point out that sometimes you might not want a header displayed (as in the third table in 'buffer-list'). This suggests either an invisible header syntax or (my preference) hidden markers to guide the tool. Code blocks are a puzzle in terms of how they should fit in a tabular layout. Sorry for writing too much! |
No, and neither we nor Vim is even trying to.
That's the same purpose: columnar material. The fact that it's mixed with visual (space/tab) alignment is one of the worst parts of vimdoc as a markup language. (Spoiler: it's really not; it's a hodgepodge of things that got added for rendering
They shouldn't; apples and oranges. If you want to help, the first step would be to get buy-in from vim/vim. If they agree on a stricter standardized format for tabular/columnar material that is easier to actually parse instead of just present visually, then we can proceed here. This is a much more intrusive step than adding, say, language markers for codeblocks, which we could do unilaterally. We do not want to invent yet another NIH custom format; if we can't do this with vimdoc, we should just switch to Markdown and port doc changes manually (which we increasingly often need to anyway). This is a long-term effort that won't happen in the next version or two. |
vimdoc has "column" marker
~
which is supposedly intended to markup a table, example:The parser could support this by recognizing anything that is separated by
<tab>
as a column. But it must be started by afoo <tab> bar <tab> ... ~
header. Tab-aligned things that don't have a column header would not be considered tables.The text was updated successfully, but these errors were encountered: