rapidsai / frigate

Frigate is a tool for automatically generating documentation for your Helm charts
https://frigate.readthedocs.io
Other
83 stars 25 forks source link

Support for formatted json inside the table for helm configurations #17

Open raul1991 opened 4 years ago

raul1991 commented 4 years ago

It would be nice to have the json formatted properly inside a table cell rather a single huge line of json.

jacobtomlinson commented 4 years ago

I agree this would be great. It is straight forward to update json.dumps to specify add indentation and sorting. Here's an example from Stack Overflow. I would suggest an indentation of two would be appropriate here.

https://github.com/rapidsai/frigate/blob/d138d180c702165c1fd63b5a49ec90359d14282e/frigate/gen.py#L233

However this means that some will now run over multiple lines and so all the templates will need updating to support this.

https://github.com/rapidsai/frigate/blob/d138d180c702165c1fd63b5a49ec90359d14282e/frigate/templates/html.jinja2#L47 https://github.com/rapidsai/frigate/blob/d138d180c702165c1fd63b5a49ec90359d14282e/frigate/templates/markdown.jinja2#L22 https://github.com/rapidsai/frigate/blob/d138d180c702165c1fd63b5a49ec90359d14282e/frigate/templates/rst.jinja2#L30

raul1991 commented 3 years ago

Just for my understanding ...

The {{default}} will be a multi line json so each block of it lying on separate line needs to back-ticked so as to form a correctly formatted json ?

Like this ?

image

raul1991 commented 3 years ago

or probably using html code to create table like this

https://stackoverflow.com/questions/28508141/code-block-inside-table-row-in-markdown/60502719#60502719

raul1991 commented 3 years ago

Changed the code a bit and it looks beautiful with 4 indents, will push the code soon.

image

jacobtomlinson commented 3 years ago

Awesome I look forward to reviewing the PR!