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

x/pkgsite: trim the non text elements from subdirectories synopsis #42335

Open
sevki opened this issue Nov 2, 2020 · 2 comments
Open

x/pkgsite: trim the non text elements from subdirectories synopsis #42335

sevki opened this issue Nov 2, 2020 · 2 comments
Labels
help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite/dochtml Issues related to package documentation in pkgsite pkgsite

Comments

@sevki
Copy link
Contributor

sevki commented Nov 2, 2020

synopsis here (I believe this is the line https://github.com/golang/pkgsite/blob/master/content/static/html/pages/subdirectories.tmpl#L19) looks really awkward
image
as opposed to the
image

may I suggest rendering that synopsis to html and removing all non text html elements from that section? something like this might work

depth := 0
summary := bytes.NewBuffer(nil)
for {
	tt := z.Next()
	switch tt {
	case html.ErrorToken:
		break
	case html.TextToken:
		summary.Write(z.Text())
}
return summary.String()
@gopherbot gopherbot added this to the Unreleased milestone Nov 2, 2020
@sevki sevki changed the title x/pkgsite: trim the non span html elements x/pkgsite: trim the non text elements from subdirectories synopsis Nov 2, 2020
@jba jba added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 2, 2020
@jba jba modified the milestones: Unreleased, pkgsite/unplanned Nov 2, 2020
@julieqiu
Copy link
Member

julieqiu commented Nov 4, 2020

@sevki - thanks for the feedback!

may I suggest rendering that synopsis to html and removing all non text html elements from that section? something like this might work

Feel free to send us a CL!

@sevki
Copy link
Contributor Author

sevki commented Nov 7, 2020

@julieqiu sure. Will do, let me check Monday if we have your corp CLA signed :)

@hyangah hyangah added the pkgsite/dochtml Issues related to package documentation in pkgsite label May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite/dochtml Issues related to package documentation in pkgsite pkgsite
Projects
None yet
Development

No branches or pull requests

5 participants