LinuxCommandLibrary

tldr-lint

Lints and validates tldr pages

TLDR

Lint all pages

$ tldr-lint [pages_directory]
copy

Format a specific page to stdout
$ tldr-lint --format [page.md]
copy

Format all pages in place
$ tldr-lint --format --in-place [pages_directory]
copy

SYNOPSIS

tldr-lint [options] [files...]
tldr-lint [options] <path_to_page_or_directory>

PARAMETERS

files...
    One or more tldr page files or directories to lint. If directories are specified, all .md files within them will be linted recursively.

-s, --spec <version>
    Validate against a specific tldr specification version. Defaults to the latest supported version.

-o, --output-format <format>
    Specify the output format for linting results (e.g., text, json). Default is text.

-p, --platform <platform>
    Specify the platform for which pages are being linted (e.g., common, linux, osx, windows). This helps in validating platform-specific rules.

-e, --exclude <pattern>
    Exclude files or directories matching the specified glob pattern from linting.

--color
    Force color output, even if stdout is not a TTY.

--no-color
    Disable color output.

--verbose
    Provide more detailed output, including skipped files and additional linting information.

--error-on-warning
    Exit with a non-zero status code if any warnings are found, treating warnings as errors.

-v, --version
    Display the tldr-lint version number.

-h, --help
    Display a help message and exit.

DESCRIPTION

tldr-lint is a command-line utility designed to validate and lint tldr pages. It ensures that contribution pages adhere to the official tldr contributing guidelines and specifications. This tool is crucial for maintaining the quality, consistency, and uniformity of the community-driven tldr documentation project. It performs various checks, including Markdown syntax validation, proper use of command examples, correct section headers, and adherence to specific formatting rules. By catching errors and inconsistencies early in the development process, tldr-lint helps contributors submit high-quality pages that are easily readable and useful to end-users across different platforms.

CAVEATS

tldr-lint typically requires Node.js and npm to be installed for its installation and execution, as it's often distributed as an npm package. The linting rules are based on the current tldr project's contributing guidelines, which may evolve over time. It performs static analysis and does not execute the commands described in the pages.

INSTALLATION

tldr-lint is commonly installed via npm (Node Package Manager). You can install it globally using:
npm install -g tldr-lint

EXIT STATUS

tldr-lint exits with a status of 0 if all linting checks pass without errors. It exits with a non-zero status (e.g., 1) if any errors are found, or if --error-on-warning is used and warnings are present.

HISTORY

tldr-lint emerged as an essential tool within the tldr project, a collaborative, community-driven effort to create simplified and community-maintained man pages. As the project grew, maintaining consistency and quality across thousands of contributed pages became crucial. tldr-lint was developed to automate the enforcement of the project's strict contributing guidelines, ensuring all new and updated pages meet the required Markdown syntax, formatting, and content standards. It significantly streamlined the review process for contributions and empowered contributors to self-validate their work, fostering a higher standard of documentation within the tldr ecosystem.

SEE ALSO

tldr(1), npm(1), markdownlint

Copied to clipboard