This directory contains the RST source files for OneCite's documentation, built with Sphinx.
Install the required documentation dependencies:
pip install -e ".[dev]"
# or
pip install sphinx sphinx-rtd-themeTo build the documentation as HTML:
# On Linux/macOS
make html
# On Windows (if make is not available)
sphinx-build -b html . _build/htmlThe built documentation will be in _build/html/. Open _build/html/index.html in your browser to view it.
PDF:
make latexpdfMan Pages:
make manTexinfo:
make texinfoEpub:
make epubTo remove all built documentation:
make cleandocs/
βββ conf.py # Sphinx configuration
βββ index.rst # Main documentation index
βββ installation.rst # Installation guide
βββ quick_start.rst # Quick start guide
βββ basic_usage.rst # Basic usage guide
βββ advanced_usage.rst # Advanced usage guide
βββ benchmarking.rst # Benchmark suite and regression checks
βββ cli_contracts.rst # Stable CLI JSON/NDJSON contracts
βββ onecite_skill.rst # Workflow skill package guide
βββ python_api.rst # Python API guide
βββ templates.rst # Custom templates guide
βββ output_formats.rst # Output formats guide
βββ faq.rst # Frequently asked questions
βββ contributing.rst # Contributing guidelines
βββ changelog.rst # Version changelog
βββ api/
β βββ core.rst # Core API reference
β βββ exceptions.rst # Exception reference
β βββ pipeline.rst # Pipeline reference
βββ Makefile # Build automation
βββ README.md # This file
- installation.rst - How to install OneCite
- quick_start.rst - Get started in 5 minutes
- basic_usage.rst - Basic usage examples
- advanced_usage.rst - Advanced features and techniques
- benchmarking.rst - Deterministic benchmarks and regression checks
- cli_contracts.rst - Stable JSON/NDJSON schemas and exit codes
- onecite_skill.rst - Using the bundled OneCite skill for automation
- python_api.rst - Using OneCite as a Python library
- templates.rst - Creating custom citation templates
- output_formats.rst - Understanding output formats
- api/core.rst - Core API documentation
- api/exceptions.rst - Exception reference
- api/pipeline.rst - Pipeline processing reference
- faq.rst - Frequently asked questions
- contributing.rst - Contribution guidelines
- changelog.rst - Version history and roadmap
Documentation is written in reStructuredText (RST) format. Here are some basics:
Main Section
============
Subsection
----------
Subsubsection
~~~~~~~~~~~~~
**Bold text** and *italic text*
.. code-block:: python
# Code block
import onecite
result = onecite.process_references(
"10.1038/nature14539", "txt", "journal_article_full",
"bibtex"
)
- Bullet list
- Another item
- Nested item
1. Numbered list
2. Second item
:doc:`Link to file`
`External link <https://example.com>`_- Create a new
.rstfile in the appropriate directory - Add it to the
.. toctree::directive inindex.rstor a parent document - Build the docs to verify
Use .. code-block:: for syntax-highlighted code:
.. code-block:: python
from onecite import process_references
result = process_references(
"10.1038/nature14539",
input_type="txt",
template_name="journal_article_full",
output_format="bibtex"
)
print('\n\n'.join(result['results']))The Sphinx configuration is in conf.py. Key settings:
- Extensions - Enabled Sphinx extensions for autodoc, intersphinx, etc.
- Theme - Using the ReadTheDocs theme (sphinx-rtd-theme)
- HTML Output - Settings for the HTML theme
- Autodoc - Automatic API documentation generation
Documentation builds automatically on:
- GitHub Commits
- Pull Requests
- Releases
The documentation is hosted at:
- Main-branch documentation: https://hezhiang.com/OneCite/
The current workflow deploys this site from the main branch. It is not a
separate, version-pinned βlatest releaseβ site; release documentation must not
be inferred from this URL unless a release-specific deployment is added.
- Fork the repository
- Create a branch for your changes
- Edit
.rstfiles - Build locally to verify:
make html - Submit a pull request
See contributing.rst for more details.
To create links within documentation:
:doc:`quick_start` # Link to another document
:ref:`genindex` # Link to generated index
:meth:`~onecite.process_references` # Link to methods
:class:`~onecite.RawEntry` # Link to classesTables:
========== ============
Header 1 Header 2
========== ============
Cell 1 Cell 2
Cell 3 Cell 4
========== ============Lists:
- Item 1
- Item 2
- Subitem 2.1
- Subitem 2.2
- Item 3- Run
make htmlfrequently while editing - Use
sphinx-build -Wto treat warnings as errors - Use
make linkcheckto verify all links - Keep lines under 80 characters for easier reviewing
"make: command not found" on Windows:
# Install make for Windows or use sphinx-build directly
sphinx-build -b html . _build/htmlModule not found errors:
# Ensure you're in the docs directory
cd docs
# Rebuild the documentation
make clean
make htmlTheme not found:
# Install the theme
pip install sphinx-rtd-themeFor documentation issues:
- Check the GitHub Issues
- Search GitHub Discussions
- See :doc:
faqfor common questions
The OneCite documentation is licensed under the MIT License. See LICENSE for details.