Skip to content

Commit 4ae3158

Browse files
authored
Merge pull request #291 from numtide/mkdocs-skeleton
Mkdocs skeleton
2 parents a015a47 + 7b49b30 commit 4ae3158

File tree

11 files changed

+435
-4
lines changed

11 files changed

+435
-4
lines changed

.github/workflows/docs.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Deploy docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "v*"
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
jobs:
14+
deploy:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
concurrency:
19+
group: ${{ github.workflow }}
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- uses: cachix/install-nix-action@v31
26+
27+
- name: Configure Git user
28+
run: |
29+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
30+
git config --local user.name "github-actions[bot]"
31+
32+
- name: Deploy main
33+
if: github.ref_name == 'main'
34+
run: |
35+
nix develop ./docs --command bash -c "cd docs && mike deploy -p main"
36+
37+
- name: Deploy version
38+
if: startsWith(github.ref, 'refs/tags/v')
39+
run: |
40+
REF_NAME=${{ github.ref_name }}
41+
MAJOR_MINOR=${REF_NAME%.*}
42+
nix develop ./docs --command bash -c "cd docs && mike deploy -p -u ${MAJOR_MINOR} latest"

.treefmt.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,3 @@ includes = ["*.nix"]
77
[formatter.rustfmt]
88
command = "rustfmt"
99
includes = ["*.rs"]
10-
11-
[formatter.markdown]
12-
command = "mdformat"
13-
includes = ["*.md"]

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
out/

docs/flake.lock

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/flake.nix

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
description = "System Manager documentation";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6+
mkdocs-numtide.url = "github:numtide/mkdocs-numtide";
7+
mkdocs-numtide.inputs.nixpkgs.follows = "nixpkgs";
8+
};
9+
10+
outputs =
11+
{
12+
self,
13+
nixpkgs,
14+
mkdocs-numtide,
15+
}:
16+
let
17+
systems = [
18+
"aarch64-linux"
19+
"aarch64-darwin"
20+
"x86_64-darwin"
21+
"x86_64-linux"
22+
];
23+
eachSystem =
24+
f:
25+
nixpkgs.lib.genAttrs systems (
26+
system:
27+
f {
28+
inherit system;
29+
pkgs = nixpkgs.legacyPackages.${system};
30+
}
31+
);
32+
in
33+
{
34+
packages = eachSystem (
35+
{ system, pkgs }:
36+
{
37+
default = pkgs.stdenvNoCC.mkDerivation {
38+
name = "system-manager-docs";
39+
40+
src = pkgs.lib.fileset.toSource {
41+
root = ./.;
42+
fileset = pkgs.lib.fileset.unions [
43+
./site
44+
./theme
45+
./mkdocs.yml
46+
];
47+
};
48+
49+
nativeBuildInputs = [
50+
mkdocs-numtide.packages.${system}.default
51+
];
52+
53+
buildPhase = ''
54+
mkdocs build
55+
'';
56+
57+
installPhase = ''
58+
mv out $out
59+
'';
60+
};
61+
}
62+
);
63+
64+
devShells = eachSystem (
65+
{ system, pkgs, ... }:
66+
{
67+
default = pkgs.mkShell {
68+
packages = [
69+
mkdocs-numtide.packages.${system}.default
70+
];
71+
shellHook = ''
72+
echo "MkDocs ready. Try: mkdocs serve"
73+
'';
74+
};
75+
}
76+
);
77+
};
78+
}

docs/mkdocs.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Project info
2+
site_name: System Manager
3+
site_url: https://system-manager.net
4+
site_description: >-
5+
Declarative system management for any Linux machine using Nix.
6+
7+
# Repository
8+
repo_name: numtide/system-manager
9+
repo_url: https://github.com/numtide/system-manager
10+
11+
# Copyright
12+
copyright: >-
13+
Content on this site is licensed under a <a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons
14+
Attribution-ShareAlike 4.0 International license</a>.
15+
16+
validation:
17+
omitted_files: warn
18+
absolute_links: warn
19+
unrecognized_links: warn
20+
21+
# Configuration
22+
23+
docs_dir: site
24+
site_dir: out
25+
26+
theme:
27+
name: material
28+
custom_dir: theme
29+
30+
# logo: assets/images/logo.png
31+
# favicon: assets/images/logo.png
32+
33+
features:
34+
- content.code.annotate
35+
- content.code.copy
36+
- navigation.footer
37+
- navigation.indexes
38+
- navigation.path
39+
- navigation.sections
40+
- navigation.tabs
41+
- navigation.tracking
42+
- search.highlight
43+
- search.share
44+
- search.suggest
45+
46+
font:
47+
text: Inter
48+
code: JetBrains Mono
49+
palette:
50+
# Palette toggle for automatic mode
51+
- media: "(prefers-color-scheme)"
52+
toggle:
53+
icon: material/brightness-auto
54+
name: Switch to light mode
55+
56+
# Palette toggle for light mode
57+
- media: "(prefers-color-scheme: light)"
58+
scheme: default
59+
primary: deep orange
60+
accent: indigo
61+
toggle:
62+
icon: material/brightness-7
63+
name: Switch to dark mode
64+
65+
# Palette toggle for dark mode
66+
- media: "(prefers-color-scheme: dark)"
67+
scheme: slate
68+
primary: deep orange
69+
accent: indigo
70+
toggle:
71+
icon: material/brightness-4
72+
name: Switch to system preference
73+
74+
extra:
75+
version:
76+
provider: mike
77+
social:
78+
- icon: fontawesome/brands/github
79+
link: https://github.com/numtide
80+
- icon: fontawesome/brands/x-twitter
81+
link: https://x.com/numtide
82+
- icon: fontawesome/brands/mastodon
83+
link: https://fosstodon.org/@numtide
84+
85+
extra_css:
86+
- stylesheets/extra.css
87+
88+
markdown_extensions:
89+
- tables
90+
- admonition
91+
- attr_list
92+
- footnotes
93+
- md_in_html
94+
- def_list
95+
- meta
96+
- pymdownx.emoji:
97+
emoji_index: !!python/name:material.extensions.emoji.twemoji
98+
emoji_generator: !!python/name:material.extensions.emoji.to_svg
99+
- pymdownx.tasklist:
100+
custom_checkbox: true
101+
- pymdownx.superfences
102+
- pymdownx.tabbed:
103+
alternate_style: true
104+
- pymdownx.details
105+
- pymdownx.highlight:
106+
use_pygments: true
107+
linenums: true
108+
anchor_linenums: true
109+
- pymdownx.inlinehilite
110+
- pymdownx.keys
111+
- toc:
112+
permalink: true
113+
114+
plugins:
115+
- mike
116+
- search
117+
- git-revision-date-localized:
118+
enable_creation_date: true
119+
type: date
120+
fallback_to_build_date: true
121+
- tags

docs/site/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
system-manager.net

docs/site/getting-started/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Getting Started
2+
3+
Documentation coming soon.

docs/site/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
template: home.html
3+
search:
4+
exclude: true
5+
---
6+
7+
# Home

docs/site/stylesheets/extra.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* Custom styles for System Manager docs */
2+
3+
/* Slightly round code blocks and tighten spacing */
4+
.md-typeset pre,
5+
.md-typeset code {
6+
border-radius: 8px;
7+
}
8+
9+
/* Make tables a bit more compact without losing readability */
10+
.md-typeset table:not([class]) th,
11+
.md-typeset table:not([class]) td {
12+
padding: 0.5rem 0.75rem;
13+
}
14+
15+
/* Subtle underline for links */
16+
.md-typeset a {
17+
text-underline-offset: 2px;
18+
text-decoration-thickness: 1.5px;
19+
}

0 commit comments

Comments
 (0)