DEV Community

Cover image for 1.5KB Single-File Wiki

1.5KB Single-File Wiki

Fedor on March 01, 2025

Imagine having a personal wiki that fits in a single HTML file — no databases, no servers, just a self-contained knowledge base you can store in Dr...
Collapse
 
justov_pinkton_841202b528 profile image
Justov Pinkton

This is great! I LOVE TW but this could be useful on my phone, where I want a VERY minimal interface etc. and don't need anything complex, just quick note taking.

I'm no JS guru - I'm trying to add


to the md2html and it's driving me crazy. It APPEARS I'm following the pattern of the other inline rules, but it just isn't working. Here's my update to the inlines:
const inlines = [
[
  /(\*{1,2}|~~|`)(.+?)\1/g,
  (_, c, txt) =>
    c == "*"
      ? `<i>${txt}</i>`
      : c == "**"
      ? `<b>${txt}</b>`
      : c == "__"
      ? `<hr/>`
      : c == "~~"
      ? `<s>${txt}</s>`
      : `<code>${enchtml(txt)}</code>`,
],
Enter fullscreen mode Exit fullscreen mode

Anyone see what I'm missing?

Great idea, and thanks in advance!

Collapse
 
fedia profile image
Fedor

Here's a casual way you could do that: chatgpt.com/share/67d495a0-3228-80...

Collapse
 
justov_pinkton_841202b528 profile image
Justov Pinkton

Ahh within the blocks section... that makes sense. eesh.
And thanks for expanding to ---, ***, ___.
I guess I could have hit my AI friend up on this hehe

I was just going with ___ testing to see if there was a conflict with ---

That update works!

Thanks!

Collapse
 
deuxlames profile image
deuxlames

That's incredible. I tried tiddlywiki may be 20 years ago :-) and a few days ago i was looking for a markdown wiki that doesn't need a server. Something simple and bingo in my mailbox today !

I'm going to try right now !

Collapse
 
artydev profile image
artydev

Great, thank you :)

Collapse
 
destynova profile image
Oisín

Very neat! I'm not sure how saving changes works if you don't have Javascript enabled, though.

Collapse
 
urbanisierung profile image
Adam

I love such simple no-dependency and simple ideas! Thanks!

Added it to the next issue of weeklyfoo.com.

Collapse
 
joebordes profile image
Joe Bordes

wonderful piece of software! recommendable

Collapse
 
detlef_meyer_99a6d7a7deed profile image
Detlef Meyer

Thanks for sharing. How am I supposed to understand this: "Feel free to take the code, tweak it, and make it your own. After all, the best tools are the ones you build yourself."
Is this an Unlicense (unlicense.org/)?

Collapse
 
katafrakt profile image
Paweł Świątkowski

It's licensed under MIT according to package.json contents.

Collapse
 
fedia profile image
Fedor

Right, it's MIT. Thank you!

Collapse
 
best_codes profile image
Best Codes

This is very cool! I don't think back / forward navigation works, though.

Collapse
 
fedia profile image
Fedor

Seems to be a Codesandbox issue with hash-based nav...

Collapse
 
best_codes profile image
Best Codes • Edited

Oh, so it does work, CodeSandbox is the issue! 👍

Collapse
 
mhvelplund profile image
Mads Hvelplund

This is pretty neat. It's a pity that it stores all the text twice, once in HTML and once in Markdown, but I'm guessing that is a performance thing?