From ef0e9324b807f11883e76bf1de46aab429fbd25b Mon Sep 17 00:00:00 2001 From: clarasb Date: Fri, 18 Sep 2026 16:37:53 +0200 Subject: [PATCH 1/3] add fonts and links in footer --- .gitignore | 3 + docs/assets/fonts/OFL.txt | 93 ++++++++++++++++++++++++++ docs/hooks/download_fonts.py | 44 ++++++++++++ docs/overrides/partials/copyright.html | 11 +++ docs/stylesheet/extra.css | 21 ++++++ mkdocs.yml | 27 ++++++-- 6 files changed, 192 insertions(+), 7 deletions(-) create mode 100644 docs/assets/fonts/OFL.txt create mode 100644 docs/hooks/download_fonts.py create mode 100644 docs/overrides/partials/copyright.html create mode 100644 docs/stylesheet/extra.css diff --git a/.gitignore b/.gitignore index d316ee0..ec2a642 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,6 @@ notebooks/*.zarr/ *.sln *.sw? .idea/ + +# Downloaded font assets +docs/assets/fonts/*.ttf \ No newline at end of file diff --git a/docs/assets/fonts/OFL.txt b/docs/assets/fonts/OFL.txt new file mode 100644 index 0000000..9c48e05 --- /dev/null +++ b/docs/assets/fonts/OFL.txt @@ -0,0 +1,93 @@ +Copyright 2011 The Roboto Project Authors (https://github.com/googlefonts/roboto-classic) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://openfontlicense.org + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/docs/hooks/download_fonts.py b/docs/hooks/download_fonts.py new file mode 100644 index 0000000..5c95ff4 --- /dev/null +++ b/docs/hooks/download_fonts.py @@ -0,0 +1,44 @@ +from pathlib import Path +from urllib.error import URLError +from urllib.request import urlretrieve + +ROBOTO_BASE_URL = "https://raw.githubusercontent.com/google/fonts/main/ofl/roboto" + +DOWNLOADS = ( + { + "name": "Roboto.ttf", + "url": f"{ROBOTO_BASE_URL}/Roboto%5Bwdth,wght%5D.ttf", + }, + { + "name": "Roboto-Italic.ttf", + "url": f"{ROBOTO_BASE_URL}/Roboto-Italic%5Bwdth,wght%5D.ttf", + }, + { + "name": "OFL.txt", + "url": f"{ROBOTO_BASE_URL}/OFL.txt", + }, +) + + +def on_config(config): + """Download self-hosted Roboto assets before MkDocs builds the site.""" + docs_dir = Path(config["docs_dir"]) + font_dir = docs_dir / "assets" / "fonts" + font_dir.mkdir(parents=True, exist_ok=True) + + for item in DOWNLOADS: + target = font_dir / item["name"] + if target.exists(): + continue + + try: + print(f"Downloading Roboto asset: {item['name']}") + urlretrieve(item["url"], target) + except URLError as exc: + raise RuntimeError( + f"Could not download {item['name']} from {item['url']}. " + "Check your network connection or place the file manually in " + f"{font_dir}." + ) from exc + + return config diff --git a/docs/overrides/partials/copyright.html b/docs/overrides/partials/copyright.html new file mode 100644 index 0000000..64cdec3 --- /dev/null +++ b/docs/overrides/partials/copyright.html @@ -0,0 +1,11 @@ + diff --git a/docs/stylesheet/extra.css b/docs/stylesheet/extra.css new file mode 100644 index 0000000..6aeb267 --- /dev/null +++ b/docs/stylesheet/extra.css @@ -0,0 +1,21 @@ +@font-face { + font-family: "Roboto"; + src: url("../assets/fonts/Roboto.ttf") format("truetype"); + font-style: normal; + font-weight: 100 900; + font-stretch: 75% 100%; + font-display: swap; +} + +@font-face { + font-family: "Roboto"; + src: url("../assets/fonts/Roboto-Italic.ttf") format("truetype"); + font-style: italic; + font-weight: 100 900; + font-stretch: 75% 100%; + font-display: swap; +} + +:root { + --md-text-font: "Roboto", "Segoe UI", Helvetica, Arial, sans-serif; +} diff --git a/mkdocs.yml b/mkdocs.yml index ca30b93..b5c4cd5 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -18,6 +18,8 @@ theme: name: material # logo: assets/logo.png # favicon: assets/logo-small.png + font: false + custom_dir: docs/overrides palette: # Palette toggle for light mode - scheme: default @@ -41,13 +43,6 @@ markdown_extensions: emoji_index: !!python/name:material.extensions.emoji.twemoji emoji_generator: !!python/name:material.extensions.emoji.to_svg -extra: - social: - - icon: fontawesome/brands/github - link: https://github.com/bcdev/xrlint - - icon: fontawesome/brands/python - link: https://pypi.org/project/xrlint/ - watch: - xrlint @@ -76,3 +71,21 @@ plugins: members_order: source extra: show_overloads: true + +extra: + social: + - icon: fontawesome/brands/github + link: https://github.com/bcdev/xrlint + - icon: fontawesome/brands/python + link: https://pypi.org/project/xrlint/ + footer_links: + - text: Imprint + href: https://www.brockmann-consult.de/imprint/ + - text: Privacy Policy + href: https://www.brockmann-consult.de/privacy-policy/ + +extra_css: + - stylesheet/extra.css + +hooks: + - docs/hooks/download_fonts.py \ No newline at end of file From 3233e006814daa42445193819db5fc18d06c8a01 Mon Sep 17 00:00:00 2001 From: clarasb Date: Thu, 24 Sep 2026 08:58:40 +0200 Subject: [PATCH 2/3] update link to policy --- mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index b5c4cd5..6de0897 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -82,7 +82,7 @@ extra: - text: Imprint href: https://www.brockmann-consult.de/imprint/ - text: Privacy Policy - href: https://www.brockmann-consult.de/privacy-policy/ + href: https://www.brockmann-consult.de/privacy-policy-documentation-pages/ extra_css: - stylesheet/extra.css From 6a1e4d7af9b9831c7265f8ed2f90423ca748237a Mon Sep 17 00:00:00 2001 From: clarasb Date: Wed, 30 Sep 2026 12:38:56 +0200 Subject: [PATCH 3/3] update font hanfdling --- .gitignore | 4 +- docs/assets/fonts/OFL.txt | 93 ------------------------------------ docs/hooks/download_fonts.py | 2 +- docs/stylesheet/extra.css | 4 +- 4 files changed, 5 insertions(+), 98 deletions(-) delete mode 100644 docs/assets/fonts/OFL.txt diff --git a/.gitignore b/.gitignore index ec2a642..26de413 100644 --- a/.gitignore +++ b/.gitignore @@ -34,5 +34,5 @@ notebooks/*.zarr/ *.sw? .idea/ -# Downloaded font assets -docs/assets/fonts/*.ttf \ No newline at end of file +# Downloaded assets +docs/assets/downloaded/* \ No newline at end of file diff --git a/docs/assets/fonts/OFL.txt b/docs/assets/fonts/OFL.txt deleted file mode 100644 index 9c48e05..0000000 --- a/docs/assets/fonts/OFL.txt +++ /dev/null @@ -1,93 +0,0 @@ -Copyright 2011 The Roboto Project Authors (https://github.com/googlefonts/roboto-classic) - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -https://openfontlicense.org - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/docs/hooks/download_fonts.py b/docs/hooks/download_fonts.py index 5c95ff4..32a7444 100644 --- a/docs/hooks/download_fonts.py +++ b/docs/hooks/download_fonts.py @@ -23,7 +23,7 @@ def on_config(config): """Download self-hosted Roboto assets before MkDocs builds the site.""" docs_dir = Path(config["docs_dir"]) - font_dir = docs_dir / "assets" / "fonts" + font_dir = docs_dir / "assets" / "downloaded" / "fonts" font_dir.mkdir(parents=True, exist_ok=True) for item in DOWNLOADS: diff --git a/docs/stylesheet/extra.css b/docs/stylesheet/extra.css index 6aeb267..38b6b4c 100644 --- a/docs/stylesheet/extra.css +++ b/docs/stylesheet/extra.css @@ -1,6 +1,6 @@ @font-face { font-family: "Roboto"; - src: url("../assets/fonts/Roboto.ttf") format("truetype"); + src: url("../assets/downloaded/fonts/Roboto.ttf") format("truetype"); font-style: normal; font-weight: 100 900; font-stretch: 75% 100%; @@ -9,7 +9,7 @@ @font-face { font-family: "Roboto"; - src: url("../assets/fonts/Roboto-Italic.ttf") format("truetype"); + src: url("../assets/downloaded/fonts/Roboto-Italic.ttf") format("truetype"); font-style: italic; font-weight: 100 900; font-stretch: 75% 100%;