From nobody Sun Jun 26 22:57:44 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 AF521864FB1 for ; Sun, 26 Jun 2022 22:57:44 +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 4LWR8S4YmPz3tH1; Sun, 26 Jun 2022 22:57:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656284264; 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=J/5cbwJO0C6eQEGCISn7r7ZWyy8eHNo8WeGoOkq1xuY=; b=gdTNlQavwItQmC+qRmkXDzzAPgLxWdo36EAvwFBC3tGg74IfYxU1V6E2JdhmdXOAxMPb4H M9ovcvj3XwJD7ptdCMuNz32oPj306dsfxpBxoAR5dV+N0ew7smrbbKgdUXRBcxby0nNX5N jL2cXsya0TVNPOgbN/zG90irEPxlt73epxDOWbeeOg4gjQAQJ1wJLL385nsWNx78bmaJd+ t6fmMZ39f0dpVX8sLXJSjESS00lELkLECObRViQrP0G4wJCBjJyLpeRg1R5aPaKBP+YsR1 8FIGwN6ejUK2zfuq1/UDKhcGFw8Xue+2b8yHKYjCuU3IwSf4VmZspyNmHR8H6g== 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 7C74D1CD2E; Sun, 26 Jun 2022 22:57:44 +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 25QMviZp030145; Sun, 26 Jun 2022 22:57:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25QMviLW030144; Sun, 26 Jun 2022 22:57:44 GMT (envelope-from git) Date: Sun, 26 Jun 2022 22:57:44 GMT Message-Id: <202206262257.25QMviLW030144@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Muhammad Moinur Rahman Subject: git: 4cb922f185 - main - Update nano config for adoc files 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: bofh X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4cb922f1851bea57d264724cc5a81d5b3b6fcdfa Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656284264; 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=J/5cbwJO0C6eQEGCISn7r7ZWyy8eHNo8WeGoOkq1xuY=; b=t/i4fNNEb8zX++f7KqGokemhggeY4iI5c1C/FGn34NvRajW5q29GRIc7BBG05J7vDwQJIe 7qk9AaMKkmEjkRxtmwreGq84CQkEW24Nqxzk6xiLolX1HMyK46xxKTGqwHmpcJ8Px9XCYr 93BMUpj4gT91isOOdJUfQr+P/sucxbL9H5OEl49PEQmoG/rmVV6WLmIT/CFhGs6XoaByPd QwnUiF/17/QhhErqnqo8deWP2dCBg65iZgUIpZFJsaAyz98CdvkNQAEkZ+2uFFFKBcyTyS C179yH6g6k0jN3VjXE3WHQU648VqQjRRkKF32koarCaFSEgwboDLg+mYv/e+DA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656284264; a=rsa-sha256; cv=none; b=wTBQDUvWcEA6DzfwzYeHx8vgDbpcVr8dx2S0mVJGr//AZu9/ReN84AaXEdaMkoe7scOY4c wWruXH7SN/cW+gt8i3/vbjTj3zvnDKslkd3nZY480r3j0MAINIJHUv56DrSiN9hGGGGNPk +7oyetiGdORrNtZa11Ej0zsDocLlTXm3CYZWrgXoCxZv8js1fBJaaLQ8MEuqZ5dxLWchE3 +6xhjcaCthHZMcz427q7ocRL4W/c5Jd59X1G9aQt4UK7T6IC0myxJgvAXzLURzfqzEXi6f /zTrPbNU4I2/CMDhoVnMJlEDnGODrYB5UfQs0HAaQmBKkmUlDqyDNt0+MV/28w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bofh (ports committer): URL: https://cgit.FreeBSD.org/doc/commit/?id=4cb922f1851bea57d264724cc5a81d5b3b6fcdfa commit 4cb922f1851bea57d264724cc5a81d5b3b6fcdfa Author: Muhammad Moinur Rahman AuthorDate: 2022-06-26 22:55:52 +0000 Commit: Muhammad Moinur Rahman CommitDate: 2022-06-26 22:55:52 +0000 Update nano config for adoc files en/books/fdp-primer/book/#editor-config-nano section still refers to the old xml syntax. This patch updates the config to support adoc documents. Additionally: - The syntax highlight is collected from different locations in the web - Remove line-wrapping related stuffs as in ASCIIDOC we can have longer lines as there is a rule "one sentence per line". PR: 264899 Obtained from: crees --- .../en/books/fdp-primer/editor-config/_index.adoc | 53 +++++++++++++++++----- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/documentation/content/en/books/fdp-primer/editor-config/_index.adoc b/documentation/content/en/books/fdp-primer/editor-config/_index.adoc index 3c865efb2b..d034d87737 100644 --- a/documentation/content/en/books/fdp-primer/editor-config/_index.adoc +++ b/documentation/content/en/books/fdp-primer/editor-config/_index.adoc @@ -191,17 +191,48 @@ Install from package:editors/nano[] or package:editors/nano-devel[]. [[editor-config-nano-config]] === Configuration -Copy the sample XML syntax highlight file to the user's home directory: - -[source,shell] -.... -% cp /usr/local/share/nano/xml.nanorc ~/.nanorc -.... - -Use an editor to replace the lines in the [.filename]#~/.nanorc# `syntax "xml"` block with these rules: +Currently there is no adoc/asciidoc syntax highlight file with nano distribution. So let's create one from scratch and use an editor to create new file or add lines in the [.filename]#~/.nanorc# with these contents: .... -syntax "xml" "\.([jrs]html?|xml|xslt?)$" +syntax "asciidoc" "\.(adoc|asc|asciidoc)$" +# main header +color red "^====+$" +# h1 +color red "^==[[:space:]].*$" +color red "^----+$" +# h2 +color magenta "^===[[:space:]].*$" +color magenta "^~~~~+$" +# h4 +color green "^====[[:space:]].*$" +color green "^\^\^\^\^+$" +# h5 +color brightblue "^=====[[:space:]].*$" +color brightblue "^\+\+\+\++$" +# attributes +color brightgreen ":.*:" +color brightred "\{[a-z0-9]*\}" +color red "\\\{[a-z0-9]*\}" +color red "\+\+\+\{[a-z0-9]*\}\+\+\+" +# Paragraph Title +color yellow "^\..*$" +# source +color magenta "^\[(source,.+|NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]" +# Other markup +color yellow ".*[[:space:]]\+$" +color yellow "_[^_]+_" +color yellow "\*[^\*]+\*" +color yellow "\+[^\+]+\+" +color yellow "`[^`]+`" +color yellow "\^[^\^]+\^" +color yellow "~[^~]+~" +color yellow "'[^']+'" +color cyan "`{1,2}[^']+'{1,2}" +# bullets +color brightmagenta "^[[:space:]]*[\*\.-]{1,5}[[:space:]]" +# anchors +color brightwhite "\[\[.*\]\]" +color brightwhite "<<.*>>" # trailing whitespace color ,blue "[[:space:]]+$" # multiples of eight spaces at the start a line @@ -211,8 +242,6 @@ color ,blue "^([TAB]*[ ]{8})+" color ,yellow "( )+TAB" # highlight indents that have an odd number of spaces color ,red "^(([ ]{2})+|(TAB+))*[ ]{1}[^ ]{1}" -# lines longer than 70 characters -color ,yellow "^(.{71})|(TAB.{63})|(TAB{2}.{55})|(TAB{3}.{47}).+$" .... Process the file to create embedded tabs: @@ -229,7 +258,7 @@ Specify additional helpful options when running the editor: [source,shell] .... -% nano -AKipwz -r 70 -T8 _index.adoc +% nano -AKipwz -T8 _index.adoc .... Users of man:csh[1] can define an alias in [.filename]#~/.cshrc# to automate these options: