documentalist
Advanced tools
Comparing version 0.0.8 to 0.1.1
11
cli.js
#!/usr/bin/env node | ||
// @ts-check | ||
@@ -15,6 +16,7 @@ // Example Usage | ||
const glob = require("glob"); | ||
const { Documentalist, KssPlugin, MarkdownPlugin, TypedocPlugin, TypescriptPlugin } = require("./dist/"); | ||
const { Documentalist, KssPlugin, MarkdownPlugin, TypescriptPlugin } = require("./dist/"); | ||
const argv = yargs | ||
.alias("v", "version") | ||
// @ts-ignore | ||
.version(require("./package.json").version) | ||
@@ -45,8 +47,3 @@ .usage("$0 [options] <files>") | ||
if (argv.ts) { | ||
docs = docs.use(/\.tsx?$/, new TypescriptPlugin({ | ||
excludePaths: ["__tests__"], | ||
})); | ||
docs = docs.use(/\.tsx?$/, new TypedocPlugin({ | ||
excludePaths: ["__tests__"], | ||
})); | ||
docs = docs.use(/\.tsx?$/, new TypescriptPlugin({ exclude: "**/__tests__/**" })); | ||
} | ||
@@ -53,0 +50,0 @@ if (argv.css) { |
@@ -7,97 +7,17 @@ /** | ||
*/ | ||
/** | ||
* This module exports all __client__ interfaces: Documentalist concepts that are meant to be used at runtime | ||
* alongside a compiled documentation data file. | ||
* | ||
* The `Documentalist` class and its plugins are only available at compile-time, but their interfaces are useful | ||
* when rendering the data, so they are exposed separately in this module. | ||
* | ||
* A few utility functions are also provided, including several type guards for `@tags`. | ||
*/ | ||
export * from "./compiler"; | ||
export * from "./kss"; | ||
export * from "./markdown"; | ||
export * from "./typedoc"; | ||
export * from "./plugin"; | ||
export * from "./tags"; | ||
export * from "./typescript"; | ||
export * from "./utils"; | ||
/** | ||
* The basic components of a navigable resource: a "route" at which it can be accessed and | ||
* its depth in the layout hierarchy. Heading tags and hierarchy nodes both extend this interface. | ||
*/ | ||
export interface INavigable { | ||
/** Fully-qualified route of the heading, which can be used as anchor `href`. */ | ||
route: string; | ||
/** Level of heading, from 1-6. Dictates which `<h#>` tag to render. */ | ||
level: number; | ||
} | ||
/** Represents a single `@tag <value>` line from a file. */ | ||
export interface ITag { | ||
/** Tag name. */ | ||
tag: string; | ||
/** Tag value, exactly as written in source. */ | ||
value: string; | ||
} | ||
/** | ||
* Represents a single `@#+ <value>` heading tag from a file. Note that all `@#+` tags | ||
* (`@#` through `@######`) are emitted as `tag: "heading"` so only one renderer is necessary to | ||
* capture all six levels. | ||
* | ||
* Heading tags include additional information over regular tags: fully-qualified `route` of the | ||
* heading (which can be used as anchor `href`), and `level` to determine which `<h#>` tag to use. | ||
*/ | ||
export interface IHeadingTag extends ITag, INavigable { | ||
tag: "heading"; | ||
} | ||
/** An entry in `contents` array: either an HTML string or an `@tag`. */ | ||
export declare type StringOrTag = string | ITag; | ||
/** | ||
* Metadata is parsed from YAML front matter in files and can contain arbitrary data. | ||
* A few keys are understood by Documentalist and, if defined in front matter, | ||
* will override default behavior. | ||
* | ||
* ```md | ||
* --- | ||
* reference: overview | ||
* title: "Welcome to the Jungle" | ||
* --- | ||
* actual contents of file... | ||
* ``` | ||
*/ | ||
export interface IMetadata { | ||
/** | ||
* Unique ID for addressing this page. | ||
* @default filename without extension | ||
*/ | ||
reference?: string; | ||
/** | ||
* Human-friendly title of this page, for display in the UI. | ||
* @default value of first `@#` tag | ||
*/ | ||
title?: string; | ||
[key: string]: any; | ||
} | ||
/** | ||
* The output of `renderBlock` which parses a long form documentation block into | ||
* metadata, rendered markdown, and tags. | ||
*/ | ||
export interface IBlock { | ||
/** Parsed nodes of source file. An array of markdown-rendered HTML strings or `@tag` objects. */ | ||
contents: StringOrTag[]; | ||
/** Raw unmodified contents of source file (excluding the metadata). */ | ||
contentsRaw: string; | ||
/** Arbitrary YAML metadata parsed from front matter of source file, if any, or `{}`. */ | ||
metadata: IMetadata; | ||
} | ||
/** | ||
* A single Documentalist page, parsed from a single source file. | ||
*/ | ||
export interface IPageData extends IBlock { | ||
/** Unique identifier for addressing this page. */ | ||
reference: string; | ||
/** Fully qualified route to this page: slash-separated references of all parent pages. */ | ||
route: string; | ||
/** Human-friendly title of this page. */ | ||
title: string; | ||
} | ||
/** An `@#+` tag belongs to a specific page. */ | ||
export interface IHeadingNode extends INavigable { | ||
/** Display title of page heading. */ | ||
title: string; | ||
} | ||
/** A page has ordered children composed of `@#+` and `@page` tags. */ | ||
export interface IPageNode extends IHeadingNode { | ||
/** Ordered list of pages and headings that appear on this page. */ | ||
children: Array<IPageNode | IHeadingNode>; | ||
/** Unique reference of this page, used for retrieval from store. */ | ||
reference: string; | ||
} |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/** | ||
@@ -7,3 +8,2 @@ * Copyright 2017-present Palantir Technologies, Inc. All rights reserved. | ||
*/ | ||
"use strict"; | ||
function __export(m) { | ||
@@ -13,2 +13,3 @@ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./typescript")); | ||
__export(require("./utils")); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/** | ||
@@ -7,3 +8,2 @@ * Copyright 2017-present Palantir Technologies, Inc. All rights reserved. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -7,3 +7,4 @@ /** | ||
*/ | ||
import { IPageData, IPageNode } from "./index"; | ||
import { IBlock } from "./compiler"; | ||
import { INavigable } from "./tags"; | ||
export interface IMarkdownPluginData { | ||
@@ -21,1 +22,24 @@ /** | ||
} | ||
/** | ||
* A single Documentalist page, parsed from a single source file. | ||
*/ | ||
export interface IPageData extends IBlock { | ||
/** Unique identifier for addressing this page. */ | ||
reference: string; | ||
/** Fully qualified route to this page: slash-separated references of all parent pages. */ | ||
route: string; | ||
/** Human-friendly title of this page. */ | ||
title: string; | ||
} | ||
/** An `@#+` tag belongs to a specific page. */ | ||
export interface IHeadingNode extends INavigable { | ||
/** Display title of page heading. */ | ||
title: string; | ||
} | ||
/** A page has ordered children composed of `@#+` and `@page` tags. */ | ||
export interface IPageNode extends IHeadingNode { | ||
/** Ordered list of pages and headings that appear on this page. */ | ||
children: Array<IPageNode | IHeadingNode>; | ||
/** Unique reference of this page, used for retrieval from store. */ | ||
reference: string; | ||
} |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/** | ||
@@ -7,3 +8,2 @@ * Copyright 2017-present Palantir Technologies, Inc. All rights reserved. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -7,22 +7,87 @@ /** | ||
*/ | ||
import { IJsDocTags } from "ts-quick-docs"; | ||
import { IBlock } from "./index"; | ||
export interface ITsDocEntry { | ||
documentation: IBlock; | ||
import { IBlock } from "./compiler"; | ||
/** Enumeration describing the various kinds of member supported by this plugin. */ | ||
export declare enum Kind { | ||
Class = "class", | ||
Interface = "interface", | ||
Method = "method", | ||
Parameter = "parameter", | ||
Property = "property", | ||
Signature = "signature", | ||
} | ||
/** Compiler flags about this member. */ | ||
export interface ITsFlags { | ||
isDeprecated?: boolean | string; | ||
isExported?: boolean; | ||
isExternal?: boolean; | ||
isOptional?: boolean; | ||
isPrivate?: boolean; | ||
isProtected?: boolean; | ||
isPublic?: boolean; | ||
isRest?: boolean; | ||
isStatic?: boolean; | ||
} | ||
/** Base type for all typescript documentation members. */ | ||
export interface ITsDocBase { | ||
/** Type brand indicating kind of member; type guards will reveal further information about it. */ | ||
kind: Kind; | ||
/** Compiled documentation: `contents` field contains an array of markdown strings or `@tag value` objects. */ | ||
documentation?: IBlock; | ||
/** Original file name in which this member originated. */ | ||
fileName?: string; | ||
flags?: ITsFlags; | ||
/** Name of this member in code, also used as its identifiers in the data store. */ | ||
name: string; | ||
tags?: IJsDocTags; | ||
} | ||
/** Documentation for a method. See `signatures` array for actual callable signatures and rendered docs. */ | ||
export interface ITsMethod extends ITsDocBase { | ||
kind: Kind.Method; | ||
/** A method has at least one signature, which describes the parameters and return type and contains documentation. */ | ||
signatures: ITsMethodSignature[]; | ||
} | ||
/** Documentation for a single method signature, including parameters, return type, and full type string. */ | ||
export interface ITsMethodSignature extends ITsDocBase { | ||
kind: Kind.Signature; | ||
parameters: ITsMethodParameter[]; | ||
returnType: string; | ||
type: string; | ||
} | ||
export interface ITsPropertyEntry extends ITsDocEntry { | ||
optional?: boolean; | ||
/** Documentation for a single parameter to a method signature. */ | ||
export interface ITsMethodParameter extends ITsDocBase { | ||
kind: Kind.Parameter; | ||
/** The default value of this property, from an initializer or an `@default` tag. */ | ||
defaultValue?: string; | ||
type: string; | ||
} | ||
export interface ITsInterfaceEntry extends ITsDocEntry { | ||
extends?: string[]; | ||
properties: ITsPropertyEntry[]; | ||
/** Documentation for a property of an object, which may have a default value. */ | ||
export interface ITsProperty extends ITsDocBase { | ||
kind: Kind.Property; | ||
/** The default value of this property, from an initializer or an `@default` tag. */ | ||
defaultValue?: string; | ||
/** Type descriptor of this property. */ | ||
type: string; | ||
} | ||
export interface ITsObjectDefinition { | ||
properties: ITsProperty[]; | ||
methods: ITsMethod[]; | ||
} | ||
/** Documentation for an `interface` definition. */ | ||
export interface ITsInterface extends ITsDocBase, ITsObjectDefinition { | ||
kind: Kind.Interface; | ||
} | ||
/** Documentation for a `class` definition. */ | ||
export interface ITsClass extends ITsDocBase, ITsObjectDefinition { | ||
kind: Kind.Class; | ||
} | ||
/** | ||
* The `TypescriptPlugin` exports a `typescript` key that contains a map of member name to | ||
* `class` or `interface` definition. | ||
* | ||
* Only classes and interfaces are provided at this root level, but each member contains full | ||
* information about its children, such as methods (and signatures and parameters) and properties. | ||
*/ | ||
export interface ITypescriptPluginData { | ||
ts: { | ||
[name: string]: ITsInterfaceEntry; | ||
typescript: { | ||
[name: string]: ITsClass | ITsInterface; | ||
}; | ||
} |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/** | ||
@@ -7,3 +8,12 @@ * Copyright 2017-present Palantir Technologies, Inc. All rights reserved. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** Enumeration describing the various kinds of member supported by this plugin. */ | ||
var Kind; | ||
(function (Kind) { | ||
Kind["Class"] = "class"; | ||
Kind["Interface"] = "interface"; | ||
Kind["Method"] = "method"; | ||
Kind["Parameter"] = "parameter"; | ||
Kind["Property"] = "property"; | ||
Kind["Signature"] = "signature"; | ||
})(Kind = exports.Kind || (exports.Kind = {})); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/** | ||
@@ -7,3 +8,2 @@ * Copyright 2017-present Palantir Technologies, Inc. All rights reserved. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -20,4 +20,3 @@ /** Slugify a string: "Really Cool Heading!" => "really-cool-heading-" */ | ||
function isTag(node, tagName) { | ||
return node != null && node.tag !== undefined | ||
&& (tagName === undefined || node.tag === tagName); | ||
return (node != null && node.tag !== undefined && (tagName === undefined || node.tag === tagName)); | ||
} | ||
@@ -24,0 +23,0 @@ exports.isTag = isTag; |
/// <reference types="marked" /> | ||
import { IBlock } from "./client"; | ||
import { ICompiler } from "./plugins"; | ||
import * as marked from "marked"; | ||
import { IBlock, ICompiler } from "./client"; | ||
export interface ICompilerOptions { | ||
/** Options for markdown rendering. See https://github.com/chjj/marked#options-1. */ | ||
markdown?: MarkedOptions; | ||
markdown?: marked.MarkedOptions; | ||
/** | ||
@@ -8,0 +8,0 @@ * Reserved @tags that should be preserved in the contents string. |
"use strict"; | ||
/** | ||
* Copyright 2017-present Palantir Technologies, Inc. All rights reserved. | ||
* Licensed under the BSD-3 License as modified (the “License”); you may obtain | ||
* a copy of the license in the LICENSE and PATENTS files in the root of this | ||
* repository. | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -19,3 +25,3 @@ const yaml = require("js-yaml"); | ||
this.renderBlock = (blockContent, reservedTagWords = this.options.reservedTags) => { | ||
const { contentsRaw, metadata } = this.extractMetadata(blockContent); | ||
const { contentsRaw, metadata } = this.extractMetadata(blockContent.trim()); | ||
const contents = this.renderContents(contentsRaw, reservedTagWords); | ||
@@ -40,4 +46,4 @@ return { contents, contentsRaw, metadata }; | ||
return splitContents | ||
.map((node) => typeof node === "string" ? this.renderMarkdown(node) : node) | ||
.filter((node) => node !== ""); | ||
.map(node => (typeof node === "string" ? this.renderMarkdown(node) : node)) | ||
.filter(node => node !== ""); | ||
} | ||
@@ -79,3 +85,4 @@ /** | ||
// NOTE: not enough information to populate `route` field yet | ||
arr.push({ tag: "heading", value, level: tag.length }); | ||
const heading = { tag: "heading", value, level: tag.length, route: "" }; | ||
arr.push(heading); | ||
} | ||
@@ -82,0 +89,0 @@ else { |
@@ -0,3 +1,3 @@ | ||
import { IFile, IPlugin } from "./client"; | ||
import { ICompilerOptions } from "./compiler"; | ||
import { IFile, IPlugin } from "./plugins"; | ||
export interface IApi<T> { | ||
@@ -4,0 +4,0 @@ /** |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/** | ||
@@ -7,3 +8,2 @@ * Copyright 2017-present Palantir Technologies, Inc. All rights reserved. | ||
*/ | ||
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -49,5 +49,7 @@ return new (P || (P = Promise))(function (resolve, reject) { | ||
const compiler = new compiler_1.Compiler(this.options); | ||
// need an empty object of correct type that we can merge into | ||
// tslint:disable-next-line:no-object-literal-type-assertion | ||
const documentation = {}; | ||
for (const { pattern, plugin } of this.plugins) { | ||
const pluginFiles = files.filter((f) => pattern.test(f.path)); | ||
const pluginFiles = files.filter(f => pattern.test(f.path)); | ||
const pluginDocumentation = yield plugin.compile(pluginFiles, compiler); | ||
@@ -64,5 +66,5 @@ this.mergeInto(documentation, pluginDocumentation); | ||
return filesGlobs | ||
.map((filesGlob) => glob.sync(filesGlob)) | ||
.map(filesGlob => glob.sync(filesGlob)) | ||
.reduce((a, b) => a.concat(b)) | ||
.map((fileName) => { | ||
.map(fileName => { | ||
const absolutePath = path.resolve(fileName); | ||
@@ -69,0 +71,0 @@ return { |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/** | ||
@@ -7,3 +8,2 @@ * Copyright 2017-present Palantir Technologies, Inc. All rights reserved. | ||
*/ | ||
"use strict"; | ||
function __export(m) { | ||
@@ -10,0 +10,0 @@ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/** | ||
@@ -7,3 +8,2 @@ * Copyright 2017-present Palantir Technologies, Inc. All rights reserved. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -56,3 +56,3 @@ const client_1 = require("./client"); | ||
const pageNode = initPageNode(page, depth); | ||
page.contents.forEach((node) => { | ||
page.contents.forEach(node => { | ||
// we only care about @page and @##+ tag nodes | ||
@@ -76,4 +76,4 @@ if (client_1.isTag(node, "page")) { | ||
function initHeadingNode(title, level) { | ||
// NOTE: `route` will be added in MarkdownPlugin. | ||
return { title, level }; | ||
// NOTE: `route` will be populated in MarkdownPlugin. | ||
return { title, level, route: "" }; | ||
} |
@@ -9,4 +9,2 @@ /** | ||
export * from "./markdown"; | ||
export * from "./typedoc"; | ||
export * from "./typescript"; | ||
export * from "./plugin"; | ||
export * from "./typescript/index"; |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/** | ||
@@ -7,3 +8,2 @@ * Copyright 2017-present Palantir Technologies, Inc. All rights reserved. | ||
*/ | ||
"use strict"; | ||
function __export(m) { | ||
@@ -15,3 +15,2 @@ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
__export(require("./markdown")); | ||
__export(require("./typedoc")); | ||
__export(require("./typescript")); | ||
__export(require("./typescript/index")); |
@@ -8,7 +8,6 @@ /** | ||
import * as kss from "kss"; | ||
import { IKssExample, IKssPluginData } from "../client"; | ||
import { ICompiler, IFile, IPlugin } from "./plugin"; | ||
import { ICompiler, IFile, IKssExample, IKssPluginData, IPlugin } from "../client"; | ||
export declare class KssPlugin implements IPlugin<IKssPluginData> { | ||
private options; | ||
constructor(options: kss.IOptions); | ||
constructor(options?: kss.IOptions); | ||
compile(cssFiles: IFile[], dm: ICompiler): { | ||
@@ -15,0 +14,0 @@ css: { |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/** | ||
@@ -7,3 +8,2 @@ * Copyright 2017-present Palantir Technologies, Inc. All rights reserved. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -13,3 +13,3 @@ const kss = require("kss"); | ||
class KssPlugin { | ||
constructor(options) { | ||
constructor(options = {}) { | ||
this.options = options; | ||
@@ -19,8 +19,8 @@ } | ||
const styleguide = this.parseFiles(cssFiles); | ||
const sections = styleguide.sections().map((s) => convertSection(s, dm)); | ||
const css = dm.objectify(sections, (s) => s.reference); | ||
const sections = styleguide.sections().map(s => convertSection(s, dm)); | ||
const css = dm.objectify(sections, s => s.reference); | ||
return { css }; | ||
} | ||
parseFiles(files) { | ||
const input = files.map((file) => ({ | ||
const input = files.map(file => ({ | ||
base: path.dirname(file.path), | ||
@@ -40,3 +40,3 @@ contents: file.read(), | ||
markupHtml: dm.renderMarkdown(`\`\`\`html\n${section.markup() || ""}\n\`\`\``), | ||
modifiers: section.modifiers().map((mod) => convertModifier(mod, dm)), | ||
modifiers: section.modifiers().map(mod => convertModifier(mod, dm)), | ||
reference: section.reference(), | ||
@@ -43,0 +43,0 @@ }; |
@@ -1,3 +0,2 @@ | ||
import { IMarkdownPluginData, IPageData, IPageNode } from "../client"; | ||
import { ICompiler, IFile, IPlugin } from "./plugin"; | ||
import { ICompiler, IFile, IMarkdownPluginData, IPageData, IPageNode, IPlugin } from "../client"; | ||
export interface IMarkdownPluginOptions { | ||
@@ -4,0 +3,0 @@ /** |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/** | ||
@@ -7,3 +8,2 @@ * Copyright 2017-present Palantir Technologies, Inc. All rights reserved. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -54,6 +54,6 @@ const path = require("path"); | ||
// compute route for page and heading NODES (from nav tree) | ||
const path = parent === undefined ? [] : [parent.route]; | ||
const baseRoute = parent === undefined ? [] : [parent.route]; | ||
const route = client_1.isPageNode(node) | ||
? path.concat(node.reference).join("/") | ||
: path.concat(client_1.slugify(node.title)).join("."); | ||
? baseRoute.concat(node.reference).join("/") | ||
: baseRoute.concat(client_1.slugify(node.title)).join("."); | ||
node.route = route; | ||
@@ -64,15 +64,10 @@ if (client_1.isPageNode(node)) { | ||
page.route = route; | ||
page.contents.forEach((content) => { | ||
page.contents.forEach(content => { | ||
// inject `route` field into heading TAGS (from page contents) | ||
if (client_1.isHeadingTag(content)) { | ||
// h1 tags do not get nested as they are used as page title | ||
if (content.level > 1) { | ||
content.route = [route, client_1.slugify(content.value)].join("."); | ||
} | ||
else { | ||
content.route = route; | ||
} | ||
content.route = content.level > 1 ? [route, client_1.slugify(content.value)].join(".") : route; | ||
} | ||
}); | ||
node.children.forEach((child) => this.recurseRoute(pageMap, child, node)); | ||
node.children.forEach(child => this.recurseRoute(pageMap, child, node)); | ||
} | ||
@@ -79,0 +74,0 @@ } |
{ | ||
"name": "documentalist", | ||
"version": "0.0.8", | ||
"version": "0.1.1", | ||
"description": "documentation for the rest of us", | ||
@@ -10,38 +10,38 @@ "main": "dist/index.js", | ||
}, | ||
"scripts": { | ||
"clean": "rm -rf dist", | ||
"docs": "pug -O docs.json ./theme/index.pug --pretty -o ./docs", | ||
"docs:json": "./cli.js './{src,typings}/**/*' > docs.json", | ||
"lint": "tslint --project .", | ||
"lint.fix": "yarn lint --fix", | ||
"test": "jest --config jest.config.json", | ||
"tsc": "tsc --project .", | ||
"watch": "yarn tsc --watch" | ||
}, | ||
"dependencies": { | ||
"glob": "^7.1.1", | ||
"js-yaml": "^3.7.0", | ||
"kss": "3.0.0-beta.15", | ||
"marked": "^0.3.6", | ||
"ts-quick-docs": "^0.5.3", | ||
"typedoc": "^0.7.1", | ||
"yargs": "^6.6.0" | ||
"js-yaml": "^3.10.0", | ||
"kss": "^3.0.0-beta.18", | ||
"marked": "^0.3.7", | ||
"typedoc": "^0.9.0", | ||
"yargs": "^10.0.3" | ||
}, | ||
"devDependencies": { | ||
"@blueprintjs/tslint-config": "^1.0.1", | ||
"@types/glob": "^5.0.30", | ||
"@types/jest": "^19.2.2", | ||
"@types/js-yaml": "^3.5.28", | ||
"@types/marked": "^0.0.28", | ||
"@types/node": "^6.0.52", | ||
"@types/react": "^15.0.14", | ||
"@types/yargs": "^6.6.0", | ||
"@types/jest": "^21.1.8", | ||
"@types/js-yaml": "^3.10.1", | ||
"@types/marked": "^0.3.0", | ||
"@types/node": "^8.5.1", | ||
"@types/react": "^16.0.31", | ||
"@types/yargs": "^10.0.0", | ||
"circle-github-bot": "^0.4.0", | ||
"jest": "^19.0.2", | ||
"npm-run-all": "^4.0.2", | ||
"jest": "^22.0.3", | ||
"npm-run-all": "^4.1.2", | ||
"pug-cli": "^1.0.0-alpha6", | ||
"ts-jest": "^19.0.2", | ||
"ts-node": "^2.1.0", | ||
"tslint": "^4.5.1", | ||
"typescript": "^2.2.1" | ||
"ts-jest": "^22.0.0", | ||
"ts-node": "^4.0.2", | ||
"tslint": "^5.8.0", | ||
"typescript": "^2.6.2" | ||
}, | ||
"scripts": { | ||
"clean": "rm -rf dist", | ||
"docs": "pug -O docs.json ./theme/index.pug --pretty -o ./docs", | ||
"docs:json": "./cli.js './{src,typings}/**/*' > docs.json", | ||
"lint": "tslint --project .", | ||
"lint.fix": "tslint --fix --project . ", | ||
"test": "jest --config jest.config.json", | ||
"tsc": "tsc --project . && echo 'OK'", | ||
"watch": "tsc --project . --watch" | ||
}, | ||
"repository": { | ||
@@ -48,0 +48,0 @@ "type": "git", |
@@ -23,10 +23,11 @@ # Documentalist | ||
```js | ||
const { Documentalist, MarkdownPlugin } = require("documentalist"); | ||
const { Documentalist, MarkdownPlugin, TypescriptPlugin } = require("documentalist"); | ||
const { writeFileSync } = require("fs"); | ||
const docs = new Documentalist() | ||
new Documentalist() | ||
.use(".md", new MarkdownPlugin()) | ||
.documentGlobs("src/**/*"); | ||
writeFileSync("docs.json", JSON.stringify(docs, null, 2)); | ||
.use(/\.tsx?$/, new TypescriptPlugin({ excludeNames: [/I.+State$/] })) | ||
.documentGlobs("src/**/*") | ||
.then(docs => JSON.stringify(docs, null, 2)) | ||
.then(json => writeFileSync("docs.json", json)) | ||
``` | ||
@@ -33,0 +34,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6
45
65669
16
43
1479
+ Added@babel/runtime@7.26.0(transitive)
+ Added@types/fs-extra@4.0.0(transitive)
+ Added@types/handlebars@4.0.31(transitive)
+ Added@types/highlight.js@9.1.8(transitive)
+ Added@types/lodash@4.14.74(transitive)
+ Added@types/marked@0.3.0(transitive)
+ Added@types/shelljs@0.7.0(transitive)
+ Addeda-sync-waterfall@1.0.1(transitive)
+ Addedansi-regex@3.0.15.0.1(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedargparse@2.0.1(transitive)
+ Addedasap@2.0.6(transitive)
+ Addedat-least-node@1.0.0(transitive)
+ Addedcamelcase@4.1.0(transitive)
+ Addedcliui@4.1.07.0.4(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcommander@5.1.0(transitive)
+ Addedcross-spawn@5.1.0(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedentities@2.1.0(transitive)
+ Addedescalade@3.2.0(transitive)
+ Addedexeca@0.7.0(transitive)
+ Addedfind-up@2.1.0(transitive)
+ Addedfs-extra@4.0.39.1.0(transitive)
+ Addedget-caller-file@2.0.5(transitive)
+ Addedget-stream@3.0.0(transitive)
+ Addedhighlight.js@10.7.3(transitive)
+ Addedis-fullwidth-code-point@2.0.03.0.0(transitive)
+ Addedis-stream@1.1.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjsonfile@4.0.06.1.0(transitive)
+ Addedkss@3.1.0(transitive)
+ Addedlinkify-it@3.0.3(transitive)
+ Addedlocate-path@2.0.0(transitive)
+ Addedlocutus@2.0.32(transitive)
+ Addedlru-cache@4.1.5(transitive)
+ Addedmarkdown-it@12.3.2(transitive)
+ Addedmdurl@1.0.1(transitive)
+ Addedmem@1.1.0(transitive)
+ Addedmimic-fn@1.2.0(transitive)
+ Addednpm-run-path@2.0.2(transitive)
+ Addednunjucks@3.2.4(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedos-locale@2.1.0(transitive)
+ Addedp-finally@1.0.0(transitive)
+ Addedp-limit@1.3.0(transitive)
+ Addedp-locate@2.0.0(transitive)
+ Addedp-try@1.0.0(transitive)
+ Addedpath-exists@3.0.0(transitive)
+ Addedpath-key@2.0.1(transitive)
+ Addedpseudomap@1.0.2(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
+ Addedshebang-command@1.2.0(transitive)
+ Addedshebang-regex@1.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedstring-width@2.1.14.2.3(transitive)
+ Addedstrip-ansi@4.0.06.0.1(transitive)
+ Addedstrip-eof@1.0.0(transitive)
+ Addedtwig@1.17.1(transitive)
+ Addedtwig-drupal-filters@3.2.0(transitive)
+ Addedtypedoc@0.9.0(transitive)
+ Addedtypescript@2.4.1(transitive)
+ Addeduc.micro@1.0.6(transitive)
+ Addeduniversalify@2.0.1(transitive)
+ Addedwhich@1.3.1(transitive)
+ Addedwhich-module@2.0.1(transitive)
+ Addedwrap-ansi@7.0.0(transitive)
+ Addedy18n@5.0.8(transitive)
+ Addedyallist@2.1.2(transitive)
+ Addedyargs@10.1.216.2.0(transitive)
+ Addedyargs-parser@20.2.98.1.0(transitive)
- Removedts-quick-docs@^0.5.3
- Removed@types/fs-extra@3.0.3(transitive)
- Removed@types/glob@8.1.0(transitive)
- Removed@types/handlebars@4.1.0(transitive)
- Removed@types/highlight.js@9.12.4(transitive)
- Removed@types/lodash@4.17.14(transitive)
- Removed@types/marked@0.0.28(transitive)
- Removed@types/minimatch@5.1.2(transitive)
- Removed@types/shelljs@0.7.9(transitive)
- Removedabbrev@1.1.1(transitive)
- Removedcamelcase@3.0.0(transitive)
- Removedcli@0.4.4-2(transitive)
- Removedcliui@3.2.0(transitive)
- Removedcommander@0.6.12.0.0(transitive)
- Removedconfig-chain@1.1.13(transitive)
- Removeddebug@4.4.0(transitive)
- Removeddeep-equal@0.1.2(transitive)
- Removeddiff@1.0.7(transitive)
- Removederror-ex@1.3.2(transitive)
- Removedfind-up@1.1.2(transitive)
- Removedfresh@0.1.0(transitive)
- Removedfs-extra@0.30.03.0.1(transitive)
- Removedglob@3.2.13.2.3(transitive)
- Removedgraceful-fs@1.2.32.0.3(transitive)
- Removedgrowl@1.7.0(transitive)
- Removedhosted-git-info@2.8.9(transitive)
- Removedinherits@1.0.2(transitive)
- Removedini@1.3.8(transitive)
- Removedis-arrayish@0.2.1(transitive)
- Removedis-utf8@0.2.1(transitive)
- Removedjade@0.26.3(transitive)
- Removedjs-beautify@1.4.2(transitive)
- Removedjsonfile@2.4.03.0.1(transitive)
- Removedklaw@1.3.1(transitive)
- Removedkss@3.0.0-beta.15(transitive)
- Removedload-json-file@1.1.0(transitive)
- Removedlru-cache@2.7.3(transitive)
- Removedmime@1.2.6(transitive)
- Removedminimatch@0.2.14(transitive)
- Removedmkdirp@0.3.00.3.5(transitive)
- Removedmocha@1.17.0(transitive)
- Removedms@2.1.3(transitive)
- Removednopt@2.1.2(transitive)
- Removednormalize-package-data@2.5.0(transitive)
- Removedos-locale@1.4.0(transitive)
- Removedparse-json@2.2.0(transitive)
- Removedpath-exists@2.1.0(transitive)
- Removedpath-type@1.1.0(transitive)
- Removedphpjs@1.3.2(transitive)
- Removedpify@2.3.0(transitive)
- Removedpinkie@2.0.4(transitive)
- Removedpinkie-promise@2.0.1(transitive)
- Removedproto-list@1.2.4(transitive)
- Removedrange-parser@0.0.4(transitive)
- Removedread-pkg@1.1.0(transitive)
- Removedread-pkg-up@1.0.1(transitive)
- Removedrimraf@2.7.1(transitive)
- Removedsemver@5.7.2(transitive)
- Removedsend@0.1.0(transitive)
- Removedsigmund@1.0.1(transitive)
- Removedspdx-correct@3.2.0(transitive)
- Removedspdx-exceptions@2.5.0(transitive)
- Removedspdx-expression-parse@3.0.1(transitive)
- Removedspdx-license-ids@3.0.20(transitive)
- Removedstrip-bom@2.0.0(transitive)
- Removedts-quick-docs@0.5.3(transitive)
- Removedtwig@0.9.5(transitive)
- Removedtypedoc@0.7.2(transitive)
- Removedtypescript@2.1.62.3.4(transitive)
- Removedunderscore@1.5.2(transitive)
- Removedvalidate-npm-package-license@3.0.4(transitive)
- Removedwhich-module@1.0.0(transitive)
- Removedyargs@6.6.0(transitive)
- Removedyargs-parser@4.2.1(transitive)
Updatedjs-yaml@^3.10.0
Updatedkss@^3.0.0-beta.18
Updatedmarked@^0.3.7
Updatedtypedoc@^0.9.0
Updatedyargs@^10.0.3