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.
Files changed (95) hide show
  1. {yerba-0.0.3a0.dev2 → yerba-0.2.0}/LICENSE +1 -1
  2. yerba-0.2.0/PKG-INFO +94 -0
  3. yerba-0.2.0/README.md +69 -0
  4. yerba-0.2.0/pyproject.toml +50 -0
  5. yerba-0.2.0/src/mate/__init__.py +74 -0
  6. yerba-0.2.0/src/mate/backends/__init__.py +3 -0
  7. yerba-0.2.0/src/mate/backends/typst.py +1391 -0
  8. yerba-0.2.0/src/mate/cli.py +51 -0
  9. yerba-0.2.0/src/mate/composition/__init__.py +5 -0
  10. yerba-0.2.0/src/mate/composition/arrange.py +130 -0
  11. yerba-0.2.0/src/mate/composition/layout.py +411 -0
  12. yerba-0.2.0/src/mate/composition/utils.py +32 -0
  13. yerba-0.2.0/src/mate/config.py +225 -0
  14. yerba-0.2.0/src/mate/core/__init__.py +25 -0
  15. yerba-0.2.0/src/mate/core/drawable.py +260 -0
  16. yerba-0.2.0/src/mate/core/element.py +648 -0
  17. yerba-0.2.0/src/mate/core/gradient.py +106 -0
  18. yerba-0.2.0/src/mate/core/presentation.py +145 -0
  19. yerba-0.2.0/src/mate/core/registry.py +49 -0
  20. yerba-0.2.0/src/mate/core/slide.py +126 -0
  21. yerba-0.2.0/src/mate/core/template.py +1044 -0
  22. yerba-0.2.0/src/mate/core/topic.py +23 -0
  23. yerba-0.2.0/src/mate/core/vec.py +46 -0
  24. yerba-0.2.0/src/mate/elements/__init__.py +40 -0
  25. yerba-0.2.0/src/mate/elements/code.py +433 -0
  26. yerba-0.2.0/src/mate/elements/group.py +146 -0
  27. yerba-0.2.0/src/mate/elements/image.py +131 -0
  28. yerba-0.2.0/src/mate/elements/shapes.py +706 -0
  29. yerba-0.2.0/src/mate/elements/spacing.py +108 -0
  30. yerba-0.2.0/src/mate/elements/text.py +766 -0
  31. yerba-0.2.0/src/mate/fonts/Lato/Lato-Black.ttf +0 -0
  32. yerba-0.2.0/src/mate/fonts/Lato/Lato-BlackItalic.ttf +0 -0
  33. yerba-0.2.0/src/mate/fonts/Lato/Lato-Bold.ttf +0 -0
  34. yerba-0.2.0/src/mate/fonts/Lato/Lato-BoldItalic.ttf +0 -0
  35. yerba-0.2.0/src/mate/fonts/Lato/Lato-Italic.ttf +0 -0
  36. yerba-0.2.0/src/mate/fonts/Lato/Lato-Light.ttf +0 -0
  37. yerba-0.2.0/src/mate/fonts/Lato/Lato-LightItalic.ttf +0 -0
  38. yerba-0.2.0/src/mate/fonts/Lato/Lato-Regular.ttf +0 -0
  39. yerba-0.2.0/src/mate/fonts/Lato/Lato-Thin.ttf +0 -0
  40. yerba-0.2.0/src/mate/fonts/Lato/Lato-ThinItalic.ttf +0 -0
  41. yerba-0.2.0/src/mate/fonts/Lato/OFL.txt +93 -0
  42. yerba-0.2.0/src/mate/fonts/PlayfairDisplay/OFL.txt +93 -0
  43. yerba-0.2.0/src/mate/fonts/PlayfairDisplay/PlayfairDisplay-Italic-VariableFont_wght.ttf +0 -0
  44. yerba-0.2.0/src/mate/fonts/PlayfairDisplay/PlayfairDisplay-VariableFont_wght.ttf +0 -0
  45. yerba-0.2.0/src/mate/fonts/README.md +6 -0
  46. yerba-0.2.0/src/mate/log.py +25 -0
  47. yerba-0.2.0/src/mate/parser/__init__.py +47 -0
  48. yerba-0.2.0/src/mate/parser/ir.py +223 -0
  49. yerba-0.2.0/src/mate/parser/markdown.py +366 -0
  50. yerba-0.2.0/src/mate/parser/markup.py +118 -0
  51. yerba-0.2.0/src/mate/parser/serialize.py +42 -0
  52. yerba-0.2.0/src/mate/templates/__init__.py +39 -0
  53. yerba-0.2.0/src/mate/templates/flow.py +242 -0
  54. yerba-0.2.0/src/mate/templates/simple.py +66 -0
  55. yerba-0.2.0/src/yerba.egg-info/PKG-INFO +94 -0
  56. yerba-0.2.0/src/yerba.egg-info/SOURCES.txt +59 -0
  57. yerba-0.2.0/src/yerba.egg-info/entry_points.txt +2 -0
  58. yerba-0.2.0/src/yerba.egg-info/requires.txt +7 -0
  59. yerba-0.2.0/src/yerba.egg-info/top_level.txt +1 -0
  60. yerba-0.0.3a0.dev2/PKG-INFO +0 -79
  61. yerba-0.0.3a0.dev2/README.md +0 -63
  62. yerba-0.0.3a0.dev2/pyproject.toml +0 -32
  63. yerba-0.0.3a0.dev2/yerba/__init__.py +0 -0
  64. yerba-0.0.3a0.dev2/yerba/__main__.py +0 -30
  65. yerba-0.0.3a0.dev2/yerba/base/__init__.py +0 -0
  66. yerba-0.0.3a0.dev2/yerba/base/box.py +0 -385
  67. yerba-0.0.3a0.dev2/yerba/base/image.py +0 -186
  68. yerba-0.0.3a0.dev2/yerba/base/parser.py +0 -167
  69. yerba-0.0.3a0.dev2/yerba/base/properties.py +0 -49
  70. yerba-0.0.3a0.dev2/yerba/base/slide.py +0 -194
  71. yerba-0.0.3a0.dev2/yerba/base/template.py +0 -887
  72. yerba-0.0.3a0.dev2/yerba/base/template_protocol.py +0 -147
  73. yerba-0.0.3a0.dev2/yerba/base/ytext.py +0 -206
  74. yerba-0.0.3a0.dev2/yerba/defaults.py +0 -73
  75. yerba-0.0.3a0.dev2/yerba/logger_setup.py +0 -28
  76. yerba-0.0.3a0.dev2/yerba/main_rutine.py +0 -205
  77. yerba-0.0.3a0.dev2/yerba/managers/__init__.py +0 -0
  78. yerba-0.0.3a0.dev2/yerba/managers/color_manager.py +0 -70
  79. yerba-0.0.3a0.dev2/yerba/managers/id_manager.py +0 -82
  80. yerba-0.0.3a0.dev2/yerba/managers/singleton.py +0 -13
  81. yerba-0.0.3a0.dev2/yerba/templates/__init__.py +0 -0
  82. yerba-0.0.3a0.dev2/yerba/templates/basic.py +0 -5
  83. yerba-0.0.3a0.dev2/yerba/templates/nice.py +0 -83
  84. yerba-0.0.3a0.dev2/yerba/utils/__init__.py +0 -0
  85. yerba-0.0.3a0.dev2/yerba/utils/aux_classes.py +0 -49
  86. yerba-0.0.3a0.dev2/yerba/utils/aux_functions.py +0 -159
  87. yerba-0.0.3a0.dev2/yerba/utils/constants.py +0 -36
  88. yerba-0.0.3a0.dev2/yerba/utils/latex.py +0 -154
  89. yerba-0.0.3a0.dev2/yerba.egg-info/PKG-INFO +0 -79
  90. yerba-0.0.3a0.dev2/yerba.egg-info/SOURCES.txt +0 -35
  91. yerba-0.0.3a0.dev2/yerba.egg-info/entry_points.txt +0 -2
  92. yerba-0.0.3a0.dev2/yerba.egg-info/requires.txt +0 -8
  93. yerba-0.0.3a0.dev2/yerba.egg-info/top_level.txt +0 -1
  94. {yerba-0.0.3a0.dev2 → yerba-0.2.0}/setup.cfg +0 -0
  95. {yerba-0.0.3a0.dev2 → yerba-0.2.0/src}/yerba.egg-info/dependency_links.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 Bernardo Español
3
+ Copyright (c) 2026 Bernardo L. Español
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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
+ ]
@@ -0,0 +1,3 @@
1
+ from .typst import TypstRenderer, TypstMeasurer
2
+
3
+ __all__ = ["TypstRenderer", "TypstMeasurer"]