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

Support examples section #112

Merged
merged 1 commit into from
Jun 9, 2020

Conversation

igonro
Copy link
Contributor

@igonro igonro commented May 15, 2020

This PR is to support the examples section.

In progress...

Issue mkdocstrings/pytkdocs#8 and PR mkdocstrings/pytkdocs#35

@pawamoy
Copy link
Member

pawamoy commented May 26, 2020

You must use an {% include directive as well, like for other types of sections, as it will allow users to override only the examples.html template, and not the whole docstring.html one.

In your other PR I also explain that we should parse interactive-like Python code blocks. Here the examples.html template would iterate on a list of paragraphs (markdown paragraphs and code blocks, this list should be built by the google parser, and stored in the section value), and:

  • render markdown paragaph with the convert_markdown filter
  • render code blocks with the highlight(language="python") filter

Feel free to ask for more details here or come and chat on Gitter! https://gitter.im/mkdocstrings/community

@igonro igonro changed the title [WIP] Support examples section Support examples section May 27, 2020
@igonro
Copy link
Contributor Author

igonro commented May 27, 2020

This is working as expected with mkdocstrings/pytkdocs#35.

I know that maybe it would be better to create a examples.html template, but I don't have knowledges about Django, neither time to get on with it.

Maybe we should add an issue with 'improvement' tag about this, but for now sadly I can't spend more time on this feature.

@pawamoy
Copy link
Member

pawamoy commented May 27, 2020

Django

Jinja2! 😁

Of course, thank you very much for the time you spent on working on this feature. I'll take it from here (though I don't have much time these days either 😅).

Could you confirm the "allow maintainers to edit this PR" box is checked? Thanks!

@igonro
Copy link
Contributor Author

igonro commented Jun 2, 2020

Django

Jinja2! 😁

Of course, thank you very much for the time you spent on working on this feature. I'll take it from here (though I don't have much time these days either 😅).

Could you confirm the "allow maintainers to edit this PR" box is checked? Thanks!

Yes! It is checked. Sorry for the late response.

@pawamoy pawamoy force-pushed the support-examples-section branch from 941ea3f to a17ea36 Compare June 7, 2020 13:51
Co-authored-by: Iago GR <igonro@gmail.com>
@pawamoy pawamoy force-pushed the support-examples-section branch from a17ea36 to 5a41cca Compare June 7, 2020 13:52
@pawamoy pawamoy merged commit 650c754 into mkdocstrings:master Jun 9, 2020
@pawamoy
Copy link
Member

pawamoy commented Jun 9, 2020

Thanks again @igonro, I'll release this soon 🙂

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

Successfully merging this pull request may close these issues.

2 participants