peschmae / glab-component-generator

Golang tool CLI tool to generate README.md from Gitlab Components
MIT License
2 stars 1 forks source link

Customize component heading level and remove extra empty lines #2

Closed mschoettle closed 1 week ago

mschoettle commented 3 weeks ago

Thanks a lot for fixing the issues described in #1! I just tested it along with headers and footers and it works great!

Currently, I have a project called ci-templates and the README at the project root contains general explanations on how to include templates and components, lists templates and then the components.

For the component, I currently link to the source and provide a description of the component. Following that comes to the input table.

The use of the header and footer works great. There's two small issues I have:

I would like to have the components as a level 3 heading because I have a level 2 heading for templates and one for components, would it be possible to configure this?

The other issue is that all my files have an empty line (newline) at the end which causes redundant newlines after the header, after the component header, and after the component (before the footer). Would it be possible to remove them?

I also have two small ideas, and will just note them here instead of bombarding you with more issues (I can also create them separately if you prefer):

peschmae commented 1 week ago

I've published a new release, adding a component-header-level flag to set the header level.

Additionally I've also cleanup some whitespace in the tempalte, especially around the HEADER/FOOTER files.

For the required column I've opened #3

Regarding the YAML snippet, I currently maintain that as part of the HEADER file on each component, and include the required fields there as well. eg.

include:
  - component: gitlab.com/<orga>/<project>/kaniko-build-publish@<VERSION>
    inputs:
      image_name: <YOUR_FANCY_IMAGE>
      image_tag: <SOMETHING_USEFUL_NOT_LATEST>
mschoettle commented 4 days ago

Thanks a lot! Works like a charm now :)