Skip to main content

A simple Sphinx extension that allows you to have APA formatting of references in your book.

Project description

Sphinx APA References

Introduction

This Sphinx extension allows you to have APA formatting of references in your book.

[!NOTE] This extension only modifies the formatting of references to comply with APA style. It does not handle citation management or reference generation; you will need to manage your references separately.

What does it do?

This extension modifies the way references are formatted in Sphinx-generated documentation to comply with APA (American Psychological Association) style guidelines for references. It ensures that citations and bibliographies are presented in a manner consistent with APA standards.

This entails forcing the following APA-specific formatting rules:

  • Proper indentation and spacing for reference entries.
  • Use of round brackets for in-text citations.

Installation

To use this extension, follow these steps:

Step 1: Install the Package

Install the module sphinx-apa-references package using pip:

pip install sphinx-apa-references

Step 2: Add to requirements.txt

Make sure that the package is included in your project's requirements.txt to track the dependency:

sphinx-apa-references

Step 3: Enable in _config.yml or conf.py

In your _config.yml file, add the extension to the list of Sphinx extra extensions (important: underscore, not dash this time) and specify the location of your bib file (note indentation of the bibtex file path specification; any number of bib files are allowed):

sphinx: 
    extra_extensions:
        .
        .
        .
        - sphinx_apa_references
        .
        .
        .
bibtex_bibfiles:
    - "<path_to_bib_file>/<bibfile>.bib"

or in your conf.py file, add the extension to the extensions list and specify the location of your bib file:

extensions = [...,"sphinx_apa_references",...]
bibtex_bibfiles = ["<path_to_bib_file>/<bibfile>.bib"]

Configuration

No additional configuration is possible. The extension automatically applies APA formatting to all references in your Sphinx documentation.

This extensions enforces the following settings, overriding any user-defined settings in _config.yml/conf.py:

  • bibtex_reference_style = "author_year_round"

Furthermore, the bibliography directive is adapted to always use the value apa for the style option if the user does not provide a value for the style option.

Examples and details

To see examples of usage visit this page in the TeachBooks manual.

Previous APA implementation

Prior to the creation of this Sphinx extension, APA referencing was implemented by including a local extension in a book subdirectory, as described in Issue 1090 from the Jupyter Book repository.

To upgrade from the previous setup, once this Sphinx extension is implemented in your book, the local extension files in _ext can be deleted and the four lines indicated below removed from your _config.yml file:

sphinx:
  config:
    .
    .
    .
    bibtex_reference_style: author_year_round   # remove
    bibtex_default_style: myapastyle            # remove
    .
    .
    .
  local_extensions:
    apastyle: _ext/                             # remove
    bracket_citation_style: _ext/               # remove

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinx_apa_references-1.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinx_apa_references-1.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_apa_references-1.0.tar.gz.

File metadata

  • Download URL: sphinx_apa_references-1.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sphinx_apa_references-1.0.tar.gz
Algorithm Hash digest
SHA256 f98af1ac934cf5c505c1087c500d5a66fa4062dae3b79e4583a73841d3da4a61
MD5 bd9d84320196181c73d95f75ee0f8b6a
BLAKE2b-256 882407783747ace65e9c4218ec750a6075b6b0d3f7969f933d1419eba3e7d66a

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_apa_references-1.0.tar.gz:

Publisher: python-publish.yml on TeachBooks/Sphinx-APA-References

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sphinx_apa_references-1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_apa_references-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 707a4064d9974a0ee9c7f85fa1cf4aa666e8d192396842bc6d019e150e847e90
MD5 ad4db3ff5a1e38fbab321b4cfc827145
BLAKE2b-256 0ee88b1dc7eeba8b09b7ed0080424269594bbae366bfa7b93f09e21eafc75b60

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_apa_references-1.0-py3-none-any.whl:

Publisher: python-publish.yml on TeachBooks/Sphinx-APA-References

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page