asciidocasciidoctor

How to bulk edit large asciidoc tables in VSCode, or do so with a table editor UI?


I have a large table in .adoc ASCIIDoctor format:

|===
|Col A|ColB

|One
|Foo

|Two
|Bar

//... Many fields ...

|===

That renders like:

Col A Col B
One Foo
Two Bar
...many fields...

I have AsciiDoc extension installed. If I wanted to insert a new column between A and B, how can I do that without having to manually edit every single field in the whole table?

What did I try? Well, there's nothing to try, I'm doing this manually now as I see no option in VSCode or AsciiDoc Extension to either bulk edit or even a nice GUI like you find in Markdown Extension editors.


Solution

  • The best built-in way to manage large tables in an .adoc AsciiDoc file, so far as I've found or asked, is to use the AsciiDoc import feature to import a csv file into a code block, then use a VSCode CSV editor GUI like Edit CSV for editing via a table/cells. This approach is actually more maintainable and better for configuration management anyway, I've found.

    To expand on this, if you're okay editing outside of VSCode, you could use/save Excel files instead, edit equations in Excel, and either Save A Copy of .csv files as exports, or have your pipeline run a python script that auto-converts your .xlsx to .csv so your .adoc file can import it.