Skip to content

Commit

Permalink
Merge pull request #125 from AllenCellModeling/fix/docs-replace-m2r2
Browse files Browse the repository at this point in the history
use myst_parser instead of m2r2
  • Loading branch information
toloudis authored Jan 2, 2025
2 parents 223d4be + 632605a commit d4bb4aa
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 7 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build-docs-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Docs

on: [pull_request]

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Dependencies
run: |
pip install --upgrade pip setuptools
pip install .[dev]
- name: Generate Docs
env:
BUILD_DOCS: true
run: |
mkdir cmake_build_debug
cd cmake_build_debug
cmake ..
cmake --build . --target docs
shell: bash
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,4 @@ dummy_test.py
*.ipynb
.DS_Store
cmake-build-debug/
cmake_build_debug/
10 changes: 6 additions & 4 deletions docs/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
#
from datetime import datetime
import os
import sys

Expand All @@ -40,12 +41,13 @@ extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinx.ext.mathjax",
"m2r2",
"myst_parser",
]

# Control napoleon
napoleon_google_docstring = False
napolean_include_init_with_doc = True
napoleon_numpy_docstring = True
napoleon_include_init_with_doc = True
napoleon_use_ivar = True
napoleon_use_param = False

Expand All @@ -60,7 +62,7 @@ templates_path = ["_templates"]
#
source_suffix = {
".rst": "restructuredtext",
".txt": "markdown",
# ".txt": "markdown",
".md": "markdown",
}

Expand All @@ -69,7 +71,7 @@ master_doc = "index"

# General information about the project.
project = u"aicspylibczi"
copyright = u'2019, Allen Institute for Cell Science'
project_copyright = f'2019-{datetime.now().year}, Allen Institute for Cell Science'
author = u"Allen Institute for Cell Science"

# The version info for the project you"re documenting, acts as replacement
Expand Down
3 changes: 2 additions & 1 deletion docs/contributing.rst
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.. mdinclude:: ../CONTRIBUTING.md
.. include:: ../CONTRIBUTING.md
:parser: myst_parser.docutils_
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ Welcome to aicspylibczi's documentation!
Package modules <modules>
contributing

.. mdinclude:: ../README.md
.. include:: ../README.md
:parser: myst_parser.docutils_


Indices and tables
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"coverage>=5.0a4",
"flake8>=3.7.7",
"ipython>=7.5.0",
"m2r2>=0.2.7",
"myst-parser>=4.0.0",
"pytest>=4.3.0",
"pytest-cov==2.6.1",
"pytest-raises>=0.10",
Expand Down

0 comments on commit d4bb4aa

Please sign in to comment.