You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm very grateful for this project, and I really like it. Thanks for all your effort :)
The reason behind this PR is that I want a more pkg.go.dev like experience, i.e. a sidebar/ navbar that updates based on the position on the page, etc.
Thanks for the PR, @l0nax. It makes sense to expose this information in the front matter data—I assume you're using this information somehow to fill a TOC?
That said, I don't think the raw godoc.Types should be exposed.
Those include a lot of the information needed to render the HTML, and don't necessarily have a stable shape.
For example, none of the decl-rendering or comment rendering logic will work in the frontmatter template.
If we could instead create a copy of a subset of that information for frontmatterData, that would be much better.
For example, for the types, we would probably have:
type frontmatterType struct {
Name string
Constants, Variables []*frontmatterValue
// ..
}
type frontmatterValue struct {
Names []string
}
It'll need a little boilerplate to build this mirror subset, but it'll be a stable API for the frontmatter templates that I can commit to not breaking in the future.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm very grateful for this project, and I really like it. Thanks for all your effort :)
The reason behind this PR is that I want a more pkg.go.dev like experience, i.e. a sidebar/ navbar that updates based on the position on the page, etc.