Hacker News new | past | comments | ask | show | jobs | submit login

To regenerate the markdown file I run this command in the console:

    cog -r README.md
Presumably most IDEs have q mechanism that can run that command automatically, either when a file changes or just intermittently over time.

I use VS Code's markdown preview panel, which updates automatically when I manually run the "cog -r" command.




Nice! I didn't know about cog.

I've developed a simple "codeblocks" tool that to keep README.md up-to-date. In your example, here is how to insert the latest `--help` output:

    codeblocks usage-auth README.md -- google-drive-to-sqlite auth --help
Where "usage-auth" is the block language in README.md:

    Full `--help`:
    ```usage-auth
    Usage: ...
    ```
Checking is also possible:

    codeblocks --check usage-auth README.md -- google-drive-to-sqlite auth --help
It's not as generic as cog, but does not require writing codegen scripts inside Markdown file.

https://github.com/shamrin/codeblocks




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: