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 {
168
168
// folder named after the component while the overview file is named similarly. e.g.
169
169
// `cdk#overlay` -> `cdk/overlay/overlay.md`
170
170
// `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` ;
172
172
return `/docs-content/overviews/${ overviewPath } ` ;
173
173
}
174
174
}
Original file line number Diff line number Diff line change @@ -30,12 +30,12 @@ def _markdown_to_html(ctx):
30
30
for input_file in input_files :
31
31
# Determine the input file path relatively to the current package path. This is necessary
32
32
# 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 )
36
35
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 ))
39
39
40
40
# Add the input file to the command line arguments that will be passed to the
41
41
# transform-markdown executable.
@@ -69,7 +69,7 @@ markdown_to_html = rule(
69
69
"_transform_markdown" : attr .label (
70
70
default = Label ("//tools/markdown-to-html" ),
71
71
executable = True ,
72
- cfg = "host " ,
72
+ cfg = "exec " ,
73
73
),
74
74
},
75
75
)
Original file line number Diff line number Diff line change @@ -9,9 +9,6 @@ import {join} from 'path';
9
9
import { highlightCodeBlock } from '../highlight-files/highlight-code-block' ;
10
10
import { DocsMarkdownRenderer } from './docs-marked-renderer' ;
11
11
12
- // Regular expression that matches the markdown extension of a given path.
13
- const markdownExtension = / .m d $ / ;
14
-
15
12
// Custom markdown renderer for transforming markdown files for the docs.
16
13
const markdownRenderer = new DocsMarkdownRenderer ( ) ;
17
14
@@ -26,7 +23,7 @@ if (require.main === module) {
26
23
// Walk through each input file and write transformed markdown output to the specified
27
24
// Bazel bin directory.
28
25
inputFiles . forEach ( inputPath => {
29
- const outputPath = join ( bazelBinPath , inputPath . replace ( markdownExtension , '. html' ) ) ;
26
+ const outputPath = join ( bazelBinPath , ` ${ inputPath } . html` ) ;
30
27
const htmlOutput = markdownRenderer . finalizeOutput (
31
28
marked ( readFileSync ( inputPath , 'utf8' ) ) ,
32
29
inputPath ,
You can’t perform that action at this time.
0 commit comments