darkriszty / MarkdownTablePrettify-VSCodeExt

Visual Studio Code extension to prettify markdown tables.
MIT License
65 stars 4 forks source link

Support for markdown table in .erb #54

Closed PhantasWeng closed 3 years ago

PhantasWeng commented 3 years ago

Pretty much API document generator use Ruby for template engine and write markdown in .erb. file, for example slate

Wish this plugin can official support format of .erb file. Or, maybe we can add support file extension in setting panel without fork

darkriszty commented 3 years ago

Hi, I will check how to add additional language support and I'll probably add some configurable languageIds.

darkriszty commented 3 years ago

I did some changes to make the formattable languages extensible by adjusting the extension activation event and adding an extension setting called markdownTablePrettify.extendedLanguages. The setting supports additional languages identifiers for formatting that you can put in an array of strings. You can take a look at the supported language identifiers here: https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers

Your use case with .erb files should work with the following setting:

"markdownTablePrettify.extendedLanguages": [ "ruby" ]

Don't forget to restart VSCode after changing this setting 🙂

The Prettify markdown tables formatting command (also available with the CTRL+ALT+M shortcut) also works for these configured languages. This is useful if you have more formatters available for the same language and you just want to quickly format the markdown tables.

These changes are available in version 3.3.0 of the extension. Let me know if you run into issues with it.