Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7k
allow adding other languages in source code documentation#5257
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
carltongibson commentedDec 14, 2017
@skriptix. This looks good. (Sorry for the slow response.) Are you up for bringing this up to date? If so, it seems a reasonable addition. |
skriptix commentedDec 15, 2017
@carltongibson Sorry, I am not sure what you are asking for. "bringing this up to date" sounds like you did have some sort of meeting? |
skriptix commentedDec 15, 2017
Ok, now i got it. You want me to resolve the conflicts. I will have a look! |
skriptix commentedDec 15, 2017
@carltongibson Hi, the branch is up to date now. Thanks for giving it a try! |
carltongibson commentedDec 15, 2017
👌🏼 awesome I’ll have a look next week. Current thought is to take this as is but create a new ticket for documenting the templates in API docs, so users then know how to override. Since there are currently no such docs I don’t want to hold this up for that. Thanks for the effort! |
carltongibson left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
OK. Looks good.
I'm going to milestone for v3.8 to allow a little more time to review.
At a minimum we'll need to add docs for the new parameters toget_docs_view etc. I think we also need to document the process of subclassingDocumentationRenderer here. (In the end I, in fact, do think the PR isn't really complete without that.)
This is a good feature though. We should definitely have it. 👍
Hi folks, many thanks for this great framework!!!
Description
The source code snippets shown in the API documentation are great, but up not now not adaptable. I would like to add source code snippets for different languages or for using the interface via a special wrapper library, which is used in our project to route requests depending on being on a productive or a staging system.
To have a chance to inject a modified version of DocumentationRenderer, the parameter renderer_classes has been added to documentation.include_docs_urls(). Now i can e.g. reduce
the number of displayed source code languages (and modify the ordering) like this:
To make this work some of the HTML templates have been adapted as well.
By adding new language names and providing the appropriate templates, it is now even possible to add new language snippets to the API documentation.
What do you think?
Thanks and Regards,