5eb232501f
* fix(www): link styles (#100) Co-authored-by: Nate Moore <nate@skypack.dev> * Add `assets/` (#102) * chore: add assets * docs: update readme Co-authored-by: Nate Moore <nate@skypack.dev> * docs: fix readme * docs: fix readme * chore: remove github banner * Allow multiple JSX in mustache * Manually discard package-lock update (due to local use of npm v7) * Tidy up * Revert mode ts-ignore Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> Co-authored-by: Nate Moore <nate@skypack.dev>
18 lines
439 B
JavaScript
18 lines
439 B
JavaScript
import cheerio from 'cheerio';
|
|
import prettier from 'prettier';
|
|
import { fileURLToPath } from 'url';
|
|
/** load html */
|
|
export function doc(html) {
|
|
return cheerio.load(html);
|
|
}
|
|
|
|
/**
|
|
* format the contents of an astro file
|
|
* @param contents {string}
|
|
*/
|
|
export function format(contents) {
|
|
return prettier.format(contents, {
|
|
parser: 'astro',
|
|
plugins: [fileURLToPath(new URL('../prettier-plugin-astro', import.meta.url))],
|
|
});
|
|
}
|