227: docs: use mkdocs-numtide r=zimbatm a=zimbatm



Co-authored-by: zimbatm <zimbatm@zimbatm.com>
This commit is contained in:
bors[bot] 2023-04-01 14:30:21 +00:00 committed by GitHub
commit e7345cbeac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 36 additions and 207 deletions

View File

@ -7,6 +7,7 @@
config = { };
}
, rustVersion ? nixpkgs.rust-bin.stable."1.65.0".default
, mkdocs-numtide ? import inputs.mkdocs-numtide { pkgs = nixpkgs; }
}:
let
lib = nixpkgs.lib;
@ -87,8 +88,7 @@ let
terraform
# Docs
mkdocs
python310Packages.mkdocs-material
mkdocs-numtide
]);
});
in
@ -98,9 +98,6 @@ in
# reduce a bit of repetition
inherit (treefmt.passthru) withConfig;
# A collection of packages for the project
docs = nixpkgs.callPackage ./docs { };
# Flake attributes
default = treefmt;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

View File

@ -1,30 +0,0 @@
{ stdenv, mkdocs, python310Packages }:
stdenv.mkDerivation {
name = "treefmt-docs";
src = builtins.path {
name = "treefmt-docs";
path = ./.;
};
# Re-create the folder structure since mkdocs insists on having the
# mkdocs.yml at the root of the repo.
unpackPhase = ''
cp -r --no-preserve=mode $src docs
cp ${../mkdocs.yml} mkdocs.yml
'';
nativeBuildInputs = [
mkdocs
python310Packages.mkdocs-material
];
buildPhase = ''
mkdocs build
'';
installPhase = ''
mv site $out
'';
}

View File

@ -1,114 +0,0 @@
@font-face {
font-family: Eurostile-Roman;
src: url("../assets/fonts/Eurostile-Roman.ttf");
}
:root > * {
--md-text-font: Eurostile-Roman;
}
/* light scheme */
[data-md-color-scheme="default"] {
--md-primary-fg-color: #f58220;
--md-primary-fg-color--light: #f58220;
--md-primary-fg-color--dark: #d41f26;
--md-accent-fg-color: #d41f26;
--md-header-bg-color: #ffffff;
--md-footer-bg-color: #939598;
--md-text-font: Eurostile-Roman;
--md-default-fg-color: #58595b;
--md-default-fg-color--light: #d41f26;
}
/* dark scheme as set in .yaml */
[data-md-color-scheme="slate"] {
--md-primary-fg-color: #546d78;
--md-typeset-color: #e9ebfc !important;
--md-default-fg-color: #e9ebfc;
--md-typeset-a-color: #fbaa31 !important;
/* --md-default-fg-color--light: #F58220; */
--md-text-font: Eurostile-Roman;
}
/* --------------------------- Header --------------------------- */
/* Logo */
.md-header__button.md-logo img,
.md-header__button.md-logo svg {
height: 2rem;
}
.md-header__button.md-logo {
background-color: #ffffff;
border-radius: 8px;
padding: 0.2rem;
}
.md-header__title {
color: #ffffff;
font-size: 1.4rem;
}
/* search input in header */
.md-search__form {
height: 1.8rem;
margin: 9px 0;
}
.md-search-result__meta {
margin-top: 0.3rem;
}
.md-tabs__link {
font-size: 0.8rem;
}
/* --------------------------- Navigation --------------------------- */
.md-nav__title {
color: #ffffff;
background-color: #939598 !important;
font-size: 1.1rem;
font-weight: 500;
}
.md-nav {
font-size: 0.8rem;
line-height: 1.3;
}
.md-sidebar--primary .md-sidebar__scrollwrap {
border-right: 1px solid #939598;
}
.md-sidebar__inner {
padding-right: 0 !important;
}
.md-nav__link--passed {
color: #fbaa31;
}
/* --------------------------- font stuff --------------------------- */
.md-typeset h1 {
font-size: 1.75rem;
line-height: 1.3;
margin: 0 0 1.25em;
font-weight: 500;
}
.md-typeset h2 {
color: #fbaa31;
font-weight: 500;
line-height: 1.3;
margin: 0 0 1.25em;
}
.md-typeset h3 {
color: #fbaa31;
}
/* highlights / links */
.md-typeset a {
color: #fbaa31;
}

View File

@ -35,6 +35,26 @@
"type": "github"
}
},
"mkdocs-numtide": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1680358379,
"narHash": "sha256-f4v6oIcqoQfUKfOsWbFkgKeGZkKTAo0nRwvL0IQGGnQ=",
"owner": "numtide",
"repo": "mkdocs-numtide",
"rev": "af6c4a5f7c0a59da3b557795f57dcae5707523ac",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "mkdocs-numtide",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1671160997,
@ -54,6 +74,7 @@
"root": {
"inputs": {
"flake-parts": "flake-parts",
"mkdocs-numtide": "mkdocs-numtide",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}

View File

@ -9,13 +9,17 @@
inputs.rust-overlay.url = "github:oxalica/rust-overlay";
inputs.rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
outputs = { self, nixpkgs, flake-parts, rust-overlay }@inputs:
inputs.mkdocs-numtide.url = "github:numtide/mkdocs-numtide";
inputs.mkdocs-numtide.inputs.nixpkgs.follows = "nixpkgs";
outputs = { self, nixpkgs, flake-parts, mkdocs-numtide, ... }@inputs:
flake-parts.lib.mkFlake { inherit self; } {
systems = nixpkgs.lib.systems.flakeExposed;
perSystem = { system, pkgs, ... }:
let
packages = import ./. {
inherit system;
mkdocs-numtide = mkdocs-numtide.packages.${system}.default;
};
in
{
@ -25,6 +29,11 @@
# Allow `nix run github:numtide/treefmt`.
packages.default = packages.treefmt;
packages.docs = mkdocs-numtide.lib.${system}.mkDocs {
name = "treefmt-docs";
src = ./.;
};
devShells.default = packages.devShell;
};
};

View File

@ -1,3 +1,5 @@
INHERIT: !ENV MKDOCS_NUMTIDE_THEME
### Site metadata ###
site_name: treefmt
@ -6,64 +8,8 @@ site_url: https://numtide.github.io/treefmt/
repo_name: 'numtide/treefmt'
repo_url: https://github.com/numtide/treefmt
edit_uri: edit/main/docs
copyright: Copyright &copy; Numtide
extra:
social:
- icon: fontawesome/brands/github
link: https://github.com/numtide
name: Numtide on Github
- icon: fontawesome/brands/twitter
link: https://twitter.com/numtide
name: Numtide on Twitter
generator: false # hide the line "Made with Material for MkDocs"
### Build settings ###
extra_css:
- stylesheets/extra.css
markdown_extensions:
- tables
- admonition
- pymdownx.escapeall
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
- pymdownx.tabbed:
alternate_style: true
- pymdownx.tasklist
theme:
name: 'material'
palette:
- scheme: default
primary: teal
accent: orange
toggle:
icon: material/brightness-7
name: Switch to dark mode
- scheme: slate
primary: blue grey
accent: orange
toggle:
icon: material/brightness-4
name: Switch to light mode
font:
text: Roboto
# text: Montserrat
code: Roboto Mono
favicon: assets/favicon.png
logo: assets/logo.png
features:
- navigation.tabs
- navigation.tabs.sticky
- navigation.top
- content.action.edit
- content.action.view
### Navigation ###
nav:
- Home: index.md