Skip to content

Commit

Permalink
feat: update beet
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Jul 21, 2024
1 parent 04aeded commit a5e7980
Show file tree
Hide file tree
Showing 68 changed files with 89 additions and 81 deletions.
14 changes: 11 additions & 3 deletions lectern/serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@
)
from urllib.parse import urlparse

from beet import DataPack, File, NamespaceFile, ResourcePack, TextFile, TextFileBase
from beet import (
DataPack,
File,
NamespaceFile,
ResourcePack,
TextFile,
TextFileBase,
get_output_scope,
)
from beet.core.utils import normalize_string

EXTENSION_HIGHLIGHTING = {
Expand Down Expand Up @@ -240,7 +248,7 @@ def serialize_pack(
if file_type in mapping
else (
extra_directive,
f"{namespace.directory}/{name}/{'/'.join(file_type.scope)}/{path}{file_type.extension}",
f"{namespace.directory}/{name}/{'/'.join(get_output_scope(file_type.scope, pack.pack_format))}/{path}{file_type.extension}",
file_instance,
)
)
Expand Down Expand Up @@ -370,7 +378,7 @@ def serialize_pack(
yield from self.format_serialized_file(
self.serialize_file_instance(
pack_directive,
f"{namespace.directory}/{name}/{'/'.join(file_type.scope)}/{path}{file_type.extension}",
f"{namespace.directory}/{name}/{'/'.join(get_output_scope(file_type.scope, pack.pack_format))}/{path}{file_type.extension}",
file_instance, # type: ignore
external_files,
external_prefix,
Expand Down
10 changes: 5 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ include = ["lectern/py.typed"]

[tool.poetry.dependencies]
python = "^3.10"
beet = ">=0.104.1"
beet = ">=0.108.0"
markdown-it-py = "^3.0.0"
click = "^8.1.7"

Expand Down
4 changes: 2 additions & 2 deletions tests/snapshots/examples__beet_project__0.pack.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand Down Expand Up @@ -449,7 +449,7 @@ tellraw @a ["", {"text": "hello", "color": "red"}]
```json
{
"pack": {
"pack_format": 22,
"pack_format": 34,
"description": ""
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/snapshots/examples__markdown_README_md__0.pack.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
},
"overlays": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ say foo
```json
{
"pack": {
"pack_format": 22,
"pack_format": 34,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 22,
"pack_format": 34,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 22,
"pack_format": 34,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand All @@ -24,7 +24,7 @@
```json
{
"pack": {
"pack_format": 22,
"pack_format": 34,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 22,
"pack_format": 34,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand All @@ -24,7 +24,7 @@
```json
{
"pack": {
"pack_format": 22,
"pack_format": 34,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
},
"overlays": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand All @@ -24,7 +24,7 @@
```json
{
"pack": {
"pack_format": 22,
"pack_format": 34,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 22,
"pack_format": 34,
"description": ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```json
{
"pack": {
"pack_format": 26,
"pack_format": 48,
"description": ""
}
}
Expand All @@ -24,7 +24,7 @@
```json
{
"pack": {
"pack_format": 22,
"pack_format": 34,
"description": ""
}
}
Expand Down
Loading

0 comments on commit a5e7980

Please sign in to comment.