diff --git a/bun.lockb b/bun.lockb index 486913e..d1c4f69 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/flake.nix b/flake.nix index 77c7d3f..1a63c29 100644 --- a/flake.nix +++ b/flake.nix @@ -9,7 +9,11 @@ let pkgs = import nixpkgs { inherit system; }; in { # For local development... - devShell = pkgs.mkShell { buildInputs = with pkgs; [ bun ]; }; + devShell = pkgs.mkShell { + LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ pkgs.stdenv.cc.cc.lib ]; + + buildInputs = with pkgs; [ bun ]; + }; # ... and remote deployment. # packages = {}; diff --git a/package.json b/package.json index 6aa3a97..63f9681 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,6 @@ "type": "module", "dependencies": { "@sveltejs/enhanced-img": "^0.3.8", - "prismjs": "^1.29.0" + "svelte-highlight": "^7.7.0" } } diff --git a/src/lib/Highlight.svelte b/src/lib/Highlight.svelte new file mode 100644 index 0000000..78e1e68 --- /dev/null +++ b/src/lib/Highlight.svelte @@ -0,0 +1,15 @@ + + +
+ +
diff --git a/src/lib/hljs.css b/src/lib/hljs.css new file mode 100644 index 0000000..6ec1544 --- /dev/null +++ b/src/lib/hljs.css @@ -0,0 +1,86 @@ +pre code.hljs { + display: block; + overflow-x: auto; +} +/*! + Theme: floral.systems + Description: github theme modified + Base: https://unpkg.com/svelte-highlight@7.7.0/styles/github.css +*/ +.hljs { + color: #24292e; +} +.hljs-doctag, +.hljs-keyword, +.hljs-literal, +.hljs-meta .hljs-keyword, +.hljs-template-tag, +.hljs-template-variable, +.hljs-type, +.hljs-variable.language_ { + color: theme(colors.coral.600); +} +.hljs-title, +.hljs-title.class_, +.hljs-title.class_.inherited__, +.hljs-title.function_ { + color: #6f42c1; +} + +.hljs-attr, +.hljs-attribute, +.hljs-meta, +.hljs-number, +.hljs-operator, +.hljs-variable, +.hljs-selector-attr, +.hljs-selector-class, +.hljs-selector-id { + color: theme(colors.teal.700); +} +.hljs-regexp, +.hljs-string, +.hljs-meta .hljs-string { + color: theme(colors.coral.700); +} +.hljs-built_in, +.hljs-symbol { + color: theme(colors.coral.500); +} +.hljs-comment, +.hljs-code, +.hljs-formula { + color: #6a737d; +} +.hljs-name, +.hljs-quote, +.hljs-selector-tag, +.hljs-selector-pseudo { + color: #22863a; +} +.hljs-subst { + color: #24292e; +} +.hljs-section { + color: #005cc5; + font-weight: bold; +} +.hljs-bullet { + color: #735c0f; +} +.hljs-emphasis { + color: #24292e; + font-style: italic; +} +.hljs-strong { + color: #24292e; + font-weight: bold; +} +.hljs-addition { + color: #22863a; + background-color: #f0fff4; +} +.hljs-deletion { + color: #b31d28; + background-color: #ffeef0; +} diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 2494d3f..a5a525c 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,5 +1,7 @@ @@ -33,15 +35,15 @@

{DISTRO} — our linux distribution

-
+
Gain certainty in your deployed system configuration by replacing your opaque state with code. -
- {@html Prism.highlight(demo1.replace(/#[^]*?#<\/slice>/,""), Prism.languages["javascript"], "nix")} +
+
-
+
diff --git a/src/routes/demo1/vm.nix b/src/routes/demo1/vm.nix index 98b1345..3e17ac4 100644 --- a/src/routes/demo1/vm.nix +++ b/src/routes/demo1/vm.nix @@ -4,10 +4,11 @@ with import { }; nixos enable = true; httpd.virtualHost.hostName = "localhost:3000"; httpd.virtualHost.adminAddr = "root@example.com"; - passwordFile = pkgs.writeText "password" "correcthorsebatterystaple"; + passwordFile = + pkgs.writeText "password" "correcthorsebatterystaple"; }; - networking.firewall.allowedTCPPorts = [ 80 ];# + networking.firewall.allowedTCPPorts = [ 80 ];# users.users.root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH3uTwzSSMAPg84fwbNp2cq9+BdLFeA1VzDGth4zCAbz https://ckie.dev" @@ -16,5 +17,5 @@ with import { }; nixos enable = true; settings.PermitRootLogin = "yes"; }; -# +# }