Skip to content

Commit ca9dde2

Browse files
authored
Merge pull request #198 from rstudio/quartodoc-attempt-1
Start transition to quartodoc
2 parents 7ded069 + de2fa3e commit ca9dde2

File tree

20 files changed

+1259
-558
lines changed

20 files changed

+1259
-558
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,21 @@ jobs:
7979
no_proxy: "*"
8080

8181
test-rsconnect:
82-
name: "Test RSConnect"
82+
name: "Test Posit Connect"
8383
runs-on: ubuntu-latest
8484
if: ${{ !github.event.pull_request.head.repo.fork }}
8585
steps:
8686
- uses: actions/checkout@v2
8787
- uses: actions/setup-python@v2
8888
with:
89-
python-version: 3.8
89+
python-version: "3.10"
9090
- name: Install dependencies
9191
run: |
9292
python -m pip install --upgrade pip
9393
python -m pip install -r requirements/dev.txt
9494
python -m pip install -e .[test]
95-
- name: run RStudio Connect
95+
96+
- name: run Posit Connect
9697
run: |
9798
docker-compose up --build -d
9899
make dev
@@ -130,28 +131,27 @@ jobs:
130131
name: "Build Docs"
131132
runs-on: ubuntu-latest
132133
steps:
133-
- uses: actions/checkout@v2
134-
- uses: actions/setup-python@v2
135-
134+
- uses: actions/checkout@v3
135+
- uses: actions/setup-python@v4
136136
with:
137137
python-version: "3.10"
138138
- name: Install dependencies
139139
run: |
140140
python -m pip install --upgrade pip
141141
python -m pip install -r requirements/dev.txt
142142
python -m pip install -e .
143-
ipython kernel install --name "venv-pins-python" --user
144-
- uses: r-lib/actions/setup-pandoc@v1
145-
with:
146-
pandoc-version: '2.17.0.1'
143+
python -m ipykernel install --user
144+
145+
- name: Set up Quarto
146+
uses: quarto-dev/quarto-actions/setup@v2
147147
- name: Build docs
148148
run: |
149149
make docs-build
150150
- name: Save docs artifact
151151
uses: actions/upload-artifact@v3
152152
with:
153153
name: docs-html
154-
path: docs/_build/html/
154+
path: docs-quarto/_site
155155

156156
preview-docs:
157157
name: "Preview Docs:"
@@ -163,7 +163,7 @@ jobs:
163163
- uses: actions/download-artifact@v3
164164
with:
165165
name: docs-html
166-
path: docs-html
166+
path: docs-quarto/_site
167167

168168
# Determine the release name ---
169169

@@ -193,7 +193,7 @@ jobs:
193193
run: |
194194
npm install -g netlify-cli
195195
# push main branch to production, others to preview --
196-
netlify deploy --dir=docs-html --alias="${ALIAS}"
196+
netlify deploy --dir=docs-quarto/_site --alias="${ALIAS}"
197197
198198
env:
199199
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
@@ -222,11 +222,11 @@ jobs:
222222
- uses: actions/download-artifact@v3
223223
with:
224224
name: docs-html
225-
path: docs-html
225+
path: docs-quarto/_site
226226
- uses: peaceiris/actions-gh-pages@v3
227227
with:
228228
github_token: ${{ secrets.GITHUB_TOKEN }}
229-
publish_dir: docs-html
229+
publish_dir: docs-quarto/_site
230230

231231
release-pypi:
232232
name: "Release to pypi"

.github/workflows/cross-compat.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252

5353
- uses: actions/setup-python@v2
5454
with:
55-
python-version: 3.8
55+
python-version: "3.10"
5656
- name: Install py dependencies
5757
run: |
5858
python -m pip install --upgrade pip

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,10 @@ dmypy.json
137137
# RStudio
138138
.Rproj.user
139139
*.Rproj
140+
141+
# Quarto
142+
/.quarto/
143+
_site/
144+
objects.json
145+
reference/
146+
src/

Makefile

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,8 @@ dev-stop:
2020
$(RSC_API_KEYS): dev-start
2121
python script/setup-rsconnect/dump_api_keys.py $@
2222

23-
README.md: README.Rmd
24-
jupytext --from Rmd --to ipynb --output - $^ \
25-
| jupyter nbconvert \
26-
--stdin --to markdown \
27-
--execute \
28-
--ExecutePreprocessor.kernel_name='venv-pins-python' \
29-
--TagRemovePreprocessor.remove_all_outputs_tags='hide-cell' \
30-
--TagRemovePreprocessor.remove_input_tags='hide-cell' \
31-
--output $@
23+
README.md:
24+
quarto render README.qmd
3225

3326
test: test-most test-rsc
3427

@@ -39,7 +32,8 @@ test-rsc:
3932
pytest pins -m "fs_rsc"
4033

4134
docs-build:
42-
jb build --builder html docs
35+
cd docs-quarto && python -m quartodoc build --verbose
36+
cd docs-quarto && quarto render
4337

4438
docs-clean:
4539
rm -rf docs/_build docs/api/api_card

README.md

Lines changed: 50 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,101 @@
1-
# pins-python
1+
# pins
2+
<a href="https://rstudio.github.io/pins-python/"><img src="docs/logo.png" align="right" height="138" /></a>
23

3-
The pins package publishes data, models, and other Python objects, making it
4-
easy to share them across projects and with your colleagues. You can pin
5-
objects to a variety of pin *boards*, including folders (to share on a
6-
networked drive or with services like DropBox), Posit Connect, Amazon
7-
S3, and Google Cloud Storage.
8-
Pins can be automatically versioned, making it straightforward to track changes,
9-
re-run analyses on historical data, and undo mistakes.
4+
The pins package publishes data, models, and other Python objects,
5+
making it easy to share them across projects and with your colleagues.
6+
You can pin objects to a variety of pin *boards*, including folders (to
7+
share on a networked drive or with services like DropBox), Posit
8+
Connect, Amazon S3, and Google Cloud Storage. Pins can be automatically
9+
versioned, making it straightforward to track changes, re-run analyses
10+
on historical data, and undo mistakes.
1011

11-
See the [documentation](https://rstudio.github.io/pins-python) for getting started.
12+
See the [documentation](https://rstudio.github.io/pins-python) for
13+
getting started.
14+
15+
You can use pins from R as well as Python. For example, you can use one
16+
language to read a pin created with the other. Learn more about [pins
17+
for R](https://pins.rstudio.com).
1218

1319
## Installation
1420

15-
```shell
21+
You can install the released version of vetiver from
22+
[PyPI](https://pypi.org/project/pins/):
23+
24+
``` shell
1625
python -m pip install pins
1726
```
1827

19-
## Usage
28+
And the development version from
29+
[GitHub](https://github.com/rstudio/pins-python) with:
2030

21-
See the [documentation](https://rstudio.github.io/pins-python) for getting started.
31+
``` shell
32+
python -m pip install git+https://github.com/rstudio/pins-python
33+
```
34+
35+
## Usage
2236

2337
To use the pins package, you must first create a pin board. A good place
2438
to start is `board_folder()`, which stores pins in a directory you
2539
specify. Here I’ll use a special version of `board_folder()` called
2640
`board_temp()` which creates a temporary board that’s automatically
27-
deleted when your Python script or notebook session ends. This is great for examples, but
28-
obviously you shouldn't use it for real work!
41+
deleted when your Python script or notebook session ends. This is great
42+
for examples, but obviously you shouldnt use it for real work!
2943

30-
31-
```python
44+
``` python
3245
import pins
3346
from pins.data import mtcars
3447

3548
board = pins.board_temp()
3649
```
3750

38-
You can "pin" (save) data to a board with the `.pin_write()` method. It requires three
39-
arguments: an object, a name, and a pin type:
40-
51+
You can “pin” (save) data to a board with the `.pin_write()` method. It
52+
requires three arguments: an object, a name, and a pin type:
4153

42-
```python
54+
``` python
4355
board.pin_write(mtcars.head(), "mtcars", type="csv")
4456
```
4557

4658
Writing pin:
4759
Name: 'mtcars'
48-
Version: 20230410T151442Z-120a5
49-
50-
51-
60+
Version: 20230523T115348Z-120a5
5261

62+
Meta(title='mtcars: a pinned 5 x 11 DataFrame', description=None, created='20230523T115348Z', pin_hash='120a54f7e0818041', file='mtcars.csv', file_size=249, type='csv', api_version=1, version=Version(created=datetime.datetime(2023, 5, 23, 11, 53, 48, 555797), hash='120a54f7e0818041'), tags=None, name='mtcars', user={}, local={})
5363

54-
Meta(title='mtcars: a pinned 5 x 11 DataFrame', description=None, created='20230410T151442Z', pin_hash='120a54f7e0818041', file='mtcars.csv', file_size=249, type='csv', api_version=1, version=Version(created=datetime.datetime(2023, 4, 10, 15, 14, 42, 55001), hash='120a54f7e0818041'), tags=None, name='mtcars', user={}, local={})
55-
56-
57-
58-
Above, we saved the data as a CSV, but depending on
59-
what you’re saving and who else you want to read it, you might use the
60-
`type` argument to instead save it as a `joblib`, `parquet`, or `json` file.
64+
Above, we saved the data as a CSV, but depending on what you’re saving
65+
and who else you want to read it, you might use the `type` argument to
66+
instead save it as a `joblib`, `parquet`, or `json` file.
6167

6268
You can later retrieve the pinned data with `.pin_read()`:
6369

64-
65-
```python
70+
``` python
6671
board.pin_read("mtcars")
6772
```
6873

69-
70-
71-
7274
mpg cyl disp hp drat wt qsec vs am gear carb
7375
0 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4
7476
1 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 4
7577
2 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1
7678
3 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1
7779
4 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2
7880

79-
80-
8181
A board on your computer is good place to start, but the real power of
8282
pins comes when you use a board that’s shared with multiple people. To
8383
get started, you can use `board_folder()` with a directory on a shared
8484
drive or in DropBox, or if you use [Posit
8585
Connect](https://posit.co/products/enterprise/connect/) you can use
8686
`board_connect()`:
8787

88-
```python
88+
``` python
8989
# Note that this uses one approach to connecting,
9090
# the environment variables CONNECT_SERVER and CONNECT_API_KEY
9191

9292
board = pins.board_connect()
9393
board.pin_write(tidy_sales_data, "hadley/sales-summary", type="csv")
9494
```
9595

96-
Then, someone else (or an automated report) can read and use your
97-
pin:
96+
Then, someone else (or an automated report) can read and use your pin:
9897

99-
```python
98+
``` python
10099
board = board_connect()
101100
board.pin_read("hadley/sales-summary")
102101
```
@@ -105,9 +104,14 @@ You can easily control who gets to access the data using the Posit
105104
Connect permissions pane.
106105

107106
The pins package also includes boards that allow you to share data on
108-
services like Amazon’s S3 (`board_s3()`), Google Cloud Storage (`board_gcs()`),
109-
and Azure blob storage (`board_azure()`).
107+
services like Amazon’s S3 (`board_s3()`), Google Cloud Storage
108+
(`board_gcs()`), and Azure blob storage (`board_azure()`).
109+
110+
## Contributing
110111

111-
## Development
112+
- This project is released with a [Contributor Code of
113+
Conduct](https://www.contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html).
114+
By contributing to this project, you agree to abide by its terms.
112115

113-
See [CONTRIBUTING.md](CONTRIBUTING.md)
116+
- If you think you have encountered a bug, please [submit an
117+
issue](https://github.com/rstudio/pins-python/issues).

README.Rmd renamed to README.qmd

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
```{python tags=c("hide-cell")}
1+
---
2+
format: gfm
3+
---
4+
5+
```{python}
6+
#| include: false
27
# this keeps the pandas dataframe repr from spitting out scoped style tags
38
# which don't render on github
49
import pandas as pd
510
pd.set_option("display.notebook_repr_html", False)
611
```
712

8-
# pins-python
13+
# pins <a href="https://rstudio.github.io/pins-python/"><img src="docs/logo.png" align="right" height="138" /></a>
914

1015
The pins package publishes data, models, and other Python objects, making it
1116
easy to share them across projects and with your colleagues. You can pin
@@ -17,15 +22,25 @@ re-run analyses on historical data, and undo mistakes.
1722

1823
See the [documentation](https://rstudio.github.io/pins-python) for getting started.
1924

25+
You can use pins from R as well as Python. For example, you can use one language
26+
to read a pin created with the other. Learn more about
27+
[pins for R](https://pins.rstudio.com).
28+
2029
## Installation
2130

31+
You can install the released version of vetiver from [PyPI](https://pypi.org/project/pins/):
32+
2233
```shell
2334
python -m pip install pins
2435
```
2536

26-
## Usage
37+
And the development version from [GitHub](https://github.com/rstudio/pins-python) with:
2738

28-
See the [documentation](https://rstudio.github.io/pins-python) for getting started.
39+
```shell
40+
python -m pip install git+https://github.com/rstudio/pins-python
41+
```
42+
43+
## Usage
2944

3045
To use the pins package, you must first create a pin board. A good place
3146
to start is `board_folder()`, which stores pins in a directory you
@@ -88,6 +103,8 @@ The pins package also includes boards that allow you to share data on
88103
services like Amazon’s S3 (`board_s3()`), Google Cloud Storage (`board_gcs()`),
89104
and Azure blob storage (`board_azure()`).
90105

91-
## Development
106+
## Contributing
107+
108+
- This project is released with a [Contributor Code of Conduct](https://www.contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.
92109

93-
See [CONTRIBUTING.md](CONTRIBUTING.md)
110+
- If you think you have encountered a bug, please [submit an issue](https://github.com/rstudio/pins-python/issues).

docs-quarto/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.quarto/
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: 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.lua

0 commit comments

Comments
 (0)