From owner-dev-commits-doc-all@freebsd.org Wed Jun 16 20:00:33 2021 Return-Path: Delivered-To: dev-commits-doc-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5EFF6641F40 for ; Wed, 16 Jun 2021 20:00:33 +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 4G4wz51VtLz3JhY; Wed, 16 Jun 2021 20:00:33 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 C0FDB21960; Wed, 16 Jun 2021 20:00:32 +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 15GK0WEh098867; Wed, 16 Jun 2021 20:00:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15GK0Wg3098866; Wed, 16 Jun 2021 20:00:32 GMT (envelope-from git) Date: Wed, 16 Jun 2021 20:00:32 GMT Message-Id: <202106162000.15GK0Wg3098866@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Ceri Davies Subject: git: 55ff91a87b - main - documentation/tools: warn, but don't fail, on languages without books. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ceri X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 55ff91a87b9b8de6af8ae5a871af3f5b46a7b747 Auto-Submitted: auto-generated X-BeenThere: dev-commits-doc-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the doc repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jun 2021 20:00:33 -0000 The branch main has been updated by ceri: URL: https://cgit.FreeBSD.org/doc/commit/?id=55ff91a87b9b8de6af8ae5a871af3f5b46a7b747 commit 55ff91a87b9b8de6af8ae5a871af3f5b46a7b747 Author: Ceri Davies AuthorDate: 2021-06-16 13:11:00 +0000 Commit: Ceri Davies CommitDate: 2021-06-16 20:00:26 +0000 documentation/tools: warn, but don't fail, on languages without books. This allows us to pass a full list of languages to the pdf target. The -o option does not warn, continuing merely to print a list of files that it would create. --- documentation/tools/books-toc-creator.py | 6 ++++++ documentation/tools/books-toc-examples-creator.py | 6 ++++++ documentation/tools/books-toc-figures-creator.py | 6 ++++++ documentation/tools/books-toc-parts-creator.py | 5 +++++ documentation/tools/books-toc-tables-creator.py | 6 ++++++ 5 files changed, 29 insertions(+) diff --git a/documentation/tools/books-toc-creator.py b/documentation/tools/books-toc-creator.py index bd85b7e923..33b15ca1ff 100644 --- a/documentation/tools/books-toc-creator.py +++ b/documentation/tools/books-toc-creator.py @@ -9,6 +9,7 @@ This script will generate the Table of Contents of the books. import sys, getopt import re +import os.path languages = [] @@ -147,6 +148,11 @@ def main(argv): for language in langargs: + if not os.path.exists('./content/{}/books/books.adoc'.format(language)): + if not justPrintOutput: + print('Warning: no books found for language "{0}"'.format(language)) + continue + with open('./content/{}/books/books.adoc'.format(language), 'r', encoding = 'utf-8') as booksFile: books = [line.strip() for line in booksFile] diff --git a/documentation/tools/books-toc-examples-creator.py b/documentation/tools/books-toc-examples-creator.py index 423239c30d..638073d397 100644 --- a/documentation/tools/books-toc-examples-creator.py +++ b/documentation/tools/books-toc-examples-creator.py @@ -12,6 +12,7 @@ books. import sys, getopt import re +import os.path languages = [] @@ -78,6 +79,11 @@ def main(argv): for language in langargs: + if not os.path.exists('./content/{}/books/books.adoc'.format(language)): + if not justPrintOutput: + print('Warning: no books found for language "{0}"'.format(language)) + continue + with open('./content/{}/books/books.adoc'.format(language), 'r', encoding = 'utf-8') as booksFile: books = [line.strip() for line in booksFile] diff --git a/documentation/tools/books-toc-figures-creator.py b/documentation/tools/books-toc-figures-creator.py index fbe1d62c65..db8b06c639 100644 --- a/documentation/tools/books-toc-figures-creator.py +++ b/documentation/tools/books-toc-figures-creator.py @@ -12,6 +12,7 @@ in the books. import sys, getopt import re +import os.path languages = [] @@ -78,6 +79,11 @@ def main(argv): for language in langargs: + if not os.path.exists('./content/{}/books/books.adoc'.format(language)): + if not justPrintOutput: + print('Warning: no books found for language "{0}"'.format(language)) + continue + with open('./content/{}/books/books.adoc'.format(language), 'r', encoding = 'utf-8') as booksFile: books = [line.strip() for line in booksFile] diff --git a/documentation/tools/books-toc-parts-creator.py b/documentation/tools/books-toc-parts-creator.py index aeb035b8cb..98d1636953 100644 --- a/documentation/tools/books-toc-parts-creator.py +++ b/documentation/tools/books-toc-parts-creator.py @@ -144,6 +144,11 @@ def main(argv): for language in langargs: + if not os.path.exists('./content/{}/books/books.adoc'.format(language)): + if not justPrintOutput: + print('Warning: no books found for language "{0}"'.format(language)) + continue + with open('./content/{}/books/books.adoc'.format(language), 'r', encoding = 'utf-8') as booksFile: books = [line.strip() for line in booksFile] diff --git a/documentation/tools/books-toc-tables-creator.py b/documentation/tools/books-toc-tables-creator.py index 67f1733d45..049098914a 100644 --- a/documentation/tools/books-toc-tables-creator.py +++ b/documentation/tools/books-toc-tables-creator.py @@ -11,6 +11,7 @@ This script will generate the Table of Contents for tables in the books. import sys, getopt import re +import os.path languages = [] @@ -77,6 +78,11 @@ def main(argv): for language in langargs: + if not os.path.exists('./content/{}/books/books.adoc'.format(language)): + if not justPrintOutput: + print('Warning: no books found for language "{0}"'.format(language)) + continue + with open('./content/{}/books/books.adoc'.format(language), 'r', encoding = 'utf-8') as booksFile: books = [line.strip() for line in booksFile]