entangled-cli 2.1.3__tar.gz → 2.1.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/PKG-INFO +3 -1
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/README.md +2 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/filedb.py +1 -1
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/hooks/quarto_attributes.py +5 -1
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/transaction.py +8 -1
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/pyproject.toml +1 -1
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/LICENSE +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/__init__.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/code_reader.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/commands/__init__.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/commands/brei.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/commands/new.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/commands/status.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/commands/stitch.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/commands/sync.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/commands/tangle.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/commands/watch.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/config/__init__.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/config/language.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/config/templates.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/config/version.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/construct.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/document.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/errors/__init__.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/errors/internal.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/errors/user.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/hooks/__init__.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/hooks/base.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/hooks/build.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/hooks/shebang.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/hooks/task.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/logging.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/main.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/markdown_reader.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/parsing.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/properties.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/py.typed +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/status.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/tangle.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/text_location.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/utility.py +0 -0
- {entangled_cli-2.1.3 → entangled_cli-2.1.5}/entangled/version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: entangled-cli
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.5
|
|
4
4
|
Summary: Literate Programming toolbox
|
|
5
5
|
Home-page: https://entangled.github.io/
|
|
6
6
|
License: Apache 2
|
|
@@ -298,6 +298,8 @@ if __name__ == "__main__":
|
|
|
298
298
|
```
|
|
299
299
|
~~~
|
|
300
300
|
|
|
301
|
+
The `id` attribute is reserved for the code's identifier (normally indicated with `#`) and the `classes` attribute can be used to indicate a list of classes in addition to the language class already given.
|
|
302
|
+
|
|
301
303
|
## Brei
|
|
302
304
|
Entangled has a small build engine (similar to GNU Make) embedded, called Brei. You may give it a list of tasks (specified in TOML) that may depend on one another. Brei will run these when dependencies are newer than the target. Execution is lazy and in parallel. Brei supports:
|
|
303
305
|
|
|
@@ -271,6 +271,8 @@ if __name__ == "__main__":
|
|
|
271
271
|
```
|
|
272
272
|
~~~
|
|
273
273
|
|
|
274
|
+
The `id` attribute is reserved for the code's identifier (normally indicated with `#`) and the `classes` attribute can be used to indicate a list of classes in addition to the language class already given.
|
|
275
|
+
|
|
274
276
|
## Brei
|
|
275
277
|
Entangled has a small build engine (similar to GNU Make) embedded, called Brei. You may give it a list of tasks (specified in TOML) that may depend on one another. Brei will run these when dependencies are newer than the target. Execution is lazy and in parallel. Brei supports:
|
|
276
278
|
|
|
@@ -20,7 +20,7 @@ def hexdigest(s: str) -> str:
|
|
|
20
20
|
"""Creates a MD5 hash digest from a string. Before hashing, the string has
|
|
21
21
|
linefeed `\\r` characters and trailing newlines removed, and the string
|
|
22
22
|
is encoded as UTF-8."""
|
|
23
|
-
content = s.replace("\r", "").rstrip(
|
|
23
|
+
content = s.replace("\r", "").rstrip().encode()
|
|
24
24
|
return hashlib.sha256(content).hexdigest()
|
|
25
25
|
|
|
26
26
|
|
|
@@ -3,7 +3,7 @@ from dataclasses import dataclass
|
|
|
3
3
|
from itertools import takewhile
|
|
4
4
|
import yaml
|
|
5
5
|
|
|
6
|
-
from ..properties import Attribute, Id
|
|
6
|
+
from ..properties import Attribute, Class, Id
|
|
7
7
|
from ..document import ReferenceId, ReferenceMap, CodeBlock
|
|
8
8
|
from .base import HookBase
|
|
9
9
|
from ..logging import logger
|
|
@@ -37,6 +37,10 @@ class Hook(HookBase):
|
|
|
37
37
|
|
|
38
38
|
if "id" in attrs:
|
|
39
39
|
code.properties.append(Id(attrs["id"]))
|
|
40
|
+
|
|
41
|
+
if "classes" in attrs:
|
|
42
|
+
code.properties.extend(Class(c) for c in attrs["classes"])
|
|
43
|
+
|
|
40
44
|
code.properties.extend(Attribute(k, v) for k, v in attrs.items())
|
|
41
45
|
|
|
42
46
|
log.debug("quarto attributes: %s", attrs)
|
|
@@ -75,6 +75,13 @@ class Create(Action):
|
|
|
75
75
|
return f"create `{self.target}`"
|
|
76
76
|
|
|
77
77
|
|
|
78
|
+
def assure_final_newline(str) -> str:
|
|
79
|
+
if str[-1] != "\n":
|
|
80
|
+
return str + "\n"
|
|
81
|
+
else:
|
|
82
|
+
return str
|
|
83
|
+
|
|
84
|
+
|
|
78
85
|
@dataclass
|
|
79
86
|
class Write(Action):
|
|
80
87
|
content: str
|
|
@@ -96,7 +103,7 @@ class Write(Action):
|
|
|
96
103
|
tmp_dir = Path() / ".entangled" / "tmp"
|
|
97
104
|
tmp_dir.mkdir(exist_ok=True, parents=True)
|
|
98
105
|
with tempfile.NamedTemporaryFile(mode="w", delete=False, dir=tmp_dir) as f:
|
|
99
|
-
f.write(self.content)
|
|
106
|
+
f.write(assure_final_newline(self.content))
|
|
100
107
|
# Flush and sync contents to disk
|
|
101
108
|
f.flush()
|
|
102
109
|
if self.mode is not None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|