Skip to content

Commit

Permalink
feat: add aliases and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
amphro committed Oct 21, 2020
1 parent a4d8110 commit aaf61ad
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ditamap/base-ditamap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class BaseDitamap extends Ditamap {
constructor(topics: string[]) {
// Set the data of topic and filenames
super('cli_reference.ditamap', {
namespaceDitamapFiles: topics.map(topic => `${topic}/cli_reference_${topic}.ditamap`)
namespaceDitamapFiles: topics.sort().map(topic => `${topic}/cli_reference_${topic}.ditamap`)
});
}

Expand Down
3 changes: 3 additions & 0 deletions src/ditamap/subtopic-ditamap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import { Ditamap } from './ditamap';
export class SubTopicDitamap extends Ditamap {
constructor(topic: string, subtopic: string, commandFileNames: string[]) {
const filename = `cli_reference_${topic}_${subtopic}.ditamap`;

commandFileNames.sort();

// Set the data of topic and filenames
super(filename, {
topic,
Expand Down
16 changes: 16 additions & 0 deletions templates/command.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,21 @@ IF YOU WANT TO CHANGE THIS CONTENT, CONTACT juliet.shackell@salesforce.com FOR D
{{/each}}
</section>
{{/if}}
{{#if aliases}}
<section>
<title><ph>Aliases for <codeph otherprops="nolang">{{id}}</codeph></ph></title>
{{#each aliases}}
<codeblock otherprops="nolang">{{this}}</codeblock>
{{/each}}
</section>
{{/if}}
{{#if examples}}
<section>
<title><ph>Examples for <codeph otherprops="nolang">{{id}}</codeph></ph></title>
{{#each examples}}
{{#isCodeBlock this}}<codeblock otherprops="nolang">{{this}}</codeblock>{{else}}<p>{{this}}</p>{{/isCodeBlock}}
{{/each}}
</section>
{{/if}}
</refbody>
</reference>

0 comments on commit aaf61ad

Please sign in to comment.