Skip to content

Commit

Permalink
feat: search and replace in title and content (#616)
Browse files Browse the repository at this point in the history
  • Loading branch information
akosbalasko authored Mar 1, 2024
1 parent 2f1c36a commit 5b10a27
Show file tree
Hide file tree
Showing 36 changed files with 345 additions and 114 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,18 @@ To configure Yarle, you must create a config file. By default it looks like this
"?": "_",
"*": "_"
},
"globalReplacementSettings": [
{
"type": "title" ,
"regex": "X",
"replace": "<replaced_X>"
},
{
"type": "content",
"regex": "a",
"replace": "<replaced_a>"
}
]
"resourcesDir": "resources",
"turndownOptions": {
"headingStyle": "atx"
Expand Down Expand Up @@ -201,6 +213,7 @@ The following configurational properties are available:
| ```sanitizeResourceNameSpaces``` | true or false | Replace spaces in resource names with the `replacementChar`. e.g "linked file.jpg" will be converted to "linked_file.jpg"
| ```replacementChar``` | string | the replacement character. e.g "linked*file.jpg" will be converted to "linked_file.jpg". It defaults to "_"
| ```replacementCharacterMap``` | JSON Object | it contains character key-value pairs, the keys will be replaced by the proper values in the filename
| ```globalReplacementSettings``` | JSON Array | it contains search and replace pairs, the keys will be replaced by the proper values according to the given type (title or content). Please note: this property has to be in valid JSON Array format, and each item has to have <b>type</b> ('title' or 'content'), <b>regex</b> (what you want to replace as a valid regular expression) and <b>replace</b> (what you want to push instead of the matched text) properties)
| ```keepOriginalAmountOfNewlines``` | true or false | keep the original amount of newlines, default is false, when the multiple newlines are collapsed to one.
```generateNakedUrls``` | true or false | if it's true, Yarle generates 'naked' external Urls without any extra characters. If its false, external Urls are wrapped by '<' and '>' characters
| ```addExtensionToInternalLinks``` | true or false | adds '.md' extensions at the end of internal file links, to make them recognizable by DevonThink and other tools
Expand Down
12 changes: 12 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@
"?": "_",
"*": "_"
},
"globalReplacementSettings": [
{
"type": "title" ,
"regex": "",
"replace": ""
},
{
"type": "content",
"regex": "",
"replace": ""
}
],
"logseqSettings": {
"journalNotes": false
},
Expand Down
12 changes: 12 additions & 0 deletions config.logseq.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@
"?": "_",
"*": "_"
},
"globalReplacementSettings": [
{
"type": "title" ,
"regex": "",
"replace": ""
},
{
"type": "content",
"regex": "",
"replace": ""
}
],
"pathSeparator": "/",
"resourcesDir": "assets",
"turndownOptions": {
Expand Down
12 changes: 12 additions & 0 deletions config.tana.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@
"?": "_",
"*": "_"
},
"globalReplacementSettings": [
{
"type": "title" ,
"regex": "",
"replace": ""
},
{
"type": "content",
"regex": "",
"replace": ""
}
],
"generateNakedUrls": true,
"logseqSettings": {
"journalNotes": false
Expand Down
Loading

0 comments on commit 5b10a27

Please sign in to comment.