Skip to content

Instantly share code, notes, and snippets.

@Jermolene
Created March 11, 2015 11:53
Show Gist options
  • Save Jermolene/1c1ff69c7afe91550057 to your computer and use it in GitHub Desktop.
Save Jermolene/1c1ff69c7afe91550057 to your computer and use it in GitHub Desktop.
Convert .txt tiddlers to wikitext
$tw.wiki.each(function(tiddler,title) {if(title.substr(-4) === ".txt") {$tw.wiki.addTiddler(new $tw.Tiddler(tiddler,{title: title.substr(0,title.length-4), type: "text/vnd.tiddlywiki"}));$tw.wiki.deleteTiddler(title);}});
@Jermolene
Copy link
Author

A hack to find all tiddlers whose title ends with .txt and remove the extension and convert the tiddler type to text/vnd.tiddlywiki.

  1. Open the browser developer console
  2. Paste the code above
  3. Press enter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment