Skip to content

Commit

Permalink
Merge b9fb5d8 into 8c6025f
Browse files Browse the repository at this point in the history
  • Loading branch information
straker committed Aug 1, 2019
2 parents 8c6025f + b9fb5d8 commit 6f95c45
Show file tree
Hide file tree
Showing 21 changed files with 370 additions and 546 deletions.
13 changes: 9 additions & 4 deletions doc-tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const fs = require('fs');

const optionalRegex = /^\[.*\]$/;
const kontraTypeRegex = /kontra\.(\w+)/g;
const packageVersionRegex = /{{\s?packageVersion\s?}}/g;
const packageVersionRegex = /__packageVersion__/g;
const excludeCodeRegex = /\s*\/\/ exclude-code:start[\s\S]*?\/\/ exclude-code:end/g;
const excludeScriptRegex = /\s*\/\/ exclude-script:start[\r\n]([\s\S]*?[\r\n])\/\/ exclude-script:end[\r\n]/g;
const codeRegex =/<pre>[\s\S]*?<code class="(.*)">([\s\S]*?)<\/code><\/pre>/g;
Expand Down Expand Up @@ -78,7 +78,7 @@ function buildImports(section) {
section.description = section.description
.replace(codeRegex, (match, className) => {

if (className === 'lang-js' && !match.includes('// exclude-tablist')) {
if (className === 'language-js' && !match.includes('// exclude-tablist')) {
let globalImport = match.replace(importRegex, `let {$1} = kontra`);
let esImport = match.replace(importRegex, `import {$1} from 'path/to/kontra.mjs'`);
let bundlerImport = match;
Expand Down Expand Up @@ -302,9 +302,14 @@ let tags = {
let contents = fs.readFileSync(this.tag.description);

let parseComments = require( path.join(require.resolve('livingcss'), '../lib/parseComments.js') );
let tags = require( path.join(require.resolve('livingcss'), '../lib/tags.js') );
let livingCSSTags = require( path.join(require.resolve('livingcss'), '../lib/tags.js') );
let tagList = {
...livingCSSTags,
example: tags.example,
sectionName: tags.sectionName
};

parseComments(contents.toString(), this.tag.description, tags, {
parseComments(contents.toString(), this.tag.description, tagList, {
pages: this.pages,
sections: this.sections
});
Expand Down
15 changes: 6 additions & 9 deletions docs/api/animation.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ <h1>Animation(&#8203;properties)
</li>
<li role="presentation"></li>
</ul>
<section role="tabpanel" aria-labelledby=animation-global-tab data-tabpanel="global"><pre><code class="lang-js">let { SpriteSheet, Animation } = kontra;
<section role="tabpanel" aria-labelledby=animation-global-tab data-tabpanel="global"><pre><code class="language-js">let { SpriteSheet, Animation } = kontra;

let image = new Image();
image.src = &#39;assets/imgs/character_walk_sheet.png&#39;;
Expand All @@ -101,9 +101,8 @@ <h1>Animation(&#8203;properties)
frames: [1,2,3,6],
frameRate: 30
});
};
</code></pre></section>
<section role="tabpanel" aria-labelledby=animation-es-tab data-tabpanel="es"><pre><code class="lang-js">import { SpriteSheet, Animation } from 'path/to/kontra.mjs';
};</code></pre></section>
<section role="tabpanel" aria-labelledby=animation-es-tab data-tabpanel="es"><pre><code class="language-js">import { SpriteSheet, Animation } from 'path/to/kontra.mjs';

let image = new Image();
image.src = &#39;assets/imgs/character_walk_sheet.png&#39;;
Expand All @@ -120,9 +119,8 @@ <h1>Animation(&#8203;properties)
frames: [1,2,3,6],
frameRate: 30
});
};
</code></pre></section>
<section role="tabpanel" aria-labelledby=animation-bundle-tab data-tabpanel="bundle"><pre><code class="lang-js">import { SpriteSheet, Animation } from &#39;kontra&#39;;
};</code></pre></section>
<section role="tabpanel" aria-labelledby=animation-bundle-tab data-tabpanel="bundle"><pre><code class="language-js">import { SpriteSheet, Animation } from &#39;kontra&#39;;

let image = new Image();
image.src = &#39;assets/imgs/character_walk_sheet.png&#39;;
Expand All @@ -139,8 +137,7 @@ <h1>Animation(&#8203;properties)
frames: [1,2,3,6],
frameRate: 30
});
};
</code></pre></section>
};</code></pre></section>
</div>
<h3 id="title-Animation"><span class="visually-hidden">Animation</span> Parameters</span></h3>
<dl aria-labelledby="title-Animation">
Expand Down

0 comments on commit 6f95c45

Please sign in to comment.