File tree Expand file tree Collapse file tree 3 files changed +8
-11
lines changed
material.angular.io/src/app/pages/component-viewer Expand file tree Collapse file tree 3 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ export class ComponentOverview extends ComponentBaseView {
168168 // folder named after the component while the overview file is named similarly. e.g.
169169 // `cdk#overlay` -> `cdk/overlay/overlay.md`
170170 // `material#button` -> `material/button/button.md`
171- const overviewPath = doc . overviewPath || `${ doc . packageName } /${ doc . id } /${ doc . id } .html` ;
171+ const overviewPath = doc . overviewPath || `${ doc . packageName } /${ doc . id } /${ doc . id } .md. html` ;
172172 return `/docs-content/overviews/${ overviewPath } ` ;
173173 }
174174}
Original file line number Diff line number Diff line change @@ -30,12 +30,12 @@ def _markdown_to_html(ctx):
3030 for input_file in input_files :
3131 # Determine the input file path relatively to the current package path. This is necessary
3232 # because we want to preserve directories for the input files and `declare_file` expects a
33- # path that is relative to the current package. Also note that we should not use `.replace`
34- # here because the extension can be also in upper case.
35- relative_basepath = _relative_to_label (ctx .label , input_file .short_path )[:- len (".md" )]
33+ # path that is relative to the current package.
34+ relative_basepath = _relative_to_label (ctx .label , input_file .short_path )
3635
37- # For each input file "xxx.md", we want to write an output file "xxx.html"
38- expected_outputs += [ctx .actions .declare_file ("%s.html" % relative_basepath )]
36+ # For each input file "xxx.md", we want to write an output file "xxx.md.html"
37+ # Note: we preserve the `.md` text to avoid collisions with real templates.
38+ expected_outputs .append (ctx .actions .declare_file ("%s.html" % relative_basepath ))
3939
4040 # Add the input file to the command line arguments that will be passed to the
4141 # transform-markdown executable.
@@ -69,7 +69,7 @@ markdown_to_html = rule(
6969 "_transform_markdown" : attr .label (
7070 default = Label ("//tools/markdown-to-html" ),
7171 executable = True ,
72- cfg = "host " ,
72+ cfg = "exec " ,
7373 ),
7474 },
7575)
Original file line number Diff line number Diff line change @@ -9,9 +9,6 @@ import {join} from 'path';
99import { highlightCodeBlock } from '../highlight-files/highlight-code-block' ;
1010import { DocsMarkdownRenderer } from './docs-marked-renderer' ;
1111
12- // Regular expression that matches the markdown extension of a given path.
13- const markdownExtension = / .m d $ / ;
14-
1512// Custom markdown renderer for transforming markdown files for the docs.
1613const markdownRenderer = new DocsMarkdownRenderer ( ) ;
1714
@@ -26,7 +23,7 @@ if (require.main === module) {
2623 // Walk through each input file and write transformed markdown output to the specified
2724 // Bazel bin directory.
2825 inputFiles . forEach ( inputPath => {
29- const outputPath = join ( bazelBinPath , inputPath . replace ( markdownExtension , '. html' ) ) ;
26+ const outputPath = join ( bazelBinPath , ` ${ inputPath } . html` ) ;
3027 const htmlOutput = markdownRenderer . finalizeOutput (
3128 marked ( readFileSync ( inputPath , 'utf8' ) ) ,
3229 inputPath ,
You can’t perform that action at this time.
0 commit comments