Skip to content

Commit

Permalink
fix: add alaska.md to processed doc files #170
Browse files Browse the repository at this point in the history
  • Loading branch information
rmenner authored and jason-capsule42 committed Jan 28, 2025
1 parent e35a773 commit b6d2a6d
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 1 deletion.
109 changes: 109 additions & 0 deletions docs/partials/alaska.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Alaska

The `auro-alaska` custom element is more than just an easy-to-use placement of the official logo, but it also comes with automation that will produce the proper version of the logo depending on the size of the parent container.

## Install

```bash
import "@alaskaairux/auro-icon/dist/auro-alaska";
```

## Default component

<div class="exampleWrapper">
<auro-alaska style="width: 192px"></auro-alaska>
</div>

<auro-accordion alignRight>
<span slot="trigger">See code</span>

```html
<auro-alaska style="width: 192px"></auro-alaska>
```

</auro-accordion>

<div class="exampleWrapper--ondark">
<auro-alaska onDark style="width: 192px"></auro-alaska>
</div>

<auro-accordion alignRight>
<span slot="trigger">See code</span>

```html
<auro-alaska onDark style="width: 192px"></auro-alaska>
```

</auro-accordion>

## Official logo with tagline

Using the `official` property will display the Alaska Airlines logo with the official tagline.

<div class="exampleWrapper">
<auro-alaska official style="width: 192px"></auro-alaska>
</div>

<auro-accordion alignRight>
<span slot="trigger">See code</span>

```html
<auro-alaska official style="width: 192px"></auro-alaska>
```

</auro-accordion>

<div class="exampleWrapper--ondark">
<auro-alaska official ondark style="width: 192px"></auro-alaska>
</div>

<auro-accordion alignRight>
<span slot="trigger">See code</span>

```html
<auro-alaska official ondark style="width: 192px"></auro-alaska>
```

</auro-accordion>

## Auto scale support

The Alaska Airline logo has a preferred version of the logo depending in the size of the rendering. The auro-alaska custom element is auto-aware and will display the proper version of the logo depending on the size of the container automatically.

<div class="exampleWrapper">
<auro-alaska style="width: 72px"></auro-alaska><br>
<auro-alaska style="width: 108px"></auro-alaska><br>
<auro-alaska style="width: 192px"></auro-alaska><br>
<auro-alaska style="width: 528px"></auro-alaska>
</div>

<auro-accordion alignRight>
<span slot="trigger">See code</span>

```html
<auro-alaska style="width: 72px"></auro-alaska>
<auro-alaska style="width: 108px"></auro-alaska>
<auro-alaska style="width: 192px"></auro-alaska>
<auro-alaska style="width: 528px"></auro-alaska>
```

</auro-accordion>

<div class="exampleWrapper">
<auro-alaska official style="width: 72px"></auro-alaska><br>
<auro-alaska official style="width: 108px"></auro-alaska><br>
<auro-alaska official style="width: 192px"></auro-alaska><br>
<auro-alaska official style="width: 528px"></auro-alaska>
</div>

<auro-accordion alignRight>
<span slot="trigger">See code</span>

```html
<auro-alaska official style="width: 72px"></auro-alaska>
<auro-alaska official style="width: 108px"></auro-alaska>
<auro-alaska official style="width: 192px"></auro-alaska>
<auro-alaska official style="width: 528px"></auro-alaska>
```

</auro-accordion>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
"build:ci": "npm-run-all sweep build:release",
"build:api": "wca 'docs/wca/*' --outFiles docs/api.md",
"build:dev:assets": "npm-run-all build:sass:component postCss:component sass:render build:docs",
"build:docs": "node ./node_modules/@aurodesignsystem/auro-library/scripts/build/generateDocs.mjs",
"build:docs": "node ./packageScripts/processDocs.mjs",
"build:sass": "npm-run-all build:sass:component postCss:component sass:render",
"build:sass:component": "sass --no-source-map src:src",
"build:watch": "nodemon -e scss,js,html --watch src --watch apiExamples/**/* --exec npm run build:dev:assets",
Expand Down
44 changes: 44 additions & 0 deletions packageScripts/processDocs.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { fileConfigs as defaultFileConfigs, defaultDocsProcessorConfig } from "@aurodesignsystem/auro-library/scripts/build/processors/defaultDocsProcessor.mjs";
import { Logger } from "@aurodesignsystem/auro-library/scripts/utils/logger.mjs";
import {
fromAuroComponentRoot,
processContentForFile,
templateFiller
} from "@aurodesignsystem/auro-library/scripts/utils/sharedFileProcessorUtils.mjs";

/**
* @param {ProcessorConfig} config - The configuration for this processor.
* @returns {import('@aurodesignsystem/auro-library/scripts/utils/sharedFileProcessorUtils').FileProcessorConfig[]}
*/
export const fileConfigs = (config) => [
...defaultFileConfigs(config),
{
identifier: 'alaska.md',
input: fromAuroComponentRoot(`docs/partials/alaska.md`),
output: fromAuroComponentRoot(`demo/alaska.md`)
}
];

/**
*
* @param {ProcessorConfig} config - The configuration for this processor.
* @return {Promise<void>}
*/
export async function processDocFiles(config = defaultDocsProcessorConfig) {
// setup
await templateFiller.extractNames();

for (const fileConfig of fileConfigs(config)) {
try {
// eslint-disable-next-line no-await-in-loop
await processContentForFile(fileConfig);
} catch (err) {
Logger.error(`Error processing ${fileConfig.identifier}: ${err.message}`);
}
}
}

processDocFiles().catch(err => {
Logger.error(`Failed to process docs: ${err}`);
});

0 comments on commit b6d2a6d

Please sign in to comment.