How do you make those plugin docs? #1312
-
I'm always amazed at the design and look of the docs for the different plugins. Looking at them, its clear for me that you're using a tool/software to generate them automatically. I want to update a project of mine and would like to use such a tool to cut out repeated information or similar. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Thanks for appreciating the docs 😄 ! Documentation files are mostly auto-generated from a selfmade tool but unfortunately the code for it is a bit scattered everywhere in the codebase so it'll be hard to reuse it elsewhere, and it's tightly coupled for metrics use case anyway so I don't think it's easily reusable as it is currently... It's also not something I plan to refactor (at least in the near future). So unfortunately it's highly improbable you'll be able to reuse the same code as metrics. The The aim of metrics documentation is to follow the "The truth is in the code" principle by having:
While the docs from If you look at a plugin <!--header-->
<!--/header-->
## ➡️ Available options
<!--options-->
<!--/options-->
... Some static documentation that can be written by plugin authors...
## ℹ️ Examples workflows
<!--examples-->
<!--/examples--> metrics/.github/scripts/build.mjs Lines 41 to 44 in 5100eba It's not a perfect solution and the implementation is kind of inconsistant (some templating done in EJS and some in JS) but at least it leverage the amount of work needed for maintenance, and the documentation is guaranteed to be up-to-date and reflects the code while the examples are supposed to be working too since they're tested on each build |
Beta Was this translation helpful? Give feedback.
Thanks for appreciating the docs 😄 !
Documentation files are mostly auto-generated from a selfmade tool but unfortunately the code for it is a bit scattered everywhere in the codebase so it'll be hard to reuse it elsewhere, and it's tightly coupled for metrics use case anyway so I don't think it's easily reusable as it is currently... It's also not something I plan to refactor (at least in the near future).
So unfortunately it's highly improbable you'll be able to reuse the same code as metrics.
But I can explain briefly how it works though if you're interested about it, maybe it can give you ideas 🙂
The
.github/scripts/build.mjs
script is the entrypoint of all generated files (not neces…