This is an automated email from the ASF dual-hosted git repository.
lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git
The following commit(s) were added to refs/heads/main by this push:
new f0fc97902 docs: download and embed FontAwesome at build time (#4543)
f0fc97902 is described below
commit f0fc979024e8d5311b58d69299512bb6b9566f46
Author: David Li <[email protected]>
AuthorDate: Mon Jul 20 04:54:21 2026 -0700
docs: download and embed FontAwesome at build time (#4543)
- CSP policy means we can't embed FontAwesome from a CDN.
- We can't vendor the font files ourselves since SIL OFL is a Category B
license for ASF.
Hence we instead download them at build time.
Closes #4542.
---
.gitignore | 4 +++
CONTRIBUTING.md | 12 +++++++++
ci/scripts/docs_build.sh | 2 ++
ci/scripts/docs_download_resources.sh | 47 +++++++++++++++++++++++++++++++++++
docs/source/conf.py | 2 +-
5 files changed, 66 insertions(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index 48f1da926..5d69844b7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -138,3 +138,7 @@ javascript/**/target/
javascript/**/dist/
javascript/native/*.node
javascript/native/build/
+
+# Static assets with a license that precludes them from being included in
+# source distributions. Downloaded at docs build time instead.
+docs/source/_static/fontawesome/
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index ec61e6965..60aff775a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -248,6 +248,18 @@ $ make -f mermaid.makefile -j all
# Check in the updated files
```
+The documentation uses icons from [FontAwesome 7
+Free](https://fontawesome.com/). These must be downloaded separately (the icons
+themselves cannot be included in Apache source distributions and as such are
not
+included in the repository, and CSP policy prohibits external CSS for our
+website). Run the `docs_download_resources.sh` script to download these files:
+
+```shell
+$ ./ci/scripts/docs_download_resources.sh "$(pwd)"
+```
+
+The `docs_build.sh` script below will also perform this step for you.
+
[mermaid]: https://mermaid.js.org/
[sphinx]: https://www.sphinx-doc.org/en/master/
diff --git a/ci/scripts/docs_build.sh b/ci/scripts/docs_build.sh
index 93abaf787..f47673930 100755
--- a/ci/scripts/docs_build.sh
+++ b/ci/scripts/docs_build.sh
@@ -21,6 +21,8 @@ set -ex
main() {
local -r source_dir="${1}"
+ "${source_dir}/ci/scripts/docs_download_resources.sh" "$source_dir"
+
pushd "$source_dir/c/apidoc"
doxygen
popd
diff --git a/ci/scripts/docs_download_resources.sh
b/ci/scripts/docs_download_resources.sh
new file mode 100755
index 000000000..33d5f073c
--- /dev/null
+++ b/ci/scripts/docs_download_resources.sh
@@ -0,0 +1,47 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Download binary resources needed to build the docs which we can't include in
+# source distributions
+
+set -euxo pipefail
+
+main() {
+ local -r source_dir="${1}"
+
+ local -r tmpdir="$(mktemp -d)"
+ trap "rm -rf $tmpdir" EXIT
+
+ # FontAwesome
+ # WOFF files are under SIL Open Font License (ASF Category B)
+ # CSS file is under MIT
+ if [[ ! -f "$source_dir/docs/source/_static/fontawesome/css/all.min.css"
]]; then
+ wget -O "$tmpdir/fontawesome.tgz"
https://github.com/FortAwesome/Font-Awesome/archive/refs/tags/7.3.1.tar.gz
+ pushd $tmpdir
+ tar xvf "$tmpdir/fontawesome.tgz"
+ popd
+
+ mkdir -p "$source_dir/docs/source/_static/fontawesome/css/"
+ mv "$tmpdir/Font-Awesome-7.3.1/webfonts/"
"$source_dir/docs/source/_static/fontawesome/webfonts/"
+ cp "$tmpdir/Font-Awesome-7.3.1/css/all.min.css"
"$source_dir/docs/source/_static/fontawesome/css/"
+ else
+ echo "FontAwesome webfonts already exist, skipping download"
+ fi
+}
+
+main "$@"
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 91deff2c1..fea6ec5b1 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -141,8 +141,8 @@ except ImportError:
#
https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_css_files = [
-
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css",
"css/custom.css",
+ "fontawesome/css/all.min.css",
]
html_static_path = ["_static"]
html_theme = "furo"