kopia lustrzana https://github.com/miklobit/TiddlyWiki5
Start support for themes
To start with, we move the current stylesheets into a theme plugin called "Snow White". Wikis have to specify at least one theme in their `tiddlywiki.info` file. Next we'll add a mechanism for switching between loaded themesprint-window-tiddler
rodzic
d62c9f613c
commit
31a378b64c
11
boot/boot.js
11
boot/boot.js
|
@ -1086,6 +1086,16 @@ $tw.loadWikiTiddlers = function(wikiPath,parentPaths) {
|
|||
}
|
||||
}
|
||||
}
|
||||
// Load any themes listed in the wiki info file
|
||||
if(wikiInfo.themes) {
|
||||
var themesBasePath = path.resolve($tw.boot.corePath,$tw.config.themesPath);
|
||||
for(var t=0; t<wikiInfo.themes.length; t++) {
|
||||
pluginFields = $tw.loadPluginFolder(path.resolve(themesBasePath,"./" + wikiInfo.themes[t]));
|
||||
if(pluginFields) {
|
||||
$tw.wiki.addTiddler(pluginFields);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Load the wiki files, registering them as writable
|
||||
var resolvedWikiPath = path.resolve(wikiPath,$tw.config.wikiTiddlersSubDir);
|
||||
$tw.utils.each($tw.loadTiddlersFromPath(resolvedWikiPath),function(tiddlerFile) {
|
||||
|
@ -1139,6 +1149,7 @@ $tw.boot.startup = function() {
|
|||
},
|
||||
config: { // Configuration overridables
|
||||
pluginsPath: "../plugins/",
|
||||
themesPath: "../themes/",
|
||||
wikiInfo: "./tiddlywiki.info",
|
||||
wikiPluginsSubDir: "./plugins",
|
||||
wikiTiddlersSubDir: "./tiddlers",
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
"tiddlywiki/tiddlyweb",
|
||||
"tiddlywiki/filesystem"
|
||||
],
|
||||
"themes": [
|
||||
"tiddlywiki/snowwhite"
|
||||
],
|
||||
"doNotSave": [
|
||||
"$:/StoryList",
|
||||
"$:/HistoryList",
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
{
|
||||
"plugins": [
|
||||
"tiddlywiki/fullscreen"
|
||||
],
|
||||
"themes": [
|
||||
"tiddlywiki/snowwhite"
|
||||
]
|
||||
}
|
|
@ -1,5 +1,8 @@
|
|||
{
|
||||
"plugins": [
|
||||
"tiddlywiki/tahoelafs"
|
||||
],
|
||||
"themes": [
|
||||
"tiddlywiki/snowwhite"
|
||||
]
|
||||
}
|
|
@ -1,5 +1,8 @@
|
|||
{
|
||||
"plugins": [
|
||||
"tiddlywiki/jasmine"
|
||||
],
|
||||
"themes": [
|
||||
"tiddlywiki/snowwhite"
|
||||
]
|
||||
}
|
|
@ -1,5 +1,8 @@
|
|||
{
|
||||
"plugins": [
|
||||
"tiddlywiki/fullscreen"
|
||||
],
|
||||
"themes": [
|
||||
"tiddlywiki/snowwhite"
|
||||
]
|
||||
}
|
|
@ -2,5 +2,8 @@
|
|||
"plugins": [
|
||||
"tiddlywiki/fullscreen",
|
||||
"tiddlywiki/tiddlyweb"
|
||||
],
|
||||
"themes": [
|
||||
"tiddlywiki/snowwhite"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"title": "$:/themes/tiddlywiki/snowwhite",
|
||||
"description": "A simple, plain layout",
|
||||
"author": "JeremyRuston",
|
||||
"version": "0.0.0",
|
||||
"coreVersion": ">=5.0.0"
|
||||
}
|
Ładowanie…
Reference in New Issue