Merge remote-tracking branch 'upstream/next' into feat/merge-upstream

This commit is contained in:
Lorenzo Lewis
2022-12-14 19:37:14 +00:00
69 changed files with 12336 additions and 18582 deletions

8
.changeset/README.md Normal file
View File

@@ -0,0 +1,8 @@
# Changesets
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

11
.changeset/config.json Normal file
View File

@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.2.0/schema.json",
"changelog": "../scripts/changesets/changelog.js",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "next",
"updateInternalDependencies": "minor",
"ignore": []
}

8
.changeset/pre.json Normal file
View File

@@ -0,0 +1,8 @@
{
"mode": "pre",
"tag": "next",
"initialVersions": {
"typedoc-plugin-markdown": "3.13.4"
},
"changesets": []
}

View File

@@ -1,7 +1,7 @@
name: CI
on: [push, pull_request]
on: [pull_request]
jobs:
build:
lint-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
@@ -9,20 +9,16 @@ jobs:
name: Node ${{ matrix.node }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Upgrade yarn
run: yarn install
- name: Install
run: yarn
run: npm install
- name: Lint
run: yarn run lint
run: npm run lint
- name: Build
run: yarn run build
- name: Markdownlint
run: yarn run markdownlint
run: npm run build
- name: Test
run: yarn test
run: npm run test

20
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: Release
on: [pull_request]
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Dependencies
run: yarn
- name: Create Release Pull Request
uses: changesets/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -10,22 +10,23 @@
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"generate-typedoc": "docusaurus generate-typedoc",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "2.0.0-rc.1",
"@docusaurus/preset-classic": "2.0.0-rc.1",
"@docusaurus/core": "2.2.0",
"@docusaurus/preset-classic": "2.2.0",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"docusaurus-plugin-typedoc": "*",
"prism-react-renderer": "^1.3.5",
"typedoc-plugin-markdown": "*",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react-dom": "^17.0.2",
"typedoc-plugin-markdown": "*"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-rc.1"
"@docusaurus/module-type-aliases": "2.2.0"
},
"browserslist": {
"production": [

View File

@@ -7,10 +7,7 @@
"docs:build": "vuepress build docs && npx http-server ./docs/.vuepress/dist -o"
},
"devDependencies": {
"@vuepress/client": "^2.0.0-beta.49",
"typedoc-plugin-markdown": "*",
"vue": "^3.2.37",
"vuepress": "^2.0.0-beta.49",
"vuepress-plugin-typedoc": "*"
}
}

View File

@@ -2,15 +2,15 @@ const path = require('path');
module.exports = {
modulePaths: ['<rootDir>/dist'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.test.json',
},
],
},
verbose: true,
setupFiles: [path.join(__dirname, 'jest.helpers.ts')],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.test.json',
},
},
maxWorkers: '50%',
testTimeout: 30000,
};

View File

@@ -1,14 +0,0 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"useNx": true,
"version": "independent",
"ignoreChanges": ["**/*.json", "**/*.md", "**/*.spec.ts", "**/*.snap"],
"command": {
"version": {
"allowBranch": "master",
"conventionalCommits": true,
"message": "chore(release)"
}
}
}

11
nx.json
View File

@@ -1,11 +0,0 @@
{
"extends": "nx/presets/npm.json",
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build"]
}
}
}
}

11878
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,36 +1,32 @@
{
"private": true,
"workspaces": [
"packages/*",
"examples/*"
"packages/typedoc-plugin-markdown"
],
"scripts": {
"lint": "lerna run lint",
"build": "lerna run build",
"markdownlint": "lerna run markdownlint",
"test": "lerna run test --parallel",
"deploy": "lerna publish from-package"
"lint": "npm run lint --workspaces",
"build": "npm run build --workspaces",
"test": "npm run test --workspaces"
},
"devDependencies": {
"@changesets/cli": "^2.25.2",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^28.1.6",
"@types/node": "^18.7.3",
"@typescript-eslint/eslint-plugin": "^5.33.0",
"@typescript-eslint/parser": "^5.33.0",
"eslint": "^8.22.0",
"fs-extra": "^10.1.0",
"jest": "^28.1.3",
"lerna": "^5.4.2",
"@types/jest": "^29.2.4",
"@types/node": "^18.11.11",
"@typescript-eslint/eslint-plugin": "^5.45.1",
"@typescript-eslint/parser": "^5.45.1",
"eslint": "^8.29.0",
"fs-extra": "^11.1.0",
"jest": "^29.3.1",
"markdownlint": "^0.26.2",
"markdownlint-cli": "^0.32.1",
"markdownlint-cli": "^0.32.2",
"npm-run-all": "^4.1.5",
"nx": "^14.5.6",
"prettier": "^2.7.1",
"ts-jest": "^28.0.7",
"ts-morph": "^15.1.0",
"prettier": "^2.8.0",
"ts-jest": "^29.0.3",
"ts-morph": "^17.0.1",
"ts-node": "^10.9.1",
"typedoc": "^0.23.14",
"typedoc": "^0.23.21",
"typedoc-plugin-mdn-links": "^2.0.0",
"typescript": "^4.8.2"
"typescript": "^4.9.3"
}
}

View File

@@ -1,29 +1,15 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# Changelog
## [0.17.6](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/docusaurus-plugin-typedoc@0.17.5...docusaurus-plugin-typedoc@0.17.6) (2022-06-27)
**Note:** Version bump only for package docusaurus-plugin-typedoc
## [0.17.5](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/docusaurus-plugin-typedoc@0.17.4...docusaurus-plugin-typedoc@0.17.5) (2022-05-10)
### Bug Fixes
* added sidebar.autoConfiguration option ([f873b32](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/f873b32f2342b74c68f0bda8e7661b265b4d93ab))
* Removed index slug ([3667eb5](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/3667eb59035b422b4f569f76635cfe682fbac5ac))
- added sidebar.autoConfiguration option ([f873b32](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/f873b32f2342b74c68f0bda8e7661b265b4d93ab))
- Removed index slug ([3667eb5](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/3667eb59035b422b4f569f76635cfe682fbac5ac))
## [0.17.4](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/docusaurus-plugin-typedoc@0.17.3...docusaurus-plugin-typedoc@0.17.4) (2022-04-21)

View File

@@ -1,7 +1,4 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# Changelog
# 1.0.0 (2022-01-09)
@@ -9,17 +6,11 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
Internally initiate with TypeDoc `defineTheme` method (`theme` option should be keyword rather than path)
# 0.1.0 (2021-09-21)
### Features
* TypeDoc 0.22 compatibility fixes ([895d586](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/895d586e36da11e7fee9931d52c51a78e868e08f))
- TypeDoc 0.22 compatibility fixes ([895d586](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/895d586e36da11e7fee9931d52c51a78e868e08f))
## [0.0.1](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-bitbucket-theme@0.0.1...typedoc-bitbucket-theme@0.0.1) (2021-02-21)

View File

@@ -1,19 +1,10 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# Changelog
## [1.0.1](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-github-wiki-theme@0.6.1...typedoc-github-wiki-theme@1.0.1) (2022-05-15)
### Bug Fixes
* Fixed incorrect toc anchors ([753a534](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/753a5340f8c29d692221152e0f49251f987707c8))
- Fixed incorrect toc anchors ([753a534](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/753a5340f8c29d692221152e0f49251f987707c8))
# 1.0.0 (2022-01-09)
@@ -21,99 +12,57 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
Internally initiate with TypeDoc `defineTheme` method (`theme` option should be keyword rather than path)
## [0.6.1](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-github-wiki-theme@0.6.0...typedoc-github-wiki-theme@0.6.1) (2022-01-09)
### Bug Fixes
* Correctly define theme using TypeDoc `defineTheme` method ([5f2ef42](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/5f2ef422aa1bcce0698e4b923682dbb106730f45))
- Correctly define theme using TypeDoc `defineTheme` method ([5f2ef42](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/5f2ef422aa1bcce0698e4b923682dbb106730f45))
# [0.6.0](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-github-wiki-theme@0.5.1...typedoc-github-wiki-theme@0.6.0) (2021-09-21)
### Features
* TypeDoc 0.22 compatibility fixes ([f68442d](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/f68442d13e448d86d444e71f5781921cb4ac795e))
- TypeDoc 0.22 compatibility fixes ([f68442d](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/f68442d13e448d86d444e71f5781921cb4ac795e))
## [0.5.1](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-github-wiki-theme@0.5.0...typedoc-github-wiki-theme@0.5.1) (2021-07-14)
### Bug Fixes
* Replace forward slash with periods for filenames ([#242](https://github.com/tgreyuk/typedoc-plugin-markdown/issues/242)) ([69e31f2](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/69e31f2ff8e9f516897bbddefb208905ed4ecaa5))
- Replace forward slash with periods for filenames ([#242](https://github.com/tgreyuk/typedoc-plugin-markdown/issues/242)) ([69e31f2](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/69e31f2ff8e9f516897bbddefb208905ed4ecaa5))
# [0.5.0](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-github-wiki-theme@0.4.3...typedoc-github-wiki-theme@0.5.0) (2021-07-13)
### Features
* Generate unique page names ([#242](https://github.com/tgreyuk/typedoc-plugin-markdown/issues/242)) ([7802fd3](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/7802fd30775be167e520aaba41a04f649a569877))
- Generate unique page names ([#242](https://github.com/tgreyuk/typedoc-plugin-markdown/issues/242)) ([7802fd3](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/7802fd30775be167e520aaba41a04f649a569877))
## [0.4.3](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-github-wiki-theme@0.4.2...typedoc-github-wiki-theme@0.4.3) (2021-07-12)
### Bug Fixes
* Handle TypeDoc 0.21.3 options breaking change ([38df28f](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/38df28f4ef6821c097d4ac3145984d57fad2e8a8))
- Handle TypeDoc 0.21.3 options breaking change ([38df28f](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/38df28f4ef6821c097d4ac3145984d57fad2e8a8))
## [0.4.2](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-github-wiki-theme@0.4.1...typedoc-github-wiki-theme@0.4.2) (2021-06-19)
### Bug Fixes
* Fix output directory check ([121ffe4](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/121ffe48717db57216314b4dc7a6646bd4a1b454))
* Remove colon from filenames to fix windows compatibility ([#237](https://github.com/tgreyuk/typedoc-plugin-markdown/issues/237)) ([554cd44](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/554cd44b2bc48b737cfb15df8e828ceea5101d19))
- Fix output directory check ([121ffe4](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/121ffe48717db57216314b4dc7a6646bd4a1b454))
- Remove colon from filenames to fix windows compatibility ([#237](https://github.com/tgreyuk/typedoc-plugin-markdown/issues/237)) ([554cd44](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/554cd44b2bc48b737cfb15df8e828ceea5101d19))
## [0.4.1](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-github-wiki-theme@0.4.0...typedoc-github-wiki-theme@0.4.1) (2021-06-19)
### Bug Fixes
* Remove reference to fs-extra ([#236](https://github.com/tgreyuk/typedoc-plugin-markdown/issues/236)) ([dfec277](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/dfec277f583a398ce6f40a0ea0f2361bebab1f88))
- Remove reference to fs-extra ([#236](https://github.com/tgreyuk/typedoc-plugin-markdown/issues/236)) ([dfec277](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/dfec277f583a398ce6f40a0ea0f2361bebab1f88))
# [0.4.0](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-github-wiki-theme@0.3.0...typedoc-github-wiki-theme@0.4.0) (2021-06-18)
### Features
* TypeDoc 0.21 compatibility ([d19d6f3](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/d19d6f37a4648e48f334cf24b82b6cc9fea00abc))
- TypeDoc 0.21 compatibility ([d19d6f3](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/d19d6f37a4648e48f334cf24b82b6cc9fea00abc))
# [0.3.0](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-github-wiki-theme@0.2.1...typedoc-github-wiki-theme@0.3.0) (2021-05-11)
### Features
* Improved sidebar structure ([58798fd](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/58798fd4b25299c8d69d6671b477973c3b896aaa))
- Improved sidebar structure ([58798fd](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/58798fd4b25299c8d69d6671b477973c3b896aaa))

View File

@@ -6,8 +6,8 @@ export class GithubWikiTheme extends MarkdownTheme {
constructor(renderer: Renderer) {
super(renderer);
this.entryDocument = 'Home.md';
this.hideBreadcrumbs = true;
//this.entryDocument = 'Home.md';
//this.hideBreadcrumbs = true;
this.listenTo(this.owner, {
[RendererEvent.END]: this.writeSidebar,
@@ -24,10 +24,10 @@ export class GithubWikiTheme extends MarkdownTheme {
writeSidebar(renderer: any) {
const parseUrl = (url: string) => '../wiki/' + url.replace('.md', '');
const navigation = this.getNavigation(renderer.project);
//const navigation = this.getNavigation(renderer.project);
const navJson: string[] = [`## ${renderer.project.name}\n`];
const allowedSections = ['Home', 'Modules', 'Namespaces'];
navigation.children
/*navigation.children
?.filter(
(navItem) =>
!navItem.isLabel || allowedSections.includes(navItem.title),
@@ -47,7 +47,7 @@ export class GithubWikiTheme extends MarkdownTheme {
navItem.url === this.entryDocument ? 'Home' : navItem.title;
navJson.push(`- [${title}](${parseUrl(navItem.url)})`);
}
});
});*/
fs.writeFileSync(
renderer.outputDirectory + '/_Sidebar.md',

View File

@@ -1,7 +1,4 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# Changelog
# 1.0.0 (2022-01-09)
@@ -9,67 +6,40 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
Internally initiate with TypeDoc `defineTheme` method (`theme` option should be keyword rather than path)
## [0.2.2](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-gitlab-wiki-theme@0.2.1...typedoc-gitlab-wiki-theme@0.2.2) (2022-01-09)
### Bug Fixes
* Correctly define theme using TypeDoc `defineTheme` method ([5f2ef42](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/5f2ef422aa1bcce0698e4b923682dbb106730f45))
- Correctly define theme using TypeDoc `defineTheme` method ([5f2ef42](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/5f2ef422aa1bcce0698e4b923682dbb106730f45))
## [0.2.1](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-gitlab-wiki-theme@0.2.0...typedoc-gitlab-wiki-theme@0.2.1) (2021-11-26)
### Bug Fixes
* **urls:** Fixes relative urls for typedoc-gitlab-wiki-theme [269] ([31e45ea](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/31e45ea5b996bf15a69b3a903fd51669d82a88e9))
- **urls:** Fixes relative urls for typedoc-gitlab-wiki-theme [269] ([31e45ea](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/31e45ea5b996bf15a69b3a903fd51669d82a88e9))
# [0.2.0](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-gitlab-wiki-theme@0.1.2...typedoc-gitlab-wiki-theme@0.2.0) (2021-09-21)
### Features
* TypeDoc 0.22 compatibility fixes ([f20f79a](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/f20f79ab3c018c69bf67a2e8969880e53a2c6270))
* TypeDoc 0.22 compatibility fixes ([#249](https://github.com/tgreyuk/typedoc-plugin-markdown/issues/249)) ([963250c](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/963250cbe0b12bc3f413b5138d6d4e33ad2a6353))
- TypeDoc 0.22 compatibility fixes ([f20f79a](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/f20f79ab3c018c69bf67a2e8969880e53a2c6270))
- TypeDoc 0.22 compatibility fixes ([#249](https://github.com/tgreyuk/typedoc-plugin-markdown/issues/249)) ([963250c](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/963250cbe0b12bc3f413b5138d6d4e33ad2a6353))
## [0.1.2](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-gitlab-wiki-theme@0.1.1...typedoc-gitlab-wiki-theme@0.1.2) (2021-07-12)
### Bug Fixes
* Handle TypeDoc 0.21.3 options breaking change ([38df28f](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/38df28f4ef6821c097d4ac3145984d57fad2e8a8))
- Handle TypeDoc 0.21.3 options breaking change ([38df28f](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/38df28f4ef6821c097d4ac3145984d57fad2e8a8))
## [0.1.1](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-gitlab-wiki-theme@0.1.0...typedoc-gitlab-wiki-theme@0.1.1) (2021-06-19)
### Bug Fixes
* Fix output directory check ([328ef00](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/328ef00e50da988f62201c9a91548e909699c587))
* Remove colon from filenames to fix windows compatibility ([115d133](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/115d133d296e6a7e8ceb7b46b6c88f2dbb7ee7d1))
- Fix output directory check ([328ef00](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/328ef00e50da988f62201c9a91548e909699c587))
- Remove colon from filenames to fix windows compatibility ([115d133](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/115d133d296e6a7e8ceb7b46b6c88f2dbb7ee7d1))
# [0.1.0](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-gitlab-wiki-theme@0.0.1...typedoc-gitlab-wiki-theme@0.1.0) (2021-05-11)
### Features
* Improved sidebar structure ([09e713a](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/09e713a4731fc3effceaf720bdefdba0c398d608))
- Improved sidebar structure ([09e713a](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/09e713a4731fc3effceaf720bdefdba0c398d608))

View File

@@ -1,6 +1,4 @@
import * as fs from 'fs';
import { Renderer, DeclarationReflection, RendererEvent } from 'typedoc';
import { Renderer } from 'typedoc';
import { MarkdownTheme } from 'typedoc-plugin-markdown';
export class GitlabWikiTheme extends MarkdownTheme {
@@ -8,50 +6,8 @@ export class GitlabWikiTheme extends MarkdownTheme {
super(renderer);
this.entryDocument = 'home.md';
this.hideBreadcrumbs = true;
this.hidePageTitle = true;
this.listenTo(this.owner, {
[RendererEvent.END]: this.onGitLabRendererEnd,
});
}
getRelativeUrl(url: string) {
const relativeUrl = super
.getRelativeUrl(url)
.replace(/(.*).md/, '$1')
.replace(/ /g, '-');
return relativeUrl.startsWith('..') ? relativeUrl : './' + relativeUrl;
}
toUrl(mapping: any, reflection: DeclarationReflection) {
return `${mapping.directory}/${reflection.getFullName()}.md`;
}
onGitLabRendererEnd(renderer: RendererEvent) {
const parseUrl = (url: string) => url.replace(/(.*).md/, '$1');
const navigation = this.getNavigation(renderer.project);
const navJson: string[] = [`## ${renderer.project.name}\n`];
navigation.children?.forEach((navItem) => {
if (navItem.isLabel) {
navJson.push(`\n### ${navItem.title}\n`);
navItem.children?.forEach((navItemChild) => {
const longTitle = navItemChild.title.split('.');
const shortTitle = longTitle[longTitle.length - 1];
navJson.push(
`- [${shortTitle}](${parseUrl(encodeURI(navItemChild.url))})`,
);
});
} else {
const title =
navItem.url === this.entryDocument ? 'Home' : navItem.title;
navJson.push(`- [${title}](${parseUrl(navItem.url)})`);
}
});
fs.writeFileSync(
renderer.outputDirectory + '/_sidebar.md',
navJson.join('\n'),
);
// this.hideBreadcrumbs = true;
// this.hidePageTitle = true;
}
get globalsFile() {

View File

@@ -1,8 +1,4 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# Changelog
# 1.0.0 (2022-01-09)
@@ -10,81 +6,48 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
Internally initiate with TypeDoc `defineTheme` method (`theme` option should be keyword rather than path)
# [0.4.0](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-hugo-theme@0.3.0...typedoc-hugo-theme@0.4.0) (2022-01-09)
### Bug Fixes
* Correctly define theme using TypeDoc `defineTheme` method ([5f2ef42](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/5f2ef422aa1bcce0698e4b923682dbb106730f45))
- Correctly define theme using TypeDoc `defineTheme` method ([5f2ef42](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/5f2ef422aa1bcce0698e4b923682dbb106730f45))
### Features
* TypeDoc 0.22 compatibility fixes ([5bda95d](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/5bda95d95aa42ec66ec893eef51507794ad52b3d))
- TypeDoc 0.22 compatibility fixes ([5bda95d](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/5bda95d95aa42ec66ec893eef51507794ad52b3d))
# [0.3.0](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-hugo-theme@0.3.0...typedoc-hugo-theme@0.3.0) (2021-09-21)
### Features
* TypeDoc 0.22 compatibility fixes ([5bda95d](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/5bda95d95aa42ec66ec893eef51507794ad52b3d))
- TypeDoc 0.22 compatibility fixes ([5bda95d](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/5bda95d95aa42ec66ec893eef51507794ad52b3d))
# [0.3.0](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-hugo-theme@0.2.1...typedoc-hugo-theme@0.3.0) (2021-09-14)
### Features
* TypeDoc 0.22 compatibility fixes ([#249](https://github.com/tgreyuk/typedoc-plugin-markdown/issues/249)) ([963250c](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/963250cbe0b12bc3f413b5138d6d4e33ad2a6353))
- TypeDoc 0.22 compatibility fixes ([#249](https://github.com/tgreyuk/typedoc-plugin-markdown/issues/249)) ([963250c](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/963250cbe0b12bc3f413b5138d6d4e33ad2a6353))
## [0.2.1](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-hugo-theme@0.2.0...typedoc-hugo-theme@0.2.1) (2021-07-12)
### Bug Fixes
* Handle TypeDoc 0.21.3 options breaking change ([c07ef46](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/c07ef4660bd126a3b97356f862a8e1019d97c5a8))
- Handle TypeDoc 0.21.3 options breaking change ([c07ef46](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/c07ef4660bd126a3b97356f862a8e1019d97c5a8))
# [0.2.0](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-hugo-theme@0.1.1...typedoc-hugo-theme@0.2.0) (2021-03-04)
### Features
* Added Branch Bundle `_index.md` files ([f3c7118](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/f3c7118af9b53f63ea40ac5937ec57e08b9f6ec8))
- Added Branch Bundle `_index.md` files ([f3c7118](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/f3c7118af9b53f63ea40ac5937ec57e08b9f6ec8))
## [0.1.1](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-hugo-theme@0.1.0...typedoc-hugo-theme@0.1.1) (2021-03-03)
### Bug Fixes
* Remove slug root dir ([#197](https://github.com/tgreyuk/typedoc-plugin-markdown/issues/197)) ([c7e2586](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/c7e25862c6ac0e34547b0e7636cb66acb51e5791))
- Remove slug root dir ([#197](https://github.com/tgreyuk/typedoc-plugin-markdown/issues/197)) ([c7e2586](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/c7e25862c6ac0e34547b0e7636cb66acb51e5791))
## 0.1.0 (2021-02-27)
### Features
* Added Hugo theme / front matter support ([3cd1bf8](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/3cd1bf894533966f75ccd56c1b7cd2078e7084c0))
- Added Hugo theme / front matter support ([3cd1bf8](https://github.com/tgreyuk/typedoc-plugin-markdown/commit/3cd1bf894533966f75ccd56c1b7cd2078e7084c0))

View File

@@ -1,7 +1,4 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# Changelog
## [3.13.4](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-plugin-markdown@3.13.3...typedoc-plugin-markdown@3.13.4) (2022-07-20)

View File

@@ -12,7 +12,7 @@
"prepublishOnly": "yarn run lint && yarn run build && yarn run test",
"prebuild": "ts-node scripts/build-resources",
"build": "rm -rf dist && tsc",
"test": "jest --colors",
"test": "jest --colors -u",
"build-and-test": "yarn run build && yarn run test",
"docs": "yarn run build && yarn run docs:md && yarn run docs:html",
"docs:md": "typedoc --plugin typedoc-plugin-markdown --hasOwnDocument all --options ../../stub-project/typedoc.json --out ./docs/md",

View File

@@ -19,7 +19,6 @@ const typedocSymbols = [
'ParameterReflection',
'ProjectReflection',
'QueryType',
'ReflectionGroup',
'ReferenceReflection',
'ReferenceType',
'ReflectionType',
@@ -38,6 +37,8 @@ const project = new Project({
tsConfigFilePath: 'tsconfig.json',
});
const themePath = path.join(__dirname, '..', 'src');
const templateFiles = getFiles('templates');
const templateSymbols = getSymbols(templateFiles, 'templates');
@@ -45,10 +46,10 @@ const partialsFiles = getFiles('partials');
const partialsSymbols = getSymbols(partialsFiles, 'partials');
const out = [
`import { \n ${typedocSymbols.join(',\n ')} } from 'typedoc';
`// THIS FILE IS AUTOGENERATED - DO NOT EDIT DIRECTLY
import { \n ${typedocSymbols.join(',\n ')} } from 'typedoc';
import { MarkdownThemeRenderContext } from './theme-context';
import { ${pluginSymbols.join(',\n')} } from './types';`,
import { ${pluginSymbols.join(',\n')} } from './models';`,
];
templateFiles.forEach((file, index) => {
@@ -98,13 +99,10 @@ partialsSymbols.forEach((symbol) => {
});
out.push(`});`);
fs.writeFileSync(
path.join(__dirname, '..', 'src', 'resources.ts'),
out.join('\n'),
);
fs.writeFileSync(path.join(themePath, 'resources.ts'), out.join('\n'));
function getFiles(type: string) {
const partialsFolder = path.join(__dirname, '..', 'src', type);
const partialsFolder = path.join(themePath, type);
return fs
.readdirSync(partialsFolder)
.map((partialsFile) => path.parse(partialsFile).name);
@@ -113,7 +111,7 @@ function getFiles(type: string) {
function getSymbols(files: string[], type: string) {
return files.map((file) => {
const tsFile = project.getSourceFile(
path.join(__dirname, '..', 'src', type, file + '.ts'),
path.join(themePath, type, file + '.ts'),
);
const symbolName = tsFile?.getExportSymbols()[0]?.getEscapedName();

View File

@@ -4,7 +4,7 @@ import {
ProjectReflection,
ReflectionKind,
} from 'typedoc';
import { link } from '../els';
import { link } from '../support/els';
import { MarkdownThemeRenderContext } from '../theme-context';
export function breadcrumbs(

View File

@@ -1,6 +1,6 @@
import { Comment } from 'typedoc';
import { camelToTitleCase } from '../support/utils';
import { MarkdownThemeRenderContext } from '../theme-context';
import { camelToTitleCase } from '../utils';
import { bold } from '../els';
export function comment(context: MarkdownThemeRenderContext, comment: Comment) {

View File

@@ -1,5 +1,5 @@
import { DeclarationReflection, PageEvent, ReflectionKind } from 'typedoc';
import { heading } from '../els';
import { heading } from '../support/els';
import { MarkdownThemeRenderContext } from '../theme-context';
export function header(

View File

@@ -1,5 +1,5 @@
import { DeclarationHierarchy, SomeType } from 'typedoc';
import { bold } from '../els';
import { bold } from '../support/els';
import { MarkdownThemeRenderContext } from '../theme-context';
export function hierarchy(

View File

@@ -1,5 +1,5 @@
import { SignatureReflection } from 'typedoc';
import { bold } from '../els';
import { bold } from '../support/els';
import { getTeritiaryHeadingLevel } from '../support/helpers';
import { MarkdownThemeRenderContext } from '../theme-context';

View File

@@ -5,9 +5,9 @@ import {
ReflectionKind,
ReflectionType,
} from 'typedoc';
import { backTicks } from '../els';
import { backTicks } from '../support/els';
import { escapeChars, stripComments, stripLineBreaks } from '../support/utils';
import { MarkdownThemeRenderContext } from '../theme-context';
import { escapeChars, stripComments, stripLineBreaks } from '../utils';
export function declarationMemberTitle(
context: MarkdownThemeRenderContext,

View File

@@ -1,5 +1,5 @@
import { DeclarationReflection } from 'typedoc';
import { bold } from '../els';
import { bold } from '../support/els';
import { getQuaternaryHeadingLevel } from '../support/helpers';
import { MarkdownThemeRenderContext } from '../theme-context';

View File

@@ -4,6 +4,7 @@ import { MarkdownThemeRenderContext } from '../theme-context';
export function signatureTitle(
context: MarkdownThemeRenderContext,
signature: SignatureReflection,
accessor?: string,
) {
const md: string[] = ['> '];
@@ -13,6 +14,10 @@ export function signatureTitle(
);
}
if (accessor) {
md.push(accessor + ' ');
}
if (!['__call', '__type'].includes(signature.name)) {
md.push(`**${signature.name}**`);
}
@@ -28,11 +33,14 @@ export function signatureTitle(
const getParameters = (parameters: ParameterReflection[] = []) => {
return parameters
.map((param) => {
const isDestructuredParam = param.name == '__namedParameters';
const paramsmd: string[] = [];
if (param.flags.isRest) {
paramsmd.push('...');
}
const paramItem = `\`${param.name}${
const paramItem = `\`${
isDestructuredParam ? '«destructured»' : param.name
}${
param.flags.isOptional || param.defaultValue ? '?' : ''
}\`: ${context.partials.someType(param.type as SomeType, 'all')}`;
paramsmd.push(paramItem);

View File

@@ -1,5 +1,5 @@
import { DeclarationReflection, SignatureReflection } from 'typedoc';
import { bold } from '../els';
import { bold } from '../support/els';
import { getQuaternaryHeadingLevel } from '../support/helpers';
import { MarkdownThemeRenderContext } from '../theme-context';

View File

@@ -3,7 +3,7 @@ import {
ReferenceReflection,
ReflectionKind,
} from 'typedoc';
import { heading, backTicks } from '../els';
import { backTicks, heading } from '../support/els';
import { getTeritiaryHeadingLevel, isConstructor } from '../support/helpers';
import { MarkdownThemeRenderContext } from '../theme-context';

View File

@@ -1,5 +1,5 @@
import { ContainerReflection, ReflectionKind } from 'typedoc';
import { heading, horizontalRule } from '../els';
import { ContainerReflection } from 'typedoc';
import { heading, horizontalRule } from '../support/els';
import { getSecondaryHeadingLevel } from '../support/helpers';
import { MarkdownThemeRenderContext } from '../theme-context';

View File

@@ -1,6 +1,6 @@
import { DeclarationReflection } from 'typedoc';
import { escapeChars } from '../support/utils';
import { MarkdownThemeRenderContext } from '../theme-context';
import { escapeChars } from '../utils';
export function reflectionTitle(
context: MarkdownThemeRenderContext,

View File

@@ -1,5 +1,5 @@
import { DeclarationReflection } from 'typedoc';
import { bold, heading, horizontalRule, unorderedList } from '../els';
import { bold, heading, horizontalRule, unorderedList } from '../support/els';
import { getSecondaryHeadingLevel } from '../support/helpers';
import { MarkdownThemeRenderContext } from '../theme-context';

View File

@@ -5,11 +5,11 @@ import {
ReflectionKind,
SignatureReflection,
} from 'typedoc';
import { bold, link } from '../els';
import { bold, link } from '../support/els';
import { getQuaternaryHeadingLevel } from '../support/helpers';
import { MarkdownThemeRenderContext } from '../theme-context';
import { escapeChars } from '../utils';
import { escapeChars } from '../support/utils';
export function sources(
context: MarkdownThemeRenderContext,

View File

@@ -1,7 +1,7 @@
import { ParameterReflection, ReflectionKind } from 'typedoc';
import { stripLineBreaks } from '../support/utils';
import { MarkdownThemeRenderContext } from '../theme-context';
import { stripLineBreaks } from '../utils';
export function parametersTable(
context: MarkdownThemeRenderContext,
@@ -59,11 +59,21 @@ function table(context: MarkdownThemeRenderContext, parameters: any) {
const rows = parameters.map((parameter) => {
const row: string[] = [];
row.push(
`\`${parameter.flags.isRest ? '...' : ''}${parameter.name}${
parameter.flags.isOptional ? '?' : ''
}\``,
);
const nbsp = ' '; // ? <== Unicode no-break space character
const rest = parameter.flags.isRest ? '...' : '';
const optional = parameter.flags.isOptional ? '?' : '';
const isDestructuredParam = parameter.name == '__namedParameters';
const isDestructuredParamProp =
parameter.name.startsWith('__namedParameters.');
if (isDestructuredParam) {
row.push(`\`${rest}«destructured»\``);
} else if (isDestructuredParamProp) {
row.push(`${nbsp}\`${rest}${parameter.name.slice(18)}${optional}\``);
} else {
row.push(`\`${rest}${parameter.name}${optional}\``);
}
row.push(
parameter.type

View File

@@ -1,6 +1,6 @@
import { DeclarationReflection, ReflectionType } from 'typedoc';
import { escapeChars, stripLineBreaks } from '../support/utils';
import { MarkdownThemeRenderContext } from '../theme-context';
import { escapeChars, stripLineBreaks } from '../utils';
export function propertiesTable(
context: MarkdownThemeRenderContext,

View File

@@ -1,6 +1,6 @@
import { TypeParameterReflection } from 'typedoc';
import { stripLineBreaks } from '../support/utils';
import { MarkdownThemeRenderContext } from '../theme-context';
import { stripLineBreaks } from '../utils';
export function typeParametersTable(
context: MarkdownThemeRenderContext,

View File

@@ -3,10 +3,10 @@ import {
ProjectReflection,
ReflectionGroup,
} from 'typedoc';
import { heading } from '../els';
import { heading } from '../support/els';
import { getSecondaryHeadingLevel } from '../support/helpers';
import { escapeChars } from '../support/utils';
import { MarkdownThemeRenderContext } from '../theme-context';
import { escapeChars } from '../utils';
export function toc(
context: MarkdownThemeRenderContext,

View File

@@ -1,7 +1,7 @@
import { DeclarationReflection, SomeType } from 'typedoc';
import { Collapse } from '../models';
import { escapeChars } from '../support/utils';
import { MarkdownThemeRenderContext } from '../theme-context';
import { Collapse } from '../types';
import { escapeChars } from '../utils';
export function declarationType(
context: MarkdownThemeRenderContext,

View File

@@ -1,6 +1,6 @@
import { InferredType } from 'typedoc';
import { escapeChars } from '../support/utils';
import { MarkdownThemeRenderContext } from '../theme-context';
import { escapeChars } from '../utils';
export function inferredType(
context: MarkdownThemeRenderContext,

View File

@@ -1,6 +1,6 @@
import { IntrinsicType } from 'typedoc';
import { escapeChars } from '../support/utils';
import { MarkdownThemeRenderContext } from '../theme-context';
import { escapeChars } from '../utils';
export function intrinsicType(
context: MarkdownThemeRenderContext,

View File

@@ -1,5 +1,5 @@
import { ReferenceType } from 'typedoc';
import { backTicks } from '../els';
import { backTicks } from '../support/els';
import { MarkdownThemeRenderContext } from '../theme-context';
import { reflectionType } from './type.reflection';

View File

@@ -1,6 +1,6 @@
import { ReflectionType } from 'typedoc';
import { Collapse } from '../models';
import { MarkdownThemeRenderContext } from '../theme-context';
import { Collapse } from '../types';
export function reflectionType(
context: MarkdownThemeRenderContext,

View File

@@ -14,10 +14,9 @@ import {
UnionType,
UnknownType,
} from 'typedoc';
import { backTicks } from '../els';
import { Collapse } from '../models';
import { backTicks } from '../support/els';
import { MarkdownThemeRenderContext } from '../theme-context';
import { Collapse } from '../types';
import { escapeChars } from '../utils';
export function someType(
context: MarkdownThemeRenderContext,

View File

@@ -1,7 +1,6 @@
import { UnknownType } from 'typedoc';
import { backTicks } from '../els';
import { backTicks } from '../support/els';
import { MarkdownThemeRenderContext } from '../theme-context';
import { escapeChars } from '../utils';
export function unknownType(
context: MarkdownThemeRenderContext,

View File

@@ -1,5 +1,5 @@
import { TypeParameterReflection } from 'typedoc';
import { backTicks } from '../els';
import { backTicks } from '../support/els';
import { MarkdownThemeRenderContext } from '../theme-context';
export function typeParameters(

View File

@@ -1,34 +1,34 @@
import {
ArrayType,
ConditionalType,
ContainerReflection,
Comment,
CommentDisplayPart,
DeclarationHierarchy,
DeclarationReflection,
InferredType,
IntersectionType,
IntrinsicType,
IndexedAccessType,
LiteralType,
PageEvent,
ParameterReflection,
ProjectReflection,
QueryType,
ReflectionGroup,
ReferenceReflection,
ReferenceType,
ReflectionType,
SignatureReflection,
SomeType,
TupleType,
TypeOperatorType,
TypeParameterReflection,
UnionType,
UnknownType } from 'typedoc';
// THIS FILE IS AUTOGENERATED - DO NOT EDIT DIRECTLY
import {
ArrayType,
ConditionalType,
ContainerReflection,
Comment,
CommentDisplayPart,
DeclarationHierarchy,
DeclarationReflection,
InferredType,
IntersectionType,
IntrinsicType,
IndexedAccessType,
LiteralType,
PageEvent,
ParameterReflection,
ProjectReflection,
QueryType,
ReferenceReflection,
ReferenceType,
ReflectionType,
SignatureReflection,
SomeType,
TupleType,
TypeOperatorType,
TypeParameterReflection,
UnionType,
UnknownType,
} from 'typedoc';
import { MarkdownThemeRenderContext } from './theme-context';
import { Collapse } from './types';
import { Collapse } from './models';
import { memberTemplate } from './templates/member';
import { projectTemplate } from './templates/project';
import { readmeTemplate } from './templates/readme';
@@ -83,20 +83,30 @@ export type Templates = {
};
export type Partials = {
breadcrumbs: (page: PageEvent<DeclarationReflection | ProjectReflection>) => string;
breadcrumbs: (
page: PageEvent<DeclarationReflection | ProjectReflection>,
) => string;
commentParts: (parts: CommentDisplayPart[]) => string;
comment: (comment: Comment) => string;
header: (page: PageEvent<DeclarationReflection>) => string;
hierarchy: (declarationHierarchy: DeclarationHierarchy) => string;
constructorMember: (signature: SignatureReflection) => string;
declarationMemberTitle: (reflection: DeclarationReflection | ParameterReflection) => string;
declarationMemberTitle: (
reflection: DeclarationReflection | ParameterReflection,
) => string;
declarationMember: (reflection: DeclarationReflection) => string;
referenceMember: (props: ReferenceReflection) => string;
signatureTitle: (signature: SignatureReflection) => string;
signatureTitle: (
signature: SignatureReflection,
accessor?: string | undefined,
) => string;
signatureMember: (signature: SignatureReflection) => string;
member: (reflection: DeclarationReflection) => string;
members: (container: ContainerReflection) => string;
reflectionTitle: (reflection: DeclarationReflection, shouldEscape?: boolean) => string;
reflectionTitle: (
reflection: DeclarationReflection,
shouldEscape?: boolean,
) => string;
reflection: (reflection: DeclarationReflection) => string;
sources: (reflection: DeclarationReflection | SignatureReflection) => string;
parametersTable: (parameters: ParameterReflection[]) => string;
@@ -105,7 +115,10 @@ export type Partials = {
toc: (reflection: DeclarationReflection | ProjectReflection) => string;
arrayType: (arrayType: ArrayType, emphasis: boolean) => string;
conditionalType: (conditionalType: ConditionalType) => string;
declarationType: (declarationReflection: DeclarationReflection, collapse?: Collapse) => string;
declarationType: (
declarationReflection: DeclarationReflection,
collapse?: Collapse,
) => string;
functionType: (modelSignatures: SignatureReflection[]) => string;
indexAccessType: (model: IndexedAccessType) => string;
inferredType: (model: InferredType) => string;
@@ -114,8 +127,15 @@ export type Partials = {
literalType: (literalType: LiteralType) => string;
queryType: (queryType: QueryType) => string;
referenceType: (referenceType: ReferenceType) => string;
reflectionType: (reflectionType: ReflectionType, collapse: Collapse) => string;
someType: (someType: SomeType, collapse?: Collapse, emphasis?: boolean) => string;
reflectionType: (
reflectionType: ReflectionType,
collapse: Collapse,
) => string;
someType: (
someType: SomeType,
collapse?: Collapse,
emphasis?: boolean,
) => string;
tupleType: (tupleType: TupleType) => string;
typeOperatorType: (model: TypeOperatorType) => string;
unionType: (unionType: UnionType, emphasis: boolean) => string;
@@ -169,4 +189,4 @@ export const partials = (context: MarkdownThemeRenderContext): Partials => ({
unionType: bind(unionType, context),
unknownType: bind(unknownType, context),
typeParameters: bind(typeParameters, context),
});
});

View File

@@ -1,5 +1,5 @@
import { PageEvent, ProjectReflection } from 'typedoc';
import { heading } from '../els';
import { heading } from '../support/els';
import { MarkdownThemeRenderContext } from '../theme-context';
export function projectTemplate(

View File

@@ -1,5 +1,5 @@
import { DeclarationReflection, PageEvent } from 'typedoc';
import { bold, heading, unorderedList } from '../els';
import { bold, heading, unorderedList } from '../support/els';
import { MarkdownThemeRenderContext } from '../theme-context';
export function reflectionTemplate(

View File

@@ -1,9 +1,8 @@
import * as path from 'path';
import { Options, ReferenceType, Reflection } from 'typedoc';
import { URL_PREFIX } from './constants';
import { Options, Reflection } from 'typedoc';
import { TypedocPluginMarkdownOptions } from './models';
import { partials, templates } from './resources';
import { MarkdownTheme } from './theme';
import { TypedocPluginMarkdownOptions } from './types';
import { URL_PREFIX } from './support/constants';
export class MarkdownThemeRenderContext {
public globalsFile = 'Modules.md';
@@ -18,7 +17,7 @@ export class MarkdownThemeRenderContext {
return this._activeLocation;
}
constructor(private theme: MarkdownTheme, public options: Options) {}
constructor(public options: Options) {}
getOption<K extends keyof TypedocPluginMarkdownOptions>(name: K) {
return this.options.getValue(name) as TypedocPluginMarkdownOptions[K];

View File

@@ -10,10 +10,10 @@ import {
Theme,
UrlMapping,
} from 'typedoc';
import { URL_PREFIX } from './constants';
import { HasOwnDocument, TemplateMapping } from './models';
import { URL_PREFIX } from './support/constants';
import { formatContents } from './support/utils';
import { MarkdownThemeRenderContext } from './theme-context';
import { HasOwnDocument, TemplateMapping } from './types';
import { formatContents } from './utils';
export class MarkdownTheme extends Theme {
@BindOption('entryDocument') entryDocument!: string;
@BindOption('entryPoints') entryPoints!: string[];
@@ -41,7 +41,6 @@ export class MarkdownTheme extends Theme {
getRenderContext() {
if (!this._renderContext) {
this._renderContext = new MarkdownThemeRenderContext(
this,
this.application.options,
);
}

View File

@@ -1,13 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Breadcrumbs: (with readme) should compile README breadcrumbs' 1`] = `"Readme | [typedoc-plugin-markdown](../modules.md)"`;
exports[`Breadcrumbs: (with readme) should compile README breadcrumbs' 1`] = `"[typedoc-plugin-markdown](Modules.md) / typedoc-plugin-markdown"`;
exports[`Breadcrumbs: (with readme) should compile class breadcrumbs' 1`] = `"[Readme](../README.md) | [typedoc-plugin-markdown](../modules.md) / Breadcrumbs"`;
exports[`Breadcrumbs: (with readme) should compile class breadcrumbs' 1`] = `"[typedoc-plugin-markdown](Modules.md) / Breadcrumbs"`;
exports[`Breadcrumbs: (with readme) should compile entryPoint (globals) breadcrumbs' 1`] = `"[Readme](../README.md) | [typedoc-plugin-markdown](../modules.md)"`;
exports[`Breadcrumbs: (with readme) should compile entryPoint (globals) breadcrumbs' 1`] = `"[typedoc-plugin-markdown](Modules.md) / typedoc-plugin-markdown"`;
exports[`Breadcrumbs: (with readme) should compile module breadcrumbs' 1`] = `"[Readme](../README.md) | [typedoc-plugin-markdown](../modules.md) / Breadcrumbs"`;
exports[`Breadcrumbs: (with readme) should compile module breadcrumbs' 1`] = `"[typedoc-plugin-markdown](Modules.md) / Breadcrumbs"`;
exports[`Breadcrumbs: (without readme) should compile class breadcrumbs' 1`] = `"[typedoc-plugin-markdown](../README.md) / Breadcrumbs"`;
exports[`Breadcrumbs: (without readme) should compile class breadcrumbs' 1`] = `"[typedoc-plugin-markdown](README.md) / Breadcrumbs"`;
exports[`Breadcrumbs: (without readme) should compile module breadcrumbs' 1`] = `"[typedoc-plugin-markdown](../README.md) / Breadcrumbs"`;
exports[`Breadcrumbs: (without readme) should compile module breadcrumbs' 1`] = `"[typedoc-plugin-markdown](README.md) / Breadcrumbs"`;

View File

@@ -10,7 +10,7 @@ You can write <strong>HTML</strong> tags directly in comments
`;
exports[`Comments: should build @link references' 1`] = `
"See [\`CommentClass\`](CommentClass.md) and CommentClass's [comment](CommentClass.md#comment) property.
"See [\`CommentClass\`](Modules.md#commentclass) and CommentClass's [comment](Modules.md#comment) property.
Also, check out [https://www.google.com|Google](https://www.google.com|Google) and
[GitHub](https://github.com).
@@ -53,7 +53,7 @@ const appVersion = await getVersion();
exports[`Comments: should convert symbols brackets to symbol links' 1`] = `
"Additionally you can link to other classes, members or functions using double square brackets.
- Link to an external reflection: [CommentClass](CommentClass.md)
- Link to an internal reflection: [commentsInReturn](../modules.md#commentsinreturn)
- Link to an external reflection: [CommentClass](Modules.md#commentclass)
- Link to an internal reflection: [commentsInReturn](Modules.md#commentsinreturn)
- Link to an undefined reflection: VOID"
`;

View File

@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Declarations: should compile a const with default value 1`] = `
" \`Const\` **stringConstWithDefaultValue**: \\"hello\\"
"\`Const\` **stringConstWithDefaultValue**: \`"hello"\`
[partial: sources]"
`;
@@ -19,19 +19,18 @@ exports[`Declarations: should compile an undefined declaration 1`] = `
`;
exports[`Declarations: should compile any function type 1`] = `
" **AnyFunctionType**<\`A\`\\\\>: (...\`input\`: \`any\`[]) => \`A\`
" **AnyFunctionType**<\`A\`\\>: (...\`input\`: \`any\`[]) => \`A\`
#### Type parameters
**Type parameters**
| Name | Type |
| :------ | :------ |
| \`A\` | \`any\` |
- \`A\` = \`any\`
#### Type declaration
(...\`input\`: \`any\`[]): \`A\`
**Type declaration**
##### Parameters
» (...\`input\`: \`any\`[]): \`A\`
**Parameters**
| Name | Type |
@@ -39,7 +38,7 @@ exports[`Declarations: should compile any function type 1`] = `
| \`...input\` | \`any\`[] |
##### Returns
**Returns**
\`A\`
@@ -49,12 +48,12 @@ exports[`Declarations: should compile any function type 1`] = `
exports[`Declarations: should compile declaration with accessors 1`] = `
" **getterAndSetter**: \`Object\`
#### Type declaration
**Type declaration**
| Name | Type |
| :------ | :------ |
| \`get getMe()\` | [\`Promise\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<\`string\`\\\\> |
| \`get getMe()\` | [\`Promise\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<\`string\`\\> |
| \`set setMe(x:string)\` | \`void\` |
@@ -62,19 +61,19 @@ exports[`Declarations: should compile declaration with accessors 1`] = `
`;
exports[`Declarations: should compile declaration with double underscores in name and value 1`] = `
" \`Const\` **\\\\_\\\\_DOUBLE\\\\_UNDERSCORES\\\\_DECLARATION\\\\_\\\\_**: typeof [\`__DOUBLE_UNDERSCORES_DECLARATION__\`](../modules.md#__double_underscores_declaration__)
"\`Const\` **\\_\\_DOUBLE\\_UNDERSCORES\\_DECLARATION\\_\\_**: typeof [\`__DOUBLE_UNDERSCORES_DECLARATION__\`](Modules.md#__double_underscores_declaration__)
[partial: sources]"
`;
exports[`Declarations: should compile enum declaration 1`] = `
" **Down** = 1
" **Down** = \`1\`
[partial: sources]"
`;
exports[`Declarations: should compile enum declaration with defaults 1`] = `
" **East** = \\"East\\"
" **East** = \`"East"\`
[partial: sources]"
`;
@@ -90,7 +89,7 @@ exports[`Declarations: should compile indexable declaration 1`] = `
context.indexSignaturePartial(typeDeclaration.indexSignature)
#### Type declaration
**Type declaration**
| Name | Type |
@@ -102,7 +101,7 @@ context.indexSignaturePartial(typeDeclaration.indexSignature)
`;
exports[`Declarations: should compile object literal cast as a const 1`] = `
" \`Const\` **objectLiteralAsConstDeclaration**: \`Object\`
"\`Const\` **objectLiteralAsConstDeclaration**: \`Object\`
Comments
@@ -118,21 +117,21 @@ Comment for Prop1.
Comment for Prop2.
#### Type declaration
**Type declaration**
| Name | Type |
| :------ | :------ |
| \`Prop1\` | \\"Prop1\\" |
| \`Prop2\` | \\"Prop2\\" |
| \`Prop3\` | \\"Prop3\\" |
| \`Prop1\` | \`"Prop1"\` |
| \`Prop2\` | \`"Prop2"\` |
| \`Prop3\` | \`"Prop3"\` |
[partial: sources]"
`;
exports[`Declarations: should compile object literal declaration 1`] = `
" \`Const\` **objectLiteralDeclaration**: \`Object\`
"\`Const\` **objectLiteralDeclaration**: \`Object\`
**\`Param\`**
@@ -146,7 +145,7 @@ description for valueZ
description for valueY
#### Type declaration
**Type declaration**
| Name | Type | Description |
@@ -167,14 +166,14 @@ description for valueY
exports[`Declarations: should compile type literal declaration 1`] = `
" **typeLiteralDeclaration**: \`Object\`
#### Type declaration
**Type declaration**
| Name | Type | Description |
| :------ | :------ | :------ |
| \`valueA?\` | \`number\` | Comments for valueA |
| \`valueB?\` | \`boolean\` | - |
| \`valueC\` | { \`[dataId: string]\`: \\"ok\\" \\\\| \\"ko\\"; } | - |
| \`valueC\` | { \`[dataId: string]\`: \`"ok"\` \\| \`"ko"\`; } | - |
| \`valueX\` | { \`valueA\`: \`number\`[] ; \`valueY\`: (\`z\`: \`string\`) => { \`a\`: \`string\` ; \`b\`: \`string\` } ; \`valueZ\`: \`string\` } | Comment for valueX |
| \`valueX.valueA\` | \`number\`[] | - |
| \`valueX.valueY\` | (\`z\`: \`string\`) => { \`a\`: \`string\` ; \`b\`: \`string\` } | - |

View File

@@ -3,68 +3,49 @@
exports[`Generics: should compile class with type params 1`] = `
"[partial: breadcrumbs]
# Class: ClassWithTypeParams<T, V\\\\>
# Class: ClassWithTypeParams<T, V\\>
[partial: comment]
## Type parameters
**Type parameters**
| Name |
| :------ |
| \`T\` || \`V\` |
## Table of contents
### Constructors
- [constructor](ClassWithTypeParams.md#constructor)
### Properties
- [propT](ClassWithTypeParams.md#propt)
- [propV](ClassWithTypeParams.md#propv)
- \`T\`
- \`V\`
[partial: toc]
[partial: members]"
`;
exports[`Generics: should compile function with a simple type param' 1`] = `
"**functionWithTypeParam**<\`A\`\\\\>(): \`boolean\`
"» **functionWithTypeParam**<\`A\`\\>(): \`boolean\`
#### Type parameters
**Type parameters**
| Name |
| :------ |
| \`A\` |
- \`A\`
#### Returns
\`boolean\`
**Returns**
[partial: sources]"
\`boolean\`"
`;
exports[`Generics: should compile function with complex type params' 1`] = `
"**functionWithTypeParams**<\`A\`, \`B\`, \`C\`\\\\>(): \`boolean\`
"» **functionWithTypeParams**<\`A\`, \`B\`, \`C\`\\>(): \`boolean\`
[partial: comment]
#### Type parameters
**Type parameters**
| Name | Type | Description |
| :------ | :------ | :------ |
| \`A\` | extends [\`ClassWithTypeParams\`](ClassWithTypeParams.md)<\`string\`, \`number\`, \`A\`\\\\> | [partial: comment] || \`B\` | \`string\` \\\\| \`boolean\` | [partial: comment] || \`C\` | \`string\` | - |
- \`A\` *extends* [\`ClassWithTypeParams\`](Modules.md#classwithtypeparams)<\`string\`, \`number\`, \`A\`\\>[partial: comment]
- \`B\` = \`string\` \\| \`boolean\`[partial: comment]
- \`C\` = \`string\`
#### Returns
\`boolean\`
**Returns**
[partial: sources]"
\`boolean\`"
`;
exports[`Generics: should compile generics with defaults' 1`] = `
@@ -74,7 +55,7 @@ exports[`Generics: should compile generics with defaults' 1`] = `
`;
exports[`Generics: should compile type with nested generics' 1`] = `
" **nestedGenerics**: [\`Generic1\`](../modules.md#generic1)<[\`Generic2\`](../modules.md#generic2)<[\`Generic3\`](../modules.md#generic3)<\`string\`\\\\>\\\\>\\\\>
" **nestedGenerics**: [\`Generic1\`](Modules.md#generic1)<[\`Generic2\`](Modules.md#generic2)<[\`Generic3\`](Modules.md#generic3)<\`string\`\\>\\>\\>
[partial: sources]"
`;

View File

@@ -1,13 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Hierarchy: should compile nested type hierarchy 1`] = `
"[\`ParentClass\`](ParentClass.md)
- **\`ChildClassA\`**
- [\`GrandChildClassA\`](GrandChildClassA.md)"
"- [\`ParentClass\`](Modules.md#parentclass)
- **ChildClassA**
- [\`GrandChildClassA\`](Modules.md#grandchildclassa)"
`;
exports[`Hierarchy: should compile type hierarchy 1`] = `
"**\`ParentClass\`**
- [\`ChildClassA\`](ChildClassA.md)
- [\`ChildClassB\`](ChildClassB.md)"
"- **ParentClass**
- [\`ChildClassA\`](Modules.md#childclassa)
- [\`ChildClassB\`](Modules.md#childclassb)"
`;

View File

@@ -9,16 +9,28 @@ exports[`Members: (member) should compile members with getter' 1`] = `"[partial:
exports[`Members: (member) should compile members with setter' 1`] = `"[partial: member]"`;
exports[`Members: (members) should compile class members' 1`] = `
"## Constructors
"#### Constructors
[partial: member]
## Properties
---
#### Properties
[partial: member]
## Accessors
---
#### Accessors
[partial: member]
---
[partial: member]"

View File

@@ -1,39 +1,33 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Signatures: should compile a promise that returns a symbol' 1`] = `
"**promiseReturningASymbol**(): [\`Promise\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[\`User\`](../modules.md#user)\\\\>
"» **promiseReturningASymbol**(): [\`Promise\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[\`User\`](Modules.md#user)\\>
#### Returns
**Returns**
[\`Promise\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[\`User\`](../modules.md#user)\\\\>
[partial: sources]"
[\`Promise\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[\`User\`](Modules.md#user)\\>"
`;
exports[`Signatures: should compile a promise that returns an object' 1`] = `
"**promiseReturningAnObject**(): [\`Promise\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<{ \`data\`: \`string\` ; \`id\`: \`string\` }\\\\>
"» **promiseReturningAnObject**(): [\`Promise\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<{ \`data\`: \`string\` ; \`id\`: \`string\` }\\>
#### Returns
**Returns**
[\`Promise\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<{ \`data\`: \`string\` ; \`id\`: \`string\` }\\\\>
[partial: sources]"
[\`Promise\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<{ \`data\`: \`string\` ; \`id\`: \`string\` }\\>"
`;
exports[`Signatures: should compile callable signature' 1`] = `
"**CallableSignature**(): \`string\`
"» **CallableSignature**(): \`string\`
#### Returns
**Returns**
\`string\`
[partial: sources]"
\`string\`"
`;
exports[`Signatures: should compile class with constructor' 1`] = `
"**new ClassWithConstructor**(\`x\`: \`string\`, \`y\`: \`string\`)
"» **new ClassWithConstructor**(\`x\`: \`string\`, \`y\`: \`string\`): [\`ClassWithConstructor\`](Modules.md#classwithconstructor)
#### Parameters
**Parameters**
| Name | Type |
@@ -42,29 +36,32 @@ exports[`Signatures: should compile class with constructor' 1`] = `
| \`y\` | \`string\` |
[partial: sources]"
**Returns**
[\`ClassWithConstructor\`](Modules.md#classwithconstructor)"
`;
exports[`Signatures: should compile function that returns a function' 1`] = `
"**functionReturningAFunction**(): <T\\\\>(\`x\`: \`string\`) => \`boolean\`
"» **functionReturningAFunction**(): <T\\>(\`x\`: \`string\`) => \`boolean\`
Comments for function
#### Returns
**Returns**
\`fn\`
<\`T\`\\\\>(\`x\`: \`string\`): \`boolean\`
Return comments
##### Type parameters
» <\`T\`\\>(\`x\`: \`string\`): \`boolean\`
| Name |
| :------ |
| \`T\` |
**Type parameters**
##### Parameters
- \`T\`
**Parameters**
| Name | Type |
@@ -72,40 +69,38 @@ Comments for function
| \`x\` | \`string\` |
##### Returns
**Returns**
\`boolean\`
[partial: sources]"
\`boolean\`"
`;
exports[`Signatures: should compile function that returns an object' 1`] = `
"**functionReturningAnObject**(): \`Object\`
"» **functionReturningAnObject**(): \`Object\`
Comments for function
#### Returns
**Returns**
\`Object\`
Return comments
| Name | Type |
| :------ | :------ |
| \`x\` | \`number\` |
| \`y\` | \`number\` |
[partial: sources]"
"
`;
exports[`Signatures: should compile function with nested typen params' 1`] = `
"**functionWithNestedParams**(\`params\`: \`Object\`, \`context\`: \`any\`): \`boolean\`
"» **functionWithNestedParams**(\`params\`: \`Object\`, \`context\`: \`any\`): \`boolean\`
Some nested params.
#### Parameters
**Parameters**
| Name | Type | Description |
@@ -121,124 +116,112 @@ Some nested params.
| \`context\` | \`any\` | The context of the method call. |
#### Returns
**Returns**
\`boolean\`
[partial: sources]"
\`boolean\`"
`;
exports[`Signatures: should compile function with reference type' 1`] = `
"**functionWithReferenceType**(\`descriptor\`: \`TypedPropertyDescriptor\`<\`any\`\\\\>): \`boolean\`
"» **functionWithReferenceType**(\`descriptor\`: \`TypedPropertyDescriptor\`<\`any\`\\>): \`boolean\`
#### Parameters
**Parameters**
| Name | Type |
| :------ | :------ |
| \`descriptor\` | \`TypedPropertyDescriptor\`<\`any\`\\\\> |
| \`descriptor\` | \`TypedPropertyDescriptor\`<\`any\`\\> |
#### Returns
**Returns**
\`boolean\`
[partial: sources]"
\`boolean\`"
`;
exports[`Signatures: should compile named parameters with comments' 1`] = `
"**functionWithNamedParamsAndComments**(\`__namedParameters?\`: \`Object\`, \`anotherParam\`: \`string\`): \`void\`
"» **functionWithNamedParamsAndComments**(\`«destructured»?\`: \`Object\`, \`anotherParam\`: \`string\`): \`void\`
FOO
#### Parameters
**Parameters**
| Name | Type | Description |
| :------ | :------ | :------ |
| \`__namedParameters\` | \`Object\` | various options |
| \`__namedParameters.bar?\` | \`number\` | - |
| \`__namedParameters.foo?\` | \`number\` | - |
| \`anotherParam\` | \`string\` | - |
| \`«destructured»\` | \`Object\` | various options |
|  \`bar?\` | \`number\` | - |
|  \`foo?\` | \`number\` | - |
| \`anotherParam\` | \`string\` | Another param comment |
#### Returns
**Returns**
\`void\`
[partial: sources]"
\`void\`"
`;
exports[`Signatures: should compile named parameters' 1`] = `
"**functionWithNamedParams**(\`__namedParameters\`: \`Object\`): \`string\`
"» **functionWithNamedParams**(\`«destructured»\`: \`Object\`): \`string\`
#### Parameters
**Parameters**
| Name | Type |
| :------ | :------ |
| \`__namedParameters\` | \`Object\` |
| \`«destructured»\` | \`Object\` |
#### Returns
**Returns**
\`string\`
[partial: sources]"
\`string\`"
`;
exports[`Signatures: should compile pipes in params and comments' 1`] = `
"**functionWithPipesInParamsAndComments**(\`n\`: \`number\`): \`number\` \\\\| null
"» **functionWithPipesInParamsAndComments**(\`n\`: \`number\`): \`number\` \\| \`null\`
#### Parameters
**Parameters**
| Name | Type | Description |
| :------ | :------ | :------ |
| \`n\` | \`number\` | a\\\\|b |
| \`n\` | \`number\` | a\\|b |
#### Returns
**Returns**
\`number\` \\\\| null
[partial: sources]"
\`number\` \\| \`null\`"
`;
exports[`Signatures: should compile signature with @return comments' 1`] = `
"**commentsInReturn**(): \`boolean\`
"» **commentsInReturn**(): \`boolean\`
Comments with a return definition
#### Returns
**Returns**
\`boolean\`
[partial: sources]"
Return comments"
`;
exports[`Signatures: should compile signature with a flag' 1`] = `
"\`Private\` **privateFunction**(): \`string\`
"» \`Private\` **privateFunction**(): \`string\`
#### Returns
**Returns**
\`string\`
[partial: sources]"
\`string\`"
`;
exports[`Signatures: should compile signature with default values' 1`] = `
"**functionWithDefaults**(\`valueA?\`: \`string\`, \`valueB?\`: \`number\`, \`valueC?\`: \`number\`, \`valueD?\`: \`boolean\`, \`valueE?\`: \`boolean\`, \`valueF?\`: \`string\`): \`string\`
"» **functionWithDefaults**(\`valueA?\`: \`string\`, \`valueB?\`: \`number\`, \`valueC?\`: \`number\`, \`valueD?\`: \`boolean\`, \`valueE?\`: \`boolean\`, \`valueF?\`: \`string\`): \`string\`
This is a function with a parameter that has a default value.
#### Parameters
**Parameters**
| Name | Type | Default value | Description |
@@ -251,19 +234,17 @@ This is a function with a parameter that has a default value.
| \`valueF\` | \`string\` | \`'<foo>'\` | - |
#### Returns
**Returns**
\`string\`
[partial: sources]"
\`string\`"
`;
exports[`Signatures: should compile signature with optional params' 1`] = `
"**functionWithOptionalParam**(\`requiredParam\`: \`string\`, \`optionalParam?\`: \`string\`): \`void\`
"» **functionWithOptionalParam**(\`requiredParam\`: \`string\`, \`optionalParam?\`: \`string\`): \`void\`
This is a function with a parameter that is optional.
#### Parameters
**Parameters**
| Name | Type | Description |
@@ -272,19 +253,17 @@ This is a function with a parameter that is optional.
| \`optionalParam?\` | \`string\` | An optional parameter. |
#### Returns
**Returns**
\`void\`
[partial: sources]"
\`void\`"
`;
exports[`Signatures: should compile signature with params' 1`] = `
"**functionWithParameters**(\`paramZ\`: \`string\`, \`paramG\`: \`any\`, \`paramA\`: \`any\`): \`number\`
"» **functionWithParameters**(\`paramZ\`: \`string\`, \`paramG\`: \`any\`, \`paramA\`: \`any\`): \`number\`
This is a function with multiple arguments and a return value.
#### Parameters
**Parameters**
| Name | Type | Description |
@@ -294,19 +273,17 @@ This is a function with multiple arguments and a return value.
| \`paramA\` | \`any\` | This is a **parameter** pointing to an interface. |
#### Returns
**Returns**
\`number\`
[partial: sources]"
\`number\`"
`;
exports[`Signatures: should compile signature with rest params' 1`] = `
"**functionWithRest**(...\`rest\`: \`string\`[]): \`string\`
"» **functionWithRest**(...\`rest\`: \`string\`[]): \`string\`
This is a function with rest parameter.
#### Parameters
**Parameters**
| Name | Type | Description |
@@ -314,28 +291,24 @@ This is a function with rest parameter.
| \`...rest\` | \`string\`[] | The rest parameter. |
#### Returns
**Returns**
\`string\`
[partial: sources]"
\`string\`"
`;
exports[`Signatures: should compile signature with union types' 1`] = `
"**functionWithUnionTypes**(\`arg\`: \`number\` \\\\| \`boolean\`[], ...\`args\`: (\`string\` \\\\| \`number\`)[]): \`any\`
"» **functionWithUnionTypes**(\`arg\`: \`number\` \\| \`boolean\`[], ...\`args\`: (\`string\` \\| \`number\`)[]): \`any\`
#### Parameters
**Parameters**
| Name | Type |
| :------ | :------ |
| \`arg\` | \`number\` \\\\| \`boolean\`[] |
| \`...args\` | (\`string\` \\\\| \`number\`)[] |
| \`arg\` | \`number\` \\| \`boolean\`[] |
| \`...args\` | (\`string\` \\| \`number\`)[] |
#### Returns
**Returns**
\`any\`
[partial: sources]"
\`any\`"
`;

View File

@@ -2,17 +2,17 @@
exports[`Types: should compile 'array' type' 1`] = `"\`string\`[]"`;
exports[`Types: should compile 'intersection' type' 1`] = `"[\`IntersectionClassA\`](IntersectionClassA.md) & [\`IntersectionClassB\`](IntersectionClassB.md)"`;
exports[`Types: should compile 'intersection' type' 1`] = `"[\`IntersectionClassA\`](Modules.md#intersectionclassa) & [\`IntersectionClassB\`](Modules.md#intersectionclassb)"`;
exports[`Types: should compile 'stringLiteral' type' 1`] = `"\\"blue\\""`;
exports[`Types: should compile 'stringLiteral' type' 1`] = `"\`"blue"\`"`;
exports[`Types: should compile 'tuple' type' 1`] = `"[\`string\`, \`number\`]"`;
exports[`Types: should compile 'typeOperator' type ' 1`] = `"unique \`symbol\`"`;
exports[`Types: should compile 'union' of literal declarations 1`] = `"{ \`bar\`: \\" \\" \\\\| \\"string\\" \\\\| \\"strong\\\\|with\\\\|pipes\\" \\\\| \\"type\\\\\`with\\\\\`backticks\\" \\\\| \\"*\\" }"`;
exports[`Types: should compile 'union' of literal declarations 1`] = `"{ \`bar\`: \`" "\` \\| \`"string"\` \\| \`"strong|with|pipes"\` \\| \`"type\`with\`backticks"\` \\| \`"*"\` }"`;
exports[`Types: should compile 'union' of string literals types' 1`] = `"\\"ease-in\\" \\\\| \\"ease-out\\""`;
exports[`Types: should compile 'union' of string literals types' 1`] = `"\`"ease-in"\` \\| \`"ease-out"\`"`;
exports[`Types: should compile collapsed 'function' type ' 1`] = `""`;
@@ -20,7 +20,7 @@ exports[`Types: should compile collapsed 'literal' type' 1`] = `"\`Object\`"`;
exports[`Types: should compile collapsed 'objectLiteralType' type' 1`] = `"\`Object\`"`;
exports[`Types: should compile conditional type ' 1`] = `"\`T\` extends \`string\` ? \\"string\\" : \`T\` extends \`number\` ? \\"number\\" : \`T\` extends \`boolean\` ? \\"boolean\\" : \`T\` extends \`undefined\` ? \\"undefined\\" : \\"object\\""`;
exports[`Types: should compile conditional type ' 1`] = `"\`T\` extends \`string\` ? \`"string"\` : \`T\` extends \`number\` ? \`"number"\` : \`T\` extends \`boolean\` ? \`"boolean"\` : \`T\` extends \`undefined\` ? \`"undefined"\` : \`"object"\`"`;
exports[`Types: should compile expanded 'function' type ' 1`] = `""`;
@@ -30,8 +30,8 @@ exports[`Types: should compile expanded 'objectLiteralType' type' 1`] = `"{}"`;
exports[`Types: should compile intrinsic type' 1`] = `"\`string\`"`;
exports[`Types: should compile unionType with object literal type ' 1`] = `"\`string\` \\\\| { \`z\`: \`string\` }"`;
exports[`Types: should compile unionType with object literal type ' 1`] = `"\`string\` \\| { \`z\`: \`string\` }"`;
exports[`Types: should resolve external refs with type params' 1`] = `"\`ClassWithTypeParams\`<[\`HTMLElement\`]( https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement ), [\`Error\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error )\\\\>"`;
exports[`Types: should resolve external refs with type params' 1`] = `"\`ClassWithTypeParams\`<[\`HTMLElement\`]( https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement ), [\`Error\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error )\\>"`;
exports[`Types: should resolve external refs' 1`] = `"[\`HTMLElement\`]( https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement )"`;

View File

@@ -13,7 +13,7 @@ describe(`Generics:`, () => {
test(`should compile class with type params`, () => {
expect(
context.templates.reflection({
context.templates.reflectionTemplate({
model: project.getChildByName('ClassWithTypeParams'),
project: project,
} as any),

View File

@@ -1,7 +1,4 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# Changelog
# [0.11.0](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/vuepress-plugin-typedoc@0.10.3...vuepress-plugin-typedoc@0.11.0) (2022-07-25)

View File

@@ -0,0 +1,32 @@
const getReleaseLine = async (changeset, _type) => {
const [firstLine, ...futureLines] = changeset.summary
.split('\n')
.map((l) => l.trimRight());
let returnVal = `- ${firstLine}`;
if (futureLines.length > 0) {
returnVal += `\n- ${futureLines.map((l) => ` ${l}`).join('\n')}`;
}
return returnVal;
};
const getDependencyReleaseLine = async (changesets, dependenciesUpdated) => {
if (dependenciesUpdated.length === 0) return '';
const updatedDependenciesList = dependenciesUpdated.map(
(dependency) => ` - ${dependency.name}@${dependency.newVersion}`,
);
return [['- Updated peer dependencies'], ...updatedDependenciesList].join(
'\n',
);
};
const defaultChangelogFunctions = {
getReleaseLine,
getDependencyReleaseLine,
};
exports.default = defaultChangelogFunctions;

17974
yarn.lock

File diff suppressed because it is too large Load Diff