diff --git a/.vscode/settings.json b/.vscode/settings.json index 3b6e9ea..d57a0f7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,9 +8,12 @@ "editor.fontFamily": "Fira Code", "editor.fontLigatures": true, - "prettier.documentSelectors": [ - "**/*.svelte" - ], + "markdownlint.config": { + "MD033": { + "allowed_elements": ["a"] + } + }, + "prettier.documentSelectors": ["**/*.svelte"], "tailwindCSS.classAttributes": [ "class", "accent", @@ -106,4 +109,4 @@ "width", "zIndex" ] -} \ No newline at end of file +} diff --git a/mdsvex.config.js b/mdsvex.config.js index 92bfaaf..04f00d0 100644 --- a/mdsvex.config.js +++ b/mdsvex.config.js @@ -1,17 +1,17 @@ import { defineMDSveXConfig as defineConfig } from 'mdsvex'; -import headings from 'remark-autolink-headings'; import remarkExternalLinks from 'remark-external-links'; -import slug from 'remark-slug'; import remarkSetImagePath from './src/lib/utils/remark-set-image-path.js'; import remarkLinkWithImageAsOnlyChild from './src/lib/utils/remark-link-with-image-as-only-child.js'; -import remarkHeadingsPermaLinks from './src/lib/utils/remark-headings-permalinks.js'; import { toString } from 'mdast-util-to-string'; import rehypeWrap from 'rehype-wrap-all'; import rehypeImgSize from 'rehype-img-size'; import { h } from 'hastscript'; import { visit } from 'unist-util-visit'; + +import remarkUnwrapImages from 'remark-unwrap-images'; import remarkToc from 'remark-toc'; -import getHeadings from './src/lib/utils/get-headings.js'; +import rehypeSlug from 'rehype-slug'; + // import { highlightCode } from './src/lib/utils/highlighter.js'; /** @type {import('mdsvex').MdsvexOptions} */ @@ -20,55 +20,58 @@ const config = defineConfig({ smartypants: { dashes: 'oldschool' }, - // Wait for skeleton to implement Prismjs, for now use in .md files - // highlight: {}, + /* Wait for skeleton to implement Prismjs, for now use in .md files */ // layout: { // blog: './src/lib/components/blog/_blog-layout.svelte', // project: './src/lib/components/projects/_project-layout.svelte', // _: './src/lib/components/fallback/_layout.svelte' // }, + /* Plugins */ rehypePlugins: [ - [rehypeWrap, { selector: 'table', wrapper: 'div.overflow-auto' }], - [rehypeImgSize, { dir: './static' }], - [ - /** Custom rehype plugin to add loading="lazy" to all images */ - () => { - return (tree) => { - visit(tree, 'element', (node) => { - if (node.tagName === 'img') { - node.properties.loading = 'lazy'; - } - }); - }; - } - ] + [rehypeSlug] + + // [rehypeWrap, { selector: 'table', wrapper: 'div.overflow-auto' }], + // [rehypeImgSize, { dir: './static' }], + // [ + // /** Custom rehype plugin to add loading="lazy" to all images */ + // () => { + // return (tree) => { + // visit(tree, 'element', (node) => { + // if (node.tagName === 'img') { + // node.properties.loading = 'lazy'; + // } + // }); + // }; + // } + // ] ], remarkPlugins: [ - [remarkToc, { maxDepth: 3, tight: true }][ + [remarkToc, { maxDepth: 3, tight: true }], + [ (remarkExternalLinks, { target: '_blank' }) ], - slug, - [ - headings, - { - behavior: 'append', - linkProperties: {}, - content: function (node) { - return [ - h('span.icon.icon-link header-anchor', { - ariaLabel: toString(node) + ' permalink' - }) - ]; - } - } - ], - remarkSetImagePath, - remarkLinkWithImageAsOnlyChild, - remarkHeadingsPermaLinks, - getHeadings + [remarkUnwrapImages] + // [ + // headings, + // { + // behavior: 'append', + // linkProperties: {}, + // content: function (node) { + // return [ + // h('span.icon.icon-link header-anchor', { + // ariaLabel: toString(node) + ' permalink' + // }) + // ]; + // } + // } + // ], + // remarkSetImagePath, + // remarkLinkWithImageAsOnlyChild, + // remarkHeadingsPermaLinks, + // getHeadings ] }); diff --git a/mdsvex.config.ts b/mdsvex.config.ts new file mode 100644 index 0000000..1c86991 --- /dev/null +++ b/mdsvex.config.ts @@ -0,0 +1,50 @@ +import { MdsvexOptions, defineMDSveXConfig as defineConfig } from 'mdsvex'; +import headings from 'rehype-autolink-headings'; +import remarkExternalLinks from 'remark-external-links'; +import slug from 'rehype-slug'; +import remarkSetImagePath from './src/lib/utils/remark-set-image-path.js'; +import remarkLinkWithImageAsOnlyChild from './src/lib/utils/remark-link-with-image-as-only-child.js'; +import { toString } from 'mdast-util-to-string'; +import rehypeWrap from 'rehype-wrap-all'; +import rehypeImgSize from 'rehype-img-size'; +import { h } from 'hastscript'; +import { visit } from 'unist-util-visit'; +import remarkToc from 'remark-toc'; +// import { highlightCode } from './src/lib/utils/highlighter.js'; + +const config: MdsvexOptions = defineConfig({ + extensions: ['.svelte.md', '.md', '.svx'], + smartypants: { + dashes: 'oldschool' + } + // Wait for skeleton to implement Prismjs, for now use in .md files + // highlight: {}, + // layout: { + // blog: './src/lib/components/blog/_blog-layout.svelte', + // project: './src/lib/components/projects/_project-layout.svelte', + // _: './src/lib/components/fallback/_layout.svelte' + // }, + // rehypePlugins: [ + // [rehypeWrap, { selector: 'table', wrapper: 'div.overflow-auto' }], + // [rehypeImgSize, { dir: './static' }], + // [slug], + // [ + // headings, + // { + // behavior: 'prepend', + // headingProperties: {}, + // content: '' + // } + // ] + // ], + // remarkPlugins: [ + // [remarkToc, { maxDepth: 3, tight: true }], + // [remarkExternalLinks, { target: '_blank', rel: 'noreferrer' }], + // remarkSetImagePath, + // remarkLinkWithImageAsOnlyChild, + // remarkHeadingsPermaLinks, + // getHeadings + // ] +}); + +export default config; diff --git a/playwright/index.html b/playwright/index.html new file mode 100644 index 0000000..000deea --- /dev/null +++ b/playwright/index.html @@ -0,0 +1,12 @@ + + + + + + Testing Page + + +
+ + + diff --git a/playwright/index.ts b/playwright/index.ts new file mode 100644 index 0000000..ac6de14 --- /dev/null +++ b/playwright/index.ts @@ -0,0 +1,2 @@ +// Import styles, initialize component theme here. +// import '../src/common.css'; diff --git a/src/app.html b/src/app.html index 7d6784c..d2bc029 100644 --- a/src/app.html +++ b/src/app.html @@ -3,7 +3,7 @@ - +