8

I'm building my sphinx doc for a django project the following way:

sphinx-apidoc app -o docs/source/app --force

Now it includes all of the South migrations which I don't want to have in my documentation. I now tried to exclude them the following way:

conf.py:
    def skip_migrations(app, what, name, obj, skip, options):
        return skip or (what == 'module' and name.find('Migration') != -1)\ 
               or str(obj).find('migrations') != -1

    def setup(app):
       app.connect('autodoc-skip-member', skip_migrations)

Now they aren't documented anymore, but are still listed under modules. How can I exclude them?

4

2 に答える 2

5

conf.py ファイルの exclude_pattern に追加することで、移行用に作成された最初のファイルを除外できます。

exclude_patterns = ["**/*.migrations.rst",]
于 2013-05-15T08:52:11.793 に答える