Skip to content

Commit

Permalink
* Enhance documentation (serve minified hyphenopoly in [https://mnate…
Browse files Browse the repository at this point in the history
…r.github.io/Hyphenopoly/min/](https://mnater.github.io/Hyphenopoly/min/) and move examples to examples directory) (issue #104)

*   exclude .DS_Store from npm package
*   bumpDevDependencies

Fixes #104
  • Loading branch information
mnater committed Mar 31, 2020
1 parent 482981c commit 983f5a9
Show file tree
Hide file tree
Showing 131 changed files with 5,931 additions and 741 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Version History

## Version 4.2.1 (2020-03-31)
### Fixed
* Enhance documentation (serve minified hyphenopoly in [https://mnater.github.io/Hyphenopoly/min/](https://mnater.github.io/Hyphenopoly/min/) and move examples to examples directory) (issue #104)
* exclude .DS_Store from npm package
* bumpDevDependencies


## Version 4.2.0 (2020-03-27)
### Added
* Added support for Macedonian
Expand Down
2 changes: 1 addition & 1 deletion Hyphenopoly.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Hyphenopoly 4.2.0 - client side hyphenation for webbrowsers
* @license Hyphenopoly 4.2.1 - client side hyphenation for webbrowsers
* ©2020 Mathias Nater, Güttingen (mathiasnater at gmail dot com)
* https://github.com/mnater/Hyphenopoly
*
Expand Down
2 changes: 1 addition & 1 deletion Hyphenopoly_Loader.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Hyphenopoly_Loader 4.2.0 - client side hyphenation
* @license Hyphenopoly_Loader 4.2.1 - client side hyphenation
* ©2020 Mathias Nater, Güttingen (mathiasnater at gmail dot com)
* https://github.com/mnater/Hyphenopoly
*
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Place all code for Hyphenopoly at the top of the header (immediately after the `
You'll have to insert two script blocks. In the first block provide the initial configurations for Hyphenopoly_Loader as inline script. In the second block load Hyphenopoly_Loader.js as external script.
Also, don't forget to enable CSS hyphenation.

[Example](http://mnater.github.io/Hyphenopoly/example1.html):
[Example](http://mnater.github.io/Hyphenopoly/min/example.html):
```html
<!DOCTYPE html>
<html>
Expand Down
9 changes: 9 additions & 0 deletions docs/min/Hyphenopoly.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions docs/min/Hyphenopoly_Loader.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
Binary file added docs/min/patterns/af.wasm
Binary file not shown.
Binary file added docs/min/patterns/as.wasm
Binary file not shown.
Binary file added docs/min/patterns/be.wasm
Binary file not shown.
Binary file added docs/min/patterns/bg.wasm
Binary file not shown.
Binary file added docs/min/patterns/bn.wasm
Binary file not shown.
Binary file added docs/min/patterns/ca.wasm
Binary file not shown.
Binary file added docs/min/patterns/cop.wasm
Binary file not shown.
Binary file added docs/min/patterns/cs.wasm
Binary file not shown.
Binary file added docs/min/patterns/cy.wasm
Binary file not shown.
Binary file added docs/min/patterns/da.wasm
Binary file not shown.
Binary file added docs/min/patterns/de.wasm
Binary file not shown.
Binary file added docs/min/patterns/el-monoton.wasm
Binary file not shown.
Binary file added docs/min/patterns/el-polyton.wasm
Binary file not shown.
Binary file added docs/min/patterns/en-gb.wasm
Binary file not shown.
Binary file added docs/min/patterns/en-us.wasm
Binary file not shown.
Binary file added docs/min/patterns/eo.wasm
Binary file not shown.
Binary file added docs/min/patterns/es.wasm
Binary file not shown.
Binary file added docs/min/patterns/et.wasm
Binary file not shown.
Binary file added docs/min/patterns/eu.wasm
Binary file not shown.
Binary file added docs/min/patterns/fi.wasm
Binary file not shown.
Binary file added docs/min/patterns/fr.wasm
Binary file not shown.
Binary file added docs/min/patterns/fur.wasm
Binary file not shown.
Binary file added docs/min/patterns/ga.wasm
Binary file not shown.
Binary file added docs/min/patterns/gl.wasm
Binary file not shown.
Binary file added docs/min/patterns/grc.wasm
Binary file not shown.
Binary file added docs/min/patterns/gu.wasm
Binary file not shown.
Binary file added docs/min/patterns/hi.wasm
Binary file not shown.
Binary file added docs/min/patterns/hr.wasm
Binary file not shown.
Binary file added docs/min/patterns/hsb.wasm
Binary file not shown.
Binary file added docs/min/patterns/hu.wasm
Binary file not shown.
Binary file added docs/min/patterns/hy.wasm
Binary file not shown.
Binary file added docs/min/patterns/ia.wasm
Binary file not shown.
Binary file added docs/min/patterns/id.wasm
Binary file not shown.
Binary file added docs/min/patterns/is.wasm
Binary file not shown.
Binary file added docs/min/patterns/it.wasm
Binary file not shown.
Binary file added docs/min/patterns/ka.wasm
Binary file not shown.
Binary file added docs/min/patterns/kmr.wasm
Binary file not shown.
Binary file added docs/min/patterns/kn.wasm
Binary file not shown.
Binary file added docs/min/patterns/la.wasm
Binary file not shown.
Binary file added docs/min/patterns/lt.wasm
Binary file not shown.
Binary file added docs/min/patterns/lv.wasm
Binary file not shown.
Binary file added docs/min/patterns/mk.wasm
Binary file not shown.
Binary file added docs/min/patterns/ml.wasm
Binary file not shown.
Binary file added docs/min/patterns/mn-cyrl.wasm
Binary file not shown.
Binary file added docs/min/patterns/mr.wasm
Binary file not shown.
Binary file added docs/min/patterns/mul-ethi.wasm
Binary file not shown.
Binary file added docs/min/patterns/nb-no.wasm
Binary file not shown.
Binary file added docs/min/patterns/nl.wasm
Binary file not shown.
Binary file added docs/min/patterns/nn.wasm
Binary file not shown.
Binary file added docs/min/patterns/oc.wasm
Binary file not shown.
Binary file added docs/min/patterns/or.wasm
Binary file not shown.
Binary file added docs/min/patterns/pa.wasm
Binary file not shown.
Binary file added docs/min/patterns/pi.wasm
Binary file not shown.
Binary file added docs/min/patterns/pl.wasm
Binary file not shown.
Binary file added docs/min/patterns/pms.wasm
Binary file not shown.
Binary file added docs/min/patterns/pt.wasm
Binary file not shown.
Binary file added docs/min/patterns/rm.wasm
Binary file not shown.
Binary file added docs/min/patterns/ro.wasm
Binary file not shown.
Binary file added docs/min/patterns/ru.wasm
Binary file not shown.
Binary file added docs/min/patterns/sh-cyrl.wasm
Binary file not shown.
Binary file added docs/min/patterns/sh-latn.wasm
Binary file not shown.
Binary file added docs/min/patterns/sk.wasm
Binary file not shown.
Binary file added docs/min/patterns/sl.wasm
Binary file not shown.
Binary file added docs/min/patterns/sr-cyrl.wasm
Binary file not shown.
Binary file added docs/min/patterns/sv.wasm
Binary file not shown.
Binary file added docs/min/patterns/ta.wasm
Binary file not shown.
Binary file added docs/min/patterns/te.wasm
Binary file not shown.
Binary file added docs/min/patterns/th.wasm
Binary file not shown.
Binary file added docs/min/patterns/tk.wasm
Binary file not shown.
Binary file added docs/min/patterns/tr.wasm
Binary file not shown.
Binary file added docs/min/patterns/uk.wasm
Binary file not shown.
Binary file added docs/min/patterns/zh-latn-pinyin.wasm
Binary file not shown.
68 changes: 68 additions & 0 deletions docs/min/testsuite/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Hyphenopoly.js &ndash; Testsuite</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css">
body {
width:80%;
margin-left:10%;
margin-right:10%;
font: normal 11px Verdana;
line-height: 18px;
}
#template {
display: none;
}
#testframe {
visibility: hidden;
}
.passed {
color: green;
background-color: lime;
}
.failed {
color: maroon;
background-color: red;
}
.obsolete {
color: black;
background-color: silver;
}
.visual {
color: olive;
background-color: yellow;
}
.omitted {
color: grey;
background-color: black;
}
.testname {
display: inline-block;
width: 6em;
}
.result {
display: inline-block;
width: 5em;
}
ul {
list-style-type: none;
padding-left: 0px;
}
</style>
</head>
<body>
<h1>The Hyphenopoly Testsuite</h1>
<ul id="template">
<li>
<span class="testname"><a href="@file@">@file@</a></span>
<span class="result @result@">[@result@]</span>
<span class="desc">@desc@</span>
</li>
</ul>
<ul id="testresults">
</ul>
<iframe id="testframe" src=""></iframe>
<script src="testdriver.js"></script>
</body>
</html>
93 changes: 93 additions & 0 deletions docs/min/testsuite/test1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 001</title>
<script>
var Hyphenopoly = {
require: {
"en-us": "supercalifragilisticexpialidocious",
"hy": "ձայնավորձայնավոր"
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
function assert() {
var tests = 2;
var i = 1;
var test = "";
var ref = "";
var result = true;
var lang = "";
while (i <= tests) {
lang = document.getElementById("test" + i).lang;
if (Hyphenopoly.cf.langs[lang] === "CSS") {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed (CSS)</p>";
result = result && true;
} else {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result && true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = false;
}
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 1,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}

.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}

.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="index.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test2.html">Next&nbsp;&rarr;</a></div>

<h1>Test 001</h1>
<p id="desc">Hyphenate two texts – en-us (where CSS-hyphenation is mostly supported) and hy (where CSS-hyphenation is unsupported).</p>
<div id="result"></div>
<hr>
<h2>1: en-us</h2>
<p id="test1" class="test hyphenate" lang="en-us">A hyphenation algorithm is a set of rules that decides at which points a word can be broken over two lines with a hyphen.</p>
<p id="ref1" class="ref" lang="en-us">A hy&shy;phen&shy;ation al&shy;go&shy;rithm is a set of rules that de&shy;cides at which points a word can be bro&shy;ken over two lines with a hy&shy;phen.</p>

<h2>2: hy (Armenian)</h2>
<p id="test2" class="test hyphenate" lang="hy">Հայերենն ունի վեց ձայնավոր, մեկ կիսաձայն և երեսուն բաղաձայն հնչյուններ</p>
<p id="ref2" class="ref" lang="hy">Հա&shy;յե&shy;րենն ունի վեց ձայնա&shy;վոր, մեկ կի&shy;սա&shy;ձայն և ե&shy;րե&shy;սուն բա&shy;ղա&shy;ձայն հնչյուններ</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>

</body>
</html>
Loading

0 comments on commit 983f5a9

Please sign in to comment.