Automation in the browser.
Example:
$op: pipe
do:
- title:
$op: doc.get
key: title
url:
$op: doc.get
key:
- location
- href
text:
$op: html.markdown
html:
$op: html.simplify
html:
$op: doc.get
key:
- documentElement
- outerHTML
- $op: fs.saveFile
filename:
$op: str.join
values:
- $op: get
key: title
- ".md"
content:
$op: template.render
template: |
---
title: {{title}}
url: {{url}}
---
{{text}}
The config
is a program that is computed using the following rules:
- If an object contains the key
$op
, it is interpreted as anoperator
, the other keys of this object are parameters of theoperator
- Operators transform the
context
according to their logic and specified parameters - Rest values interprets as is
- Calculation is a depth-first search
- Initial
context
is asecrets
data
The data which contains sensitive information and stored locally.
Example of secrets
data:
token: Bearer token
Full documentation of operators is available in the operators section and on the options
page of the extension.
If you need to include code from other files, you can use the $ref
key.
Example:
$ref: "./<filename>#<selector>"
<filename>
is a name of the file<selector>
is JSONPath selector- One of the parameters can be omitted (e.g.
./<filename>
,#<selector>
)
- If you need a simple tool to save web content to Obsidian, try obsidian-web.
- Simple build automation tool mk