diff --git a/flake.nix b/flake.nix index 92bac7b..d3a7beb 100644 --- a/flake.nix +++ b/flake.nix @@ -33,6 +33,7 @@ markdollPlugins = [ (pkgs.mkMarkdollPlugin "utils" ./plugins/utils.sh) (pkgs.mkMarkdollPlugin "logroll" ./plugins/logroll.sh) + (pkgs.mkMarkdollPlugin "dollcode" ./plugins/dollcode.sh) (pkgs.mkMarkdollPlugin "mermaid" ./plugins/mermaid.sh) pkgs.mermaid-ascii diff --git a/log/001-static-sites-rework.doll b/log/001-static-sites-rework.doll index f552ee3..932b619 100644 --- a/log/001-static-sites-rework.doll +++ b/log/001-static-sites-rework.doll @@ -3,7 +3,7 @@ title: static_sites_rework log[001] description: getting automated deployments back in the dollhive --- -&static sites rework (14MAY2025) ^a+n +&[invoke(dollcode):1] static sites rework (14MAY2025) ^a+n so like this site,, its a bunch of .doll files, compiled down to .html. @@ -280,4 +280,6 @@ description: getting automated deployments back in the dollhive &links - blood.pet on git: [link(https://git.sapphic.engineer/noe/blood.pet/):noe/blood.pet] - static-sites config: [link(https://git.sapphic.engineer/noe/nixos/src/branch/main/nixos/hosts/static-sites):noe/nixos:/nixos/hosts/static-sites] - - woodpecker config: [link(https://git.sapphic.engineer/noe/nixos/src/branch/main/nixos/hosts/woodpecker/default.nix):noe/nixos:/nixos/hosts/woodpecker/default.nix] \ No newline at end of file + - woodpecker config: [link(https://git.sapphic.engineer/noe/nixos/src/branch/main/nixos/hosts/woodpecker/default.nix):noe/nixos:/nixos/hosts/woodpecker/default.nix] + + [invoke(dollcode):41666] \ No newline at end of file diff --git a/log/002-soppy-wet-nix.doll b/log/002-soppy-wet-nix.doll index 3be7321..104edee 100644 --- a/log/002-soppy-wet-nix.doll +++ b/log/002-soppy-wet-nix.doll @@ -3,7 +3,7 @@ title: soppy_wet_nix log[002] description: how it stores secrets alongside its code --- -&soppy wet nix (16MAY2025) ^a +&[invoke(dollcode):2] soppy wet nix (16MAY2025) ^a what if that one read [code:/secrets/dont_leak] but it said [codeblock:: dont_leak: ENC[AES256_GCM,data:psyelHNBMy+xglw=,iv:UhxfqAqVbCgMRMqRMA1MmvgIO18zTrVtQdFywupZyYA=,tag:Legj+njC3z8jX16n1pZszg==,type:str] @@ -381,4 +381,4 @@ description: how it stores secrets alongside its code &is doll soppy yet - sure hope so. \ No newline at end of file + sure hope so. [invoke(dollcode):41666] \ No newline at end of file diff --git a/plugins/dollcode.sh b/plugins/dollcode.sh new file mode 100755 index 0000000..d81ca59 --- /dev/null +++ b/plugins/dollcode.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +window=$1 +output="" + +if [ -z $window ]; then + window=$(cat /dev/stdin) + + if [ -z $window ]; then + echo "no number supplied" + exit 1 + fi +fi + + +while [ $window -gt 0 ]; do + mod=$(( window % 3 )) + + if [ $mod -eq 0 ]; then + window=$(( (window - 3) / 3 )) + else + window=$(( (window - mod) / 3 )) + fi + + char="" + case $mod in + 0) char="▌";; + 1) char="▖";; + 2) char="▘";; + esac + + output="$char$output" +done + +echo $output \ No newline at end of file