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

The "Use go templates" page is missing its actual go templates #1773

Closed
cpick opened this issue Oct 22, 2020 · 4 comments
Closed

The "Use go templates" page is missing its actual go templates #1773

cpick opened this issue Oct 22, 2020 · 4 comments

Comments

@cpick
Copy link

cpick commented Oct 22, 2020

📚 Documentation

usegotemplates.md contains examples that have go templates (ie things surrounded in double-curly-brackets), but the website's usegotemplates.html has those important sections stripped out.

Perhaps the pipeline that produces the website itself uses go templates and is trying to interpret them?

@johanbrandhorst
Copy link
Collaborator

Haha, that's a great bug. Yeah we obviously use a mustache templating engine somewhere. I wonder if we can escape these in the docs? It's possible the run the docs site locally via the script in the docs folder, so if someone would an easy way to experiment locally, you can run:

$ JEKYLL_GITHUB_TOKEN=<your-github-token> ./run.sh

From the ./docs directory.

@johanbrandhorst
Copy link
Collaborator

CC @Jeremytjuh

@iamrajiv
Copy link
Contributor

iamrajiv commented Oct 29, 2020

@cpick @johanbrandhorst I think this happening because Jekyll uses liquid tags and double curlies are getting ripped out by the liquid processor. To overcome this issue we have to use {% raw %} tag something like this

## {% raw %}{{.RequestType.Name}}{% endraw %}

@johanbrandhorst
Copy link
Collaborator

This is fixed now: https://grpc-ecosystem.github.io/grpc-gateway/docs/mapping/customizingopenapioutput/#using-go-templates-in-protofile-comments 🎉

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

No branches or pull requests

3 participants