aboutsummaryrefslogtreecommitdiff
path: root/documentation/tools
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/tools')
-rw-r--r--documentation/tools/README2
-rwxr-xr-xdocumentation/tools/addkey.sh15
-rwxr-xr-xdocumentation/tools/asciidoctor.sh41
-rwxr-xr-xdocumentation/tools/checkkey.sh16
-rw-r--r--documentation/tools/global-pgpkeys-creator.rb4
5 files changed, 56 insertions, 22 deletions
diff --git a/documentation/tools/README b/documentation/tools/README
index 8e6cf312bb..744bfe35e1 100644
--- a/documentation/tools/README
+++ b/documentation/tools/README
@@ -54,7 +54,7 @@ key IDs on the command line, addkey.sh will look for a key that
matches your FreeBSD.org email address.
The script will generate a file named <freefall-login>.key (des.key in
-my case) with programlisting elements: one that contains the
+my case) with literal-block-margin elements: one that contains the
fingerprints of all the keys you exported, and one that contains an
ASCII dump of those keys, as produced by 'gpg --armor --export'. It
will also add a line to pgpkeys.ent defining an external entity named
diff --git a/documentation/tools/addkey.sh b/documentation/tools/addkey.sh
index 9b77bdf4df..776aeee40c 100755
--- a/documentation/tools/addkey.sh
+++ b/documentation/tools/addkey.sh
@@ -73,19 +73,20 @@ if [ $# -ne 0 ] ; then
case $(expr "${arg}" : '^[0-9A-Fa-f]\{8,16\}$') in
8)
warning "${arg}: recommend using 16-digit keyid"
- ;&
+ ;;
16)
- keyid=$(getkeybyid "${arg}")
- if [ -n "${keyid}" ] ; then
- keyids="${keyids} ${keyid}"
- else
- warning "${arg} not found"
- fi
;;
*)
warning "${arg} does not appear to be a valid key ID"
+ continue
;;
esac
+ keyid=$(getkeybyid "${arg}")
+ if [ -n "${keyid}" ] ; then
+ keyids="${keyids} ${keyid}"
+ else
+ warning "${arg} not found"
+ fi
done
else
# Search for keys by freebsd.org email
diff --git a/documentation/tools/asciidoctor.sh b/documentation/tools/asciidoctor.sh
index a834b2e532..1bf1e61554 100755
--- a/documentation/tools/asciidoctor.sh
+++ b/documentation/tools/asciidoctor.sh
@@ -27,8 +27,15 @@
LOCALBASE="/usr/local"
-ASCIIDOCTORPDF_CMD="${LOCALBASE}/bin/asciidoctor-pdf"
-ASCIIDOCTOREPUB_CMD="${LOCALBASE}/bin/asciidoctor-epub3"
+
+if [ "$USE_RUBYGEMS" = "YES" ]; then
+ GEMBASE="${GEM_PATH}"
+else
+ GEMBASE="${LOCALBASE}"
+fi
+
+ASCIIDOCTORPDF_CMD="${GEMBASE}/bin/asciidoctor-pdf"
+ASCIIDOCTOREPUB3_CMD="${GEMBASE}/bin/asciidoctor-epub3"
build_pdf() {
if [ "$1" = "" ] || [ "$2" = "" ] || [ "$3" = "" ]; then
@@ -42,6 +49,8 @@ build_pdf() {
local cur_dir_source="content/$doc_lang/$doc_type/$doc_name/"
local cur_dir_output="public/$doc_lang/$doc_type/$doc_name/"
+ local theme_font=""
+
if [ ! -d "$cur_dir_output" ]; then
mkdir -p "$cur_dir_output"
fi
@@ -61,6 +70,27 @@ build_pdf() {
local asciidoctor_file_name="_index.adoc"
fi
+ # Check non default fonts
+ case "$doc_lang" in
+ zh-cn)
+ if [ ! -f "$LOCALBASE/share/docproj-fonts-cjk/NotoSansSC-Medium.otf" ]; then
+ echo " font not found, skipping pdf build"
+ return
+ fi
+ theme_font="-a pdf-theme=./shared/zh-cn/zh-cn-theme.yml -a pdf-fontsdir=$LOCALBASE/share/docproj-fonts-cjk"
+ ;;
+ zh-tw)
+ if [ ! -f "$LOCALBASE/share/docproj-fonts-cjk/NotoSansTC-Medium.otf" ]; then
+ echo " font not found, skipping pdf build"
+ return
+ fi
+ theme_font="-a pdf-theme=./shared/zh-tw/zh-tw-theme.yml -a pdf-fontsdir=$LOCALBASE/share/docproj-fonts-cjk/"
+ ;;
+ *)
+ theme_font="-a pdf-theme=default-with-fallback-font"
+ ;;
+ esac
+
$ASCIIDOCTORPDF_CMD \
-r ./shared/lib/man-macro.rb \
-r ./shared/lib/git-macro.rb \
@@ -73,7 +103,7 @@ build_pdf() {
-a lang="$doc_lang" \
-a isonline=1 \
-a env-beastie=1 \
- -a pdf-theme=default-with-fallback-font \
+ ${theme_font} \
-o "${cur_dir_output}${doc_name}_${doc_lang}.pdf" \
"${cur_dir_source}${asciidoctor_file_name}"
}
@@ -110,7 +140,7 @@ build_epub() {
local asciidoctor_file_name="_index.adoc"
fi
- $ASCIIDOCTOREPUB_CMD \
+ $ASCIIDOCTOREPUB3_CMD \
-r ./shared/lib/man-macro.rb \
-r ./shared/lib/git-macro.rb \
-r ./shared/lib/packages-macro.rb \
@@ -161,7 +191,10 @@ archive() {
"$pub_dir" \
public/css/ \
public/fonts/ \
+ public/images/FreeBSD-colors.svg \
+ public/images/FreeBSD-monochromatic.svg \
public/js/ \
+ public/styles/ \
$source_doc_dir \
$image_doc_dir
diff --git a/documentation/tools/checkkey.sh b/documentation/tools/checkkey.sh
index c4772f13b3..8740a5dde6 100755
--- a/documentation/tools/checkkey.sh
+++ b/documentation/tools/checkkey.sh
@@ -105,20 +105,20 @@ if [ $# -ne 0 ] ; then
case $(expr "${arg}" : '^[0-9A-Fa-f]\{8,16\}$') in
8)
warning "${arg}: recommend using 16-digit keyid"
- ;&
+ ;;
16)
- keyid=$(getkeybyid "${arg}")
- if [ -n "${keyid}" ] ; then
- keyids="${keyids} ${keyid}"
- else
- warning "${arg} not found"
- fi
;;
*)
warning "${arg} does not appear to be a valid key ID"
+ continue
;;
esac
- shift
+ keyid=$(getkeybyid "${arg}")
+ if [ -n "${keyid}" ] ; then
+ keyids="${keyids} ${keyid}"
+ else
+ warning "${arg} not found"
+ fi
done
else
# Search for keys by freebsd.org email
diff --git a/documentation/tools/global-pgpkeys-creator.rb b/documentation/tools/global-pgpkeys-creator.rb
index 87fe29cc29..5e5596bab6 100644
--- a/documentation/tools/global-pgpkeys-creator.rb
+++ b/documentation/tools/global-pgpkeys-creator.rb
@@ -3,8 +3,8 @@
=begin
BSD 2-Clause License
-Copyright (c) 2020-2022, The FreeBSD Project
-Copyright (c) 2020-2022, Sergio Carlavilla <carlavilla@FreeBSD.org>
+Copyright (c) 2020-2025, The FreeBSD Project
+Copyright (c) 2020-2025, Sergio Carlavilla <carlavilla@FreeBSD.org>
This script will merge all the pgpkeys into one single file