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

Refactor to support pluggable examples #8

Open
skyzyx opened this issue Apr 5, 2017 · 1 comment
Open

Refactor to support pluggable examples #8

skyzyx opened this issue Apr 5, 2017 · 1 comment

Comments

@skyzyx
Copy link
Contributor

skyzyx commented Apr 5, 2017

Being able to install sphinxcontrib-httpexample followed by sphinxcontrib-httpexample-guzzle would be great.

Specifically, if the examples used something easy to use like Jinja2, it would be much easier for people to develop their own plugins for examples.

@datakurre
Copy link
Collaborator

Because Python is dynamic language, you could extend the plugin could already with custom Sphinx-plugins, by adding their own example builder into AVAILABLE_BUILDERS dictionary of sphinxcontrib.httpexample.directives.

https://github.com/collective/sphinxcontrib-httpexample/blob/master/src/sphinxcontrib/httpexample/directives.py#L12

Builder is simply a function, which receives Python built-in BaseHTTPRequestHandler with example request data and should return a string of corresponding example syntax for a similar request.

I agree that documentation for extending the plugin would be nice. I keep that in mind, when I'm working on this extension next time.

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

No branches or pull requests

2 participants