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

richtypo-rules-ru

v5.1.3

Published

Russian typography rules for Richtypo

Downloads

200

Readme

Richtypo Russian typography rules

The Russian typography rules for Richtypo.

Converts this:

Настругал Папа Карло тысячу БУРАТИН 29 февраля - используйте
"Ричтайпо" и ваши уши будут торчать из-за туч.

to this:

Настругал Папа Карло тысячу
<abbr>БУРАТИН</abbr> 29&nbsp;февраля&nbsp;— используйте «Ричтайпо»
и&nbsp;ваши уши будут торчать <nobr>из-за</nobr>&nbsp;туч.

Installation

npm install --save richtypo richtypo-rules-ru

Basic usage

import richtypo from 'richtypo';
import rules from 'richtypo-rules-ru';

const text =
  'Настругал Папа Карло тысячу БУРАТИН 29 февраля - ' +
  'используйте "Ричтайпо" и ваши уши будут торчать из-за туч.';

richtypo(rules, text);

// -> Настругал Папа Карло тысячу <abbr>БУРАТИН</abbr> 29&nbsp;февраля&nbsp;—
//    используйте «Ричтайпо» и&nbsp;ваши уши будут торчать <nobr>из-за</nobr>&nbsp;туч.

The default export of richtypo-rules-ru contains recommended rules (marked with ¹ in a table below), but you can import each rule separately:

import richtypo from 'richtypo';
import { quotes, numberSeparators } from 'richtypo-rules-ru';
richtypo(
  [quotes, numberSeparators],
  'Текст "в кавычках" - 123456,78'
);
// -> Текст «в кавычках» - 123&#x202f;456,78

See more examples in Richtypo docs.

The rules

| Rule | Description | Input | Output | | --- | --- | --- | --- | | abbrs¹ | wrap abbreviations in <abbr> tag | БКОАНТОЛО | <abbr>БКОАНТОЛО</abbr> | | dashes¹ | transform a dash between two words to an em dash (—), add a non-breaking space before an em dash | собака - друг | собака&nbsp;— друг² | | degreeSigns¹ | add a non-breaking space between a number and a degree sign (°) | 13 °C | 13&#x202f;°C | | ellipses¹ | transform three dots (...) to an ellipsis (…) | ... | | | etcs¹ | add a non-breaking space inside “и т. д.” and “и т. п.” | и т. д. | и&nbsp;т.&nbsp;д.² | | hyphenatedWords¹ | wrap words with a hyphen in <nobr> tag | из-за | <nobr>из-за</nobr> | | initials¹ | wrap initials in <nobr> tag | В. И. Ленин | <nobr>В. И. Ленин</nobr> | | numberSigns¹ | add a non-breaking space between a number sign (№) and a number | № 3 | №&nbsp;3² | | numberUnits¹ | add a non-breaking space between a number and its unit | 2 кг | 2&nbsp;кг² | | orphans¹ | add a non-breaking space in front of the last word in a paragraph (line) | собака лучший друг | собака лучший&nbsp;друг² | | particles¹ | add a non-breaking space before particles | это ж как бы | это&nbsp;ж как&nbsp;бы² | | quotes¹ | transform dumb quotes (") to typography quotes («») | текст "в кавычках" | текст «в кавычках» | | sectionSigns¹ | add a non-breaking space between a section sign (§) and a number | § 3 | §&nbsp;3² | | shortWords¹ | add a non-breaking space after short words | в печали | в&nbsp;печали² |

¹ Recommended rules (see code examples above)

² &nbsp; is actually rendered as a symbol (\xA0), not an HTML entity. We use &nbsp; only in the docs for readability.