epogrebnyak / abacus

A small yet valid double-entry accounting system in Python and command line.
https://epogrebnyak.github.io/abacus/
GNU General Public License v3.0
59 stars 4 forks source link

test runner for code examples in docs #71

Closed epogrebnyak closed 10 months ago

epogrebnyak commented 10 months ago

I'm testing the code examples provided in docs files, but my setup is rather clumsy, also it takes rather long to launch the npx part (codedown). Wonder waht is the best practice for this?

echo.py is a preprocessor that removes the offset from cotent tabs, maybe it soulddo the codedownjb as weel and maybe even lauch the code examples.

# Run Python code from docs
docs-py:
  poetry run python docs/echo.py docs/quick_start.md | npx codedown python > docs/quick_start.py
  poetry run python docs/quick_start.py
  poetry run python docs/echo.py docs/index.md | npx codedown python > docs/_index.py
  poetry run python docs/_index.py

# Run console examples from docs
docs-cli:
  poetry run python docs/echo.py docs/quick_start.md | npx codedown bash > docs/quick_start.bat
  cd docs && rm -f chart.json entries.linejson && quick_start.bat
  poetry run python docs/echo.py docs/index.md | npx codedown bash > docs/_index.bat
  cd docs && rm -f chart.json entries.linejson && _index.bat
epogrebnyak commented 10 months ago

https://github.com/squidfunk/mkdocs-material/discussions/6629

epogrebnyak commented 10 months ago

used now in just boil command