New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

rubi-text

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rubi-text

A concept component to improve pronunciation descriptions.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Rubi

Rubi characters are small superscript texts placed above or to the right of normal text. These characters are common in East Asian writings and serve a purpose in adding an extra pronunciation guide for unfamiliar readers. After seeing a twitter post by @mabelandtee, I developed a ReactJS concept component to deliver a similar result as Rubi characters, but for English.

Check out the Demo

For more information on Rubi Characters, check out this Wiki article

Example Render

Getting Started

Via NPM:

npm install rubi-text --save

Example Code

Copyable Code
import Rubi from 'rubi-text'

const App = () => <Rubi text="Kernel">Colonel</Rubi>

export default App

Properties

Proptypedefaultdescriptionrequired
textstringnoneYour rubi text above the normal textYes
childrenstringnoneYour normal textYes
sizestring"12px"Font size for your rubi textNo
offsetXnumber0Offset rubi text on X-axisNo
offsetYnumber0Offset rubi text on Y-axisNo
colorstring"initial"Color of your rubi textNo
alignstring"center"Aligns rubi textNo
justifybooleanfalseJustify Rubi text to width of normal textNo
lowerSpacingbooleanfalseJustify normal text to width of Rubi textNo
lowerCenterbooleanfalseCenters normal text to width of Rubi textNo
attachAfterstringnoneAdd string after each char in normal textNo

Be sure to check out the example folder to see these properties in action.

FAQ

Will this support other writing systems?

Not sure. I have some experience in multilingual websites, but I'm open to contributions.

Why the name "Rubi"? It's really similar to the "Ruby" programming language.

No relation. "Ruby" or "Rubi" is just what it's called. I could have gone for "Ruby" but yeah, I'm pretty certain that's been taken.

Why did you build this?

I liked the concept and figured myself and other people would find it useful.

HTML5 already exists?

It does! And we actually use that here for semantic correctness. This component essentially makes it look better to write in your code. We also add several additional properties to improve readability.

Do you profit from this?

Nope. Would appreciate a follow, though. Twitter | Twitch

My Rubi characters are overlapping?

The Rubi text will require that you have a line-height set for your content. I've found that line-height: 32px works best at minimum.

Does this support mobile?

It does.

This looks kind of weird?

Of course. This isn't a standard in English writing systems. But it certainly makes it more interesting.

Can I contribute to this?

Yep. Make that pull request.

License

MIT © Technopathic

FAQs

Package last updated on 14 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts