Skip to content

Commit 1ded5b7

Browse files
committed
Add docs website
1 parent f2e5e3c commit 1ded5b7

File tree

6 files changed

+148
-0
lines changed

6 files changed

+148
-0
lines changed

.github/workflows/publish-website.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
on:
2+
push:
3+
branches: [main, master]
4+
release:
5+
types: [published]
6+
workflow_dispatch: {}
7+
8+
name: demo-website
9+
10+
jobs:
11+
demo-page:
12+
runs-on: ubuntu-latest
13+
# Only restrict concurrency for non-PR jobs
14+
concurrency:
15+
group: quarto-publish-${{ github.event_name != 'pull_request' || github.run_id }}
16+
permissions:
17+
contents: write
18+
steps:
19+
- name: "Check out repository"
20+
uses: actions/checkout@v4
21+
22+
- name: "Set up Quarto"
23+
uses: quarto-dev/quarto-actions/setup@v2
24+
with:
25+
version: "pre-release"
26+
27+
- name: Publish to GitHub Pages (and render)
28+
uses: quarto-dev/quarto-actions/publish@v2
29+
with:
30+
target: gh-pages
31+
path: docs

docs/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.quarto/

docs/_extensions

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../_extensions/

docs/_quarto.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
project:
2+
type: website
3+
4+
website:
5+
title: "options"
6+
reader-mode: true
7+
repo-url: https://github.com/coatless-quarto/options/
8+
repo-actions: [edit, issue]
9+
sidebar:
10+
style: "floating"
11+
search: true
12+
tools:
13+
- icon: github
14+
href: https://github.com/coatless-quarto/options/
15+
contents:
16+
- text: "Home"
17+
file: index.qmd
18+
- section: "Extra"
19+
contents:
20+
- qoptions-release-notes.qmd
21+
22+
format:
23+
html:
24+
toc: true

docs/index.qmd

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
title: "Home"
3+
format:
4+
html:
5+
toc: false
6+
---
7+
8+
The `options` Quarto extension allows developers to craft options that incorporate default parameters.
9+
10+
## Usage
11+
12+
The `options` extension does not introduce significant enhancements to your document's content. Instead, it serves as a way for authors to quickly bootstrap their own custom code cell through an [extension embedding](https://quarto.org/docs/journals/formats.html#extension-embedding).
13+
14+
## Installation
15+
16+
To install the `options` extension inside of your own extension, follow these steps:
17+
18+
1. Open your terminal.
19+
20+
2. Navigate to where your own extension's development location is.
21+
22+
3. Execute the following command:
23+
24+
```sh
25+
quarto add coatless-quarto/options --embed <your-extension-name>
26+
```
27+
28+
This command will download and install the extension under the `_extensions` subdirectory of your Quarto extension project. If you are using version control, ensure that you include this directory in your repository.
29+
30+
### File structure
31+
32+
When embedding the extension inside of your own extension, you should see the following folder structure:
33+
34+
```sh
35+
.
36+
└── _extensions
37+
└── <your-extension-name>
38+
└── _extensions
39+
└── coatless-quarto
40+
└── options
41+
42+
```
43+
44+
### Registering the extension
45+
46+
Inside of the `_extension.yml`, please include the nested extension under `filters` as the first extension to run:
47+
48+
```
49+
title: My Extension
50+
author: My Name
51+
version: 0.1.1
52+
quarto-required: ">=1.4.549"
53+
contributes:
54+
format:
55+
common:
56+
filters:
57+
- coatless-quarto/options
58+
- <your-extension>.lua
59+
```
60+
61+
## Retrieving Options
62+
63+
Inside of the Lua filter, this extension can be used to setup:
64+
65+
```lua
66+
-- Store function calls in a table value
67+
local options = require("_extensions.coatless-quarto.options.options")
68+
69+
-- Attempt to retrieve option
70+
options.tryOption(options, key)
71+
72+
-- Retrieve option if present, otherwise use default
73+
options.getOption(options, key, default)
74+
```

docs/qoptions-release-notes.qmd

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: "Release Notes"
3+
date: "04-27-2024"
4+
date-modified: last-modified
5+
engine: markdown
6+
format:
7+
html:
8+
toc: true
9+
---
10+
11+
# 0.0.0-dev.1: ???? (??-??-????)
12+
13+
## Features
14+
15+
- `options` focuses on option tooling for Quarto extension developers:
16+
- `tryOption`: attempts to retrieve the option, otherwise returns `nil`.
17+
- `getOption`: retrieve the current value of the option or fall back to a default value if not found.

0 commit comments

Comments
 (0)