Moving Config Docs From YAML to Markdown

Documenting configuration directly on the config file is great, right? Everything is right there.

Ehh.

This could probably be repackaged.

Why embark on this journey?

You can Ctrl + F (or Command + F) your way through the file, but you ha…


This content originally appeared on DEV Community and was authored by Amara Graham

Documenting configuration directly on the config file is great, right? Everything is right there.

Ehh.

This could probably be repackaged.

Why embark on this journey?

You can Ctrl + F (or Command + F) your way through the file, but you have to know what you are looking for.

You could argue an intuitive experience and naming strategy would work well in this situation, but that's a stretch, particularly when talking about advanced config. A great goal, but really difficult.

For first time users, you are likely going to walk through this template, uncommenting out the config you do want to use. You may take the opportunity to stop and read along the way, but I'm thinking reading nearly 1000 lines and trying to retain keywords for future changes is just not going to work for most people.

So let's get this presented in another way to maximize visibility and gain some of that sweet SEO and searchability people are used to these days. You'll cover the use cases where people go back to the config template directly and get it backed into the docs.

YAML to HTML

From this issue comment:

The template YAML as-is was hard to consume. Nearly everything is commented with # (except flush?) I had to start by copying the file locally and removing the comments for it to be valid YAML.

From there, I took the lazy(ish) approach and used https://github.com/ishswar/yaml-to-table, which didn't work without some changes. Instead of copying the descriptions, it added ipsum... ugh.

I found this project that got me from YAML to HTML. It wasn't perfect since it didn't copy the descriptions, but I'm not above putting on some background noise (music, podcast, etc.) and copy and pasting my little heart out.

HTML to Markdown

Since our docs are in Docusaurus, I could have left the tables in HTML, but once they were in HTML the move to Markdown is pretty well supported by various free tools.

I used TableConvert which takes a bunch of different formats. Just be careful with what you put into any tool! None of this info was sensitive or private.

Wrap up

Could I have done this in a more streamlined or automated way? Likely.

Will I invest the time to script this? Unlikely.

I view this as a one time project with how stable the templates are and how little things change regularly in this space. If we were often adding, removing, or deprecating this config, I would certainly be more motivated to get this automated to go from YAML to Markdown with as little touches as possible.

Have you done something similar? Do you read or work with YAML often? How do you prefer to read documentation on YAML config?

Cover photo by Elevate on Unsplash


This content originally appeared on DEV Community and was authored by Amara Graham


Print Share Comment Cite Upload Translate Updates
APA

Amara Graham | Sciencx (2023-05-03T17:06:45+00:00) Moving Config Docs From YAML to Markdown. Retrieved from https://www.scien.cx/2023/05/03/moving-config-docs-from-yaml-to-markdown/

MLA
" » Moving Config Docs From YAML to Markdown." Amara Graham | Sciencx - Wednesday May 3, 2023, https://www.scien.cx/2023/05/03/moving-config-docs-from-yaml-to-markdown/
HARVARD
Amara Graham | Sciencx Wednesday May 3, 2023 » Moving Config Docs From YAML to Markdown., viewed ,<https://www.scien.cx/2023/05/03/moving-config-docs-from-yaml-to-markdown/>
VANCOUVER
Amara Graham | Sciencx - » Moving Config Docs From YAML to Markdown. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/05/03/moving-config-docs-from-yaml-to-markdown/
CHICAGO
" » Moving Config Docs From YAML to Markdown." Amara Graham | Sciencx - Accessed . https://www.scien.cx/2023/05/03/moving-config-docs-from-yaml-to-markdown/
IEEE
" » Moving Config Docs From YAML to Markdown." Amara Graham | Sciencx [Online]. Available: https://www.scien.cx/2023/05/03/moving-config-docs-from-yaml-to-markdown/. [Accessed: ]
rf:citation
» Moving Config Docs From YAML to Markdown | Amara Graham | Sciencx | https://www.scien.cx/2023/05/03/moving-config-docs-from-yaml-to-markdown/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.