diff --git a/docs/assets/_custom.scss b/docs/assets/_custom.scss index 4b8612d..6e20e28 100644 --- a/docs/assets/_custom.scss +++ b/docs/assets/_custom.scss @@ -46,7 +46,7 @@ details { } &[open] summary:before { - @include arrow(45deg); + @include arrow(45deg); } .table-container { @@ -59,7 +59,8 @@ details { width: calc(100% - 1px); } - table, tbody { + table, + tbody { // fill entire width margin: 0 !important; @@ -101,13 +102,13 @@ aside.book-menu span { .source { position: relative; .filename { - position: absolute; - right: 0px; - margin: 0; - line-height: 0; - font-size: 0.8rem; - background-color: transparent; - color: #d8dee9; + position: absolute; + right: 0px; + margin: 0; + line-height: 0; + font-size: 0.8rem; + background-color: transparent; + color: #d8dee9; } } @@ -115,4 +116,4 @@ aside.book-menu span { .listing { position: absolute; bottom: 10px; -} \ No newline at end of file +} diff --git a/flake.lock b/flake.lock index 39bf586..d37e89a 100644 --- a/flake.lock +++ b/flake.lock @@ -50,11 +50,28 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1680945546, + "narHash": "sha256-8FuaH5t/aVi/pR1XxnF0qi4WwMYC+YxlfdsA0V+TEuQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "d9f759f2ea8d265d974a6e1259bd510ac5844c5d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "flake-compat": "flake-compat", "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "treefmt": "treefmt" } }, "systems": { @@ -71,6 +88,24 @@ "repo": "default", "type": "github" } + }, + "treefmt": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1688026376, + "narHash": "sha256-qJmkr9BWDpqblk4E9/rCsAEl39y2n4Ycw6KRopvpUcY=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "df3f32b0cc253dfc7009b7317e8f0e7ccd70b1cf", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index d88e0f4..6e865dc 100644 --- a/flake.nix +++ b/flake.nix @@ -3,6 +3,7 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + treefmt.url = "github:numtide/treefmt-nix"; flake-utils = { url = "github:numtide/flake-utils"; inputs.nixpkgs.follows = "nixpkgs"; @@ -63,14 +64,6 @@ devShells.default = pkgs.mkShell { buildInputs = with pkgs; [ - # formatters - alejandra - black - nodePackages.prettier - nodePackages.prettier-plugin-toml - shfmt - treefmt - # extra tools dive fd @@ -91,7 +84,24 @@ ''; }; - formatter = pkgs.treefmt; + formatter = + (inputs.treefmt.lib.evalModule pkgs { + projectRootFile = "flake.nix"; + programs = { + alejandra.enable = true; + black.enable = true; + prettier.enable = true; + shfmt.enable = true; + }; + settings.global.excludes = [ + "docs/themes/*" + "docs/layouts/*" + "modules/generated/*" + ]; + }) + .config + .build + .wrapper; apps = { docs = inputs.flake-utils.lib.mkApp { diff --git a/treefmt.toml b/treefmt.toml deleted file mode 100644 index 0103e8b..0000000 --- a/treefmt.toml +++ /dev/null @@ -1,28 +0,0 @@ -[global] -excludes = ["./docs/themes/*"] - -[formatter.nix] -command = "alejandra" -includes = ["*.nix"] -excludes = ["./modules/generated/*"] - -[formatter.prettier] -command = "prettier" -options = ["--plugin", "prettier-plugin-toml", "--write"] -includes = ["*.md", "*.yaml", "*.toml", "*.json"] -excludes = [] - -[formatter.black] -command = "black" -includes = ["*.py"] - -[formatter.shell] -command = "shfmt" -options = [ - "-i", - "2", # indent 2 - "-s", # simplify the code - "-w", # write back to the file - -] -includes = ["*.sh", "*.bash"]