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

Comments

@sevki
Copy link
Contributor

@sevki 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 the pkgsite label Nov 2, 2020
@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 modified the milestones: Unreleased, pkgsite/unplanned Nov 2, 2020
@julieqiu
Copy link
Contributor

@julieqiu 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!

@julieqiu julieqiu added the help wanted label Nov 4, 2020
@sevki
Copy link
Contributor Author

@sevki sevki commented Nov 7, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.