What is WikiMind?
An old-school, ultra minimal, no tracker, no dependencies PHP wiki. It is used on mindwi.se. Based on WikWiki and Slimdown. Only one file is required, no database and it was not designed to be highly configurable like WordPress, but instead focusing on speed and control on content. It all started in December 2019. Complete script is about 4 kilobytes and only 41 lines of code. The style is intentionally minimal, in perfect line with Motherfucking Website.
Current v2021.06: source.txt
Archived v2021.01 using HtmlUp: source-old.txt
How to use it
- Copy code in a new file index.php.
- Change website name $_N (line 5).
- Set password $_P (line 9) using bcrypt-generator (default is admin).
- Transfer to server.
- Browse to the specified file.
- Start typing with the syntax below.
Based on Markdown, but simplified to the bare minimum. Also displayed when you create a new page, nine rules easy to remember:
Title: one to six number sign (#) at the beginning of a line.
Emphasis/italic: one asterisk (*) before and after a word or a group of words.
Strong/bold: two asterisk () before and after a word or a group of words.
Unordered list: one asterisk and a space (* ) at the begining of a line.
Ordered list: A digit, a dot a space (1. ) at the beginning of a line.
Blockquote: A chevron and a space (> ) at the beginning of a line.
Internal page link: Use [page] (?name) without a space in-between.
External page link: Use [page] (URL) without a space in-between.
Horizontal line/rule: Three minus sign (---) on an empty line.
Contact me: info at mindwi.se.
What's new compared to WikWiki
- Responsive design;
- Simple Markdown parser;
- Password to edit;
- Internal link instead of WikiLink;
- Accesskey E to enter edit mode and save changes;
- Page deletion if emptied;
- Dark mode.
While WordPress, Bludit, and others are packed with features and themes, creating your own code to support the bare minimum is a personal challenge. Also, I appreciate the ultra-minimalist side which does not support themes, plugins, comments, social media, or multi-users, etc. It inspires me to learn to settle for less. Leo Babauta on his site mnmlist
taught me to remove anything that is not useful.
I believe in a better web, where we don't need an ultrafast connection to load thousand lines of useless codes just for the fun to track user and abuse of their ignorance to push down their throat more physical possessions by emptying their wallet.
It seems that perfection is attained not when there is nothing more to add, but when there is nothing more to remove.
-Antoine de Saint Exupéry
- 2021.07 (Not yet published): variable names reduced to a single letter, CSS optimized again. Removed the markdown syntax to translate _ to emphasis and __ to strong since it was conflicting with URLs.
- 2021.06: removed lines with a single bracket, CSS compressed, Slimdown class turned into regular functions, if shorthand used in functions, default directory now named w instead of wik. Down from 4296 to 3888 bytes.
- 2021.05: Code compressed even more by removing useless specs, longer var names, spaces, using shorthands whenever possible. Reducing the code from 4707 to 4296 bytes.
- 2021.04: Quote regex removed since blockquote is used instead, function to delete a page amended, variable for the website name now used as global in functions, strikethrough removed from syntax, code compressed and simplified quite a bit again.
- 2021.03: Minor fixes.
- 2021.02 (major release): A new milestone has been completed with a new markdown parser using Slimdown, ability to parse code removed for security and compatibility purposes. Code went from 8203 to 5704 bytes, and from 88 to 74 lines.
- 2021.01: Added autocomplete on password and autofocus on content in edit mode, few style changes (Verdana now default, minor cosmetic in edit mode).
- 2020.11: Reverted back to a more spaced out code, to 90 lines. Added a dark mode, fixed a bug with the first line of code displayed on a page that was not aligned with the following lines.
- 2020.10: Code went from 100 to 13 lines, size went from 7927 to 6267 bytes, just by compressing the code the maximum using PHP Minifier. To un-minify it, simply use a PHP formatter. I'm still looking to find a more simple and elegant Markdown parser to bring the code down under 6KB.
- 2020.09: Code now highly compressed, went from 173 to 100 lines. Size went from 8863 to 7927 bytes. We are approaching from the final version.
- 2020.08: One line removed in function e(), global variable calls removed (now transfered through the functions), home page name changed, div names reducted to a single letter.
- 2020.07: Lines to assign $_POST and $_GET removed, edit textarea adjusted to 100% (better for smartphone), CSS simplified, website name variable added on line 5.
- 2020.06: strong tags changed for b, \n added to clean HTML code generated, few code lines removed, placeholder added in edit textarea to display syntax (only when no content).
- 2020.05: CSS compressed, invisible characters removed, 2 functions modified.
- 2020.04: Few functions and if compacted to reduce entire code to 193 lines, lists of more than 9 items are now displayed correctly, few other minor changes.
- 2020.03: Bug fix blocking user to delete a page, one function removed because unused.
- 2020.02: Style change, div added to fix responsiveness.
- 2020.01: First public version.
- Lines starting with a numbers and a dot (like 2021.1) gets converted in a list.
- Line break and p tag have issues with multi-lines parsing. If 2 lines of text are not separated by an empty line, only one get the p tag. It should be treated as a br and within the same p tag.
- Unorganized list (ul) create a different ul tag for each line. regex101 will help.
- HTML tag are not restricted.
- Image cannot be added to page. (Internal image: Use ![img alt text] (path) without a space in-between. External image: Use ![img alt text] (URL) without a space in-between.)