Replies: 1 comment 1 reply
-
My experience using things like markdown-autodocs is that they are very fragile. (perhaps more fragile than the thing they are trying to solve) So, it solves the "don't have something in 2 places" problem, but not really the "when did this thing change enough that someone needs to look at the documentation again." problem. Jupyter notebooks also have their own set of problems, since they mix an intention ("Run this code") with the result of running the code in a single file. Personally, I prefer to focus on well commented examples (which can be tested) and writing documentation which is more conceptual, so it doesn't change significantly as the code changes. |
Beta Was this translation helpful? Give feedback.
-
I am researching options to keep the
programming_guide
code snippets tested and updated. I was hoping to start a discussion on possible solutions.Problem
Right now, code snippets are not tested for correctness by the CI which may lead to code snippets silently becoming outdated. It's possible that copied snippets and source code files could also become out of sync, since the snippets require a person to manually copy code from the source into the markdown file.
Possible Solutions
1. Jupyter Notebooks
Converting examples to Jupyter Notebooks might be a way forward, and then those notebooks could be executed as part of the CI process to ensure they remain up-to-date.
2. Markdown Autodocs Action
I found a GitHub action called Markdown Autodocs that might also be a path forward. Markdown Autodocs scans selected markdown files for specifically formatted comments, and then inserts code snippets into those markdown files and creates a commit to the repo with the update. I created a proof-of-concept repo/action using markdown autodocs here. Specifically, the code snippet managed by markdown autodocs here. For what it's worth, I found it pretty easy to use.
Other options??
Perhaps something I haven't thought of?
Beta Was this translation helpful? Give feedback.
All reactions