mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-3323] Updated doc tools to use DocFX intermediate files (#3601)
* [ADF-3323] Moved source file parsing to main doc tool * [ADF-3323] Moved source info classes * [ADF-3323] Added doc YAML generator tool * [ADF-3323] Added doc YAML/JSON source paths to gitignore * [ADF-3323] Completed templates and template context code * [ADF-3323] Added source paths and updated type linker * [ADF-3323] Final fixes to templates and type linking * [ADF-3323] Fixed filter for private and protected methods * [ADF-3323] Content services docs after check and rebuild * [ADF-3323] Updated docbuild script in package.json
This commit is contained in:
committed by
Eugenio Romano
parent
54380fd693
commit
69d8ff147e
35
tools/doc/yamlTemplates/methodSig.ejs
Normal file
35
tools/doc/yamlTemplates/methodSig.ejs
Normal file
@@ -0,0 +1,35 @@
|
||||
summary: >-
|
||||
<%- ((typeof sig.comment !== "undefined") && (typeof sig.comment.shortText !== "undefined")) ? (sig.comment.shortText || "").replace(/[\n\r]+/g, " ").trim() : "" %>
|
||||
tags:
|
||||
<% if ((typeof sig.comment !== "undefined") && (typeof sig.comment.tags !== "undefined")) { -%>
|
||||
<% sig.comment.tags.forEach(tag => { -%>
|
||||
- name: <%= tag.tag %>
|
||||
text: >-
|
||||
<%= (tag.text || "").replace(/[\n\r]+/g, " ").trim() %>
|
||||
<% }) -%>
|
||||
<% } -%>
|
||||
syntax:
|
||||
parameters:
|
||||
<% if ((typeof sig.parameters !== "undefined") && (sig.parameters.length > 0)) { -%>
|
||||
<% sig.parameters.forEach((param) => { -%>
|
||||
- id: <%= param.name %>
|
||||
type: >-
|
||||
<%- include("type", {type: param.type}).trim() %>
|
||||
description: >-
|
||||
<%- param.comment ? (param.comment.text || "").replace(/[\n\r]+/g, " ").trim() : "" %>
|
||||
defaultValue: >-
|
||||
<%- (typeof param.defaultValue !== "undefined") ? param.defaultValue : "" %>
|
||||
flags:
|
||||
<%_ if (typeof param.flags !== "undefined") { -%>
|
||||
<%_ Object.keys(param.flags).forEach(flagName => { -%>
|
||||
- name: <%= flagName %>
|
||||
value: <%- param.flags[flagName] %>
|
||||
<% }) -%>
|
||||
<% } -%>
|
||||
<% }) -%>
|
||||
<% } -%>
|
||||
return:
|
||||
type: >-
|
||||
<%- include("type", {type: sig.type}).trim() %>
|
||||
summary: >-
|
||||
<%- ((typeof sig.comment !== "undefined") && (typeof sig.comment.returns !== "undefined")) ? (sig.comment.returns || "").replace(/[\n\r]+/g, " ").trim() : "" %>
|
27
tools/doc/yamlTemplates/property.ejs
Normal file
27
tools/doc/yamlTemplates/property.ejs
Normal file
@@ -0,0 +1,27 @@
|
||||
summary: >-
|
||||
<%- (typeof child.comment !== "undefined") ? (child.comment.shortText || "").replace(/[\n\r]+/g, " ").trim() : "" %>
|
||||
tags:
|
||||
<%_ if ((typeof child.comment !== "undefined") && (typeof child.comment.tags !== "undefined")) { -%>
|
||||
<% child.comment.tags.forEach(tag => { -%>
|
||||
- name: <%= tag.tag %>
|
||||
text: >-
|
||||
<%- (tag.text || "").replace(/[\n\r]+/g, " ").trim() %>
|
||||
<%_ }) -%>
|
||||
<% } -%>
|
||||
decorators:
|
||||
<%_ if (typeof child.decorators !== "undefined") { -%>
|
||||
<% child.decorators.forEach(dec => { -%>
|
||||
- name: <%= dec.name %>
|
||||
arguments:
|
||||
<% Object.keys(dec.arguments).forEach(argName => { -%>
|
||||
- id: <%= argName %>
|
||||
value: <%- dec.arguments[argName] %>
|
||||
<% }) %>
|
||||
<%_ }) -%>
|
||||
<% } -%>
|
||||
syntax:
|
||||
return:
|
||||
type: >-
|
||||
<%- include("type", {type: child.type}).trim() %>
|
||||
defaultValue: >-
|
||||
<%- (child.defaultValue || "").length < 20 ? child.defaultValue : "" %>
|
44
tools/doc/yamlTemplates/template.ejs
Normal file
44
tools/doc/yamlTemplates/template.ejs
Normal file
@@ -0,0 +1,44 @@
|
||||
items:
|
||||
- uid: <%= name %>
|
||||
name: <%= name %>
|
||||
fullName: <%= name %>
|
||||
source:
|
||||
path: <%= sources[0].fileName %>
|
||||
startLine: <%= sources[0].line %>
|
||||
children:
|
||||
<%_ if (typeof children !== "undefined") { -%>
|
||||
<%_ children.forEach((child) => { -%>
|
||||
- <%= name %>.<%= child.name %>
|
||||
<% }) -%>
|
||||
<% } -%>
|
||||
langs: typeScript
|
||||
type: <%= kindString.toLowerCase() %>
|
||||
<%_ if (typeof children !== "undefined") { -%>
|
||||
<%_ children.forEach((child) => { -%>
|
||||
<%_ if ((child.kindString === "Constructor") || (child.kindString === "Method")) { -%>
|
||||
<%_ child.signatures.forEach((sig) => { -%>
|
||||
- uid: <%= name %>.<%= child.name %>
|
||||
name: <%= child.name %>
|
||||
type: <%= child.kindString.toLowerCase() %>
|
||||
flags:
|
||||
<%_ if (typeof child.flags !== "undefined") { -%>
|
||||
<%_ Object.keys(child.flags).forEach(flagName => { -%>
|
||||
- name: <%= flagName %>
|
||||
value: <%= child.flags[flagName] %>
|
||||
<% }) -%>
|
||||
<% } -%>
|
||||
<%- include("methodSig", {sig: sig}); -%>
|
||||
<% }); %>
|
||||
<% } else if (child.kindString === "Property") { -%>
|
||||
- uid: <%= name %>.<%= child.name %>
|
||||
name: <%= child.name %>
|
||||
type: <%= child.kindString.toLowerCase() %>
|
||||
<%- include("property", {child: child}); -%>
|
||||
<% } else if ((child.kindString === "Accessor") && (typeof child.getSignature !== "undefined")) { -%>
|
||||
- uid: <%= name %>.<%= child.name %>
|
||||
name: <%= child.name %>
|
||||
type: <%= child.kindString.toLowerCase() %>
|
||||
<%- include("property", {child: child.getSignature}); -%>
|
||||
<% } -%>
|
||||
<% }) -%>
|
||||
<% } -%>
|
20
tools/doc/yamlTemplates/type.ejs
Normal file
20
tools/doc/yamlTemplates/type.ejs
Normal file
@@ -0,0 +1,20 @@
|
||||
<%_ if ((type.type === "intrinsic") || (type.type === "reference")) { _%>
|
||||
<%= type.name _%>
|
||||
<%_ if (typeof type.typeArguments !== "undefined") { _%>
|
||||
<<%_ type.typeArguments.forEach((arg, index) => { _%>
|
||||
<%= index === 0 ? "" : ", " _%>
|
||||
<%- include("type", {type: arg}).trim() _%>
|
||||
<%_ }) _%>>
|
||||
<%_ } _%>
|
||||
<%_ } else if (type.type === "stringLiteral") { _%>
|
||||
"<%= type.value _%>"
|
||||
<%_ } else if (type.type === "reflection") { _%>
|
||||
Function
|
||||
<%_ } else if (type.type === "array") { _%>
|
||||
<%- include("type", {type: type.elementType}).trim() _%>[]
|
||||
<%_ } else if (type.type === "union") { _%>
|
||||
<%_ type.types.forEach((unionItem, index) => { _%>
|
||||
<%= index === 0 ? "" : " | " _%>
|
||||
<%- include("type", {type: unionItem}).trim() _%>
|
||||
<%_ }) _%>
|
||||
<%_ } _%>
|
Reference in New Issue
Block a user