yerba 0.0.3a0.dev2__tar.gz → 0.2.0__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.
- {yerba-0.0.3a0.dev2 → yerba-0.2.0}/LICENSE +1 -1
- yerba-0.2.0/PKG-INFO +94 -0
- yerba-0.2.0/README.md +69 -0
- yerba-0.2.0/pyproject.toml +50 -0
- yerba-0.2.0/src/mate/__init__.py +74 -0
- yerba-0.2.0/src/mate/backends/__init__.py +3 -0
- yerba-0.2.0/src/mate/backends/typst.py +1391 -0
- yerba-0.2.0/src/mate/cli.py +51 -0
- yerba-0.2.0/src/mate/composition/__init__.py +5 -0
- yerba-0.2.0/src/mate/composition/arrange.py +130 -0
- yerba-0.2.0/src/mate/composition/layout.py +411 -0
- yerba-0.2.0/src/mate/composition/utils.py +32 -0
- yerba-0.2.0/src/mate/config.py +225 -0
- yerba-0.2.0/src/mate/core/__init__.py +25 -0
- yerba-0.2.0/src/mate/core/drawable.py +260 -0
- yerba-0.2.0/src/mate/core/element.py +648 -0
- yerba-0.2.0/src/mate/core/gradient.py +106 -0
- yerba-0.2.0/src/mate/core/presentation.py +145 -0
- yerba-0.2.0/src/mate/core/registry.py +49 -0
- yerba-0.2.0/src/mate/core/slide.py +126 -0
- yerba-0.2.0/src/mate/core/template.py +1044 -0
- yerba-0.2.0/src/mate/core/topic.py +23 -0
- yerba-0.2.0/src/mate/core/vec.py +46 -0
- yerba-0.2.0/src/mate/elements/__init__.py +40 -0
- yerba-0.2.0/src/mate/elements/code.py +433 -0
- yerba-0.2.0/src/mate/elements/group.py +146 -0
- yerba-0.2.0/src/mate/elements/image.py +131 -0
- yerba-0.2.0/src/mate/elements/shapes.py +706 -0
- yerba-0.2.0/src/mate/elements/spacing.py +108 -0
- yerba-0.2.0/src/mate/elements/text.py +766 -0
- yerba-0.2.0/src/mate/fonts/Lato/Lato-Black.ttf +0 -0
- yerba-0.2.0/src/mate/fonts/Lato/Lato-BlackItalic.ttf +0 -0
- yerba-0.2.0/src/mate/fonts/Lato/Lato-Bold.ttf +0 -0
- yerba-0.2.0/src/mate/fonts/Lato/Lato-BoldItalic.ttf +0 -0
- yerba-0.2.0/src/mate/fonts/Lato/Lato-Italic.ttf +0 -0
- yerba-0.2.0/src/mate/fonts/Lato/Lato-Light.ttf +0 -0
- yerba-0.2.0/src/mate/fonts/Lato/Lato-LightItalic.ttf +0 -0
- yerba-0.2.0/src/mate/fonts/Lato/Lato-Regular.ttf +0 -0
- yerba-0.2.0/src/mate/fonts/Lato/Lato-Thin.ttf +0 -0
- yerba-0.2.0/src/mate/fonts/Lato/Lato-ThinItalic.ttf +0 -0
- yerba-0.2.0/src/mate/fonts/Lato/OFL.txt +93 -0
- yerba-0.2.0/src/mate/fonts/PlayfairDisplay/OFL.txt +93 -0
- yerba-0.2.0/src/mate/fonts/PlayfairDisplay/PlayfairDisplay-Italic-VariableFont_wght.ttf +0 -0
- yerba-0.2.0/src/mate/fonts/PlayfairDisplay/PlayfairDisplay-VariableFont_wght.ttf +0 -0
- yerba-0.2.0/src/mate/fonts/README.md +6 -0
- yerba-0.2.0/src/mate/log.py +25 -0
- yerba-0.2.0/src/mate/parser/__init__.py +47 -0
- yerba-0.2.0/src/mate/parser/ir.py +223 -0
- yerba-0.2.0/src/mate/parser/markdown.py +366 -0
- yerba-0.2.0/src/mate/parser/markup.py +118 -0
- yerba-0.2.0/src/mate/parser/serialize.py +42 -0
- yerba-0.2.0/src/mate/templates/__init__.py +39 -0
- yerba-0.2.0/src/mate/templates/flow.py +242 -0
- yerba-0.2.0/src/mate/templates/simple.py +66 -0
- yerba-0.2.0/src/yerba.egg-info/PKG-INFO +94 -0
- yerba-0.2.0/src/yerba.egg-info/SOURCES.txt +59 -0
- yerba-0.2.0/src/yerba.egg-info/entry_points.txt +2 -0
- yerba-0.2.0/src/yerba.egg-info/requires.txt +7 -0
- yerba-0.2.0/src/yerba.egg-info/top_level.txt +1 -0
- yerba-0.0.3a0.dev2/PKG-INFO +0 -79
- yerba-0.0.3a0.dev2/README.md +0 -63
- yerba-0.0.3a0.dev2/pyproject.toml +0 -32
- yerba-0.0.3a0.dev2/yerba/__init__.py +0 -0
- yerba-0.0.3a0.dev2/yerba/__main__.py +0 -30
- yerba-0.0.3a0.dev2/yerba/base/__init__.py +0 -0
- yerba-0.0.3a0.dev2/yerba/base/box.py +0 -385
- yerba-0.0.3a0.dev2/yerba/base/image.py +0 -186
- yerba-0.0.3a0.dev2/yerba/base/parser.py +0 -167
- yerba-0.0.3a0.dev2/yerba/base/properties.py +0 -49
- yerba-0.0.3a0.dev2/yerba/base/slide.py +0 -194
- yerba-0.0.3a0.dev2/yerba/base/template.py +0 -887
- yerba-0.0.3a0.dev2/yerba/base/template_protocol.py +0 -147
- yerba-0.0.3a0.dev2/yerba/base/ytext.py +0 -206
- yerba-0.0.3a0.dev2/yerba/defaults.py +0 -73
- yerba-0.0.3a0.dev2/yerba/logger_setup.py +0 -28
- yerba-0.0.3a0.dev2/yerba/main_rutine.py +0 -205
- yerba-0.0.3a0.dev2/yerba/managers/__init__.py +0 -0
- yerba-0.0.3a0.dev2/yerba/managers/color_manager.py +0 -70
- yerba-0.0.3a0.dev2/yerba/managers/id_manager.py +0 -82
- yerba-0.0.3a0.dev2/yerba/managers/singleton.py +0 -13
- yerba-0.0.3a0.dev2/yerba/templates/__init__.py +0 -0
- yerba-0.0.3a0.dev2/yerba/templates/basic.py +0 -5
- yerba-0.0.3a0.dev2/yerba/templates/nice.py +0 -83
- yerba-0.0.3a0.dev2/yerba/utils/__init__.py +0 -0
- yerba-0.0.3a0.dev2/yerba/utils/aux_classes.py +0 -49
- yerba-0.0.3a0.dev2/yerba/utils/aux_functions.py +0 -159
- yerba-0.0.3a0.dev2/yerba/utils/constants.py +0 -36
- yerba-0.0.3a0.dev2/yerba/utils/latex.py +0 -154
- yerba-0.0.3a0.dev2/yerba.egg-info/PKG-INFO +0 -79
- yerba-0.0.3a0.dev2/yerba.egg-info/SOURCES.txt +0 -35
- yerba-0.0.3a0.dev2/yerba.egg-info/entry_points.txt +0 -2
- yerba-0.0.3a0.dev2/yerba.egg-info/requires.txt +0 -8
- yerba-0.0.3a0.dev2/yerba.egg-info/top_level.txt +0 -1
- {yerba-0.0.3a0.dev2 → yerba-0.2.0}/setup.cfg +0 -0
- {yerba-0.0.3a0.dev2 → yerba-0.2.0/src}/yerba.egg-info/dependency_links.txt +0 -0
yerba-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: yerba
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Python-driven presentation tool: Markdown decks laid out in Python, rendered to PDF
|
|
5
|
+
Author-email: "Bernardo L. Español" <esp.bernardo@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Repository, https://github.com/bersp/mate
|
|
8
|
+
Project-URL: Issues, https://github.com/bersp/mate/issues
|
|
9
|
+
Keywords: presentation,slides,markdown,pdf
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Topic :: Multimedia :: Graphics :: Presentation
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: numpy
|
|
18
|
+
Requires-Dist: typst>=0.14
|
|
19
|
+
Requires-Dist: rich>=13
|
|
20
|
+
Requires-Dist: markdown-it-py>=3
|
|
21
|
+
Requires-Dist: mdit-py-plugins>=0.4
|
|
22
|
+
Requires-Dist: pyyaml>=6
|
|
23
|
+
Requires-Dist: pygments>=2.15
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
<p align="center">
|
|
27
|
+
<a href="https://github.com/bersp/mate">
|
|
28
|
+
<img src="https://raw.githubusercontent.com/bersp/mate/master/.github/assets/logo.png" alt="mate" width="90%">
|
|
29
|
+
</a>
|
|
30
|
+
</p>
|
|
31
|
+
<br />
|
|
32
|
+
|
|
33
|
+
`mate` is a Python application for creating presentations by writing Markdown files. The goal is to build aesthetically pleasing presentations in a short amount of time while staying highly customizable and versatile: the content is plain Markdown, and the details can be tweaked with a short, clean syntax (or at least that's the intention).
|
|
34
|
+
|
|
35
|
+
The idea behind `mate` is to create slides fast, in a declarative and programmatic way, and let the template take care of arranging things and giving them their look. Since the content knows nothing about the aesthetics, restyling a whole presentation amounts to switching its template.
|
|
36
|
+
|
|
37
|
+
Templates get a lot of freedom and tools, and they are constructive: a template can be as small as a background change or as ambitious as a full visual identity, with its own functions and slide designs, and a deck can combine several of them.
|
|
38
|
+
|
|
39
|
+
## Features
|
|
40
|
+
|
|
41
|
+
- Slides are written in plain Markdown: `#` opens a slide, and bold, italics, code and math work as usual.
|
|
42
|
+
- Whatever Markdown cannot express, the extended syntax can: any element of a slide can be created, styled, positioned and aligned.
|
|
43
|
+
- Templates control fonts, colors, backgrounds and slide logic. Use a built-in one, or write your own as a small Python file next to your deck.
|
|
44
|
+
- Slides reveal their content in stages, with a versatile system of pauses, in-place reveals and overwrites.
|
|
45
|
+
- There is a drawing API as well: shapes, Bézier curves, images and gradients can go on a slide alongside the text.
|
|
46
|
+
- `mate` is fast: everything is heavily cached, so builds stay quick even for large decks.
|
|
47
|
+
- There is nothing else to install: no LaTeX, no external tools. The rendering backend ships inside the package.
|
|
48
|
+
|
|
49
|
+
## Getting started
|
|
50
|
+
|
|
51
|
+
_To get_ `mate`, _all you need is_ `yerba`:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pip install yerba
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Write a deck:
|
|
58
|
+
|
|
59
|
+
```markdown
|
|
60
|
+
# A slide title
|
|
61
|
+
|
|
62
|
+
Some content with **bold**, _italic_ and inline $x^2$ math.
|
|
63
|
+
|
|
64
|
+
Words can be styled in place: [this is red][color="red"], and
|
|
65
|
+
[this is translucent and smaller][opacity=0.4, fontsize=7].
|
|
66
|
+
|
|
67
|
+
> pause
|
|
68
|
+
|
|
69
|
+
- Bullet points work as usual
|
|
70
|
+
- and this list appears after the pause.
|
|
71
|
+
|
|
72
|
+
# Another slide
|
|
73
|
+
## With a subtitle
|
|
74
|
+
|
|
75
|
+
More content.
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
and build it:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
mate slides.md
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The PDF lands next to the source, as `slides.pdf`.
|
|
85
|
+
|
|
86
|
+
See the [docs](https://github.com/bersp/mate/blob/master/docs/README.md) for the full Markdown syntax, front matter, templates, and the Python API.
|
|
87
|
+
|
|
88
|
+
## Backends
|
|
89
|
+
|
|
90
|
+
The code is built to support different backends. Typst is the only one supported today; new backends will follow once the current one is fully functional and free of known bugs.
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
MIT. The bundled fonts keep their own licenses (SIL OFL 1.1, under `fonts/`).
|
yerba-0.2.0/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://github.com/bersp/mate">
|
|
3
|
+
<img src="https://raw.githubusercontent.com/bersp/mate/master/.github/assets/logo.png" alt="mate" width="90%">
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
<br />
|
|
7
|
+
|
|
8
|
+
`mate` is a Python application for creating presentations by writing Markdown files. The goal is to build aesthetically pleasing presentations in a short amount of time while staying highly customizable and versatile: the content is plain Markdown, and the details can be tweaked with a short, clean syntax (or at least that's the intention).
|
|
9
|
+
|
|
10
|
+
The idea behind `mate` is to create slides fast, in a declarative and programmatic way, and let the template take care of arranging things and giving them their look. Since the content knows nothing about the aesthetics, restyling a whole presentation amounts to switching its template.
|
|
11
|
+
|
|
12
|
+
Templates get a lot of freedom and tools, and they are constructive: a template can be as small as a background change or as ambitious as a full visual identity, with its own functions and slide designs, and a deck can combine several of them.
|
|
13
|
+
|
|
14
|
+
## Features
|
|
15
|
+
|
|
16
|
+
- Slides are written in plain Markdown: `#` opens a slide, and bold, italics, code and math work as usual.
|
|
17
|
+
- Whatever Markdown cannot express, the extended syntax can: any element of a slide can be created, styled, positioned and aligned.
|
|
18
|
+
- Templates control fonts, colors, backgrounds and slide logic. Use a built-in one, or write your own as a small Python file next to your deck.
|
|
19
|
+
- Slides reveal their content in stages, with a versatile system of pauses, in-place reveals and overwrites.
|
|
20
|
+
- There is a drawing API as well: shapes, Bézier curves, images and gradients can go on a slide alongside the text.
|
|
21
|
+
- `mate` is fast: everything is heavily cached, so builds stay quick even for large decks.
|
|
22
|
+
- There is nothing else to install: no LaTeX, no external tools. The rendering backend ships inside the package.
|
|
23
|
+
|
|
24
|
+
## Getting started
|
|
25
|
+
|
|
26
|
+
_To get_ `mate`, _all you need is_ `yerba`:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install yerba
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Write a deck:
|
|
33
|
+
|
|
34
|
+
```markdown
|
|
35
|
+
# A slide title
|
|
36
|
+
|
|
37
|
+
Some content with **bold**, _italic_ and inline $x^2$ math.
|
|
38
|
+
|
|
39
|
+
Words can be styled in place: [this is red][color="red"], and
|
|
40
|
+
[this is translucent and smaller][opacity=0.4, fontsize=7].
|
|
41
|
+
|
|
42
|
+
> pause
|
|
43
|
+
|
|
44
|
+
- Bullet points work as usual
|
|
45
|
+
- and this list appears after the pause.
|
|
46
|
+
|
|
47
|
+
# Another slide
|
|
48
|
+
## With a subtitle
|
|
49
|
+
|
|
50
|
+
More content.
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
and build it:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
mate slides.md
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The PDF lands next to the source, as `slides.pdf`.
|
|
60
|
+
|
|
61
|
+
See the [docs](https://github.com/bersp/mate/blob/master/docs/README.md) for the full Markdown syntax, front matter, templates, and the Python API.
|
|
62
|
+
|
|
63
|
+
## Backends
|
|
64
|
+
|
|
65
|
+
The code is built to support different backends. Typst is the only one supported today; new backends will follow once the current one is fully functional and free of known bugs.
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
MIT. The bundled fonts keep their own licenses (SIL OFL 1.1, under `fonts/`).
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "yerba"
|
|
7
|
+
version = "0.2.0"
|
|
8
|
+
description = "Python-driven presentation tool: Markdown decks laid out in Python, rendered to PDF"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
dependencies = ["numpy", "typst>=0.14", "rich>=13", "markdown-it-py>=3", "mdit-py-plugins>=0.4", "pyyaml>=6", "pygments>=2.15"]
|
|
14
|
+
authors = [
|
|
15
|
+
{name = "Bernardo L. Español", email = "esp.bernardo@gmail.com"},
|
|
16
|
+
]
|
|
17
|
+
keywords = ["presentation", "slides", "markdown", "pdf"]
|
|
18
|
+
classifiers = [
|
|
19
|
+
"Development Status :: 3 - Alpha",
|
|
20
|
+
"Environment :: Console",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Topic :: Multimedia :: Graphics :: Presentation",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
[project.urls]
|
|
26
|
+
Repository = "https://github.com/bersp/mate"
|
|
27
|
+
Issues = "https://github.com/bersp/mate/issues"
|
|
28
|
+
|
|
29
|
+
[project.scripts]
|
|
30
|
+
mate = "mate.cli:main"
|
|
31
|
+
|
|
32
|
+
[tool.setuptools.packages.find]
|
|
33
|
+
where = ["src"]
|
|
34
|
+
|
|
35
|
+
[tool.setuptools.package-data]
|
|
36
|
+
mate = ["fonts/*/*.ttf", "fonts/*/OFL.txt", "fonts/README.md"]
|
|
37
|
+
|
|
38
|
+
[tool.ruff]
|
|
39
|
+
line-length = 88
|
|
40
|
+
|
|
41
|
+
[tool.ruff.lint]
|
|
42
|
+
# E/W: pycodestyle (E501 enforces the line width on every line, docstrings included)
|
|
43
|
+
# F: pyflakes D: pydocstyle (docstring style)
|
|
44
|
+
select = ["E", "F", "W", "D"]
|
|
45
|
+
# Docstrings are written only when they add information, so the
|
|
46
|
+
# "missing docstring" family is not enforced; only docstring *style* is.
|
|
47
|
+
ignore = ["D100", "D101", "D102", "D103", "D104", "D105", "D106", "D107"]
|
|
48
|
+
|
|
49
|
+
[tool.ruff.lint.pydocstyle]
|
|
50
|
+
convention = "numpy"
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
from .config import config
|
|
2
|
+
from .core import (
|
|
3
|
+
Vec,
|
|
4
|
+
Anchor,
|
|
5
|
+
Element,
|
|
6
|
+
Drawable,
|
|
7
|
+
Gradient,
|
|
8
|
+
PresentationTemplateBase,
|
|
9
|
+
Presentation,
|
|
10
|
+
Slide,
|
|
11
|
+
Snapshot,
|
|
12
|
+
IDRegistry,
|
|
13
|
+
id_registry,
|
|
14
|
+
measure_all,
|
|
15
|
+
)
|
|
16
|
+
from .elements import (
|
|
17
|
+
Circle,
|
|
18
|
+
Code,
|
|
19
|
+
Close,
|
|
20
|
+
CubicTo,
|
|
21
|
+
Curve,
|
|
22
|
+
CurveSegment,
|
|
23
|
+
Ellipse,
|
|
24
|
+
Group,
|
|
25
|
+
HSpace,
|
|
26
|
+
Image,
|
|
27
|
+
Line,
|
|
28
|
+
LineTo,
|
|
29
|
+
MoveTo,
|
|
30
|
+
Polygon,
|
|
31
|
+
QuadTo,
|
|
32
|
+
Rectangle,
|
|
33
|
+
Text,
|
|
34
|
+
VSpace,
|
|
35
|
+
)
|
|
36
|
+
from .composition import arrange, Layout, Region, layout_to_group
|
|
37
|
+
|
|
38
|
+
__all__ = [
|
|
39
|
+
"Vec",
|
|
40
|
+
"Anchor",
|
|
41
|
+
"Element",
|
|
42
|
+
"Drawable",
|
|
43
|
+
"Gradient",
|
|
44
|
+
"PresentationTemplateBase",
|
|
45
|
+
"Presentation",
|
|
46
|
+
"Slide",
|
|
47
|
+
"Snapshot",
|
|
48
|
+
"Circle",
|
|
49
|
+
"Close",
|
|
50
|
+
"Code",
|
|
51
|
+
"CubicTo",
|
|
52
|
+
"Curve",
|
|
53
|
+
"CurveSegment",
|
|
54
|
+
"Ellipse",
|
|
55
|
+
"Group",
|
|
56
|
+
"HSpace",
|
|
57
|
+
"Image",
|
|
58
|
+
"Line",
|
|
59
|
+
"LineTo",
|
|
60
|
+
"MoveTo",
|
|
61
|
+
"Polygon",
|
|
62
|
+
"QuadTo",
|
|
63
|
+
"Rectangle",
|
|
64
|
+
"Text",
|
|
65
|
+
"VSpace",
|
|
66
|
+
"IDRegistry",
|
|
67
|
+
"id_registry",
|
|
68
|
+
"measure_all",
|
|
69
|
+
"config",
|
|
70
|
+
"arrange",
|
|
71
|
+
"Layout",
|
|
72
|
+
"Region",
|
|
73
|
+
"layout_to_group",
|
|
74
|
+
]
|