An Electron desktop application for TiddlyWiki on Node.js
TiddlyWiki
A non-linear personal web notebook that anyone can use and keep forever, independently of any corporation.
-
Install Node.js and npm
-
npm install tiddlywiki -g
-
Check your installation
tiddlywiki --version
You can see installed version of TiddlyWiki if OK.
-
Create your Wiki, remember to change the name
mynewwiki
to what you want!cd /path/to/store/your/wiki tiddlywiki mynewwiki --init server
-
Optional: You can run your Wiki now if you want to try out.
tiddlywiki mynewwiki --server
Visit http://127.0.0.1:8080/ in your browser
-
npm install electron -g
-
Install electron-packager globally
npm install electron-packager -g
-
Clone this repository
cd /path/to/store git clone https://github.com/oxdc/tiddly cd tiddly
-
Install dependencies
npm install
-
Copy the
config-example.js
as a new file calledconfig.js
cp ./config-example.js ./config.js
-
Edit the configuration attributes
vim ./config.js
const configuration = { host: '127.0.0.1', // localhost or 0.0.0.0 for web access port: 8080, // tiddlywiki server port /* You must change this path to your wiki's absolute path */ wikiDir: '/absolute/path/to/your/wiki', /* NOTE: If you delete two lines below, your wiki site will be open to all! Anyone can visit and edit without login! */ username: 'user', // CHANGE ME OR DELETE !! password: 'passw0rd', // CHANGE ME OR DELETE !! /* If true, you won't need to enter your password each time you open this application. */ autoLogin: true, /* Optional If true, Tiddly will launch the Content Server. You can access your files through it and never need to import all of them into your wiki. */ enableContentServer: false }
-
Optional: Edit the Tiddly Content Server
vim ./config.js
const configuration = { host: '127.0.0.1', // localhost or 0.0.0.0 for web access port: 8080, // tiddlywiki server port /* You must change this path to your wiki's absolute path */ wikiDir: '/absolute/path/to/your/wiki', /* NOTE: If you delete two lines below, your wiki site will be open to all! Anyone can visit and edit without login! */ username: 'user', // CHANGE ME OR DELETE !! password: 'passw0rd', // CHANGE ME OR DELETE !! /* If true, you won't need to enter your password each time you open this application. */ autoLogin: true, /* Optional If true, Tiddly will launch the Content Server. You can access your files through it and never need to import all of them into your wiki. */ enableContentServer: true, // default root directory of the Tiddly Content Server csRoot: './contents', // Tiddly Content Server host address csHost: '127.0.0.1', // port of Tiddly Content Server csPort: 8081, /* White list defines a series of folders that you can access. If anyone is trying to access a folder that's not contained here, it will end up with a 403 forbidden error. ! Remember: accessing root directory '/' is always forbidden */ csWhiteList: ['demo'] }
After the Tiddly Content Server launched, you can see a demo page at http://localhost:8081/demo .
You can access your files through it and never need to import all of them into your wiki.
Example:
created: 19710101000000000 creator: user modified: 19710101000000000 modifier: user tags: title: Content Server Test type: text/vnd.tiddlywiki [img[tiddly|http://localhost:8081/demo/imgs/tiddly.png]] [[pdf|http://localhost:8081/demo/pdfs/hints.pdf]]
You can edit MIME types of your Tiddly Content Server. See also MDN Incomplete list of MIME types .
const configuration = { // ...... mimeType: { '.ico': 'image/x-icon', '.html': 'text/html', '.js': 'text/javascript', '.json': 'application/json', '.css': 'text/css', '.png': 'image/png', '.jpg': 'image/jpeg', '.wav': 'audio/wav', '.mp3': 'audio/mpeg', '.svg': 'image/svg+xml', '.pdf': 'application/pdf', '.doc': 'application/msword', '.eot': 'appliaction/vnd.ms-fontobject', '.ttf': 'aplication/font-sfnt' } }
-
Run this application
electron .
-
Build (pack) this application
electron-packager .
-
Done! Enjoy!