lifecycle-toolkit icon indicating copy to clipboard operation
lifecycle-toolkit copied to clipboard

Substitute code fragments with `include` shortcodes

Open mowies opened this issue 1 year ago • 6 comments

Goal

Replace all code fragments occurring in the documentation with external files that are referenced using the {% include "filename" %}shortcode available in Material for MkDocs. The new files should be in an assets folder inside the same folder as the docs file that is referencing them.

DoD

  • all code fragments moved to files
  • all references replaced with include shortcodes
  • file are in correct assets folders

mowies avatar Nov 27 '23 11:11 mowies

@mowies ,Would it be possible to automate this? for example go through docs and look for

"""yaml bla bla """

and extract this to a file.

I wrote a quick python script to extract yaml code samples. Are there other code sample types?

ahmedavid avatar Dec 03 '23 07:12 ahmedavid

It's definitely possible to automate this, the problem is naming of the files. They should be named in a way that is easily understandable. A few of them will probably also be re-usable in several docs pages. I don't see an easy way to automate that part. Any suggestions?

mowies avatar Dec 04 '23 10:12 mowies

Yes you are right, naming things is the hardest thing in IT. To give meaningful names one needs to be have domain knowledge. I can write a script to extract and replace short codes. Maybe somebody can join to help with naming.

ahmedavid avatar Dec 04 '23 11:12 ahmedavid

Sure! Just start off with a PR and then somebody else can take over and give meaningful names to things :)

mowies avatar Dec 04 '23 12:12 mowies

Hi @mowies, I create a draft pr. Please see if general structure is ok.

ahmedavid avatar Dec 05 '23 05:12 ahmedavid

Author unassigned. More info here https://github.com/keptn/lifecycle-toolkit/pull/2633#issuecomment-1889177875

odubajDT avatar Jan 12 '24 13:01 odubajDT