Skip to content

build: switch to docs-content from examples package #14612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/material-examples/example-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ export class ExampleData {
/** Description of the example. */
description: string;

/** Path to the example. This is based on the structure of the material.angular.io repo. */
examplePath: string;

/** List of files that are part of this example. */
exampleFiles: string[];

Expand All @@ -38,7 +35,6 @@ export class ExampleData {

// TODO(tinayuangao): Do not hard-code extensions
this.exampleFiles = ['html', 'ts', 'css'].map(extension => `${example}-example.${extension}`);
this.examplePath = `/assets/stackblitz/examples/${example}/`;
this.selectorName = this.indexFilename = `${example}-example`;

if (exampleConfig.additionalFiles) {
Expand Down
2 changes: 2 additions & 0 deletions tools/dgeni/templates/constant.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ <h4 id="{$ constant.name $}" class="docs-header-link docs-api-h4 docs-api-consta
<p class="docs-api-constant-description">{$ constant.description | marked | safe $}</p>
{%- endif -%}

<div class="docs-markdown">
<pre class="docs-markdown-pre">
<code class="docs-markdown-code">
{%- highlight "typescript" -%}
const {$ constant.name | safe $}: {$ constant.type | safe $};
{%- end_highlight -%}
</code>
</pre>
</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation seems amiss here (and below)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's actually by intention because if we indent the <div> here, the pre and code element would have some additional whitespace and throw off the docs.

I tried using a HTML minifier for Bazel and tested it, but the whitespaces were preserved. That's why the pre and code already were indented in that way (we use a minifier at the moment;)

2 changes: 2 additions & 0 deletions tools/dgeni/templates/type-alias.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ <h4 id="{$ alias.name $}" class="docs-header-link docs-api-h4 docs-api-type-alia
<p class="docs-api-type-alias-description">{$ alias.description | marked | safe $}</p>
{%- endif -%}

<div class="docs-markdown">
<pre class="docs-markdown-pre">
<code class="docs-markdown-code">
{%- highlight "typescript" -%}
type {$ alias.name | safe $} = {$ alias.typeDefinition | safe $};
{%- end_highlight -%}
</code>
</pre>
</div>
4 changes: 2 additions & 2 deletions tools/package-docs-content/package-docs-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ function getBazelActionArguments() {
}

if (require.main === module) {
// The script expects the output path as first argument. All remaining arguments will be
// considered as markdown input files that need to be transformed.
// Process all file pairs that have been passed to this executable. Each argument will
// consist of the input file path and the desired output location.
getBazelActionArguments().forEach(argument => {
// Each argument that has been passed consists of an input file path and the expected
// output path. e.g. {path_to_input_file},{expected_output_path}
Expand Down