Skip to content
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

gopages: output markdown format (via custom template?) #54

Open
corani opened this issue May 18, 2023 · 3 comments
Open

gopages: output markdown format (via custom template?) #54

corani opened this issue May 18, 2023 · 3 comments

Comments

@corani
Copy link

corani commented May 18, 2023

In my repo I'm using MkDocs to generate a gh-pages site based on the documentation I have in Markdown format. I would like to integrate the godocs within that documentation. Would it be possible to support a custom template for the index files so instead of generating HTML I could generate Markdown instead?

I could probably get MkDocs to include the HTML files, but supporting Markdown would ensure the theme and formatting stays consistent with the rest of the documentation.

@JohnStarich
Copy link
Owner

Thanks @corani for opening. Are you proposing a single README-like Markdown file at the root, similar to pkg.go.dev? Or more like several markdown files throughout?

If I remember right, the Go doc recommendations say to use # Headings, - Bullet points, and [links] in their own format. In your case, they may be package doc comments.
You can see their recommendations here: https://go.dev/doc/comment

@corani
Copy link
Author

corani commented May 23, 2023

I mean: currently gopages is generating HTML files (one index.html per package, AFAICS). Instead I'd like to generate markdown files (ideally via a customizable template). While MkDocs can import the HTML files, they end up looking pretty bad and are not fully integrated in the navigation.

@corani
Copy link
Author

corani commented May 25, 2023

I guess some way to make it possible to override these: https://github.com/JohnStarich/go/blob/master/gopages/internal/generate/template.go#L98

So that the user could provide their own templates.

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

No branches or pull requests

2 participants