Skip to content

Commit

Permalink
perf(demo): update demo file names
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanjones243 committed Feb 12, 2024
1 parent 0079666 commit 42c083e
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 82 deletions.
63 changes: 0 additions & 63 deletions .github/ISSUE_TEMPLATE/publish_component.md

This file was deleted.

2 changes: 1 addition & 1 deletion demo/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
See LICENSE in the project root for license information.
HTML in this document is standardized and NOT to be edited.
All demo code should be added/edited in ./demo/apiExamples.md
All demo code should be added/edited in ./demo/api.md
With the exception of adding custom elements if needed for the demo.
Expand Down
4 changes: 0 additions & 4 deletions demo/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,6 @@ Within the scope of the auro-dialog there is `aria-labelledby="dialog-header"`.
<div>
<auro-button onClick="toggleDialog('#unformattedMdDialog')">Unformatted Medium Dialog</auro-button>
</div>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/auro-dialog@latest/dist/style-unformatted.css" />
<auro-dialog id="unformattedMdDialog" unformatted md lg ondark>
<span slot="content">
<img style="display: block; width: 100%" src="https://blog.alaskaair.com/wp-content/uploads/2020/11/111-psp-blog-img-guide.jpg" alt="alaska airlines pride lights" />
Expand All @@ -651,7 +650,6 @@ Within the scope of the auro-dialog there is `aria-labelledby="dialog-header"`.
<div>
<auro-button onClick="toggleDialog('#unformattedMdDialog')">Unformatted Medium Dialog</auro-button>
</div>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/auro-dialog@latest/dist/style-unformatted.css" />
<auro-dialog id="unformattedMdDialog" unformatted md lg ondark>
<span slot="content">
<img style="display: block; width: 100%" src="https://blog.alaskaair.com/wp-content/uploads/2020/11/111-psp-blog-img-guide.jpg" alt="alaska airlines pride lights" />
Expand All @@ -675,7 +673,6 @@ When using the dialog with the `unformatted` attribute, some may want to adjust
<div>
<auro-button onClick="toggleDialog('#unformattedCustomMdDialog')">Unformatted w/custom close button</auro-button>
</div>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/auro-dialog@latest/dist/style-unformatted.css" />
<style>
.example::part(close-button) {
top: var(--ds-size-400);
Expand Down Expand Up @@ -703,7 +700,6 @@ When using the dialog with the `unformatted` attribute, some may want to adjust
<div>
<auro-button onClick="toggleDialog('#unformattedCustomMdDialog')">Unformatted w/custom close button</auro-button>
</div>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/auro-dialog@latest/dist/style-unformatted.css" />
<style>
.example::part(close-button) {
top: var(--ds-size-400);
Expand Down
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
See LICENSE in the project root for license information.
HTML in this document is standardized and NOT to be edited.
All demo code should be added/edited in ./demo/demo.md
All demo code should be added/edited in ./demo/index.md
With the exception of adding custom elements if needed for the demo.
Expand Down
4 changes: 2 additions & 2 deletions demo/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
The demo.md file is a compiled document. No edits should be made directly to this file.
The index.md file is a compiled document. No edits should be made directly to this file.
README.md is created by running `npm run build:docs`.
This file is generated based on a template fetched from `./docs/partials/demo.md`
This file is generated based on a template fetched from `./docs/partials/index.md`
-->

# Dialog
Expand Down
4 changes: 2 additions & 2 deletions docs/partials/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
The demo.md file is a compiled document. No edits should be made directly to this file.
The index.md file is a compiled document. No edits should be made directly to this file.
README.md is created by running `npm run build:docs`.
This file is generated based on a template fetched from `./docs/partials/demo.md`
This file is generated based on a template fetched from `./docs/partials/index.md`
-->

# Dialog
Expand Down
18 changes: 9 additions & 9 deletions scripts/generateDocs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ function formatApiTableContents(content, destination) {

fs.writeFileSync(destination, result, { encoding: 'utf8'});

fs.readFile('./demo/apiExamples.md', 'utf8', function(err, data) {
formatTemplateFileContents(data, './demo/apiExamples.md');
fs.readFile('./demo/api.md', 'utf8', function(err, data) {
formatTemplateFileContents(data, './demo/api.md');
});
}

Expand Down Expand Up @@ -123,7 +123,7 @@ function processReadme() {
}

/**
* Compiles `./docTemplates/demo.md` -> `./demo/index.md`
* Compiles `./docTemplates/index.md` -> `./demo/index.md`
*/

function processDemo() {
Expand All @@ -148,17 +148,17 @@ function processDemo() {
}

/**
* Compiles `./docTemplates/apiExamples.md` -> `./demo/apiExamples.md`
* Compiles `./docTemplates/api.md` -> `./demo/api.md`
*/

function processApiExamples() {
const callback = function(updatedContent, outputConfig) {
if (fs.existsSync('./demo/apiExamples.md')) {
fs.readFile('./demo/apiExamples.md', 'utf8', function(err, data) {
formatApiTableContents(data, './demo/apiExamples.md');
if (fs.existsSync('./demo/api.md')) {
fs.readFile('./demo/api.md', 'utf8', function(err, data) {
formatApiTableContents(data, './demo/api.md');
});
} else {
console.log('ERROR: ./demo/apiExamples.md file is missing');
console.log('ERROR: ./demo/api.md file is missing');
}
};

Expand All @@ -167,7 +167,7 @@ function processApiExamples() {
outputDir: './demo'
};

const markdownPath = path.join(__dirname, '../docs/partials/apiExamples.md');
const markdownPath = path.join(__dirname, '../docs/partials/api.md');

markdownMagic(markdownPath, config, callback);
}
Expand Down

0 comments on commit 42c083e

Please sign in to comment.