New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

typedoc-plugin-markdown

Package Overview
Dependencies
Maintainers
1
Versions
252
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typedoc-plugin-markdown - npm Package Compare versions

Comparing version 2.1.9 to 2.1.10

dist/comments.plugin.js

12

dist/index.js

@@ -45,15 +45,3 @@ "use strict";

});
app.options.addDeclaration({
component: 'markdown',
help: 'Markdown Plugin: Deprectated - use --platform.',
name: 'mdEngine',
type: declaration_1.ParameterType.String,
});
app.options.addDeclaration({
component: 'markdown',
help: 'Markdown Plugin: Deprectated - use --hideSources.',
name: 'mdHideSources',
type: declaration_1.ParameterType.Boolean,
});
app.converter.addComponent('markdown', new plugin_1.MarkdownPlugin(app.converter));
};

29

dist/plugin.js

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

const path = require("path");
const typedoc_1 = require("typedoc");
const converter_1 = require("typedoc/dist/lib/converter");

@@ -27,4 +26,2 @@ const components_1 = require("typedoc/dist/lib/converter/components");

this.listenTo(this.application.renderer, {
[events_1.PageEvent.BEGIN]: this.onPageBegin,
[events_1.PageEvent.END]: this.onPageEnd,
[events_1.RendererEvent.BEGIN]: this.onRenderBegin,

@@ -34,3 +31,2 @@ });

onBegin() {
MarkdownPlugin_1.application = this.application;
MarkdownPlugin_1.settings = this.application.options.getRawValues();

@@ -44,25 +40,8 @@ MarkdownPlugin_1.setTheme(this.application.renderer, this.application.options);

}
onPageBegin(page) {
if (MarkdownPlugin_1.theme) {
MarkdownPlugin_1.reflection = page.model instanceof typedoc_1.DeclarationReflection ? page.model : undefined;
MarkdownPlugin_1.location = page.model.url ? page.model.url : '';
}
}
onPageEnd(page) {
if (MarkdownPlugin_1.theme) {
page.contents = page.contents ? MarkdownPlugin_1.formatContents(page.contents) : '';
}
}
static setTheme(renderer, options) {
const themeName = options.getValue('theme');
const themePath = path.join(__dirname, './theme/');
const media = options.getValue('media');
const platform = options.getValue('platform') || options.getValue('mdEngine');
const platform = options.getValue('platform');
const theme = themeName === 'markdown' ? this.getTheme(platform, renderer, themePath, options) : null;
if (theme) {
if (media &&
(theme instanceof theme_docusaurus_1.DocusaurusTheme || theme instanceof theme_gitbook_1.GitbookTheme || theme instanceof theme_vuepress_1.VuePressTheme)) {
MarkdownPlugin_1.application.logger.warn(`[typedoc-markdown-plugin] media option is currently not supported in ${platform} theme`);
options.setValue('media', null);
}
renderer.theme = renderer.addComponent('theme', theme);

@@ -89,8 +68,2 @@ MarkdownPlugin_1.theme = theme;

}
static formatContents(contents) {
return contents
.replace(/[\r\n]{3,}/g, '\n\n')
.replace(/!spaces/g, '')
.trim();
}
};

@@ -97,0 +70,0 @@ MarkdownPlugin = MarkdownPlugin_1 = __decorate([

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Handlebars = require("handlebars");
const plugin_1 = require("../../plugin");
const theme_gitbook_1 = require("../theme.gitbook");
const theme_vuepress_1 = require("../theme.vuepress");
const relative_url_1 = require("./relative-url");
function breadcrumbs() {

@@ -18,3 +18,3 @@ if (!isVisible()) {

if (model.url) {
md.push(`[${model.name}](${relative_url_1.relativeUrl(model.url)})`);
md.push(`[${model.name}](${Handlebars.helpers.relativeURL.call(this, model.url)})`);
}

@@ -26,3 +26,3 @@ else {

else {
md.push(`[Globals](${relative_url_1.relativeUrl(project.url)})`);
md.push(`[Globals](${Handlebars.helpers.relativeURL.call(this, project.url)})`);
}

@@ -29,0 +29,0 @@ return md.join(' › ');

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const comment_1 = require("./comment");
const Handlebars = require("handlebars");
function commentTags() {
const md = ['\n'];
this.forEach(tag => {
md.push(`**\`${tag.tagName}\`** ${tag.text ? comment_1.comment.call(tag.text) : ''}`);
md.push(`**\`${tag.tagName}\`** ${tag.text ? Handlebars.helpers.comment.call(tag.text) : ''}`);
});

@@ -9,0 +9,0 @@ return md.join('\n\n');

@@ -5,3 +5,3 @@ "use strict";

function ifDisplaySourceFiles(options) {
if (!this.sources || plugin_1.MarkdownPlugin.settings.hideSources || plugin_1.MarkdownPlugin.settings.mdHideSources) {
if (!this.sources || plugin_1.MarkdownPlugin.settings.hideSources) {
return options.inverse(this);

@@ -8,0 +8,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Handlebars = require("handlebars");
const plugin_1 = require("../../plugin");
const theme_docusaurus_1 = require("../theme.docusaurus");
const comment_1 = require("./comment");
const strip_line_breaks_1 = require("./strip-line-breaks");

@@ -35,6 +35,6 @@ const type_1 = require("./type");

if (parameter.comment && parameter.comment.shortText) {
commentsText.push(comment_1.comment.call(strip_line_breaks_1.stripLineBreaks.call(parameter.comment.shortText)));
commentsText.push(Handlebars.helpers.comment.call(strip_line_breaks_1.stripLineBreaks.call(parameter.comment.shortText)));
}
if (parameter.comment && parameter.comment.text) {
commentsText.push(comment_1.comment.call(strip_line_breaks_1.stripLineBreaks.call(parameter.comment.text)));
commentsText.push(Handlebars.helpers.comment.call(strip_line_breaks_1.stripLineBreaks.call(parameter.comment.text)));
}

@@ -41,0 +41,0 @@ row.push(commentsText.length > 0 ? commentsText.join(' ') : '-');

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Handlebars = require("handlebars");
const plugin_1 = require("../../plugin");

@@ -7,3 +8,2 @@ const theme_docusaurus_1 = require("../theme.docusaurus");

const theme_vuepress_1 = require("../theme.vuepress");
const relative_url_1 = require("./relative-url");
function projectTitle() {

@@ -13,3 +13,3 @@ if (!isVisible()) {

}
return `**[${this.project.name}](${relative_url_1.relativeUrl(plugin_1.MarkdownPlugin.theme.indexName)})**`;
return `**[${this.project.name}](${Handlebars.helpers.relativeURL.call(this, plugin_1.MarkdownPlugin.theme.indexName)})**`;
}

@@ -16,0 +16,0 @@ exports.projectTitle = projectTitle;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Handlebars = require("handlebars");
const typedoc_1 = require("typedoc");
const types_1 = require("typedoc/dist/lib/models/types");
const relative_url_1 = require("./relative-url");
function typeAndParent() {

@@ -11,3 +11,3 @@ if (this instanceof types_1.ReferenceType && this.reflection) {

if (this.reflection.parent.parent.url) {
md.push(`[${this.reflection.parent.parent.name}](${relative_url_1.relativeUrl(this.reflection.parent.parent.url)})`);
md.push(`[${this.reflection.parent.parent.name}](${Handlebars.helpers.relativeURL.call(this, this.reflection.parent.parent.url)})`);
}

@@ -20,3 +20,3 @@ else {

if (this.reflection.parent.url) {
md.push(`[${this.reflection.parent.name}](${relative_url_1.relativeUrl(this.reflection.parent.url)})`);
md.push(`[${this.reflection.parent.name}](${Handlebars.helpers.relativeURL.call(this, this.reflection.parent.url)})`);
}

@@ -27,3 +27,3 @@ else {

if (this.reflection.url) {
md.push(`[${this.reflection.name}](${relative_url_1.relativeUrl(this.reflection.url)})`);
md.push(`[${this.reflection.name}](${Handlebars.helpers.relativeURL.call(this, this.reflection.url)})`);
}

@@ -30,0 +30,0 @@ else {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Handlebars = require("handlebars");
const types_1 = require("typedoc/dist/lib/models/types");
const relative_url_1 = require("./relative-url");
function type() {

@@ -35,3 +35,3 @@ if (this instanceof types_1.ReferenceType && (this.reflection || (this.name && this.typeArguments))) {

const reflection = model.reflection
? [`[${model.reflection.name}](${relative_url_1.relativeUrl(model.reflection.url)})`]
? [`[${model.reflection.name}](${Handlebars.helpers.relativeURL.call(this, model.reflection.url)})`]
: [model.name];

@@ -38,0 +38,0 @@ if (model.typeArguments) {

@@ -6,11 +6,12 @@ "use strict";

const reflections_1 = require("typedoc/dist/lib/models/reflections");
const events_1 = require("typedoc/dist/lib/output/events");
const UrlMapping_1 = require("typedoc/dist/lib/output/models/UrlMapping");
const theme_1 = require("typedoc/dist/lib/output/theme");
const DefaultTheme_1 = require("typedoc/dist/lib/output/themes/DefaultTheme");
const comments_plugin_1 = require("../comments.plugin");
const front_matter_plugin_1 = require("../front-matter.plugin");
class MarkdownTheme extends theme_1.Theme {
constructor(renderer, basePath, options) {
super(renderer, basePath);
this.navigationTitlesMap = {};
this.hasGlobalsFile = false;
renderer.removeComponent('navigation');
this.listenTo(renderer, events_1.PageEvent.END, this.onPageEnd, 1024);
renderer.removeComponent('assets');

@@ -20,2 +21,7 @@ renderer.removeComponent('javascript-index');

renderer.removeComponent('pretty-print');
renderer.addComponent('comments', new comments_plugin_1.CommentsPlugin(renderer));
if (this.application.options.getValue('platform') === 'docusaurus' ||
this.application.options.getValue('platform') === 'vuepress') {
renderer.addComponent('frontmatter', new front_matter_plugin_1.FrontMatterPlugin(renderer));
}
}

@@ -55,3 +61,2 @@ isOutputDirectory(outputDirectory) {

urls.push(new UrlMapping_1.UrlMapping(this.indexName, entryPoint, 'index.hbs'));
this.hasGlobalsFile = true;
}

@@ -70,9 +75,2 @@ else {

this.navigation = this.getNavigation(project);
if (this.navigation.children) {
this.navigation.children.forEach(navItem => {
navItem.children.forEach(navItemChild => {
this.navigationTitlesMap[navItemChild.url] = navItemChild.title;
});
});
}
return urls;

@@ -252,3 +250,12 @@ }

}
onPageEnd(page) {
page.contents = page.contents ? MarkdownTheme.formatContents(page.contents) : '';
}
static formatContents(contents) {
return contents
.replace(/[\r\n]{3,}/g, '\n\n')
.replace(/!spaces/g, '')
.replace(/^\s+|\s+$/g, '');
}
}
exports.MarkdownTheme = MarkdownTheme;
{
"name": "typedoc-plugin-markdown",
"version": "2.1.9",
"version": "2.1.10",
"description": "A plugin for TypeDoc that enables TypeScript API documentation to be generated in Markdown.",

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

"copyfiles": "^2.1.1",
"cross-spawn": "^6.0.5",
"cross-spawn": "^7.0.0",
"jest": "^24.9.0",

@@ -50,0 +50,0 @@ "prettier": "^1.18.2",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc