1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-01 15:46:18 +00:00
TiddlyWiki5/plugins/tiddlywiki/text-slicer/modules/rules/html-by-heading.tid
Jermolene e344c38349 Major updates to text-slicer plugin
* In the interests of performance and expressiveness, switched to using a Sax parser instead of a DOM implementation.
* Use extensible declarative rules to control the slicing process
* Added new optional set of rules for slicing by heading, where the paragraphs underneath a heading are packed into the same tiddler as the heading
* Added a modal dialogue for specifying parameters when slicing in the browser
2017-12-14 14:16:54 +00:00

190 lines
2.9 KiB
Plaintext

title: $:/plugins/tiddlywiki/text-slicer/slicer-rules/html-by-heading.json
name: html-by-heading
caption: By Heading (HTML)
description: One tiddler per heading, threaded (HTML)
inherits-from: html-by-paragraph
type: application/json
tags: $:/tags/text-slicer/slicer-rules
[
{
"selector": "address,center,fieldset,form,hr,iframe,isindex,noframes,noscript,ol,ul,li,pre,table",
"actions": {}
},
{
"selector": "blockquote",
"actions": {
"markup": {
"wiki": {
"prefix": "<<<\n",
"suffix": "<<<\n"
}
}
}
},
{
"selector": "dd",
"actions": {
"markup": {
"wiki": {
"prefix": "\n: ",
"suffix": "\n"
}
}
}
},
{
"selector": "dl",
"actions": {
"markup": {
"wiki": {
"prefix": "\n",
"suffix": "\n"
}
}
}
},
{
"selector": "dt",
"actions": {
"markup": {
"wiki": {
"prefix": "\n; ",
"suffix": "\n"
}
}
}
},
{
"selector": "h1",
"actions": {
"startNewChunk": {
"toc-type": "heading",
"toc-heading-level": "h1"
},
"mergeNext": true,
"setCaption": true,
"isParent": true,
"headingLevel": 1,
"markup": {
"wiki": {
"prefix": "! ",
"suffix": "\n"
}
}
}
},
{
"selector": "h2",
"actions": {
"startNewChunk": {
"toc-type": "heading",
"toc-heading-level": "h2"
},
"mergeNext": true,
"setCaption": true,
"isParent": true,
"headingLevel": 2,
"markup": {
"wiki": {
"prefix": "!! ",
"suffix": "\n"
}
}
}
},
{
"selector": "h3",
"actions": {
"startNewChunk": {
"toc-type": "heading",
"toc-heading-level": "h3"
},
"mergeNext": true,
"setCaption": true,
"isParent": true,
"headingLevel": 3,
"markup": {
"wiki": {
"prefix": "!!! ",
"suffix": "\n"
}
}
}
},
{
"selector": "h4",
"actions": {
"startNewChunk": {
"toc-type": "heading",
"toc-heading-level": "h4"
},
"mergeNext": true,
"setCaption": true,
"isParent": true,
"headingLevel": 4,
"markup": {
"wiki": {
"prefix": "!!!! ",
"suffix": "\n"
}
}
}
},
{
"selector": "h5",
"actions": {
"startNewChunk": {
"toc-type": "heading",
"toc-heading-level": "h5"
},
"mergeNext": true,
"setCaption": true,
"isParent": true,
"headingLevel": 5,
"markup": {
"wiki": {
"prefix": "!!!!! ",
"suffix": "\n"
}
}
}
},
{
"selector": "h6",
"actions": {
"startNewChunk": {
"toc-type": "heading",
"toc-heading-level": "h6"
},
"mergeNext": true,
"setCaption": true,
"isParent": true,
"headingLevel": 6,
"markup": {
"wiki": {
"prefix": "!!!!!! ",
"suffix": "\n"
}
}
}
},
{
"selector": "p",
"actions": {
"markup": {
"wiki": {
"prefix": "",
"suffix": "\n"
}
}
}
},
{
"selector": "*",
"actions": {
"dontRenderTag": true
}
}
]