wiki

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit f121199de5c3850d07143ca267d39ce3c1af359b
parent a7c5526bf816ee8ead1e7bd2651f76bc854066e9
Author: Alisa Lain <60989682+al1-ce@users.noreply.github.com>
Date:   Sun, 13 Jul 2025 05:11:39 +0300

improve furigana support, add new articles

Diffstat:
Mpublic/404.html | 6+++---
Mpublic/_404.md | 7+++++++
Mpublic/all_pages.md | 4++--
Mpublic/index.html | 85++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
Mpublic/js/plugins/wikilink.js | 6+++++-
Mpublic/meta/maintenance.md | 5+++--
Mpublic/meta/markdown_flavour.md | 20++++++++++++++------
Mpublic/meta/style_guidelines.md | 2++
Mpublic/meta/style_test.md | 38++++++++++++++++++++++----------------
Mpublic/wiki/aa.md | 2+-
Apublic/wiki/html_entities.md | 109+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mpublic/wiki/html_furigana.md | 50+++++++++++++++++++++++++++++++++++---------------
Mpublic/wiki/kagai_nihongo.md | 25+++++++++++++++++--------
Mpublic/wiki/vim_digraphs.md | 2++
14 files changed, 306 insertions(+), 55 deletions(-)

diff --git a/public/404.html b/public/404.html @@ -24,9 +24,9 @@ <body> <div class="block heavy wide"> <br> - <h1 class="upper glitch">Error: 404</h1><br> - <h2 class="glitch">You've strayed from a set path.</h2> - <a href="/">Go Back?</a> + <h1 class="upper">Error: 404</h1><br> + <h2>Unable to find requested resource.</h2> + <a href="/">Go Home?</a> </div> <script src="/js/index.js"></script> diff --git a/public/_404.md b/public/_404.md @@ -1,5 +1,11 @@ <h2><center id="page-404-title-center">404 - Page not found</center></h2> +<hr> + <center>You can <a href="" id="page-404-create-new-article">create it</a>.</center> +<br> + <center>Return to <a href="/">home</a>?</center> + +<hr> +\ No newline at end of file diff --git a/public/all_pages.md b/public/all_pages.md @@ -1,6 +1,6 @@ |||| |:-|:-|:-| -|[aa](wiki/aa.md)|[maintenance](meta/maintenance.md)|[style_guidelines](meta/style_guidelines.md)| +|[aa](wiki/aa.md)|[kagai_nihongo](wiki/kagai_nihongo.md)|[recursion](wiki/recursion.md)| +|[html_entities](wiki/html_entities.md)|[maintenance](meta/maintenance.md)|[style_guidelines](meta/style_guidelines.md)| |[html_furigana](wiki/html_furigana.md)|[markdown_flavour](meta/markdown_flavour.md)|[style_test](meta/style_test.md)| |[index](/)|[options](meta/options.md)|[vim_digraphs](wiki/vim_digraphs.md)| -|[kagai_nihongo](wiki/kagai_nihongo.md)|[recursion](wiki/recursion.md)| diff --git a/public/index.html b/public/index.html @@ -255,6 +255,14 @@ color: #D00 !important; text-decoration: underline; } + + rt { + font-size: 0.5em; + /* border: 1px solid transparent; */ + } + rt:hover { + /* border: 1px dashed var(--mono-tint1); */ + } </style> <nav id="app-nav" class="app-nav"> <a id="nav-home" href="/">Home</a> @@ -343,10 +351,49 @@ // Invoked on each page load before new markdown is transformed to HTML. // Supports asynchronous tasks (see beforeEach documentation for details). // hook.beforeEach(function (markdown) {return markdown;}); + hook.beforeEach(function(markdown, next) { + const out = markdown.replace(/\\+%{([^{}]+)}/g, function(content) { + if (content.startsWith("\\\\")) return content.substr(1); + const innerContent = content.replace('\\%{', '').replace('}', ''); + const itext = innerContent.split(/(?<!\\)\\=/); + let t = innerContent; + let o = "<ruby>"; + if (itext.length == 2) { + t = itext[0]; + o = `<ruby title="${itext[1].replaceAll(/"/g, "&quot;")}">`; + } + let p = ''; + let f = false; + for (let c of t) { + if (c == "<") c = "&lt;"; + if (c == ">") c = "&gt;"; + if (c == '(' && p != '\\') { + o += "<rp>(</rp><rt>"; + f = true; + } else + if (c == ')' && p != '\\' && f == true) { + o += "</rt><rp>)</rp>"; + f = false; + } else + if (c == '\\') { /* do nothing, next if */ } else + if (p == '\\' && (c != '(' && c != ')')) { + o += p + c; + } else { + o += c; + } + p = c; + } + o += "</ruby>"; + o.replaceAll("<rp>(</rp><rt></rt><rp>)</rp>", "<rt></rt>"); + return o; + }); + + next(out); + }); // Invoked on each page load after new markdown has been transformed to HTML. // Supports asynchronous tasks (see afterEach documentation for details). - hook.afterEach(function (html) {return html;}); + // hook.afterEach(function (html) {return html;}); // Invoked on each page load after new HTML has been appended to the DOM hook.doneEach(function() { @@ -384,6 +431,42 @@ for (let e of document.querySelectorAll("blockquote > blockquote > p")) { e.innerHTML = ">" + e.innerHTML; } + + let fg_output = document.getElementById("furigana-output"); + let fg_input = document.getElementById("furigana-input"); + + if (fg_input != null && fg_output != null) { + function process_furigana() { + let t = fg_input.value; + let o = "<ruby>"; + let p = ''; + let f = false; + for (let c of t) { + if (c == "<") c = "&lt;"; + if (c == ">") c = "&gt;"; + if (c == '(' && p != '\\') { + o += "<rp>(</rp><rt>"; + f = true; + } else + if (c == ')' && p != '\\' && f == true) { + o += "</rt><rp>)</rp>"; + f = false; + } else + if (c == '\\') { /* do nothing, next if */ } else + if (p == '\\' && (c != '(' && c != ')')) { + o += p + c; + } else { + o += c; + } + p = c; + } + o += "</ruby>"; + o.replaceAll("<rp>(</rp><rt></rt><rp>)</rp>", "<rt></rt>"); + fg_output.innerHTML = o; + }; + fg_input.addEventListener("input", process_furigana); + process_furigana(); + } }); // Invoked one time after rendering the initial page diff --git a/public/js/plugins/wikilink.js b/public/js/plugins/wikilink.js @@ -30,7 +30,11 @@ function plugin(hook, vm) { const linkTopicSps = link.split('#'); // link, topic hashPath = linkTopicSps[0]; topic = `?id=${linkTopicSps[1]}`; - showText = `${linkAliasSps[1].trim()}`; + if (linkAliasSps.length == 1) { + showText = `${hashPath.trim()}`; + } else { + showText = `${linkAliasSps[1].trim()}`; + } } if (showText.split("|").length == 2) { showText = showText.split("|")[1]; } hashPath = hashPath.replaceAll(' ', '_').toLowerCase(); diff --git a/public/meta/maintenance.md b/public/meta/maintenance.md @@ -2,16 +2,17 @@ This article is a list of things/features I need to do/implement. - To add: - bottom "wikihub" table syntax - Footnotes - Special "citation needed" footnote style +- Title syntax `<tag title="asdf">` or a "click/hover translation" To do: +- add escaping for inline formatting, wikilinks and header redirects +- add &#91;[multipl]]e <- incorporating attached ending (e) into link --- See also: -- [[maintenance]] diff --git a/public/meta/markdown_flavour.md b/public/meta/markdown_flavour.md @@ -1,18 +1,18 @@ # wiki@al1-ce markdown flavour +This article is a stub and is dependant on [[maintenance]] + ## Wikilinks -```md -[[Direct Link]] +- &#91;[Direct Link]] - links to direct_link article in current directory - https://wiki.al1-ce.dev/CURRENT_DIR/direct_link -[[Direct Link|Custom text]] +- &#91;[Direct Link|Custom text]] - same as above but with custom text -[[Direct Link#Header]] +- &#91;[Direct Link#Header]] - same as above but linking to certain header -[[/meta/Style Guidelines|Style Guidelines]] +- &#91;[/meta/Style Guidelines|Style Guidelines]] - same as above but using absolute path - https://wiki.al1-ce.dev/meta/style_guidelines -``` ## Inline code More of a way to colour (TODO add actual color syntax) normal text @@ -38,3 +38,11 @@ Syntax (`\@` replace with `@`) [link to that header](#replace-with-this-id) ``` +## Furigana + +See [[/wiki/html_furigana|HTML furigana]]. + +```md +\\%{furigana(input)} +\\%{furigana(input)\=title} +``` diff --git a/public/meta/style_guidelines.md b/public/meta/style_guidelines.md @@ -1,5 +1,7 @@ # Style Guidelines +This article is a stub + This is an article about article style guidelines. For now there is at least one: diff --git a/public/meta/style_test.md b/public/meta/style_test.md @@ -59,7 +59,7 @@ Numbered list - striked ~~striked~~ striked - highlighted ==highlighted== highlighted - subscript ~sub~script subscript -- superscript ^super^script superscript +- superscript ^super^script superscript ## Lines @@ -91,14 +91,6 @@ ___ int main(int argc, char **argv) { return 0; } ``` - -```aa -AA (Shift JIS) -|     .|\|/ |     |   .| -| ∧∧.|/⌒ヽ、| ∧_∧ .| ∧∧ | -|(,,゚Д゚)||,,゚ Θ゚)|(; ´Д`)|(=゚ω゚)| -``` - ## Images Markdown image @@ -141,20 +133,33 @@ Here's a simple footnote,a[^1] and here's a longer one.[^bignote] | Header | Title | Here's this | | Paragraph | Text | And more | -## Custom header ID's - -### My Great Heading {#custom-id} -- [Markdown link](#custom-id) -- [[#custom-id|Wiki link]] - ## Misc - [x] done - [ ] todo -- Auto-emoji :joy: +- Auto-emoji :gun: !> Warning ?> Info +## Custom + +```aa +AA (Shift JIS) +|     .|\|/ |     |   .| +| ∧∧.|/⌒ヽ、| ∧_∧ .| ∧∧ | +|(,,゚Д゚)||,,゚ Θ゚)|(; ´Д`)|(=゚ω゚)| +``` + +- Furigana \%{this is a(tis is ah) test(test)} \%{今(い)まで。。。}\%{先(せん)生(せい)} test +- Inline style {@k void} {@f main}({@k int} argc, {@k char} **argv) { {@k return} {@n 0}; } {@c //} a {@t FIXME}{@c :} {@s utterly broken} + +## Custom header ID's + +Is an actual extension but was missing from parser so had to implement it myself + +### My Great Heading {#custom-id} +- [Markdown link](#custom-id) +- [[#custom-id|Wiki link]] +\ No newline at end of file diff --git a/public/wiki/aa.md b/public/wiki/aa.md @@ -1,6 +1,6 @@ # AA (Shift-JIS art) -TODO +This article is a stub ## Test diff --git a/public/wiki/html_entities.md b/public/wiki/html_entities.md @@ -0,0 +1,108 @@ +# HTML Entities + +This article is a stub + +ISO 8859-1 Characters +Full list of supported ISO-8859-1 characters. Notice that the names are case sensitive, hence if you want an uppercase letter, the name should also start with an uppercase letter. + +``` +┌────────┬──────────────┬────────────────┬────────────────── +│Character Entity Name Entity Number Description +├────────┼──────────────┼────────────────┼────────────────── +│ │ │ &#32; │ Space +│! │ │ &#33; │ Exclamation mark +│" │ │ &#34; │ Quotation mark +│# │ │ &#35; │ Number sign +│$ │ │ &#36; │ Dollar sign +│% │ │ &#37; │ Percent sign +│& │ &amp; │ &#38; │ Ampersand +│' │ │ &#39; │ Apostrophe +│( │ │ &#40; │ Opening/Left Parenthesis +│) │ │ &#41; │ Closing/Right Parenthesis +│* │ │ &#42; │ Asterisk +│+ │ │ &#43; │ Plus sign +│, │ │ &#44; │ Comma +│- │ │ &#45; │ Hyphen +│. │ │ &#46; │ Period +│/ │ │ &#47; │ Slash +│0 │ │ &#48; │ Digit 0 +│1 │ │ &#49; │ Digit 1 +│2 │ │ &#50; │ Digit 2 +│3 │ │ &#51; │ Digit 3 +│4 │ │ &#52; │ Digit 4 +│5 │ │ &#53; │ Digit 5 +│6 │ │ &#54; │ Digit 6 +│7 │ │ &#55; │ Digit 7 +│8 │ │ &#56; │ Digit 8 +│9 │ │ &#57; │ Digit 9 +│: │ │ &#58; │ Colon +│; │ │ &#59; │ Semicolon +│< │ &lt; │ &#60; │ Less-than +│= │ │ &#61; │ Equals sign +│> │ &gt; │ &#62; │ Greater than +│? │ │ &#63; │ Question mark +│@ │ │ &#64; │ At sign +│A │ │ &#65; │ Uppercase A +│B │ │ &#66; │ Uppercase B +│C │ │ &#67; │ Uppercase C +│D │ │ &#68; │ Uppercase D +│E │ │ &#69; │ Uppercase E +│F │ │ &#70; │ Uppercase F +│G │ │ &#71; │ Uppercase G +│H │ │ &#72; │ Uppercase H +│I │ │ &#73; │ Uppercase I +│J │ │ &#74; │ Uppercase J +│K │ │ &#75; │ Uppercase K +│L │ │ &#76; │ Uppercase L +│M │ │ &#77; │ Uppercase M +│N │ │ &#78; │ Uppercase N +│O │ │ &#79; │ Uppercase O +│P │ │ &#80; │ Uppercase P +│Q │ │ &#81; │ Uppercase Q +│R │ │ &#82; │ Uppercase R +│S │ │ &#83; │ Uppercase S +│T │ │ &#84; │ Uppercase T +│U │ │ &#85; │ Uppercase U +│V │ │ &#86; │ Uppercase V +│W │ │ &#87; │ Uppercase W +│X │ │ &#88; │ Uppercase X +│Y │ │ &#89; │ Uppercase Y +│Z │ │ &#90; │ Uppercase Z +│[ │ │ &#91; │ Opening/Left square bracket +│\ │ │ &#92; │ Backslash +│] │ │ &#93; │ Closing/Right square bracket +│^ │ │ &#94; │ Caret +│_ │ │ &#95; │ Underscore +│` │ │ &#96; │ Grave accent +│a │ │ &#97; │ Lowercase a +│b │ │ &#98; │ Lowercase b +│c │ │ &#99; │ Lowercase c +│d │ │ &#100; │ Lowercase d +│e │ │ &#101; │ Lowercase e +│f │ │ &#102; │ Lowercase f +│g │ │ &#103; │ Lowercase g +│h │ │ &#104; │ Lowercase h +│i │ │ &#105; │ Lowercase i +│j │ │ &#106; │ Lowercase j +│k │ │ &#107; │ Lowercase k +│l │ │ &#108; │ Lowercase l +│m │ │ &#109; │ Lowercase m +│n │ │ &#110; │ Lowercase n +│o │ │ &#111; │ Lowercase o +│p │ │ &#112; │ Lowercase p +│q │ │ &#113; │ Lowercase q +│r │ │ &#114; │ Lowercase r +│s │ │ &#115; │ Lowercase s +│t │ │ &#116; │ Lowercase t +│u │ │ &#117; │ Lowercase u +│v │ │ &#118; │ Lowercase v +│w │ │ &#119; │ Lowercase w +│x │ │ &#120; │ Lowercase x +│y │ │ &#121; │ Lowercase y +│z │ │ &#122; │ Lowercase z +│{ │ │ &#123; │ Opening/Left curly brace +│| │ │ &#124; │ Vertical bar +│} │ │ &#125; │ Closing/Right curly brace +│~ │ │ &#126; │ Tilde +└────────┴──────────────┴────────────────┴────────────────── +``` +\ No newline at end of file diff --git a/public/wiki/html_furigana.md b/public/wiki/html_furigana.md @@ -1,6 +1,6 @@ # HTML furigana -For providing furigana (kana on top of <ruby>世界<rp>(</rp><rt>せかい</rt><rp>)</rp></ruby>) for kanji or similar style markup `<ruby>`[^1] tag can be used. +For providing furigana (kana on top of \%{世界(せかい)}) for kanji or similar style markup `<ruby>`[^1] tag can be used. Structure of `<ruby>` tag might seem complicated at first but it's rather simple when you learn what each tag does. @@ -25,16 +25,7 @@ Each of lines provides certain function, `<ruby>` tag itself wraps the furigana, If one would want to split furigana between kanji it can be easily done inside a single tag. -<ruby title="World"> - 世 - <rp>(</rp> - <rt>せ</rt> - <rp>)</rp> - 界 - <rp>(</rp> - <rt>かい</rt> - <rp>)</rp> -</ruby> +\%{世(せ)界(かい)\=World} ```html @@ -50,12 +41,41 @@ If one would want to split furigana between kanji it can be easily done inside a </ruby> ``` +## Furigana input (for any reasons) + +How to use (`input` - output): +- text - \%{text} +- text(te) - \%{text(te)} +- text\\(te) - \%{text\(te)} +- text(\\(te)) - \%{text(\(te))} +- text(\\(te\\)) - \%{text(\(te\))\=Notice the escaped second paren} +- text(a)word()after(b) - \%{text(a)word()after(b)} + +<input placeholder="Input text" id="furigana-input" value="世(せ)界(かい)"></input> + +<p id="furigana-output"></p> + <style> -rt { -font-size: 0.5em; -} + #furigana-output { + text-align: center; + font-size: 5rem; + min-height: 12.5rem; + border: 1px solid var(--mono-tint2); + margin: 0.5em 0; + padding: 0.75em 0.5em 0.5em 0.5em; + background: white; + color: black; + } + + #furigana-input { + text-align: left; + width: 80%; + margin-left: 10%; + } </style> -TODO: add furigana styling to index.html +## Notes + +This wiki however provides easier syntax for furigana, same rules as in above `Furigana input` section apply while input has to be wrapped into `\\%{input here}` or `\\%{input here\=title}`, see [[/meta/markdown_flavour|Markdown flavour]]. [^1]: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/ruby diff --git a/public/wiki/kagai_nihongo.md b/public/wiki/kagai_nihongo.md @@ -1,15 +1,24 @@ # Kagai nihongo (moon. foreign japanese) -An unnamed phenomenon, most likely brought by [[imageboards]], where [[anon|anons]] incorporate select japanese words into his speech. +An unnamed phenomenon, most likely brought by [[imageboards]], where [[anon|anons]] incorporate select japanese words into their speech. Notable examples: -- daijoubu - "not daijoubu", "it's daijoubu", replacement for "ok" -- desu - desu desu desu, a topic finisher, used everywhere -- genki - 200% genki, means healthy, active -- keikaku - just according to keikaku (plan) -- sasuga - "as expected of", "even the [...]" -- seiso - pure (proof needed) -- senpai - upperclassman, be it school class or social class +- \%{大丈夫(だいじょうぶ)}, daijoubu + - "not daijoubu", "it's daijoubu", replacement for "ok", "fine" +- \%{です}, desu + - desu desu desu, a topic finisher, used everywhere +- \%{元(げん)気(き)}, genki + - 200% genki, means healthy, active. Usually used when somebody is hyperactive +- \%{計(けい)画(かく)}, keikaku + - just according to keikaku (plan), originated from Death Note eng. dub +- \%{さすが}, sasuga + - "as expected of", "even the [...] could X". さすがに○○\%{先生(せんせい)!}, as expected of Mr. XX +- \%{せいそ}, seiso + - eng. slang that came from \%{清楚(せいそ)\=clean, tidy} and is used when referring to [[vtuber|Vtubers]]. +- \%{せんぱい}, senpai + - upperclassman, be it school class or social class +- \%{先(せん)生(せい)}, sensei + - teacher, used either towards teachers or "role models" --- diff --git a/public/wiki/vim_digraphs.md b/public/wiki/vim_digraphs.md @@ -1,5 +1,7 @@ # Vim digraphs +This article is a stub + [[Vim]] provides an easy way to input printable non-ascii (usually unicode) characters with digraphs[^1]. Example: