From 1b41b4468495bbe66f99345ee94a67346176deb7 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sat, 15 Oct 2016 16:21:51 +0100 Subject: [PATCH] Improve support for bulk loading tiddlers under Node.js Fixes #2610 --- boot/boot.js | 152 +++++++++++++----- .../tiddlers/concepts/TiddlyWikiFolders.tid | 116 ++----------- .../tiddlers/mechanisms/PluginMechanism.tid | 110 ++----------- .../nodejs/tiddlywiki.files_Files.tid | 52 ++++++ .../tiddlers/nodejs/tiddlywiki.info_Files.tid | 59 +++++++ .../tiddlers/plugins/Disabling_Plugins.tid | 15 ++ .../tiddlers/plugins/PluginFolders.tid | 28 ++++ .../tiddlers/plugins/Plugin_Fields.tid | 22 +++ .../plugins/Plugin_Information_Tiddlers.tid | 25 +++ .../tiddlywiki/katex/files/tiddlywiki.files | 131 ++------------- 10 files changed, 345 insertions(+), 365 deletions(-) create mode 100644 editions/tw5.com/tiddlers/nodejs/tiddlywiki.files_Files.tid create mode 100644 editions/tw5.com/tiddlers/nodejs/tiddlywiki.info_Files.tid create mode 100644 editions/tw5.com/tiddlers/plugins/Disabling_Plugins.tid create mode 100644 editions/tw5.com/tiddlers/plugins/PluginFolders.tid create mode 100644 editions/tw5.com/tiddlers/plugins/Plugin_Fields.tid create mode 100644 editions/tw5.com/tiddlers/plugins/Plugin_Information_Tiddlers.tid diff --git a/boot/boot.js b/boot/boot.js index 7413d74e5..5ffbd2770 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -1456,17 +1456,26 @@ $tw.loadTiddlersFromFile = function(filepath,fields) { typeInfo = type ? $tw.config.contentTypeInfo[type] : null, data = fs.readFileSync(filepath,typeInfo ? typeInfo.encoding : "utf8"), tiddlers = $tw.wiki.deserializeTiddlers(ext,data,fields), - metafile = filepath + ".meta", metadata; - if(ext !== ".json" && tiddlers.length === 1 && fs.existsSync(metafile)) { - metadata = fs.readFileSync(metafile,"utf8"); - if(metadata) { - tiddlers = [$tw.utils.parseFields(metadata,tiddlers[0])]; - } + if(ext !== ".json" && tiddlers.length === 1) { + metadata = $tw.loadMetadataForFile(filepath); + tiddlers = [$tw.utils.extend({},metadata,tiddlers[0])]; } return {filepath: filepath, type: type, tiddlers: tiddlers, hasMetaFile: !!metadata}; }; +/* +Load the metadata fields in the .meta file corresponding to a particular file +*/ +$tw.loadMetadataForFile = function(filepath) { + var metafilename = filepath + ".meta"; + if(fs.existsSync(metafilename)) { + return $tw.utils.parseFields(fs.readFileSync(metafilename,"utf8") || ""); + } else { + return null; + } +}; + /* A default set of files for TiddlyWiki to ignore during load. This matches what NPM ignores, and adds "*.meta" to ignore tiddler @@ -1486,44 +1495,7 @@ $tw.loadTiddlersFromPath = function(filepath,excludeRegExp) { var files = fs.readdirSync(filepath); // Look for a tiddlywiki.files file if(files.indexOf("tiddlywiki.files") !== -1) { - // If so, process the files it describes - var filesInfo = JSON.parse(fs.readFileSync(filepath + path.sep + "tiddlywiki.files","utf8")); - // First the tiddlers - $tw.utils.each(filesInfo.tiddlers,function(tidInfo) { - var type = tidInfo.fields.type || "text/plain", - typeInfo = $tw.config.contentTypeInfo[type], - pathname = path.resolve(filepath,tidInfo.file), - text = fs.readFileSync(pathname,typeInfo ? typeInfo.encoding : "utf8"); - if(tidInfo.isTiddlerFile) { - var fileTiddlers = $tw.wiki.deserializeTiddlers(path.extname(pathname),text) || []; - $tw.utils.each(fileTiddlers,function(tiddler) { - $tw.utils.extend(tiddler,tidInfo.fields); - if(tidInfo.prefix) { - tiddler.text = tidInfo.prefix + tiddler.text; - } - if(tidInfo.suffix) { - tiddler.text = tiddler.text + tidInfo.suffix; - } - }); - tiddlers.push({tiddlers: fileTiddlers}); - } else { - if(tidInfo.prefix) { - text = tidInfo.prefix + text; - } - if(tidInfo.suffix) { - text = text + tidInfo.suffix; - } - tidInfo.fields.text = text; - tiddlers.push({tiddlers: [tidInfo.fields]}); - } - }); - // Then any recursive directories - $tw.utils.each(filesInfo.directories,function(dirPath) { - var pathname = path.resolve(filepath,dirPath); - if(fs.existsSync(pathname) && fs.statSync(pathname).isDirectory()) { - tiddlers.push.apply(tiddlers,$tw.loadTiddlersFromPath(pathname,excludeRegExp)); - } - }); + Array.prototype.push.apply(tiddlers,$tw.loadTiddlersFromSpecification(filepath)); } else { // If not, read all the files in the directory $tw.utils.each(files,function(file) { @@ -1539,6 +1511,98 @@ $tw.loadTiddlersFromPath = function(filepath,excludeRegExp) { return tiddlers; }; +/* +Load all the tiddlers defined by a `tiddlywiki.files` specification file +filepath: pathname of the directory containing the specification file +*/ +$tw.loadTiddlersFromSpecification = function(filepath) { + var tiddlers = []; + // Read the specification + var filesInfo = JSON.parse(fs.readFileSync(filepath + path.sep + "tiddlywiki.files","utf8")); + // Helper to process a file + var processFile = function(filename,isTiddlerFile,fields) { + var extInfo = $tw.config.fileExtensionInfo[path.extname(filename)], + type = (extInfo || {}).type || fields.type || "text/plain", + typeInfo = $tw.config.contentTypeInfo[type] || {}, + pathname = path.resolve(filepath,filename), + text = fs.readFileSync(pathname,typeInfo.encoding || "utf8"), + metadata = $tw.loadMetadataForFile(pathname) || {}, + fileTiddlers; + if(isTiddlerFile) { + fileTiddlers = $tw.wiki.deserializeTiddlers(path.extname(pathname),text,metadata) || []; + } else { + fileTiddlers = [$tw.utils.extend({text: text},metadata)]; + } + var combinedFields = $tw.utils.extend({},fields,metadata); + $tw.utils.each(fileTiddlers,function(tiddler) { + $tw.utils.each(combinedFields,function(fieldInfo,name) { + if(typeof fieldInfo === "string" || $tw.utils.isArray(fieldInfo)) { + tiddler[name] = fieldInfo; + } else { + var value = tiddler[name]; + switch(fieldInfo.source) { + case "filename": + value = path.basename(filename); + break; + case "basename": + value = path.basename(filename,path.extname(filename)); + break; + case "extname": + value = path.extname(filename); + break; + case "created": + value = new Date(fs.statSync(pathname).birthtime); + break; + case "modified": + value = new Date(fs.statSync(pathname).mtime); + break; + } + if(fieldInfo.prefix) { + value = fieldInfo.prefix + value; + } + if(fieldInfo.suffix) { + value = value + fieldInfo.suffix; + } + tiddler[name] = value; + } + }); + }); + tiddlers.push({tiddlers: fileTiddlers}); + }; + // Process the listed tiddlers + $tw.utils.each(filesInfo.tiddlers,function(tidInfo) { + if(tidInfo.prefix && tidInfo.suffix) { + tidInfo.fields.text = {prefix: tidInfo.prefix,suffix: tidInfo.suffix}; + } else if(tidInfo.prefix) { + tidInfo.fields.text = {prefix: tidInfo.prefix}; + } else if(tidInfo.suffix) { + tidInfo.fields.text = {suffix: tidInfo.suffix}; + } + processFile(tidInfo.file,tidInfo.isTiddlerFile,tidInfo.fields); + }); + // Process any listed directories + $tw.utils.each(filesInfo.directories,function(dirSpec) { + // Read literal directories directly + if(typeof dirSpec === "string") { + var pathname = path.resolve(filepath,dirSpec); + if(fs.existsSync(pathname) && fs.statSync(pathname).isDirectory()) { + tiddlers.push.apply(tiddlers,$tw.loadTiddlersFromPath(pathname,excludeRegExp)); + } + } else { + // Process directory specifier + var dirPath = path.resolve(filepath,dirSpec.path), + files = fs.readdirSync(dirPath), + fileRegExp = new RegExp(dirSpec.filesRegExp || "^.*$"); + for(var t=0; t> -|!Field |!Description | -|title |Title of plugin | -|description |Description of plugin | -|author |Author of plugin | -|version |Version string (must conform to [ext[SemanticVersioning|http://semver.org/]] convention) | -|source |Source URL of plugin | -|type |Must be ''application/json'' | -|plugin-type |Can be ''plugin'' (default), ''language'' or ''theme'' | -|text |JSON encoding of the list of tiddlers comprising the plugin | -|list |Names of exposed plugin information tiddlers (see below) | -|name |Name of the theme (only for themes) | -|dependents |List of dependent plugins (currently only implemented for themes) | - -! Plugin folders - -On the server, plugins can be stored as ordinary JSON tiddlers but it is often more convenient to store them as separate tiddler files within folders. Plugin folders must contain a `plugin.info` file that contains the metadata for the plugin. It can also optionally identify files external to the plugin folder that should be loaded as tiddlers. - -The `plugin.info` file should contain the following JSON structure: - -The JSON structure for plugin tiddlers is as follows: - -``` -{ - "title": "$:/plugins/publisher/name", - "description": "An exemplary plugin for demonstration purposes", - "author": "JeremyRuston", - "version": "1.2.3-alpha3", - "core-version": ">=5.0.0", - "source": "http://tiddlywiki.com/MyPlugin", - "plugin-type": "plugin", - "list": "readme license history" -} -``` - -By convention, the titles of the individual tiddlers are prefixed with the title of the containing plugin, but they are not restricted to do so. - -Note that if the `version` field is omitted from a `plugin.info` file when the plugin folder is packed then it is automatically filled in by the core to the current core version number. This is to ensure that all the core plugins carry the correct version number. Generally plugin authors will want to ensure that they do explicitly specify a version number. - -! Plugin library - -The standard distribution of TiddlyWiki includes a number of standard plugins in the `plugins` directory. - -! Including plugins in a wiki - -To be usable in the browser, plugins just need to be included in the wiki. For wikis that are generated on the server, TiddlyWikiFolders can contain a `tiddlywiki.info` file that identifies the plugins to be included in this wiki: - -``` -{ - "plugins": [ - "tiddlywiki/slider", - "tiddlytools/chooser" - ] -} -``` - -Plugins names refer to plugin folders listed in TiddlyWiki5's root `plugins` folder. - -Plugins can also be included manually by copying them into the `plugins` subfolder of the wiki. - -! Plugin processing - -The wiki object keeps track of all of the currently loaded plugins. If a request for a tiddler isn't in the store then the wiki looks through the cascade of plugins to find the requested tiddler. It is a similar idea to the way that shadow tiddlers are implemented in classic TiddlyWiki. - -In the browser, any constituent tiddlers that are JavaScript modules (ie shadow tiddlers of content type `application/javascript` and possessing the field `module-type`) are executed during startup processing. - -!! Disabling Plugins - -Plugins can be disabled by creating a tiddler titled `$:/config/Plugins/Disabled/` concatenated with the plugin title, and setting its text to `yes`. - -For example, to disable the plugin `$:/plugins/tiddlywiki/highlight`, the title would be: - -``` -$:/config/Plugins/Disabled/$:/plugins/tiddlywiki/highlight -``` - -! Information Tiddlers for Plugins - -Plugin authors are encouraged to provide special information and documentation tiddlers that TiddlyWiki can include as plugin information tabs in the [[control panel|$:/ControlPanel]]. - -Plugins should provide an icon contained in a tiddler with the title formed of `/icon` (for example, [[$:/core/icon]]). - -Plugins expose the names of the individual information tabs that they wish to display in the `list` field of the plugin tiddler. By convention, some or all of the following should be provided: - -* ''readme'': basic information about the plugin -* ''license'': the license under which the plugin is published - -The title of the associated information tiddler must be formed as follows: - -# `$:///` (for example, ''$:/core/en-GB/readme'') -# `$://` (for example, ''$:/core/readme'') - -Thus, plugins can provide language-specific versions of each information tiddler. - -Note that information tiddlers should not reference other tiddlers within the plugin. This is because plugins containing themes or languages are dynamically switched in and out as they are selected, and so their information tiddlers may not be available for viewing. The control panel uses the 'subtiddler' attribute of the TranscludeWidget to access these tiddlers, which works independently of the plugin switching mechanism. diff --git a/editions/tw5.com/tiddlers/nodejs/tiddlywiki.files_Files.tid b/editions/tw5.com/tiddlers/nodejs/tiddlywiki.files_Files.tid new file mode 100644 index 000000000..b466dd0d7 --- /dev/null +++ b/editions/tw5.com/tiddlers/nodejs/tiddlywiki.files_Files.tid @@ -0,0 +1,52 @@ +created: 20161015114118243 +modified: 20161015151555834 +tags: TiddlyWikiFolders +title: tiddlywiki.files Files +type: text/vnd.tiddlywiki + +! Introduction + +A `tiddlywiki.files` JSON file in a sub-folder within [[a TiddlyWiki folder|TiddlyWikiFolders]] overrides the usual logic for recursively scanning the folder for tiddler files. Instead, the `tiddlywiki.files` file specifies instructions for loading tiddlers from specific files and folders. + +The format of the file is an object with two optional properties: + +* ''tiddlers'' - an array of objects describing external files with the ability to override or modify any of the fields read from the file +* ''directories'' - an array of objects describing external directories, a filter determining which files within those directories should be processed, and the ability to override or modify any of the fields read from the file + +Note that significant enhancements to `tiddlywiki.files` processing were introduced in [[Release 5.1.14]]. + +!! Field overrides + +Both the ''tiddlers'' and ''directories'' sections of `tiddlywiki.files` files include the ability to override or customise the values of fields with a `fields` object. + +Each field can be specified as either a ''string'' or ''array'' value to be assigned directly to the field, or <<.from-version "5.1.14">> an ''object'' describing how to generate the value for the field. The object contains the following properties: + +* ''source'' - (optional) a string specifying the source value for the field. If not specified, the existing value is used +** //filename// the filename of the file containing the tiddler +** //basename// the filename of the file containing the tiddler without any extension +** //extname// the extension of the filename of the file containing the tiddler +** //created// the creation date/time of the file containing the tiddler +** //modified// the modification date/time of the file containing the tiddler +* ''prefix'' - (optional) a string to be prepended to the value of the field +* ''suffix'' - (optional) a string to be appended to the value of the field + +! Tiddlers section + +The file specifications in the `tiddlers` array support the following properties: + +* ''file'': (required) the absolute or relative path to the file containing the tiddler data (relative paths are interpreted relative to the path of the `tiddlywiki.files` file) +* ''isTiddlerFile'': (optional) if `true`, the file will be treated as a [[tiddler file|TiddlerFiles]] and deserialised to extract the tiddlers. Otherwise, the raw content of the file is assigned to the `text` field without any parsing +* ''fields'': (optional) an object containing values that override or customise the fields provided in the tiddler file (see above) +* ''prefix'' & ''suffix'': (optional) strings to be prefixed and suffixed to the tiddler `text` field +*> Note that providing a ''prefix'' here is equivalent to setting the `text` field of the ''fields'' object to `{"prefix":""}`. + +! Directories section + +Directory specifications in the `directories` array may take the following forms: + +* a ''string'' literal, specifying the absolute or relative path to the directory containing the tiddler files (relative paths are interpreted relative to the path of the `tiddlywiki.files` file). The directory is recursively searched for tiddler files +* <<.from-version "5.1.14">> an ''object'' with the following properties: +** ''path'' - (required) the absolute or relative path to the directory containing the tiddler files (relative paths are interpreted relative to the path of the `tiddlywiki.files` file). Note that the directory is not recursively searched; sub-directories are ignored +** ''filesRegExp'' - (optional) a [[regular expression]] that matches the filenames of the files that should be processed within the directory +** ''isTiddlerFile'' - (required) if `true`, the file will be treated as a [[tiddler file|TiddlerFiles]] and deserialised to extract the tiddlers. Otherwise, the raw content of the file is assigned to the `text` field without any parsing +** ''fields'' - (required) an object containing values that override or customise the fields provided in the tiddler file (see above) diff --git a/editions/tw5.com/tiddlers/nodejs/tiddlywiki.info_Files.tid b/editions/tw5.com/tiddlers/nodejs/tiddlywiki.info_Files.tid new file mode 100644 index 000000000..f3f572246 --- /dev/null +++ b/editions/tw5.com/tiddlers/nodejs/tiddlywiki.info_Files.tid @@ -0,0 +1,59 @@ +created: 20161015114042793 +modified: 20161015121622327 +tags: TiddlyWikiFolders +title: tiddlywiki.info Files +type: text/vnd.tiddlywiki + +[[TiddlyWikiFolders]] are configured with a single `tiddlywiki.info` file in the root of the wiki folder. It should contain a JSON object comprising the following properties: + +* ''plugins'' - an array of plugin names to be included in the wiki +* ''themes'' - an array of theme names to be included in the wiki +* ''languages'' - an array of language names to be included in the wiki +* ''includeWikis'' - an array of references to external wiki folders to be included in the wiki +* ''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) + +!!! ''includeWikis'' + +The entries in the ''includeWikis'' array can be either a string specifying the relative path to the wiki, or an object with the following fields: + +* ''path'' - relative path to wiki folder +* ''read-only'' - set //true// to prevent the tiddlers in the included wiki from being modified. The modifications will be written to the directory specified in ''default-tiddler-location'', described below + +!!! ''build'' + +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. + +!!! ''config'' + +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) + +* ''retain-original-tiddler-path'' - If true, the server will generate a tiddler [[$:/config/OriginalTiddlerPaths]] containing the original file paths of each tiddler in the wiki + +!!! Example + +For example: + +``` +{ + "plugins": [ + "tiddlywiki/tiddlyweb", + "tiddlywiki/filesystem" + ], + "includeWikis": [ + "../tw5.com" + ], + "build": { + "index": [ + "--rendertiddler","$:/core/save/all","index.html","text/plain"], + "favicon": [ + "--savetiddler","$:/favicon.ico","favicon.ico", + "--savetiddler","$:/green_favicon.ico","static/favicon.ico"] + }, + "config": { + "retain-original-tiddler-path": true + } +} +``` diff --git a/editions/tw5.com/tiddlers/plugins/Disabling_Plugins.tid b/editions/tw5.com/tiddlers/plugins/Disabling_Plugins.tid new file mode 100644 index 000000000..12c11a112 --- /dev/null +++ b/editions/tw5.com/tiddlers/plugins/Disabling_Plugins.tid @@ -0,0 +1,15 @@ +created: 20161015121727194 +modified: 20161015121728291 +tags: PluginMechanism +title: Disabling Plugins +type: text/vnd.tiddlywiki + +!! Disabling Plugins + +Plugins can be disabled by creating a tiddler titled `$:/config/Plugins/Disabled/` concatenated with the plugin title, and setting its text to `yes`. + +For example, to disable the plugin `$:/plugins/tiddlywiki/highlight`, the title would be: + +``` +$:/config/Plugins/Disabled/$:/plugins/tiddlywiki/highlight +``` \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/plugins/PluginFolders.tid b/editions/tw5.com/tiddlers/plugins/PluginFolders.tid new file mode 100644 index 000000000..e3e7c6ad9 --- /dev/null +++ b/editions/tw5.com/tiddlers/plugins/PluginFolders.tid @@ -0,0 +1,28 @@ +created: 20161015113519246 +modified: 20161015113833256 +tags: PluginMechanism +title: PluginFolders +type: text/vnd.tiddlywiki + +On the server, plugins can be stored as ordinary JSON tiddlers but it is often more convenient to store them as separate tiddler files within folders. Plugin folders must contain a `plugin.info` file that contains the metadata for the plugin. It can also optionally identify files external to the plugin folder that should be loaded as tiddlers. + +The `plugin.info` file should contain the following JSON structure: + +The JSON structure for plugin tiddlers is as follows: + +``` +{ + "title": "$:/plugins/publisher/name", + "description": "An exemplary plugin for demonstration purposes", + "author": "JeremyRuston", + "version": "1.2.3-alpha3", + "core-version": ">=5.0.0", + "source": "http://tiddlywiki.com/MyPlugin", + "plugin-type": "plugin", + "list": "readme license history" +} +``` + +By convention, the titles of the individual tiddlers are prefixed with the title of the containing plugin, but they are not restricted to do so. + +Note that if the `version` field is omitted from a `plugin.info` file when the plugin folder is packed then it is automatically filled in by the core to the current core version number. This is to ensure that all the core plugins carry the correct version number. Generally plugin authors will want to ensure that they do explicitly specify a version number. diff --git a/editions/tw5.com/tiddlers/plugins/Plugin_Fields.tid b/editions/tw5.com/tiddlers/plugins/Plugin_Fields.tid new file mode 100644 index 000000000..86636179e --- /dev/null +++ b/editions/tw5.com/tiddlers/plugins/Plugin_Fields.tid @@ -0,0 +1,22 @@ +created: 20161015122718559 +modified: 20161015122719647 +tags: PluginMechanism +title: Plugin Fields +type: text/vnd.tiddlywiki + +! Plugin fields + +Plugins are stored as tiddlers with the following fields: + +|!Field |!Description | +|title |Title of plugin | +|description |Description of plugin | +|author |Author of plugin | +|version |Version string (must conform to [ext[SemanticVersioning|http://semver.org/]] convention) | +|source |Source URL of plugin | +|type |Must be ''application/json'' | +|plugin-type |Can be ''plugin'' (default), ''language'' or ''theme'' | +|text |JSON encoding of the list of tiddlers comprising the plugin | +|list |Names of exposed plugin information tiddlers (see below) | +|name |Name of the theme (only for themes) | +|dependents |List of dependent plugins (currently only implemented for themes) | \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/plugins/Plugin_Information_Tiddlers.tid b/editions/tw5.com/tiddlers/plugins/Plugin_Information_Tiddlers.tid new file mode 100644 index 000000000..0c0f168c6 --- /dev/null +++ b/editions/tw5.com/tiddlers/plugins/Plugin_Information_Tiddlers.tid @@ -0,0 +1,25 @@ +created: 20161015121708376 +modified: 20161015121709477 +tags: PluginMechanism +title: Plugin Information Tiddlers +type: text/vnd.tiddlywiki + +! Information Tiddlers for Plugins + +Plugin authors are encouraged to provide special information and documentation tiddlers that TiddlyWiki can include as plugin information tabs in the [[control panel|$:/ControlPanel]]. + +Plugins should provide an icon contained in a tiddler with the title formed of `/icon` (for example, [[$:/core/icon]]). + +Plugins expose the names of the individual information tabs that they wish to display in the `list` field of the plugin tiddler. By convention, some or all of the following should be provided: + +* ''readme'': basic information about the plugin +* ''license'': the license under which the plugin is published + +The title of the associated information tiddler must be formed as follows: + +# `$:///` (for example, ''$:/core/en-GB/readme'') +# `$://` (for example, ''$:/core/readme'') + +Thus, plugins can provide language-specific versions of each information tiddler. + +Note that information tiddlers should not reference other tiddlers within the plugin. This is because plugins containing themes or languages are dynamically switched in and out as they are selected, and so their information tiddlers may not be available for viewing. The control panel uses the 'subtiddler' attribute of the TranscludeWidget to access these tiddlers, which works independently of the plugin switching mechanism. \ No newline at end of file diff --git a/plugins/tiddlywiki/katex/files/tiddlywiki.files b/plugins/tiddlywiki/katex/files/tiddlywiki.files index 1924dbd09..6af3ec967 100644 --- a/plugins/tiddlywiki/katex/files/tiddlywiki.files +++ b/plugins/tiddlywiki/katex/files/tiddlywiki.files @@ -1,126 +1,17 @@ { + "directories": [ + { + "path": "./fonts/", + "filesRegExp": "^.*\\.woff$", + "isTiddlerFile": false, + "fields": { + "title": {"source": "filename", "prefix": "$:/plugins/tiddlywiki/katex/fonts/"}, + "type": "application/font-woff" + } + } + ], "tiddlers": [ { - "file": "fonts/KaTeX_AMS-Regular.woff", - "fields": { - "type": "application/font-woff", - "title": "$:/plugins/tiddlywiki/katex/fonts/KaTeX_AMS-Regular.woff" - } - },{ - "file": "fonts/KaTeX_Caligraphic-Bold.woff", - "fields": { - "type": "application/font-woff", - "title": "$:/plugins/tiddlywiki/katex/fonts/KaTeX_Caligraphic-Bold.woff" - } - },{ - "file": "fonts/KaTeX_Caligraphic-Regular.woff", - "fields": { - "type": "application/font-woff", - "title": "$:/plugins/tiddlywiki/katex/fonts/KaTeX_Caligraphic-Regular.woff" - } - },{ - "file": "fonts/KaTeX_Fraktur-Bold.woff", - "fields": { - "type": "application/font-woff", - "title": "$:/plugins/tiddlywiki/katex/fonts/KaTeX_Fraktur-Bold.woff" - } - },{ - "file": "fonts/KaTeX_Fraktur-Regular.woff", - "fields": { - "type": "application/font-woff", - "title": "$:/plugins/tiddlywiki/katex/fonts/KaTeX_Fraktur-Regular.woff" - } - },{ - "file": "fonts/KaTeX_Main-Bold.woff", - "fields": { - "type": "application/font-woff", - "title": "$:/plugins/tiddlywiki/katex/fonts/KaTeX_Main-Bold.woff" - } - },{ - "file": "fonts/KaTeX_Main-Italic.woff", - "fields": { - "type": "application/font-woff", - "title": "$:/plugins/tiddlywiki/katex/fonts/KaTeX_Main-Italic.woff" - } - },{ - "file": "fonts/KaTeX_Main-Regular.woff", - "fields": { - "type": "application/font-woff", - "title": "$:/plugins/tiddlywiki/katex/fonts/KaTeX_Main-Regular.woff" - } - },{ - "file": "fonts/KaTeX_Math-BoldItalic.woff", - "fields": { - "type": "application/font-woff", - "title": "$:/plugins/tiddlywiki/katex/fonts/KaTeX_Math-BoldItalic.woff" - } - },{ - "file": "fonts/KaTeX_Math-Italic.woff", - "fields": { - "type": "application/font-woff", - "title": "$:/plugins/tiddlywiki/katex/fonts/KaTeX_Math-Italic.woff" - } - },{ - "file": "fonts/KaTeX_Math-Regular.woff", - "fields": { - "type": "application/font-woff", - "title": "$:/plugins/tiddlywiki/katex/fonts/KaTeX_Math-Regular.woff" - } - },{ - "file": "fonts/KaTeX_SansSerif-Bold.woff", - "fields": { - "type": "application/font-woff", - "title": "$:/plugins/tiddlywiki/katex/fonts/KaTeX_SansSerif-Bold.woff" - } - },{ - "file": "fonts/KaTeX_SansSerif-Italic.woff", - "fields": { - "type": "application/font-woff", - "title": "$:/plugins/tiddlywiki/katex/fonts/KaTeX_SansSerif-Italic.woff" - } - },{ - "file": "fonts/KaTeX_SansSerif-Regular.woff", - "fields": { - "type": "application/font-woff", - "title": "$:/plugins/tiddlywiki/katex/fonts/KaTeX_SansSerif-Regular.woff" - } - },{ - "file": "fonts/KaTeX_Script-Regular.woff", - "fields": { - "type": "application/font-woff", - "title": "$:/plugins/tiddlywiki/katex/fonts/KaTeX_Script-Regular.woff" - } - },{ - "file": "fonts/KaTeX_Size1-Regular.woff", - "fields": { - "type": "application/font-woff", - "title": "$:/plugins/tiddlywiki/katex/fonts/KaTeX_Size1-Regular.woff" - } - },{ - "file": "fonts/KaTeX_Size2-Regular.woff", - "fields": { - "type": "application/font-woff", - "title": "$:/plugins/tiddlywiki/katex/fonts/KaTeX_Size2-Regular.woff" - } - },{ - "file": "fonts/KaTeX_Size3-Regular.woff", - "fields": { - "type": "application/font-woff", - "title": "$:/plugins/tiddlywiki/katex/fonts/KaTeX_Size3-Regular.woff" - } - },{ - "file": "fonts/KaTeX_Size4-Regular.woff", - "fields": { - "type": "application/font-woff", - "title": "$:/plugins/tiddlywiki/katex/fonts/KaTeX_Size4-Regular.woff" - } - },{ - "file": "fonts/KaTeX_Typewriter-Regular.woff", - "fields": { - "type": "application/font-woff", - "title": "$:/plugins/tiddlywiki/katex/fonts/KaTeX_Typewriter-Regular.woff" - } - },{ "file": "katex.without-font-face.min.css", "fields": { "type": "text/plain",