|
@@ -2,7 +2,17 @@
|
|
|
|
|
|
This page lists specific formatting instructions for `tldr` pages.
|
|
This page lists specific formatting instructions for `tldr` pages.
|
|
|
|
|
|
-## Layout
|
|
|
|
|
|
+## Contents
|
|
|
|
+
|
|
|
|
+1. [General layout](#general-layout)
|
|
|
|
+2. [Pages](#pages)
|
|
|
|
+3. [General writing](#general-writing)
|
|
|
|
+4. [Heading](#heading)
|
|
|
|
+5. [Example descriptions](#example-descriptions)
|
|
|
|
+6. [Example commands](#example-commands)
|
|
|
|
+7. [Language-specific rules](#language-specific-rules)
|
|
|
|
+
|
|
|
|
+## General layout
|
|
|
|
|
|
The basic format of each page should match the following template and have at most 8 command examples:
|
|
The basic format of each page should match the following template and have at most 8 command examples:
|
|
|
|
|
|
@@ -66,10 +76,10 @@ npm install --global tldr-lint
|
|
tldr-lint path/to/tldr_page.md
|
|
tldr-lint path/to/tldr_page.md
|
|
```
|
|
```
|
|
|
|
|
|
-For other ways to use `tldr-lint`, such as linting an entire directory, check out (what else!)
|
|
|
|
-[`tldr tldr-lint`](https://github.com/tldr-pages/tldr/blob/main/pages/common/tldr-lint.md). Alternatively, you can also use its alias `tldrl`.
|
|
|
|
|
|
+For other ways to use `tldr-lint`, such as linting an entire directory, check out the
|
|
|
|
+[`tldr page on tldr-lint`](https://github.com/tldr-pages/tldr/blob/main/pages/common/tldr-lint.md). Alternatively, you can also use its alias `tldrl`.
|
|
|
|
|
|
-Your client may be able to preview a page locally using the `--render` flag:
|
|
|
|
|
|
+Depending on your client, you may be able to preview a page locally using the `--render` flag:
|
|
|
|
|
|
```sh
|
|
```sh
|
|
tldr --render path/to/tldr_page.md
|
|
tldr --render path/to/tldr_page.md
|
|
@@ -83,7 +93,11 @@ When documenting PowerShell commands, please take note of the following naming c
|
|
- The page title/heading must be written as-is (matching the spelling intended by Microsoft or the PowerShell module author), such as `Invoke-WebRequest` instead of `invoke-webrequest`.
|
|
- The page title/heading must be written as-is (matching the spelling intended by Microsoft or the PowerShell module author), such as `Invoke-WebRequest` instead of `invoke-webrequest`.
|
|
- The command name and options in the examples should also be written as-is, such as `Command-Name {{input}} -CommandParameter {{value}}` instead of `command-name {{input}} -commandparameter {{value}}`.
|
|
- The command name and options in the examples should also be written as-is, such as `Command-Name {{input}} -CommandParameter {{value}}` instead of `command-name {{input}} -commandparameter {{value}}`.
|
|
|
|
|
|
-Due to [various compatibility differences](https://learn.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell) and removed Windows-specific commands in PowerShell 6.x, Ensure that the command works on between **PowerShell 5.1** (aka. the "Legacy Windows PowerShell" as installed in Windows 10 and 11), and the **latest version of the Cross-Platform PowerShell** (formerly known as PowerShell Core). If the command or its options is unavailable or contains different behavior between each version, please kindly note them in the descriptions. For example,
|
|
|
|
|
|
+Due to [various compatibility differences](https://learn.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell) and removed Windows-specific commands in PowerShell 6.x, ensure that
|
|
|
|
+the command works on between **PowerShell 5.1** (aka. the "Legacy Windows PowerShell" as installed in Windows 10
|
|
|
|
+and 11), and the **latest version of the Cross-Platform PowerShell** (formerly known as PowerShell Core).
|
|
|
|
+
|
|
|
|
+Thus, if the command or its options is unavailable or contains different behavior between each version, please kindly note them in the descriptions. For example:
|
|
|
|
|
|
```md
|
|
```md
|
|
# Clear-RecycleBin
|
|
# Clear-RecycleBin
|
|
@@ -93,7 +107,17 @@ Due to [various compatibility differences](https://learn.microsoft.com/powershel
|
|
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.management/clear-recyclebin>.
|
|
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.management/clear-recyclebin>.
|
|
```
|
|
```
|
|
|
|
|
|
-## Aliases
|
|
|
|
|
|
+## Pages
|
|
|
|
+
|
|
|
|
+### Platform differences
|
|
|
|
+
|
|
|
|
+If you are afraid the commands may differ between platforms or operating systems (e.g. Windows vs macOS),
|
|
|
|
+most [tldr pages clients](https://github.com/tldr-pages/tldr/wiki/tldr-pages-clients) will choose the most suitable version of the command to be displayed to the enduser.
|
|
|
|
+
|
|
|
|
+In this case, the information of the Windows version of `cd` (stored in `pages/windows/cd.md`) will be displayed by default to Windows users, and a generic/common version (stored in `pages/common/cd.md`)
|
|
|
|
+will be displayed for Linux, macOS, and other platform users.
|
|
|
|
+
|
|
|
|
+### Aliases
|
|
|
|
|
|
If a command can be called with alternative names (like `vim` can be called by `vi`), alias pages can be created to point the user to the original command name.
|
|
If a command can be called with alternative names (like `vim` can be called by `vi`), alias pages can be created to point the user to the original command name.
|
|
|
|
|
|
@@ -123,11 +147,12 @@ Example:
|
|
|
|
|
|
- Pre-translated alias page templates can be found [here](https://github.com/tldr-pages/tldr/blob/main/contributing-guides/translation-templates/alias-pages.md).
|
|
- Pre-translated alias page templates can be found [here](https://github.com/tldr-pages/tldr/blob/main/contributing-guides/translation-templates/alias-pages.md).
|
|
|
|
|
|
-### PowerShell-Specific Aliases
|
|
|
|
|
|
+#### PowerShell-Specific Aliases
|
|
|
|
|
|
Some PowerShell commands may introduce aliases which fall into one of these three categories:
|
|
Some PowerShell commands may introduce aliases which fall into one of these three categories:
|
|
|
|
|
|
-**1. Substituting an existing Windows Command Prompt (`cmd`) command**, such as `cd` aliasing to `Set-Location` with different command options. In this case, add the following alias note into the second line of the original Command Prompt command's tldr description, for example:
|
|
|
|
|
|
+1. **Replaces an existing Windows Command Prompt (`cmd`) command**, such as `cd` aliasing to `Set-Location` with different command options. In this case, add the following alias note into the second line of the original
|
|
|
|
+Command Prompt command's tldr description, for example:
|
|
|
|
|
|
```md
|
|
```md
|
|
# cd
|
|
# cd
|
|
@@ -141,10 +166,11 @@ Some PowerShell commands may introduce aliases which fall into one of these thre
|
|
`tldr set-location`
|
|
`tldr set-location`
|
|
```
|
|
```
|
|
|
|
|
|
-> [!TIP]
|
|
|
|
-> The "View documentation of the equivalent PowerShell command" example is optional and may be excluded if the page already has the maximum number (8) of examples.
|
|
|
|
|
|
+> [!NOTE]
|
|
|
|
+> The "View documentation of the equivalent PowerShell command" example is optional and must be excluded if the page already has the maximum number (8) of examples.
|
|
|
|
|
|
-**2. Provides a new alias but only executable in PowerShell**, such as `ni` for `New-Item`. In this case, use the [standard alias template](https://github.com/tldr-pages/tldr/blob/main/contributing-guides/translation-templates/alias-pages.md), but add the word "In Powershell," (or equivalent) to indicate that the command is exclusive to PowerShell. For example,
|
|
|
|
|
|
+2. **Provides a new alias but only executable in PowerShell**, such as `ni` for `New-Item`. In this case, use the [standard alias template](https://github.com/tldr-pages/tldr/blob/main/contributing-guides/translation-templates/alias-pages.md),
|
|
|
|
+but add the word "In Powershell," (or equivalent) to indicate that the command is exclusive to PowerShell. For example,
|
|
|
|
|
|
```md
|
|
```md
|
|
# ni
|
|
# ni
|
|
@@ -157,7 +183,8 @@ Some PowerShell commands may introduce aliases which fall into one of these thre
|
|
`tldr new-item`
|
|
`tldr new-item`
|
|
```
|
|
```
|
|
|
|
|
|
-**3. Provides a new alias that conflicts with other programs**, most notoriously the inclusion of `curl` and `wget` as aliases of `Invoke-WebRequest` (with a non-compatible set of command options). Note that PowerShell system aliases that fall into this category are commonly exclusive to Windows.
|
|
|
|
|
|
+**3. Provides a new alias that conflicts with other programs**, most notoriously the inclusion of `curl` and `wget` as aliases of `Invoke-WebRequest` (with a non-compatible set of command options).
|
|
|
|
+Note that PowerShell system aliases that fall into this category are commonly exclusive to Windows.
|
|
|
|
|
|
In this case, provide a note and method to determine whether the command currently refers to a PowerShell command (by alias) or others. For example,
|
|
In this case, provide a note and method to determine whether the command currently refers to a PowerShell command (by alias) or others. For example,
|
|
|
|
|
|
@@ -180,92 +207,49 @@ In this case, provide a note and method to determine whether the command current
|
|
`tldr invoke-webrequest`
|
|
`tldr invoke-webrequest`
|
|
```
|
|
```
|
|
|
|
|
|
-## Option syntax
|
|
|
|
-
|
|
|
|
-- For commonly/frequently used commands (e.g. `grep`, `tar`, `etc`), we prefer using short options along with [mnemonics](#short-option-mnemonics) or both inside a placeholder.
|
|
|
|
-- For highlighting both long and short options in commands (instead of using mnemonics), combine them within a placeholder i.e. `{{-o|--output}}`.
|
|
|
|
-- For user-friendliness, use **GNU-style long options** (like `--help` rather than `-h`) when they are cross-platform compatible (intended to work the same across multiple platforms) for pages in `common` directory.
|
|
|
|
-- When documenting PowerShell commands, use **PowerShell-style long options** (like `-Help` instead of `-H`).
|
|
|
|
-- We prefer using a space instead of the equals sign (`=`) to separate options from their arguments (i.e. use `--opt arg` instead of `--opt=arg`) unless the program does not support it.
|
|
|
|
-
|
|
|
|
-### Short option mnemonics
|
|
|
|
-
|
|
|
|
-Short option mnemonics are optional hints which can be added to help users understand the meaning of these short options. The assigned mnemonics should match with the ones in the command's official documentation (e.g. from `man` or `Get-Help`). For example:
|
|
|
|
-
|
|
|
|
-```md
|
|
|
|
-- [d]isplay the ins[t]allation [i]D for the current device. Useful for offline license activation:
|
|
|
|
-
|
|
|
|
-`slmgr.vbs /dti`
|
|
|
|
-
|
|
|
|
-- Display the current license's e[xp]i[r]ation date and time:
|
|
|
|
-
|
|
|
|
-`slmgr.vbs /xpr`
|
|
|
|
-```
|
|
|
|
-
|
|
|
|
-Note that, in the first example, the `[d]`, `[t]`, and `[i]` characters are enclosed with square brackets to indicate that the `/dti` option of the command is a combination of "display", "installation", and "ID", respectively. Consecutive mnemonic characters can be grouped under the same square brackets, such as `e[xp]i[r]ation` instead of `e[x][p]i[r]ation`.
|
|
|
|
-
|
|
|
|
-**Mnemonic characters must be written in a case-sensitive manner**, even when it is placed as the first character of the sentence (i.e. use `[d]isplay` instead of `[D]isplay`). This is to avoid conflicts with GNU-style command options which may interpret uppercase options differently than the lowercase ones, such as `-v` for displaying the command's `[v]ersion` number and `-V` to run the command in `[V]erbose` mode.
|
|
|
|
|
|
+## General writing
|
|
|
|
|
|
-Option mnemonics may also be used in translations as long as the highlighted word contains similar meanings to the language (commonly English) which the command is written for. For example, `[d]ownload` in English may be translated into `[d]escargar` in Spanish, `[i]nstall` in English may be translated to `[i]nstallieren` in German, and `[a]pp` in English may be translated into `[a]plikasi` in Indonesian and Malay.
|
|
|
|
|
|
+### Emphasis
|
|
|
|
|
|
-- Optionally, mnemonics and their enclosed terms can be separated with brackets from the rest of the description (i.e. `([a]ll)`) in translations and specific pages to provide additional context or mention a word not present in the description.
|
|
|
|
|
|
+Do not use *italics*, **boldface** or any other text styling on the pages. These are reserved for client emphasis of placeholders.
|
|
|
|
|
|
-> [!NOTE]
|
|
|
|
-> In cases where the character isn't present in the translated word, you can highlight the option before/next to the equivalent word or you can add the English work beside the translation inside a bracket. For example, `E[x]tract` in English maybe translated into `[x] ekstrak` or `ekstrak [x]` or `ekstrak (E[x]tract)` in Indonesian.
|
|
|
|
|
|
+### Imperative Mood
|
|
|
|
|
|
-## Placeholder syntax
|
|
|
|
|
|
+- **All descriptions must be phrased in the imperative mood.**
|
|
|
|
+- This also applies to all translations by default unless otherwise specified in the language-specific section below.
|
|
|
|
|
|
-User-provided values should use the `{{placeholder}}` syntax
|
|
|
|
-in order to allow `tldr` clients to highlight them.
|
|
|
|
|
|
+When writing descriptions for command examples, **check for any grammatical errors**. `Go to the specified directory` is preferred instead of:
|
|
|
|
|
|
-Keep the following guidelines in mind when choosing placeholders:
|
|
|
|
|
|
+- `Going to the specified directory` (should not be in present participle form)
|
|
|
|
+- `This command will go to the specified directory` (it is clear that this example works for *this* comment)
|
|
|
|
+- `Let's go to the specified directory!`
|
|
|
|
+- `Directory change` (use the active form instead of passive, if possible)
|
|
|
|
|
|
-### Naming
|
|
|
|
|
|
+For instance, instead of `Listing all files:`, `List all files:` can be used as the example's description below:
|
|
|
|
|
|
-- Use short but descriptive placeholders,
|
|
|
|
- such as `{{path/to/source_file}}` or `{{path/to/wallet.txt}}`.
|
|
|
|
-- Use [`snake_case`](https://wikipedia.org/wiki/snake_case) for multi-word placeholders.
|
|
|
|
-- Use a generic placeholder rather than an actual value where a generic placeholder is available (but there is an exception to this listed below). For example, use
|
|
|
|
- `iostat {{1..infinity}}` rather than `iostat {{2}}`.
|
|
|
|
- - If there are several consecutive placeholders of the same type
|
|
|
|
- which don't allow adding arbitrary text in them (ranges), then instead of generic placeholders use descriptive ones. For example prefer `input swipe {{x_position}} {{y_position}} {{x_position}} {{y_position}} {{seconds}}`
|
|
|
|
- instead of `input swipe {{-infinity..infinity}} {{-infinity..infinity}} {{-infinity..infinity}} {{-infinity..infinity}} {{1..infinity}}`.
|
|
|
|
|
|
+```md
|
|
|
|
+- Listing all files:
|
|
|
|
|
|
-### Paths
|
|
|
|
|
|
+ `ls`
|
|
|
|
+```
|
|
|
|
|
|
-- Use `{{filename}}` when just the file name is expected.
|
|
|
|
-- For any reference to paths of files or directories,
|
|
|
|
- use the format `{{path/to/<placeholder>}}`,
|
|
|
|
- except when the location is implicit.
|
|
|
|
-- When the path cannot be relative,
|
|
|
|
- but has to start at the root of the filesystem,
|
|
|
|
- prefix it with a slash,
|
|
|
|
- such as `get {{/path/to/remote_file}}`.
|
|
|
|
-- In case of a possible reference both to a file or a directory,
|
|
|
|
- use `{{path/to/file_or_directory}}`.
|
|
|
|
|
|
+### Serial Comma
|
|
|
|
|
|
-> [!NOTE]
|
|
|
|
-> If the command is specific to Windows, use backslashes (`\`) instead, such as `{{path\to\file_or_directory}}`. Drive letters such as `C:` are optional unless the command input requires an absolute path or specific drive letter range, such as `cd /d {{C}}:{{path\to\directory}}`.
|
|
|
|
|
|
+- When declaring a list of 3 or more items,
|
|
|
|
+use a [serial comma](https://en.wikipedia.org/wiki/Serial_comma),
|
|
|
|
+also known as the Oxford comma,
|
|
|
|
+since omitting it can create ambiguity.
|
|
|
|
|
|
-### Extensions
|
|
|
|
|
|
+> Delete the Git branches, tags and remotes.
|
|
|
|
|
|
-- If a particular extension is expected for the file, append it.
|
|
|
|
- For example, `unrar x {{path/to/compressed.rar}}`.
|
|
|
|
-- In case a generic extension is needed, use `{{.ext}}`, but **only** if an extension is required.
|
|
|
|
- For instance, in `find.md`'s example "Find files by extension" (`find {{path/to/root}} -name '{{*.ext}}'`)
|
|
|
|
- using `{{*.ext}}` explains the command without being unnecessarily specific;
|
|
|
|
- while in `wc -l {{path/to/file}}` using `{{path/to/file}}` (without extension) is sufficient.
|
|
|
|
|
|
+The example above does not use a serial comma, so this could mean one of two things:
|
|
|
|
|
|
-### Grouping placeholders
|
|
|
|
|
|
+- Delete the Git branches named `tags` and `remotes`.
|
|
|
|
+- Delete all of the following: Git branches, Git tags, and Git remotes.
|
|
|
|
|
|
-- If a command can take 0 or more arguments of the same kind, use an ellipsis: `{{placeholder1 placeholder2 ...}}`.
|
|
|
|
- For instance, if multiple paths are expected `{{path/to/directory1 path/to/directory2 ...}}` can be used.
|
|
|
|
-- If a command can take 0 or more arguments of different kinds, use an ellipsis: `{{placeholder1|placeholder2|...}}`.
|
|
|
|
- If there are more than 5 possible values, you can use `|...` after the last item.
|
|
|
|
-- It's impossible to restrict the minimum or (and) maximum placeholder count via `ellipsis`.
|
|
|
|
|
|
+This can be resolved by inserting a comma before the "and" or "or" in the final element in the list.
|
|
|
|
|
|
-It's up to the program to decide how to handle duplicating values, provided syntax
|
|
|
|
-tells no info about whether items are mutually exclusive or not.
|
|
|
|
|
|
+> Delete the Git branches, tags, andBrand and project names can be capitalized in the description whenever applicable (e.g. use `A tool for interacting with a Git repository.` instead of ``A tool for interacting with a `git` repository.``). remotes.
|
|
|
|
|
|
### Special cases
|
|
### Special cases
|
|
|
|
|
|
@@ -287,41 +271,72 @@ Use backticks on the following:
|
|
- Standard streams: `stdout`, `stdin`, `stderr`. **Do not** use the full names (e.g. standard output).
|
|
- Standard streams: `stdout`, `stdin`, `stderr`. **Do not** use the full names (e.g. standard output).
|
|
- Compression algorithms, e.g. `zip`, `7z`, `xz`.
|
|
- Compression algorithms, e.g. `zip`, `7z`, `xz`.
|
|
|
|
|
|
-## Descriptions
|
|
|
|
|
|
+## Heading
|
|
|
|
|
|
-### Imperative Mood
|
|
|
|
|
|
+### More information links
|
|
|
|
|
|
-- **All descriptions must be phrased in the imperative mood.**
|
|
|
|
-- This also applies to all translations by default unless otherwise specified in the language-specific section below.
|
|
|
|
|
|
+- On the `More information` link line, we prefer linking to the author's provided documentation of the command line reference or the man page. When not available, use <https://manned.org> as the default fallback for all platforms
|
|
|
|
+(except `osx` and BSD platforms other than FreeBSD).
|
|
|
|
+Alternatively, you can link to the author's website or a tutorial page if the command doesn't have a documentation page.
|
|
|
|
|
|
-If you are afraid the commands may differ between platforms or operating systems (e.g. Windows vs macOS), most [tldr pages clients](https://github.com/tldr-pages/tldr/wiki/tldr-pages-clients) will choose the most suitable version of the command.
|
|
|
|
|
|
+- For `osx`: Apple distributes the built-in man pages [in Xcode](https://developer.apple.com/documentation/os/reading_unix_manual_pages).
|
|
|
|
+For commands documented there, we recommend using <https://keith.github.io/xcode-man-pages/>, an HTML export of all Apple's man pages bundled with Xcode.
|
|
|
|
|
|
-In this case, the information of the Windows version of `cd` (stored in `pages/windows/cd.md`) will be displayed by default to Windows users, and a generic/common version (stored in `pages/common/cd.md`) will be displayed for Linux, macOS, and other platforms.
|
|
|
|
|
|
+> [!IMPORTANT]
|
|
|
|
+> All links must be enclosed inside angular brackets (`<` and `>`).
|
|
|
|
|
|
-When writing descriptions for command examples, **check for any grammatical errors**. `Go to the specified directory` is preferred instead of:
|
|
|
|
|
|
+- It is suggested to use a more information link with English content in both translations and English pages. That's because the links can eventually change, but the translations are often out of sync with the English pages.
|
|
|
|
|
|
-- `Going to the specified directory` (should not be in present participle form)
|
|
|
|
-- `This command will go to the specified directory` (it is clear that this example works for *this* comment)
|
|
|
|
-- `Let's go to the specified directory!`
|
|
|
|
-- `Directory change` (use the active form instead of passive, if possible)
|
|
|
|
|
|
+#### Versioned links
|
|
|
|
|
|
-For instance, instead of `Listing all files:`, `List all files:` can be used as the example's description below:
|
|
|
|
|
|
+When a utility or distribution has versioned links for the packages, link to the most recent version of documentation (i.e. `latest`) or none if the website automatically redirects to the latest version of the documentation.
|
|
|
|
+
|
|
|
|
+For example, use:
|
|
|
|
+
|
|
|
|
+- <https://manpages.debian.org/latest/apt/apt.8.html> instead of <https://manpages.debian.org/bookworm/apt/apt.8.en.html>.
|
|
|
|
+- <https://docs.aws.amazon.com/cdk/latest/guide/cli.html> instead of <https://docs.aws.amazon.com/cdk/v2/guide/cli.html>.
|
|
|
|
+
|
|
|
|
+#### Microsoft Learn links
|
|
|
|
+
|
|
|
|
+When linking pages to the Microsoft Learn links, remove the locale from the address as the website will automatically redirect to the reader's preferred locale setting.
|
|
|
|
+For example, Use <https://learn.microsoft.com/windows-server/administration/windows-commands/cd> instead of
|
|
|
|
+<https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cd>.
|
|
|
|
+
|
|
|
|
+Additionally, if the link is related to PowerShell command documentation, remove the **documentation version indicator** (in which the version of PowerShell/module that the documentation is derived from), aka.
|
|
|
|
+the part of the address that starts with `?view=`.
|
|
|
|
+
|
|
|
|
+- Use <https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/select-string> instead of <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/select-string?view=powershell-7.4>.
|
|
|
|
+- Use <https://learn.microsoft.com/powershell/module/powershellget/install-module> instead of <https://learn.microsoft.com/en-us/powershell/module/powershellget/install-module?view=powershellget-1.x>.
|
|
|
|
+
|
|
|
|
+### See also section
|
|
|
|
+
|
|
|
|
+- To reference a related command or subcommand, use:
|
|
|
|
|
|
```md
|
|
```md
|
|
-- Listing all files:
|
|
|
|
|
|
+> See also: `command`.
|
|
|
|
+```
|
|
|
|
|
|
- `ls`
|
|
|
|
|
|
+- To reference related commands or subcommands, use:
|
|
|
|
+
|
|
|
|
+```md
|
|
|
|
+> See also: `command1`, `command2`, `command3`.
|
|
```
|
|
```
|
|
|
|
|
|
|
|
+- Optionally, you can add a short description beside the referenced pages:
|
|
|
|
+
|
|
|
|
+``See also: `date`, for Unix information; `umount`, for unmounting partitions.``
|
|
|
|
+
|
|
|
|
+## Example descriptions
|
|
|
|
+
|
|
### Wording
|
|
### Wording
|
|
|
|
|
|
-- All descriptions **must be concise**.
|
|
|
|
-- Avoid using the page title in the description (e.g. use `A sketching and painting program designed for digital artists` instead of `Krita is a sketching and painting program designed for digital artists`) unless the program name differs from the executable name (e.g. `rg` and Ripgrep).
|
|
|
|
|
|
+- Avoid using the page title in the description (e.g. use `A sketching and painting program designed for digital artists` instead of `Krita is a sketching and painting program designed for digital artists`)
|
|
|
|
+unless the program name differs from the executable name (e.g. `rg` and Ripgrep).
|
|
- Avoid mentioning that the program is used on the command-line (e.g. use `Ripgrep is a recursive line-oriented search tool` instead of `Ripgrep is a recursive line-oriented CLI search tool`).
|
|
- Avoid mentioning that the program is used on the command-line (e.g. use `Ripgrep is a recursive line-oriented search tool` instead of `Ripgrep is a recursive line-oriented CLI search tool`).
|
|
-- For example, when writing documentation for `cd`, a tool to change the current working directory in the Terminal or Command Prompt, **do not** write a lengthy description such as:
|
|
|
|
|
|
+- For example, when writing documentation for `cd`, a tool to check out and work on a specific directory in the Terminal or Command Prompt, **do not** write a lengthy description such as:
|
|
|
|
|
|
```md
|
|
```md
|
|
-> `cd` is a system tool, available in Windows, macOS, and Linux, to change the current working directory to get things done in the Command Prompt, Terminal, and PowerShell.
|
|
|
|
|
|
+> `cd` is a system tool, available in Windows, macOS, and Linux, to check out a specific directory to get things done in the Command Prompt, Terminal, and PowerShell.
|
|
```
|
|
```
|
|
|
|
|
|
It should instead be simplified to make it easier for everyone to read:
|
|
It should instead be simplified to make it easier for everyone to read:
|
|
@@ -334,78 +349,113 @@ It should instead be simplified to make it easier for everyone to read:
|
|
|
|
|
|
- Proper names should be capitalized in the description whenever applicable (e.g. use `A tool for interacting with a Git repository.` instead of ``A tool for interacting with a `git` repository.``).
|
|
- Proper names should be capitalized in the description whenever applicable (e.g. use `A tool for interacting with a Git repository.` instead of ``A tool for interacting with a `git` repository.``).
|
|
- Acronym expansions (i.e. protocols, tools, etc) must not be translated unless there is a recognized native equivalent for them.
|
|
- Acronym expansions (i.e. protocols, tools, etc) must not be translated unless there is a recognized native equivalent for them.
|
|
-- When documenting keycaps or a keyboard shortcut for a utility it is suggested to wrap them in backticks to make them stand out in the description (i.e. ``Print the last lines of a given file and keep reading it until `Ctrl + C`:``). Alternatively, you can document them as a separate command and optionally highlight them as placeholders (i.e. `:wq{{Enter}}` or `:wq<Enter>` or `:wq(Enter)`).
|
|
|
|
|
|
+- When documenting keycaps or a keyboard shortcut for a utility, to make it stand out in the description:
|
|
|
|
|
|
-## Emphasis
|
|
|
|
|
|
+1. If it is not translatable, enclose it with backticks (i.e. ``Print the last lines of a given file and keep reading it until `Ctrl + C`:``)
|
|
|
|
+2. If it is translatable, enclose it with double angled brackets inside a placeholder (i.e. ``:wq{{<<Enter>>}}``).
|
|
|
|
|
|
-Do not use *italics*, **boldface** or any other text styling on the pages. These are reserved for client emphasis of placeholders.
|
|
|
|
|
|
+### Short option mnemonics
|
|
|
|
|
|
-## Serial Comma
|
|
|
|
|
|
+Short option mnemonics are optional hints which can be added to help users understand the meaning of these short options. The assigned mnemonics should match with the ones in the command's official documentation (e.g. from `man` or `Get-Help`). For example:
|
|
|
|
|
|
-- When declaring a list of 3 or more items,
|
|
|
|
-use a [serial comma](https://en.wikipedia.org/wiki/Serial_comma),
|
|
|
|
-also known as the Oxford comma,
|
|
|
|
-since omitting it can create ambiguity.
|
|
|
|
|
|
+```md
|
|
|
|
+- [d]isplay the ins[t]allation [i]D for the current device. Useful for offline license activation:
|
|
|
|
|
|
-> Delete the Git branches, tags and remotes.
|
|
|
|
|
|
+`slmgr.vbs /dti`
|
|
|
|
|
|
-The example above does not use a serial comma, so this could mean one of two things:
|
|
|
|
|
|
+- Display the current license's e[xp]i[r]ation date and time:
|
|
|
|
|
|
-- Delete the Git branches named `tags` and `remotes`.
|
|
|
|
-- Delete all of the following: Git branches, Git tags, and Git remotes.
|
|
|
|
|
|
+`slmgr.vbs /xpr`
|
|
|
|
+```
|
|
|
|
|
|
-This can be resolved by inserting a comma before the "and" or "or" in the final element in the list.
|
|
|
|
|
|
+Note that, in the first example, the `[d]`, `[t]`, and `[i]` characters are enclosed with square brackets to indicate that the `/dti` option of the command is a combination of "display", "installation", and "ID", respectively.
|
|
|
|
+Group consecutive mnemonic characters under the same square brackets, for example: `e[xp]i[r]ation` instead of `e[x][p]i[r]ation`.
|
|
|
|
|
|
-> Delete the Git branches, tags, and remotes.
|
|
|
|
|
|
+**Mnemonic characters must be written in a case-sensitive manner**, even when it is placed as the first character of the sentence (i.e. use `[d]isplay` instead of `[D]isplay`).
|
|
|
|
+This is to avoid conflicts with GNU-style command options which may interpret uppercase options differently than the lowercase ones, such as `-v` for displaying the command's `[v]ersion` number and `-V` to run the command in `[V]erbose` mode.
|
|
|
|
|
|
-## See also section
|
|
|
|
|
|
+Option mnemonics may also be used in translations as long as the highlighted word contains similar meanings to the language (commonly English) which the command is written for.
|
|
|
|
+For example, `[d]ownload` in English may be translated into `[d]escargar` in Spanish, `[i]nstall` in English may be translated to `[i]nstallieren` in German, and `[a]pp` in English may be translated into `[a]plikasi` in Indonesian and Malay.
|
|
|
|
|
|
-- To reference a related command or subcommand, use:
|
|
|
|
|
|
+- Optionally, mnemonics and their enclosed terms can be separated with brackets from the rest of the description (i.e. `([a]ll)`) in translations and specific pages to provide additional context or mention a word not present in the description.
|
|
|
|
|
|
-```md
|
|
|
|
-> See also: `command`.
|
|
|
|
-```
|
|
|
|
|
|
+> [!NOTE]
|
|
|
|
+> In cases where the character isn't present in the translated word, you can highlight the option before/next to the equivalent word or you can add the English work beside the translation inside a bracket.
|
|
|
|
+> For example, `E[x]tract` in English maybe translated into `[x] ekstrak` or `ekstrak [x]` or `ekstrak (E[x]tract)` in Indonesian.
|
|
|
|
|
|
-- To reference related commands or subcommands, use:
|
|
|
|
|
|
+## Example commands
|
|
|
|
|
|
-```md
|
|
|
|
-> See also: `command1`, `command2`, `command3`.
|
|
|
|
-```
|
|
|
|
|
|
+### Option syntax
|
|
|
|
|
|
-- Optionally, you can add a short description beside the referenced pages:
|
|
|
|
|
|
+- For commonly/frequently used commands (e.g. `grep`, `tar`, `etc`), we prefer using short options along with [mnemonics](#short-option-mnemonics) or both inside a placeholder.
|
|
|
|
+- For highlighting both long and short options in commands (instead of using mnemonics), combine them within a placeholder i.e. `{{-o|--output}}`.
|
|
|
|
+- For user-friendliness, use **GNU-style long options** (like `--help` rather than `-h`) when they are cross-platform compatible (intended to work the same across multiple platforms) for pages in `common` directory.
|
|
|
|
|
|
-``See also: `date`, for Unix information; `umount`, for unmounting partitions.``
|
|
|
|
|
|
+### Placeholder syntax
|
|
|
|
+
|
|
|
|
+User-provided values should use the `{{placeholder}}` syntax
|
|
|
|
+in order to allow `tldr` clients to highlight them.
|
|
|
|
|
|
-## More information links
|
|
|
|
|
|
+> [!TIP]
|
|
|
|
+> It is suggested to enclose placeholders accepting strings as input within quotes. i.e. Use `"{{placeholder}}"` instead of `{{"placeholder"}}`.
|
|
|
|
+
|
|
|
|
+Keep the following guidelines in mind when choosing placeholders:
|
|
|
|
|
|
-- On the `More information` link line, we prefer linking to the author's provided documentation of the command line reference or the man page. When not available, use <https://manned.org> as the default fallback for all platforms (except `osx` and BSD platforms other than FreeBSD). Alternatively, you can link to the author's website or a tutorial page if the command doesn't have a documentation page.
|
|
|
|
|
|
+#### Naming
|
|
|
|
+
|
|
|
|
+- Use short but descriptive placeholders,
|
|
|
|
+ such as `{{path/to/source_file}}` or `{{path/to/wallet.txt}}`.
|
|
|
|
+- Use [`snake_case`](https://wikipedia.org/wiki/snake_case) for multi-word placeholders.
|
|
|
|
+- Use a generic placeholder rather than an actual value where a generic placeholder is available (but there is an exception to this listed below). For example, use
|
|
|
|
+`iostat {{1..infinity}}` rather than `iostat {{2}}`.
|
|
|
|
+- If there are several consecutive placeholders of the same type
|
|
|
|
+ which don't allow adding arbitrary text in them (ranges), then instead of generic placeholders use descriptive ones. For example prefer `input swipe {{x_position}} {{y_position}} {{x_position}} {{y_position}} {{seconds}}`
|
|
|
|
+ instead of `input swipe {{-infinity..infinity}} {{-infinity..infinity}} {{-infinity..infinity}} {{-infinity..infinity}} {{1..infinity}}`.
|
|
|
|
|
|
-- For `osx`: Apple distributes the built-in man pages [in Xcode](https://developer.apple.com/documentation/os/reading_unix_manual_pages). For commands documented there, we recommend using https://keith.github.io/xcode-man-pages/, an HTML export of all Apple's man pages bundled with Xcode.
|
|
|
|
|
|
+#### Paths
|
|
|
|
|
|
-- **All links must be enclosed inside angular brackets (`<` and `>`) for proper rendering in clients.**
|
|
|
|
|
|
+- Use `{{filename}}` when just the file name is expected.
|
|
|
|
+- For any reference to paths of files or directories,
|
|
|
|
+ use the format `{{path/to/placeholder}}`,
|
|
|
|
+ except when the location is implicit.
|
|
|
|
+- When the path cannot be relative,
|
|
|
|
+ but has to start at the root of the filesystem,
|
|
|
|
+ prefix it with a slash,
|
|
|
|
+ such as `get {{/path/to/remote_file}}`.
|
|
|
|
+- In case of a possible reference both to a file or a directory,
|
|
|
|
+ use `{{path/to/file_or_directory}}`.
|
|
|
|
|
|
-- We prefer translations to use the more information link of the English page by default.
|
|
|
|
|
|
+> [!NOTE]
|
|
|
|
+> If the command is specific to Windows, use backslashes (`\`) instead, such as `{{path\to\file_or_directory}}`. Drive letters such as `C:` are optional unless the command input requires an absolute path
|
|
|
|
+> or specific drive letter range, such as `cd /d {{C}}:{{path\to\directory}}`.
|
|
|
|
|
|
-### Versioned links
|
|
|
|
|
|
+#### Extensions
|
|
|
|
|
|
-When a utility or distribution has versioned links for the packages, we prefer linking to the most recent version of documentation (i.e. `latest`) or none if the website automatically redirects to the latest version of the documentation.
|
|
|
|
|
|
+- If a particular extension is expected for the file, append it.
|
|
|
|
+ For example, `unrar x {{path/to/compressed.rar}}`.
|
|
|
|
+- In case a generic extension is needed, use `{{.ext}}`, but **only** if an extension is required.
|
|
|
|
+ For instance, in `find.md`'s example "Find files by extension" (`find {{path/to/root}} -name '{{*.ext}}'`)
|
|
|
|
+ using `{{*.ext}}` explains the command without being unnecessarily specific;
|
|
|
|
+ while in `wc -l {{path/to/file}}` using `{{path/to/file}}` (without extension) is sufficient.
|
|
|
|
|
|
-For example, use:
|
|
|
|
|
|
+#### Grouping placeholders
|
|
|
|
|
|
-- <https://manpages.debian.org/latest/apt/apt.8.html> instead of <https://manpages.debian.org/bookworm/apt/apt.8.en.html>.
|
|
|
|
-- <https://docs.aws.amazon.com/cdk/latest/guide/cli.html> instead of <https://docs.aws.amazon.com/cdk/v2/guide/cli.html>.
|
|
|
|
|
|
+- If a command can optionally take 1 or more arguments of the same kind, use an ellipsis: `{{placeholder1 placeholder2 ...}}`.
|
|
|
|
+ For instance, if multiple paths are expected, use `{{path/to/directory1 path/to/directory2 ...}}`.
|
|
|
|
+- If a command can optionally take 1 or more arguments of different kinds, use an ellipsis: `{{placeholder1|placeholder2|...}}`.
|
|
|
|
+ If there are more than 5 possible values, you can use `|...` after the last item.
|
|
|
|
+- It's impossible to restrict the minimum or (and) maximum placeholder count via `ellipsis`.
|
|
|
|
|
|
-### Microsoft Learn links
|
|
|
|
|
|
+It's up to the program to decide how to handle duplicating values, provided syntax
|
|
|
|
+tells no info about whether items are mutually exclusive or not.
|
|
|
|
|
|
-When linking pages to the Microsoft Learn links, remove the locale from the address as the website will automatically redirect to the reader's preferred locale setting. For example, Use <https://learn.microsoft.com/windows-server/administration/windows-commands/cd> instead of
|
|
|
|
-<https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cd>.
|
|
|
|
|
|
+#### Optional placeholders
|
|
|
|
|
|
-Additionally, if the link is related to PowerShell command documentation, remove the **documentation version indicator** (in which the version of PowerShell/module that the documentation is derived from), aka. the part of the address that starts with `?view=`.
|
|
|
|
|
|
+When documenting optional placeholders likes paths or file extensions, it is suggested to specify them in the page or example descriptions instead of the placeholder itself. For example:
|
|
|
|
|
|
-- Use <https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/select-string> instead of <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/select-string?view=powershell-7.4>.
|
|
|
|
-- Use <https://learn.microsoft.com/powershell/module/powershellget/install-module> instead of <https://learn.microsoft.com/en-us/powershell/module/powershellget/install-module?view=powershellget-1.x>.
|
|
|
|
|
|
+- Use `{{path/to/source.ext}}` instead of `{{path/to/source.tar[.gz|.bz2|.xz]}}`.
|
|
|
|
|
|
-## Help and version commands
|
|
|
|
|
|
+### Help and version commands
|
|
|
|
|
|
- We generally put, **in this order**, the help and version commands as the **last two** examples of the page to highlight more practical commands at the beginning of the page. They can be replaced to accommodate other useful examples if required.
|
|
- We generally put, **in this order**, the help and version commands as the **last two** examples of the page to highlight more practical commands at the beginning of the page. They can be replaced to accommodate other useful examples if required.
|
|
- For consistency, we prefer generic wording `Display help` and `Display version` for these commands.
|
|
- For consistency, we prefer generic wording `Display help` and `Display version` for these commands.
|
|
@@ -529,12 +579,15 @@ To ensure that the sentence may not be confused with `start processing the web s
|
|
|
|
|
|
### French-Specific Rules
|
|
### French-Specific Rules
|
|
|
|
|
|
-- Command and example descriptions on pages in French must use the third person singular present indicative tense (présent de l'indicatif à la troisième personne du singulier). For example, use `Extrait une archive` rather than `Extraire une archive` or `Extrais une archive`.
|
|
|
|
-- There must be a single blank space between special characters in the descriptions. For example, use `Plus d'informations : https://example.com.` instead of `Plus d'informations: https://example.com.` and use `Crée une archive à partir de fichiers :` instead of `Crée une archive à partir de fichiers:`.
|
|
|
|
|
|
+- Command and example descriptions on pages in French must use the third person singular present indicative tense (présent de l'indicatif à la troisième personne du singulier).
|
|
|
|
+For example, use `Extrait une archive` rather than `Extraire une archive` or `Extrais une archive`.
|
|
|
|
+- There must be a single blank space between special characters in the descriptions.
|
|
|
|
+For example, use `Plus d'informations : https://example.com.` instead of `Plus d'informations: https://example.com.` and use `Crée une archive à partir de fichiers :` instead of `Crée une archive à partir de fichiers:`.
|
|
|
|
|
|
### Portuguese-Specific Rules
|
|
### Portuguese-Specific Rules
|
|
|
|
|
|
-Example descriptions on pages in Portuguese (for both European and Brazilian Portuguese) must start with verbs in the third person singular present indicative tense. This is because the descriptions must explain what the commands do, making this the correct form to express the intended meaning.
|
|
|
|
|
|
+Example descriptions on pages in Portuguese (for both European and Brazilian Portuguese) must start with verbs in the third person singular present indicative tense.
|
|
|
|
+This is because the descriptions must explain what the commands do, making this the correct form to express the intended meaning.
|
|
|
|
|
|
For example, use `Lista os arquivos` instead of `Listar os arquivos`, `Listando os arquivos` or any other form.
|
|
For example, use `Lista os arquivos` instead of `Listar os arquivos`, `Listando os arquivos` or any other form.
|
|
|
|
|