From 0eb9af613b91e499d442ea0d5d6f03be613690ea Mon Sep 17 00:00:00 2001 From: Erik Golinelli Date: Tue, 12 Dec 2023 14:16:42 +0100 Subject: [PATCH] Refactor code and update documentation Functionality for new input variables 'tsconfig_file' and 'options' were incorporated. Also, support for Node.js 16 has been announced in the README, as well as an updated table of input variables and their details. The 'config_file' input variable has been removed. --- README.md | 91 ++++++++++++++++++++++++++++++++----------------- action.yml | 9 +++-- lib/index.js | 85 ++++++++++++++++++++++++++++++++++------------ src/index.ts | 95 ++++++++++++++++++++++++++++++++++++++-------------- 4 files changed, 199 insertions(+), 81 deletions(-) diff --git a/README.md b/README.md index 71055df..545cce9 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ The following example [workflow step](https://help.github.com/en/actions/configu ## Supported platforms -The tsdoc-action is a JavaScript action and is supported on both Linux, MacOS, and Windows. The action supports stable versions of Node.js 14 and later. +The tsdoc-action is a JavaScript action and is supported on both Linux, MacOS, and Windows. The action supports stable versions of Node.js 16 and later. | OS (runs-on) | ubuntu-latest | macos-latest | windows-latest | | --- |:---: |:---: |:---: | @@ -29,37 +29,67 @@ The tsdoc-action is a JavaScript action and is supported on both Linux, MacOS, a The following input variables options can/must be configured: -| Input variable |Necessity|Description|Default| -|------------------------|----|----|----| -| `source_dir` |Optional|Source directory to build documentation from.|| -| `output_dir` |Optional|Output folder for the generated documentation.|`./out`| -| `config_file` |Optional|The path to a TypeDoc configuration file.|| -| `theme` |Optional|The TypeDoc template or theme to install. Will run `npm install template`.|| -| `theme_dir` |Optional|The relative location of the template files directory within the template package.|| -| `front_page` |Optional|The path to a Markdown file to be used as a the front page. Normally `README.md`.|| -| `excludeInternal` |Optional|Removes symbols annotated with the `@internal` doc tag.|`true`| -| `excludePrivate` |Optional|Removes private class members from the generated documentation.|`false`| -| `excludeProtected` |Optional|Removes protected class members from the generated documentation.|`false`| -| `excludeReferences` |Optional|Removes re-exports of a symbol already included in the documentation from the documentation.|`false`| -| `excludeCategories` |Optional|Removes reflections associated with any of the given categories.|| -| `name` |Optional|Set the name of the project that will be used in the header of the template.|Package name from package.json| -| `includeVersion` |Optional|Includes the version according to package.json in generated documentation.|`false`| -| `disableSources` |Optional|Disables capturing where reflections are declared when converting input.|`false`| -| `sourceLinkTemplate` |Optional|Specify a link template to be used when generating source urls.|| -| `gitRevision` |Optional|Use specified revision or branch instead of the last revision for linking to source files.|| -| `gitRemote` |Optional|Use the specified git remote instead of origin for linking to source files.|| -| `disableGit` |Optional|Prevents TypeDoc from using Git to try to determine if sources can be linked.|`false`| -| `readme` |Optional|Path to the readme file that should be displayed on the index page.|| -| `stripYamlFrontmatter` |Optional|Remove YAML frontmatter from the readme file displayed on the main page.|`false`| - -## Templates 💅 +Certainly! Here's an updated version of your README table with some corrections and additions: + +| Input variable |Necessity| Description | Default | +|-----------------------------|----|-------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------| +| `entryPoints` |Optional| Entry points for TypeDoc to analyze. same as `source_dir` | | +| `output_dir` |Optional| Output folder for the generated documentation. | `./out` | +| `options` |Optional| The path to a TypeDoc configuration file. see https://typedoc.org/options/configuration/#options | | +| `tsconfig` |Optional| The path to a tsconfig.json file. Defaults to ./tsconfig.json | `./tsconfig.json ` | +| `name` |Optional| Set the name of the project that will be used in the header of the template. | Package name from package.json | +| `titleLink` |Optional| Link the title in the header points to. | | +| `entryPointStrategy` |Optional| Strategy for determining entry points. Valid options are 'resolve' or 'packages'. | | +| `install_module` |Optional| The Plugin, theme, template npm package name that you need to install. | | +| `plugin` |Optional| The TypeDoc plugin that you want to use. Requires to be installed using `install_module`. | | +| `theme` |Optional| The TypeDoc template or theme. Requires the theme to be installed using `install_module`. | | +| `theme_dir` |Optional| The relative location of the template files directory within the template package. | | +| `themeColor` |Optional| The base color for your theme/template. | | +| `front_page` |Optional| The path to a Markdown file to be used as the front page. Normally `README.md`. | | +| `basePath` |Optional| Base path to be used when displaying file paths. | | +| `excludeInternal` |Optional| Removes symbols annotated with the `@internal` doc tag. | `true` | +| `excludePrivate` |Optional| Removes private class members from the generated documentation. | `false` | +| `excludeProtected` |Optional| Removes protected class members from the generated documentation. | `false` | +| `excludeReferences` |Optional| Removes re-exports of a symbol already included in the documentation from the documentation. | `false` | +| `excludeCategories` |Optional| Removes reflections associated with any of the given categories. | | +| `includeVersion` |Optional| Includes the version according to package.json in generated documentation. | `false` | +| `disableSources` |Optional| Disables capturing where reflections are declared when converting input. | `false` | +| `sourceLinkTemplate` |Optional| Specify a link template to be used when generating source urls. | | +| `gitRevision` |Optional| Use specified revision or branch instead of the last revision for linking to source files. | | +| `gitRemote` |Optional| Use the specified git remote instead of origin for linking to source files. | | +| `disableGit` |Optional| Prevents TypeDoc from using Git to try to determine if sources can be linked. | `false` | +| `readme` |Optional| Path to the readme file that should be displayed on the index page. | | +| `stripYamlFrontmatter` |Optional| Remove YAML frontmatter from the readme file displayed on the main page. | `false` | +| `lightHighlightTheme` |Optional| The Shiki theme to be used to highlight code snippets in light mode. | | +| `darkHighlightTheme` |Optional| The Shiki theme to be used to highlight code snippets in dark mode. | | +| `customCss` |Optional| Extra CSS file to be copied into the assets directory and referenced by the theme. | | +| `markedOptions` |Optional| Options to be forwarded to Marked when parsing doc comments. | | +| `cname` |Optional| Text for creating a CNAME file in the output directory. | | +| `sourceLinkExternal` |Optional| Treat source links as external links that open in a new tab when generating HTML. | | +| `htmlLang` |Optional| Sets the lang attribute in TypeDocs HTML output. | | +| `githubPages` |Optional| Automatically add a .nojekyll file to the output directory to prevent GitHub Pages from processing your documentation site using Jekyll. | | +| `cacheBust` |Optional| Include the generation time in