Code Monkey home page Code Monkey logo

tiddlywiki-migrator's Introduction

TiddlyWiki Migrator

TiddlyWiki Migrator is a set of scripts put together to automate the migration from a TiddlyWiki (TW). It allows to export all tiddlers in a single-file HTML TiddlyWiki to multiple markdown files (one per tiddler), excluding system tiddlers.

Process design

Dependencies

  • Node.js (tested with v10.4.0)
  • Npm (tested with 6.1.0)
  • Pandoc (tested with 2.2.1)

Usage

  1. Clone this repository.
  2. Copy your single-file html TiddlyWiki (2 or 5) in your cloned repository.
  3. Rename your TW html to wiki.html
  4. Export your tiddlers:
$ make
  1. Convert all your tiddlers to Markdown:
$ make convert

Your tiddlers will be in the markdown_tiddlers directory.

Use case

A TW user has decided to abandon the use of TiddlyWiki. For that, she wants to save all tiddlers as markdown files, one for each tiddler from her TiddlyWiki.

Features

  • Supports classic (version 2) and modern (version 5) TiddlyWikis.
  • Supported tiddler formats:
    • text/vnd.tiddlywiki (modern TW format)
    • text/x-tiddlywiki (classic TW format)
    • text/x-markdown
  • Exports to Markdown using Pandoc using options to conveniently simplify the resulting text.
  • Exported Markdown files follow a safe-name policy, while keeping the name as similar to the original as possible (this includes translating special vowels to the corresponding simple ones).
  • Metadata from tiddlers is exported as YFML at the beginning of each Markdown file. Metadata includes: creation date, last modification date, tags, etc.

Motivation

What is TiddlyWiki?

TiddlyWiki "classic" (v2.x) is an offline, self-contained html wiki, where you can create, modify and delete tiddlers.

TiddlyWiki "modern" (v5.x) is a brand new TW which can run just like v2.x or using node.js as a backend service to store/retrieve tiddlers.

No doubt, TiddlyWiki is a useful and interesting piece of software.

You can find more information on the TiddlyWiki web.

What is a tiddler?

A tiddler is composed by:

  • a title,
  • a creation date,
  • a last modification date,
  • a creator and modifier person name,
  • zero or more tags,
  • a text and
  • a format (e.g. "text/x-tiddlywiki")

Why markdown?

Markdown is a possible tiddler's type (as of new versions of TiddlyWiki).

Markdown format is commonplace on the Internet: in forums, blogs, source code repo platforms, etc.

Markdown files usually end with the .md extension and follow the Markdown text format.

Where can I read more about the process of building this script?

I wrote a post with some more detail.

tiddlywiki-migrator's People

Contributors

davidag avatar jlouzado avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tiddlywiki-migrator's Issues

Please can you give more detailed instructions for people new to coding?

Hello David! Thank you so much for building this tool. I'm hoping to find it extremely useful!

However, I'm new to coding and so I have definitely done something wrong or missed out some steps that might seem obvious to more experienced users.

I have cloned the repo to my desktop and copied the wiki.html into the same folder, but when I try to run $ make in the Node.js command line I get this error message:

'$' is not recognized as an internal or external command,
operable program or batch file.

image

Any help would be massively appreciated. Thank you!
Another David :)

Node_modules directory needs to be manually moved into the repo's root directory in order for the scripts to run

Thank you for creating this TW migrator. I am very new to coding and node.js so it is quite likely that I ran into the following error because I set things up wrong. This is the error I got when I ran make:

Dependencies OK
Installing TiddlyWiki...
/home/USERNAME/.nvm/versions/node/v18.16.0/bin/npm install tiddlywiki

up to date, audited 2 packages in 392ms

found 0 vulnerabilities
Setting up temporary wiki...
/home/USERNAME/.nvm/versions/node/v18.16.0/bin/node node_modules/tiddlywiki/tiddlywiki.js tmp_wiki --init empty
node:internal/modules/cjs/loader:1078
  throw err;
  ^

Error: Cannot find module '/home/USERNAME/repos/tiddlywiki-migrator/node_modules/tiddlywiki/tiddlywiki.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
    at Module._load (node:internal/modules/cjs/loader:920:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v18.16.0
make: *** [Makefile:71: tmp_wiki/tiddlywiki.info] Error 1

I solved this by copying the node_modules directory from the user root directory into the root directory of the repo. Both make and make convert worked after this.

Is this a mistake on my part or is it a genuine issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.