mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-25 02:57:19 +00:00
e344c38349
* 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
190 lines
2.9 KiB
Plaintext
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
|
|
}
|
|
}
|
|
]
|