Skip to content

Update the README generator to allow custom content anywhere throughout the README #78

Description

@briangallagher

The issue at the moment is that custom content can only be created after the generated content. This can create an unnatural flow in the README given that sections such as Additional Resources are created in the generated content.

Proposal

Maintain the existing README generation but allow custom content markers throughout the README.

More Detail

On first generation (no README):

  • Render the full README from the template, All headings + auto markers + auto content.
<!-- auto-overview:start -->
Generated content here
<!-- auto-overview:end --> 

repeat for generated sections 

Editing for custom content

  • Allow custom-content markers to be added anywhere to the README such as:
<!-- custom-quick-start:start -->
Add custom content here
<!-- custom-quick-start:end --> 

On check (fix=False):

  • Render expected README from template.
    • For each auto section:
      • Assert both markers exist in the existing README.
      • Extract and compare only the body between markers to the expected body.
      • If any auto section is missing or mismatched → “Out of sync” (CI fails).
      • Ignore everything outside auto blocks (i.e. custom content).

On fix (fix=True):

  • If all markers exist:

    • Replace bodies between markers with the expected ones (keep everything else).
  • If any required marker is missing or malformed:

    • Overwrite only the auto scaffold from the template (title + headings + auto blocks), leaving custom blocks that are clearly outside that scaffold.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions