Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,13 @@ test:
wheel_file=${wheels[0]}
python -m pip install --group dev ${wheel_file}
make test

docs:
stage: test
script:
- python -m pip install --group docs .
- make docs
artifacts:
paths:
- docs/site/*
expire_in: 1 week
15 changes: 15 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
build:
os: ubuntu-24.04
tools:
python: '3.14'
jobs:
install:
- pip install --upgrade pip
- pip install --group 'docs'
build:
html:
- make docs
post_build:
- mkdir -p $READTHEDOCS_OUTPUT/html/
- cp --recursive docs/site/* $READTHEDOCS_OUTPUT/html/
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Commands used by CI

.PHONY: format lint build test
.PHONY: format lint build test docs

format:
ruff check --fix
Expand All @@ -17,3 +17,7 @@ build:
test:
pytest
python -m doctest README.md

docs:
python docs/make.py
zensical build -f docs/zensical.toml --clean
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[![Tests](https://github.com/ValkyrieSystems/jbpy/actions/workflows/test.yml/badge.svg)](https://github.com/ValkyrieSystems/jbpy/actions/workflows/test.yml)

**jbpy** is a library for reading and writing Joint BIIF Profile files. Including:

* National Imagery Transmission Format (NITF)
* North Atlantic Treaty Organisation (NATO) Secondary Imagery Format (NSIF)

Expand Down
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
src/api/
site/
26 changes: 26 additions & 0 deletions docs/make.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import pathlib
import shutil

import pdoc
import pdoc.render

here = pathlib.Path(__file__).parent
out = here / "src" / "api"
if out.exists():
shutil.rmtree(out)

# Render parts of pdoc's documentation into src/api...
pdoc.render.configure(
docformat="numpy",
template_directory=here / "pdoc-template",
)
modules = [
"jbpy",
"jbpy.core",
"jbpy.image_data",
]
pdoc.pdoc(*modules, output_directory=out)

# ...and rename the .html files to .md so that zensical picks them up!
for f in out.glob("**/*.html"):
f.rename(f.with_suffix(".md"))
20 changes: 20 additions & 0 deletions docs/pdoc-template/frame.html.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: {{ module.modulename if module else "API Reference" }}
---

<div>
{% block content %}{% endblock %}

{% filter minify_css %}
{% block style %}
{#
The important part is that we leave out layout.css here.
Ideally we would still include Bootstrap Reboot, but that breaks mkdocs' theme.
<style>{% include "resources/bootstrap-reboot.min.css" %}</style>
#}
<style>{% include "syntax-highlighting.css" %}</style>
<style>{% include "theme.css" %}</style>
<style>{% include "content.css" %}</style>
{% endblock %}
{% endfilter %}
</div>
1 change: 1 addition & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--8<-- "README.md"
64 changes: 64 additions & 0 deletions docs/zensical.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[project]
site_name = "jbpy Documentation"
site_description = "Documentation for jbpy: a library for reading and writing Joint BIIF Profile files."
site_author = "Valkyrie Systems Corporation"
#site_url = "https://www.example.com/" TODO: set once hosted
repo_name = "ValkyrieSystems/jbpy"
repo_url = "https://github.com/ValkyrieSystems/jbpy"
docs_dir = "src"
use_directory_urls = false

copyright = """
Copyright &copy; 2026, Valkyrie Systems Corporation
"""

nav = [
{ "Get started" = "index.md"},
{"API Reference" = [
{"jbpy" = "api/jbpy.md"},
{"jbpy.core" = "api/jbpy/core.md"},
{"jbpy.image_data" = "api/jbpy/image_data.md"},
]}
]


# ----------------------------------------------------------------------------
# Section for configuring theme options
# ----------------------------------------------------------------------------
[project.theme]
language = "en"
logo = "https://raw.githubusercontent.com/ValkyrieSystems/sarkit/main/docs/source/_static/sarkit_logo.png"

# Zensical provides a number of feature toggles that change the behavior
# of the documentation site.
features = [
"announce.dismiss",
"content.code.annotate",
"content.code.copy",
"content.code.select",
"content.footnote.tooltips",
"content.tabs.link",
"content.tooltips",
"navigation.footer",
"navigation.indexes",
"navigation.instant",
"navigation.instant.prefetch",
"navigation.path",
"navigation.sections",
"navigation.top",
"navigation.tracking",
"search.highlight",
]

[project.theme.icon]
repo = "fontawesome/brands/github"

[project.markdown_extensions.pymdownx.highlight]
anchor_linenums = true
line_spans = "__span"
pygments_lang_class = true
[project.markdown_extensions.pymdownx.inlinehilite]
[project.markdown_extensions.pymdownx.snippets]
[project.markdown_extensions.pymdownx.superfences]
[project.markdown_extensions.admonition]
[project.markdown_extensions.pymdownx.details]
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ examples = [
"pillow",
]

docs = [
"pdoc>=16.0.0",
"zensical>=0.0.18",
]

[project.urls]
Repository = "https://github.com/ValkyrieSystems/jbpy"
"Bug Tracker" = "https://github.com/ValkyrieSystems/jbpy/issues"
Expand Down