Skip to content

Refactor documentation#2272

Open
mromaszewicz wants to merge 4 commits into
oapi-codegen:mainfrom
mromaszewicz:docs
Open

Refactor documentation#2272
mromaszewicz wants to merge 4 commits into
oapi-codegen:mainfrom
mromaszewicz:docs

Conversation

@mromaszewicz
Copy link
Copy Markdown
Member

Break up the README.md into smaller chunks, and add more docs about the configuration file. All the router examples and the config docs go into their own files under the docs/ directory.

Added a table of contents

For code review, it might be easier to peruse the docs in my source branch, rather than trying to understand it from diffs.

@mromaszewicz mromaszewicz requested a review from a team as a code owner March 3, 2026 22:16
Comment thread README.md
Comment thread README.md Outdated
Copy link
Copy Markdown
Member

@jamietanna jamietanna left a comment

Choose a reason for hiding this comment

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

If we're going to split the documentation across files, that's probably good - I've had grumblings in the past that GitHub's generated table of contents doesn't actually scroll so folks can't scroll through all the headers - but we should consider what this means for the docs in pkg.go.dev, which I believe only pull from README.md - do we need to make sure there's a subset of docs available for pkg.go.dev? Does docs/... work there?

I think if we're going to use Markdown-committed table of contents, we need a way to keep them up-to-date (via automation).

I guess you've generated them one-time using Claude, but to make it consistent, this needs to be automatable + validated in CI

Also, the reason for using an HTML table over Markdown is that it's easier to add new entries without worrying about formatting (should we be introducing whitespace to make sure all the Markdown table columns line up?) etc

(Haven't yet fully reviewed the different pages - will do shortly)

@mromaszewicz
Copy link
Copy Markdown
Member Author

pkg.go.dev will only render a top level doc.go or README.md, in that order of preference, so by splitting the docs into multiple files, our pkg.go.dev gives an overview, while linking people to the more full docs in Github.

The HTML table was a workaround for markdown tables not supporting embedded preformatted blocks. I removed those, and replaced them with links to router-specific documentation, so it's not needed.

Investigating table of contents automation right now, see if I can do something to make it easier, but there seems like no great way.

@mromaszewicz
Copy link
Copy Markdown
Member Author

Ok, I've automated the generation of the TOC. It has a rule in the makefile, and you can see the generated TOC surrounded by comment anchors to tell the tool where to place it. It's in the next commit.

@mromaszewicz mromaszewicz requested a review from jamietanna April 3, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants