quartobot 0.1.0__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.
- quartobot-0.1.0/.gitignore +25 -0
- quartobot-0.1.0/LICENSE +21 -0
- quartobot-0.1.0/PKG-INFO +126 -0
- quartobot-0.1.0/README.md +92 -0
- quartobot-0.1.0/_extensions/seandavi/quarto-manubot-cite/README.md +140 -0
- quartobot-0.1.0/actions/render-manuscript/README.md +47 -0
- quartobot-0.1.0/actions/setup-quartobot/README.md +45 -0
- quartobot-0.1.0/examples/book-minimal/README.md +59 -0
- quartobot-0.1.0/examples/extension-minimal/README.md +48 -0
- quartobot-0.1.0/pyproject.toml +124 -0
- quartobot-0.1.0/src/quartobot/__init__.py +6 -0
- quartobot-0.1.0/src/quartobot/cli.py +215 -0
- quartobot-0.1.0/src/quartobot/init_project.py +428 -0
- quartobot-0.1.0/src/quartobot/resolve.py +310 -0
- quartobot-0.1.0/src/quartobot/scan.py +299 -0
- quartobot-0.1.0/src/quartobot/validate.py +264 -0
- quartobot-0.1.0/template/README.md +130 -0
- quartobot-0.1.0/template-book/README.md +144 -0
- quartobot-0.1.0/tests/__init__.py +0 -0
- quartobot-0.1.0/tests/fixtures/sample.qmd +36 -0
- quartobot-0.1.0/tests/test_cli.py +53 -0
- quartobot-0.1.0/tests/test_init.py +186 -0
- quartobot-0.1.0/tests/test_resolve.py +514 -0
- quartobot-0.1.0/tests/test_scan.py +345 -0
- quartobot-0.1.0/tests/test_validate.py +267 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# macOS
|
|
2
|
+
.DS_Store
|
|
3
|
+
|
|
4
|
+
# Editor
|
|
5
|
+
.vscode/
|
|
6
|
+
.idea/
|
|
7
|
+
|
|
8
|
+
# Python
|
|
9
|
+
__pycache__/
|
|
10
|
+
*.py[cod]
|
|
11
|
+
.venv/
|
|
12
|
+
*.egg-info/
|
|
13
|
+
build/
|
|
14
|
+
dist/
|
|
15
|
+
.pytest_cache/
|
|
16
|
+
.ruff_cache/
|
|
17
|
+
.mypy_cache/
|
|
18
|
+
.coverage
|
|
19
|
+
htmlcov/
|
|
20
|
+
|
|
21
|
+
# Quarto (when example projects accumulate)
|
|
22
|
+
_output/
|
|
23
|
+
_freeze/
|
|
24
|
+
.quarto/
|
|
25
|
+
*_files/
|
quartobot-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sean Davis
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
quartobot-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: quartobot
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: The manubot manuscript-as-software pattern, on Quarto.
|
|
5
|
+
Project-URL: Homepage, https://github.com/seandavi/quartobot
|
|
6
|
+
Project-URL: Documentation, https://seandavi.github.io/quartobot
|
|
7
|
+
Project-URL: Issues, https://github.com/seandavi/quartobot/issues
|
|
8
|
+
Project-URL: Source, https://github.com/seandavi/quartobot
|
|
9
|
+
Author-email: Sean Davis <seandavi@gmail.com>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: citations,manubot,quarto,reproducible-research,scholarly-publishing
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering
|
|
22
|
+
Classifier: Topic :: Text Processing :: Markup
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Requires-Dist: click>=8.1
|
|
25
|
+
Requires-Dist: manubot<0.7,>=0.6
|
|
26
|
+
Requires-Dist: pyyaml>=6.0
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
29
|
+
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
31
|
+
Requires-Dist: ruff>=0.5; extra == 'dev'
|
|
32
|
+
Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
# quartobot
|
|
36
|
+
|
|
37
|
+
[](LICENSE)
|
|
38
|
+
[](DESIGN.md)
|
|
39
|
+
|
|
40
|
+
The manubot manuscript-as-software pattern, on Quarto.
|
|
41
|
+
|
|
42
|
+
> **Status:** v0.1 in flight. CLI commands ship; the Quarto extension
|
|
43
|
+
> and the manuscript template ship. An architecture pivot is under
|
|
44
|
+
> discussion in [`docs/citation-pipeline.md`](docs/citation-pipeline.md)
|
|
45
|
+
> that would collapse the extension into a single pre-render hook
|
|
46
|
+
> calling the CLI directly — read the design doc before non-trivial
|
|
47
|
+
> work, and watch the [v0.1 milestone](https://github.com/seandavi/quartobot/milestone/1)
|
|
48
|
+
> for tagging.
|
|
49
|
+
|
|
50
|
+
## What this is
|
|
51
|
+
|
|
52
|
+
Manubot has, for eight years, run scholarly manuscripts as a git repository
|
|
53
|
+
that builds itself on every commit, resolves citations from DOIs and
|
|
54
|
+
PubMed IDs automatically, hands out an immutable permalink per commit, and
|
|
55
|
+
collaborates through pull requests. The pattern is published
|
|
56
|
+
([Himmelstein et al. 2019](https://doi.org/10.1371/journal.pcbi.1007128))
|
|
57
|
+
and has been used for hundreds of preprints.
|
|
58
|
+
|
|
59
|
+
Quarto now covers more of scholarly publishing than manubot ever did —
|
|
60
|
+
manuscripts, books, websites, slides, dashboards, courseware — but the
|
|
61
|
+
manubot pattern does not yet exist there natively. That's the gap this
|
|
62
|
+
repo closes.
|
|
63
|
+
|
|
64
|
+
The shipping surface is a Python CLI and (optionally) a GitHub template:
|
|
65
|
+
|
|
66
|
+
1. **`quartobot`** — a Python CLI. `quartobot resolve` pre-fetches
|
|
67
|
+
citations through manubot's resolver library, so CI never sees a
|
|
68
|
+
Crossref hiccup mid-render. `quartobot scan` summarizes cite keys
|
|
69
|
+
grouped by prefix with duplicate detection. `quartobot validate`
|
|
70
|
+
is the CI-lint surface (static checks against `_quarto.yml`).
|
|
71
|
+
`quartobot init` scaffolds the pattern into an existing Quarto
|
|
72
|
+
project. Authors write `@doi:10.1371/journal.pcbi.1007128`,
|
|
73
|
+
`@pmid:31479462`, `@arxiv:2104.10729`, `@isbn:…`, or bare DOIs in
|
|
74
|
+
their prose, and citations resolve.
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
uv tool install git+https://github.com/seandavi/quartobot
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
2. **`quartobot-manuscript`** — a GitHub template that combines Quarto
|
|
81
|
+
Manuscripts, the CLI's pre-render hook, and a CI workflow that
|
|
82
|
+
gives every commit an immutable permalink at `/v/<sha>/`, embeds
|
|
83
|
+
that permalink in the rendered HTML, posts PR previews via sticky
|
|
84
|
+
comment, and deploys HTML + PDF + DOCX to GitHub Pages.
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
gh repo create my-paper --template seandavi/quartobot-manuscript
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Under the current (filter-based) architecture, a Quarto extension
|
|
91
|
+
`quarto-manubot-cite` also ships at `quarto add seandavi/quartobot`.
|
|
92
|
+
The pivot proposal in `docs/citation-pipeline.md` collapses that
|
|
93
|
+
extension into a one-line pre-render hook calling the CLI — the
|
|
94
|
+
extension shrinks to optional wiring, the CLI becomes the load-bearing
|
|
95
|
+
surface. PyPI publishing and the standalone template repo are part of
|
|
96
|
+
the v0.1 tag.
|
|
97
|
+
|
|
98
|
+
## Why this exists
|
|
99
|
+
|
|
100
|
+
[manubot/manubot#332](https://github.com/manubot/manubot/issues/332)
|
|
101
|
+
("Quarto integration") was opened by Anthony Gitter in April 2022 after a
|
|
102
|
+
conversation with Sean Davis. Four years later, no PR, no assignee — but
|
|
103
|
+
`pandoc-manubot-cite` shipped inside the `manubot` package and Quarto
|
|
104
|
+
Manuscripts shipped as a first-party project type. The integration is
|
|
105
|
+
small once you stop trying to rebuild the resolver. This repo is the work
|
|
106
|
+
to resolve that issue.
|
|
107
|
+
|
|
108
|
+
## Working example
|
|
109
|
+
|
|
110
|
+
[seandavi/2026-venice-spatial-hackathon-manuscript](https://github.com/seandavi/2026-venice-spatial-hackathon-manuscript)
|
|
111
|
+
runs the CI / permalink / banner half of the pattern on a live 25-author
|
|
112
|
+
preprint from the Bioconductor Spatial Hackathon. That's the working
|
|
113
|
+
reference the template is being lifted from.
|
|
114
|
+
|
|
115
|
+
## See also
|
|
116
|
+
|
|
117
|
+
- Design — [`DESIGN.md`](DESIGN.md)
|
|
118
|
+
- Prior art — [`docs/prior-art.md`](docs/prior-art.md)
|
|
119
|
+
- Publication plan — [`docs/publication-plan.md`](docs/publication-plan.md)
|
|
120
|
+
- Conversation notes — [`docs/conversation-notes.md`](docs/conversation-notes.md)
|
|
121
|
+
- Contributing — [`CONTRIBUTING.md`](CONTRIBUTING.md)
|
|
122
|
+
- Code of conduct — [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md)
|
|
123
|
+
|
|
124
|
+
## License
|
|
125
|
+
|
|
126
|
+
[MIT](LICENSE).
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# quartobot
|
|
2
|
+
|
|
3
|
+
[](LICENSE)
|
|
4
|
+
[](DESIGN.md)
|
|
5
|
+
|
|
6
|
+
The manubot manuscript-as-software pattern, on Quarto.
|
|
7
|
+
|
|
8
|
+
> **Status:** v0.1 in flight. CLI commands ship; the Quarto extension
|
|
9
|
+
> and the manuscript template ship. An architecture pivot is under
|
|
10
|
+
> discussion in [`docs/citation-pipeline.md`](docs/citation-pipeline.md)
|
|
11
|
+
> that would collapse the extension into a single pre-render hook
|
|
12
|
+
> calling the CLI directly — read the design doc before non-trivial
|
|
13
|
+
> work, and watch the [v0.1 milestone](https://github.com/seandavi/quartobot/milestone/1)
|
|
14
|
+
> for tagging.
|
|
15
|
+
|
|
16
|
+
## What this is
|
|
17
|
+
|
|
18
|
+
Manubot has, for eight years, run scholarly manuscripts as a git repository
|
|
19
|
+
that builds itself on every commit, resolves citations from DOIs and
|
|
20
|
+
PubMed IDs automatically, hands out an immutable permalink per commit, and
|
|
21
|
+
collaborates through pull requests. The pattern is published
|
|
22
|
+
([Himmelstein et al. 2019](https://doi.org/10.1371/journal.pcbi.1007128))
|
|
23
|
+
and has been used for hundreds of preprints.
|
|
24
|
+
|
|
25
|
+
Quarto now covers more of scholarly publishing than manubot ever did —
|
|
26
|
+
manuscripts, books, websites, slides, dashboards, courseware — but the
|
|
27
|
+
manubot pattern does not yet exist there natively. That's the gap this
|
|
28
|
+
repo closes.
|
|
29
|
+
|
|
30
|
+
The shipping surface is a Python CLI and (optionally) a GitHub template:
|
|
31
|
+
|
|
32
|
+
1. **`quartobot`** — a Python CLI. `quartobot resolve` pre-fetches
|
|
33
|
+
citations through manubot's resolver library, so CI never sees a
|
|
34
|
+
Crossref hiccup mid-render. `quartobot scan` summarizes cite keys
|
|
35
|
+
grouped by prefix with duplicate detection. `quartobot validate`
|
|
36
|
+
is the CI-lint surface (static checks against `_quarto.yml`).
|
|
37
|
+
`quartobot init` scaffolds the pattern into an existing Quarto
|
|
38
|
+
project. Authors write `@doi:10.1371/journal.pcbi.1007128`,
|
|
39
|
+
`@pmid:31479462`, `@arxiv:2104.10729`, `@isbn:…`, or bare DOIs in
|
|
40
|
+
their prose, and citations resolve.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
uv tool install git+https://github.com/seandavi/quartobot
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
2. **`quartobot-manuscript`** — a GitHub template that combines Quarto
|
|
47
|
+
Manuscripts, the CLI's pre-render hook, and a CI workflow that
|
|
48
|
+
gives every commit an immutable permalink at `/v/<sha>/`, embeds
|
|
49
|
+
that permalink in the rendered HTML, posts PR previews via sticky
|
|
50
|
+
comment, and deploys HTML + PDF + DOCX to GitHub Pages.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
gh repo create my-paper --template seandavi/quartobot-manuscript
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Under the current (filter-based) architecture, a Quarto extension
|
|
57
|
+
`quarto-manubot-cite` also ships at `quarto add seandavi/quartobot`.
|
|
58
|
+
The pivot proposal in `docs/citation-pipeline.md` collapses that
|
|
59
|
+
extension into a one-line pre-render hook calling the CLI — the
|
|
60
|
+
extension shrinks to optional wiring, the CLI becomes the load-bearing
|
|
61
|
+
surface. PyPI publishing and the standalone template repo are part of
|
|
62
|
+
the v0.1 tag.
|
|
63
|
+
|
|
64
|
+
## Why this exists
|
|
65
|
+
|
|
66
|
+
[manubot/manubot#332](https://github.com/manubot/manubot/issues/332)
|
|
67
|
+
("Quarto integration") was opened by Anthony Gitter in April 2022 after a
|
|
68
|
+
conversation with Sean Davis. Four years later, no PR, no assignee — but
|
|
69
|
+
`pandoc-manubot-cite` shipped inside the `manubot` package and Quarto
|
|
70
|
+
Manuscripts shipped as a first-party project type. The integration is
|
|
71
|
+
small once you stop trying to rebuild the resolver. This repo is the work
|
|
72
|
+
to resolve that issue.
|
|
73
|
+
|
|
74
|
+
## Working example
|
|
75
|
+
|
|
76
|
+
[seandavi/2026-venice-spatial-hackathon-manuscript](https://github.com/seandavi/2026-venice-spatial-hackathon-manuscript)
|
|
77
|
+
runs the CI / permalink / banner half of the pattern on a live 25-author
|
|
78
|
+
preprint from the Bioconductor Spatial Hackathon. That's the working
|
|
79
|
+
reference the template is being lifted from.
|
|
80
|
+
|
|
81
|
+
## See also
|
|
82
|
+
|
|
83
|
+
- Design — [`DESIGN.md`](DESIGN.md)
|
|
84
|
+
- Prior art — [`docs/prior-art.md`](docs/prior-art.md)
|
|
85
|
+
- Publication plan — [`docs/publication-plan.md`](docs/publication-plan.md)
|
|
86
|
+
- Conversation notes — [`docs/conversation-notes.md`](docs/conversation-notes.md)
|
|
87
|
+
- Contributing — [`CONTRIBUTING.md`](CONTRIBUTING.md)
|
|
88
|
+
- Code of conduct — [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md)
|
|
89
|
+
|
|
90
|
+
## License
|
|
91
|
+
|
|
92
|
+
[MIT](LICENSE).
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# quarto-manubot-cite
|
|
2
|
+
|
|
3
|
+
A Quarto extension that wires `pandoc-manubot-cite` into any Quarto
|
|
4
|
+
project, so authors can cite by persistent identifier
|
|
5
|
+
(`@doi:10.1371/journal.pcbi.1007128`, `@pmid:31479462`, `@arxiv:2104.10729`,
|
|
6
|
+
`@isbn:9780262035613`, bare DOIs, and the rest of manubot's vocabulary)
|
|
7
|
+
and have entries auto-resolved into the bibliography on next build.
|
|
8
|
+
|
|
9
|
+
This is a thin wrapper. The resolver itself is
|
|
10
|
+
[manubot](https://github.com/manubot/manubot)'s — we don't reimplement it.
|
|
11
|
+
|
|
12
|
+
## Prerequisites
|
|
13
|
+
|
|
14
|
+
- Quarto ≥ 1.4
|
|
15
|
+
- `pandoc-manubot-cite` on `PATH`. Install with:
|
|
16
|
+
```bash
|
|
17
|
+
pip install manubot
|
|
18
|
+
```
|
|
19
|
+
Manubot ships the filter as an entry point; once installed, the binary
|
|
20
|
+
is discoverable by pandoc.
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
quarto add seandavi/quartobot
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
(While the extension lives in the parent `quartobot` repo, that's the
|
|
29
|
+
install path. It will move to `seandavi/quarto-manubot-cite` after the
|
|
30
|
+
first tagged release. See [#13](https://github.com/seandavi/quartobot/issues/13).)
|
|
31
|
+
|
|
32
|
+
## Use
|
|
33
|
+
|
|
34
|
+
Add the filter to your `_quarto.yml`:
|
|
35
|
+
|
|
36
|
+
```yaml
|
|
37
|
+
filters:
|
|
38
|
+
- quarto-manubot-cite
|
|
39
|
+
|
|
40
|
+
# Where pandoc-manubot-cite writes the resolved CSL JSON.
|
|
41
|
+
manubot-output-bibliography: references.json
|
|
42
|
+
|
|
43
|
+
# Where the bibliography cache lives.
|
|
44
|
+
manubot-bibliography-cache: _freeze/manubot-cache.json
|
|
45
|
+
|
|
46
|
+
# Don't fail the render on a single unresolved citation — warn and continue.
|
|
47
|
+
manubot-fail-on-errors: false
|
|
48
|
+
|
|
49
|
+
# Both files are merged at render time. Hand-curated entries live in
|
|
50
|
+
# references.bib; auto-resolved entries land in references.json.
|
|
51
|
+
bibliography:
|
|
52
|
+
- references.bib
|
|
53
|
+
- references.json
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Then cite in your `.qmd`:
|
|
57
|
+
|
|
58
|
+
```markdown
|
|
59
|
+
The manubot pattern is described in @doi:10.1371/journal.pcbi.1007128.
|
|
60
|
+
A related approach using URL keys appears in @pmid:31479462.
|
|
61
|
+
The Quarto book covers cross-format publishing [@quarto2024].
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
On render, `pandoc-manubot-cite` resolves each persistent-identifier key
|
|
65
|
+
against the relevant API (Crossref, NCBI, arXiv, Wikidata, etc.), writes
|
|
66
|
+
the resulting CSL JSON entries to `references.json`, and caches the
|
|
67
|
+
metadata at `_freeze/manubot-cache.json` so subsequent renders don't
|
|
68
|
+
re-fetch.
|
|
69
|
+
|
|
70
|
+
## Citation key vocabulary
|
|
71
|
+
|
|
72
|
+
The full table from manubot, for quick reference:
|
|
73
|
+
|
|
74
|
+
| Prefix | Source | Example |
|
|
75
|
+
|---|---|---|
|
|
76
|
+
| `@doi:` | Crossref / DataCite | `@doi:10.1371/journal.pcbi.1007128` |
|
|
77
|
+
| `@pmid:` | NCBI PubMed | `@pmid:31479462` |
|
|
78
|
+
| `@pmcid:` | NCBI PubMed Central | `@pmcid:PMC6735409` |
|
|
79
|
+
| `@arxiv:` | arXiv | `@arxiv:2104.10729` |
|
|
80
|
+
| `@isbn:` | Books (multiple resolvers) | `@isbn:9780262035613` |
|
|
81
|
+
| `@url:` | Web pages | `@url:https://manubot.org` |
|
|
82
|
+
| `@wikidata:` | Wikidata | `@wikidata:Q56458094` |
|
|
83
|
+
| `@zotero:` | Zotero web items | `@zotero:https://www.zotero.org/groups/.../items/ABCD1234` |
|
|
84
|
+
| bare DOI | DOI prefix-inferred | `@10.1371/journal.pcbi.1007128` |
|
|
85
|
+
|
|
86
|
+
See manubot's
|
|
87
|
+
[`pandoc-manubot-cite` reference](https://manubot.github.io/manubot/reference/manubot/pandoc/cite_filter/)
|
|
88
|
+
for the authoritative behavior, including normalization rules and prefix
|
|
89
|
+
inference.
|
|
90
|
+
|
|
91
|
+
## How the two bibliographies interact
|
|
92
|
+
|
|
93
|
+
Declaring both `references.bib` (hand-curated) and `references.json`
|
|
94
|
+
(auto-resolved) under `bibliography:` lets pandoc citeproc merge them.
|
|
95
|
+
Hand-curated entries you author with stable BibTeX keys (`@quarto2024`,
|
|
96
|
+
`@himmelstein2019`) sit alongside the auto-resolved DOI/PMID entries.
|
|
97
|
+
|
|
98
|
+
Precedence and dedup semantics are tracked in
|
|
99
|
+
[#10](https://github.com/seandavi/quartobot/issues/10) — the practical
|
|
100
|
+
guidance is to use auto-resolved keys (`@doi:…`) by default and reach for
|
|
101
|
+
hand-curated entries only when you need to override metadata the
|
|
102
|
+
resolver got wrong.
|
|
103
|
+
|
|
104
|
+
## Configuration reference
|
|
105
|
+
|
|
106
|
+
These metadata keys are read by `pandoc-manubot-cite` from your document
|
|
107
|
+
or `_quarto.yml`. Defaults shown are manubot's, not ours:
|
|
108
|
+
|
|
109
|
+
- `manubot-output-bibliography` — path to write the resolved CSL JSON.
|
|
110
|
+
- `manubot-bibliography-cache` — path to the persistent cache (read at
|
|
111
|
+
startup, written incrementally as citations resolve).
|
|
112
|
+
- `manubot-fail-on-errors` — `false` by default. Set to `true` to make
|
|
113
|
+
unresolved citations fail the render.
|
|
114
|
+
- `manubot-infer-citekey-prefixes` — `true` by default. Lets you write
|
|
115
|
+
bare `@10.1371/...` instead of `@doi:10.1371/...`.
|
|
116
|
+
- `manubot-requests-cache-path` — path for the HTTP request cache
|
|
117
|
+
(separate from the bibliography cache).
|
|
118
|
+
- `manubot-log-level` — `WARNING` by default.
|
|
119
|
+
|
|
120
|
+
See [manubot's reference](https://manubot.github.io/manubot/reference/manubot/pandoc/cite_filter/)
|
|
121
|
+
for the full list.
|
|
122
|
+
|
|
123
|
+
## Failure mode
|
|
124
|
+
|
|
125
|
+
By default, `pandoc-manubot-cite` warns on unresolved citations and exits
|
|
126
|
+
0 — your render continues with the unresolved citation key intact in the
|
|
127
|
+
output. That's deliberate: a Crossref or PubMed hiccup shouldn't fail
|
|
128
|
+
your build. Set `manubot-fail-on-errors: true` in CI if you want the
|
|
129
|
+
opposite.
|
|
130
|
+
|
|
131
|
+
## See also
|
|
132
|
+
|
|
133
|
+
- [manubot](https://github.com/manubot/manubot) — the upstream package.
|
|
134
|
+
- [Himmelstein et al. 2019](https://doi.org/10.1371/journal.pcbi.1007128) —
|
|
135
|
+
the foundational manubot paper. Cite it if you use this extension.
|
|
136
|
+
- The [quartobot DESIGN doc](../../../DESIGN.md) — pattern-level decisions.
|
|
137
|
+
|
|
138
|
+
## License
|
|
139
|
+
|
|
140
|
+
[MIT](../../../LICENSE).
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# render-manuscript
|
|
2
|
+
|
|
3
|
+
Composite action: renders a Quarto project to one or more formats.
|
|
4
|
+
|
|
5
|
+
```yaml
|
|
6
|
+
- uses: seandavi/quartobot/actions/render-manuscript@v0.1
|
|
7
|
+
with:
|
|
8
|
+
project: "." # path to the Quarto project dir
|
|
9
|
+
formats: "html,pdf,docx" # comma-separated
|
|
10
|
+
upload-logs: "true" # render-*.log as artifact
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## What it does
|
|
14
|
+
|
|
15
|
+
1. Prints a diagnostics block (Quarto version, Pandoc version, TeX
|
|
16
|
+
engine version, project file listing).
|
|
17
|
+
2. Runs `quarto render --to <fmt> --execute-debug` for each requested
|
|
18
|
+
format, capturing stdout to `render-<fmt>.log`.
|
|
19
|
+
3. For PDF renders, emits a heartbeat line every 30 seconds so a stalled
|
|
20
|
+
TinyTeX run shows up in the workflow log instead of timing out
|
|
21
|
+
silently.
|
|
22
|
+
4. Uploads the render logs as a workflow artifact (skippable).
|
|
23
|
+
|
|
24
|
+
## Pair with setup-quartobot
|
|
25
|
+
|
|
26
|
+
This action assumes Quarto, manubot, and the `quarto-manubot-cite`
|
|
27
|
+
extension are already installed. Use [`setup-quartobot`](../setup-quartobot/)
|
|
28
|
+
in the step before:
|
|
29
|
+
|
|
30
|
+
```yaml
|
|
31
|
+
- uses: actions/checkout@v4
|
|
32
|
+
- uses: seandavi/quartobot/actions/setup-quartobot@v0.1
|
|
33
|
+
- uses: seandavi/quartobot/actions/render-manuscript@v0.1
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Formats
|
|
37
|
+
|
|
38
|
+
Quarto supports a long list (`html`, `pdf`, `docx`, `epub`, `jats`,
|
|
39
|
+
`revealjs`, `gfm`, plus several others). Whatever you pass here is
|
|
40
|
+
handed to `quarto render --to`. Defaults to the manuscript triple:
|
|
41
|
+
`html,pdf,docx`.
|
|
42
|
+
|
|
43
|
+
## Exit behavior
|
|
44
|
+
|
|
45
|
+
The action fails fast — any single format failing stops the loop and
|
|
46
|
+
fails the action. Render logs upload regardless (`if: always()`) so
|
|
47
|
+
post-mortem is straightforward.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# setup-quartobot
|
|
2
|
+
|
|
3
|
+
Composite action: installs everything needed to render a Quarto project
|
|
4
|
+
using the manubot citation pattern.
|
|
5
|
+
|
|
6
|
+
```yaml
|
|
7
|
+
- uses: actions/checkout@v4
|
|
8
|
+
- uses: seandavi/quartobot/actions/setup-quartobot@v0.1
|
|
9
|
+
with:
|
|
10
|
+
project: "." # where _quarto.yml lives (default: .)
|
|
11
|
+
python-version: "3.12"
|
|
12
|
+
manubot-spec: "manubot>=0.6,<0.7"
|
|
13
|
+
quarto-version: "" # empty = latest stable
|
|
14
|
+
tinytex: "true" # set "false" to skip TeX install
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## What it does
|
|
18
|
+
|
|
19
|
+
1. `actions/setup-python@v5` with pip cache.
|
|
20
|
+
2. `pip install '<manubot-spec>'` — installs `pandoc-manubot-cite` on `PATH`.
|
|
21
|
+
3. `quarto-dev/quarto-actions/setup@v2` with TinyTeX by default.
|
|
22
|
+
4. `quarto add <extension-source>` inside `<project>` — installs the
|
|
23
|
+
`quarto-manubot-cite` filter extension.
|
|
24
|
+
|
|
25
|
+
## When to skip TinyTeX
|
|
26
|
+
|
|
27
|
+
If you render HTML only and want a faster CI job, set `tinytex: "false"`.
|
|
28
|
+
TinyTeX is required for PDF rendering and adds ~30 seconds to the job.
|
|
29
|
+
|
|
30
|
+
## Pinning
|
|
31
|
+
|
|
32
|
+
For reproducible CI, pin everything explicitly:
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
with:
|
|
36
|
+
python-version: "3.12"
|
|
37
|
+
manubot-spec: "manubot==0.6.1"
|
|
38
|
+
quarto-version: "1.5.57"
|
|
39
|
+
extension-source: "seandavi/quartobot@v0.1"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## See also
|
|
43
|
+
|
|
44
|
+
- [`render-manuscript`](../render-manuscript/) — the matching render step.
|
|
45
|
+
- [Extension documentation](https://github.com/seandavi/quartobot/tree/main/_extensions/seandavi/quarto-manubot-cite).
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# book-minimal
|
|
2
|
+
|
|
3
|
+
The smallest Quarto **book** project that exercises
|
|
4
|
+
`quarto-manubot-cite`. Mirrors the shape of
|
|
5
|
+
[`../extension-minimal/`](../extension-minimal/), but uses
|
|
6
|
+
`project: type: book` to demonstrate that the manubot pattern isn't
|
|
7
|
+
limited to manuscripts.
|
|
8
|
+
|
|
9
|
+
## Run it
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
cd examples/book-minimal/
|
|
13
|
+
|
|
14
|
+
# Once: install the extension and the resolver.
|
|
15
|
+
quarto add seandavi/quartobot
|
|
16
|
+
pip install 'manubot>=0.6,<0.7'
|
|
17
|
+
|
|
18
|
+
# Each render:
|
|
19
|
+
quarto render
|
|
20
|
+
open _book/index.html
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## What you should see
|
|
24
|
+
|
|
25
|
+
- `_book/` directory with `index.html` (preface) and chapter pages
|
|
26
|
+
(`chapters/intro.html`, `chapters/methods.html`,
|
|
27
|
+
`chapters/discussion.html`), plus the standard Quarto book site
|
|
28
|
+
assets (search index, sidebar, theme bundles).
|
|
29
|
+
- Each chapter's HTML carries its own bibliography section at the
|
|
30
|
+
bottom listing only the cites that chapter references — Quarto
|
|
31
|
+
book's idiomatic layout.
|
|
32
|
+
- `_freeze/manubot-cache.json` is populated incrementally as each
|
|
33
|
+
chapter renders. On a clean second render, every cite is a cache
|
|
34
|
+
hit and no network round-trip is needed.
|
|
35
|
+
|
|
36
|
+
## Per-chapter vs aggregated bibliography
|
|
37
|
+
|
|
38
|
+
Quarto book HTML output puts each chapter's references at the bottom of
|
|
39
|
+
that chapter. If you want a single aggregated references page,
|
|
40
|
+
that's currently a Quarto feature gap for book HTML — separate from
|
|
41
|
+
this extension. Track in
|
|
42
|
+
[seandavi/quartobot#34](https://github.com/seandavi/quartobot/issues/34).
|
|
43
|
+
|
|
44
|
+
## Why this isn't the template
|
|
45
|
+
|
|
46
|
+
The template (`../../template-book/` once that ships) adds: a version
|
|
47
|
+
banner, per-commit permalinks via CI, PR previews, gh-pages deploy.
|
|
48
|
+
All of that is the *pattern*. The example here is just the
|
|
49
|
+
*extension* on a book project type.
|
|
50
|
+
|
|
51
|
+
If you want the pattern, use the template. If you want to add manubot-
|
|
52
|
+
style citations to an existing Quarto book, this is the shape.
|
|
53
|
+
|
|
54
|
+
## See also
|
|
55
|
+
|
|
56
|
+
- [Manuscript-shape minimal example](../extension-minimal/)
|
|
57
|
+
- [Extension reference](../../_extensions/seandavi/quarto-manubot-cite/README.md)
|
|
58
|
+
- The book template (in progress, tracked at
|
|
59
|
+
[#36](https://github.com/seandavi/quartobot/issues/36))
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# extension-minimal
|
|
2
|
+
|
|
3
|
+
The smallest Quarto project that exercises `quarto-manubot-cite`. Use
|
|
4
|
+
this if you want to try the extension on its own without adopting the
|
|
5
|
+
full `quartobot-manuscript` template.
|
|
6
|
+
|
|
7
|
+
## Run it
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
cd examples/extension-minimal/
|
|
11
|
+
|
|
12
|
+
# Once: install the extension and the resolver.
|
|
13
|
+
quarto add seandavi/quartobot
|
|
14
|
+
pip install 'manubot>=0.6,<0.7'
|
|
15
|
+
|
|
16
|
+
# Each render:
|
|
17
|
+
quarto render index.qmd
|
|
18
|
+
open index.html
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## What you should see
|
|
22
|
+
|
|
23
|
+
- `references.json` written at the project root with one CSL JSON entry
|
|
24
|
+
for the resolved DOI (`10.1371/journal.pcbi.1007128`).
|
|
25
|
+
- `_freeze/manubot-cache.json` written with the cached resolver response.
|
|
26
|
+
- The rendered HTML shows both `@doi:…` and `@quarto2024` citations
|
|
27
|
+
rendered correctly in a numbered bibliography.
|
|
28
|
+
|
|
29
|
+
The second render should be ~instant — the cache covers the one resolver
|
|
30
|
+
lookup. `@quarto2024` is read directly from `references.bib` and never
|
|
31
|
+
needed a network round-trip.
|
|
32
|
+
|
|
33
|
+
## Generated artifacts
|
|
34
|
+
|
|
35
|
+
The render produces `index.html`, `references.json`, `_extensions/` (when
|
|
36
|
+
you ran `quarto add`), and `_freeze/`. These are all gitignored
|
|
37
|
+
(`examples/extension-minimal/.gitignore`) so this directory stays clean
|
|
38
|
+
inside the repo.
|
|
39
|
+
|
|
40
|
+
## Why this isn't the template
|
|
41
|
+
|
|
42
|
+
The template (`../../template/`) adds: a version banner, per-commit
|
|
43
|
+
permalinks via CI, PR previews, multi-format render (HTML + PDF + DOCX),
|
|
44
|
+
gh-pages deploy. All of that is the *pattern*. The example here is just
|
|
45
|
+
the *extension*.
|
|
46
|
+
|
|
47
|
+
If you want the pattern, use the template. If you want to add manubot-
|
|
48
|
+
style citations to an existing Quarto project, this is the shape.
|