typedoc-plugin-markdown
Advanced tools
Comparing version 4.0.0-next.37 to 4.0.0-next.38
@@ -12,3 +12,3 @@ "use strict"; | ||
const isPackages = context.options.getValue('entryPointStrategy') === | ||
typedoc_1.EntryPointStrategy.Packages && !Boolean(page.project.groups); | ||
typedoc_1.EntryPointStrategy.Packages; | ||
if (isPackages) { | ||
@@ -15,0 +15,0 @@ const packageItem = findPackage(page.model); |
@@ -20,2 +20,3 @@ import { DeclarationReflection, Options, ProjectReflection, Renderer } from 'typedoc'; | ||
getUrls(): UrlMapping[]; | ||
private buildUrlsFromPackage; | ||
/** | ||
@@ -22,0 +23,0 @@ * |
@@ -49,3 +49,3 @@ "use strict"; | ||
getUrls() { | ||
var _a, _b, _c, _d; | ||
var _a, _b, _c, _d, _e; | ||
const preserveReadme = Boolean(this.project.readme) && !this.options.getValue('mergeReadme'); | ||
@@ -72,16 +72,10 @@ const preserveModulesPage = (((_a = this.project) === null || _a === void 0 ? void 0 : _a.groups) && | ||
if (isPackages) { | ||
(_d = this.project.children) === null || _d === void 0 ? void 0 : _d.forEach((projectChild) => { | ||
const preservePackageReadme = Boolean(projectChild.readme) && !this.options.getValue('mergeReadme'); | ||
const packagesIndex = (0, helpers_1.getIndexFileName)(projectChild); | ||
const packageMeta = this.renderer.packages[projectChild.name]; | ||
const outputFileStrategy = packageMeta.outputFileStrategy || | ||
this.options.getValue('outputFileStrategy'); | ||
const url = `${projectChild.name}/${preservePackageReadme ? packagesIndex : entryFileName}`; | ||
if (preservePackageReadme) { | ||
this.urls.push(new url_mapping_1.UrlMapping(`${path.dirname(url)}/${entryFileName}`, projectChild, this.theme.readmeTemplate)); | ||
} | ||
this.urls.push(new url_mapping_1.UrlMapping(url, projectChild, this.theme.projectTemplate)); | ||
projectChild.url = url; | ||
this.buildUrlsFromProject(projectChild, url, outputFileStrategy); | ||
}); | ||
if (((_d = Object.keys(this.renderer.packages)) === null || _d === void 0 ? void 0 : _d.length) === 1) { | ||
this.buildUrlsFromProject(this.project); | ||
} | ||
else { | ||
(_e = this.project.children) === null || _e === void 0 ? void 0 : _e.forEach((projectChild) => { | ||
this.buildUrlsFromPackage(projectChild); | ||
}); | ||
} | ||
} | ||
@@ -93,2 +87,17 @@ else { | ||
} | ||
buildUrlsFromPackage(projectChild) { | ||
const entryFileName = this.options.getValue('entryFileName'); | ||
const preservePackageReadme = Boolean(projectChild.readme) && !this.options.getValue('mergeReadme'); | ||
const packagesIndex = (0, helpers_1.getIndexFileName)(projectChild); | ||
const packageMeta = this.renderer.packages[projectChild.name]; | ||
const outputFileStrategy = (packageMeta === null || packageMeta === void 0 ? void 0 : packageMeta.outputFileStrategy) || | ||
this.options.getValue('outputFileStrategy'); | ||
const url = `${projectChild.name}/${preservePackageReadme ? packagesIndex : entryFileName}`; | ||
if (preservePackageReadme) { | ||
this.urls.push(new url_mapping_1.UrlMapping(`${path.dirname(url)}/${entryFileName}`, projectChild, this.theme.readmeTemplate)); | ||
} | ||
this.urls.push(new url_mapping_1.UrlMapping(url, projectChild, this.theme.projectTemplate)); | ||
projectChild.url = url; | ||
this.buildUrlsFromProject(projectChild, url, outputFileStrategy); | ||
} | ||
/** | ||
@@ -146,3 +155,3 @@ * | ||
reflection.name === 'index') { | ||
return `module.index.md`; | ||
return urlPath.replace('index.md', 'module.index.md'); | ||
} | ||
@@ -149,0 +158,0 @@ return urlPath; |
{ | ||
"name": "typedoc-plugin-markdown", | ||
"version": "4.0.0-next.37", | ||
"version": "4.0.0-next.38", | ||
"description": "A plugin for TypeDoc that enables TypeScript API documentation to be generated in Markdown.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
208440
4852