You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

typedoc-plugin-frontmatter

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typedoc-plugin-frontmatter - npm Package Compare versions

Comparing version

to
1.0.0-next.1

dist/options/option-types.d.ts

18

dist/index.js

@@ -27,2 +27,3 @@ "use strict";

exports.load = void 0;
const path = __importStar(require("path"));
const typedoc_plugin_markdown_1 = require("typedoc-plugin-markdown");

@@ -40,3 +41,4 @@ const yaml = __importStar(require("yaml"));

app.renderer.on(typedoc_plugin_markdown_1.MarkdownPageEvent.BEGIN, (page) => {
var _a, _b, _c;
var _a, _b, _c, _d;
const entryFileName = app.options.getValue('entryFileName');
const frontmatterGlobals = app.options.getValue('frontmatterGlobals');

@@ -46,2 +48,4 @@ const frontmatterTags = app.options.getValue('frontmatterCommentTags');

const preserveFrontmatterCommentTags = app.options.getValue('preserveFrontmatterCommentTags');
const readmeFrontmatter = app.options.getValue('readmeFrontmatter');
const indexFrontmatter = app.options.getValue('indexFrontmatter');
const resolvedFrontmatterTags = ((_a = page.model) === null || _a === void 0 ? void 0 : _a.comment)

@@ -62,2 +66,14 @@ ? (0, tags_1.getFrontmatterTags)((_b = page.model) === null || _b === void 0 ? void 0 : _b.comment, frontmatterTags, namingConvention)

};
if (path.parse(page.url).name === path.parse(entryFileName).name) {
page.frontmatter = {
...page.frontmatter,
...readmeFrontmatter,
};
}
if (path.parse(page.url).name === path.parse(((_d = page.project) === null || _d === void 0 ? void 0 : _d.url) || '').name) {
page.frontmatter = {
...page.frontmatter,
...indexFrontmatter,
};
}
});

@@ -64,0 +80,0 @@ app.renderer.on(typedoc_plugin_markdown_1.MarkdownPageEvent.END, (page) => {

import { DeclarationOption } from 'typedoc';
export declare const frontmatterGlobals: Partial<DeclarationOption>;
export declare const readmeFrontmatter: Partial<DeclarationOption>;
export declare const indexFrontmatter: Partial<DeclarationOption>;
export declare const frontmatterCommentTags: Partial<DeclarationOption>;
export declare const preserveFrontmatterCommentTags: Partial<DeclarationOption>;
export declare const frontmatterNamingConvention: Partial<DeclarationOption>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.frontmatterNamingConvention = exports.preserveFrontmatterCommentTags = exports.frontmatterCommentTags = exports.frontmatterGlobals = void 0;
exports.frontmatterNamingConvention = exports.preserveFrontmatterCommentTags = exports.frontmatterCommentTags = exports.indexFrontmatter = exports.readmeFrontmatter = exports.frontmatterGlobals = void 0;
const typedoc_1 = require("typedoc");

@@ -11,2 +11,12 @@ const maps_1 = require("./maps");

};
exports.readmeFrontmatter = {
help: 'Specify static variables to be added to the readme page only.',
type: typedoc_1.ParameterType.Mixed,
defaultValue: {},
};
exports.indexFrontmatter = {
help: 'Specify static variables to be added to the index page only.',
type: typedoc_1.ParameterType.Mixed,
defaultValue: {},
};
exports.frontmatterCommentTags = {

@@ -13,0 +23,0 @@ help: 'Specify which comment block tags should be added to frontmatter.',

7

dist/options/models.d.ts

@@ -0,4 +1,5 @@

import { ManuallyValidatedOption } from 'typedoc';
declare module 'typedoc' {
interface TypeDocOptionMap {
frontmatterGlobals: any;
frontmatterGlobals: ManuallyValidatedOption<FrontmatterGlobals>;
frontmatterCommentTags: any[];

@@ -10,3 +11,3 @@ preserveFrontmatterCommentTags: boolean;

export interface PluginOptions {
frontmatterGlobals: any;
frontmatterGlobals: ManuallyValidatedOption<FrontmatterGlobals>;
frontmatterCommentTags: any[];

@@ -16,1 +17,3 @@ preserveFrontmatterCommentTags: boolean;

}
export interface FrontmatterGlobals {
}
{
"name": "typedoc-plugin-frontmatter",
"version": "0.0.3-next.0",
"version": "1.0.0-next.1",
"description": "A plugin for TypeDoc that prepends configurable frontmatter to page content.",

@@ -16,3 +16,4 @@ "main": "dist/index.js",

"pretest": "ts-node ./test/__scripts__/prepare.ts",
"test": "jest"
"test": "jest",
"test:update": "npm run build && npm run test -- -u"
},

@@ -29,13 +30,14 @@ "author": "Tom Grey",

},
"homepage": "https://github.com/tgreyuk/typedoc-plugin-markdown/tree/master/packages/typedoc-plugin-frontmatter#readme",
"homepage": "https://typedoc-plugin-markdown.org/utilities/frontmatter/introduction",
"dependencies": {
"yaml": "^2.2.2"
"yaml": "^2.3.4"
},
"peerDependencies": {
"typedoc-plugin-markdown": ">=4.0.0-next.13"
"typedoc-plugin-markdown": ">=4.0.0-next.54"
},
"keywords": [
"frontmatter",
"typedoc"
"typedoc",
"typedoc-plugin"
]
}
# typedoc-plugin-frontmatter
![npm](https://img.shields.io/npm/v/typedoc-plugin-frontmatter%2Fnext?&logo=npm) ![Downloads](https://img.shields.io/npm/dm/typedoc-plugin-frontmatter) [![Build Status](https://github.com/tgreyuk/typedoc-plugin-markdown/actions/workflows/ci.yml/badge.svg?branch=next)](https://github.com/tgreyuk/typedoc-plugin-markdown/actions/workflows/ci.yml)
![npm](https://img.shields.io/npm/v/typedoc-plugin-frontmatter%2Fnext?&logo=npm) [![Build Status](https://github.com/tgreyuk/typedoc-plugin-markdown/actions/workflows/ci.yml/badge.svg?branch=next)](https://github.com/tgreyuk/typedoc-plugin-markdown/actions/workflows/ci.yml)

@@ -15,6 +15,2 @@ A plugin for TypeDoc that prepends configurable frontmatter to page content.

Please visit https://typedoc-plugin-markdown.org/utilities/frontmatter.
## License
Released under the [MIT License](./LICENSE).
Please visit [typedoc-plugin-markdown.org](https://typedoc-plugin-markdown.org/utilities/frontmatter/introduction) for comprehensive documentation, including options and usage guides.