Search Results

Search found 8 results on 1 pages for 'autodoc'.

Page 1/1 | 1 

  • Sphinx autodoc is not automatic enough

    - by Cory Walker
    I'm trying to use Sphinx to document a 5,000+ line project in Python. It has about 7 base modules. As far as I know, In order to use autodoc I need to write code like this for each file in my project: .. automodule:: mods.set.tests :members: :show-inheritance: This is way too tedious because I have many files. It would be much easier if I could just specify that I wanted the 'mods' module to be documented. Sphinx could then recursively go through the module and make a page for each submodule. Is there A feature like this? If not I could write a script to make all the .rst files, but that would take up a lot of time.

    Read the article

  • displaying python's autodoc to the user (python 3.3)

    - by Plotinus
    I'm writing a simple command line math game, and I'm using python's autodoc for my math algorithms to help me remember, for example, what a proth number is while i'm writing the algorithm, but later on I'll want to tell that information to the user as well, so they'll know what the answer was. So, for example I have: def is_proth(): """Proth numbers and numbers that fit the formula k×2^n + 1, where k are odd positive integers, and 2^n > k.""" [snip] return proths and then I tried to make a dictionary, like so: definitions = {"proths" : help(is_proth)} But it doesn't work. It prints this when I start the program, one for each item in the dictionary, and then it errors out on one of them that returns a set. And anyway, I don't want it displayed to the user until after they've played the game. Help on function is_proth in module __main__: is_proth() Proth numbers and numbers that fit the formula k×2^n + 1, where k are odd positive integers, and 2^n > k. (END) I understand the purpose of autodoc is more for helping programmers who are calling a function than for generating userdoc, but it seems inefficient to have to type out the definition of what a proth number is twice, once in a comment to help me remember what an algorithm does and then once to tell the user the answer to the game they were playing after they've won or lost.

    Read the article

  • How to autodoc .Net Google code projects?

    - by Remus Rusanu
    I know how to generate html documentation using Sandcastle and similar tools. But if I want to host the project on Google code, how can I easily publish the documentation straight into the Google project Wiki pages? I can see the SVN repository has a wiki folder which I assume maps to the project Wiki pages and I guess I can make a build step to build the documentation from the autodoc tags. But is there some tool that generates wiki compatible format from the code documentation tags?

    Read the article

  • Sphinx Error Unknow directive type "automodule" or "autoclass"

    - by user1130381
    I need document my python project using Sphinx. But I can't use autodoc. When I config my project I select the option "extension autodoc", but now if I use .. autoclass:: Class, I have a ERROR: ERROR: Unknown directive type "autoclass" I configure the PYTHONPATH, and now it's good. But I already have this problem. My index file is: .. ATOM documentation master file, created by sphinx-quickstart on Thu Nov 22 15:24:42 2012. You can adapt this file completely to your liking, but it should at least contain the root toctree directive. Welcome to ATOM's documentation! Contents: .. toctree:: :maxdepth: 2 .. automodule:: atom Indices and tables :ref:genindex :ref:modindex :ref:search Thank you, I need that someone say me how I find the problem, or how i can fix this! Sorry for my English, I start now to learn English.

    Read the article

  • Documenting module/class/function bodies in python sphinx docs

    - by perrierism
    Is there a way with Sphinx documentation to output a function or class body (the code itself) with the autodoc feature? I'm using autodoc to much success. In addition to the docstrings getting pulled in to the documentation I want like a link to click for each function where it will show you the source... is that possible? This is about what most of my documentation looks like now: .. module:`foo.mymodule` Title =================== .. automodule:: foo.mymodule .. autoclass:: MyModulesClass :members: :undoc-members:

    Read the article

  • Make Sphinx generate RST class documentation from pydoc

    - by Michal Cihar
    I'm currently migrating all existing (incomplete) documentation to Sphinx. The problem is that the documentation uses Python docstrings (the module is written in C, but it probably does not matter) and the class documentation must be converted into a form usable for Sphinx. There is sphinx.ext.autodoc, but it automatically puts current docstrings to the document. I want to generate source (RST) file based on current docstrings, which I could edit and improve manually. How would you transform docstrings into RST for Sphinx?

    Read the article

  • Make Sphinx generate me rst for class documentation from pydoc

    - by Michal Cihar
    I'm currently in process of migrating existing (non complete) documentation to Sphinx. The final goal is to have all documentation in Sphinx. The problem I'm facing right now is that I have some documentation using Python docstrings (well the module is actually written in C, but it probably does not matter) and I would like to generate class documentation in form usable for Sphinx from these docstrings. I know there is sphinx.ext.autodoc, but it automatically puts current docstrings to the document. I rather want to generate source (rst) file based on current docstrings, which I could edit and improve manually. So is there some way to turn existing docstrings into rst form which Sphinx consumes?

    Read the article

  • Using Sphinx with a distutils-built C extension

    - by detly
    I have written a Python module including a submodule written in C: the module itself is called foo and the C part is foo._bar. The structure looks like: src/ foo/__init__.py <- contains the public stuff foo/_bar/bar.c <- the C extension doc/ <- Sphinx configuration conf.py ... foo/__init__.py imports _bar to augment it, and the useful stuff is exposed in the foo module. This works fine when it's built, but obviously won't work in uncompiled form, since _bar doesn't exist until it's built. I'd like to use Sphinx to document the project, and use the autodoc extension on the foo module. This means I need to build the project before I can build the documentation. Since I build with distutils, the built module ends up in some variably named dir build/lib.linux-ARCH-PYVERSION — which means I can't just hard-code the directory into a Sphinx' conf.py. So how do I configure my distutils setup.py script to run the Sphinx builder over the built module? For completeness, here's the call to setup (the 'fake' things are custom builders that subclass build and build_ext): setup(cmdclass = { 'fake': fake, 'build_ext_fake' : build_ext_fake }, package_dir = {'': 'src'}, packages = ['foo'], name = 'foo', version = '0.1', description = desc, ext_modules = [module_real])

    Read the article

1