docput 0.2.1__tar.gz → 1.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {docput-0.2.1 → docput-1.0.1}/.forgejo/workflows/push.yml +27 -29
- {docput-0.2.1 → docput-1.0.1}/CHANGELOG.md +14 -0
- {docput-0.2.1 → docput-1.0.1}/Justfile +8 -6
- {docput-0.2.1 → docput-1.0.1}/PKG-INFO +17 -2
- {docput-0.2.1 → docput-1.0.1}/README.md +9 -0
- {docput-0.2.1 → docput-1.0.1}/docs/Justfile +0 -3
- docput-1.0.1/docs/_root/_headers +0 -0
- {docput-0.2.1 → docput-1.0.1}/docs/_templates/page.html +1 -0
- {docput-0.2.1 → docput-1.0.1}/docs/commands/index.md +1 -1
- {docput-0.2.1 → docput-1.0.1}/docs/index.md +2 -1
- docput-1.0.1/docs/installation.md +83 -0
- docput-0.2.1/docs/getting_started.md → docput-1.0.1/docs/user_guide.md +2 -81
- {docput-0.2.1 → docput-1.0.1}/pyproject.toml +18 -15
- {docput-0.2.1 → docput-1.0.1/src}/docput/cli/main.py +10 -10
- {docput-0.2.1 → docput-1.0.1/src}/docput/cli/manifest.py +11 -8
- {docput-0.2.1 → docput-1.0.1/src}/docput/cli/version.py +13 -17
- {docput-0.2.1 → docput-1.0.1/src}/docput/manifest.py +10 -22
- docput-1.0.1/src/docput/remote/base.py +220 -0
- docput-1.0.1/src/docput/remote/filesystem.py +71 -0
- {docput-0.2.1 → docput-1.0.1/src}/docput/remote/git_pages.py +41 -60
- {docput-0.2.1 → docput-1.0.1/src}/docput/scripts/docput.js +1 -1
- {docput-0.2.1 → docput-1.0.1/src}/docput.egg-info/PKG-INFO +17 -2
- docput-1.0.1/src/docput.egg-info/SOURCES.txt +50 -0
- {docput-0.2.1 → docput-1.0.1/src}/docput.egg-info/scm_file_list.json +23 -23
- docput-1.0.1/src/docput.egg-info/scm_version.json +8 -0
- {docput-0.2.1 → docput-1.0.1}/tests/test_remotes.py +72 -15
- docput-0.2.1/docput/protocols.py +0 -13
- docput-0.2.1/docput/remote/base.py +0 -137
- docput-0.2.1/docput/remote/filesystem.py +0 -66
- docput-0.2.1/docput.egg-info/SOURCES.txt +0 -50
- docput-0.2.1/docput.egg-info/scm_version.json +0 -8
- docput-0.2.1/docs/_root/_headers +0 -4
- {docput-0.2.1 → docput-1.0.1}/.gitignore +0 -0
- {docput-0.2.1 → docput-1.0.1}/LICENSE.md +0 -0
- {docput-0.2.1 → docput-1.0.1}/docs/.gitignore +0 -0
- {docput-0.2.1 → docput-1.0.1}/docs/_include/forgejo-hover.svg +0 -0
- {docput-0.2.1 → docput-1.0.1}/docs/_include/forgejo-monochrome.svg +0 -0
- {docput-0.2.1 → docput-1.0.1}/docs/_include/pypi-hover.svg +0 -0
- {docput-0.2.1 → docput-1.0.1}/docs/_include/pypi-monochrome.svg +0 -0
- {docput-0.2.1 → docput-1.0.1}/docs/_root/_redirects +0 -0
- {docput-0.2.1 → docput-1.0.1}/docs/_static/css/custom.css +0 -0
- {docput-0.2.1 → docput-1.0.1}/docs/commands/manifest.md +0 -0
- {docput-0.2.1 → docput-1.0.1}/docs/commands/version.md +0 -0
- {docput-0.2.1 → docput-1.0.1}/docs/conf.py +0 -0
- {docput-0.2.1 → docput-1.0.1}/docs/version-manifest.json +0 -0
- {docput-0.2.1 → docput-1.0.1}/docs/version-marker.json +0 -0
- {docput-0.2.1 → docput-1.0.1}/setup.cfg +0 -0
- {docput-0.2.1 → docput-1.0.1/src}/docput/__init__.py +0 -0
- {docput-0.2.1 → docput-1.0.1/src}/docput/__main__.py +0 -0
- {docput-0.2.1 → docput-1.0.1/src}/docput/cli/__init__.py +0 -0
- {docput-0.2.1 → docput-1.0.1/src}/docput/config.py +0 -0
- {docput-0.2.1 → docput-1.0.1/src}/docput/remote/__init__.py +0 -0
- {docput-0.2.1 → docput-1.0.1/src}/docput/sphinx_ext/__init__.py +0 -0
- {docput-0.2.1 → docput-1.0.1/src}/docput/sphinx_ext/_templates/sidebar/version-switch.html +0 -0
- {docput-0.2.1 → docput-1.0.1/src}/docput.egg-info/dependency_links.txt +0 -0
- {docput-0.2.1 → docput-1.0.1/src}/docput.egg-info/entry_points.txt +0 -0
- {docput-0.2.1 → docput-1.0.1/src}/docput.egg-info/requires.txt +0 -0
- {docput-0.2.1 → docput-1.0.1/src}/docput.egg-info/top_level.txt +0 -0
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
name: build
|
|
2
2
|
on: [ push, pull_request ]
|
|
3
|
+
concurrency:
|
|
4
|
+
group: drewcassidy.me/docput ${{ forge.event_name }}
|
|
5
|
+
cancel-in-progress: false
|
|
3
6
|
|
|
4
7
|
jobs:
|
|
5
|
-
|
|
6
|
-
name: Test
|
|
7
|
-
runs-on: ubuntu-
|
|
8
|
+
test:
|
|
9
|
+
name: Test on Python ${{ matrix.python-version }}
|
|
10
|
+
runs-on: ubuntu-26.04
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
python-version: [ "3.14", "3.15" ]
|
|
8
14
|
services:
|
|
9
15
|
gitpages:
|
|
10
16
|
image: codeberg.org/git-pages/git-pages:0.9.1
|
|
@@ -19,11 +25,13 @@ jobs:
|
|
|
19
25
|
with:
|
|
20
26
|
fetch-depth: 0
|
|
21
27
|
|
|
22
|
-
- name: Set up
|
|
23
|
-
uses: https://
|
|
28
|
+
- name: Set up Python
|
|
29
|
+
uses: https://code.forgejo.org/actions/setup-python@v6
|
|
24
30
|
with:
|
|
25
|
-
python-version
|
|
26
|
-
|
|
31
|
+
python-version: ${{ matrix.python-version }}
|
|
32
|
+
|
|
33
|
+
- name: Set up Project
|
|
34
|
+
run: pip install --editable . --group dev
|
|
27
35
|
|
|
28
36
|
- name: Lint
|
|
29
37
|
run: just -v lint
|
|
@@ -31,20 +39,11 @@ jobs:
|
|
|
31
39
|
- name: Test
|
|
32
40
|
run: just -v test
|
|
33
41
|
|
|
34
|
-
- name: Build
|
|
35
|
-
run: just -v build
|
|
36
|
-
|
|
37
|
-
- name: Upload dist
|
|
38
|
-
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
|
39
|
-
with:
|
|
40
|
-
name: python-dist
|
|
41
|
-
path: dist/
|
|
42
|
-
compression-level: 0 # already compressed
|
|
43
|
-
|
|
44
|
-
|
|
45
42
|
document:
|
|
46
43
|
name: Document
|
|
47
|
-
|
|
44
|
+
needs:
|
|
45
|
+
- test
|
|
46
|
+
runs-on: ubuntu-26.04
|
|
48
47
|
container:
|
|
49
48
|
env:
|
|
50
49
|
DOCPUT_REMOTE: git-pages+https://drewcassidy.me/docput
|
|
@@ -53,11 +52,13 @@ jobs:
|
|
|
53
52
|
- name: Checkout
|
|
54
53
|
uses: https://code.forgejo.org/actions/checkout@v5
|
|
55
54
|
|
|
56
|
-
- name: Set up
|
|
57
|
-
uses: https://
|
|
55
|
+
- name: Set up Python
|
|
56
|
+
uses: https://code.forgejo.org/actions/setup-python@v6
|
|
58
57
|
with:
|
|
59
58
|
python-version-file: pyproject.toml
|
|
60
|
-
|
|
59
|
+
|
|
60
|
+
- name: Set up Project
|
|
61
|
+
run: pip install --editable . --group docs
|
|
61
62
|
|
|
62
63
|
- name: Build docs
|
|
63
64
|
run: just -v docs build -D version=${{ forge.ref_name }}
|
|
@@ -75,18 +76,15 @@ jobs:
|
|
|
75
76
|
name: Publish
|
|
76
77
|
if: forge.event_name == 'push' && startsWith(forge.ref, 'refs/tags')
|
|
77
78
|
needs:
|
|
78
|
-
-
|
|
79
|
+
- test
|
|
79
80
|
- document
|
|
80
|
-
runs-on: ubuntu-
|
|
81
|
+
runs-on: ubuntu-26.04
|
|
81
82
|
steps:
|
|
82
83
|
- name: Checkout
|
|
83
84
|
uses: https://code.forgejo.org/actions/checkout@v5
|
|
84
85
|
|
|
85
|
-
- name:
|
|
86
|
-
|
|
87
|
-
with:
|
|
88
|
-
name: python-dist
|
|
89
|
-
path: dist
|
|
86
|
+
- name: Build dist
|
|
87
|
+
run: just -v build
|
|
90
88
|
|
|
91
89
|
- name: Get Changelog Information
|
|
92
90
|
id: yaclog-show
|
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file
|
|
4
4
|
|
|
5
|
+
## 1.0.1 - 2026-10-19
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Fixed error with trailing slashes in paths when using the git-pages backend on Python 3.15 (#4)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## 1.0.0 - 2026-08-23
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- Reversed display order of versions in dropdown menu, so most recent versions are at the top
|
|
17
|
+
|
|
18
|
+
|
|
5
19
|
## 0.2.1 - 2026-07-30
|
|
6
20
|
|
|
7
21
|
### Fixed
|
|
@@ -2,16 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
mod docs
|
|
4
4
|
|
|
5
|
+
source_dirs := "src/ tests/"
|
|
6
|
+
|
|
5
7
|
# Lint python source code
|
|
6
8
|
lint:
|
|
7
|
-
pyflakes
|
|
8
|
-
black --quiet --check
|
|
9
|
-
zuban check
|
|
9
|
+
pyflakes {{ source_dirs }}
|
|
10
|
+
black --quiet --check {{ source_dirs }}
|
|
11
|
+
zuban check {{ source_dirs }}
|
|
10
12
|
|
|
11
13
|
# Format python source code and other support files
|
|
12
14
|
format: && docs::format
|
|
13
|
-
black --quiet
|
|
14
|
-
mdformat README.md
|
|
15
|
+
black --quiet {{ source_dirs }}
|
|
16
|
+
mdformat README.md
|
|
15
17
|
{{ just_executable() }} --fmt --unstable
|
|
16
18
|
|
|
17
19
|
# Run tests
|
|
@@ -20,7 +22,7 @@ test *args:
|
|
|
20
22
|
|
|
21
23
|
# Build distribution
|
|
22
24
|
build:
|
|
23
|
-
|
|
25
|
+
pipx run build
|
|
24
26
|
|
|
25
27
|
pre-commit := f"""
|
|
26
28
|
#!/bin/sh
|
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: docput
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: Deploy multi-versioned docs to static hosting
|
|
5
5
|
Author-email: Andrew Cassidy <drewcassidy@me.com>
|
|
6
6
|
License-Expression: MIT
|
|
7
7
|
Project-URL: Source, https://git.offworld.city/drewcassidy/docput
|
|
8
|
+
Project-URL: Documentation, https://drewcassidy.me/docput/latest/
|
|
8
9
|
Keywords: sphinx,git-pages,documentation,ci
|
|
9
|
-
Classifier: Development Status ::
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
10
11
|
Classifier: Intended Audience :: Developers
|
|
11
12
|
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Environment :: Console
|
|
12
14
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
15
|
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: JavaScript
|
|
14
17
|
Classifier: Topic :: Utilities
|
|
15
18
|
Classifier: Topic :: Documentation
|
|
16
19
|
Classifier: Topic :: Documentation :: Sphinx
|
|
20
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Site Management
|
|
21
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
17
22
|
Classifier: Framework :: Sphinx
|
|
23
|
+
Classifier: Framework :: Sphinx :: Extension
|
|
18
24
|
Requires-Python: >=3.14
|
|
19
25
|
Description-Content-Type: text/markdown
|
|
20
26
|
License-File: LICENSE.md
|
|
@@ -59,3 +65,12 @@ $ pip install docput
|
|
|
59
65
|
[documentation]: https://drewcassidy.me/docput/latest/
|
|
60
66
|
[pypi]: https://pypi.org/project/docput
|
|
61
67
|
[source]: https://git.offworld.city/drewcassidy/docput
|
|
68
|
+
|
|
69
|
+
## Licensing
|
|
70
|
+
|
|
71
|
+
Docput is distributed under [the MIT license](LICENSE.md)
|
|
72
|
+
|
|
73
|
+
Note that we *do not* waive the attribution requirements of our
|
|
74
|
+
licenses, including for ingestion into machine learning models. If you
|
|
75
|
+
train on and produce code derived from our work, you must uphold all
|
|
76
|
+
attribution requirements in produced works.
|
|
@@ -34,3 +34,12 @@ $ pip install docput
|
|
|
34
34
|
[documentation]: https://drewcassidy.me/docput/latest/
|
|
35
35
|
[pypi]: https://pypi.org/project/docput
|
|
36
36
|
[source]: https://git.offworld.city/drewcassidy/docput
|
|
37
|
+
|
|
38
|
+
## Licensing
|
|
39
|
+
|
|
40
|
+
Docput is distributed under [the MIT license](LICENSE.md)
|
|
41
|
+
|
|
42
|
+
Note that we *do not* waive the attribution requirements of our
|
|
43
|
+
licenses, including for ingestion into machine learning models. If you
|
|
44
|
+
train on and produce code derived from our work, you must uphold all
|
|
45
|
+
attribution requirements in produced works.
|
|
@@ -11,16 +11,13 @@ format:
|
|
|
11
11
|
sphinx_module := "sphinx"
|
|
12
12
|
|
|
13
13
|
# Build documentation.
|
|
14
|
-
[arg("args", help="Arguments passed to sphinx")]
|
|
15
14
|
build *args:
|
|
16
15
|
python -m {{ sphinx_module }} . _build {{ args }}
|
|
17
16
|
|
|
18
17
|
# Push documentation version
|
|
19
|
-
[arg("args", help="Arguments passed to docput")]
|
|
20
18
|
push *args:
|
|
21
19
|
docput version push {{ args }} _build
|
|
22
20
|
|
|
23
21
|
# Update root files for the documentation site
|
|
24
|
-
[arg("args", help="Arguments passed to docput")]
|
|
25
22
|
update-root *args:
|
|
26
23
|
docput upload --merge _root . {{ args }}
|
|
File without changes
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
|
|
3
|
+
Install using pip
|
|
4
|
+
|
|
5
|
+
```{code-block} console
|
|
6
|
+
$ pip install docput
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
or by adding it as a documentation dependency for your python project
|
|
10
|
+
|
|
11
|
+
```{code-block} toml
|
|
12
|
+
---
|
|
13
|
+
caption: pyproject.toml
|
|
14
|
+
---
|
|
15
|
+
[dependency-groups]
|
|
16
|
+
docs = [
|
|
17
|
+
"docput",
|
|
18
|
+
]
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
then install with
|
|
22
|
+
|
|
23
|
+
```{code-block} console
|
|
24
|
+
$ pip install --group docs
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Setup
|
|
28
|
+
|
|
29
|
+
docput can be used as a standalone CLI tool
|
|
30
|
+
with no additional setup,
|
|
31
|
+
however it includes some tools
|
|
32
|
+
to make navigating your documentation easier
|
|
33
|
+
|
|
34
|
+
### Sphinx
|
|
35
|
+
|
|
36
|
+
docput includes a sphinx extension
|
|
37
|
+
to add a version selector to your documentation.
|
|
38
|
+
The extension loads a small JavaScript file that reads the version manifest,
|
|
39
|
+
so the menu is always up to date with the currently available versions.
|
|
40
|
+
|
|
41
|
+
To use this menu,
|
|
42
|
+
first add `docput` to the list of sphinx extensions in `conf.py`
|
|
43
|
+
then add docput's templates folder to the search path.
|
|
44
|
+
|
|
45
|
+
```{code-block} python
|
|
46
|
+
---
|
|
47
|
+
caption: conf.py
|
|
48
|
+
---
|
|
49
|
+
import docput
|
|
50
|
+
|
|
51
|
+
extensions = [
|
|
52
|
+
"docput",
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Now, add the template path,
|
|
59
|
+
and include the version selector
|
|
60
|
+
in the list of sidebar elements.
|
|
61
|
+
Consult your theme's documentation
|
|
62
|
+
for [sidebar customization](inv:sphinx:std:confval#html_sidebars).
|
|
63
|
+
The below example is for [Furo]
|
|
64
|
+
|
|
65
|
+
```{code-block} python
|
|
66
|
+
---
|
|
67
|
+
emphasize-lines: 5
|
|
68
|
+
caption: conf.py
|
|
69
|
+
---
|
|
70
|
+
templates_path = [docput.sphinx_templates, "_templates"]
|
|
71
|
+
|
|
72
|
+
html_sidebars = {
|
|
73
|
+
"**": [
|
|
74
|
+
"sidebar/scroll-start.html",
|
|
75
|
+
"sidebar/brand.html",
|
|
76
|
+
"sidebar/version-switch.html", # provided by docput
|
|
77
|
+
"sidebar/search.html",
|
|
78
|
+
"sidebar/navigation.html",
|
|
79
|
+
"sidebar/scroll-end.html",
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
[furo]: https://github.com/pradyunsg/furo
|
|
@@ -1,83 +1,4 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
## Installation
|
|
4
|
-
|
|
5
|
-
Install using pip
|
|
6
|
-
|
|
7
|
-
```{code-block} console
|
|
8
|
-
$ pip install docput
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
or by adding it as a documentation dependency for your python project
|
|
12
|
-
|
|
13
|
-
```{code-block} toml
|
|
14
|
-
---
|
|
15
|
-
caption: pyproject.toml
|
|
16
|
-
---
|
|
17
|
-
[dependency-groups]
|
|
18
|
-
docs = [
|
|
19
|
-
"docput",
|
|
20
|
-
]
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
then install with
|
|
24
|
-
|
|
25
|
-
```{code-block} console
|
|
26
|
-
$ pip install --group docs
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## Setup
|
|
30
|
-
|
|
31
|
-
docput can be used as a standalone CLI tool
|
|
32
|
-
with no additional setup,
|
|
33
|
-
however it includes some tools
|
|
34
|
-
to make navigating your documentation easier
|
|
35
|
-
|
|
36
|
-
### Sphinx
|
|
37
|
-
|
|
38
|
-
docput includes a sphinx extension
|
|
39
|
-
to add a version selector to your documentation.
|
|
40
|
-
The extension loads a small JavaScript file that reads the version manifest,
|
|
41
|
-
so the menu is always up to date with the currently available versions.
|
|
42
|
-
|
|
43
|
-
To use this menu,
|
|
44
|
-
first add `docput` to the list of sphinx extensions in `conf.py`
|
|
45
|
-
then add docput's templates folder to the search path.
|
|
46
|
-
|
|
47
|
-
```{code-block} python
|
|
48
|
-
---
|
|
49
|
-
caption: conf.py
|
|
50
|
-
---
|
|
51
|
-
import docput
|
|
52
|
-
|
|
53
|
-
extensions = [
|
|
54
|
-
"docput",
|
|
55
|
-
]
|
|
56
|
-
|
|
57
|
-
templates_path = [docput.sphinx_templates, "_templates"]
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Finally, add the version selector to the list of sidebar elements.
|
|
61
|
-
Consult your theme's documentation
|
|
62
|
-
for [sidebar customization](inv:sphinx:std:confval#html_sidebars).
|
|
63
|
-
The below example is for [Furo]
|
|
64
|
-
|
|
65
|
-
```{code-block} python
|
|
66
|
-
---
|
|
67
|
-
emphasize-lines: 5
|
|
68
|
-
caption: conf.py
|
|
69
|
-
---
|
|
70
|
-
html_sidebars = {
|
|
71
|
-
"**": [
|
|
72
|
-
"sidebar/scroll-start.html",
|
|
73
|
-
"sidebar/brand.html",
|
|
74
|
-
"sidebar/version-switch.html", # provided by docput
|
|
75
|
-
"sidebar/search.html",
|
|
76
|
-
"sidebar/navigation.html",
|
|
77
|
-
"sidebar/scroll-end.html",
|
|
78
|
-
]
|
|
79
|
-
}
|
|
80
|
-
```
|
|
1
|
+
# User Guide
|
|
81
2
|
|
|
82
3
|
## Connecting to a Remote
|
|
83
4
|
|
|
@@ -186,6 +107,6 @@ with {option}`--alias <docput version push --alias>`.
|
|
|
186
107
|
is a shortcut for
|
|
187
108
|
`--alias latest`.
|
|
188
109
|
|
|
189
|
-
|
|
110
|
+
|
|
190
111
|
[git-pages]: https://git-pages.org
|
|
191
112
|
[git-pages auth]: https://codeberg.org/git-pages/git-pages#authorization
|
|
@@ -14,15 +14,20 @@ authors = [{ name = "Andrew Cassidy", email = "drewcassidy@me.com" }]
|
|
|
14
14
|
license = "MIT"
|
|
15
15
|
keywords = ["sphinx", "git-pages", "documentation", "ci"]
|
|
16
16
|
classifiers = [
|
|
17
|
-
"Development Status ::
|
|
17
|
+
"Development Status :: 5 - Production/Stable",
|
|
18
18
|
"Intended Audience :: Developers",
|
|
19
19
|
"Operating System :: OS Independent",
|
|
20
|
+
"Environment :: Console",
|
|
20
21
|
"Programming Language :: Python :: 3 :: Only",
|
|
21
22
|
"Programming Language :: Python :: 3",
|
|
23
|
+
"Programming Language :: JavaScript",
|
|
22
24
|
"Topic :: Utilities",
|
|
23
25
|
"Topic :: Documentation",
|
|
24
26
|
"Topic :: Documentation :: Sphinx",
|
|
25
|
-
"
|
|
27
|
+
"Topic :: Internet :: WWW/HTTP :: Site Management",
|
|
28
|
+
"Topic :: Software Development :: Documentation",
|
|
29
|
+
"Framework :: Sphinx",
|
|
30
|
+
"Framework :: Sphinx :: Extension",
|
|
26
31
|
]
|
|
27
32
|
|
|
28
33
|
requires-python = ">= 3.14"
|
|
@@ -35,31 +40,32 @@ dynamic = ["version"]
|
|
|
35
40
|
|
|
36
41
|
[dependency-groups]
|
|
37
42
|
docs = [
|
|
38
|
-
"Sphinx ~= 9.1
|
|
39
|
-
"furo
|
|
40
|
-
"sphinx-inline-tabs
|
|
41
|
-
"sphinx-copybutton ~= 0.5
|
|
42
|
-
"sphinx-click ~= 6.2
|
|
43
|
-
"myst-parser ~= 5.1
|
|
43
|
+
"Sphinx ~= 9.1",
|
|
44
|
+
"furo == 2025.12.19",
|
|
45
|
+
"sphinx-inline-tabs == 2025.12.21.14",
|
|
46
|
+
"sphinx-copybutton ~= 0.5",
|
|
47
|
+
"sphinx-click ~= 6.2",
|
|
48
|
+
"myst-parser ~= 5.1"
|
|
44
49
|
]
|
|
45
50
|
dev = [
|
|
46
51
|
# format
|
|
47
|
-
"black
|
|
52
|
+
"black == 26.3.1",
|
|
48
53
|
"mdformat ~= 1.0.0",
|
|
49
54
|
"mdformat-config",
|
|
50
55
|
"mdformat-black",
|
|
51
56
|
"mdformat-myst",
|
|
52
57
|
# lint
|
|
53
|
-
"pyflakes ~= 3.4
|
|
54
|
-
"zuban ~= 0.
|
|
58
|
+
"pyflakes ~= 3.4",
|
|
59
|
+
"zuban ~= 0.10.0",
|
|
55
60
|
# test
|
|
56
|
-
"pytest ~= 9.0
|
|
61
|
+
"pytest ~= 9.0",
|
|
57
62
|
# build
|
|
58
63
|
"build",
|
|
59
64
|
]
|
|
60
65
|
|
|
61
66
|
[project.urls]
|
|
62
67
|
Source = "https://git.offworld.city/drewcassidy/docput"
|
|
68
|
+
Documentation = "https://drewcassidy.me/docput/latest/"
|
|
63
69
|
|
|
64
70
|
[project.scripts]
|
|
65
71
|
docput = "docput.cli:main"
|
|
@@ -67,9 +73,6 @@ docput = "docput.cli:main"
|
|
|
67
73
|
[tool.setuptools_scm]
|
|
68
74
|
fallback_version = "0.0.0"
|
|
69
75
|
|
|
70
|
-
[tool.setuptools.packages.find]
|
|
71
|
-
include = ["docput*"]
|
|
72
|
-
|
|
73
76
|
[tool.pytest]
|
|
74
77
|
addopts = [
|
|
75
78
|
'--doctest-modules',
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import shutil
|
|
2
2
|
import sys
|
|
3
|
+
from functools import update_wrapper
|
|
3
4
|
from io import Writer
|
|
4
5
|
from pathlib import Path
|
|
5
6
|
from typing import Any, Callable, Concatenate
|
|
6
|
-
from functools import update_wrapper
|
|
7
7
|
|
|
8
8
|
import click
|
|
9
9
|
|
|
10
|
-
from ..protocols import Reader
|
|
11
10
|
from ..remote import Remote, open_remote
|
|
12
11
|
|
|
13
12
|
|
|
@@ -65,7 +64,7 @@ def main_group(ctx: click.Context, remote: Remote):
|
|
|
65
64
|
@pass_remote
|
|
66
65
|
def download(remote: Remote, source: str, dest: Writer[bytes]):
|
|
67
66
|
"""Download SOURCE from the remote and write it to DEST"""
|
|
68
|
-
buff = remote.
|
|
67
|
+
buff = remote.open(source, "rb")
|
|
69
68
|
shutil.copyfileobj(buff, dest)
|
|
70
69
|
|
|
71
70
|
|
|
@@ -84,7 +83,7 @@ def download(remote: Remote, source: str, dest: Writer[bytes]):
|
|
|
84
83
|
def upload(
|
|
85
84
|
remote: Remote,
|
|
86
85
|
overwrite: bool,
|
|
87
|
-
source: Path
|
|
86
|
+
source: Path,
|
|
88
87
|
dest: str,
|
|
89
88
|
):
|
|
90
89
|
"""
|
|
@@ -99,8 +98,9 @@ def upload(
|
|
|
99
98
|
"""
|
|
100
99
|
with remote:
|
|
101
100
|
if isinstance(source, Path) and str(source) == "-":
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
remote.write(sys.stdin.buffer.read(), dest)
|
|
102
|
+
else:
|
|
103
|
+
remote.copytree(source, dest, overwrite)
|
|
104
104
|
|
|
105
105
|
|
|
106
106
|
@main_group.command(short_help="Delete a file or directory.")
|
|
@@ -109,7 +109,7 @@ def upload(
|
|
|
109
109
|
def rm(remote: Remote, path: str):
|
|
110
110
|
"""Delete the file or directory at PATH on the remote"""
|
|
111
111
|
with remote:
|
|
112
|
-
remote.
|
|
112
|
+
remote.remove(path)
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
@main_group.command(short_help="Create a symlink.")
|
|
@@ -117,9 +117,9 @@ def rm(remote: Remote, path: str):
|
|
|
117
117
|
@click.argument("target")
|
|
118
118
|
@pass_remote
|
|
119
119
|
def ln(remote: Remote, source: str, target: str):
|
|
120
|
-
"""Create a symlink on the remote at
|
|
120
|
+
"""Create a symlink on the remote at TARGET pointing to SOURCE"""
|
|
121
121
|
with remote:
|
|
122
|
-
remote.
|
|
122
|
+
remote.symlink(source, target)
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
@main_group.command(short_help="Create a directory.")
|
|
@@ -128,4 +128,4 @@ def ln(remote: Remote, source: str, target: str):
|
|
|
128
128
|
def mkdir(remote: Remote, path: str):
|
|
129
129
|
"""Create a directory on the remote at PATH. Any existing file or directory at PATH will be deleted"""
|
|
130
130
|
with remote:
|
|
131
|
-
remote.
|
|
131
|
+
remote.mkdir(path)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import os
|
|
2
|
-
import shutil
|
|
3
2
|
import subprocess
|
|
4
3
|
from pathlib import Path
|
|
5
4
|
from tempfile import TemporaryDirectory
|
|
6
5
|
|
|
7
6
|
import click
|
|
8
7
|
from click import ClickException
|
|
8
|
+
from urlpath import URL
|
|
9
9
|
|
|
10
10
|
from .main import main_group, pass_remote
|
|
11
11
|
from ..config import get_config
|
|
@@ -29,6 +29,7 @@ def manifest_group(): ...
|
|
|
29
29
|
@click.option(
|
|
30
30
|
"--url",
|
|
31
31
|
"url",
|
|
32
|
+
type=click.Path(path_type=URL),
|
|
32
33
|
metavar="URL",
|
|
33
34
|
help="""
|
|
34
35
|
Set the root URL to a new value. The root URL is the base for all hrefs in the version manifest. This must be absolute (either a path starting
|
|
@@ -36,19 +37,22 @@ def manifest_group(): ...
|
|
|
36
37
|
""",
|
|
37
38
|
)
|
|
38
39
|
@pass_remote
|
|
39
|
-
def edit(remote: Remote, editor: str | None, url:
|
|
40
|
+
def edit(remote: Remote, editor: str | None, url: URL | None):
|
|
40
41
|
"""Edit the version manifest."""
|
|
41
42
|
with remote:
|
|
43
|
+
manifest = remote.read_manifest()
|
|
44
|
+
if url is not None:
|
|
45
|
+
manifest.base_url = url
|
|
42
46
|
if editor is not None:
|
|
43
47
|
with TemporaryDirectory() as td:
|
|
44
48
|
tmp_path = Path(td) / get_config().get("manifest_url")
|
|
45
|
-
with open(tmp_path, "
|
|
46
|
-
|
|
49
|
+
with open(tmp_path, "w") as temp:
|
|
50
|
+
manifest.dump(temp)
|
|
47
51
|
while True:
|
|
48
52
|
subprocess.run([editor, tmp_path], check=True)
|
|
49
53
|
try:
|
|
50
|
-
with open(tmp_path, "
|
|
51
|
-
|
|
54
|
+
with open(tmp_path, "r") as temp:
|
|
55
|
+
manifest = VersionManifest.load(temp)
|
|
52
56
|
return
|
|
53
57
|
except Exception as e:
|
|
54
58
|
retry = click.confirm(
|
|
@@ -58,5 +62,4 @@ def edit(remote: Remote, editor: str | None, url: str | None):
|
|
|
58
62
|
raise ClickException(
|
|
59
63
|
f"Aborting after error parsing manifest file: {e}"
|
|
60
64
|
)
|
|
61
|
-
|
|
62
|
-
remote.manifest.base_url = url
|
|
65
|
+
remote.write_manifest(manifest)
|