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
├── 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
- 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", lambda c: 0
)
- 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",
interactive_callback=lambda c: 0
)
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:
- Development: https://hzacode.github.io/OneCite/ (built from main branch)
- Latest: https://hzacode.github.io/OneCite/ (built from latest release)
- 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.