Skip to main content
Deno 2 is finally here 🎉️
Learn more

docable

An open-source documentation generator written in TypeScript.

Compilers

Docable.Compilers.JsonCompiler

import Docable from "https://deno.land/x/docable@v0.1.0/mod.ts";

const encoder = new TextEncoder();
const compiler = new Docable.Compilers.JsonCompiler();

let compiled = compiler.compile([
  "/path/to/my/first_file.ts",
  "/path/to/my/second_file.ts",
  "/path/to/my/third_file.ts"
]);
let encoded = encoder.encode(JSON.stringify(compiled, null, 4));

Deno.writeFileSync("/path/to/output_file.json", encoded);

Example Input File: https://github.com/crookse/docable/blob/master/tests/data/json_compiler_input.ts

Example Output JSON: https://github.com/crookse/docable/blob/master/tests/data/json_compiler_expected.json