Skip to content

Commit 41322b3

Browse files
Add even more special characters as allowed title (#414)
1 parent ad0bb9a commit 41322b3

File tree

11 files changed

+136
-12
lines changed

11 files changed

+136
-12
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
55

66
The format is based on [Keep a Changelog](https://keepachangelog.com).
77

8+
## [v0.0.20](https://github.com/tldr-pages/tldr-lint/compare/v0.0.19...v0.0.20)
9+
10+
### Added
11+
12+
- Add `:`, `>`, `<`, `|`, and `?` as allowed characters in page titles ([#414](https://github.com/tldr-pages/tldr-lint/pull/414))
13+
14+
### Changed
15+
16+
- Make TLDR013 more descriptive since we also allow specific characters ([#414](https://github.com/tldr-pages/tldr-lint/pull/414))
17+
818
## [v0.0.19 - 2025-06-10](https://github.com/tldr-pages/tldr-lint/compare/v0.0.18...v0.0.19)
919

1020
### Added

lib/tldr-lint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports.ERRORS = parser.ERRORS = {
1818
'TLDR010': 'Only Unix-style line endings allowed',
1919
'TLDR011': 'Page never contains more than a single empty line',
2020
'TLDR012': 'Page should contain no tabs',
21-
'TLDR013': 'Title should be alphanumeric with dashes, underscores or spaces',
21+
'TLDR013': 'Title should be alphanumeric with dashes, underscores, spaces or allowed characters',
2222
'TLDR014': 'Page should contain no trailing whitespace',
2323
'TLDR015': 'Example descriptions should start with a capital letter',
2424
'TLDR016': 'Label for information link should be spelled exactly `More information: `',

lib/tldr-parser.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specs/pages/passing/colon.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# :
2+
3+
> Returns a successful exit status code of 0.
4+
> More information: <https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#colon>.
5+
6+
- Return a successful exit code:
7+
8+
`:`
9+
10+
- Make a command always exit with 0:
11+
12+
`{{command}} || :`
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# >
2+
3+
> Redirect output.
4+
> More information: <https://gnu.org/software/bash/manual/bash.html#Redirecting-Output>.
5+
6+
- Redirect `stdout` to a file:
7+
8+
`{{command}} > {{path/to/file}}`
9+
10+
- Append to a file:
11+
12+
`{{command}} >> {{path/to/file}}`
13+
14+
- Redirect both `stdout` and `stderr` to a file:
15+
16+
`{{command}} &> {{path/to/file}}`
17+
18+
- Redirect `stderr` to `/dev/null` to keep the terminal output clean:
19+
20+
`{{command}} 2> /dev/null`
21+
22+
- Clear the file contents or create a new empty file:
23+
24+
`> {{path/to/file}}`
25+
26+
- Redirect `stderr` to `stdout` for piping them together:
27+
28+
`{{command1}} 2>&1 | {{command2}}`

specs/pages/passing/less-than.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# <
2+
3+
> Redirect data to `stdin`.
4+
> More information: <https://gnu.org/software/bash/manual/bash.html#Redirecting-Input>.
5+
6+
- Redirect a file to `stdin` (achieves the same effect as `cat file.txt |`):
7+
8+
`{{command}} < {{path/to/file.txt}}`
9+
10+
- Create a here document and pass that into `stdin` (requires a multiline command):
11+
12+
`{{command}} << {{EOF}} <Enter> {{multiline_text}} <Enter> {{EOF}}`
13+
14+
- Create a here string and pass that into `stdin` (achieves the same effect as `echo string |`):
15+
16+
`{{command}} <<< {{string}}`
17+
18+
- Process data from a file and write the output to another file:
19+
20+
`{{command}} < {{path/to/file.txt}} > {{path/to/file2.txt}}`
21+
22+
- Write a here document into a file:
23+
24+
`cat << {{EOF}} > {{path/to/file.txt}} <Enter> {{multiline_data}} <Enter> {{EOF}}`
25+
26+
- Disregard leading tabs (good for scripts with indentation but does not work for spaces):
27+
28+
`cat <<- {{EOF}} > {{path/to/file.txt}} <Enter> {{multiline_data}} <Enter> {{EOF}}`
29+
30+
- Pass command output to a program as a file descriptor:
31+
32+
`diff <({{command1}}) <({{command2}})`
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# ?
2+
3+
> Get context sensitive.
4+
> More information: <https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/fundamentals/configuration/15mt/fundamentals-15-mt-book/cf-cli-basics.html#GUID-223128D2-FB6D-418D-86C6-06D1D0DA51B3>.
5+
6+
- Get available commands:
7+
8+
`?`
9+
10+
- Get storages that are listable:
11+
12+
`dir ?`
13+
14+
- Show what IP information is viewable:
15+
16+
`ip show ?`
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# |
2+
3+
> Pipe data between programs.
4+
> More information: <https://gnu.org/software/bash/manual/bash.html#Pipelines>.
5+
6+
- Pipe `stdout` to `stdin`:
7+
8+
`{{command}} | {{command}}`
9+
10+
- Pipe both `stdout` and `stderr` to `stdin`:
11+
12+
`{{command}} |& {{command}}`

specs/tldr-lint.spec.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,20 @@ describe('TLDR pages that are simply correct', function() {
225225
});
226226
});
227227

228+
const validTitleCharacters = [
229+
[':', 'colon'],
230+
['>', 'greater-than'],
231+
['<', 'less-than'],
232+
['|', 'vertical-bar'],
233+
['?', 'question-mark']
234+
];
235+
validTitleCharacters.forEach(([symbol, name]) => {
236+
it(`Page title includes '${symbol}' symbol`, function() {
237+
let errors = lintFile(`pages/passing/${name}.md`).errors;
238+
expect(errors.length).toBe(0);
239+
});
240+
});
241+
228242
it('Certain words are always written in lower case', function() {
229243
let errors = lintFile('pages/passing/lower-case.md').errors;
230244
expect(errors.length).toBe(0);

0 commit comments

Comments
 (0)