Compare commits

...

4 Commits

36 changed files with 530 additions and 276 deletions

80
README.md Normal file
View File

@ -0,0 +1,80 @@
---
title: Website Publication Files
cuid: 26e4-a0
trls: [ nl ]
lang: en
---
How I create web pages from selected files from this repository, with private and public editions.
<!--summary-above-->
## Quickstart
Prerequisites: [node](https://nodejs.org); clone this repository `git clone https://git.surfacemarkup.net/hans/ad_pubfiles`.
0. In this repository, `npm install` dependencies, including [Web Origami](https://weborigami.org). The following instructions assume you also have installed the `ori` command with `npm install -g @weborigami/origami`. If not, replace `ori` in commands below with `npx @weborigami/origami`.
1. link or copy `README.md` to the parent directory of this repository, with the name `ad_pubfiles_pub.ori.md`. Now you have input for testing and development, since the ori template files look in the parent directory for files with this pattern. Optionally add more files with the pattern: `[a-p]+_title[_pub-other-tags][.ori].md`. That is:
- they MUST start with a sequence of characters `a-p`,
- followed by an underscore,
- followed by a title which does not contain an underscore,
- followed optionally by an underscore and one or more tags separated by hyphens. For testing purposes, only the `pub` tag is relevant.
- followed by the filetype extension `.md`. If you want to use Origami expressions in the file, use `.ori.md`.
The reason for this setup step is that on my machine, the parent directory contains my personal wiki. So I can't share the input with you directly. The filename pattern above is used for the process of selecting which files to include in the build. The [figure below](#project-structure-figure) shows this arrangement.
2. Use the following commands to achieve the desired output.
- in private mode: `ori "serve watch ., =debug ./site.ori('all')"`
- in public mode: `ori "serve watch ., =debug ./site.ori()"`
`site.ori` only exposes the final rendering step from `pipeline.ori`. Therefore:
- To serve the pipeline with all the processing steps available for inspection, replace `site.ori` with `pipeline.ori` in the commands above.
<figure class="wider" id="project-structure-figure">
<img src="/ad_pubfiles_pub.d/project-structure.svg" alt="a diagram showing a directory called src containing markdown files. The src directory also contains a subdirectory called ad_pubfiles_pub.d. Arrows show that the file README.md inside this subdirectory is hardlinked to a file in the parent src directory, and that the file pipeline.ori in the subdirectory reads markdown files from the parent src directory, and that the subdirectory is a git repository which is synchronized with a remote public repository.">
<figcaption>How the site generator files relate to the content</figcaption>
</figure>
<trl-group>
<trl-alt lang="en">
## Markup Language
I have developed a text markup format which suits my needs better than Markdown. The parser works and I can render HTML with it, but the feature set is still very limited. For example, I can only render single works in italic. That might seem like an odd sort of limitation, but it's because I've started from somewhat different first principles than the assumptions the HTML/Markdown worfklow is based on. As we all know, the last 10% takes the most work. So to start with, I'm formatting the source files in Markdown.
</trl-alt>
<trl-alt lang="nl">
## Markup-taal
Ik heb een formaat ontwikkeld voor tekst die beter bij mijn doelen past dan Markdown.
</trl-alt>
</trl-group>
## Internal Links
![link to image](/ad_pubfiles_pub.d/images/bird.webp)
Internal links need to be absolute from the root of the directory. This SHOULD be fixed in a future version.
## Web Origami, Public and Private Site Versions
I want to make only select files public. Files whose name contains the tag `pub` should be included in the public build. The public build should be the default. To include all files, pass 'all' to the site.ori file. That sort of reduces the risk of accidentally publishing private files.
<p>—private-below—</p>
EXCEPT NOT REALLY! In this case, because this file is hardlinked to `README.md` inside a publicised git repository. You have been warned!
## Organisation
${ada_pubfiles-worklog.md/}

View File

@ -1 +0,0 @@
WILL BE SEEN IN FINAL OUTPUT!

View File

@ -1,44 +0,0 @@
---
title: foobar
---
(see test.ori. This is confusing!)
So I was wondering the following, but I believe by default the path `..` returns a shallow tree by default, so the question is moot. That is: I was stuck on how to apply a regex to a nested tree of file paths, but I was erroneously assuming the tree was deep, but it's not.
My original solution therefore works because the input is already just the top-level flat directory contents:
```
{
all: ..
filtered: Tree.filter(raw, (val, key) => key.endsWith('.md')) //yes, should really use globKeys for this, but actually I'm doing a more complex comparison with AND here
}
```
Nevertheless, I can't figure out if its possible to achieve the goal stated in the subject.
`globKeys` supports a limited set of glob patterns. I guess `mask` with `regExpKeys` is probably the closest, but it's not going to work across deep paths?
given this directory structure:
```
/src
readme.md
installation.md
node_modules/
package/
readme.md
```
I only want `src/readme.md` and `src/installation.md`.
I came up with this, except is it going to be a deep operation?
```
{
all: ..
selected: Tree.map(all, Tree.regExpKeys({"^[^\/]+?\/.*\.md$": false}))
}
```
the regex returns false if the string ends with `.md` but also has a folder name with slash at the beginning. So these are excluded from the result.
huh: would you have to do some rewriting of keys to a flat map with concatenated paths?

View File

@ -1,9 +0,0 @@
---
title: ok
id: testit
date: today
---
# My file
${<_index.md>}

View File

@ -1,3 +0,0 @@
{
files: site.ori('')/filenames
}

View File

@ -1,3 +0,0 @@
{
files: site.ori("all")/filenames
}

View File

@ -1,2 +0,0 @@
fd -e md --color=never
#fd -e txt

View File

@ -1,9 +0,0 @@
---
title: Another Public File
cuid: 26ef-a0
---
This file is also public. But not all of it.
<!--private-below-->
This part will not be shown.
Everything following here will be hidden from private view!

View File

@ -1,9 +0,0 @@
---
title: Another File
cuid: 26e4-a2
---
Just some text, in this file.
<!--summary-above-->
This file should only be shown if site was built with `site.ori("all")`,
because it does not have `_pub` in its filename.

View File

@ -1,68 +1,90 @@
:root { :root {
/* size variables */ /* size variables */
/* more pronounced, perfect fifth on narrow screens */ /* more pronounced, perfect fifth on narrow screens */
/* @link https://utopia.fyi/type/calculator?c=360,16,1.5,1240,20,1.25,5,2,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12 */ /* @link https://utopia.fyi/type/calculator?c=360,16,1.5,1240,20,1.25,5,2,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12 */
--step--2: clamp(0.4444rem, 0.299rem + 0.6465vw, 0.8rem); --step--2: clamp(0.4444rem, 0.299rem + 0.6465vw, 0.8rem);
--step--1: clamp(0.6667rem, 0.5303rem + 0.6061vw, 1rem); --step--1: clamp(0.6667rem, 0.5303rem + 0.6061vw, 1rem);
--step-0: clamp(1rem, 0.8977rem + 0.4545vw, 1.25rem); --step-0: clamp(1rem, 0.8977rem + 0.4545vw, 1.25rem);
--step-1: clamp(1.5rem, 1.4744rem + 0.1136vw, 1.5625rem); --step-1: clamp(1.5rem, 1.4744rem + 0.1136vw, 1.5625rem);
--step-2: clamp(1.9531rem, 2.3714rem + -0.5398vw, 2.25rem); --step-2: clamp(1.9531rem, 2.3714rem + -0.5398vw, 2.25rem);
--step-3: clamp(2.4414rem, 3.7569rem + -1.6974vw, 3.375rem); --step-3: clamp(2.4414rem, 3.7569rem + -1.6974vw, 3.375rem);
--step-4: clamp(3.0518rem, 5.8851rem + -3.6559vw, 5.0625rem); --step-4: clamp(3.0518rem, 5.8851rem + -3.6559vw, 5.0625rem);
--step-5: clamp(3.8147rem, 9.1397rem + -6.871vw, 7.5938rem); --step-5: clamp(3.8147rem, 9.1397rem + -6.871vw, 7.5938rem);
/* @link https://utopia.fyi/space/calculator?c=360,18,1.2,1240,20,1.25,5,2,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12 */ /* @link https://utopia.fyi/space/calculator?c=360,18,1.2,1240,20,1.25,5,2,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12 */
--space-3xs: clamp(0.3125rem, 0.3125rem + 0vw, 0.3125rem); --space-3xs: clamp(0.3125rem, 0.3125rem + 0vw, 0.3125rem);
--space-2xs: clamp(0.5625rem, 0.5369rem + 0.1136vw, 0.625rem); --space-2xs: clamp(0.5625rem, 0.5369rem + 0.1136vw, 0.625rem);
--space-xs: clamp(0.875rem, 0.8494rem + 0.1136vw, 0.9375rem); --space-xs: clamp(0.875rem, 0.8494rem + 0.1136vw, 0.9375rem);
--space-s: clamp(1.125rem, 1.0739rem + 0.2273vw, 1.25rem); --space-s: clamp(1.125rem, 1.0739rem + 0.2273vw, 1.25rem);
--space-m: clamp(1.6875rem, 1.6108rem + 0.3409vw, 1.875rem); --space-m: clamp(1.6875rem, 1.6108rem + 0.3409vw, 1.875rem);
--space-l: clamp(2.25rem, 2.1477rem + 0.4545vw, 2.5rem); --space-l: clamp(2.25rem, 2.1477rem + 0.4545vw, 2.5rem);
--space-xl: clamp(3.375rem, 3.2216rem + 0.6818vw, 3.75rem); --space-xl: clamp(3.375rem, 3.2216rem + 0.6818vw, 3.75rem);
--space-2xl: clamp(4.5rem, 4.2955rem + 0.9091vw, 5rem); --space-2xl: clamp(4.5rem, 4.2955rem + 0.9091vw, 5rem);
--space-3xl: clamp(6.75rem, 6.4432rem + 1.3636vw, 7.5rem); --space-3xl: clamp(6.75rem, 6.4432rem + 1.3636vw, 7.5rem);
/* One-up pairs */ /* One-up pairs */
--space-3xs-2xs: clamp(0.3125rem, 0.1847rem + 0.5682vw, 0.625rem); --space-3xs-2xs: clamp(0.3125rem, 0.1847rem + 0.5682vw, 0.625rem);
--space-2xs-xs: clamp(0.5625rem, 0.4091rem + 0.6818vw, 0.9375rem); --space-2xs-xs: clamp(0.5625rem, 0.4091rem + 0.6818vw, 0.9375rem);
--space-xs-s: clamp(0.875rem, 0.7216rem + 0.6818vw, 1.25rem); --space-xs-s: clamp(0.875rem, 0.7216rem + 0.6818vw, 1.25rem);
--space-s-m: clamp(1.125rem, 0.8182rem + 1.3636vw, 1.875rem); --space-s-m: clamp(1.125rem, 0.8182rem + 1.3636vw, 1.875rem);
--space-m-l: clamp(1.6875rem, 1.3551rem + 1.4773vw, 2.5rem); --space-m-l: clamp(1.6875rem, 1.3551rem + 1.4773vw, 2.5rem);
--space-l-xl: clamp(2.25rem, 1.6364rem + 2.7273vw, 3.75rem); --space-l-xl: clamp(2.25rem, 1.6364rem + 2.7273vw, 3.75rem);
--space-xl-2xl: clamp(3.375rem, 2.7102rem + 2.9545vw, 5rem); --space-xl-2xl: clamp(3.375rem, 2.7102rem + 2.9545vw, 5rem);
--space-2xl-3xl: clamp(4.5rem, 3.2727rem + 5.4545vw, 7.5rem); --space-2xl-3xl: clamp(4.5rem, 3.2727rem + 5.4545vw, 7.5rem);
/* Custom pairs */ /* Custom pairs */
--space-s-l: clamp(1.125rem, 0.5625rem + 2.5vw, 2.5rem); --space-s-l: clamp(1.125rem, 0.5625rem + 2.5vw, 2.5rem);
/*COLORS*/ /*COLORS*/
--blue: #d7f0e1; --blue: #d7f0e1;
--darkblue: #2c6a88; --darkblue: #2c6a88;
--oc-gray-3: #dee2e6; --oc-gray-3: #dee2e6;
--oc-gray-5: #adb5bd; --oc-gray-5: #adb5bd;
--oc-gray-6: #868e96; --oc-gray-6: #868e96;
--oc-gray-7: #495057; --oc-gray-7: #495057;
--oc-gray-8: #343a40; --oc-gray-8: #343a40;
--oc-cyan-6: #15aabf; --oc-cyan-6: #15aabf;
--oc-cyan-9: #0b7285; --oc-cyan-9: #0b7285;
--oc-blue-1: #d0ebff; --oc-blue-1: #d0ebff;
--oc-blue-3: #74c0fc; --oc-blue-3: #74c0fc;
--oc-blue-4: #4dabf7; --oc-blue-4: #4dabf7;
--oc-blue-7: #1c7ed6; --oc-blue-7: #1c7ed6;
--oc-blue-9: #1864ab; --oc-blue-9: #1864ab;
--oc-grape-9: #862e9c; --oc-grape-9: #862e9c;
--oc-violet-4: #9775fa; --oc-violet-4: #9775fa;
--oc-violet-9: #5f3dc4; --oc-violet-9: #5f3dc4;
}
}
body { body {
font-family: "sans-serif"; font-family: "sans-serif";
margin: 0 auto; & > :not(.wider) {
max-width: 66ch; max-width: 38rem;
margin-inline: auto;
}
& > .wider {
max-width: min(55rem, 100%);
margin-inline: auto;
}
} }
figure img {
max-width: 100%;
}
figcaption {
margin-inline: auto;
width: max-content;
}
trl-group {
display: block;
}
@layer translations { @layer translations {
body > trl-selector:first-child {display: none;} /* was adding a grid row! */ body > trl-selector:first-child {display: none;} /* was adding a grid row! */
trl-selector { trl-selector {

View File

@ -1,3 +0,0 @@
while read line
do echo "$line"
done

View File

@ -4,7 +4,7 @@
title: page.title title: page.title
_body: Tree.indent` _body: Tree.indent`
<h1>${page.title}</h1> <h1>${page.title}</h1>
<span>${page.fnd.addr} ${page.fnd.tags || ''}</span> <p><span>${page.fnd.addr} ${page.fnd.tags || ''}</span></p>
${page._body} ${page._body}
<a href="/">↖index</a> <a href="/">↖index</a>
` `

View File

@ -3,6 +3,6 @@
--- ---
<article> <article>
<a href=${key}><h1>${value.title}</h1></a> <a href=${key}><h1>${value.title}</h1></a>
<span>${value.fnd.addr} ${value.fnd.tags || ''}</span> <p><span>${value.fnd.addr} ${value.fnd.tags || ''}</span></p>
${value.summary || ""} ${value.summary || ""}
</article> </article>

View File

@ -1,6 +0,0 @@
//return title and html ...
export default (doc) => {
}

View File

@ -1,14 +0,0 @@
import {fromHtml} from 'hast-util-from-html';
import {visit} from 'unist-util-visit';
export default async function(value) {
const tree = fromHtml(value);
const links = [];
visit(tree, [{tagName: 'link'}, {tagName: 'img'}], function(node) {
links.push(node);
})
const hrefs = links.map(link => link.properties.href || link.properties.src)
return hrefs;
// return tree;
}

View File

@ -3,61 +3,60 @@
to keep parts of the pipeline private while still allowing better debugging. to keep parts of the pipeline private while still allowing better debugging.
serve/watch pipeline.ori for debugging. serve/watch pipeline.ori for debugging.
server or copy site.ori to build final output. server or copy site.ori to build final output.
See README.md/#
*/ */
(all) => { (all) => {
/* /*
list is all the files in current directory. list is all the files in parent directory.
allfiles is all source files: ending with `.md` and not starting with `_`. allfiles is all source files: ending with `.md` and not starting with `_`.
pubfiles is the subset containing the string `_pub`. pubfiles is the subset containing the string `_pub`.
files selects either of these depending on the argument passed to this file. files selects either of these depending on the argument passed to this file.
NOTES: NOTES:
- if markdown files are empty, Origami.document() will error. - if markdown files are empty, Origami.document() will error.
*/ */
/*
this is the external filename method.
*/
// allfiles: allfiles.sh() //reads MD files.
// pubfiles: pubfiles.sh(allfiles)
(list): ..
allfiles: Tree.filter(list, (val, key) => key.endsWith('.md') && !key.startsWith('_'))
documents: Tree.map(allfiles, {value: (value) => Origami.document(value)}) //if I don't use the verbose syntax I get the filename characters as part of value!
withfndata: Tree.map(documents, { value: (value, key) => addFilenameData.js(value, Origami.slash.remove(key))})
pubfiles: Tree.filter(withfndata, (val, key) => val.fnd.tags?.includes('pub'))
/*
Now convert to html.
*/
asHtml: Tree.map(all ? withfndata: pubfiles, {
value: (value) => Origami.mdHtml(value)
key: (value, key) => `${value.fnd.name}`
})
/*
after converting to html, we can extract a 'summary' from the file.
With markdown, the title is taken from the YAML frontmatter,
and ends up in a separate field of the document.
So we dont have to worry about the title being part of the summary.
*/
withSummary: Tree.map(asHtml, extractSummary.js)
/*
Removing private content coming below the html paragraph `<p>—private-below—</p>`
Only remove this if in public mode. So if this file is called as `site.ori("all")`,
then final output is `withSummary`, otherwise it's `privateRemoved`.
*/
privateRemoved: Tree.map(withSummary, removePrivate.js)
final: (all ? withSummary : privateRemoved )
/* /*
slightly complex. This adds a property `html` to the page with the rendered content. this is the external filename method.
*/ */
// allfiles: allfiles.sh() //reads MD files.
// pubfiles: pubfiles.sh(allfiles)
(list): ..
allfiles: Tree.filter(list, (val, key) => key.endsWith('.md') && !key.startsWith('_'))
documents: Tree.map(allfiles, {value: (value) => Origami.document(value)}) //if I don't use the verbose syntax I get the filename characters as part of value!
withfilenamedata: Tree.map(documents, { value: (value, key) => ./filenamedata/addFilenameData.js(value, Origami.slash.remove(key))})
//files now have a key `fnd` for 'filenamedata`. This contains address, title, and tags parsed from the filename.
pubfiles: Tree.filter(withfilenamedata, (val, key) => val.fnd.tags?.includes('pub'))
/*
Now convert to html.
*/
asHtml: Tree.map(all ? withfilenamedata: pubfiles, {
value: (value) => Origami.mdHtml(value)
key: (value, key) => `${value.fnd.name}`
})
/*
after converting to html, we can extract a 'summary' from the file.
With markdown, the title is taken from the YAML frontmatter,
and ends up in a separate field of the document.
So we dont have to worry about the title being part of the summary.
*/
withSummary: Tree.map(asHtml, ./html-manipulations/extractSummary.js)
/*
Removing private content coming below the html paragraph `<p>—private-below—</p>`
Only remove this if in public mode. So if this file is called as `site.ori("all")`,
then final output is `withSummary`, otherwise it's `privateRemoved`.
*/
privateRemoved: Tree.map(withSummary, ./html-manipulations/removePrivate.js)
final: (all ? withSummary : privateRemoved )
renderedPages: Tree.map(final, {value: (page) => { renderedPages: Tree.map(final, {value: (page) => {
html: <page.ori>(page, all) html: <ori-templates/page.ori>(page, all)
...page ...page
}}) }})
/* /*
@ -65,17 +64,14 @@
*/ */
//NOTE! two steps at once. Could separate the withTranslations part: add a html_LANG property to the document object, then later create the folder structure. //NOTE! two steps at once. Could separate the withTranslations part: add a html_LANG property to the document object, then later create the folder structure.
pagesInFolders: Tree.map(renderedPages, pagesInFoldersWithTranslations.js) pagesInFolders: Tree.map(renderedPages, ./translations/pagesInFoldersWithTranslations.js)
linksByFile: Tree.map(Tree.map(renderedPages, (a) => a/html),getLinkedFilesFromHtml.js) linksByFile: Tree.map(Tree.map(renderedPages, (a) => a/html), ./linked-files/getLinkedFilesFromHtml.js)
uniqueLinks: Tree.flat(linksByFile) → (a) => [...new Set(a)] uniqueLinks: Tree.flat(linksByFile) → (a) => [...new Set(a)]
linksAsTree: pathsToObjs.js(uniqueLinks) linksAsTree: ./linked-files/pathsToObjs.js(uniqueLinks)
onlyLinkedFiles: Tree.mask(list, linksAsTree) onlyLinkedFiles: Tree.mask(list, linksAsTree)
/* index.html: ori-templates/indexPage.ori(final, all)
Now, I think I have enough to build both the individual pages and the index page!
*/
index.html: indexPage.ori(final, all)
...onlyLinkedFiles ...onlyLinkedFiles
} }

321
project-structure.svg Normal file
View File

@ -0,0 +1,321 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="240.31155mm"
height="158.17592mm"
viewBox="0 0 240.31155 158.17592"
version="1.1"
id="svg1"
inkscape:version="1.3.2 (091e20e, 2023-11-25)"
sodipodi:docname="project-structure.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
inkscape:zoom="0.76791526"
inkscape:cx="457.08168"
inkscape:cy="204.44964"
inkscape:window-width="1883"
inkscape:window-height="1056"
inkscape:window-x="37"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs1">
<marker
style="overflow:visible"
id="Dot"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Dot"
markerWidth="1"
markerHeight="1"
viewBox="0 0 1 1"
inkscape:isstock="true"
inkscape:collect="always"
preserveAspectRatio="xMidYMid">
<path
transform="scale(0.5)"
style="fill:context-stroke;fill-rule:evenodd;stroke:none"
d="M 5,0 C 5,2.76 2.76,5 0,5 -2.76,5 -5,2.76 -5,0 c 0,-2.76 2.3,-5 5,-5 2.76,0 5,2.24 5,5 z"
sodipodi:nodetypes="sssss"
id="path17" />
</marker>
<marker
style="overflow:visible"
id="marker11"
refX="0"
refY="0"
orient="auto-start-reverse"
inkscape:stockid="Stylized triangle arrow"
markerWidth="1"
markerHeight="1"
viewBox="0 0 1 1"
inkscape:isstock="true"
inkscape:collect="always"
preserveAspectRatio="xMidYMid">
<path
transform="scale(0.5)"
style="fill:context-stroke;fill-rule:evenodd;stroke:context-stroke;stroke-width:1pt"
d="m 6,0 c -3,1 -7,3 -9,5 0,0 0,-4 2,-5 -2,-1 -2,-5 -2,-5 2,2 6,4 9,5 z"
id="path11" />
</marker>
<marker
style="overflow:visible"
id="ArrowTriangleStylized"
refX="0"
refY="0"
orient="auto-start-reverse"
inkscape:stockid="Stylized triangle arrow"
markerWidth="1"
markerHeight="1"
viewBox="0 0 1 1"
inkscape:isstock="true"
inkscape:collect="always"
preserveAspectRatio="xMidYMid">
<path
transform="scale(0.5)"
style="fill:context-stroke;fill-rule:evenodd;stroke:context-stroke;stroke-width:1pt"
d="m 6,0 c -3,1 -7,3 -9,5 0,0 0,-4 2,-5 -2,-1 -2,-5 -2,-5 2,2 6,4 9,5 z"
id="path4" />
</marker>
</defs>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(22.308297,-22.801204)">
<rect
style="fill:none;stroke:#000000;stroke-width:0.661458;stroke-linecap:round;stroke-linejoin:round"
id="rect1"
width="152.39316"
height="133.56699"
x="33.754688"
y="37.769974" />
<rect
style="fill:none;stroke:#000000;stroke-width:0.661458;stroke-linecap:round;stroke-linejoin:round"
id="rect2"
width="140.86958"
height="70.922546"
x="39.516479"
y="77.367867" />
<text
xml:space="preserve"
style="font-size:5.64444px;line-height:normal;font-family:'Drafting* Mono';-inkscape-font-specification:'Drafting* Mono';text-decoration-color:#000000;letter-spacing:-0.174625px;fill:#000000;stroke-width:0.854001;stroke-linecap:square;stroke-linejoin:round;-inkscape-stroke:none;stop-color:#000000"
x="35.446587"
y="36.580788"
id="text2"><tspan
sodipodi:role="line"
id="tspan2"
style="stroke-width:0.854"
x="35.446587"
y="36.580788">src</tspan></text>
<text
xml:space="preserve"
style="font-size:5.64444px;line-height:normal;font-family:'Drafting* Mono';-inkscape-font-specification:'Drafting* Mono';text-decoration-color:#000000;letter-spacing:-0.174625px;fill:#000000;stroke-width:0.854001;stroke-linecap:square;stroke-linejoin:round;-inkscape-stroke:none;stop-color:#000000"
x="40.572369"
y="76.105804"
id="text3"><tspan
sodipodi:role="line"
id="tspan3"
style="stroke-width:0.854"
x="40.572369"
y="76.105804">ad_pubfiles.d/</tspan></text>
<text
xml:space="preserve"
style="font-size:5.64444px;line-height:normal;font-family:'Drafting* Mono';-inkscape-font-specification:'Drafting* Mono';text-decoration-color:#000000;letter-spacing:-0.174625px;fill:#000000;stroke-width:0.854001;stroke-linecap:square;stroke-linejoin:round;-inkscape-stroke:none;stop-color:#000000"
x="40.565407"
y="45.987274"
id="text4"><tspan
sodipodi:role="line"
id="tspan4"
style="stroke-width:0.854"
x="40.565407"
y="45.987274">aa_README_pub.ori.md</tspan></text>
<text
xml:space="preserve"
style="font-size:5.64444px;line-height:normal;font-family:'Drafting* Mono';-inkscape-font-specification:'Drafting* Mono';text-decoration-color:#000000;letter-spacing:-0.174625px;fill:#000000;stroke-width:0.854001;stroke-linecap:square;stroke-linejoin:round;-inkscape-stroke:none;stop-color:#000000"
x="40.565407"
y="53.268227"
id="text5"><tspan
sodipodi:role="line"
id="tspan5"
style="stroke-width:0.854"
x="40.565407"
y="53.268227">ab_CHANGELOG_pub.ori.md</tspan></text>
<text
xml:space="preserve"
style="font-size:5.64444px;line-height:normal;font-family:'Drafting* Mono';-inkscape-font-specification:'Drafting* Mono';text-decoration-color:#000000;letter-spacing:-0.174625px;fill:#000000;stroke-width:0.854001;stroke-linecap:square;stroke-linejoin:round;-inkscape-stroke:none;stop-color:#000000"
x="40.565407"
y="60.549179"
id="text6"><tspan
sodipodi:role="line"
id="tspan6"
style="stroke-width:0.854"
x="40.565407"
y="60.549179">ad_pubfiles_pub.ori.md</tspan></text>
<text
xml:space="preserve"
style="font-size:5.64444px;line-height:normal;font-family:'Drafting* Mono';-inkscape-font-specification:'Drafting* Mono';text-decoration-color:#000000;letter-spacing:-0.174625px;fill:#000000;stroke-width:0.854001;stroke-linecap:square;stroke-linejoin:round;-inkscape-stroke:none;stop-color:#000000"
x="40.125549"
y="162.62843"
id="text7"><tspan
sodipodi:role="line"
id="tspan7"
style="stroke-width:0.854"
x="40.125549"
y="162.62843">pg_journal.md</tspan></text>
<text
xml:space="preserve"
style="font-size:5.64444px;line-height:normal;font-family:'Drafting* Mono';-inkscape-font-specification:'Drafting* Mono';text-decoration-color:#000000;letter-spacing:-0.174625px;fill:#000000;stroke-width:0.854001;stroke-linecap:square;stroke-linejoin:round;-inkscape-stroke:none;stop-color:#000000"
x="40.125549"
y="154.97641"
id="text8"><tspan
sodipodi:role="line"
id="tspan8"
style="stroke-width:0.854"
x="40.125549"
y="154.97641">...</tspan></text>
<path
style="fill:none;stroke:#000000;stroke-width:0.661458;stroke-linecap:round;stroke-linejoin:round"
d="M 33.754687,37.769974 V 32.441382 H 184.76596 l 1.38189,5.328592"
id="path8"
sodipodi:nodetypes="cccc" />
<path
style="fill:none;stroke:#000000;stroke-width:0.661458;stroke-linecap:round;stroke-linejoin:round"
d="m 39.516477,77.367867 -0.01161,-5.990051 139.499303,0.661459 1.38189,5.328592"
id="path9"
sodipodi:nodetypes="cccc" />
<text
xml:space="preserve"
style="font-size:5.64444px;line-height:normal;font-family:'Drafting* Mono';-inkscape-font-specification:'Drafting* Mono';text-decoration-color:#000000;letter-spacing:-0.174625px;fill:#000000;stroke-width:0.854001;stroke-linecap:square;stroke-linejoin:round;-inkscape-stroke:none;stop-color:#000000"
x="42.15987"
y="85.101646"
id="text9"><tspan
sodipodi:role="line"
id="tspan9"
style="stroke-width:0.854"
x="42.15987"
y="85.101646">README.md</tspan></text>
<path
style="fill:none;stroke:#6c6c6c;stroke-width:0.661458;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;marker-start:url(#marker11);marker-end:url(#ArrowTriangleStylized)"
d="M 36.641125,58.982847 C 21.755947,59.311244 20.687265,83.458182 35.78525,83.281314"
id="path10"
sodipodi:nodetypes="cc" />
<text
xml:space="preserve"
style="font-size:5.64444px;line-height:normal;font-family:'Drafting* Mono';-inkscape-font-specification:'Drafting* Mono';text-decoration-color:#000000;letter-spacing:-0.174625px;fill:#000000;stroke-width:0.854001;stroke-linecap:square;stroke-linejoin:round;-inkscape-stroke:none;stop-color:#000000"
x="42.15987"
y="100.49876"
id="text11"><tspan
sodipodi:role="line"
id="tspan11"
style="stroke-width:0.854"
x="42.15987"
y="100.49876">site.ori</tspan></text>
<text
xml:space="preserve"
style="font-size:5.64444px;line-height:normal;font-family:'Drafting* Mono';-inkscape-font-specification:'Drafting* Mono';text-decoration-color:#000000;letter-spacing:-0.174625px;fill:#000000;stroke-width:0.854001;stroke-linecap:square;stroke-linejoin:round;-inkscape-stroke:none;stop-color:#000000"
x="42.15987"
y="92.390984"
id="text12"><tspan
sodipodi:role="line"
id="tspan12"
style="stroke-width:0.854"
x="42.15987"
y="92.390984">pipeline.ori</tspan></text>
<text
xml:space="preserve"
style="font-size:5.64444px;line-height:normal;font-family:'Drafting* Mono';-inkscape-font-specification:'Drafting* Mono';text-decoration-color:#000000;letter-spacing:-0.174625px;fill:#000000;stroke-width:0.854001;stroke-linecap:square;stroke-linejoin:round;-inkscape-stroke:none;stop-color:#000000"
x="42.15987"
y="106.96966"
id="text13"><tspan
sodipodi:role="line"
id="tspan13"
style="stroke-width:0.854"
x="42.15987"
y="106.96966">...</tspan></text>
<text
xml:space="preserve"
style="font-size:5.64444px;line-height:normal;font-family:'Drafting* Mono';-inkscape-font-specification:'Drafting* Mono';text-decoration-color:#000000;letter-spacing:-0.174625px;fill:#000000;stroke-width:0.854001;stroke-linecap:square;stroke-linejoin:round;-inkscape-stroke:none;stop-color:#000000"
x="42.15987"
y="115.11634"
id="text15"><tspan
sodipodi:role="line"
id="tspan15"
style="stroke-width:0.854"
x="42.15987"
y="115.11634">.git</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444px;line-height:normal;font-family:'Jost*';-inkscape-font-specification:'Jost*';text-align:end;text-decoration-color:#000000;letter-spacing:-0.174625px;text-anchor:end;fill:#6c6c6c;fill-opacity:1;stroke-width:0.854001;stroke-linecap:square;stroke-linejoin:round;-inkscape-stroke:none;stop-color:#000000"
x="23.416746"
y="69.783974"
id="text16"><tspan
sodipodi:role="line"
id="tspan16"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Jost*';-inkscape-font-specification:'Jost*';text-align:end;text-anchor:end;fill:#6c6c6c;fill-opacity:1;stroke-width:0.854"
x="23.416746"
y="69.783974">hardlinked.</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Jost*';-inkscape-font-specification:'Jost*';text-align:end;text-anchor:end;fill:#6c6c6c;fill-opacity:1;stroke-width:0.854"
x="23.242123"
y="76.839523"
id="tspan17">same file!</tspan></text>
<path
style="fill:none;stroke:#6c6c6c;stroke-width:0.661458;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;marker-end:url(#Dot)"
d="m 84.055528,90.909318 h 43.033912 c 29.62783,0 26.8537,-13.841089 27.08487,-26.159095"
id="path20"
sodipodi:nodetypes="csc" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444px;line-height:normal;font-family:'Jost*';-inkscape-font-specification:'Jost*';text-align:start;text-decoration-color:#000000;letter-spacing:-0.174625px;text-anchor:start;fill:#6c6c6c;fill-opacity:1;stroke-width:0.854001;stroke-linecap:square;stroke-linejoin:round;-inkscape-stroke:none;stop-color:#000000"
x="85.254784"
y="99.005234"
id="text20"><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Jost*';-inkscape-font-specification:'Jost*';text-align:start;text-anchor:start;fill:#6c6c6c;fill-opacity:1;stroke-width:0.854"
x="85.254784"
y="99.005234"
id="tspan21">reads md files from parent dir.</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Jost*';-inkscape-font-specification:'Jost*';text-align:start;text-anchor:start;fill:#6c6c6c;fill-opacity:1;stroke-width:0.854"
x="85.254784"
y="106.06078"
id="tspan23">Does not descend into dirs like this one.</tspan></text>
<path
style="fill:none;stroke:#6c6c6c;stroke-width:0.661458;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;marker-end:url(#Dot)"
d="M 40.803687,114.47587 H 30.050997"
id="path23"
sodipodi:nodetypes="cc" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444px;line-height:normal;font-family:'Jost*';-inkscape-font-specification:'Jost*';text-align:start;text-decoration-color:#000000;letter-spacing:-0.174625px;text-anchor:start;fill:#6c6c6c;fill-opacity:1;stroke-width:0.854001;stroke-linecap:square;stroke-linejoin:round;-inkscape-stroke:none;stop-color:#000000"
x="-13.524602"
y="115.62434"
id="text26"><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Jost*';-inkscape-font-specification:'Jost*';text-align:start;text-anchor:start;fill:#6c6c6c;fill-opacity:1;stroke-width:0.854"
x="-13.524602"
y="115.62434"
id="tspan26">synced with public</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Jost*';-inkscape-font-specification:'Jost*';text-align:start;text-anchor:start;fill:#6c6c6c;fill-opacity:1;stroke-width:0.854"
x="-13.524602"
y="122.67989"
id="tspan27">remote repo</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -1 +0,0 @@
rg '_pub' || true

View File

@ -1,11 +0,0 @@
import {promises} from 'fs';
const {readFile} = promises;
export default async function readFiles(filelist) {
const filenames = filelist.split('\n').filter(name => name !== '')
const files = {};
for (const file of filenames) {
const contents = await readFile(file, 'utf-8');
files[file] = contents;
}
return files;
}

View File

@ -1 +0,0 @@
echo "$1"

View File

@ -1,3 +0,0 @@
while read line
do echo "$line"
done

View File

@ -1,30 +0,0 @@
{
test: {
"readme.md": "hello world"
"index.js" : "import nest from './a/nested.js'"
a: {
"nested.md": "myfile"
"nested.js": "export default nest = ''"
b: {
"deeper.md" : "deep inside"
}
}
}
raw: ..
files: Tree.filter(raw, (val, key) => key.endsWith('.md') && /^[a-p]+_/.test(key))
regexpd: Tree.mask(test, Tree.regExpKeys({"^[^\/]+?\/.*\.md$": false}))
//regexpdtop: Tree.mask(test, Tree.globKeys({"**": {"*.md": true}}))
regexpdtest: Tree.mask(test, {
...Tree.constant(true)
...Tree.regExpKeys({
"^[^\/]+?\/.*\.md$": false
})})
regexpdfiles: Tree.mask(files, {
...Tree.constant(true)
...Tree.regExpKeys({
"^[^\/]+?\/.*\.md$": false
})})
paths: Tree.paths(test)
regexpaths: Tree.map(Tree.filter(paths, (value) => /^[^\/]+?\/.*\.md$/.test(value)), {key: (value, key) => value, value: (value) => true})
excluded: Tree.mask(paths, regexpaths)
}

View File

@ -1 +0,0 @@
echo "foobar"

View File

@ -1,8 +0,0 @@
export default async (value) => {
if (value.unpack) {
const unpacked = await value.unpack();
console.log(unpacked);
}
return value;
}

View File

@ -1,6 +0,0 @@
{
test: testfile.ori.md/
all: .
allmd: Tree.filter(all, (val, key) => key.endsWith('.md') && !key.startsWith('_'))
docs: Tree.map(allmd, {value: (val) => Origami.unpack(val)})
}

View File

@ -28,7 +28,6 @@ export default async (page) => {
//this is going to create a folder for each 'translation' specified in frontmatter. //this is going to create a folder for each 'translation' specified in frontmatter.
function handleTranslations(html, trls) { function handleTranslations(html, trls) {
if (trls) { if (trls) {
console.log(trls);
const outputs = {}; const outputs = {};
trls.forEach(trl => { trls.forEach(trl => {
outputs[trl] = { outputs[trl] = {
@ -41,7 +40,7 @@ function handleTranslations(html, trls) {
} }
} }
//"reorders" all `trl-group`s so the element with given lang is displayed. //modifies all `trl-group`s so the element with given lang is displayed.
//EN is default language ... //EN is default language ...
//also adds a (hidden by css) trl-selector at the top of `body`. //also adds a (hidden by css) trl-selector at the top of `body`.
//TODO: add a link to translated pages ... //TODO: add a link to translated pages ...