Skip to content

Commit 8789b7b

Browse files
authored
Merge pull request #35 from rwjblue/more-update-docs-fixes
More tweaks to update-docs command.
2 parents 5632db9 + 24cc7c5 commit 8789b7b

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

commands/local/update-docs.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,15 @@ function updateTransformREADME(transformName) {
5151
toc.push(`* [${testName}](#${testName})`);
5252
details.push(
5353
'---',
54-
`<a id="${testName}"></a>`,
54+
`<a id="${testName}">**${testName}}**</a>`,
55+
'',
5556
`**Input** (<small>[${testName}.input${extension}](${inputPath})</small>):`,
56-
'```${extension}',
57+
'```' + extension.slice(1),
5758
fs.readFileSync(inputPath),
5859
'```',
60+
'',
5961
`**Output** (<small>[${testName}.input${extension}](${outputPath})</small>):`,
60-
'```${extension}',
62+
'```' + extension.slice(1),
6163
fs.readFileSync(outputPath),
6264
'```'
6365
);
@@ -66,7 +68,7 @@ function updateTransformREADME(transformName) {
6668
let transformREADMEPath = `transforms/${transformName}/README.md`;
6769

6870
let FIXTURES_TOC_PLACE_HOLDER = /<!--FIXTURES_TOC_START-->[\s\S]*<!--FIXTURES_TOC_END-->/;
69-
let FIXTURES_CONTENTS_PLACE_HOLDER = /<!--FIXTURES_CONTENT_START-->[\s\S]*<!--FIXTURES_CONTENT_END-->/;
71+
let FIXTURES_CONTENT_PLACE_HOLDER = /<!--FIXTURES_CONTENT_START-->[\s\S]*<!--FIXTURES_CONTENT_END-->/;
7072

7173
fs.writeFileSync(
7274
transformREADMEPath,
@@ -77,8 +79,8 @@ function updateTransformREADME(transformName) {
7779
`<!--FIXTURES_TOC_START-->\n${toc.join('\n')}\n<!--FIXTURES_TOC_END-->`
7880
)
7981
.replace(
80-
FIXTURES_CONTENTS_PLACE_HOLDER,
81-
`<!--FIXTURES_CONTENTS_START-->\n${details.join('\n')}\n<!--FIXTURES_CONTENTS_END-->`
82+
FIXTURES_CONTENT_PLACE_HOLDER,
83+
`<!--FIXTURES_CONTENT_START-->\n${details.join('\n')}\n<!--FIXTURE_CONTENT_END-->`
8284
)
8385
);
8486
}

0 commit comments

Comments
 (0)