Skip to content

Commit 57d63b8

Browse files
committed
Add tid2md.py and README.md
1 parent eabea69 commit 57d63b8

File tree

2 files changed

+406
-0
lines changed

2 files changed

+406
-0
lines changed

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# tid2md
2+
3+
Migrate your TiddlyWiki5 (Node.js version) tiddlers (`.tid` files) to Markdown tiddlers (`.md` files for markup plus `.md.meta` files for meta information).
4+
5+
## Markdown in TiddlyWiki
6+
7+
[TiddlyWiki](https://tiddlywiki.com/) uses its own [WikiText](https://tiddlywiki.com/#WikiText) markup language. While this is the natural first choice when using TiddlyWiki, it's also possible writing tiddlers in Markdown using the official [Markdown Plugin](https://tiddlywiki.com/#Markdown%20Plugin). Markdown has the advantage that it's used in many places (p.e. GitHub, GitLab, BitBucket, StackOverflow, Reddit) and is supported by many editors, parsers and other tools. When you often copy tiddlers (or parts of them) to other websites or when you edit/process your `.tid` files with tools except TiddlyWiki itself, it might make sense to write your tiddlers in Markdown or migrate those already written in WikiText to Markdown. This is what `tid2md.py` was made for.
8+
9+
## Installation
10+
11+
Just clone this repository and copy/symlink `tid2md.py` to a directory in your `$PATH`.
12+
13+
For example (on Linux):
14+
15+
```sh
16+
cd ~/Downloads
17+
git clone https://github.com/MaxGyver83/tid2md.git
18+
mkdir -p ~/.local/bin
19+
cd ~/.local/bin
20+
ln -s ~/Downloads/tid2md/tid2md.py
21+
cd ~
22+
test -f tid2md.py || PATH=~/.local/bin:"$PATH"
23+
```
24+
25+
## How to use tid2md.py
26+
27+
`tid2md.py` is a Python script to be run in a terminal. It takes a list of `.tid` files as input parameter. This means that it cannot be used with a single-HTML-file TiddlyWiki. It only works with a [Node.js TiddlyWiki](https://tiddlywiki.com/#Installing%20TiddlyWiki%20on%20Node.js) which stores every tiddler as a separate `.tid` file on your disk.
28+
29+
⚠ Warning: This script was only tested by myself using my own tiddlers. Please test it on a copy of your wiki and check if the migrated tiddlers look like expected.
30+
31+
Migrate all `.tid` files:
32+
33+
```sh
34+
cd path/to/wiki/tiddlers
35+
tid2md.py --delete *.tid
36+
```
37+
38+
This will create Markdown tiddlers (consisting of a `.md` and a `.md.meta` file) for all WikiText tiddlers except:
39+
40+
* System tiddlers
41+
* Tiddlers containing macro definitons
42+
* Tiddlers containing at least one table
43+
44+
Tiddlers with tables are skipped by default because Markdown tables are lacking many features of WikiText tables (p.e. two header rows, captions, cell alignment, cell merging, ...). Use `--tables` to migrate such tiddlers anyway.
45+
46+
The `--delete` option makes the script delete the original `.tid` files after a successful migration because otherwise you would end up with two versions of the same tiddler.
47+
48+
Run `tid2md.py --help` for more options.

0 commit comments

Comments
 (0)