Skip to content

Commit fc0e53b

Browse files
authored
Merge pull request #153 from rstudio/quartodoc
2 parents a4ef626 + f135637 commit fc0e53b

38 files changed

Lines changed: 631 additions & 374 deletions

.github/workflows/docs.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,31 @@ jobs:
2020
- name: Install dependencies
2121
run: |
2222
python -m pip install --upgrade pip
23-
python -m pip install -e .[dev]
23+
python -m pip install -e .[docs]
24+
- name: Set up Quarto
25+
uses: quarto-dev/quarto-actions/setup@v2
2426
- name: build docs
2527
run: |
2628
make docs
2729
- name: save docs
2830
uses: actions/upload-artifact@v3
2931
with:
3032
name: docs-html
31-
path: docs/_build/html/
33+
path: docs/_site
3234
- name: publish dev docs
3335
if: github.ref_name == 'main' && github.ref_type == 'branch'
3436
uses: peaceiris/actions-gh-pages@v3
3537
with:
3638
github_token: ${{ secrets.GITHUB_TOKEN }}
37-
publish_dir: docs/_build/*
39+
publish_dir: docs/_site/*
3840
publish_branch: gh-pages
3941
destination_dir: main
4042
- name: publish stable docs
4143
if: github.ref_type == 'tag' && startswith(github.ref, 'refs/tags/v')
4244
uses: peaceiris/actions-gh-pages@v3
4345
with:
4446
github_token: ${{ secrets.GITHUB_TOKEN }}
45-
publish_dir: docs/_build/*
47+
publish_dir: docs/_site/*
4648
publish_branch: gh-pages
4749
destination_dir: ${{ github.ref_name }}
4850
- name: create symlink stable to new version

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,5 @@ NOTES.md
142142
## RStudio
143143
*.Rproj
144144
.Rproj.user
145+
146+
/.quarto/

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
exclude: "(.*\\.csv)|(^examples/)|(^vetiver/tests/snapshots/)"
3+
exclude: "(.*\\.csv)|(^examples/)|(^vetiver/tests/snapshots/)|(^docs/_extensions/)"
44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
66
rev: v2.4.0

Makefile

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
.PHONY: clean-pyc clean-build clean docs
22
UNAME := $(shell uname)
33

4-
SPHINX_BUILDARGS=
5-
# Note that these are keys generated by the docker rsconnect service, so are
6-
# not really secrets. They are saved to json to make it easy to use rsconnect
7-
# as multiple users from the tests
84
RSC_API_KEYS=vetiver/tests/rsconnect_api_keys.json
95

106
ifeq ($(UNAME), Darwin)
@@ -22,16 +18,15 @@ help:
2218
@echo "test - run tests quickly with the default Python"
2319
@echo "test-rsc - run tests for rsconnect"
2420
@echo "coverage - check code coverage quickly with the default Python"
25-
@echo "docs - generate Sphinx HTML documentation, including API docs"
26-
@echo "cdocs - cleanout previous build & generate Sphinx HTML documentation, including API docs"
21+
@echo "docs - generate HTML documentation, including API docs"
2722
@echo "release - package and upload a release"
2823
@echo "dist - package"
2924
@echo "install - install the package to the active Python's site-packages"
3025
@echo "dev - generate RStudio Connect API keys"
3126
@echo "dev-start - start up development RStudio Connect in Docker"
3227
@echo "dev-stop - stop RStudio Connect dev container"
3328

34-
clean: clean-build clean-pyc clean-test docs-clean
29+
clean: clean-build clean-pyc clean-test
3530

3631
clean-build:
3732
rm -fr build/
@@ -65,14 +60,8 @@ coverage:
6560
coverage html
6661
$(BROWSER) htmlcov/index.html
6762

68-
cdocs cdoc cdocumentation: docs-clean docs
69-
70-
docs-clean:
71-
$(MAKE) -C docs clean
72-
7363
docs doc documentation:
74-
$(MAKE) -C docs html
75-
$(BROWSER) docs/_build/html/index.html
64+
$(MAKE) -C docs docs
7665

7766
release: dist
7867
twine upload dist/*

docs/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/.quarto/
2+
/_site/
3+
/objects.json
4+
/_sidebar.yml
5+
/reference
6+
/latest
7+
/stable
8+
/_environment

docs/Makefile

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
1-
# Minimal makefile for Sphinx documentation
2-
#
3-
4-
# You can set these variables from the command line, and also
5-
# from the environment for the first two.
6-
SPHINXOPTS ?=
7-
SPHINXBUILD ?= sphinx-build
8-
SOURCEDIR = source
9-
BUILDDIR = _build
10-
11-
# Put it first so that "make" without argument is like "make help".
12-
help:
13-
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
1+
# Minimal makefile for quartodoc documentation
142

153
.PHONY: help Makefile
164

17-
# Catch-all target: route all unknown targets to Sphinx using the new
18-
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
5+
# Catch-all target:
196
%: Makefile
20-
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
7+
python version_config.py
8+
python -m quartodoc build
9+
python -m quartodoc interlinks
10+
quarto render
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.html
2+
*.pdf
3+
*_files/
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Interlinks Extension For Quarto
2+
3+
_TODO_: Add a short description of your extension.
4+
5+
## Installing
6+
7+
_TODO_: Replace the `<github-organization>` with your GitHub organization.
8+
9+
```bash
10+
quarto add <github-organization>/interlinks
11+
```
12+
13+
This will install the extension under the `_extensions` subdirectory.
14+
If you're using version control, you will want to check in this directory.
15+
16+
## Using
17+
18+
_TODO_: Describe how to use your extension.
19+
20+
## Example
21+
22+
Here is the source code for a minimal example: [example.qmd](example.qmd).
23+
24+
## Developing
25+
26+
To see the AST the filter operates on, use this command:
27+
28+
```
29+
quarto render example.qmd --to native --output -
30+
```
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
title: Interlinks
2+
author: Michael Chow
3+
version: 1.0.0
4+
quarto-required: ">=1.2.0"
5+
contributes:
6+
filters:
7+
- interlinks.py
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: "Interlinks Example"
3+
filters:
4+
- interlinks.py
5+
interlinks:
6+
sources:
7+
siuba:
8+
url: https://siuba.org/
9+
inv: null
10+
fallback: objects_siuba.json
11+
vetiver:
12+
url: https://vetiver.rstudio.com/
13+
inv: null
14+
fallback: objects_vetiver.json
15+
---
16+
17+
## Heading {#sec-hello}
18+
19+
## Testing
20+
21+
22+
| style | syntax | output |
23+
| ----- | ------ | ------ |
24+
| md custom text | `[some explanation](`vetiver.SKLearnHandler`)` | [some explanation](`vetiver.SKLearnHandler`) |
25+
| md blank text | `[](`vetiver.SKLearnHandler`)` | [](`vetiver.SKLearnHandler`) |
26+
| md blank text (~shortened)| `[](`~vetiver.SKLearnHandler`)` | [](`~vetiver.SKLearnHandler`) |
27+
| rst custom text | `` :ref:`some explanation <vetiver.SKLearnHandler>` `` | :ref:`some explanation <vetiver.SKLearnHandler>` |
28+
| rst blank text | `` :ref:`vetiver.SKLearnHandler` `` | :ref:`vetiver.SKLearnHandler` |
29+
| rst blank text (~shortened) | `` :ref:`~vetiver.SKLearnHandler` `` | :ref:`~vetiver.SKLearnHandler` |

0 commit comments

Comments
 (0)