Closed slmg closed 4 years ago
Hi @slmg,
I'm glad you like the extension! 🙂
This definitely sounds like a big project, but extracting the core logic to not be depend on the VSCode API is something that I was also thinking about for some time. My plan would be to have some sort of a CLI that's able accept a file, similarly to your example. Later, this could be then be also used in the contexts you mentioned.
I'm going to work on the CLI version in the context of this issue. Thanks for the suggestions!
Hi, I managed to extract the core logic as a stand alone CLI feature in the project and to set up a docker image with it. I'm not currently planning to use this in a CI pipeline or to prettify files from the terminal/scripts, but I hope that you and others might find it useful. 🙂
Available features from the command line
npm run --silent prettify-md < input.md
.npm run --silent prettify-md < input.md > output.md
.npm run --silent check-md < input.md
. This will fail with an exception and return code 1
if the file is not prettyfied.Available features from docker (https://hub.docker.com/r/darkriszty/prettify-md)
docker container run -i darkriszty/prettify-md < input.md
.docker container run -i darkriszty/prettify-md < input.md > output.md
.docker container run -i darkriszty/prettify-md --check < input.md
. This will fail with an exception and return code 1
if the file is not prettyfied.Hi @darkriszty,
Thank you for doing this work, this is very useful! I started to use the docker image in CI and it works perfectly. :+1: I will soon create a new issue (and a PR :slightly_smiling_face: ) to report my feedbacks.
First of all thank you for creating this extension. I used it a bit and I find it pretty neat. It greatly improves readability to prettify markdown tables.
To give you a bit of context I am auto-generating some markdown tables using terraform-docs (another very cool tool btw if you find yourself working on some terraform project). The result table renders well in html but isn't pretty, so at that point I find this extension very useful to prettify it. So far so good.
Problem comes at the moment of trying to automate this process within a CI pipeline: it would be nice to have doc automatically generated and nicely formatted. Therefore I am wondering if you would be up to extract the core logic of your extension and dockerize it, to enable a use such as:
I know this request is technically outside the scope of this project, but I found it made sense to raise as I think your existing code could be re-used fairly easily inside a
node
base image. This image could then be used to create a Github action and would easily be available to anyone willing to prettify their tables.Thanks!