npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@343dev/markdown-lint

v3.0.0

Published

Markdown code style linter

Downloads

8

Readme

@343dev/markdown-lint

npm

Консольная утилита для проверки Markdown-файлов на соответствие указанным стандартам качества.

Основана на Prettier, Remark и Typograf.

Мотивация

Порой репозитории с проектами содержат большое количество файлов с документацией. Однажды мы решили начать проверять грамматику и орфографию в таких файлах, и создали для этих целей languagetool-node.

В то же время мы решили проверять синтаксис Markdown-файлов, как мы проверяем JS, CSS и иные файлы проекта. Потому создали этот линтер.

Установка

Для глобальной установки и использования CLI-утилиты:

npm install -g @343dev/markdown-lint

Для установки в проект:

npm install --dev @343dev/markdown-lint

Работа с CLI

Для ручной проверки файлов или директорий можно обращаться к markdown-lint из командной строки:

# проверка файла на наличие ошибок
markdown-lint README.md

# проверка файлов внутри директории (без поиска в поддиректориях)
markdown-lint ./docs

# проверка файлов внутри директории (с поиском в поддиректориях)
markdown-lint -r ./docs

# проверка файла и автоматическое исправление ошибок
markdown-lint --fix README.md

Доступные флаги

  • --fix — автоматическое исправление ошибок;
  • --ext <value> — указание расширений файлов; допустимо последовательное указание нескольких расширений, например --ext apib --ext txt. По умолчанию md;
  • -t, --typograph — типографирование текста;
  • -r, --recursive — поиск файлов не только внутри указанной директории, но и во всех поддиректориях;
  • -c, --config <file> — подключение внешнего файла с конфигурацией линтера;
  • -v, --version — вывод текущей версии линтера;
  • -h, --help — вывод справки.

Конфигурация линтера

Работа линтера основана на Markdown-процессоре remark.

Линтинг производится с помощью библиотеки remark-lint и набора правил remark-preset-lint-markdown-style-guide.

Для тонкой настройки линтера нужно создать файл конфигурации и с помощью флага --config указать путь до него:

markdown-lint --fix --config ~/.markdownlintrc.cjs README.md

Пример конфигурации:

module.exports = {
  // prettier обрабатывает тексты, когда `--fix` передан
  prettier: {
    // автоматически ограничиваем длину строки в 120 символов
    printWidth: '120'
  },

  remark: {
    // применяем настройки для remark-lint
    plugins: [
      // объявляем линтеру, что максимальная длина строки теперь равна 120 символам
      ['remark-lint-maximum-line-length', 120],

      // отключаем правило `no-inline-padding`
      ['remark-lint-no-inline-padding', false],

      // объявляем линтеру, что мы теперь используем `*` как маркер списка
      ['remark-lint-unordered-list-marker-style', '*']
    ],

    // remark-stringify обрабатывает тексты, когда `--fix` передан
    stringifySettings: {
      // автоматически заменяем все маркеры списка на `*`
      bullet: '*'
    }
  },

  typograf: {
    // API настроек — https://github.com/typograf/typograf/blob/dev/docs/api_rules.md
    // список правил — https://github.com/typograf/typograf/blob/dev/docs/RULES.ru.md
    locale: ['ru', 'en-US'],
    enableRules: [],
    disableRules: [
      // обязательное отключение следующих правил требуется для правильной работы типографа
      'common/space/delTrailingBlanks',
      'common/space/trimLeft',
      'common/space/trimRight'
    ],
    rulesSettings: []
  }
};

Пример работы

До обработки с флагом --fix

Linux kernel
============

There are several guides for kernel developers and users. These guides can be rendered in a number of formats, like HTML and PDF. Please read Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or ``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory, several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the requirements for building and running the kernel, and information about the problems which may result by upgrading your kernel.

__Useful links__

* [Linux kernel licensing rules](https://www.kernel.org/doc/html/latest/process/license-rules.html#kernel-licensing)
* [Reporting bugs](https://www.kernel.org/doc/html/latest/admin-guide/reporting-bugs.html)

После обработки

# Linux kernel

There are several guides for kernel developers and users. These guides can be
rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use `make htmldocs` or `make pdfdocs`. The
formatted documentation can also be read online at:

```
https://www.kernel.org/doc/html/latest/
```

There are various text files in the Documentation/ subdirectory, several of them
using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about the
problems which may result by upgrading your kernel.

**Useful links**

- [Linux kernel licensing rules](https://www.kernel.org/doc/html/latest/process/license-rules.html#kernel-licensing)
- [Reporting bugs](https://www.kernel.org/doc/html/latest/admin-guide/reporting-bugs.html)

Благодарности

Яркую картинку для репозитория нарисовал Игорь Гарибальди.