siefkenj / unified-latex

Utilities for parsing and manipulating LaTeX ASTs with the Unified.js framework
MIT License
85 stars 20 forks source link

cli #85

Closed MarcelSchaible closed 1 week ago

MarcelSchaible commented 6 months ago

Hi,

this project looks promising and can solve a problem I am facing since years now. I am building proceedings for my department and the authors often deliver funny latex files.

But how can I run for e.g. the linter from a shell? Since I am a npm newbie any help is appreciated.

Thanks

Marcel

siefkenj commented 6 months ago

If you want to use unified-latex-cli, do npm install -g @unified-latex/unified-latex-cli. Then you can run npx unified-latex -h, or if it is in your path, just unified-latex.

The CLI has basic linting and formatting capabilities. If you need something more custom, you will have to write your own node script. You can look in the examples folder for some example usage of the unified-latex libraries. You can glue them together with a node script that reads file input, etc.