git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/3] doc: git-rev-parse: enforce command-line description syntax

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 21, 2024, 17:31 UTC
Message-ID
<xmqqfrxlpvv1.fsf@gitster.g>
In-Reply-To
<67dca173-3048-430b-88a1-d3b5d853f84b@free.fr>
Jean-Noël Avila <jn.avila@free.fr> writes:
Show 17 quoted lines
>>> ---short[=length]::
>>> +--short[=<length>]::
>>>   	Same as `--verify` but shortens the object name to a unique
>>>   	prefix with at least `length` characters. The minimum length
>> This same comment applies throughout this patch, but in other places
>> when we use <placeholder> in the option argument description, don't
>> we use the same <placeholder> in text as well?  I am wondering if
>> the `length` (typeset in fixed-width) should become <length>.  What
>> do other recent[*] documentation pages commonly do?
>
> This is another part of the inconsistences in documentation that I'd
> like to tackle (hopefully, not in another life).
>
> Using angle brackets for placeholders everywhere they appear is a
> visual link to the preceding syntax description, but may feel a bit
> heavy on some cases. Anyway, I'm all for applying the rule everywhere,
> for the sake of consistency.

I agree that if <placeholder> is not an appropriate way to spell them in the explanation text, we would want to change them consistently everywhere, and until then, using the angle-bracketted <placeholder> that is common would be better. The text will be modified again when we decide to switch from <placeholder> to something else, so updating them now may be a wasted effort, but (1) we may decide that <placeholder> is good enough after all, or (2) it may make it easier to mechanically identify words whose mark-up should be converted if we consistently use <placeholder> now, even if we know it won't be the final mark-up.

So I am inclined to say that we should first do `length` -> <length> in the body text in the short term. But I also think we should *not* do so as part of this patch, whose focus is how the option enumeration header should mark up the option arguments.

Show 7 quoted lines
> Backticks and single quotes are used indistinctively (by the way,
> asciidoctor does not process single quotes as markup) and are not used
> everywhere they should. Using backticks is also a good hint for
> translators to mean "verbatim, do not translate". Obviously, the
> placeholders ask for translation, so the backtick rule should not
> apply to them, even if another formating would be welcome :
> _<placeholder>_ for instance?

Yes. The way AsciiDoc renders (at least HTML) an unadorned <placeholder> is not so great.

In "git-add.html" manual page, we see these examples. The first one (unadorned) does not make the placeholder word stand out enough; the second one that does `<file>` makes it stand out better, but as you said, the `verbatim` mark-up is semantically wrong.

https://git.github.io/htmldocs/git-add.html#:~:text=For%20more%20details%20about%20the%20%3Cpathspec%3E%20syntax
https://git.github.io/htmldocs/git-add.html#:~:text=Pathspec%20is%20passed%20in%20%3Cfile%3E%20instead%20of%20commandline%20args.%20If%20%3Cfile%3E%20is%20exactly%20%2D%20then%20standard%20input%20is%20used.%20Pathspec

The last part of the Documentation/CodingGuidelines document talks about how to mark up placeholders but it does not go beyond saying that they are written as <hyphen-in-between-words-in-angle-braket>. Whatever mark-up rule we decide to use, we should document it there.

Thanks.
Previous: Jean-Noël AvilaNext: Jean-Noël AVILA
Message 5 of 15 in “Doc placeholders”
  1. 0/3 Doc placeholdersJean-Noël Avila via GitGitGadget, Feb 20, 2024
  2. 1/3 doc: git-rev-parse: enforce command-line description syntaxJean-Noël Avila via GitGitGadget, Feb 20, 2024
  3. Junio C HamanoFeb 20, 2024
  4. Jean-Noël AvilaFeb 21, 2024
  5. Junio C HamanoFeb 21, 2024
  6. Jean-Noël AVILAFeb 21, 2024
  7. Junio C HamanoFeb 21, 2024
  8. Jean-Noël AVILAFeb 22, 2024
  9. Junio C HamanoFeb 22, 2024
  10. Jean-Noël AVILAFeb 24, 2024
  11. 2/3 doc: git-clone fix missing placeholder end carretJean-Noël Avila via GitGitGadget, Feb 20, 2024
  12. Eric SunshineFeb 20, 2024
  13. Junio C HamanoFeb 20, 2024
  14. 3/3 doc: add some missing sentence dots.Jean-Noël Avila via GitGitGadget, Feb 20, 2024
  15. Junio C HamanoFeb 20, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.