Skip to content

Commit a5e7980

Browse files
committed
feat: update beet
1 parent 04aeded commit a5e7980

File tree

68 files changed

+89
-81
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+89
-81
lines changed

lectern/serialize.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,15 @@
3030
)
3131
from urllib.parse import urlparse
3232

33-
from beet import DataPack, File, NamespaceFile, ResourcePack, TextFile, TextFileBase
33+
from beet import (
34+
DataPack,
35+
File,
36+
NamespaceFile,
37+
ResourcePack,
38+
TextFile,
39+
TextFileBase,
40+
get_output_scope,
41+
)
3442
from beet.core.utils import normalize_string
3543

3644
EXTENSION_HIGHLIGHTING = {
@@ -240,7 +248,7 @@ def serialize_pack(
240248
if file_type in mapping
241249
else (
242250
extra_directive,
243-
f"{namespace.directory}/{name}/{'/'.join(file_type.scope)}/{path}{file_type.extension}",
251+
f"{namespace.directory}/{name}/{'/'.join(get_output_scope(file_type.scope, pack.pack_format))}/{path}{file_type.extension}",
244252
file_instance,
245253
)
246254
)
@@ -370,7 +378,7 @@ def serialize_pack(
370378
yield from self.format_serialized_file(
371379
self.serialize_file_instance(
372380
pack_directive,
373-
f"{namespace.directory}/{name}/{'/'.join(file_type.scope)}/{path}{file_type.extension}",
381+
f"{namespace.directory}/{name}/{'/'.join(get_output_scope(file_type.scope, pack.pack_format))}/{path}{file_type.extension}",
374382
file_instance, # type: ignore
375383
external_files,
376384
external_prefix,

poetry.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ include = ["lectern/py.typed"]
2525

2626
[tool.poetry.dependencies]
2727
python = "^3.10"
28-
beet = ">=0.104.1"
28+
beet = ">=0.108.0"
2929
markdown-it-py = "^3.0.0"
3030
click = "^8.1.7"
3131

tests/snapshots/examples__beet_project__0.pack.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}
@@ -449,7 +449,7 @@ tellraw @a ["", {"text": "hello", "color": "red"}]
449449
```json
450450
{
451451
"pack": {
452-
"pack_format": 22,
452+
"pack_format": 34,
453453
"description": ""
454454
}
455455
}

tests/snapshots/examples__markdown_README_md__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
},
1313
"overlays": {

tests/snapshots/examples__markdown_examples_append_modifier_txt__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_examples_basic1_txt__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_examples_basic2_txt__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_examples_basic3_txt__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_examples_code_fragments_md__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_examples_combined_md__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ say foo
2828
```json
2929
{
3030
"pack": {
31-
"pack_format": 22,
31+
"pack_format": 34,
3232
"description": ""
3333
}
3434
}

tests/snapshots/examples__markdown_examples_compact_txt__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_examples_download_fragment_txt__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_examples_embedded_vs_text_md__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_examples_empty_functions_txt__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_examples_escaped_fragment_txt__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_examples_folded_sections_md__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_examples_just_paths_md__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_examples_merge_lang_txt__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 22,
10+
"pack_format": 34,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_examples_merge_modifier_txt__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_examples_prepend_modifier_txt__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_examples_readme_example_md__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_examples_sound_txt__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 22,
10+
"pack_format": 34,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_examples_strip_final_newline_txt__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_examples_with_links_inline_image_md__0.pack.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}
@@ -24,7 +24,7 @@
2424
```json
2525
{
2626
"pack": {
27-
"pack_format": 22,
27+
"pack_format": 34,
2828
"description": ""
2929
}
3030
}

tests/snapshots/examples__markdown_examples_with_links_lots_of_textures_md__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 22,
10+
"pack_format": 34,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_examples_with_links_pack_icon_data_url_md__0.pack.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}
@@ -24,7 +24,7 @@
2424
```json
2525
{
2626
"pack": {
27-
"pack_format": 22,
27+
"pack_format": 34,
2828
"description": ""
2929
}
3030
}

tests/snapshots/examples__markdown_examples_with_links_pack_icon_link_md__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_examples_with_links_pack_local_icon_md__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_examples_with_links_structure_files_md__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_external_files_README_md__0.pack.md_external_files/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
},
1313
"overlays": {

tests/snapshots/examples__markdown_external_files_examples_with_links_inline_image_md__0.pack.md_external_files/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}
@@ -24,7 +24,7 @@
2424
```json
2525
{
2626
"pack": {
27-
"pack_format": 22,
27+
"pack_format": 34,
2828
"description": ""
2929
}
3030
}

tests/snapshots/examples__markdown_external_files_examples_with_links_lots_of_textures_md__0.pack.md_external_files/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 22,
10+
"pack_format": 34,
1111
"description": ""
1212
}
1313
}

tests/snapshots/examples__markdown_external_files_examples_with_links_pack_icon_data_url_md__0.pack.md_external_files/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```json
88
{
99
"pack": {
10-
"pack_format": 26,
10+
"pack_format": 48,
1111
"description": ""
1212
}
1313
}
@@ -24,7 +24,7 @@
2424
```json
2525
{
2626
"pack": {
27-
"pack_format": 22,
27+
"pack_format": 34,
2828
"description": ""
2929
}
3030
}

0 commit comments

Comments
 (0)