mirror of
				https://github.com/Jermolene/TiddlyWiki5
				synced 2025-10-30 15:13:00 +00:00 
			
		
		
		
	Enhance "includeWikis" to merge build targets
Build targets found in included wikis are merged behind any found in the wiki itself
This commit is contained in:
		| @@ -1583,7 +1583,9 @@ $tw.loadWikiTiddlers = function(wikiPath,parentPaths) { | |||||||
| 		$tw.utils.each(wikiInfo.includeWikis,function(includedWikiPath) { | 		$tw.utils.each(wikiInfo.includeWikis,function(includedWikiPath) { | ||||||
| 			var resolvedIncludedWikiPath = path.resolve(wikiPath,includedWikiPath); | 			var resolvedIncludedWikiPath = path.resolve(wikiPath,includedWikiPath); | ||||||
| 			if(parentPaths.indexOf(resolvedIncludedWikiPath) === -1) { | 			if(parentPaths.indexOf(resolvedIncludedWikiPath) === -1) { | ||||||
| 				$tw.loadWikiTiddlers(resolvedIncludedWikiPath,parentPaths); | 				var subWikiInfo = $tw.loadWikiTiddlers(resolvedIncludedWikiPath,parentPaths); | ||||||
|  | 				// Merge the build targets | ||||||
|  | 				wikiInfo.build = $tw.utils.extend([],subWikiInfo.build,wikiInfo.build); | ||||||
| 			} else { | 			} else { | ||||||
| 				$tw.utils.error("Cannot recursively include wiki " + resolvedIncludedWikiPath); | 				$tw.utils.error("Cannot recursively include wiki " + resolvedIncludedWikiPath); | ||||||
| 			} | 			} | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| created: 20130825214200000 | created: 20130825214200000 | ||||||
| modified: 20140912141727308 | modified: 20141013204930183 | ||||||
| tags: [[TiddlyWiki on Node.js]] | tags: [[TiddlyWiki on Node.js]] | ||||||
| title: TiddlyWikiFolders | title: TiddlyWikiFolders | ||||||
| type: text/vnd.tiddlywiki | type: text/vnd.tiddlywiki | ||||||
| @@ -27,6 +27,8 @@ The `tiddlywiki.info` file in a wiki folder contains a JSON object comprising th | |||||||
| * ''build'' - a hashmap of named build targets, each defined by an array of command tokens (see BuildCommand) | * ''build'' - a hashmap of named build targets, each defined by an array of command tokens (see BuildCommand) | ||||||
| * ''config'' - an optional hashmap of configuration options (see below) | * ''config'' - an optional hashmap of configuration options (see below) | ||||||
|  |  | ||||||
|  | Note that the build targets of included wikis are merged if a target of that name isn't defined in the current `tiddlywiki.info` file. | ||||||
|  |  | ||||||
| Configuration options include: | Configuration options include: | ||||||
|  |  | ||||||
| * ''default-tiddler-location'' - a string path to the default location for the filesystem adaptor to save new tiddlers (resolved relative to the wiki folder) | * ''default-tiddler-location'' - a string path to the default location for the filesystem adaptor to save new tiddlers (resolved relative to the wiki folder) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jermolene
					Jermolene