Skip to content

Commit 5f7d560

Browse files
committed
feat(docs): add ng-doc
1 parent 7765c78 commit 5f7d560

10 files changed

Lines changed: 12954 additions & 9388 deletions

File tree

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/node_modules
22
/dist
33
/.angular/cache
4+
/.nx/cache
45
/.eslintcache
56

7+
/ng-doc
8+
69
/.vscode/*
710
!/.vscode/settings.json
811
!/.vscode/tasks.json
912
!/.vscode/launch.json
1013
!/.vscode/extensions.json
11-
12-
13-
.nx/cache

docs/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
"@angular/forms": "17.x.x",
1111
"@angular/platform-browser": "17.x.x",
1212
"@angular/router": "17.x.x",
13+
"@ng-doc/app": "17.5.5",
14+
"@ng-doc/core": "17.5.5",
15+
"@ng-doc/ui-kit": "17.5.5",
1316
"rxjs": "7.x.x",
1417
"tslib": "2.x.x"
1518
}

docs/project.json

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,39 @@
1111
"prefix": "adoc",
1212
"targets": {
1313
"build": {
14-
"executor": "@angular-devkit/build-angular:application",
14+
"executor": "@ng-doc/builder:application",
1515
"options": {
1616
"outputPath": "dist/docs",
1717
"index": "docs/src/index.html",
1818
"browser": "docs/src/main.ts",
1919
"polyfills": ["zone.js"],
2020
"tsConfig": "docs/tsconfig.app.json",
2121
"inlineStyleLanguage": "scss",
22-
"assets": ["docs/src/favicon.ico", "docs/src/assets"],
23-
"styles": ["docs/src/styles.scss"],
24-
"scripts": []
22+
"assets": [
23+
{
24+
"glob": "**/*",
25+
"input": "node_modules/@ng-doc/app/assets",
26+
"output": "assets/ng-doc/app"
27+
},
28+
{
29+
"glob": "**/*",
30+
"input": "node_modules/@ng-doc/ui-kit/assets",
31+
"output": "assets/ng-doc/ui-kit"
32+
},
33+
{
34+
"glob": "**/*",
35+
"input": "ng-doc/docs/assets",
36+
"output": "assets/ng-doc"
37+
},
38+
"docs/src/favicon.ico",
39+
"docs/src/assets"
40+
],
41+
"styles": [
42+
"node_modules/@ng-doc/app/styles/global.css",
43+
"docs/src/styles.scss"
44+
],
45+
"scripts": [],
46+
"allowedCommonJsDependencies": ["@ng-doc/core"]
2547
},
2648
"configurations": {
2749
"production": {
@@ -48,7 +70,7 @@
4870
"defaultConfiguration": "production"
4971
},
5072
"serve": {
51-
"executor": "@angular-devkit/build-angular:dev-server",
73+
"executor": "@ng-doc/builder:dev-server",
5274
"configurations": {
5375
"production": {
5476
"buildTarget": "docs:build:production"

docs/src/app/app.component.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<ng-doc-root>
2+
<ng-doc-navbar [leftContent]="leftContent">
3+
<ng-template #leftContent>
4+
<h3 style="margin: 0">MyAwesomeDoc</h3>
5+
</ng-template>
6+
</ng-doc-navbar>
7+
<ng-doc-sidebar />
8+
<router-outlet />
9+
</ng-doc-root>

docs/src/app/app.component.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
import { Component } from '@angular/core';
22
import { RouterOutlet } from '@angular/router';
3+
import {
4+
NgDocNavbarComponent,
5+
NgDocRootComponent,
6+
NgDocSidebarComponent,
7+
} from '@ng-doc/app';
38

49
@Component({
510
selector: 'adoc-root',
611
standalone: true,
7-
imports: [RouterOutlet],
12+
imports: [
13+
RouterOutlet,
14+
NgDocRootComponent,
15+
NgDocNavbarComponent,
16+
NgDocSidebarComponent,
17+
],
818
templateUrl: './app.component.html',
919
styleUrl: './app.component.scss',
1020
})

docs/src/app/app.config.ts

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,37 @@
1+
import {
2+
provideHttpClient,
3+
withFetch,
4+
withInterceptorsFromDi,
5+
} from '@angular/common/http';
16
import { ApplicationConfig } from '@angular/core';
2-
import { provideRouter } from '@angular/router';
3-
4-
import { routes } from './app.routes';
7+
import { provideAnimations } from '@angular/platform-browser/animations';
8+
import { provideRouter, withInMemoryScrolling } from '@angular/router';
9+
import {
10+
NG_DOC_DEFAULT_PAGE_PROCESSORS,
11+
NG_DOC_DEFAULT_PAGE_SKELETON,
12+
NgDocDefaultSearchEngine,
13+
provideMainPageProcessor,
14+
provideNgDocApp,
15+
providePageSkeleton,
16+
provideSearchEngine,
17+
} from '@ng-doc/app';
18+
import { NG_DOC_ROUTING, provideNgDocContext } from '@ng-doc/generated';
519

620
export const appConfig: ApplicationConfig = {
7-
providers: [provideRouter(routes)],
21+
providers: [
22+
provideAnimations(),
23+
provideRouter(
24+
NG_DOC_ROUTING,
25+
withInMemoryScrolling({
26+
scrollPositionRestoration: 'enabled',
27+
anchorScrolling: 'enabled',
28+
}),
29+
),
30+
provideHttpClient(withInterceptorsFromDi(), withFetch()),
31+
provideNgDocContext(),
32+
provideNgDocApp(),
33+
provideSearchEngine(NgDocDefaultSearchEngine),
34+
providePageSkeleton(NG_DOC_DEFAULT_PAGE_SKELETON),
35+
provideMainPageProcessor(NG_DOC_DEFAULT_PAGE_PROCESSORS),
36+
],
837
};

docs/src/app/app.routes.ts

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

0 commit comments

Comments
 (0)