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!ia0vp^0wB!63?wyl`GbL!Lb6AYF9SoB8UsT^3j@P1pisjL z28L1t28LG&3=CE?7#PG0=IjczVPIf#2=EDU1u6(CKb+Wiwr=O+;uW{c*4&A1Jrz{8 z)4ynQ?dJPcYwy%;xnI8WmUr$t-~6qfnQMIVwv;WuQL*Yq-L5CatL}tUABt^18CZ5O zZ{c;IIY350$$p>|3flP?CbiEsc~jS!_w~D@-8-UT(J^iW{g;gG5$d2=oUQB>1m z@0`tUsjG?>Uj}-le#`xk$|De!wc8%H9(?})|Nq7v4}s!!o9``u`G4xw?{%B*m9M-R zQVF#5P*BAYs3W&O0$NnJ^+EmC2f#3iZ95)VdI0Dcpiyv-WY0P0p1#T_Z>w*?cE6%s z0mXX*O7{cRz=NWC>%+j(ZC*JW9phIsFhqD|Z2-E>D|<5oL#Aiu_JGoT5S2AM9(m_% z^2y&CR-T^|Z`YHa^B;WkcK|~ywEAG>n%i}o z?*m;33^cfn5C+gCK-VVsovq)Bq973HJg^IaA?BI2x8vB0x*d-|{@wK?2;{Xx@L&gd z6Br#}DWLg41A!_7O7;R1&jO{3!1TqiyCldDl>V>-|M%V{f8t%=1*kvR${~LK!l5U+ zE;&bk_oXlWQ^n1wc;Wk}FW#{_g-;-%DvtP?D4mF z3v@eUlDE4HLkFv@2av;A;1O92%udl*pgo2Q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