From 59597628cb5841cbefc38accd89e7eda663551a1 Mon Sep 17 00:00:00 2001 From: Valentin Gagarin Date: Wed, 3 Apr 2024 16:22:47 +0200 Subject: [PATCH] show Nix logo in the manual (#9870) * show Nix logo in the manual the location of files is hard-coded by mdBook. there is also seems to be no way to define custom templates, therefore all styling has to be done in the CSS override. Co-authored-by: Robert Hensing --- doc/manual/custom.css | 22 ++++++++++++++++++++++ doc/manual/local.mk | 2 +- doc/manual/src/favicon.png | Bin 0 -> 1205 bytes doc/manual/src/favicon.svg | 1 + 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 doc/manual/src/favicon.png create mode 100644 doc/manual/src/favicon.svg diff --git a/doc/manual/custom.css b/doc/manual/custom.css index b90f5423f..9e8e3886f 100644 --- a/doc/manual/custom.css +++ b/doc/manual/custom.css @@ -1,3 +1,25 @@ +:root { + --sidebar-width: 23em; +} + +h1.menu-title::before { + content: ""; + background-image: url("./favicon.svg"); + padding: 1.25em; + background-position: center center; + background-size: 2em; + background-repeat: no-repeat; +} + + +h1.menu-title { + padding: 0.5em; +} + +.sidebar .sidebar-scrollbox { + padding: 1em; +} + h1:not(:first-of-type) { margin-top: 1.3em; } diff --git a/doc/manual/local.mk b/doc/manual/local.mk index 698a9289b..71ad5c8e6 100644 --- a/doc/manual/local.mk +++ b/doc/manual/local.mk @@ -217,7 +217,7 @@ doc/manual/generated/man1/nix3-manpages: $(d)/src/command-ref/new-cli # `@docroot@` is to be preserved for documenting the mechanism # FIXME: maybe contributing guides should live right next to the code # instead of in the manual -$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/anchors.jq $(d)/custom.css $(d)/src/SUMMARY.md $(d)/src/store/types $(d)/src/command-ref/new-cli $(d)/src/contributing/experimental-feature-descriptions.md $(d)/src/command-ref/conf-file.md $(d)/src/language/builtins.md $(d)/src/language/builtin-constants.md $(d)/src/release-notes/rl-next.md +$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/anchors.jq $(d)/custom.css $(d)/src/SUMMARY.md $(d)/src/store/types $(d)/src/command-ref/new-cli $(d)/src/contributing/experimental-feature-descriptions.md $(d)/src/command-ref/conf-file.md $(d)/src/language/builtins.md $(d)/src/language/builtin-constants.md $(d)/src/release-notes/rl-next.md $(d)/src/figures $(d)/src/favicon.png $(d)/src/favicon.svg $(trace-gen) \ tmp="$$(mktemp -d)"; \ cp -r doc/manual "$$tmp"; \ diff --git a/doc/manual/src/favicon.png b/doc/manual/src/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..1ed2b5fe0fdf7a6144adc5cdfa31b5f553df4610 GIT binary patch literal 1205 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4rT@h1`S>QUj?_l`4}d(&oy~d*O~YAyPtv-?0j6e1B8Og4?`6c z@AWI(>6N`HbLKga)b>X~Wgsbt0*D%akeVGnxto3SHyapd+#b=w}+ZGBL`^+DCzJF#uY14|DC zmK_W#KMeOs_MCI>>8pJ5w)z%q_bb{JP`o#wbbnykL68D)fK+dN7+AW^D`%r){Avb< z2(PRS-Z`7SvNtm@WO`<94=CLSQCYL&k$27}pZu+1HT&x}-EY|XAb0M$h=x5e?T4zj zJ*?mTw0;jb^maYzIsd^oe}`Y;&d}p zq9_O~-48-#2LsCvduHwJIQF7$$0Lw`cRdLLdF>D+pdchDI(9w=nYsN@K=IzX9ghM^ z_A)RqEKs`mf`NfycS(>RDE%>D1^(~7Oa8>Wz6(%)u$4pn{DnhLbX{_e{_aa(`lpJU zQSrj}PhY-$yMO1SInQKmAuGG(XTvScBR@?{{Sn2&&S>*?Av5#bd-u;V&pWXD_EUZB zBQFjuUUKxsQ61gKclRDz#G-Ka!QBPSO!MB^GqJNq{79ehDaOJo{QPQrYa#7vyrv)S zJ^1$h>*w!Ej67w3m#6jq%5l+tczsawacox6AN;>nw>6C2N7 zJ$v`?<(r`OQjQC6?fTVrY*`xH!)e#Hed{~7?%lk5`~GnX zyGpdE`_3~ez4b-XIQ{HAjV1PqkYbnGPjshp*ihvAOK- zFJ9@^MkXGfN3+fHZ|=(7eWY*h?v{-|WEozb@;EsEV8c5G1_sFz*NBqf{Irtt#G+J& j^73-M%)IR4 \ No newline at end of file