librelist archives

« back to archive

route information (decorator) in sphinx doc

route information (decorator) in sphinx doc

From:
Cornelius Kölbel
Date:
2014-12-11 @ 18:16
Hallo,

this might be a more sphinx specific question, but as it is in
combination with flask - maybe someone stumbled upon thins.

I'd like to create a sphinx documentation of my flask project.
I created an API with routes for the functions and added the automodule
and :members: stuff to write the docstrings to the documentation.

Everything works fine so far, but I am wondering if there is a smart way
to add the route information automatically.
The generated documentation would not give an clue, that the function

 @app.route("/init")
 def init()
     pass


would serve the route /app/init.

Kind regards
Cornelius


Re: [flask] route information (decorator) in sphinx doc

From:
Cornelius Kölbel
Date:
2014-12-11 @ 18:54
hm,
sphinxcontrib.autohttp.flask

<https://pythonhosted.org/sphinxcontrib-httpdomain/#module-sphinxcontrib.autohttp.flask>

Am 11.12.2014 um 19:16 schrieb Cornelius Kölbel:
> Hallo,
>
> this might be a more sphinx specific question, but as it is in
> combination with flask - maybe someone stumbled upon thins.
>
> I'd like to create a sphinx documentation of my flask project.
> I created an API with routes for the functions and added the automodule
> and :members: stuff to write the docstrings to the documentation.
>
> Everything works fine so far, but I am wondering if there is a smart way
> to add the route information automatically.
> The generated documentation would not give an clue, that the function
>
>  @app.route("/init")
>  def init()
>      pass
>
>
> would serve the route /app/init.
>
> Kind regards
> Cornelius
>
>
>

Re: [flask] route information (decorator) in sphinx doc

From:
Cornelius Kölbel
Date:
2014-12-11 @ 19:04
That. Looks. Cool.

Thanks!

Am 11.12.2014 um 19:54 schrieb Cornelius Kölbel:
> hm,
> sphinxcontrib.autohttp.flask
> 
<https://pythonhosted.org/sphinxcontrib-httpdomain/#module-sphinxcontrib.autohttp.flask>
>
> Am 11.12.2014 um 19:16 schrieb Cornelius Kölbel:
>> Hallo,
>>
>> this might be a more sphinx specific question, but as it is in
>> combination with flask - maybe someone stumbled upon thins.
>>
>> I'd like to create a sphinx documentation of my flask project.
>> I created an API with routes for the functions and added the automodule
>> and :members: stuff to write the docstrings to the documentation.
>>
>> Everything works fine so far, but I am wondering if there is a smart way
>> to add the route information automatically.
>> The generated documentation would not give an clue, that the function
>>
>>  @app.route("/init")
>>  def init()
>>      pass
>>
>>
>> would serve the route /app/init.
>>
>> Kind regards
>> Cornelius
>>
>>
>>

Re: [flask] route information (decorator) in sphinx doc

From:
David Baumgold
Date:
2014-12-11 @ 18:21
Perhaps you want to use 
sphinxcontrib.httpdomain? https://pythonhosted.org/sphinxcontrib-httpdomain/


From: Cornelius Kölbel <cornelius@privacyidea.org>
Reply: flask@librelist.com <flask@librelist.com>>
Date: December 11, 2014 at 1:19:56 PM
To: flask@librelist.com <flask@librelist.com>>
Subject:  [flask] route information (decorator) in sphinx doc  

Hallo,  

this might be a more sphinx specific question, but as it is in  
combination with flask - maybe someone stumbled upon thins.  

I'd like to create a sphinx documentation of my flask project.  
I created an API with routes for the functions and added the automodule  
and :members: stuff to write the docstrings to the documentation.  

Everything works fine so far, but I am wondering if there is a smart way  
to add the route information automatically.  
The generated documentation would not give an clue, that the function  

@app.route("/init")  
def init()  
pass  


would serve the route /app/init.  

Kind regards  
Cornelius  


Re: [flask] route information (decorator) in sphinx doc

From:
Cornelius Kölbel
Date:
2014-12-11 @ 18:52
Hi David,

this does not solve my problem ;-)
But looks great anyway.
THanks for the hint.

Kind regards
Cornelius

Am 11.12.2014 um 19:21 schrieb David Baumgold:
> Perhaps you want to use
> sphinxcontrib.httpdomain? https://pythonhosted.org/sphinxcontrib-httpdomain/
>
>
> From: Cornelius Kölbel <cornelius@privacyidea.org>
> <mailto:cornelius@privacyidea.org>
> Reply: flask@librelist.com <flask@librelist.com>>
> <mailto:flask@librelist.com>
> Date: December 11, 2014 at 1:19:56 PM
> To: flask@librelist.com <flask@librelist.com>>
> <mailto:flask@librelist.com>
> Subject: [flask] route information (decorator) in sphinx doc
>
>> Hallo,
>>
>> this might be a more sphinx specific question, but as it is in
>> combination with flask - maybe someone stumbled upon thins.
>>
>> I'd like to create a sphinx documentation of my flask project.
>> I created an API with routes for the functions and added the automodule
>> and :members: stuff to write the docstrings to the documentation.
>>
>> Everything works fine so far, but I am wondering if there is a smart way
>> to add the route information automatically.
>> The generated documentation would not give an clue, that the function
>>
>> @app.route("/init")
>> def init()
>> pass
>>
>>
>> would serve the route /app/init.
>>
>> Kind regards
>> Cornelius
>>
>>
>>