cli-static-render
: Add option to cli to take an input and return the rendered html
#854
Open
4 tasks done
Clear and concise description of the problem
I want to be able to use shiki in non JavaScript project without having to render it in the client side. This would allow it to be used in non-javascript projects to generate static HTML that could then be inserted into The output of the other template engine/documentation tool.
To give an illustrative example: a lot of documentation is generated using the python (sphinx)[https://www.sphinx-doc.org] The highlighting that shiki provides is far better than alternative like pygments. It would be nice to be able to replace the highlighting it does with that of shiki.
If this feature sounds useful I would be happy to work on a pr implementing it
Suggested solution
I think that a good way to be able to achieve this would be to add the following features to either the existing cli package or create a additional cli package for just staticly rendering:
specify the code to be highlighted
a) a string of text via a flag or piped to stdin
b) the path to a file
c) the path to a folder of source files
provide a way to specify the parameters passed to the codeToHtml function by
a) passing in a json string or json file
b) provide flags
This cli can then be called in another programing language or script by calling the cli with whatever language features they have for Interacting with cli application. For instance in python the subprocesses library.
Alternative
There are a few alternatives I have considered
Additional context
No response
Validations
Contributes
The text was updated successfully, but these errors were encountered: