Skip to content

Commit

Permalink
Split ‘using plugins’ into a page
Browse files Browse the repository at this point in the history
  • Loading branch information
irskep committed Aug 27, 2024
1 parent 0fa7934 commit 2f6ab50
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 25 deletions.
26 changes: 2 additions & 24 deletions docs/src/plugins/index.djot
Original file line number Diff line number Diff line change
@@ -1,26 +1,4 @@
---
order: -1
---
# Plugins

Djockey has a plugin API that allows arbitrary transforms on documents.

You can use plugins by specifying a `plugins`{.language-yaml} array in your `djockey.config`{.language-sh}:

```yaml
plugins:
- myCustomPlugin.js
- plugin-from-package
```

## How plugins work

There is a "read" pass and a "write" pass. If a plugin creates new content that should be processed in turn by other plugins, you can configure Djockey to run more than one set of passes.

```mermaid
flowchart LR
Parse(Read documents) --> Read(Read pass)
Read --> Write(Write pass)
Write -->|If configured| Read
Write --> Output
```
title: "Plugins"
---
26 changes: 26 additions & 0 deletions docs/src/plugins/using_plugins.djot
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
order: 0
---
# Using plugins

Djockey has a plugin API that allows arbitrary transforms on documents.

You can use plugins by specifying a `plugins`{.language-yaml} array in your `djockey.config`{.language-sh}:

```yaml
plugins:
- myCustomPlugin.js
- plugin-from-package
```

## Extra passes

There is a "read" pass and a "write" pass. If a plugin creates new content that should be processed in turn by other plugins, you can configure Djockey to run more than one set of passes.

```mermaid
flowchart LR
Parse(Read documents) --> Read(Read pass)
Read --> Write(Write pass)
Write -->|If configured| Read
Write --> Output
```
1 change: 0 additions & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export function makePathBackToRoot(
export function ensureParentDirectoriesExist(filePath: string) {
if (fs.existsSync(path.resolve(path.join(filePath, "..")))) return;

console.log("mkdirSync", path.resolve(path.join(filePath, "..")));
fs.mkdirSync(path.resolve(path.join(filePath, "..")), {
recursive: true,
});
Expand Down

0 comments on commit 2f6ab50

Please sign in to comment.