Skip to content

Commit 9a6b8e0

Browse files
SkyZeroZxalxhub
authored andcommitted
docs(docs-infra): Refactors tutorial generation and updates ng-container docs
Updates the `ng-container` documentation page to use the correct `angular-html` code format and removes an unused CLI documentation file.
1 parent ae1c0dc commit 9a6b8e0

28 files changed

Lines changed: 54 additions & 229 deletions

adev/scripts/update-cross-repo-docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ Updates the Angular CDK API JSON files in `adev/src/content/cdk`, used for the [
1212

1313
## CLI Help Pages
1414

15-
Updates the Angular CLI help JSON files in `adev/src/content/cli/help`, used for the [angular.dev CLI](https://angular.dev/cli) pages.
15+
Updates the Angular CLI help JSON files in `adev/src/content/cli`, used for the [angular.dev CLI](https://angular.dev/cli) pages.

adev/scripts/update-cross-repo-docs/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async function main() {
2626
await updateAssets({
2727
repo: 'angular/cli-builds',
2828
assetsPath: 'help',
29-
destPath: join(import.meta.dirname, '../../src/content/cli/help'),
29+
destPath: join(import.meta.dirname, '../../src/content/cli'),
3030
});
3131

3232
console.log('\n-----------------------------------------------');

adev/shared-docs/pipeline/tutorials/playground_index.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ async function generatePlaygroundFiles(
5757
);
5858
writeFileSync(
5959
join(outputDir, path, 'source-code.json'),
60-
JSON.stringify(await generateSourceCode(config, itemFiles)),
60+
JSON.stringify(await generateSourceCode(itemFiles)),
6161
);
6262
}
6363

adev/shared-docs/pipeline/tutorials/source-code.mts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@
77
*/
88

99
import {FileSystemTree} from '@webcontainer/api';
10-
import {FileAndContentRecord, TutorialConfig} from '../../interfaces/index';
10+
import {FileAndContentRecord} from '../../interfaces/index';
1111
import {getFileSystemTree} from './webcontainers.mjs';
1212

1313
/** Generate the source-code.json content for a provided tutorial config. */
14-
export async function generateSourceCode(
15-
config: TutorialConfig,
16-
files: FileAndContentRecord,
17-
): Promise<FileSystemTree> {
14+
export async function generateSourceCode(files: FileAndContentRecord): Promise<FileSystemTree> {
1815
// TODO(josephperrott): figure out if filtering is needed for this.
1916
const allFiles = Object.keys(files);
2017
return getFileSystemTree(allFiles, files);

adev/shared-docs/pipeline/tutorials/tutorial_index.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async function generateTutorialFiles(tutorialDir: string, commonDir: string, out
5454
);
5555
writeFileSync(
5656
join(outputDir, 'source-code.json'),
57-
JSON.stringify(await generateSourceCode(introConfig, introFiles)),
57+
JSON.stringify(await generateSourceCode(introFiles)),
5858
);
5959

6060
// For each tutorial step, generate the metadata and source-code files.
@@ -75,7 +75,7 @@ async function generateTutorialFiles(tutorialDir: string, commonDir: string, out
7575
);
7676
writeFileSync(
7777
join(outputDir, path, 'source-code.json'),
78-
JSON.stringify(await generateSourceCode(config, itemFiles)),
78+
JSON.stringify(await generateSourceCode(itemFiles)),
7979
);
8080
}
8181

adev/src/assets/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ copy_to_directory(
1212
"//adev/src/content/best-practices",
1313
"//adev/src/content/best-practices/runtime-performance",
1414
"//adev/src/content/cdk:cdk_docs",
15-
"//adev/src/content/cli/help:cli_docs",
15+
"//adev/src/content/cli:cli_docs",
1616
"//adev/src/content/ecosystem",
1717
"//adev/src/content/ecosystem/rxjs-interop",
1818
"//adev/src/content/ecosystem/service-workers",
@@ -94,7 +94,7 @@ copy_to_directory(
9494
"//tools/manual_api_docs/elements:elements_docs",
9595
],
9696
replace_prefixes = {
97-
"adev/src/content/cli/help/cli_docs_html": "cli/",
97+
"adev/src/content/cli/cli_docs_html": "cli/",
9898
"adev/src/content/aria/aria_docs_html": "api/",
9999
"adev/src/content/cdk/cdk_docs_html": "api/",
100100
"adev/src/content": "",

adev/src/content/cli/BUILD.bazel

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
1+
load("//adev/shared-docs/pipeline/api-gen/rendering:render_api_to_html.bzl", "render_api_to_html")
2+
13
package(default_visibility = ["//visibility:public"])
24

5+
exports_files(["_build-info.json"])
6+
37
filegroup(
48
name = "cli",
59
srcs = glob(
6-
["**"],
10+
["*.json"],
711
exclude = [
8-
"BUILD.bazel",
12+
# Exclude _build-info.json as it is not a help entry.
13+
"_build-info.json",
914
],
10-
) + [
11-
"//adev/src/content/cli/help",
12-
"//adev/src/content/cli/help:_build-info.json",
15+
),
16+
)
17+
18+
render_api_to_html(
19+
name = "cli_docs",
20+
srcs = [
21+
":cli",
1322
],
1423
)
File renamed without changes.

0 commit comments

Comments
 (0)