A lightweight quine for simple, self-contained wikis (Also mirrored on GitHub: https://github.com/Alamantus/FeatherWiki) https://feather.wiki
Go to file
Robbie Antenesse df93405bb5 Bump version to 1.7.1 2023-10-24 13:00:44 -06:00
.github Create FUNDING.yml for GitHub 2023-05-08 12:15:46 -06:00
extensions Add table-of-contents.js extension (#114) 2023-07-31 17:51:46 +00:00
helpers Trim some more bytes 2023-10-24 12:36:02 -06:00
nests Add iacore's Deno nest 2023-05-10 17:58:19 +00:00
scripts Improve build script 2023-10-18 10:34:00 -06:00
views Move Markdown preview below buttons 2023-10-24 12:36:16 -06:00
.gitignore I use MacOS sometimes 2022-10-25 21:33:37 -06:00
LICENSE Ensure LICENSE contains exact copy of AGPLv3 2022-05-23 20:36:44 +02:00
README.md Trim some more bytes 2023-10-24 12:36:02 -06:00
index.css Rename pell to ed to save some more bytes 2023-10-21 12:26:36 -06:00
index.html Bird names are back! + add details for server builds 2022-10-26 13:55:46 -06:00
index.js Trim some more bytes 2023-10-24 12:36:02 -06:00
initEmitter.js Populate state.recent during ONLOAD event (#134) 2023-10-23 21:21:38 -06:00
initState.js Populate state.recent during ONLOAD event (#134) 2023-10-23 21:21:38 -06:00
logo.svg Add logo svg 2022-04-14 16:19:40 -06:00
nanochoo.js Add FW.ready for document.ready detection 2023-10-24 12:18:47 -06:00
package-lock.json Bump version to 1.7.1 2023-10-24 13:00:44 -06:00
package.json Bump version to 1.7.1 2023-10-24 13:00:44 -06:00

README.md

Feather Wiki

A 55.929 kilobyte quine for simple, self-contained wikis! The idea is that it's like TiddlyWiki but as small as possible.

Check out the Documentation to see it in action and learn how to use it!

Versions

Feather Wiki has two primary builds depending on your needs, Wren for everyday use and Warbler for web servers to trigger a save if set up correctly. The vast majority of people will likely only use Wren—if you don't plan on setting up a web server that can support saving the HTML file over the existing file directly on the server, then you're the majority of people.

Both of these builds have an alternative "ruffled" option that uses less minification to allow for better compatibility with certain web browsers at the cost of a couple of extra kilobytes in size. If you're not able to get Feather Wiki running in your browser of choice, give the ruffled option a try. All builds can be found on the website or on the repository's Releases page.

Feather Wiki's CSS and JavaScript files are also available separately for each version, but it is important to note that the JavaScript currently expects both its code and the CSS to be on the HTML page that is loaded in full in order to save! Specifically, the contents of the .js file must be in the HTML output inside of a <script id="a"> script tag with the id as specified (a), and the contents of the .css must be in the HTML output inside of a <script id="s"> style tag with the id as specified (s). If you don't need to save your wiki, then you don't need to do this.

Feather Wiki will only run on browsers that support ECMAScript 2015 (also known as ES6) features.

👨‍💻 Technical Talk: Supported Browsers

According to this ECMAScript compatibility table, the following browser versions should definitely be able to run Feather Wiki version 1.3.0 and up without issues:

  • Chrome 86+
  • Edge 87+
  • Firefox 88+
  • iOS Safari 12+
  • Opera 73+
  • Opera Mobile 62+
  • Safari 13+
  • Samsung Internet for Android 12+

The chart linked above is incomplete, so if your browser is older than any of these, you might still be able to run Feather Wiki, but you'll have to check yourself if it supports features from ECMAScript 2015 (also known as ES6).

Server-Saving

Warbler is the server build of Feather Wiki, and it is exactly the same as Wren except that it is larger (56.923 kilobytes) because it includes extra code for saving to certain web servers.

You can use this version on Tiddlyhost or by using a self-hosted nest from this repository!

Server Setup

Warbler expects a dav header with any value to be returned by an OPTIONS call to the server at the same address as the Feather Wiki file is served. If the server looks compatible, Feather Wiki will display a new "Save Wiki to Server" button above a "Save Wiki Locally" button.

When the user clicks the "Save Wiki to Server" button, Feather Wiki will send a PUT request to the server with a body that contains the full HTML output of the Feather Wiki file that would normally be downloaded to the computer. If you want password protection on your wiki (and I think you should), then you'll need to implement that in a way that the server can understand, whether by having the user log in on a different page and saving to a domain cookie or by using basic HTTP auth—the choice is yours.

After sending to the server, Feather Wiki expects either a success or failed response with an optional text message as the body to explain a failure. If not text is returned in the response body on a failure, it will simply display the status code in a message box, eg. "Save Failed! Status 403." On success, Feather Wiki will display "Saved."

Contribution

For anyone

If you have a request to either add to or improve Feather Wiki or your have encountered a problem not related to browser compatibility, I encourage you to first browse the current issues and create a new issue with the details only if one regarding your topic doesn't already exist, and I will try to reply promptly and add an appropriate label. I reserve the right to deny requests, but if a given request garners enough interest, I'll be much more likely to consider it!

The observant among you may have noticed that there is a mirror on GitHub (if that's where you're reading this, hello to you!). I will review Issue tickets from the GitHub mirror, but I request that you submit make an attempt to submit them to the Codeberg repository if at all possible. I will not be monitoring the GitHub repo closely, though I should receive email notifications.

For coders

Feel free to fork this repo and submit pull requests to have your changes or additions reviewed! I might ask for changes to make the output smaller or improve organization, but as above, I also reserve the right to deny changes outright in favor of a future plugin/code extension system that allows users to inject their own code into their Feather Wiki instead of including it in the base.
The observant among you may have noticed that there is a mirror on GitHub (if that's where you're reading this, hello to you!). I will review pull requests from the GitHub mirror, but I request that you submit make an attempt to submit your pull requests to the Codeberg repository if at all possible. I will not be monitoring the GitHub repo closely, though I should receive email notifications.

Development

Feather Wiki uses only a few JavaScript libraries to function on the front end, but it requires more to develop.

To get your computer set up to develop:

  1. Install Git
  2. Install Node
  3. Use a command line or terminal
  4. Clone the git repo with git clone https://codeberg.org/Alamantus/FeatherWiki.git
  5. Navigate to your cloned repo cd FeatherWiki
  6. Run npm install
  7. Run npm start and visit http://localhost:3000 in your browser
  8. Start making changes to the JavaScript to update your build—you will need to refresh your browser to see your changes
  • Note: Changing the CSS doesn't automatically update the build, so you'll need to modify some JS or restart the script to see those changes

When you're ready to build, simply use the npm run build to build all versions of Feather Wiki at once!

To test a build, you can use npm test to build all versions and serve the Server build on a local server. The test script will allow Feather Wiki to use the "Save Wiki to Server" button—the output gets saved to develop/put-save.html if you need to check it.

Details

Feather Wiki uses a modified version of Choo as its base JavaScript framework, a subset of JSON-Compress for minifying JSON output, a customized pell for its HTML editor, and a greatly customized md.js for its Markdown parsing.

If you want to restrict a feature to one build or another (which I request you do if it's only specific to the regular or server build), use process.env.SERVER in an if statement to ensure that esbuild removes the code on build for the irrelevant versions. It will be auto-populated with true or false during the build process.

The overarching goal is to keep Feather Wiki as small as possible while still providing the most important features. Unfortunately, that's a pretty loose and fluid goal, but as long as you keep "as small as possible" in mind, you probably won't go too far astray.

License Clarification

Feather Wiki is an HTML document containing a self-replicating JavaScript application for creating wiki-style websites whose content is also stored in the output.
Copyright (C) 2022 Robbie Antenesse <dev@alamantus.com>

Feather Wiki is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Any content created by a user using any version of Feather Wiki is the property of its creator. User-created data and the replicated copies of Feather Wiki containing user-created data can be used and distributed however their creator see fit. The GNU Affero General Public License applies to the code that constitutes the Feather Wiki application and NOT the content created by users of Feather Wiki unless explicitly stated by the user within their own content.

Feather Wiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

A copy of the GNU Affero General Public License is included in the source code of Feather Wiki. If not, see https://www.gnu.org/licenses/.