[sphinx-dev] sphinx.ext.autodoc
Hi, I'm trying to use Sphinx to provide a documentation site for my company. We develop an open source software and our source code it's not accessible because not well documented. It's mentioned that we can generate autodoc from Sphinx but I can't find what should I configure to add this extension. Can I have help please? Best regards -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to sphinx-...@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.
Re: [sphinx-dev] sphinx.ext.autodoc
On Thu, Oct 21, 2010 at 10:09 AM, Maarch wrote: > I'm trying to use Sphinx to provide a documentation site for my > company. We develop an open source software and our source code it's > not accessible because not well documented. > It's mentioned that we can generate autodoc from Sphinx but I can't > find what should I configure to add this extension. > Can I have help please? I can't tell from your query, so I have to ask: have you read the documentation? Sphinx, being a tool for documentation, tends to have great documentation, and the docs for autodoc don't disappoint: http://sphinx.pocoo.org/ext/autodoc.html Basically you just make sure the code you want to extract docstrings from is on PYTHONPATH, and then do something like:: .. autoclass:: mymodule.MyClass In your docs. Jacob -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to sphinx-...@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.
Re: [sphinx-dev] sphinx.ext.autodoc
On Thu, Oct 21, 2010 at 8:39 AM, Jacob Kaplan-Moss wrote: > On Thu, Oct 21, 2010 at 10:09 AM, Maarch wrote: >> I'm trying to use Sphinx to provide a documentation site for my >> company. We develop an open source software and our source code it's >> not accessible because not well documented. >> It's mentioned that we can generate autodoc from Sphinx but I can't >> find what should I configure to add this extension. >> Can I have help please? > > I can't tell from your query, so I have to ask: have you read the > documentation? Sphinx, being a tool for documentation, tends to have > great documentation, and the docs for autodoc don't disappoint: > http://sphinx.pocoo.org/ext/autodoc.html > > Basically you just make sure the code you want to extract docstrings > from is on PYTHONPATH, and then do something like:: > > .. autoclass:: mymodule.MyClass > > In your docs. > > Jacob > > -- > You received this message because you are subscribed to the Google Groups > "sphinx-dev" group. > To post to this group, send email to sphinx-...@googlegroups.com. > To unsubscribe from this group, send email to > sphinx-dev+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sphinx-dev?hl=en. > > Maybe the problem is you also have to follow the instructions at: http://sphinx.pocoo.org/config.html#confval-extensions which are a bit vague. In this particular case in your conf.py file do: sys.path.insert(0, os.path.abspath(PATH_TO_THE_MODULES_YOU_ARE_AUTODOCING)) extensions = ['sphinx.ext.autodoc'] -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to sphinx-...@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.
[sphinx-dev] How is the Sphinx home page created?
I've wondered for a while how the Sphinx home page at http://sphinx.pocoo.org/index.html is created. Unlike all the other pages on the site there isn't a Show Source link. It also doesn't seem to be in http://bitbucket.org/birkenfeld/sphinx/src/tip/doc/. I like the idea of having the Home page be a general overview of the entire website with no Next navigation in the Navigation bar and a completely different sidebar from the rest of the site. It still of course links seamlessly with the "normal" Sphinx generated documention. However, it's not completely obvious to me how this was done. -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to sphinx-...@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.
Re: [sphinx-dev] How is the Sphinx home page created?
Hi, > I've wondered for a while how the Sphinx home page at > http://sphinx.pocoo.org/index.html is created. Unlike all the other > pages on the site there isn't a Show Source link. It also doesn't seem > to be in http://bitbucket.org/birkenfeld/sphinx/src/tip/doc/. This page is not created from reST file. See _template directory and you can see the file. http://bitbucket.org/birkenfeld/sphinx/src/tip/doc/ Sphinx supports static html and Jinja2 template (you add suffix "_t" like "style.css_t") too. I was asked same question from my friend :-) -- #! /usr/bin/python2 def shibu(shibukawa, yoshiki): web = "http://www.shibu.jp"; mail = "yosh...@shibu.jp" twitter = "@shibukawa" return "smile!" -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to sphinx-...@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.
Re: [sphinx-dev] How is the Sphinx home page created?
On 10/21/10, SHIBUKAWA Yoshiki wrote: > Hi, > >> I've wondered for a while how the Sphinx home page at >> http://sphinx.pocoo.org/index.html is created. Unlike all the other >> pages on the site there isn't a Show Source link. It also doesn't seem >> to be in http://bitbucket.org/birkenfeld/sphinx/src/tip/doc/. > > This page is not created from reST file. > See _template directory and you can see the file. > > http://bitbucket.org/birkenfeld/sphinx/src/tip/doc/ > > Sphinx supports static html and Jinja2 template > (you add suffix "_t" like "style.css_t") too. > > I was asked same question from my friend :-) > > -- > #! /usr/bin/python2 > def shibu(shibukawa, yoshiki): > web = "http://www.shibu.jp"; > mail = "yosh...@shibu.jp" > twitter = "@shibukawa" > return "smile!" > > -- > You received this message because you are subscribed to the Google Groups > "sphinx-dev" group. > To post to this group, send email to sphinx-...@googlegroups.com. > To unsubscribe from this group, send email to > sphinx-dev+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sphinx-dev?hl=en. > > Aha, thanks! You also need to add the following to your conf.py file: master_doc = 'contents' html_index = 'index.html' # Custom sidebar templates, maps document names to template names. html_sidebars = { 'index' : ['indexsidebar.html', 'searchbox.html'], (Other custom sidebars here) } # Additional templates that should be rendered to pages, maps page names to # template names. html_additional_pages = {'index': 'index.html'} (and then change the name of your default main .rst page from index.rst to contents.rst) The html_index conf.py option doesn't seem to be documented at http://sphinx.pocoo.org/config.html#options-for-html-output and perhaps it should be? Also copy (and then edit) http://bitbucket.org/birkenfeld/sphinx/src/tip/doc/_templates/index.html & indexsidebar.html to either the _templates directory or to your custom theme directory. Doing "make html" will now automatically create your new index.html Home page. -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to sphinx-...@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.
Re: [sphinx-dev] How is the Sphinx home page created?
On 10/21/10, TP wrote: > On 10/21/10, SHIBUKAWA Yoshiki wrote: >> Hi, >> >>> I've wondered for a while how the Sphinx home page at >>> http://sphinx.pocoo.org/index.html is created. Unlike all the other >>> pages on the site there isn't a Show Source link. It also doesn't seem >>> to be in http://bitbucket.org/birkenfeld/sphinx/src/tip/doc/. >> >> This page is not created from reST file. >> See _template directory and you can see the file. >> >> http://bitbucket.org/birkenfeld/sphinx/src/tip/doc/ >> >> Sphinx supports static html and Jinja2 template >> (you add suffix "_t" like "style.css_t") too. >> >> I was asked same question from my friend :-) >> >> -- >> #! /usr/bin/python2 >> def shibu(shibukawa, yoshiki): >> web = "http://www.shibu.jp"; >> mail = "yosh...@shibu.jp" >> twitter = "@shibukawa" >> return "smile!" >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sphinx-dev" group. >> To post to this group, send email to sphinx-...@googlegroups.com. >> To unsubscribe from this group, send email to >> sphinx-dev+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/sphinx-dev?hl=en. >> >> > > Aha, thanks! You also need to add the following to your conf.py file: > > master_doc = 'contents' > > html_index = 'index.html' > > # Custom sidebar templates, maps document names to template names. > html_sidebars = { > 'index' : >['indexsidebar.html', > 'searchbox.html'], > (Other custom sidebars here) > } > > # Additional templates that should be rendered to pages, maps page names > to > # template names. > html_additional_pages = {'index': 'index.html'} > > (and then change the name of your default main .rst page from > index.rst to contents.rst) > > The html_index conf.py option doesn't seem to be documented at > http://sphinx.pocoo.org/config.html#options-for-html-output and > perhaps it should be? > > Also copy (and then edit) > http://bitbucket.org/birkenfeld/sphinx/src/tip/doc/_templates/index.html > & indexsidebar.html to either the _templates directory or to your > custom theme directory. > > Doing "make html" will now automatically create your new index.html Home > page. > It turns out you don't need to add html_index to conf.py. It must be something that Sphinx needs specifically for itself? -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to sphinx-...@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.
Re: [sphinx-dev] How is the Sphinx home page created?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 22.10.2010 03:13, schrieb TP: >> Aha, thanks! You also need to add the following to your conf.py file: >> >> master_doc = 'contents' >> >> html_index = 'index.html' >> >> # Custom sidebar templates, maps document names to template names. >> html_sidebars = { >> 'index' : >>['indexsidebar.html', >> 'searchbox.html'], >> (Other custom sidebars here) >> } >> >> # Additional templates that should be rendered to pages, maps page names >> to >> # template names. >> html_additional_pages = {'index': 'index.html'} >> >> (and then change the name of your default main .rst page from >> index.rst to contents.rst) >> >> The html_index conf.py option doesn't seem to be documented at >> http://sphinx.pocoo.org/config.html#options-for-html-output and >> perhaps it should be? >> >> Also copy (and then edit) >> http://bitbucket.org/birkenfeld/sphinx/src/tip/doc/_templates/index.html >> & indexsidebar.html to either the _templates directory or to your >> custom theme directory. >> >> Doing "make html" will now automatically create your new index.html Home >> page. >> > > It turns out you don't need to add html_index to conf.py. It must be > something that Sphinx needs specifically for itself? If it isn't docmented, it doesn't do anything. :) The html_index was a config value in old Sphinx versions and has been removed subsequently. I just forgot to remove it from the conf.py as well. cheers, Georg -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.16 (GNU/Linux) iEYEARECAAYFAkzBHRMACgkQN9GcIYhpnLD/BgCbBK7RLwHFr0ixq4O61orufkLT QyYAoJwyliqbar3qbvrKRIgWkXRDKueX =ckQd -END PGP SIGNATURE- -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to sphinx-...@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.