Skip to content

Commit

Permalink
feat: Add support of mdbook-toc plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jontze committed Sep 14, 2021
1 parent d538a3e commit 6121751
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/mdbook/plugins/Toc.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Toc } from "./Toc";

import * as PluginModule from "./MdPlugin";

jest.mock("./MdPlugin");

describe("Toc", () => {
it("should init class", () => {
const constructorSpy = jest.spyOn(PluginModule, "MdPlugin");
const linkchecker = new Toc();

expect(constructorSpy).toHaveBeenCalledWith(
"badboy/mdbook-toc",
"toc-version",
"mdbook-toc",
"unknown-linux-gnu"
);
expect(linkchecker).toBeDefined();
});
});
12 changes: 12 additions & 0 deletions src/mdbook/plugins/Toc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { MdPlugin } from "./MdPlugin";

export class Toc extends MdPlugin {
constructor() {
super(
"badboy/mdbook-toc",
"toc-version",
"mdbook-toc",
"unknown-linux-gnu"
);
}
}

0 comments on commit 6121751

Please sign in to comment.