git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jean-Noël Avila via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: "Jean-Noël Avila" <jn.avila@free.fr>,
	"Jean-Noël Avila" <jn.avila@free.fr>
Subject: [PATCH v3 2/3] doc: update the guidelines to reflect the current formatting rules
Date: Sun, 11 Aug 2024 15:20:11 +0000	[thread overview]
Message-ID: <92f3121cf4e719d1bd6f85e3af454a3ea7547930.1723389612.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1766.v3.git.1723389612.gitgitgadget@gmail.com>

From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <jn.avila@free.fr>

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
---
 Documentation/CodingGuidelines | 54 ++++++++++++++++++----------------
 1 file changed, 28 insertions(+), 26 deletions(-)

diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 1d92b2da03e..1c2d2ecbea9 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -746,70 +746,72 @@ Markup:
    _<key-id>_
 
  When literal and placeholders are mixed, each markup is applied for
- each sub-entity. If they are stuck, a special markup, called
- unconstrained formatting is required.
- Unconstrained formating for placeholders is __<like-this>__
- Unconstrained formatting for literal formatting is ++like this++
-   `--jobs` _<n>_
-   ++--sort=++__<key>__
-   __<directory>__++/.git++
-   ++remote.++__<name>__++.mirror++
-
- caveat: ++ unconstrained format is not verbatim and may expand
- content. Use Asciidoc escapes inside them.
+ each sub-entity. If the formatting is becoming too hairy, you can use the
+ s:["foo"] formatting macro and let it format the groups for you.
+   `--jobs` _<n>_ or s:["--jobs <n>"]
+   s:["--sort=<key>
+   s:["<directory>/.git"]
+   s:["remote.<name>.mirror"]
+   s:["ssh://[<user>@]<host>[:<port>]/<path-to-git-repo>"]
+
+Note that the double-quotes are required by the macro.
 
 Synopsis Syntax
 
- Syntax grammar is formatted neither as literal nor as placeholder.
+ The synopsis (a paragraph with [synopsis] attribute) is automatically
+ formatted by the toolchain and does not need typesetting.
 
  A few commented examples follow to provide reference when writing or
  modifying command usage strings and synopsis sections in the manual
  pages:
 
  Possibility of multiple occurrences is indicated by three dots:
-   _<file>_...
+   <file>...
    (One or more of <file>.)
 
  Optional parts are enclosed in square brackets:
-   [_<file>_...]
+   [<file>...]
    (Zero or more of <file>.)
 
-   ++--exec-path++[++=++__<path>__]
+ An optional parameter needs to be typeset with unconstrained pairs
+   [<repository>]
+
+   --exec-path[=<path>]
    (Option with an optional argument.  Note that the "=" is inside the
    brackets.)
 
-   [_<patch>_...]
+   [<patch>...]
    (Zero or more of <patch>.  Note that the dots are inside, not
    outside the brackets.)
 
  Multiple alternatives are indicated with vertical bars:
-   [`-q` | `--quiet`]
-   [`--utf8` | `--no-utf8`]
+   [-q | --quiet]
+   [--utf8 | --no-utf8]
 
  Use spacing around "|" token(s), but not immediately after opening or
  before closing a [] or () pair:
-   Do: [`-q` | `--quiet`]
-   Don't: [`-q`|`--quiet`]
+   Do: [-q | --quiet]
+   Don't: [-q|--quiet]
 
  Don't use spacing around "|" tokens when they're used to separate the
  alternate arguments of an option:
-    Do: ++--track++[++=++(`direct`|`inherit`)]`
-    Don't: ++--track++[++=++(`direct` | `inherit`)]
+    Do: --track[=(direct|inherit)]
+    Don't: --track[=(direct | inherit)]
 
  Parentheses are used for grouping:
-   [(_<rev>_ | _<range>_)...]
+   [(<rev>|<range>)...]
    (Any number of either <rev> or <range>.  Parens are needed to make
    it clear that "..." pertains to both <rev> and <range>.)
 
-   [(`-p` _<parent>_)...]
+   [(-p <parent>)...]
    (Any number of option -p, each with one <parent> argument.)
 
-   `git remote set-head` _<name>_ (`-a` | `-d` | _<branch>_)
+   git remote set-head <name> (-a|-d|<branch>)
    (One and only one of "-a", "-d" or "<branch>" _must_ (no square
    brackets) be provided.)
 
  And a somewhat more contrived example:
-   `--diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]`
+   --diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]
    Here "=" is outside the brackets, because "--diff-filter=" is a
    valid usage.  "*" has its own pair of brackets, because it can
    (optionally) be specified only when one or more of the letters is
-- 
gitgitgadget


  parent reply	other threads:[~2024-08-11 15:20 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-23 22:44 [PATCH 0/3] doc: introducing synopsis para Jean-Noël Avila via GitGitGadget
2024-07-23 22:44 ` [PATCH 1/3] doc: introduce a synopsis custom paragraph attribute Jean-Noël Avila via GitGitGadget
2024-07-23 23:36   ` Junio C Hamano
2024-07-23 22:44 ` [PATCH 2/3] doc: update the guidelines to reflect the current formatting rules Jean-Noël Avila via GitGitGadget
2024-07-23 23:37   ` Junio C Hamano
2024-07-23 22:44 ` [PATCH 3/3] doc: apply synopsis simplification on git-clone and git-init Jean-Noël Avila via GitGitGadget
2024-07-23 23:04 ` [PATCH 0/3] doc: introducing synopsis para Jean-Noël AVILA
2024-07-24 21:06 ` [PATCH v2 " Jean-Noël Avila via GitGitGadget
2024-07-24 21:06   ` [PATCH v2 1/3] doc: introduce a synopsis custom paragraph attribute Jean-Noël Avila via GitGitGadget
2024-07-24 21:06   ` [PATCH v2 2/3] doc: update the guidelines to reflect the current formatting rules Jean-Noël Avila via GitGitGadget
2024-07-24 21:06   ` [PATCH v2 3/3] doc: apply synopsis simplification on git-clone and git-init Jean-Noël Avila via GitGitGadget
2024-07-24 23:15   ` [PATCH v2 0/3] doc: introducing synopsis para Junio C Hamano
2024-07-25 12:15     ` Jean-Noël AVILA
2024-07-25 15:32       ` Junio C Hamano
2024-08-11 15:20   ` [PATCH v3 " Jean-Noël Avila via GitGitGadget
2024-08-11 15:20     ` [PATCH v3 1/3] doc: introduce a synopsis custom paragraph attribute Jean-Noël Avila via GitGitGadget
2024-08-11 15:20     ` Jean-Noël Avila via GitGitGadget [this message]
2024-08-11 23:56       ` [PATCH v3 2/3] doc: update the guidelines to reflect the current formatting rules Eric Sunshine
2024-08-12  6:18         ` Jean-Noël Avila
2024-08-11 15:20     ` [PATCH v3 3/3] doc: apply synopsis simplification on git-clone and git-init Jean-Noël Avila via GitGitGadget
2024-08-19 20:08     ` [PATCH v3 0/3] doc: introducing synopsis para Junio C Hamano
2024-08-21 21:05       ` Jean-Noël AVILA
2024-08-30 17:48         ` Junio C Hamano
2024-09-05 21:52     ` [PATCH v4 " Jean-Noël Avila via GitGitGadget
2024-09-05 21:52       ` [PATCH v4 1/3] doc: introduce a synopsis typesetting Jean-Noël Avila via GitGitGadget
2024-09-05 21:52       ` [PATCH v4 2/3] doc: update the guidelines to reflect the current formatting rules Jean-Noël Avila via GitGitGadget
2024-09-05 21:52       ` [PATCH v4 3/3] doc: apply synopsis simplification on git-clone and git-init Jean-Noël Avila via GitGitGadget
2024-09-13 18:15       ` [PATCH v4 0/3] doc: introducing synopsis para Junio C Hamano
2024-09-20 23:14         ` Josh Steadmon
2024-09-21  1:38           ` Junio C Hamano
2024-09-21  6:19           ` Junio C Hamano
2024-09-21  6:23             ` Junio C Hamano
2024-09-21  6:54               ` Chris Torek
2024-09-23 16:38                 ` Junio C Hamano
     [not found]                   ` <CAPig+cQgw8xf5bQaUEW=qvKQpnxrkiTrMsqa+VW9d_GX0au1sA@mail.gmail.com>
2024-09-24 22:03                     ` Josh Steadmon
2024-09-24 23:34                       ` Junio C Hamano
2024-09-24  7:08       ` [PATCH v5 " Jean-Noël Avila via GitGitGadget
2024-09-24  7:08         ` [PATCH v5 1/3] doc: introduce a synopsis typesetting Jean-Noël Avila via GitGitGadget
2024-09-24  7:08         ` [PATCH v5 2/3] doc: update the guidelines to reflect the current formatting rules Jean-Noël Avila via GitGitGadget
2024-09-24  7:08         ` [PATCH v5 3/3] doc: apply synopsis simplification on git-clone and git-init Jean-Noël Avila via GitGitGadget
2024-09-24 17:16         ` [PATCH v5 0/3] doc: introducing synopsis para Junio C Hamano
2024-09-24 19:30           ` Torsten Bögershausen
2024-09-24 20:33             ` Junio C Hamano
2024-10-02 21:41               ` Josh Steadmon
2024-10-02 22:43                 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=92f3121cf4e719d1bd6f85e3af454a3ea7547930.1723389612.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jn.avila@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).