├── .gitignore ├── .gitmodules ├── AddPlugin.sh ├── MakePlugin.sh ├── MakePluginLibrary.sh ├── MakeWiki.sh ├── PluginLibrary └── tiddlywiki.info ├── Readme.md ├── Setup.sh ├── UtilityTiddlers ├── MakeLibrary.tid └── MakePlugin.tid └── start.sh /.gitignore: -------------------------------------------------------------------------------- 1 | LanguageFolder.txt 2 | PluginFolder.txt 3 | ThemeFolder.txt 4 | Author.txt 5 | TiddlyWikiVersion.txt 6 | Wikis/ 7 | Plugins/ 8 | Themes/ 9 | Languages/ 10 | PluginLibrary/output 11 | test.sh -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "TiddlyWiki5"] 2 | path = TiddlyWiki5 3 | url = https://github.com/Jermolene/TiddlyWiki5.git 4 | -------------------------------------------------------------------------------- /AddPlugin.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | OLD="\"plugins\": \[" 4 | 5 | NEW="\"plugins\": \[\ 6 | \"$1\"," 7 | 8 | sed -i".bak" "s#$OLD#$NEW#g" "./Wikis/$2/tiddlywiki.info" -------------------------------------------------------------------------------- /MakePlugin.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Jed Carty April 13 2020 (@inmysocks on GitHub.com) 3 | # 4 | # This script creates an empty plugin in the Plugins folder 5 | # 6 | # Usage: ./MakePlugin.sh PluginName AuthorName 7 | 8 | if [ ! -f ./Author.txt ]; then 9 | echo "Run Setup.sh before running this." 10 | exit 0 11 | fi 12 | 13 | AUTHOR=$(<./Author.txt) 14 | PLUGINNAME="DemoPlugin" 15 | PLUGINFOLDER=$(=5.1.13\", 38 | \"source\": \"\", 39 | \"list\": \"readme\", 40 | \"plugin-type\": \"plugin\" 41 | }" > "$PLUGINFOLDER/$AUTHOR/$PLUGINNAME/plugin.info" 42 | 43 | echo "title: \$:/plugins/$AUTHOR/$PLUGINNAME/readme 44 | caption: readme 45 | 46 | Readme text goes here." > "$PLUGINFOLDER/$AUTHOR/$PLUGINNAME/readme.tid" 47 | 48 | echo "New empty plugin created in $PLUGINFOLDER/$AUTHOR/$PLUGINNAME." 49 | 50 | ./MakeWiki.sh "$AUTHOR/$PLUGINNAME" server 51 | 52 | ./AddPlugin.sh "$AUTHOR/$PLUGINNAME" "$AUTHOR/$PLUGINNAME" -------------------------------------------------------------------------------- /MakePluginLibrary.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Jed Carty April 13 2020 (@inmysocks on GitHub.com) 3 | 4 | if [ ! -f ./Author.txt ]; then 5 | echo "Run Setup.sh before running this." 6 | exit 0 7 | fi 8 | 9 | # You have to change this to match your actual plugin path 10 | export TIDDLYWIKI_PLUGIN_PATH=$( ./TiddlyWikiVersion.txt 18 | fi 19 | 20 | 21 | echo "Checking for newer versions of tiddlywiki" 22 | CURRENTTAG=$(<./TiddlyWikiVersion.txt) 23 | cd TiddlyWiki5 24 | NEWESTTAG=$(git ls-remote --tags | grep -o 'refs/tags/v[0-9]*\.[0-9]*\.[0-9]*' | sort -rV | head -n 1 | grep -o '[^\/]*$') 25 | cd .. 26 | if [ ! $CURRENTTAG == $NEWESTTAG ]; then 27 | echo "You are using version $CURRENTTAG but $NEWESTTAG is available." 28 | echo "Warning: If you have modified the core this will overwrite your 29 | changes!!!" 30 | echo "Do you wish to update to $NEWESTTAG? (enter 1 or 2 for yes or no)" 31 | select yn in "Yes" "No"; do 32 | case $yn in 33 | Yes ) UPDATE="yes"; break;; 34 | No ) UPDATE=""; break;; 35 | esac 36 | done 37 | if [ $UPDATE ]; then 38 | cd TiddlyWiki5 39 | git reset --hard 40 | git fetch --tags 41 | git checkout $NEWESTTAG 42 | cd .. 43 | echo $NEWESTTAG > ./TiddlyWikiVersion.txt 44 | fi 45 | else 46 | echo "You have the newest version, $CURRENTTAG" 47 | fi 48 | 49 | #echo "Patching tiddlywiki to work with this version of the plugin library 50 | #creator." 51 | #./PatchMakeLibrary.sh 52 | 53 | echo " 54 | Enter the author name, this will be used as the author name for plugins you 55 | create. It can be changed in the future by reruning this script or editing 56 | Author.txt 57 | " 58 | 59 | CURRENTNAME="DEFAULTAUTHOR" 60 | CURRENTFOLDER="$(pwd)" 61 | 62 | if [ -f ./Author.txt ]; then 63 | CURRENTNAME=$(<./Author.txt) 64 | fi 65 | 66 | echo "Author Name (press enter to leave as $CURRENTNAME):" 67 | read AUTHORNAME 68 | 69 | if [ "$AUTHORNAME" ]; then 70 | echo $AUTHORNAME > Author.txt 71 | fi 72 | 73 | if [ ! -d ./Plugins ]; then 74 | mkdir ./Plugins 75 | fi 76 | if [ ! -d ./Themes ]; then 77 | mkdir ./Themes 78 | fi 79 | if [ ! -d ./Languages ]; then 80 | mkdir ./Languages 81 | fi 82 | if [ ! -d ./Wikis ]; then 83 | mkdir ./Wikis 84 | fi 85 | 86 | echo "$CURRENTFOLDER/Plugins" > ./PluginFolder.txt 87 | echo "$CURRENTFOLDER/Themes" > ./ThemeFolder.txt 88 | echo "$CURRENTFOLDER/Languages" > ./LanguageFolder.txt 89 | -------------------------------------------------------------------------------- /UtilityTiddlers/MakeLibrary.tid: -------------------------------------------------------------------------------- 1 | title: Make Plugin Library 2 | 3 | \define makeHTML(json) 4 | ` 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Plugin Library 14 | 109 | 110 | 111 | 112 |

HelloThere

113 | 114 |

This is the TiddlyWiki plugin library. It is not intended to be opened directly in the browser.

115 | 116 |

See https://tiddlywiki.com/ for details of how to install plugins.

117 | 118 | 119 | 120 | ` 121 | \end 122 | 123 | \define oneTiddler() 124 | <$list 125 | filter='[fields[]] -text +[bl[]]' 126 | > 127 |
128 |     "<$view field='title' jsencoded/>": "<$view tiddler=<> field=<> format=jsencoded/>", 129 | 130 | <$list 131 | filter='[fields[]] -text +[bl[]]' 132 | > 133 |
134 |     "<$view field='title' jsencoded/>": "<$view tiddler=<> field=<> format=jsencoded/>" 135 | 136 | \end 137 | 138 | \define jsonListing() 139 | [
140 | <$list 141 | filter='[subfilter{$:/state/PluginLibrary!!filter}] +[bl[]]' 142 | variable=theTiddler 143 | > 144 |   { 145 | <> 146 |
147 |   }, 148 |
149 | 150 | <$list 151 | filter='[subfilter{$:/state/PluginLibrary!!filter}] +[last[]]' 152 | variable=theTiddler 153 | > 154 |   { 155 | <> 156 |
157 |   } 158 |
159 | 160 | ] 161 | \end 162 | 163 | This packages the plugins returned by this filter into the format needed by a plugin library. 164 | 165 | The file structure needs to be: 166 | 167 | *Library Folder 168 | ** recipes 169 | *** library 170 | **** tiddlers 171 | ***** //individual tiddler json files// 172 | **** tiddlers.json 173 | ** index.html 174 | 175 | filter: <$edit-text tiddler='$:/state/PluginLibrary' field=filter/> 176 | 177 | 178 | !! tiddlers.json 179 | 180 | ''filename:'' tiddlers.json 181 | 182 | ''contents:'' 183 | 184 | <> 185 | 186 | !! Tiddler JSON files: 187 | 188 | <$list filter={{$:/state/PluginLibrary!!filter}}> 189 | 190 | --- 191 | ''filename:'' <$view field='title' format='urlencoded'/>.json 192 | 193 | ''contents:'' 194 | 195 | <$text text=<>/> 196 | 197 | 198 | --- 199 | ''filename:'' index.html 200 | 201 | ''contents:'' 202 | 203 | <$wikify name=JSONLISTING text=<>> 204 |
205 | <>
206 | 
207 | -------------------------------------------------------------------------------- /UtilityTiddlers/MakePlugin.tid: -------------------------------------------------------------------------------- 1 | title: Make Plugin 2 | 3 | \define plugintext() 4 | { 5 | "tiddlers": {<$list filter="[subfilter{$:/state/MakePlugin!!filter}]+[bl[]]"> 6 | "{{{ [] +[jsonstringify[]] }}}": <$text text=<>/>,<$list filter="[subfilter{$:/state/MakePlugin!!filter}]+[last[]]"> 7 | "{{{ [] +[jsonstringify[]] }}}": <$text text=<>/> 8 | } 9 | } 10 | \end 11 | 12 | Name: 13 | <$edit-text 14 | tiddler='$:/state/MakePlugin' 15 | field='name' 16 | class='tc-edit-texteditor' 17 | placeholder='Enter the plugin name here' 18 | default='' 19 | /> 20 | Filter: 21 | <$edit-text 22 | tiddler='$:/state/MakePlugin' 23 | field='filter' 24 | class='tc-edit-texteditor' 25 | placeholder='Enter a filter to select tiddlers for the plugin' 26 | default='' 27 | /> 28 | Description: 29 | <$edit-text 30 | tiddler='$:/state/MakePlugin' 31 | field='description' 32 | class='tc-edit-texteditor' 33 | placeholder='Enter a description for the plugin' 34 | default='' 35 | /> 36 | List: 37 | <$edit-text 38 | tiddler='$:/state/MakePlugin' 39 | field='list' 40 | class='tc-edit-texteditor' 41 | placeholder='This is a list of items shown in tabs in the plugin info' 42 | default='' 43 | /> 44 | Version: 45 | <$edit-text 46 | tiddler='$:/state/MakePlugin' 47 | field='version' 48 | class='tc-edit-texteditor' 49 | placeholder='Enter the plugin version' 50 | default='' 51 | /> 52 | 53 | <$button> 54 | Make Plugin 55 | <$wikify 56 | name=pluginText 57 | text="<>" 58 | > 59 | <$action-setfield 60 | $tiddler={{$:/state/MakePlugin!!name}} 61 | text=<> 62 | type='application/json' 63 | description={{$:/state/MakePlugin!!description}} 64 | core-version=">=5.0.0" 65 | dependents="" 66 | list={{$:/state/MakePlugin!!list}} 67 | plugin-type="plugin" 68 | version={{$:/state/MakePlugin!!version}} 69 | /> 70 | 71 | -------------------------------------------------------------------------------- /start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Jed Carty April 13 2020 (@inmysocks on GitHub.com) 3 | # 4 | # This starts a wiki server on a given port, defaulting to 8080 5 | # 6 | # Usage: ./start.sh wiki 8888 7 | 8 | if [ ! -f ./PluginFolder.txt ]; then 9 | echo "Run Setup.sh before running this." 10 | exit 0 11 | fi 12 | 13 | WIKI="wiki" 14 | PORT="8080" 15 | 16 | if [ $1 ]; then 17 | WIKI=$1 18 | fi 19 | 20 | if [ $2 ]; then 21 | PORT=$2 22 | fi 23 | 24 | export TIDDLYWIKI_PLUGIN_PATH=$(