Skip to content

Update new package README template #2707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

mjwolf
Copy link

@mjwolf mjwolf commented Jul 3, 2025

Update the README templates and generator used in new package creation to match the new standardized README structure. The updated template should be better at helping users write the readme for new packages, by explaining what is needed in each section of the template.

This also makes a few other small changes which will make it easier for new users to create and use integration packages. It moves the generated readme to _dev/build/docs, adds a "Do not modify" message to the README generated during build, and adds a default sample-event (which is needed to build the update readme template, since it now includes {{event}}).

mjwolf added 5 commits July 1, 2025 10:31
Update the README templates and generator used in new package creation
to match the new standardized README structure. The updated template
should be better at helping users write the readme, by explaining what
is needed in each section of the template.

This also makes a few other small changes which will make it easier for
new users to create integration packages. It moves the generated readme
to `_dev/build/docs`, adds a "Do not modify" message to the README
generated during `build`, and adds a default sample-event (which is
needed to build the update readme template).
Rewrite the readme for the test apache package to use the new docs
format.

NOTE: This format isn't used in the published apache integration.
@mjwolf
Copy link
Author

mjwolf commented Jul 3, 2025

The new README template in Kibana, with no changes made to it:

mw-dev-e3609a kb canadacentral azure staging elastic cloud_app_integrations_detail_hello-0 0 9_overview

@@ -204,6 +209,9 @@ func renderReadme(fileName, packageRoot, templatePath string, linksMap linkMap)
}
return linksMap.RenderLink(args[0], options)
},
"header": func(args ...string) (string, error) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This depends on the user leaving ``{{header}}` in the readme in order to add the "Do not modify" string to the generated files.

I could also inject the string into all generated READMEs, regardless of if this {{header}} is in it, but I don't know if this would cause problems with other package types, so I didn't do that. If it won't cause problems, I could change to add to all generated files.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I definitely have no idea if there are any negative consequences, but I'd vote for the string being generated into all generated files without having to worry about including the header placeholder

Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you modify one of the packages under test/packages to see the expected usage and result?

@mjwolf
Copy link
Author

mjwolf commented Jul 7, 2025

Could you modify one of the packages under test/packages to see the expected usage and result?

The panw integration has already been published with the README updated to use the new template: https://github.com/elastic/integrations/tree/main/packages/panw/docs

I can also modify one of the test packages in elastic-package, so there's an example of new template here.

@elasticmachine
Copy link
Collaborator

elasticmachine commented Jul 8, 2025

💔 Build Failed

Failed CI Steps

History

@mjwolf
Copy link
Author

mjwolf commented Jul 9, 2025

I've changed the readme in the test/packages/parallel/apache package to use the new format. This isn't used in the real, published apache integration yet though. I've just added it here so there's an example of the new format in elastic-package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants