diff --git a/scripts/typedoc/generate_typedoc.sh b/scripts/typedoc/generate_typedoc.sh index f4e28ac180..092f820627 100755 --- a/scripts/typedoc/generate_typedoc.sh +++ b/scripts/typedoc/generate_typedoc.sh @@ -1,4 +1,4 @@ -./node_modules/.bin/typedoc --mode file --theme ./scripts/typedoc/theme --excludeExternals \ +./node_modules/.bin/typedoc --mode file --theme ./scripts/typedoc/theme --excludeExternals --excludePrivate --excludeProtected \ --out ./doc ./authorization/v1.ts \ ./discovery/v1.ts ./language-translator/v3.ts \ ./natural-language-classifier/v1.ts ./natural-language-understanding/v1.ts \ diff --git a/scripts/typedoc/theme/assets/css/main.css b/scripts/typedoc/theme/assets/css/main.css index 48b3645ce2..ea210c7681 100644 --- a/scripts/typedoc/theme/assets/css/main.css +++ b/scripts/typedoc/theme/assets/css/main.css @@ -186,7 +186,7 @@ table { border-collapse: collapse; border-spacing: 0; } .col > :first-child, .col-1 > :first-child, .col-2 > :first-child, .col-3 > :first-child, .col-4 > :first-child, .col-5 > :first-child, .col-6 > :first-child, .col-7 > :first-child, .col-8 > :first-child, .col-9 > :first-child, .col-10 > :first-child, .col-11 > :first-child, .tsd-panel > :first-child, ul.tsd-descriptions > li > :first-child, .col > :first-child > :first-child, .col-1 > :first-child > :first-child, .col-2 > :first-child > :first-child, .col-3 > :first-child > :first-child, .col-4 > :first-child > :first-child, .col-5 > :first-child > :first-child, .col-6 > :first-child > :first-child, .col-7 > :first-child > :first-child, .col-8 > :first-child > :first-child, .col-9 > :first-child > :first-child, .col-10 > :first-child > :first-child, .col-11 > :first-child > :first-child, .tsd-panel > :first-child > :first-child, ul.tsd-descriptions > li > :first-child > :first-child, .col > :first-child > :first-child > :first-child, .col-1 > :first-child > :first-child > :first-child, .col-2 > :first-child > :first-child > :first-child, .col-3 > :first-child > :first-child > :first-child, .col-4 > :first-child > :first-child > :first-child, .col-5 > :first-child > :first-child > :first-child, .col-6 > :first-child > :first-child > :first-child, .col-7 > :first-child > :first-child > :first-child, .col-8 > :first-child > :first-child > :first-child, .col-9 > :first-child > :first-child > :first-child, .col-10 > :first-child > :first-child > :first-child, .col-11 > :first-child > :first-child > :first-child, .tsd-panel > :first-child > :first-child > :first-child, ul.tsd-descriptions > li > :first-child > :first-child > :first-child { margin-top: 0; } .col > :last-child, .col-1 > :last-child, .col-2 > :last-child, .col-3 > :last-child, .col-4 > :last-child, .col-5 > :last-child, .col-6 > :last-child, .col-7 > :last-child, .col-8 > :last-child, .col-9 > :last-child, .col-10 > :last-child, .col-11 > :last-child, .tsd-panel > :last-child, ul.tsd-descriptions > li > :last-child, .col > :last-child > :last-child, .col-1 > :last-child > :last-child, .col-2 > :last-child > :last-child, .col-3 > :last-child > :last-child, .col-4 > :last-child > :last-child, .col-5 > :last-child > :last-child, .col-6 > :last-child > :last-child, .col-7 > :last-child > :last-child, .col-8 > :last-child > :last-child, .col-9 > :last-child > :last-child, .col-10 > :last-child > :last-child, .col-11 > :last-child > :last-child, .tsd-panel > :last-child > :last-child, ul.tsd-descriptions > li > :last-child > :last-child, .col > :last-child > :last-child > :last-child, .col-1 > :last-child > :last-child > :last-child, .col-2 > :last-child > :last-child > :last-child, .col-3 > :last-child > :last-child > :last-child, .col-4 > :last-child > :last-child > :last-child, .col-5 > :last-child > :last-child > :last-child, .col-6 > :last-child > :last-child > :last-child, .col-7 > :last-child > :last-child > :last-child, .col-8 > :last-child > :last-child > :last-child, .col-9 > :last-child > :last-child > :last-child, .col-10 > :last-child > :last-child > :last-child, .col-11 > :last-child > :last-child > :last-child, .tsd-panel > :last-child > :last-child > :last-child, ul.tsd-descriptions > li > :last-child > :last-child > :last-child { margin-bottom: 0; } -.container { max-width: 1200px; margin: 0 auto; padding: 0 40px; } +.container { margin: 0 auto; padding: 0 40px; } @media (max-width: 640px) { .container { padding: 0 20px; } } .container-main { padding-bottom: 200px; } diff --git a/scripts/typedoc/theme/helpers/excluded-index-section.js b/scripts/typedoc/theme/helpers/excluded-index-section.js new file mode 100644 index 0000000000..305a1237d0 --- /dev/null +++ b/scripts/typedoc/theme/helpers/excluded-index-section.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function excludedIndexSection(sectionTitle) { + // Returns true if section is excluded. Returns false otherwise + const excludedSections = ['Interfaces', 'Type aliases', 'Modules'] + return excludedSections.includes(sectionTitle) +} +exports.excludedIndexSection = excludedIndexSection; diff --git a/scripts/typedoc/theme/helpers/excluded-nav-url.js b/scripts/typedoc/theme/helpers/excluded-nav-url.js new file mode 100644 index 0000000000..1f3cd14cec --- /dev/null +++ b/scripts/typedoc/theme/helpers/excluded-nav-url.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function excludedNavUrl(cssString, currentlySelected=false) { + // We do not want to clutter documentation with interfaces, Type aliases and Modules + // So we'll hide navigation links to those documentations + // This function will identify a url by its CSS class + + // We will make an exception for when excluded items are selected + // In that case, we do render the selected excluded URL in the side navigation + // Regardless of its other css properties + + // Returns true to exclude something, return false otherwise + + if (currentlySelected) { + // We do not want to exclude selected items + return false + } else { + const excludedCssClasses = ['tsd-kind-interface', 'tsd-kind-type-alias'] + const cssClasses = cssString.split(' ') + + return cssClasses.some((cssClass) => { + return excludedCssClasses.includes(cssClass) + }) + } +} +exports.excludedNavUrl = excludedNavUrl; diff --git a/scripts/typedoc/theme/layouts/default.hbs b/scripts/typedoc/theme/layouts/default.hbs index 22e5b4e831..b80818a11d 100644 --- a/scripts/typedoc/theme/layouts/default.hbs +++ b/scripts/typedoc/theme/layouts/default.hbs @@ -15,10 +15,10 @@