Skip to content

Commit

Permalink
Merge pull request #20 from panoply/next
Browse files Browse the repository at this point in the history
Next
  • Loading branch information
panoply authored Apr 25, 2024
2 parents 3d86310 + 41d6a6b commit 766e525
Show file tree
Hide file tree
Showing 38 changed files with 9,542 additions and 7,517 deletions.
95 changes: 37 additions & 58 deletions docs/.eleventy.cjs
Original file line number Diff line number Diff line change
@@ -1,60 +1,13 @@
/* eslint-disable array-bracket-spacing */

const eleventy = require('@panoply/11ty');
const papyrus = require('papyrus');
const { eleventy, terser, markdown, sprite } = require('e11ty');
const container = require('markdown-it-container');
const { terser, sprite, versions, markdown } = require('@sissel/11ty');
const flems = require('./src/data/flems.json');

/**
* Papyrus Syntax
*
* Highlighting code blocks of markdown annotated regions of input.
*/
function syntax ({ raw, language }) {

if (language === 'bash') {

return papyrus.static(raw, {
language,
editor: false,
showSpace: false,
showTab: false,
showCR: false,
showLF: false,
showCRLF: false,
lineNumbers: false
})

} else if (language === 'treeview') {

return papyrus.static(raw, {
language,
editor: false,
showSpace: false,
trimEnd: false,
trimStart: false
});

}

return papyrus.static(raw, {
language,
editor: false,
showSpace: false,
trimEnd: true,
trimStart: true
});

};


function tabs(md, tokens, idx) {
function tabs(tokens, idx) {

if(tokens[idx].nesting === 1) {

const col = tokens[idx].info.trim().match(/^tabs\s+(.*)$/);

if (col !== null) {

const [ type, id ] = col[1].split(':')
Expand Down Expand Up @@ -139,41 +92,67 @@ function tabs(md, tokens, idx) {
}
}



return '</div>'


}


module.exports = eleventy (function(config){


markdown(config, {
syntax,
papyrus: {
default: {
editor: false,
showSpace: false,
trimEnd: true,
trimStart: true
},
language: {
bash: {
editor: false,
showSpace: false,
showTab: false,
showCR: false,
showLF: false,
showCRLF: false,
lineNumbers: false
},
treeview: {
editor: false,
showSpace: false,
trimEnd: false,
trimStart: false
}
}
},
options: {
html: true,
linkify: true,
typographer: true,
breaks: false,
}
})
.use(container, 'tabs', { render: (tokens, idx) => tabs(markdown, tokens, idx) })
.use(container, 'tabs', { render: (tokens, idx) => tabs(tokens, idx) })
.disable("code");


config.addPlugin(versions, { version: require('../package.json').version });
config.addPlugin(sprite, { inputPath: './src/svg', spriteShortCode: 'sprite' });
config.addPlugin(terser)
config.addShortcode('version', () => require('../package.json').version)
config.setDynamicPermalinks(false);


return {
htmlTemplateEngine: 'liquid',
passthroughFileCopy: false,
pathPrefix: '/relapse',
templateFormats: ['liquid', 'json', 'md', 'css', 'html', 'yaml'],
templateFormats: [
'liquid',
'json',
'md',
'css',
'html',
'yaml'
],
dir: {
input: 'src',
output: 'public',
Expand Down
5 changes: 3 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@
"autoprefixer": "^10.4.17",
"concurrently": "^8.2.2",
"cssnano": "^6.0.5",
"e11ty": "^0.0.1",
"esbuild": "^0.20.1",
"eslint": "^8.57.0",
"language-literals": "^0.0.2",
"markdown-it-container": "^4.0.0",
"netlify-cli": "^17.17.1",
"papyrus": "link:../../../liquify/packages/papyrus",
"papyrus": "^0.5.9",
"postcss": "^8.4.35",
"postcss-cli": "^11.0.0",
"sass": "^1.71.1",
Expand All @@ -80,6 +81,6 @@
"dependencies": {
"qvp": "^0.3.2",
"relapse": "link:..",
"spx": "link:../../../brixtol/packages/spx"
"spx": "link:../../spx"
}
}
Loading

0 comments on commit 766e525

Please sign in to comment.