From 55010f84bb0807a918c5945ca4bdb04d292e4b9e Mon Sep 17 00:00:00 2001 From: NAHO <90870942+trueNAHO@users.noreply.github.com> Date: Wed, 2 Oct 2024 17:48:23 +0200 Subject: [PATCH] examples: simple: init --- examples/simple/flake.lock | 146 +++++++++++++++++++++++++++ examples/simple/flake.nix | 26 +++++ examples/simple/src/lorem_ipsum.adoc | 8 ++ examples/simple/src/main.adoc | 22 ++++ 4 files changed, 202 insertions(+) create mode 100644 examples/simple/flake.lock create mode 100644 examples/simple/flake.nix create mode 100644 examples/simple/src/lorem_ipsum.adoc create mode 100644 examples/simple/src/main.adoc diff --git a/examples/simple/flake.lock b/examples/simple/flake.lock new file mode 100644 index 0000000..4aa1726 --- /dev/null +++ b/examples/simple/flake.lock @@ -0,0 +1,146 @@ +{ + "nodes": { + "asciidoctor-nix": { + "inputs": { + "flake-utils": "flake-utils", + "git-hooks": "git-hooks", + "nixpkgs": "nixpkgs", + "reveal-js": "reveal-js" + }, + "locked": { + "lastModified": 0, + "narHash": "sha256-W84kkX03t+wgs3ZqE1+hTwjSD+SFl6ZhHHHwJTjSAdM=", + "path": "../..", + "type": "path" + }, + "original": { + "path": "../..", + "type": "path" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": [ + "asciidoctor-nix" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "asciidoctor-nix", + "nixpkgs" + ], + "nixpkgs-stable": [ + "asciidoctor-nix", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1727514110, + "narHash": "sha256-0YRcOxJG12VGDFH8iS8pJ0aYQQUAgo/r3ZAL+cSh9nk=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "85f7a7177c678de68224af3402ab8ee1bcee25c8", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "asciidoctor-nix", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1727634051, + "narHash": "sha256-S5kVU7U82LfpEukbn/ihcyNt2+EvG7Z5unsKW9H/yFA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "06cf0e1da4208d3766d898b7fdab6513366d45b9", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "reveal-js": { + "flake": false, + "locked": { + "lastModified": 1727685694, + "narHash": "sha256-sWTjnVpRfuVvAexwgFg/6brPrGgzmoG5lrZV4Ifw1Zk=", + "owner": "hakimel", + "repo": "reveal.js", + "rev": "669cc25e55f498bced468563ba239659309096df", + "type": "github" + }, + "original": { + "owner": "hakimel", + "repo": "reveal.js", + "type": "github" + } + }, + "root": { + "inputs": { + "asciidoctor-nix": "asciidoctor-nix" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/examples/simple/flake.nix b/examples/simple/flake.nix new file mode 100644 index 0000000..cf75183 --- /dev/null +++ b/examples/simple/flake.nix @@ -0,0 +1,26 @@ +{ + description = "Simple example"; + inputs.asciidoctor-nix.url = "path:../.."; + + outputs = inputs: + builtins.removeAttrs inputs.asciidoctor-nix [ + "_type" + "inputs" + "lastModified" + "lastModifiedDate" + "lib" + "narHash" + "outPath" + "outputs" + "packages" + "sourceInfo" + ] + // inputs.asciidoctor-nix.inputs.flake-utils.lib.eachDefaultSystem ( + system: { + packages = + inputs.asciidoctor-nix.inputs.nixpkgs.legacyPackages.${system}.lib.attrsets.unionOfDisjoint + (inputs.asciidoctor-nix.lib.${system}.packages {src = ./src;}) + (inputs.asciidoctor-nix.packages.${system} or {}); + } + ); +} diff --git a/examples/simple/src/lorem_ipsum.adoc b/examples/simple/src/lorem_ipsum.adoc new file mode 100644 index 0000000..239095b --- /dev/null +++ b/examples/simple/src/lorem_ipsum.adoc @@ -0,0 +1,8 @@ += Lorem ipsum + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor +incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis +nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. +Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu +fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in +culpa qui officia deserunt mollit anim id est laborum. diff --git a/examples/simple/src/main.adoc b/examples/simple/src/main.adoc new file mode 100644 index 0000000..07187ef --- /dev/null +++ b/examples/simple/src/main.adoc @@ -0,0 +1,22 @@ += asciidoctor.nix +:sectnums: + +include::lorem_ipsum.adoc[leveloffset=+1] + +include::lorem_ipsum.adoc[leveloffset=+2] + +include::lorem_ipsum.adoc[leveloffset=+1] + +include::lorem_ipsum.adoc[leveloffset=+2] + +include::lorem_ipsum.adoc[leveloffset=+1] + +include::lorem_ipsum.adoc[leveloffset=+2] + +include::lorem_ipsum.adoc[leveloffset=+1] + +include::lorem_ipsum.adoc[leveloffset=+2] + +include::lorem_ipsum.adoc[leveloffset=+1] + +include::lorem_ipsum.adoc[leveloffset=+2]