All Projects → curiositry → diaeresis

curiositry / diaeresis

Licence: MIT License
A lightweight (<1kb minified + gzipped) JavaScript library that lets you wield diæreses like C̶h̶u̶c̶k̶ Mary Norris:

Programming Languages

HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to diaeresis

Typeit
The most versatile JavaScript typewriter effect library on the planet.
Stars: ✭ 2,406 (+15940%)
Mutual labels:  typography, javascript-library
Typelighterjs
Take a stride into the world of dynamic and appealing typewriters. You can be sure that you will never even think of looking back.
Stars: ✭ 262 (+1646.67%)
Mutual labels:  typography, javascript-library
simple-crypto-js
Simplified AES cryptography for safer and easier encryption and decryption processes of any JavaScript objects.
Stars: ✭ 78 (+420%)
Mutual labels:  javascript-library
previewSlider
Responsive fullscreen image slider where the users are able to preview next/previous image when hovering over the navigation arrows.
Stars: ✭ 16 (+6.67%)
Mutual labels:  javascript-library
typeset.css
✍ tr.v. type·set To set (written material) into type; compose.
Stars: ✭ 19 (+26.67%)
Mutual labels:  typography
aioneframework
Aione Framework: All-in-one lightweight mobile first front-end framework to design websites, web applications, mobile applications, progressive web applications having large number of examples, documentation, tutorials, community support, components.
Stars: ✭ 13 (-13.33%)
Mutual labels:  javascript-library
xss-firewall
xss monitor and intercept
Stars: ✭ 16 (+6.67%)
Mutual labels:  javascript-library
handwrite
Handwrite generates a custom font based on your handwriting sample.
Stars: ✭ 235 (+1466.67%)
Mutual labels:  typography
validate-polish
Utility library for validation of PESEL, NIP, REGON, identity card etc. Aimed mostly at Polish enviroment. [Polish] Walidacja numerów pesel, nip, regon, dowodu osobistego.
Stars: ✭ 31 (+106.67%)
Mutual labels:  javascript-library
excel-date-to-js
Convert Excel date in integer format into JS date. Dates are stored as numbers in Excel and count the number of days since January 0, 1900 (1900 standard, for mac it is 1904, which means January 0, 1904 is the start date). Times are handled internally as numbers between 0 and 1.
Stars: ✭ 26 (+73.33%)
Mutual labels:  javascript-library
kironroy.github.io
Portfolio
Stars: ✭ 14 (-6.67%)
Mutual labels:  typography
ring-election
A node js library with a distributed leader/follower algorithm ready to be used
Stars: ✭ 92 (+513.33%)
Mutual labels:  javascript-library
validate
An extension to the popular library validate.js that adds some useful custom validations out of the box. Also, a hub for all custom validations, that we have created, so you can easily add them to your own project.
Stars: ✭ 31 (+106.67%)
Mutual labels:  javascript-library
huozi.js
A simple typography engine for CJK languages, especially designed for game rich-text. 用于游戏富文本的中日韩文字排印引擎。
Stars: ✭ 135 (+800%)
Mutual labels:  typography
nested-sort
Nested Sort is a JavaScript library which helps you to sort a nested list of items via drag and drop.
Stars: ✭ 31 (+106.67%)
Mutual labels:  javascript-library
Tourney
3 axes/variable/no curves
Stars: ✭ 20 (+33.33%)
Mutual labels:  typography
pine
Responsive CSS Framework ( PineCSS )
Stars: ✭ 41 (+173.33%)
Mutual labels:  javascript-library
cerbero
Track your users interactions
Stars: ✭ 56 (+273.33%)
Mutual labels:  javascript-library
indexed-string-variation
Experimental JavaScript module to generate all possible variations of strings over an alphabet using an n-ary virtual tree
Stars: ✭ 16 (+6.67%)
Mutual labels:  javascript-library
afinn
Sentiment Analysis in Javascript using the AFINN Lexicon
Stars: ✭ 26 (+73.33%)
Mutual labels:  javascript-library

Diaeresis.js

A lightweight JavaScript library that lets you wield diæreses like Chuck Mary Norris.

→ Check out the Demo ←

Usage:

All you need to do is include the script in your page and initialize it (in this example, using the RawGit CDN so you don’t even have to download it):

<script src="https://cdn.rawgit.com/curiositry/diaeresis/master/diaeresis.min.js"></script>

<script>
  var d = new Diaeresis();
</script>

By default, it will run on the contents of #diaeresis, and use the small built-in dictionary. But you can change all that when you initialize it:

var d = new Diaeresis({
  selector: "myCustomId",
  dictionary: {
    "bronte": "brontë",
    "find": "replace"
  }
});

In the above example, diaeresis will run on the element with the ID #myCustomId, which is handy if you don't want to change your markup to include the Diaeresis ID. And in the above example, we define additional dictionary entries. The dictionary object you give Diaeresis when you initialize it gets merged into the default dictionary, but it takes priority. So you can add new items, or overwrite existing items. (For example: if you think that reëlect should be spelled with a hyphen, you could add a rule like this: "reelect": "re-elect", which would override the default rule that changes reelect to reëlect.)

You’ll probably want to run Diaeresis asynchronously, like this:

<script src="diaeresis.min.js" defer></script>
<script>
  document.addEventListener("DOMContentLoaded", function(event) {
    var d = new Diaeresis();
  }
</script>

Going wild

While the small, built-in dictionary only adds diaereses, the script itself is much more flexible. Here a few examples of other uses you could put it to:

  • Converting "dumb" quotes to “smart” quotes, fake (--) em-dashes to real em-dases (—), and other ersatz punctuation marks to their respective Unicode characters.

  • Adding other diacritical marks — such as acute (´ ) and grave (`) accents — to words that ought to have them but rarely do, such as “élite” and “résumé”.

  • Converting ASCII smiley faces to Unicode emoticons, and other symbols to their official Unicode character.

  • Adding fancy ligatures (diaeresis → diæresis, for example).

You can use diaeresis.js for any of the above just by adding custom rules to the “dictionary”:

var d = new Diaeresis({
  dictionary: {
    "--": "—",
    "elite": " élite",
    "<3": "❤",
    "diaeres": "diæres"
  }
});

(And Diaeresis supports regular expressions, if you want to get fancy.)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].