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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ilib-loctool-ghfm

v1.12.0

Published

A loctool plugin that knows how to process github-flavored markdown files

Readme

ilib-loctool-ghfm

Ilib loctool plugin to parse and localize github-flavored markdown

Markdown is broken into paragraphs and phrases using the remark family of parsers.

Escapes

Whenever there is syntax in the markdown that translators should not touch, this plugin converts them into xml-like components.

This is _bold_ and *italic* text.

Becomes the string:

This is <c0>bold</c0> and <c1>italic</c1> text.

for the translators.

In this way, translators only have to deal with xml-like syntax (which they are probably already familiar with) instead of the various methods of marking up text using markdown.

Each component is numbered so that the translators can switch them around as appropriate for the grammar of their target language.

Code

Snippets of code are not processed. If there is an inline snippet of code, it will be considered part of the surrounding text and represented as an XML-like component. The text of the inline snippet will be put into the comments of the extracted string so that the translator knows what it is.

Example:

There are many instances of `numcount` used in the code.

becomes:

There are many instances of <c0/> used in the code.

for the translators.

Inline snippets are represented with self-closing XML tags.

HTML

You may embed HTML in the markdown and it will be processed as above using the XML-like components.

This text is <b>bold</b> and contains a <span font="foo">different font</span>.

becomes:

This text is <c0>bold</c0> and contains a <c1>different font</c1>.

for the translators.

The attributes of certain HTML tags, such as the "title" attribute will have its value extracted as well as a string resource.

Comments

If you would like to place a translator's comment with a particular section of text, you can do so with an HTML comment that starts with "I18N" like this:

<!-- I18N this commment is extracted and sent along with the
     resource that follows it. -->
This is the text that is being commented upon.

Links, References, and Footnotes

You can have references and links in your markdown as normal:

See the code on [github](https://github.com/iLib-js/ilib-mono/tree/main/packages/ilib-loctool-ghfm).

which becomes:

See the code on <c0>github</c0>.

for the translators.

For links, such as the above, the target URL of the link is not usually translated. However, you can override that for specific links with a special HTML comment directive:

<!-- i18n-enable localize-links -->
See the code on [github](https://github.com/iLib-js/ilib-mono/tree/main/packages/ilib-loctool-ghfm).
<!-- i18n-disable localize-links -->

In this case, the URL https://github.com/iLib-js/ilib-mono/tree/main/packages/ilib-loctool-ghfm will be extracted as a separate string resource which can be localized independently, presumably to point to a localized version of the website.

For references with footnotes, the contents of the footnotes are usually not translated either if they consist only of URLs. Example:

This text is [translated][tr].

[tr]: http://www.non.translated.url/

However, you can override this for specific footnotes with the same HTML comment directive:

This text is [translated][tr].

<!-- i18n-enable localize-links -->
[tr]: http://www.non.translated.url/
<!-- i18n-disable localize-links -->

In this case, the url itself will be extracted as a separate string resource and will be localizable.

File Extensions

By default, this plugin handles files with the following extensions:

  • .md
  • .markdown
  • .mdown
  • .mkd
  • .rst
  • .rmd
  • .mdx

Mappings

This plugin now supports mappings:

{
  [...]
  "settings": {
    "markdown": {
      "mappings": {
        "**/*.mdx": {
          "template": "[localeDir]/[filename]"
        },
        "**/foobar.md": {
          "template": "[dir]/[basename]_[locale].[extension]",
          "frontmatter": ["Title", "Description"],
          "localeMap": {
            "fr-FR": "fr",
            "ja-JP": "ja"
          }
        }
      }
    }
  }
}

The mappings allow you to match a particular path name and apply particular settings to that path, such as an output path name template. The mappings are minimatch style.

The template follows the syntax for path name templates defined in the the loctool itself.

The frontmatter setting specifies an array of strings that represent the names of the fields in the frontmatter that should be localized. The frontmatter is parsed as a yaml file using the ilib-loctool-yaml plugin.

Any fields not listed in the frontmatter list will be preserved but not be localized. If frontmatter is set to "true" instead of an array, all fields will be localized. If frontmatter is set to "false", or if it is not given, then no fields will be localized.

The localeMap setting specifies the mapping between locales that are used internally in the plugin, and the output locale that should be used for constructing the file name of output files.

License

This plugin is licensed under Apache2. See the LICENSE file for more details.

Release Notes

See CHANGELOG.md