Squarkdown comes with sensible defaults out-of-the-box, but you’ll almost certainly want to configure it to suit your needs.
Squarkdown reads in your configuration from 1 of 4 places:
- /squarkup.toml
- /squarkup.json (not yet unsupported)
- /.squarkdown/squarkup.toml
- /.squarkdown/squarkup.json (not yet unsupported)
TOML is the recommended format. JSON support is in progress!
IMPORTANT
You need a squarkup config file – even if empty – to run Squarkdown, because Squarkdown uses it to resolve your project root!
Categories
Configuration options are neatly organised into categories. Throughout the docs you’ll see them referred to as category.option, e.g. format.preserve-comments.
| Category | Description |
|---|---|
errors | Error handling |
project | Project metadata |
paths | Finding files to squarkup |
charm | Charm squark |
out | Output |
format | Markdown rendering |
assets | Assets preprocessing |
fonts | Fonts preprocessing |
TIP
If you’re new to Squarkdown,
paths.siteis the most important option to set.From there,
errorsandpathsare the most important categories to start with.
Errors
| Option | Type | Values | Default |
|---|---|---|---|
strict | boolean | true | |
debug | boolean | true | |
on-error | string | warn kill | warn |
file-already-exists | string | overwrite error skip | overwrite |
link-broken | string | mark-dead strip-extension link-to-github error | error |
link-inactive | string | mark-dead strip-extension link-to-github error | error |
strict
Enable stricter safety checks?
This includes:
- Requiring
dest(ination) to be explicitly provided in the charm squark - Validating charm squark only contains [Squarkdown-native fields]
- Checking directories remain under your project root
- Checking multiple files don’t export to the same directory
debug
Enable more helpful debug output?
This includes:
- When a rendering error occurs, showing a snapshot of the source text pointing out the exact error
This requires Squarkdown to do more work, so has a tiny impact on performance. It’s enabled by default since the performance impact is usually negligible, and it makes error messages significantly better!
New in v4.2.
on-error
How should Squarkdown react to non-fatal errors?
Defaults to warn, meaning Squarkdown will report the error but continue processing. This means one bad page won’t bring down the entire squarkup, and you’d be able to catch more errors in a single run.
In production, you’ll probably want kill, so that you don’t get an incomplete build.
file-already-exists
How should Squarkdown react when a file to render to already exists?
Defaults to overwrite, meaning Squarkdown will overwrite the existing file.
In production, you may want error to avoid Squarkdown overwriting a handwritten +page.svx without you knowing.
link-broken
IMPORTANT
Not to be confused with
link-inactive!
How should Squarkdown handle a link that does not resolve to an existent file or folder?
Defaults to error, meaning Squarkdown will raise an error handled according to errors.on-error.
New in v4.6.
link-inactive
IMPORTANT
Not to be confused with
link-broken!
How should Squarkdown handle a link that does not resolve to an active file or folder?
This refers to when a link would be broken in production, because the linked file doesn’t have #SQUARK live!, and so wouldn’t have a page in the site.
Defaults to error, meaning Squarkdown will raise an error handled according to errors.on-error.
Project
| Option | Type |
|---|---|
name | string |
github | string |
name
The displayed name of the repo, injected into <title> when format.inject-head = true.
New in v4.2.
github
The GitHub repository name, e.g. Sup2point0/stranger-quarkdown.
New in v4.2.
Paths
| Option | Type | Default |
|---|---|---|
site | string | your project root |
sources | string array | your entire project repo |
include | string array | .md files |
exclude | string array | .git/, .node_modules/, .svelte-kit/ folders |
site
sources
include
exclude
Charm
| Option | Type | Default |
|---|---|---|
flags | string array | none |
fields | string array | none |
flags
New in v4.8.
fields
New in v4.8.
Out
| Option | Type | Notes | Default |
|---|---|---|---|
folder | string | path relative to project root | src/routes/ in your site folder |
file-name | string | file name with .svx extension | +page.svx |
site-data-path | string none | path relative to site | none |
render-page-ts | boolean | true | |
shorter-fields | boolean | false |
folder
Where to export files relative to.
destination paths in files are relative to this folder.
file-name
The file name for exported files, including the (expected) .svx extension.
site-data-path
Where to export site data, including the (expected) .json extension.
If absent, site data is not exported.
render-page-ts
Should +page.ts files be exported?
shorter-fields
Should fields in exported +page.ts and site.json use more compact identifiers?
For instance, description is shortened to desc, and last_update is shortened to update.
Format
| Option | Type | Default |
|---|---|---|
inject-head | boolean | true |
preserve-heading | boolean | false |
preserve-comments | boolean | false |
externalise-links | boolean | true |
escape-angles | boolean | true |
escape-braces | boolean | true |
repair-tables | boolean | true |
inject-head
Inject a <head> element containing <title> and <meta name="description">?
New in v4.2.
preserve-heading
Keep the first # Heading in the rendered output?
preserve-comments
Keep <!-- comments --> in the rendered output?
externalise-links
Convert links containing <sup>↗</sup> to <a target="_blank"> elements?
escape-angles
Escape <> (that don’t form HTML tags) as < > for HTML safty?
New in v4.9.
escape-braces
Escape {} as { } for Svelte safety?
New in v4.9.
repair-tables
See also: Repairing HTML
Repair potentially broken HTML that would result in SvelteKit rendering errors?
This includes:
- Adding missing
<tbody>to<table>elements
New in v4.8.
Assets
These options are used for assets preprocessing and rewriting links to asset files.
If any options are provided, then assets preprocessing will be enabled and asset links will be rewritten.
| Option | Type | Notes | Default |
|---|---|---|---|
base-path | string | path relative to site origin | none |
folder | string | path relative to project root | your project root |
site-assets-folder | string none | path relative to project root | none |
extensions | string array | file extensions | .png, .jpg, .jpeg, .webp, .svg files |
base-path
Base path to prepend to rewritten asset links.
When assets preprocessing is enabled, Squarkdown will rewrite Markdown links to asset files, so that they work in the site. These links are absolute links, so e.g.  becomes .
This is fine if your site is served from the origin root (e.g. my-site.com/image.png), but if you’re under a subpath (e.g. me.github.io/project/image.png), then these links will break.
This option remedies that by allowing you to specify what to prepend before /image.png. So if you provide my-project, then the link is rewritten to /my-project/image.png.
New in v4.8.
folder
The folder containing asset files to copy to SvelteKit’s static/ folder.
site-assets-folder
The folder containing asset files to copy directly to the root of static/, without structure preservation.
extensions
Only files with these extensions will be treated as asset files.
Fonts
| Option | Type | Values |
|---|---|---|
queries | string array |