示例#1
0
                pybtex.style.template.
                optional[self.format_editor(e, as_sentence=False)],
                self.format_btitle(e, "booktitle", as_sentence=False),
                self.format_volume_and_series(e, as_sentence=False),
                self.format_chapter_and_pages(e), ], ],
            pybtex.style.template.sentence(
                sep=" ")[pybtex.style.template.sentence(add_period=False)[
                    pybtex.style.template.optional_field("publisher"),
                    pybtex.style.template.optional_field("address"),
                    self.format_edition(e), ],
                         pybtex.style.formatting.unsrt.date, ],
            self.format_web_refs(e), ]
        return template


pybtex_register_plugin("pybtex.style.formatting", "apsstyle", ApsStyle)

# -- Monkeypatch for instance attribs (sphinx bug #2044) -----------------------


def iad_add_directive_header(self, sig):
    ClassLevelDocumenter.add_directive_header(self, sig)


InstanceAttributeDocumenter.add_directive_header = iad_add_directive_header

# -- Options for HTML output ---------------------------------------------------

# on_rtd is whether we are on readthedocs.org, this line of code grabbed from
# docs.readthedocs.org
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
示例#2
0
                pybtex.style.template.
                optional[self.format_editor(e, as_sentence=False)],
                self.format_btitle(e, 'booktitle', as_sentence=False),
                self.format_volume_and_series(e, as_sentence=False),
                self.format_chapter_and_pages(e), ], ],
            pybtex.style.template.sentence(
                sep=" ")[pybtex.style.template.sentence(add_period=False)[
                    pybtex.style.template.optional_field('publisher'),
                    pybtex.style.template.optional_field('address'),
                    self.format_edition(e), ],
                         pybtex.style.formatting.unsrt.date, ],
            self.format_web_refs(e), ]
        return template


pybtex_register_plugin('pybtex.style.formatting', 'apsstyle', ApsStyle)

# -- Monkeypatch for instance attribs (sphinx bug #2044) -----------------------

from sphinx.ext.autodoc import (
    ClassLevelDocumenter,
    InstanceAttributeDocumenter,
)


def iad_add_directive_header(self, sig):
    ClassLevelDocumenter.add_directive_header(self, sig)


InstanceAttributeDocumenter.add_directive_header = iad_add_directive_header