From 1c62dfae70ba3c93676968c62f5f3e37f3769dca Mon Sep 17 00:00:00 2001 From: Lloyd Brookes Date: Mon, 26 Aug 2024 19:13:15 +0100 Subject: [PATCH] Cache all internal handlebars content in a single file - speeds up plus helps avoid issues like #82 --- bin/generate-partial-cache.js | 22 +++ index.js | 7 +- package-lock.json | 8 +- package.json | 2 +- partials/partial-cache.js | 262 ++++++++++++++++++++++++++++++++++ 5 files changed, 294 insertions(+), 7 deletions(-) create mode 100644 bin/generate-partial-cache.js create mode 100644 partials/partial-cache.js diff --git a/bin/generate-partial-cache.js b/bin/generate-partial-cache.js new file mode 100644 index 0000000..952169c --- /dev/null +++ b/bin/generate-partial-cache.js @@ -0,0 +1,22 @@ +const FileSet = require('file-set') +const fs = require('fs') +const path = require('path') + +const fileSet = new FileSet() + +async function start () { + await fileSet.add('./partials/**/*.hbs') + const map = new Map() + for (const file of fileSet.files) { + map.set( + path.basename(file, '.hbs'), + fs.readFileSync(file, 'utf8') || '' + ) + } + console.log('module.exports = ' + JSON.stringify(Array.from(map), null, ' ')) +} +start() + +/* +node bin/generate-partial-cache.js > partials/partial-cache.js +*/ diff --git a/index.js b/index.js index 3a7909e..7c7b85c 100644 --- a/index.js +++ b/index.js @@ -4,6 +4,7 @@ const DmdOptions = require('./lib/dmd-options') const dmdVersion = require('./package').version const FileSet = require('file-set') const os = require('os') +const partialCache = require('./partials/partial-cache.js') /** * Transforms doclet data into markdown documentation. @@ -77,8 +78,10 @@ async function generate (templateData, options) { state.templateData = templateData state.options = options - /* register all dmd partials. */ - await registerPartials(path.resolve(__dirname, 'partials', '**', '*.hbs')) + /* register all internal dmd partials. */ + for (const [name, content] of partialCache) { + handlebars.registerPartial(name, content) + } /* if plugins were specified, register the helpers/partials from them too */ if (options.plugin) { diff --git a/package-lock.json b/package-lock.json index c893e1f..093b1c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "common-sequence": "^2.0.2", "file-set": "^6.0.1", "handlebars": "^4.7.8", - "marked": "^14.0.0", + "marked": "^14.1.0", "object-get": "^2.1.1", "reduce-flatten": "^3.0.1", "reduce-unique": "^2.0.1", @@ -310,9 +310,9 @@ } }, "node_modules/marked": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-14.0.0.tgz", - "integrity": "sha512-uIj4+faQ+MgHgwUW1l2PsPglZLOLOT1uErt06dAPtx2kjteLAkbsd/0FiYg/MGS+i7ZKLb7w2WClxHkzOOuryQ==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-14.1.0.tgz", + "integrity": "sha512-P93GikH/Pde0hM5TAXEd8I4JAYi8IB03n8qzW8Bh1BIEFpEyBoYxi/XWZA53LSpTeLBiMQOoSMj0u5E/tiVYTA==", "license": "MIT", "bin": { "marked": "bin/marked.js" diff --git a/package.json b/package.json index ce7491d..aace38e 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "common-sequence": "^2.0.2", "file-set": "^6.0.1", "handlebars": "^4.7.8", - "marked": "^14.0.0", + "marked": "^14.1.0", "object-get": "^2.1.1", "reduce-flatten": "^3.0.1", "reduce-unique": "^2.0.1", diff --git a/partials/partial-cache.js b/partials/partial-cache.js new file mode 100644 index 0000000..fcfe835 --- /dev/null +++ b/partials/partial-cache.js @@ -0,0 +1,262 @@ +module.exports = [ + [ + 'main', + '{{>main-index~}}\n{{>all-docs~}}\n' + ], + [ + 'separator', + '{{#if (option "separators")}}\n\n* * *\n\n{{/if~}}' + ], + [ + 'index-indent', + '{{string-repeat " " (indexDepth)}}' + ], + [ + 'heading-indent', + '{{string-repeat "#" (headingDepth)}} ' + ], + [ + 'main-index', + '{{! a main index is only shown if at least 2 global or modules exist ~}}\n\n{{#if (showMainIndex)~}}\n{{>module-index~}}\n{{>global-index~}}\n{{/if~}}\n' + ], + [ + 'all-docs', + '{{#orphans ~}}\n{{>docs~}}\n{{/orphans~}}\n' + ], + [ + 'linked-type-list', + '{{#each types~}}\n{{>link to=this html=../html ~}}\n{{#unless @last}}{{{../delimiter}}}{{/unless~}}\n{{/each}}' + ], + [ + 'link', + '{{! usage: link to="namepath" html=true/false caption="optional caption"~}}\n\n{{~#if html~}}\n\n\n{{~#link to~}}\n{{#if url~}}\n{{#if ../../caption}}{{../../../caption}}{{else}}{{name}}{{/if}}\n{{~else~}}\n{{#if ../../caption}}{{../../../caption}}{{else}}{{name}}{{/if~}}\n{{/if~}}\n{{/link~}}\n\n\n{{~else~}}\n\n{{#link to~}}\n{{#if url~}}\n[{{#if ../../caption}}{{escape ../../../caption}}{{else}}{{escape name}}{{/if}}]({{{url}}})\n{{~else~}}\n{{#if ../../caption}}{{escape ../../../caption}}{{else}}{{escape name}}{{/if~}}\n{{~/if~}}\n{{/link~}}\n\n{{/if~}}\n' + ], + [ + 'defaultvalue', + '{{#unless (equal defaultvalue undefined)}}{{#if equals}} = {{/if}}{{#if (equal type.names.[0] "string")}}{{json-stringify defaultvalue}}{{else}}{{defaultvalue}}{{/if}}{{/unless}}' + ], + [ + 'sig-name', + '{{#if virtual}}*{{/if}}{{#with (parentObject)}}{{#if virtual}}*{{/if~}}{{/with~}}\n{{#if name}}{{#sig~}}\n{{{@depOpen}~}}\n{{{@codeOpen}~}}\n{{#if @prefix}}{{@prefix}} {{/if~}}\n{{@parent~}}\n{{@accessSymbol}}{{#if (isEvent)}}"{{{name}}}"{{else}}{{{escape name}}}{{/if~}}\n{{#if @methodSign}}{{#if (isEvent)}} {{@methodSign}}{{else}}{{@methodSign}}{{/if}}{{/if~}}\n{{{@codeClose}~}}\n{{#if @returnSymbol}} {{@returnSymbol}}{{/if~}}\n{{#if @returnTypes}} {{>linked-type-list types=@returnTypes delimiter=" \\| " }}{{/if~}}\n{{#if @suffix}} {{@suffix}}{{/if~}}\n{{{@depClose}~}}\n{{~/sig}}{{/if~}}\n{{#if virtual}}*{{/if}}{{#with (parentObject)}}{{#if virtual}}*{{/if~}}{{/with~}}\n' + ], + [ + 'sig-link', + '{{#if virtual}}*{{/if}}{{#with (parentObject)}}{{#if virtual}}*{{/if~}}{{/with~}}\n{{#if name}}{{#sig~}}\n{{{@depOpen}~}}\n[{{{@codeOpen}~}}\n{{#if @prefix}}{{@prefix}} {{/if~}}\n{{@accessSymbol}}{{#if (isEvent)}}"{{{name}}}"{{else}}{{{name}}}{{/if~}}\n{{~#if @methodSign}}{{#if (isEvent)}} {{@methodSign}}{{else}}{{@methodSign}}{{/if}}{{/if~}}\n{{{@codeClose}}}](#{{{anchorName}}})\n{{~#if @returnSymbol}} {{@returnSymbol}}{{/if~}}\n{{#if @returnTypes}} {{>linked-type-list types=@returnTypes delimiter=" \\| " }}{{/if~}}\n{{#if @suffix}} {{@suffix}}{{/if~}}\n{{{@depClose}~}}\n{{~/sig}}{{/if~}}\n{{#if virtual}}*{{/if}}{{#with (parentObject)}}{{#if virtual}}*{{/if~}}{{/with~}}\n' + ], + [ + 'sig-link-parent', + '{{#if name}}{{#sig~}}\n{{{@depOpen}~}}\n[{{{@codeOpen}~}}\n{{#if @prefix}}{{@prefix}} {{/if~}}\n{{#if (isClassMember)}}{{@parent~}}{{/if~}}\n{{@accessSymbol}}{{#if (isEvent)}}"{{{name}}}"{{else}}{{{name}}}{{/if~}}\n{{~#if @methodSign}}{{#if (isEvent)}} {{@methodSign}}{{else}}{{@methodSign}}{{/if}}{{/if~}}\n{{{@codeClose}}}](#{{{anchorName}}})\n{{~#if @returnSymbol}} {{@returnSymbol}}{{/if~}}\n{{#if @returnTypes}} {{>linked-type-list types=@returnTypes delimiter=" \\| " }}{{/if~}}\n{{#if @suffix}} {{@suffix}}{{/if~}}\n{{{@depClose}~}}\n{{~/sig}}{{/if~}}\n' + ], + [ + 'sig-link-html', + '{{#if name}}{{#sig no-gfm=true ~}}\n{{{@depOpen}~}}\n\n{{~{@codeOpen}~}}\n{{#if @prefix}}{{@prefix}} {{/if~}}\n{{@accessSymbol}}{{#if (isEvent)}}"{{{name}}}"{{else}}{{{name}}}{{/if~}}\n{{~#if @methodSign}}{{#if (isEvent)}} {{@methodSign}}{{else}}{{@methodSign}}{{/if}}{{/if~}}\n{{{@codeClose}~}}\n\n{{~#if @returnSymbol}} {{@returnSymbol}}{{/if~}}\n{{#if @returnTypes}} {{>linked-type-list types=@returnTypes html=true delimiter=" | " }}{{/if~}}\n{{#if @suffix}} {{@suffix}}{{/if~}}\n{{{@depClose}~}}\n{{~/sig}}{{/if~}}\n' + ], + [ + 'module-index', + '{{#unless (optionEquals "module-index-format" "none")~}}\n{{#if (optionEquals "module-index-format" "dl")}}{{>module-index-dl ~}}{{/if~}}\n{{#if (optionEquals "module-index-format" "grouped")}}{{>module-index-grouped ~}}{{/if~}}\n{{#if (optionEquals "module-index-format" "table")}}{{>module-index-table ~}}{{/if~}}\n{{/unless~}}\n' + ], + [ + 'module-index-table', + '{{#modules~}}\n{{#if @first~}}\n{{>heading-indent}}Modules\n\n\n \n \n \n \n \n \n{{/if~}}\n \n \n \n \n{{#if @last~}}\n \n
ModuleDescription
{{>sig-link-html}}{{{md (inlineLinks description)}}}
\n\n{{/if~}}\n{{/modules}}\n' + ], + [ + 'module-index-grouped', + '{{#modules~}}\n{{#if @first~}}{{>heading-indent}}Modules\n\n{{/if~}}\n{{>member-index-grouped~}}\n{{/modules}}\n\n' + ], + [ + 'module-index-dl', + '{{#modules~}}\n{{#if @first~}}{{>heading-indent}}Modules\n\n
\n{{/if~}}\n
{{>sig-link-html}}
\n
{{{md (inlineLinks description)}}}
\n{{#if @last~}}
\n\n{{/if~}}\n{{/modules~}}\n' + ], + [ + 'global-index', + '{{>global-index-kinds kind="class" title="Classes" ~}}\n{{>global-index-kinds kind="mixin" title="Mixins" ~}}\n{{>global-index-kinds kind="member" title="Members" ~}}\n{{>global-index-kinds kind="namespace" title="Objects" ~}}\n{{>global-index-kinds kind="constant" title="Constants" ~}}\n{{>global-index-kinds kind="function" title="Functions" ~}}\n{{>global-index-kinds kind="event" title="Events" ~}}\n{{>global-index-kinds kind="typedef" title="Typedefs" ~}}\n{{>global-index-kinds kind="external" title="External" ~}}\n{{>global-index-kinds kind="interface" title="Interfaces" ~}}\n' + ], + [ + 'global-index-table', + '{{#globals kind=kind~}}\n{{#if @first~}}\n{{>heading-indent}}{{../title}}\n\n\n \n \n \n \n \n \n{{/if~}}\n \n \n \n \n{{#if @last~}}\n \n
GlobalDescription
{{>sig-link-html}}{{{md (inlineLinks description)}}}
\n\n{{/if~}}\n{{/globals}}\n' + ], + [ + 'global-index-kinds', + '{{#unless (optionEquals "global-index-format" "none")~}}\n{{#if (optionEquals "global-index-format" "dl")}}\n{{>global-index-dl kind=kind title=title ~}}\n{{/if~}}\n{{#if (optionEquals "global-index-format" "grouped")}}\n{{>global-index-grouped kind=kind title=title }}\n{{/if~}}\n{{#if (optionEquals "global-index-format" "table")}}\n{{>global-index-table kind=kind title=title ~}}\n{{/if~}}\n{{/unless~}}\n' + ], + [ + 'global-index-grouped', + '{{#globals kind=kind~}}\n{{#if @first~}}{{>heading-indent}}{{../title}}\n\n{{/if~}}\n{{>member-index-grouped~}}\n{{#if @last}}\n\n{{/if~}}\n{{/globals}}\n' + ], + [ + 'global-index-dl', + '{{#globals kind=kind ~}}\n{{#if @first~}}{{>heading-indent}}{{../title}}\n\n
\n{{/if~}}\n
{{>sig-link-html}}
\n
{{{md (inlineLinks description)}}}
\n{{#if @last~}}
\n\n{{/if~}}\n{{/globals~}}\n' + ], + [ + 'members', + '{{#children inherited=undefined ~}}\n{{>docs~}}\n{{/children~}}\n' + ], + [ + 'header', + '\n\n{{>heading-indent}}{{>sig-name}}\n' + ], + [ + 'docs', + '{{>header~}}\n{{>body}}\n{{>member-index~}}\n{{>separator~}}\n{{>members~}}\n' + ], + [ + 'member-index', + "{{setLevel this 0~}}\n{{#if (descendants min=(option 'memberIndex.minDescendants'))~}}\n{{#if isExported~}}\n{{#if (equal (depth) 0)}}\n{{#if (optionEquals \"member-index-format\" \"list\")}}\n\n{{>member-index-list}}\n\n{{else~}}\n\n{{>member-index-grouped}}\n\n{{/if~}}\n{{/if~}}\n{{else~}}\n{{#if (optionEquals \"member-index-format\" \"list\")}}\n\n{{>member-index-list}}\n\n{{else}}\n\n{{>member-index-grouped}}\n\n{{/if~}}\n{{/if~}}\n{{/if}}\n" + ], + [ + 'member-index-list', + '{{>index-indent}}* {{>sig-link-parent}}\n{{#indexChildren ~}}\n{{>member-index-list~}}\n{{/indexChildren}}' + ], + [ + 'member-index-grouped', + '{{string-repeat " " (add level baseLevel)}}* {{#unless (equal _title undefined)}}_{{_title}}_{{else}}{{>sig-link}}{{/unless}}\n{{#groupBy (option "group-by")~}}\n{{>member-index-grouped baseLevel=(add ../level ../baseLevel 1)~}}\n{{/groupBy~}}\n' + ], + [ + 'version', + '{{#if version}}**Version**: {{inlineLinks version}} \n{{/if~}}' + ], + [ + 'todo', + '{{#if todoList~}}\n**Todo**\n\n{{#if (option "no-gfm")~}}\n\n{{#each todoList~}}\n{{#if done}}- {{{inlineLinks task}}} ✓\n{{else}}- {{{inlineLinks task}}}\n{{/if~}}\n{{/each~}}\n\n{{else~}}\n\n{{#each todoList~}}\n{{#if done}}- [x] {{{inlineLinks task}}}\n{{else}}- [ ] {{{inlineLinks task}}}\n{{/if~}}\n{{/each~}}\n\n{{/if}}\n\n{{/if~}}\n' + ], + [ + 'throws', + '{{#if exceptions~}}\n**Throws**:\n\n{{#each exceptions~}}\n- {{#if type.names}}{{>linked-type-list types=type.names}} {{/if}}{{{inlineLinks description}}}\n{{/each}}\n\n{{/if}}' + ], + [ + 'this', + '{{#if thisvalue}}**this**: {{>link to=thisvalue}} \n{{/if~}}' + ], + [ + 'summary', + '{{#if summary}}**Summary**: {{{inlineLinks summary}}} \n{{/if~}}\n' + ], + [ + 'since', + '{{#if since}}**Since**: {{{inlineLinks since}}} \n{{/if~}}' + ], + [ + 'see', + '{{#if see~}}\n\n{{#if (equal see.length 1)~}}\n**See**: {{{inlineLinks see.[0]}}} \n{{else~}}\n**See**\n\n{{#each see}}- {{{inlineLinks this}}}\n{{/each}}\n\n{{/if~}}\n{{/if~}}' + ], + [ + 'scope', + '{{#if scope}}\n**Kind**: {{#if (equal kind "event") ~}}\nevent emitted{{#if memberof}} by {{>link to=memberof}}{{/if}} \n{{else~}}\n{{scope}} {{#if virtual}}abstract {{/if}}{{kindInThisContext}}{{#if memberof}} of {{>link to=memberof}}{{/if}} \n{{/if~}}\n{{else~}}\n{{#if isExported}}**Kind**: Exported {{kind}} \n{{/if~}}\n{{/if~}}' + ], + [ + 'returns', + '{{#if returns}}\n{{#if returns.[0].description~}}\n**Returns**: {{#each returns~}}\n {{#if type~}}\n {{#if type.names}}{{>linked-type-list types=type.names delimiter=" \\| " ~}}{{/if}}\n {{~#if description}} - {{{inlineLinks description}}}{{/if~}}\n {{else~}}\n {{{inlineLinks description}~}}\n {{/if~}}\n{{~/each}}\n \n{{/if}}{{/if}}' + ], + [ + 'requires', + '{{#if requires~}}\n**Requires**: {{>linked-type-list types=requires delimiter=", " }} \n{{/if}}' + ], + [ + 'readOnly', + '{{#if readonly}}**Read only**: true \n{{/if~}}' + ], + [ + 'overrides', + '{{#if overrides}}**Overrides**: {{>link to=overrides}} \n{{/if~}}\n' + ], + [ + 'mixes', + '{{#if mixes~}}\n**Mixes**: {{>linked-type-list types=mixes delimiter=", " }} \n{{/if}}' + ], + [ + 'license', + '{{#if license}}**License**: {{inlineLinks license}} \n{{/if~}}' + ], + [ + 'implements', + '{{#if implements}}**Implements**: {{>linked-type-list types=implements delimiter=", " }} \n{{/if}}\n' + ], + [ + 'fires', + '{{#if fires~}}\n**Emits**: {{>linked-type-list types=fires delimiter=", " }} \n{{/if}}' + ], + [ + 'examples', + '{{#examples}}\n**Example**{{#if caption}} *({{caption}})* {{else}} {{/if}}\n{{{inlineLinks example}}}\n{{/examples}}\n' + ], + [ + 'description', + '{{#if description}}{{{inlineLinks description}}}\n\n{{/if}}' + ], + [ + 'deprecated', + '{{#if deprecated}}***Deprecated***\n\n{{/if~}}' + ], + [ + 'default', + '{{#unless (equal defaultvalue undefined)}}**Default**: {{>defaultvalue}} \n{{/unless}}' + ], + [ + 'customTags', + '{{#if customTags}}{{#each customTags}}**{{titleCase tag}}**: {{#with (parseType value)~}}\n{{#if type}}{{>link to=type}}{{/if}}{{#if description}}{{{inlineLinks description}}}{{/if}}{{/with}} \n{{/each}}{{/if~}}\n' + ], + [ + 'copyright', + '{{#if copyright}}**Copyright**: {{{inlineLinks copyright}}} \n{{/if~}}\n' + ], + [ + 'chainable', + '{{#if chainable}}**Chainable** \n{{/if~}}' + ], + [ + 'category', + '{{#if category}}**Category**: {{inlineLinks category}} \n{{/if~}}' + ], + [ + 'body', + '{{>deprecated~}}\n{{>description~}}\n{{>scope~}}\n{{>summary~}}\n{{>augments~}}\n{{>implements~}}\n{{>mixes~}}\n{{>default~}}\n{{>chainable~}}\n{{>overrides~}}\n{{>returns~}}\n{{>category~}}\n{{>throws~}}\n{{>fires~}}\n{{>this~}}\n{{>access~}}\n{{>readOnly~}}\n{{>requires~}}\n{{>customTags~}}\n{{>see~}}\n{{>since~}}\n{{>version~}}\n{{>authors~}}\n{{>license~}}\n{{>copyright~}}\n{{>todo~}}\n{{>params~}}\n{{>properties~}}\n{{>examples~}}\n' + ], + [ + 'authors', + '{{#if author}}{{#each author}}**Author**: {{{inlineLinks this}}} \n{{/each}}{{/if~}}\n' + ], + [ + 'augments', + '{{#if augments}}**Extends**: {{>linked-type-list types=augments delimiter=", " }} \n{{/if}}\n' + ], + [ + 'access', + '{{#if access}}**Access**: {{{access}}} \n{{/if~}}\n' + ], + [ + 'properties', + '{{#if (optionEquals "property-list-format" "list")}}{{>properties-list~}}{{/if~}}\n{{#if (optionEquals "property-list-format" "table")~}}\n {{#if (optionEquals "no-gfm" true)}}{{>properties-table-html}}{{else}}{{>properties-table}}{{/if~}}\n{{/if~}}\n' + ], + [ + 'properties-table', + '{{#if properties}}**Properties**\n\n{{tableHead properties "name|Name" "type|Type" "defaultvalue|Default" "description|Description" ~}}\n\n{{#tableRow properties "name" "type" "defaultvalue" "description" ~}}\n| {{#if @col1}}{{>param-table-name}} | {{/if~}}\n{{#if @col2}}{{>linked-type-list types=type.names delimiter=" \\| " }} | {{/if~}}\n{{#if @col3}}{{>defaultvalue}} | {{/if~}}\n{{#if @col4}}{{{stripNewlines (inlineLinks description)}}} |{{/if}}\n{{/tableRow}}\n\n{{/if}}' + ], + [ + 'properties-table-html', + '{{#if properties~}}**Properties**\n\n\n \n \n {{#each (tableHeadHtml properties "name|Name" "type|Type" "defaultvalue|Default" "description|Description")}}{{/each}}\n \n \n \n {{#tableRow properties "name" "type" "defaultvalue" "description" ~}}\n \n {{#if @col1}}{{/if~}}\n {{#if @col2}}{{/if~}}\n {{#if @col3}}{{/if~}}\n {{#if @col4}}{{/if}}\n \n {{~/tableRow}}\n \n
{{this}}
{{>param-table-name}}{{>linked-type-list types=type.names delimiter=" | " html=true}}{{>defaultvalue}}{{{md (inlineLinks description)}}}
\n\n{{/if}}' + ], + [ + 'properties-list', + '{{#if properties}}**Properties**\n\n{{#each properties~}}\n{{#if (regexp-test name "\\w+\\.\\w+")}} {{/if}}- {{{name}}} {{>linked-type-list types=type.names delimiter=" \\| " ~}}{{#if description}} - {{{inlineLinks description}}}{{/if}} \n{{/each}}\n\n{{/if~}}' + ], + [ + 'params', + '{{#if (optionEquals "param-list-format" "list")}}{{>params-list~}}{{/if~}}\n{{#if (optionEquals "param-list-format" "table")~}}\n{{#if (optionEquals "no-gfm" true)}}{{>params-table-html~}}{{else}}{{>params-table~}}{{/if~}}\n{{/if~}}\n' + ], + [ + 'params-table', + '{{#if params}}\n\n{{tableHead params "name|Param" "type|Type" "defaultvalue|Default" "description|Description" ~}}\n\n{{#tableRow params "name" "type" "defaultvalue" "description" ~}}\n| {{#if @col1}}{{>param-table-name}} | {{/if~}}\n{{#if @col2}}{{>linked-type-list types=type.names delimiter=" \\| " }} | {{/if~}}\n{{#if @col3}}{{>defaultvalue}} | {{/if~}}\n{{#if @col4}}{{{stripNewlines (inlineLinks description)}}} |{{/if}}\n{{/tableRow}}\n\n{{/if}}' + ], + [ + 'params-table-html', + '{{#if params}}\n\n \n \n {{#each (tableHeadHtml params "name|Param" "type|Type" "defaultvalue|Default" "description|Description")}}{{/each}}\n \n \n \n {{#tableRow params "name" "type" "defaultvalue" "description" ~}}\n \n {{#if @col1}}{{/if~}}\n {{#if @col2}}{{/if~}}\n {{#if @col3}}{{/if~}}\n {{#if @col4}}{{/if}}\n \n {{~/tableRow}}\n \n
{{this}}
{{>param-table-name}}{{>linked-type-list types=type.names delimiter=" | " html=true}}{{>defaultvalue}}{{{md (inlineLinks description)}}}
\n\n{{/if}}' + ], + [ + 'params-list', + '{{#if params}}\n{{#params}}**Params**\n\n{{#each this~}}\n{{indent}}- {{name}}{{#if type}} {{>linked-type-list types=type.names delimiter=" | " }}{{/if}}{{#unless (equal defaultvalue undefined)}} {{>defaultvalue equals=true ~}}{{/unless}}{{#if description}} - {{{inlineLinks description}}}{{/if}}\n{{/each}}\n\n{{/params~}}\n{{/if}}' + ], + [ + 'param-table-name', + '{{#if optional}}[{{/if~}}\n{{#if variable}}...{{/if~}}\n{{{name}~}}\n{{#if optional}}]{{/if}}' + ] +]