Skip to content

Commit cd19a8d

Browse files
feat: add more special characters to allowlist (#389)
1 parent 0741a32 commit cd19a8d

File tree

17 files changed

+273
-14
lines changed

17 files changed

+273
-14
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com).
77

88
## [v0.0.19](https://github.com/tldr-pages/tldr-lint/compare/v0.0.18...v0.0.19)
99

10+
### Added
11+
12+
- Add `{`, `%`, `,`, `^`, `~`, `$`, `~`, and `.` as allowed characters in file names and page titles ([#389](https://github.com/tldr-pages/tldr-lint/pull/389))
13+
1014
### Changed
1115

1216
- Switched to Node.js 22 ([#393](https://github.com/tldr-pages/tldr-lint/pull/393))
@@ -15,13 +19,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com).
1519

1620
### Added
1721

18-
- Add `!` as allowed characters in page titles ([#386](https://github.com/tldr-pages/tldr-lint/pull/386))
22+
- Add `!` as allowed characters in file names and page titles ([#386](https://github.com/tldr-pages/tldr-lint/pull/386))
1923

2024
## [v0.0.17 - 2025-03-31](https://github.com/tldr-pages/tldr-lint/compare/v0.0.16...v0.0.17)
2125

2226
### Added
2327

24-
- Add `]` and `}` as allowed characters in page titles ([#378](https://github.com/tldr-pages/tldr-lint/pull/378))
28+
- Add `]` and `}` as allowed characters in file names and page titles ([#378](https://github.com/tldr-pages/tldr-lint/pull/378))
2529

2630
## [v0.0.16 - 2024-10-04](https://github.com/tldr-pages/tldr-lint/compare/v0.0.15...v0.0.16)
2731

lib/tldr-parser.js

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

specs/pages/passing/$.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# $
2+
3+
> Expand a Bash variable.
4+
> More information: <https://gnu.org/software/bash/manual/bash.html#Shell-Variables>.
5+
6+
- Print a variable:
7+
8+
`echo ${{VARIABLE}}`
9+
10+
- Print the exit status of the previous command:
11+
12+
`echo $?`
13+
14+
- Print a random number between 0 and 32767:
15+
16+
`echo $RANDOM`
17+
18+
- Print one of the prompt strings:
19+
20+
`echo ${{PS0|PS1|PS2|PS3|PS4}}`
21+
22+
- Expand with the output of `command` and run it. Same as enclosing `command` in backtics:
23+
24+
`$({{command}})`
25+
26+
- List how many arguments the current context has:
27+
28+
`echo $#`
29+
30+
- Print out a Bash array:
31+
32+
`echo ${array[@]}`

specs/pages/passing/%.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# %
2+
3+
> Manage jobs.
4+
> More information: <https://www.gnu.org/software/bash/manual/bash.html#Job-Control-Basics>.
5+
6+
- Bring the current job to front:
7+
8+
`%`
9+
10+
- Bring the previous job to front:
11+
12+
`%-`
13+
14+
- Bring the job number `n` to front:
15+
16+
`%{{n}}`
17+
18+
- Bring a job whose command starts with `string` to front:
19+
20+
`%{{string}}`
21+
22+
- Bring a job whose command contains `string` to front:
23+
24+
`%?{{string}}`
25+
26+
- Resume a suspended job:
27+
28+
`%{{1}} &`
File renamed without changes.

specs/pages/passing/,.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# ,
2+
3+
> Run commands without installing them.
4+
> More information: <https://github.com/nix-community/comma>.
5+
6+
- Run a command:
7+
8+
`, {{command -with -flags}}`
9+
10+
- Add a command to a child shell:
11+
12+
`, {{[-s|--shell]}} {{command}}`
13+
14+
- Clear the cache:
15+
16+
`, {{[-e|--empty-cache]}}`

specs/pages/passing/..md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# .
2+
3+
> This command is an alias of `source`.
4+
5+
- View documentation for the original command:
6+
7+
`tldr source`

specs/pages/passing/[.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# [
2+
3+
> Check file types and compare values.
4+
> Returns a status of 0 if the condition evaluates to true, 1 if it evaluates to false.
5+
> More information: <https://gnu.org/software/bash/manual/bash.html#index-test>.
6+
7+
- Test if a given variable is equal/not equal to the specified string:
8+
9+
`[ "${{variable}}" {{=|!=}} "{{string}}" ]`
10+
11+
- Test if a given variable is [eq]ual/[n]ot [e]qual/[g]reater [t]han/[l]ess [t]han/[g]reater than or [e]qual/[l]ess than or [e]qual to the specified number:
12+
13+
`[ "${{variable}}" -{{eq|ne|gt|lt|ge|le}} {{integer}} ]`
14+
15+
- Test if the specified variable has a [n]on-empty value:
16+
17+
`[ -n "${{variable}}" ]`
18+
19+
- Test if the specified variable has an empty value ([z]ero length):
20+
21+
`[ -z "${{variable}}" ]`
22+
23+
- Test if the specified [f]ile exists:
24+
25+
`[ -f {{path/to/file}} ]`
26+
27+
- Test if the specified [d]irectory exists:
28+
29+
`[ -d {{path/to/directory}} ]`
30+
31+
- Test if the specified file or directory [e]xists:
32+
33+
`[ -e {{path/to/file_or_directory}} ]`

specs/pages/passing/[[.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# [[
2+
3+
> Check file types and compare values.
4+
> Returns a status of 0 if the condition evaluates to true, 1 if it evaluates to false.
5+
> More information: <https://gnu.org/software/bash/manual/bash.html#index-_005b_005b>.
6+
7+
- Test if a given variable is equal/not equal to the specified string:
8+
9+
`[[ ${{variable}} {{==|!=}} "{{string}}" ]]`
10+
11+
- Test if a given string conforms the specified glob/regex:
12+
13+
`[[ ${{variable}} {{==|=~}} {{pattern}} ]]`
14+
15+
- Test if a given variable is [eq]ual/[n]ot [e]qual/[g]reater [t]han/[l]ess [t]han/[g]reater than or [e]qual/[l]ess than or [e]qual to the specified number:
16+
17+
`[[ ${{variable}} -{{eq|ne|gt|lt|ge|le}} {{integer}} ]]`
18+
19+
- Test if the specified variable has a [n]on-empty value:
20+
21+
`[[ -n ${{variable}} ]]`
22+
23+
- Test if the specified variable has an empty value ([z]ero length):
24+
25+
`[[ -z ${{variable}} ]]`
26+
27+
- Test if the specified [f]ile exists:
28+
29+
`[[ -f {{path/to/file}} ]]`
30+
31+
- Test if the specified [d]irectory exists:
32+
33+
`[[ -d {{path/to/directory}} ]]`
34+
35+
- Test if the specified file or directory [e]xists:
36+
37+
`[[ -e {{path/to/file_or_directory}} ]]`

specs/pages/passing/].md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# ]
2+
3+
> This shell keyword is used to close out `[`.
4+
5+
- View documentation for the `[` keyword:
6+
7+
`tldr [`

0 commit comments

Comments
 (0)