Skip to content

Commit d802fe9

Browse files
authored
Typedoc integrated into vitepress (#793)
1 parent 43da502 commit d802fe9

File tree

13 files changed

+495
-618
lines changed

13 files changed

+495
-618
lines changed

docs/.vitepress/config.mjs

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import { defineConfig } from "vitepress";
2+
3+
import typedocSidebar from "../api/typedoc-sidebar.json";
4+
5+
// https://vitepress.dev/reference/site-config
6+
export default defineConfig({
7+
title: "ember-link",
8+
description: "Links as Primitives",
9+
base: "/ember-link/",
10+
themeConfig: {
11+
// https://vitepress.dev/reference/default-theme-config
12+
nav: [
13+
{ text: "Home", link: "/" },
14+
{ text: "Guides", link: "/getting-started" },
15+
{ text: "API", link: "/api/modules", activeMatch: "/api" },
16+
],
17+
18+
outline: [2, 3],
19+
20+
sidebar: {
21+
"/": [
22+
{
23+
text: "Guides",
24+
items: [
25+
{ text: "Getting Started", link: "/getting-started" },
26+
{ text: "Installation", link: "/installation" },
27+
{ text: "Configuration", link: "/configuration" },
28+
{ text: "Migration", link: "/migration" },
29+
],
30+
},
31+
{
32+
text: "Usage",
33+
items: [
34+
{ text: "Using Primitives", link: "/using-primitives" },
35+
{ text: "Params", link: "/params" },
36+
{ text: "Behavior", link: "/behavior" },
37+
{ text: "Link Helper", link: "/helper" },
38+
{ text: "LinkManager Service", link: "/service" },
39+
{ text: "Testing", link: "/testing" },
40+
],
41+
},
42+
{
43+
text: "Advanced",
44+
items: [
45+
{ text: "Customization", link: "/customization" },
46+
{ text: "Using Locales", link: "/using-locales" },
47+
{ text: "Link Builder", link: "/link-builder" },
48+
{ text: "Commands", link: "/commands" },
49+
],
50+
},
51+
],
52+
"/api/": [
53+
{
54+
text: "API",
55+
items: typedocSidebar,
56+
},
57+
],
58+
},
59+
60+
socialLinks: [
61+
{ icon: "github", link: "https://github.com/buschtoens/ember-link" },
62+
],
63+
},
64+
});

docs/.vitepress/config.ts

Lines changed: 0 additions & 60 deletions
This file was deleted.

docs/.vitepress/sidebar-api.ts

Lines changed: 0 additions & 89 deletions
This file was deleted.

docs/behavior.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Behavior
22

3-
[`Behavior`](./api/interfaces/ember_link.Behavior.md) controls the way links are
3+
[`Behavior`](./api/ember-link/interfaces/Behavior.md) controls the way links are
44
opened. This can be [configured globally](./configuration.md) or
55
[locally with each link](./helper.md#parameters).
66

77
## `open`
88

9-
When links are opened with [`link.open`](./api/classes/ember_link.Link.md#open)
9+
When links are opened with [`link.open`](./api/ember-link/classes/Link.md#open)
1010
it will use
1111
[`Router.transitionTo()`](https://api.emberjs.com/ember/5.0/classes/RouterService/methods/transitionTo?anchor=transitionTo)
1212
by default, but you can set it to `replace` to use

docs/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ You can configure it globally or locally and there are reasons for both.
66
## Global Behavior
77

88
Global configuration is happening through the
9-
[`LinkManagerService`](./api/classes/ember_link.LinkManagerService.md) to match
9+
[`LinkManagerService`](./api/ember-link/classes/LinkManagerService.md) to match
1010
the needs for your application:
1111

1212
```ts
@@ -28,7 +28,7 @@ export default class ApplicationRoute extends Route {
2828

2929
Local behavior can be applied for each link instance and _may_ overwrite
3030
globally configured behavior. Pass the `behavior` parameter to a
31-
[`Link`](./api/classes/ember_link.Link.md) instance.
31+
[`Link`](./api/ember-link/classes/Link.md) instance.
3232

3333
## Global vs. Local Behavior
3434

docs/service.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# `LinkManager` Service
22

33
The `LinkManager` service is used by the [`(link) helper`](./helper.md) and
4-
to create a [`Link`](./api/classes/ember_link.Link.md) instances.
4+
to create a [`Link`](./api/ember-link/classes/Link.md) instances.
55

66
You can also use this service directly to programmatically create link
77
references.
88

99
## `createLink(linkParams: LinkParams): Link`
1010

11-
Will create a [`Link`](./api/classes/ember_link.Link.md) to pass around using
11+
Will create a [`Link`](./api/ember-link/classes/Link.md)to pass around using
1212
the same parameters as [`(link) helper`](./helper.md).
1313

1414
::: info
15-
API Docs: [createLink](./api/classes/ember_link.LinkManagerService.md#createlink)
15+
API Docs: [createLink](./api/ember-link/classes/LinkManagerService.md#createlink)
1616
:::
1717

1818
## `getLinkParamsFromURL(url: string): LinkParams`
@@ -21,5 +21,5 @@ Use this method to derive `LinkParams` from a serialized, recognizable URL, that
2121
you can then pass into `createLink`.
2222

2323
::: info
24-
API Docs: [getLinkParamsFromURL](./api/classes/ember_link.LinkManagerService.md#getlinkparamsfromurl)
24+
API Docs: [getLinkParamsFromURL](./api/ember-link/classes/LinkManagerService.md#getlinkparamsfromurl)
2525
:::

docs/testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ your app boots with a fully-fledged router, so `ember-link` just works normally.
1212
In [integration / render tests (`setupRenderingTest(hooks)`)](https://guides.emberjs.com/release/testing/testing-components/) the
1313
router is not initialized, so `ember-link` can't operate normally. To still
1414
support using `(link)` & friends in render tests, you can use the
15-
[`setupLink(hooks)` test helper](./api/modules/ember_link_test_support.md#setuplink).
15+
[`setupLink(hooks)` test helper](./api/ember-link/test-support/functions/setupLink.md).
1616

1717
```ts
1818
import { click, render } from '@ember/test-helpers';

docs/using-primitives.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ That also prepares them to properly work with [testing](./testing.md).
4545

4646
## Low Level Components
4747

48-
Make [`Link`](./api/classes/ember_link.Link.md) a first-class
48+
Make [`Link`](./api/ember-link/classes/Link.md) a first-class
4949
primitive in your app architecture! Instead of manually wiring up
50-
[`Link#url`](./api/classes/ember_link.Link.md#url) and
51-
[`Link#open()`](./api/classes/ember_link.Link.md#open) every time, rather
50+
[`Link#url`](./api/ember-link/classes/Link.md#url) and
51+
[`Link#open()`](./api/ember-link/classes/Link.md#open) every time, rather
5252
create your own ready-to-use, style-guide-compliant link and button components
5353
that accept `@link` as an argument.
5454

ember-link/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@
8181
"rollup": "4.9.6",
8282
"rollup-plugin-copy": "^3.5.0",
8383
"rollup-plugin-ts": "^3.4.5",
84+
"typedoc-plugin-markdown": "^4.0.0-next.50",
85+
"typedoc-vitepress-theme": "^1.0.0-next.8",
8486
"typedoc": "^0.25.7",
85-
"typedoc-plugin-markdown": "^3.17.1",
8687
"typescript": "^5.3.3"
8788
},
8889
"engines": {

ember-link/src/services/link-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default class LinkManagerService extends Service {
2828
*/
2929
@service('router') readonly router!: RouterServiceWithRecognize;
3030

31-
[BEHAVIOR]: Behavior = {
31+
protected [BEHAVIOR]: Behavior = {
3232
open: 'transition',
3333
prevent
3434
};

ember-link/typedoc.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
{
22
"entryPoints": [
3-
"src/index.ts",
4-
"src/test-support/index.ts"
3+
"./src/index.ts",
4+
"./src/test-support/index.ts"
55
],
66
"out": "../docs/api",
7-
"json": "../docs/api/data.json",
87
"plugin": [
9-
"typedoc-plugin-markdown"
8+
"typedoc-plugin-markdown",
9+
"typedoc-vitepress-theme"
1010
],
11+
"docsRoot": "../docs",
12+
"excludeExternals": true,
1113
"excludePrivate": true,
1214
"excludeProtected": true,
13-
"excludeExternals": true,
14-
// typedoc-plugin-markdown
15-
"hideBreadcrumbs": true
15+
"useCodeBlocks": true,
16+
"parametersFormat": "table",
17+
"typeDeclarationFormat": "table",
18+
"textContentMappings": {
19+
"breadcrumbs.home": "API",
20+
"kind.typeAlias.singular": "Type",
21+
"kind.typeAlias.plural": "Types",
22+
}
1623
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"docs:preview": "vitepress preview docs"
2222
},
2323
"devDependencies": {
24-
"concurrently": "^7.6.0",
25-
"vitepress": "^1.0.0-beta.3"
24+
"concurrently": "^8.2.2",
25+
"vitepress": "^1.0.0-rc.41"
2626
},
2727
"volta": {
2828
"node": "20.11.0"

0 commit comments

Comments
 (0)