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

Using websupport, how do I get the generated index? #1003

Closed
shimizukawa opened this issue Jan 3, 2015 · 2 comments
Closed

Using websupport, how do I get the generated index? #1003

shimizukawa opened this issue Jan 3, 2015 · 2 comments
Assignees
Labels
Milestone

Comments

@shimizukawa
Copy link
Member

When building my project with "make html", genindex.html is generated as expected.

How do I get WebSupport to return the index? websupport.get_document("genindex") returns a dictionary, but d["body"] == "".

websupport = WebSupport(datadir="...", search="woosh")
document = websupport.get_document("genindex")

# document["body"] == ""

@shimizukawa shimizukawa added this to the 1.4 milestone Jan 3, 2015
@shimizukawa
Copy link
Member Author

shimizukawa commented Jan 3, 2015

From Dustin Mitchell on 2014-11-25 18:12:11+00:00

This is actually not "minor" -- indexes of any sort do not work with WebSupport.

To reproduce:

  • run sphinx-quickstart and accept defaults.
  • put this in index.rst:
Welcome to Test's documentation!
================================

Contents:

.. py:module:: test.foo
.. py:class:: Bar

    .. py:method:: bar()

        foo the bar.

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

put this in bug.py:

from sphinx.websupport import WebSupport

ws = WebSupport(
    srcdir='.',
    builddir='./bld')

ws.build()
print `ws.get_document('py-modindex')['body']`

Run bug.py:

Running Sphinx v1.2.3
loading pickled environment... done
building [websupport]: targets for 1 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
preparing documents... done
writing output... [100%] index                                                                                                      
writing additional files... genindex py-modindex search
copying static files... done
copying extra files... done
dumping object inventory... done
build succeeded.
''

that last '' indicates that the body of the document is empty.

I believe the culprit is somewhere in WebSupportBuilder._render_page, which assumes it's rendering page.html.

@shimizukawa
Copy link
Member Author

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants