Skip to content

Commit

Permalink
feat: Enable toc and open-on-gh plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
jontze committed Sep 14, 2021
1 parent 6121751 commit c316e6c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
16 changes: 16 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@ inputs:
description: mermaid version that should be used
required: false
default: "latest"
use-toc:
description: "Use toc plugin (true / false)"
required: false
default: false
toc-version:
description: toc version that should be used
required: false
default: "latest"
use-opengh:
description: "Use open-on-gh plugin (true / false)"
required: false
default: false
opengh-version:
description: open-on-gh version that should be used
required: false
default: "latest"
runs:
using: "node12"
main: "./dist/index.js"
Expand Down
14 changes: 14 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import * as core from "@actions/core";
import { MdBook } from "./mdbook/MdBook";
import { Linkcheck } from "./mdbook/plugins/Linkcheck";
import { Mermaid } from "./mdbook/plugins/Mermaid";
import { OpenGh } from "./mdbook/plugins/OpenGh";
import { Toc } from "./mdbook/plugins/Toc";

/**
* Run the action async
Expand All @@ -21,6 +23,18 @@ const run = async () => {
const mermaidPlugin = new Mermaid();
await mermaidPlugin.setup();
}

// Toc - 3rd party preprocessor plugin for mdbook
if (core.getBooleanInput("use-toc") === true) {
const tocPlugin = new Toc();
await tocPlugin.setup();
}

// Open-On-Gh - 3rd party preprocessor plugin for mdbook
if (core.getBooleanInput("use-opengh") === true) {
const openGhPlugin = new OpenGh();
await openGhPlugin.setup();
}
};

(async (): Promise<void> => {
Expand Down

0 comments on commit c316e6c

Please sign in to comment.