@tinymce/moxiedoc
Advanced tools
Comparing version 0.3.0-feature.20220822040129921.sha302e003 to 0.3.0-feature.20220823030451710.shad46d220
@@ -12,3 +12,3 @@ # Changelog | ||
### Added | ||
- New `structure` option with default `flat` file structure or `legacy` nested folders. | ||
- New `structure` option for specifying `legacy` nested structure for antora docs, or `default` file structure. | ||
@@ -15,0 +15,0 @@ ## 0.2.1 - 2022-04-29 |
@@ -13,3 +13,3 @@ #! /usr/bin/env node | ||
.option('-t, --template <template>', 'template name, default: cli') | ||
.option('-s, --structure <type>', 'output file structure') | ||
.option('-s, --structure <type>', 'output file structure, default: default') | ||
.option('-v, --verbose', 'verbose output') | ||
@@ -16,0 +16,0 @@ .option('--debug', 'debug output') |
@@ -160,8 +160,6 @@ "use strict"; | ||
if (structure === 'legacy') { | ||
Util.generateIndexPages(indexPage, sortedTypes, memberTemplate, structure) | ||
Util.generateLegacyIndexPages(indexPage, sortedTypes, memberTemplate, structure) | ||
.forEach((pageOutput) => navPages.push(pageOutput)); | ||
} | ||
navPages.forEach((page) => { | ||
addPage(page); | ||
}); | ||
navPages.forEach(addPage); | ||
// create all json and adoc for each item | ||
@@ -168,0 +166,0 @@ const pages = sortedTypes.map(getMemberPages.bind(null, root, memberTemplate, structure)); |
@@ -9,3 +9,3 @@ import { ExportStructure } from '../../lib/exporter'; | ||
export interface PageOutput { | ||
readonly type: 'adoc' | 'json' | 'yml'; | ||
readonly type: 'adoc' | 'json'; | ||
readonly filename: string; | ||
@@ -26,4 +26,4 @@ readonly content: string; | ||
declare const generateNavPages: (indexPage: NavFile, structure: ExportStructure) => PageOutput[]; | ||
declare const generateIndexPages: (indexPage: NavFile, sortedTypes: Type[], memberTemplate: HandlebarsTemplateDelegate, structure: ExportStructure) => PageOutput[]; | ||
export { compileTemplate, getNavFile, generateNavPages, generateIndexPages, getFilePath, getJsonFilePath, generateXref, generateTypeXref }; | ||
declare const generateLegacyIndexPages: (indexPage: NavFile, sortedTypes: Type[], memberTemplate: HandlebarsTemplateDelegate, structure: ExportStructure) => PageOutput[]; | ||
export { compileTemplate, getNavFile, generateNavPages, generateLegacyIndexPages, getFilePath, getJsonFilePath, generateXref, generateTypeXref }; | ||
//# sourceMappingURL=util.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.generateTypeXref = exports.generateXref = exports.getJsonFilePath = exports.getFilePath = exports.generateIndexPages = exports.generateNavPages = exports.getNavFile = exports.compileTemplate = void 0; | ||
exports.generateTypeXref = exports.generateXref = exports.getJsonFilePath = exports.getFilePath = exports.generateLegacyIndexPages = exports.generateNavPages = exports.getNavFile = exports.compileTemplate = void 0; | ||
const fs = require("fs"); | ||
@@ -47,3 +47,3 @@ const Handlebars = require("handlebars"); | ||
exports.generateTypeXref = generateTypeXref; | ||
const getJsonFilePath = (type, fullName) => (BASE_PATH + '/api/json/' + type + '_' + fullName.replace(/\./g, '_') + '.json').toLowerCase(); | ||
const getJsonFilePath = (type, fullName) => ('_data/api/json/' + type + '_' + fullName.replace(/\./g, '_') + '.json').toLowerCase(); | ||
exports.getJsonFilePath = getJsonFilePath; | ||
@@ -184,3 +184,3 @@ const getFilePath = (name, structure) => { | ||
}; | ||
const generateIndexPages = (indexPage, sortedTypes, memberTemplate, structure) => { | ||
const generateLegacyIndexPages = (indexPage, sortedTypes, memberTemplate, structure) => { | ||
const newNavPages = []; | ||
@@ -195,3 +195,3 @@ const descriptions = getDescriptionsFromTypes(sortedTypes); | ||
}; | ||
exports.generateIndexPages = generateIndexPages; | ||
exports.generateLegacyIndexPages = generateLegacyIndexPages; | ||
//# sourceMappingURL=util.js.map |
{ | ||
"name": "@tinymce/moxiedoc", | ||
"version": "0.3.0-feature.20220822040129921.sha302e003", | ||
"version": "0.3.0-feature.20220823030451710.shad46d220", | ||
"description": "A tool for generating API documentation", | ||
@@ -5,0 +5,0 @@ "author": "Tiny Technologies, Inc", |
@@ -23,3 +23,3 @@ # moxiedoc | ||
-t --template <template>: documentation type: default: 'cli'; 'antora', 'github', 'moxiewiki', 'singlehtml', 'tinymcenext', 'xml' | ||
-s --structure <type>: default: 'flat', 'legacy' | ||
-s --structure <type>: default: 'default'; 'legacy' | ||
-v --verbose: verbose output | ||
@@ -26,0 +26,0 @@ --debug: debug output |
@@ -15,3 +15,3 @@ #! /usr/bin/env node | ||
.option('-t, --template <template>', 'template name, default: cli') | ||
.option('-s, --structure <type>', 'output file structure') | ||
.option('-s, --structure <type>', 'output file structure, default: default') | ||
.option('-v, --verbose', 'verbose output') | ||
@@ -18,0 +18,0 @@ .option('--debug', 'debug output') |
@@ -186,9 +186,7 @@ import { ZipWriter } from 'moxie-zip'; | ||
if (structure === 'legacy') { | ||
Util.generateIndexPages(indexPage, sortedTypes, memberTemplate, structure) | ||
Util.generateLegacyIndexPages(indexPage, sortedTypes, memberTemplate, structure) | ||
.forEach((pageOutput) => navPages.push(pageOutput)); | ||
} | ||
navPages.forEach((page) => { | ||
addPage(page); | ||
}); | ||
navPages.forEach(addPage); | ||
@@ -195,0 +193,0 @@ // create all json and adoc for each item |
@@ -16,3 +16,3 @@ import * as fs from 'fs'; | ||
export interface PageOutput { | ||
readonly type: 'adoc' | 'json' | 'yml'; | ||
readonly type: 'adoc' | 'json'; | ||
readonly filename: string; | ||
@@ -77,3 +77,3 @@ readonly content: string; | ||
const getJsonFilePath = (type: string, fullName: string): string => | ||
(BASE_PATH + '/api/json/' + type + '_' + fullName.replace(/\./g, '_') + '.json').toLowerCase(); | ||
('_data/api/json/' + type + '_' + fullName.replace(/\./g, '_') + '.json').toLowerCase(); | ||
@@ -232,3 +232,4 @@ const getFilePath = (name: string, structure: ExportStructure): string => { | ||
const generateIndexPages = (indexPage: NavFile, sortedTypes: Type[], memberTemplate: HandlebarsTemplateDelegate, structure: ExportStructure): PageOutput[] => { | ||
const generateLegacyIndexPages = | ||
(indexPage: NavFile, sortedTypes: Type[], memberTemplate: HandlebarsTemplateDelegate, structure: ExportStructure): PageOutput[] => { | ||
const newNavPages = [] as PageOutput[]; | ||
@@ -250,3 +251,3 @@ const descriptions = getDescriptionsFromTypes(sortedTypes); | ||
generateNavPages, | ||
generateIndexPages, | ||
generateLegacyIndexPages, | ||
getFilePath, | ||
@@ -253,0 +254,0 @@ getJsonFilePath, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
366058
6927