adder_op
This module contains the classes that represent Obsidian adder operators.
Operators make it possible to create very specific ways to adding content to notes. They are generally used together with AdderWhere.
Op(operator: str)
Bases: ABC
Base class for all adder operators.
Source code in pyobsidian/adder_op.py
16 17 18 |
|
id: str
abstractmethod
property
The identifier of the operator.
build_operator(operator: str) -> Any
abstractmethod
Build the operator.
Parameters:
-
operator
(str
) –The operator string.
Returns:
-
Any
–The operator.
Source code in pyobsidian/adder_op.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
OpMkHeader(operator: str)
Bases: Op
Adder operator mkheader.
From the operator is obtained:
- Precedence represents whether it will be added before or after. '|>' or '<|'
- The level indicates the header level (1, 2, 3 etc)
- The index represents which level will be applied.
For example OpMkHeader('|>{3}h2') creates precedence '|>', level 2 and index 3 The translation of this operator would be "after the third h2".
This structure can be used by AdderWhere to add content based on the order of headers.
Parameters:
-
operator
(str
) –The operator string.
Source code in pyobsidian/adder_op.py
69 70 71 |
|
build_operator(operator: str) -> dict[str, str]
Build the operator.
Parameters:
-
operator
(str
) –The operator string.
Returns:
-
dict[str, str]
–The operator.
Source code in pyobsidian/adder_op.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
|