Skip to content

Commit 2b1f161

Browse files
committed
v3.4.0b1
1 parent 7b2242e commit 2b1f161

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
## Unreleased
66

7+
## 3.4.0b1 - 2023-11-28
8+
9+
### Changed
10+
- Include first batch of block coding images.
11+
712
## 3.3.0 - 2023-11-24
813

914
### Changed

doc/common/extensions/blockimg.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from docutils.nodes import image, paragraph
77
from pathlib import Path
88

9-
SPHINX_DOC = "main"
109
SPHINX_IMAGE_PATH = "blockimg"
1110

1211
SVG_SCALE = 0.9
@@ -22,6 +21,10 @@ def get_svg_size(file_path):
2221
return float(width), float(height)
2322

2423

24+
# Global variable to store the app object
25+
app = None
26+
27+
2528
class BlockImageDirective(Image):
2629
option_spec = Image.option_spec.copy()
2730
option_spec["stack"] = directives.flag
@@ -30,7 +33,7 @@ def run(self):
3033
# Adjust the image path
3134
file_name = self.arguments[0] + ".svg"
3235
self.arguments[0] = "/" + SPHINX_IMAGE_PATH + "/" + file_name
33-
path = Path(os.getcwd()) / SPHINX_DOC / SPHINX_IMAGE_PATH / file_name
36+
path = Path(app.srcdir) / SPHINX_IMAGE_PATH / file_name
3437

3538
# Set it to the scaled SVG size unless width explicitly set.
3639
if self.options.get("width") is None:
@@ -51,5 +54,7 @@ def run(self):
5154
return nodes
5255

5356

54-
def setup(app):
57+
def setup(apparg):
58+
global app
59+
app = apparg
5560
app.add_directive("blockimg", BlockImageDirective)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pybricks"
3-
version = "3.3.0"
3+
version = "3.4.0b1"
44
description = "Documentation and user-API stubs for Pybricks MicroPython"
55
authors = ["The Pybricks Authors <[email protected]>"]
66
maintainers = ["Laurens Valk <[email protected]>", "David Lechner <[email protected]>" ]

0 commit comments

Comments
 (0)