From nobody Wed Nov 02 21:42:43 2022 X-Original-To: dev-commits-doc-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4N2gNM2zwSz4h1RH for ; Wed, 2 Nov 2022 21:42:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4N2gNM2RSZz3DNm; Wed, 2 Nov 2022 21:42:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667425363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zyv+0ILT+0G2g4rSRUSBdbKwLZ4L039xN4JloqF5x3o=; b=g+mJUL7LxvyYvWrvfV4k7NGhlRYKJfjT6Zb1vv25IIY8Dv1byUjnRzuuhUWqJ5zEe+J+7A oLn9rFjZc1i/p9UAblkEWjOx2QOhvqwdRV4DGAgAShpoY8R1/KGlRP3YYr2p721GUdIA2z gRSBO3rKMlGQFOBmNfo7BvTXpZn3EjlC9jyv2I3hKtMMmglHMWDx3tAX9Y2EZXORL2ni0W mIP4MikfWQ4d5u34VEu/JQaGMvZjhih0V3oJcr3meHXD9VdiP1jHfmaGw1DmduexTDO/05 XTNkf6GsWo6Kx6NudFUEGcRzIU5//r8D4XEoEV/Q90uW3ayYMrNg4YelzVKzrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4N2gNM1TMRz1BDl; Wed, 2 Nov 2022 21:42:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2A2Lghca060811; Wed, 2 Nov 2022 21:42:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A2LghZi060810; Wed, 2 Nov 2022 21:42:43 GMT (envelope-from git) Date: Wed, 2 Nov 2022 21:42:43 GMT Message-Id: <202211022142.2A2LghZi060810@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Sergio Carlavilla Delgado Subject: git: d9fc0784a8 - main - Update build instructions for macOS List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-doc-all@freebsd.org X-BeenThere: dev-commits-doc-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: carlavilla X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d9fc0784a881811cef16d2bda321cd30b8499738 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667425363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zyv+0ILT+0G2g4rSRUSBdbKwLZ4L039xN4JloqF5x3o=; b=PveSXMSk/bwPGD+z4XzJRQfFJtg71V5I4LVoPx83sJo/3YrKzWm8ObmmwmQUs7ikvc/YIf J3Pvpq4+bpvhwxNaAdh+BeKsfoDGBvbHLzr9xsJbwJCp25/eVlQUUgo/Px99mvxnza/OF+ zXV04NOT92xX3tM9gZ4w4VwpnwUT95iedsMg549W0D0wX51WZxBnvLSkA3zedSBnxEM5rd wSDkVMxA6wDA7wLCfzHKPgnl8GMSor34agdEdmS9UI5v5WX37cf/bkKwlXR+3jVpPZXJ+2 crjm+wkpRd7lYef2yL51+vqSag4gxmwTc6yL2o0JPkZItTKuGi6z8ZqkuG9+Rg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667425363; a=rsa-sha256; cv=none; b=JR91Hsmr1EYmdGgJ6HO6HXAfENxNbd1gQQQ6Z5wzvwsqjT/0fc+9WBVic6v7RvGdkLUK+j kjPKx67rQpNosrjduTt6n5okU0l2UDeIfwy2OUt8O4GGyDW4Pp0A+N25hAump1Q99JKnXS FpbRK23aj1Ydv/91GfiRW+/6O/3eL4BzszjkNCRLwnG/vPk0snSOXdq3ouR2RsSgWTMzPB zTKbDv5Dl75g9LxJzEMKoiSsgKfObCHm5UrO6hV1Hdg/XaEuiWjfJmKHuj0ECZCpQSZU/C /mOsJe9SvRAyKT7QXQDP538JymWLLAKkZtgwEy8pBALnwRUu/sZibp+3YIiGYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by carlavilla: URL: https://cgit.FreeBSD.org/doc/commit/?id=d9fc0784a881811cef16d2bda321cd30b8499738 commit d9fc0784a881811cef16d2bda321cd30b8499738 Author: Minsoo Choo AuthorDate: 2022-11-02 21:40:13 +0000 Commit: Sergio Carlavilla Delgado CommitDate: 2022-11-02 21:42:32 +0000 Update build instructions for macOS Approved by: carlavilla@ Reviewed by: Jose Luis Duran Differential Revision: https://reviews.freebsd.org/D37143 --- documentation/Makefile | 28 +++++++++++++++------- .../en/books/fdp-primer/overview/_index.adoc | 10 ++++---- documentation/tools/asciidoctor.sh | 13 +++++++--- 3 files changed, 35 insertions(+), 16 deletions(-) diff --git a/documentation/Makefile b/documentation/Makefile index 457f6add0b..410ff444df 100644 --- a/documentation/Makefile +++ b/documentation/Makefile @@ -32,13 +32,23 @@ BOOKONLY_LANGS= mn ALL_LANGUAGES= bn-bd da de el en es fr hu id it ja ko mn nl pl pt-br ru tr zh-cn zh-tw LOCALBASE?= /usr/local +USE_RUBYGEMS?= NO +GEM_PATH?= -RUBY_CMD = ${LOCALBASE}/bin/ruby +.if ${USE_RUBYGEMS} == "YES" +GEMBASE?= ${GEM_PATH} +.else +GEMBASE?= ${LOCALBASE} +.endif + +RUBY_CMD = ${GEMBASE}/bin/ruby HUGO_CMD = ${LOCALBASE}/bin/hugo HUGO_ARGS?= --verbose --minify HUGO_OFFLINE_ARGS?= --environment offline --verbose --minify -ASCIIDOCTOR_CMD= ${LOCALBASE}/bin/asciidoctor -ASCIIDOCTORPDF_CMD= ${LOCALBASE}/bin/asciidoctor-pdf +ROUGIFY_CMD= ${GEMBASE}/bin/rougify +ASCIIDOCTOR_CMD= ${GEMBASE}/bin/asciidoctor +ASCIIDOCTORPDF_CMD= ${GEMBASE}/bin/asciidoctor-pdf +ASCIIDOCTOREPUB3_CMD= ${GEMBASE}/bin/asciidoctor-epub3 .if defined(DOC_LANG) && !empty(DOC_LANG) LANGUAGES= ${DOC_LANG:S/,/ /g} @@ -54,8 +64,8 @@ RUBYLIB = ../shared/lib .export RUBYLIB RUN_DEPENDS= ${HUGO_CMD} \ - ${LOCALBASE}/bin/asciidoctor \ - ${LOCALBASE}/bin/rougify + ${ASCIIDOCTOR_CMD} \ + ${ROUGIFY_CMD} .ifndef HOSTNAME . ifdef BIND @@ -111,13 +121,13 @@ requirements: .endfor requirements-pdf: -.if !exists(${LOCALBASE}/bin/asciidoctor-pdf) - @(echo ${LOCALBASE}/bin/asciidoctor-pdf not found, please run 'pkg install rubygem-asciidoctor-pdf'; exit 1) +.if !exists(${ASCIIDOCTORPDF_CMD}) + @(echo ${ASCIIDOCTOR_CMD} not found, please install rubygem-asciidoctor-pdf; exit 1) .endif requirements-epub: -.if !exists(${LOCALBASE}/bin/asciidoctor-epub3) - @(echo ${LOCALBASE}/bin/asciidoctor-epub3 not found, please run 'pkg install rubygem-asciidoctor-epub3'; exit 1) +.if !exists(${ASCIIDOCTOREPUB3_CMD}) + @(echo ${ASCIIDOCTOREPUB3_CMD} not found, please install rubygem-asciidoctor-epub3; exit 1) .endif starting-message: .PHONY diff --git a/documentation/content/en/books/fdp-primer/overview/_index.adoc b/documentation/content/en/books/fdp-primer/overview/_index.adoc index 157e6ea499..b728d23a9c 100644 --- a/documentation/content/en/books/fdp-primer/overview/_index.adoc +++ b/documentation/content/en/books/fdp-primer/overview/_index.adoc @@ -251,21 +251,23 @@ Hugo version 0.90 or higher must be used + [source,shell] .... -$ brew install hugo ruby git bmake asciidoctor +$ brew install hugo ruby git bmake .... + . Add Ruby to the Path. + [source,shell] .... -$ echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.zshrc +$ echo 'export GEM_PATH="/usr/local/lib/ruby/gems/3.1.0"' >> ~/.zshrc +$ echo 'export PATH="$(brew --prefix ruby)/bin:$PATH"' >> ~/.zshrc +$ source ~/.zshrc .... + . Install the rouge package using RubyGem. + [source,shell] .... -$ sudo gem install rouge +$ sudo gem install rouge asciidoctor asciidoctor-pdf asciidoctor-epub3 .... + . Install a local working copy of the documentation from the FreeBSD repository in [.filename]#~/doc# (see crossref:working-copy[working-copy,The Working Copy]). @@ -284,7 +286,7 @@ Repeat until all of the errors are resolved. + [source,shell] .... -$ bmake run LOCALBASE=/usr +$ bmake run LOCALBASE=/usr USE_RUBYGEMS=YES .... . Add all the files with `git add .`, then review the diff with `git diff`. For example: + diff --git a/documentation/tools/asciidoctor.sh b/documentation/tools/asciidoctor.sh index a834b2e532..27ce3f790c 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 @@ -110,7 +117,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 \