diff --git a/.readthedocs.yml b/.readthedocs.yml index 690a6af86..c5b10247d 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -8,7 +8,7 @@ build: - python -m pip install pdm - pdm install -G docs - cat docs/conf.py - - pdm run docs build $READTHEDOCS_OUTPUT/html + - pdm run docs build $READTHEDOCS_OUTPUT/html --builder dirhtml sphinx: configuration: docs/conf.py diff --git a/bookshelf/commands/docs.py b/bookshelf/commands/docs.py index f2a203b2e..4db38ceb7 100644 --- a/bookshelf/commands/docs.py +++ b/bookshelf/commands/docs.py @@ -13,23 +13,27 @@ def docs() -> None: @docs.command() @click.argument("output", required=False) -def build(output: str | None = None) -> None: +@click.option("--builder", default="html", help="The builder to use for Sphinx") +def build(output: str | None = None, builder: str = "html") -> None: """Build static HTML documentation.""" sphinx = shutil.which("sphinx-build") if not sphinx: error_msg = "The 'sphinx-build' command was not found." raise FileNotFoundError(error_msg) - subprocess.run( - [sphinx, ".", output if output else "_build"], - check=True, - cwd=DOC_DIR, - ) + subprocess.run([ + sphinx, + ".", + "-b", + builder, + output if output else "_build", + ], check=True, cwd=DOC_DIR) @docs.command() @click.argument("output", required=False) -def watch(output: str | None = None) -> None: +@click.option("--builder", default="html", help="The builder to use for Sphinx") +def watch(output: str | None = None, builder: str = "html") -> None: """Build and serve live documentation.""" try: sphinx = shutil.which("sphinx-autobuild") @@ -37,11 +41,14 @@ def watch(output: str | None = None) -> None: error_msg = "The 'sphinx-autobuild' command was not found." raise FileNotFoundError(error_msg) - subprocess.run( - [sphinx, ".", output if output else "_build", "--watch", f"{EXAMPLES_DIR}"], - check=True, - cwd=DOC_DIR, - ) + subprocess.run([ + sphinx, + ".", + "-b", + builder, + output if output else "_build", "--watch", + f"{EXAMPLES_DIR}", + ], check=True, cwd=DOC_DIR) except KeyboardInterrupt: click.echo("\nExiting sphinx-autobuild…") diff --git a/bookshelf/packtest/runner.py b/bookshelf/packtest/runner.py index 0e41007c3..47964c5a3 100644 --- a/bookshelf/packtest/runner.py +++ b/bookshelf/packtest/runner.py @@ -23,6 +23,10 @@ class Runner: r"Running test environment 'bs.load:(?P.*?)' batch 0 " r"\((?P\d+) tests\)", ), + "test_position": re.compile( + r"(?P\d+) tests are now running at position " + r"(?P-?\d+), (?P-?\d+), (?P-?\d+)!", + ), "test_error": re.compile( r"::error title=Test (?Pbs.*?) " r"failed on line (?P\d+)!::(?P.*)", @@ -71,6 +75,15 @@ def _handle_test_environment(self, match: re.Match, logger: StepLogger) -> None: int(match["count"]), ) + def _handle_test_position(self, match: re.Match, logger: StepLogger) -> None: + logger.debug( + "Run %s tests at position (%s, %s, %s)", + int(match["count"]), + int(match["x"]), + int(match["y"]), + int(match["z"]), + ) + def _handle_test_error(self, match: re.Match, logger: StepLogger) -> None: """Handle individual test error logs.""" name = match["name"] @@ -88,6 +101,7 @@ def _monitor_process(self, process: subprocess.Popen, logger: StepLogger) -> Non for line in iter(process.stdout.readline, ""): for pattern, callback in ( (self.PATTERNS["test_environment"], self._handle_test_environment), + (self.PATTERNS["test_position"], self._handle_test_position), (self.PATTERNS["test_error"], self._handle_test_error), (self.PATTERNS["any_error"], self._handle_any_error), ): diff --git a/data/manifest.json b/data/manifest.json index 62fdadbd7..729edac7b 100644 --- a/data/manifest.json +++ b/data/manifest.json @@ -3689,7 +3689,7 @@ "slug": "bookshelf-string", "icon": "https://raw.githubusercontent.com/mcbookshelf/bookshelf/refs/tags/v3.0.2/modules/bs.string/pack.png", "readme": "https://raw.githubusercontent.com/mcbookshelf/bookshelf/refs/tags/v3.0.2/modules/bs.string/README.md", - "description": "Get information about the system string effortlessly.", + "description": "Bookshelf utility for manipulating and transforming strings in Minecraft datapacks.", "documentation": "https://docs.mcbookshelf.dev/en/latest/modules/string.html", "kind": "data_pack", "tags": [ diff --git a/docs/_static/bookshelf.css b/docs/_static/bookshelf.css index a6b821126..5390bd0d5 100644 --- a/docs/_static/bookshelf.css +++ b/docs/_static/bookshelf.css @@ -9,114 +9,24 @@ } @font-face { - font-family: "Noto Color Emoji"; - font-style: normal; - font-weight: 400; - src: url("fonts/notocoloremoji.0.woff2") format("woff2"); - unicode-range: U+1f1e6-1f1ff; -} - -@font-face { - font-family: "Noto Color Emoji"; - font-style: normal; - font-weight: 400; - src: url("fonts/notocoloremoji.1.woff2") format("woff2"); - unicode-range: U+200d, U+2620, U+26a7, U+fe0f, U+1f308, U+1f38c, U+1f3c1, U+1f3f3-1f3f4, U+1f6a9, U+e0062-e0063, U+e0065, U+e0067, U+e006c, U+e006e, U+e0073-e0074, U+e0077, U+e007f; -} - -@font-face { - font-family: "Noto Color Emoji"; - font-style: normal; - font-weight: 400; - src: url("fonts/notocoloremoji.2.woff2") format("woff2"); - unicode-range: U+23, U+2a, U+30-39, U+a9, U+ae, U+200d, U+203c, U+2049, U+20e3, U+2122, U+2139, U+2194-2199, U+21a9-21aa, U+23cf, U+23e9-23ef, U+23f8-23fa, U+24c2, U+25aa-25ab, U+25b6, U+25c0, U+25fb-25fe, U+2611, U+2622-2623, U+2626, U+262a, U+262e-262f, U+2638, U+2640, U+2642, U+2648-2653, U+2660, U+2663, U+2665-2666, U+2668, U+267b, U+267e-267f, U+2695, U+269b-269c, U+26a0, U+26a7, U+26aa-26ab, U+26ce, U+26d4, U+2705, U+2714, U+2716, U+271d, U+2721, U+2733-2734, U+2747, U+274c, U+274e, U+2753-2755, U+2757, U+2764, U+2795-2797, U+27a1, U+27b0, U+27bf, U+2934-2935, U+2b05-2b07, U+2b1b-2b1c, U+2b55, U+3030, U+303d, U+3297, U+3299, U+fe0f, U+1f170-1f171, U+1f17e-1f17f, U+1f18e, U+1f191-1f19a, U+1f201-1f202, U+1f21a, U+1f22f, U+1f232-1f23a, U+1f250-1f251, U+1f310, U+1f3a6, U+1f3b5-1f3b6, U+1f3bc, U+1f3e7, U+1f441, U+1f499-1f49c, U+1f49f-1f4a0, U+1f4a2, U+1f4ac-1f4ad, U+1f4b1-1f4b2, U+1f4b9, U+1f4db, U+1f4f2-1f4f6, U+1f500-1f50a, U+1f515, U+1f518-1f524, U+1f52f-1f53d, U+1f549, U+1f54e, U+1f5a4, U+1f5e8, U+1f5ef, U+1f6ab, U+1f6ad-1f6b1, U+1f6b3, U+1f6b7-1f6bc, U+1f6be, U+1f6c2-1f6c5, U+1f6d0-1f6d1, U+1f6d7, U+1f6dc, U+1f7e0-1f7eb, U+1f7f0, U+1f90d-1f90e, U+1f9e1, U+1fa75-1fa77, U+1faaf; -} - -@font-face { - font-family: "Noto Color Emoji"; - font-style: normal; - font-weight: 400; - src: url("fonts/notocoloremoji.3.woff2") format("woff2"); - unicode-range: U+231a-231b, U+2328, U+23f0-23f3, U+2602, U+260e, U+2692, U+2694, U+2696-2697, U+2699, U+26b0-26b1, U+26cf, U+26d1, U+26d3, U+2702, U+2709, U+270f, U+2712, U+fe0f, U+1f302, U+1f321, U+1f392-1f393, U+1f3a9, U+1f3bd, U+1f3ee, U+1f3f7, U+1f3fa, U+1f451-1f462, U+1f484, U+1f489-1f48a, U+1f48c-1f48e, U+1f4a1, U+1f4a3, U+1f4b0, U+1f4b3-1f4b8, U+1f4bb-1f4da, U+1f4dc-1f4f1, U+1f4ff, U+1f50b-1f514, U+1f516-1f517, U+1f526-1f529, U+1f52c-1f52e, U+1f550-1f567, U+1f56f-1f570, U+1f576, U+1f587, U+1f58a-1f58d, U+1f5a5, U+1f5a8, U+1f5b1-1f5b2, U+1f5c2-1f5c4, U+1f5d1-1f5d3, U+1f5dc-1f5de, U+1f5e1, U+1f5f3, U+1f6aa, U+1f6ac, U+1f6bd, U+1f6bf, U+1f6c1, U+1f6cb, U+1f6cd-1f6cf, U+1f6d2, U+1f6e0-1f6e1, U+1f6f0, U+1f97b-1f97f, U+1f9af, U+1f9ba, U+1f9e2-1f9e6, U+1f9ea-1f9ec, U+1f9ee-1f9f4, U+1f9f7-1f9ff, U+1fa71-1fa74, U+1fa79-1fa7b, U+1fa86, U+1fa91-1fa93, U+1fa96, U+1fa99-1faa0, U+1faa2-1faa7, U+1faaa-1faae; -} - -@font-face { - font-family: "Noto Color Emoji"; - font-style: normal; - font-weight: 400; - src: url("fonts/notocoloremoji.4.woff2") format("woff2"); - unicode-range: U+265f, U+26bd-26be, U+26f3, U+26f8, U+fe0f, U+1f004, U+1f0cf, U+1f380-1f384, U+1f386-1f38b, U+1f38d-1f391, U+1f396-1f397, U+1f399-1f39b, U+1f39e-1f39f, U+1f3a3-1f3a5, U+1f3a7-1f3a9, U+1f3ab-1f3b4, U+1f3b7-1f3bb, U+1f3bd-1f3c0, U+1f3c5-1f3c6, U+1f3c8-1f3c9, U+1f3cf-1f3d3, U+1f3f8-1f3f9, U+1f47e, U+1f4e2, U+1f4f7-1f4fd, U+1f52b, U+1f579, U+1f58c-1f58d, U+1f5bc, U+1f6f7, U+1f6f9, U+1f6fc, U+1f93f, U+1f941, U+1f945, U+1f947-1f94f, U+1f9e7-1f9e9, U+1f9f5-1f9f6, U+1fa70-1fa71, U+1fa80-1fa81, U+1fa83-1fa85, U+1fa87-1fa88, U+1fa94-1fa95, U+1fa97-1fa98, U+1faa1, U+1faa9; -} - -@font-face { - font-family: "Noto Color Emoji"; - font-style: normal; - font-weight: 400; - src: url("fonts/notocoloremoji.5.woff2") format("woff2"); - unicode-range: U+2693, U+26e9-26ea, U+26f1-26f2, U+26f4-26f5, U+26fa, U+26fd, U+2708, U+fe0f, U+1f301, U+1f303, U+1f306-1f307, U+1f309, U+1f310, U+1f3a0-1f3a2, U+1f3aa, U+1f3cd-1f3ce, U+1f3d5, U+1f3d7-1f3db, U+1f3df-1f3e6, U+1f3e8-1f3ed, U+1f3ef-1f3f0, U+1f488, U+1f492, U+1f4ba, U+1f54b-1f54d, U+1f5fa-1f5ff, U+1f680-1f6a2, U+1f6a4-1f6a8, U+1f6b2, U+1f6d1, U+1f6d5-1f6d6, U+1f6dd-1f6df, U+1f6e2-1f6e5, U+1f6e9, U+1f6eb-1f6ec, U+1f6f3-1f6f6, U+1f6f8, U+1f6fa-1f6fb, U+1f9bc-1f9bd, U+1f9ed, U+1f9f3, U+1fa7c; -} - -@font-face { - font-family: "Noto Color Emoji"; - font-style: normal; - font-weight: 400; - src: url("fonts/notocoloremoji.6.woff2") format("woff2"); - unicode-range: U+2615, U+fe0f, U+1f32d-1f330, U+1f336, U+1f33d, U+1f345-1f37f, U+1f382, U+1f52a, U+1f942-1f944, U+1f950-1f96f, U+1f99e, U+1f9aa, U+1f9c0-1f9cb, U+1fad0-1fadb; -} - -@font-face { - font-family: "Noto Color Emoji"; - font-style: normal; - font-weight: 400; - src: url("fonts/notocoloremoji.7.woff2") format("woff2"); - unicode-range: U+200d, U+2600-2601, U+2603-2604, U+2614, U+2618, U+26a1, U+26c4-26c5, U+26c8, U+26f0, U+2728, U+2744, U+2b1b, U+2b50, U+fe0f, U+1f300, U+1f304-1f305, U+1f308, U+1f30a-1f30f, U+1f311-1f321, U+1f324-1f32c, U+1f331-1f335, U+1f337-1f33c, U+1f33e-1f344, U+1f3d4, U+1f3d6, U+1f3dc-1f3de, U+1f3f5, U+1f400-1f43f, U+1f490, U+1f4a7, U+1f4ab, U+1f4ae, U+1f525, U+1f54a, U+1f573, U+1f577-1f578, U+1f648-1f64a, U+1f940, U+1f980-1f9ae, U+1f9ba, U+1fa90, U+1faa8, U+1fab0-1fabd, U+1fabf, U+1face-1facf, U+1fae7; -} - -@font-face { - font-family: "Noto Color Emoji"; - font-style: normal; - font-weight: 400; - src: url("fonts/notocoloremoji.8.woff2") format("woff2"); - unicode-range: U+200d, U+2640, U+2642, U+2695-2696, U+26f7, U+26f9, U+2708, U+2764, U+fe0f, U+1f33e, U+1f373, U+1f37c, U+1f384-1f385, U+1f393, U+1f3a4, U+1f3a8, U+1f3c2-1f3c4, U+1f3c7, U+1f3ca-1f3cc, U+1f3eb, U+1f3ed, U+1f3fb-1f3ff, U+1f466-1f478, U+1f47c, U+1f481-1f483, U+1f486-1f487, U+1f48b, U+1f48f, U+1f491, U+1f4bb-1f4bc, U+1f527, U+1f52c, U+1f574-1f575, U+1f57a, U+1f645-1f647, U+1f64b, U+1f64d-1f64e, U+1f680, U+1f692, U+1f6a3, U+1f6b4-1f6b6, U+1f6c0, U+1f6cc, U+1f91d, U+1f926, U+1f930-1f931, U+1f934-1f93a, U+1f93c-1f93e, U+1f977, U+1f9af-1f9b3, U+1f9b8-1f9b9, U+1f9bc-1f9bd, U+1f9cc-1f9cf, U+1f9d1-1f9df, U+1fa82, U+1fac3-1fac5; -} - -@font-face { - font-family: "Noto Color Emoji"; - font-style: normal; - font-weight: 400; - src: url("fonts/notocoloremoji.9.woff2") format("woff2"); - unicode-range: U+200d, U+261d, U+2620, U+2639-263a, U+2665, U+270a-270d, U+2728, U+2763-2764, U+2b50, U+fe0f, U+1f31a-1f31f, U+1f32b, U+1f383, U+1f389, U+1f3fb-1f3ff, U+1f440-1f450, U+1f463-1f465, U+1f479-1f47b, U+1f47d-1f480, U+1f485, U+1f48b-1f48c, U+1f493-1f49f, U+1f4a4-1f4a6, U+1f4a8-1f4ab, U+1f4af, U+1f525, U+1f573, U+1f590, U+1f595-1f596, U+1f5a4, U+1f5e3, U+1f600-1f644, U+1f648-1f64a, U+1f64c, U+1f64f, U+1f90c-1f925, U+1f927-1f92f, U+1f932-1f933, U+1f970-1f976, U+1f978-1f97a, U+1f9a0, U+1f9b4-1f9b7, U+1f9bb, U+1f9be-1f9bf, U+1f9d0, U+1f9e0-1f9e1, U+1fa75-1fa79, U+1fac0-1fac2, U+1fae0-1fae6, U+1fae8, U+1faf0-1faf8; -} - -@font-face { - font-family: "Noto Color Emoji"; - font-style: normal; - font-weight: 400; - src: url("fonts/notocoloremoji.10.woff2") format("woff2"); - unicode-range: U+200d, U+2194-2195, U+2640, U+2642, U+26d3, U+27a1, U+fe0f, U+1f344, U+1f34b, U+1f3c3, U+1f3fb-1f3ff, U+1f426, U+1f468-1f469, U+1f4a5, U+1f525, U+1f642, U+1f6b6, U+1f7e9, U+1f7eb, U+1f9af, U+1f9bc-1f9bd, U+1f9ce, U+1f9d1-1f9d2; -} - -@font-face { - font-family: "Noto Color Emoji"; - font-style: normal; - font-weight: 400; - src: url("fonts/notocoloremoji.11.woff2") format("woff2"); - unicode-range: U+1fa89, U+1fa8f, U+1fabe, U+1fac6, U+1fadc, U+1fadf, U+1fae9; + font-family: TossFace; + src: url("fonts/tossface.ttf"); } html { --pst-sidebar-font-size: .95rem; --pst-sidebar-secondary: 18rem; - --pst-font-family-base: "Nunito", "Noto Color Emoji", var(--pst-font-family-base-system); - --pst-font-family-heading: "Nunito", "Noto Color Emoji", var(--pst-font-family-base-system); + --pst-font-family-base: "Nunito", "TossFace", var(--pst-font-family-base-system); + --pst-font-family-heading: "Nunito", "TossFace", var(--pst-font-family-base-system); } html[data-theme="light"] { --pst-color-primary: #538fef; --pst-color-secondary: #f76e13; + --pst-color-secondary-highlight: #ff8000; --pst-color-accent: #ff8000; --sd-color-card-border-hover: var(--pst-color-primary); - --pst-color-primary-highlight: var(--pst-color-secondary); + --pst-color-primary-highlight: #4a83df; --scrollbar-thumb-bg: #00000019; --scrollbar-thumb-bg-hover: #00000026; --scrollbar-thumb-bg-active: #0000002b; @@ -127,6 +37,7 @@ html[data-theme="light"] { --pst-color-surface: #fefefe; --pst-color-on-background: #f9f9f9; --pst-color-table-outer-border: #77777722; + --pst-color-primary-highlight-text: #eee!important; } html[data-theme="light"] .highlight .c1 { @@ -137,7 +48,8 @@ html[data-theme="dark"] { --pst-color-primary: #79a3f2; --pst-color-secondary: #ec8423; --pst-color-accent: #ff8000; - --pst-color-primary-highlight: var(--pst-color-secondary); + --pst-color-secondary-highlight: #ff8000; + --pst-color-primary-highlight: #2a55a5; --sd-color-primary: #3b6bc4; --pst-color-secondary-text: #fff; --sd-color-primary-text: #fff; @@ -152,13 +64,48 @@ html[data-theme="dark"] { --bs-border-color: #dee2e611; --pst-color-table-row-hover-bg: #79a3f266; --pst-color-table-outer-border: #79a3f244; + --pst-color-primary-highlight-text: #eee!important; } - html[data-theme=dark] .bd-content .sd-tab-set .sd-tab-content, html[data-theme=dark] .bd-content .sd-tab-set>label { background-color: #191d25; } +.emoji { + line-height: 1; + display: inline-block; + vertical-align: middle; + text-shadow: + -.5px -.5px 0 #00000022, + .5px -.5px 0 #00000022, + -.5px .5px 0 #00000022, + .5px .5px 0 #00000022; +} + +@media (min-width: 960px) { + .bd-header ul.navbar-nav { + align-items: end; + } +} + +code .emoji { + display: initial; + vertical-align: initial; + text-shadow: none; +} + +.bd-header .navbar-item { + height: auto; +} + +p.rubric { + display: block; +} + +ul.navbar-nav li a { + display: inline-block; +} + .navbar-brand { font-family: "Unbounded"; font-size: 1em; @@ -370,10 +317,6 @@ tr.row-odd { button.btn.version-switcher__button { margin-bottom: unset; } -.bd-header .navbar-nav li a.nav-link { - text-align: center; - padding-inline: 6px 12px!important; -} .bd-header ul.navbar-nav .dropdown .dropdown-menu .dropdown-item { padding-inline: 1.5rem !important; } @@ -385,7 +328,7 @@ button.btn.version-switcher__button { padding-top: 1rem; } button.btn.version-switcher__button { - max-width: 6rem; + max-width: 4.5rem; overflow: hidden; text-overflow: ellipsis; } @@ -403,16 +346,22 @@ button.btn.version-switcher__button { .bd-header .navbar-header-items__center, .bd-header .navbar-header-items__end, ul.navbar-icon-links { - column-gap: .75rem; + column-gap: .5rem; } -@media (min-width: 720px) { - .bd-footer .bd-footer__inner { - flex-direction: row; - } +.bd-header .navbar-nav li a.nav-link { + padding-inline: 6px 12px!important; + text-align: center; +} + +#pst-nav-more-links a.nav-link { + text-align: left; } @media (min-width: 960px) { + .bd-footer .bd-footer__inner { + flex-direction: row; + } .bd-page-width { max-width: 90rem; } @@ -434,4 +383,17 @@ ul.navbar-icon-links { .bd-header ul.navbar-nav { gap: .4rem; } + .bd-header .navbar-header-items__center, + .bd-header .navbar-header-items__end, + ul.navbar-icon-links { + column-gap: 1rem; + } +} + +.bd-footer { + font-size: 0.85rem; +} + +footer, #pst-secondary-sidebar { + --pst-color-link: var(--pst-color-text-base) } diff --git a/docs/_static/fonts/notocoloremoji.0.woff2 b/docs/_static/fonts/notocoloremoji.0.woff2 deleted file mode 100644 index 58280ab33..000000000 Binary files a/docs/_static/fonts/notocoloremoji.0.woff2 and /dev/null differ diff --git a/docs/_static/fonts/notocoloremoji.1.woff2 b/docs/_static/fonts/notocoloremoji.1.woff2 deleted file mode 100644 index e03a4d295..000000000 Binary files a/docs/_static/fonts/notocoloremoji.1.woff2 and /dev/null differ diff --git a/docs/_static/fonts/notocoloremoji.10.woff2 b/docs/_static/fonts/notocoloremoji.10.woff2 deleted file mode 100644 index 9303822bd..000000000 Binary files a/docs/_static/fonts/notocoloremoji.10.woff2 and /dev/null differ diff --git a/docs/_static/fonts/notocoloremoji.11.woff2 b/docs/_static/fonts/notocoloremoji.11.woff2 deleted file mode 100644 index 5f8d81ec2..000000000 Binary files a/docs/_static/fonts/notocoloremoji.11.woff2 and /dev/null differ diff --git a/docs/_static/fonts/notocoloremoji.2.woff2 b/docs/_static/fonts/notocoloremoji.2.woff2 deleted file mode 100644 index 746c9ee15..000000000 Binary files a/docs/_static/fonts/notocoloremoji.2.woff2 and /dev/null differ diff --git a/docs/_static/fonts/notocoloremoji.3.woff2 b/docs/_static/fonts/notocoloremoji.3.woff2 deleted file mode 100644 index 4a5c550d2..000000000 Binary files a/docs/_static/fonts/notocoloremoji.3.woff2 and /dev/null differ diff --git a/docs/_static/fonts/notocoloremoji.4.woff2 b/docs/_static/fonts/notocoloremoji.4.woff2 deleted file mode 100644 index c7efb265a..000000000 Binary files a/docs/_static/fonts/notocoloremoji.4.woff2 and /dev/null differ diff --git a/docs/_static/fonts/notocoloremoji.5.woff2 b/docs/_static/fonts/notocoloremoji.5.woff2 deleted file mode 100644 index 0a5af121c..000000000 Binary files a/docs/_static/fonts/notocoloremoji.5.woff2 and /dev/null differ diff --git a/docs/_static/fonts/notocoloremoji.6.woff2 b/docs/_static/fonts/notocoloremoji.6.woff2 deleted file mode 100644 index d5d182e8b..000000000 Binary files a/docs/_static/fonts/notocoloremoji.6.woff2 and /dev/null differ diff --git a/docs/_static/fonts/notocoloremoji.7.woff2 b/docs/_static/fonts/notocoloremoji.7.woff2 deleted file mode 100644 index f51ce9bd9..000000000 Binary files a/docs/_static/fonts/notocoloremoji.7.woff2 and /dev/null differ diff --git a/docs/_static/fonts/notocoloremoji.8.woff2 b/docs/_static/fonts/notocoloremoji.8.woff2 deleted file mode 100644 index ca5847a19..000000000 Binary files a/docs/_static/fonts/notocoloremoji.8.woff2 and /dev/null differ diff --git a/docs/_static/fonts/notocoloremoji.9.woff2 b/docs/_static/fonts/notocoloremoji.9.woff2 deleted file mode 100644 index dc63fd4c4..000000000 Binary files a/docs/_static/fonts/notocoloremoji.9.woff2 and /dev/null differ diff --git a/docs/_static/fonts/tossface.ttf b/docs/_static/fonts/tossface.ttf new file mode 100644 index 000000000..c76f0d062 Binary files /dev/null and b/docs/_static/fonts/tossface.ttf differ diff --git a/docs/_templates/mention-legales-footer.html b/docs/_templates/mention-legales-footer.html deleted file mode 100644 index bece1b300..000000000 --- a/docs/_templates/mention-legales-footer.html +++ /dev/null @@ -1 +0,0 @@ -Mentions Légales diff --git a/docs/_templates/mentions-legales.html b/docs/_templates/mentions-legales.html new file mode 100644 index 000000000..e4659e52d --- /dev/null +++ b/docs/_templates/mentions-legales.html @@ -0,0 +1,5 @@ +Code of Conduct +| +License (MPL 2.0) +| +Mentions Légales (FR) diff --git a/docs/changelog/v3.0.0.md b/docs/changelog/v3.0.0.md index c8ea4515a..a14ad71a1 100644 --- a/docs/changelog/v3.0.0.md +++ b/docs/changelog/v3.0.0.md @@ -30,7 +30,7 @@ Introduced bundles to better group modules, replacing **Bookshelf** and **Booksh - **[#349](https://github.com/mcbookshelf/bookshelf/issues/349)** - Added the `on_finished` argument to fill operations. If specified, the provided command runs automatically when the operation completes. - **[#287](https://github.com/mcbookshelf/bookshelf/issues/287)** - Updated `replace_type` to return whether a type was found and replaced. -### `🧱 bs.environment` +### `⛰️ bs.environment` - 🐛 **[#320](https://github.com/mcbookshelf/bookshelf/issues/320)** - Fixed functions that were previously unusable outside the Overworld. diff --git a/docs/conf.py b/docs/conf.py index 64708d1a2..f9e60ca9d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,4 +1,8 @@ import os +import re +from pathlib import Path + +from sphinx.application import Sphinx # -- Project information ----------------------------------------------------- @@ -80,7 +84,8 @@ "navbar_persistent": ["search-button"], "navigation_with_keys": True, "use_edit_page_button": True, - "footer_center": ["mention-legales-footer.html"], + "footer_start": ["copyright"], + "footer_center": ["mentions-legales.html"], "header_links_before_dropdown": 4, "logo": { "text": "Bookshelf", @@ -120,3 +125,49 @@ "⚠️ You are reading a doc of an undergoing development version. " "Information can be out of date and/or change at any time. ⚠️" ) + +BODY_PATTERN = re.compile(r"(.*?)", re.DOTALL) +EMOJI_PATTERN = re.compile( + r"[\U0001F600-\U0001F64F" + r"\U0001F300-\U0001F5FF" + r"\U0001F680-\U0001F6FF" + r"\U0001F700-\U0001F77F" + r"\U0001F780-\U0001F7FF" + r"\U0001F800-\U0001F8FF" + r"\U0001F900-\U0001F9FF" + r"\U0001FA00-\U0001FA6F" + r"\U0001FA70-\U0001FAFF" + r"\u2600-\u26FF" + r"\u2700-\u27BF" + r"\U0001F000-\U0001F02F" + r"\U0001F004\U0001F0CF" + r"\U0001F46A-\U0001F46F" + r"\U0001F170-\U0001F251" + r"\U0001F1E6-\U0001F1FF" + r"\U00002B50" + r"]+", +) + + +def setup(app: Sphinx) -> None: + """Set up the extension to replace emojis in the doctree.""" + app.connect("build-finished", replace_emojis_in_html_files) + + +def replace_emojis_in_html_files(app: Sphinx, _: object) -> None: + """Replace emojis in the rendered HTML files after the build is finished.""" + output_dir = app.outdir + for root, _, files in os.walk(output_dir): + for file in files: + if file.endswith(".html"): + filepath = Path(root) / str(file) + content = filepath.read_text("utf-8") + if body_match := BODY_PATTERN.search(content): + body_content = body_match.group(1) + modified_body_content = EMOJI_PATTERN.sub( + lambda match: f'{match.group(0)}', + body_content, + ) + new_content = content.replace(body_content, modified_body_content) + if new_content != content: + filepath.write_text(new_content, "utf-8") diff --git a/docs/contribute/index.md b/docs/contribute/index.md index 1598bb453..4164c603c 100644 --- a/docs/contribute/index.md +++ b/docs/contribute/index.md @@ -2,7 +2,7 @@ html_theme.sidebar_secondary.remove: true --- -# 🤝 Contribute +# 🤝 Contribute Welcome to the Contribute section of our documentation! Whether you're fixing bugs, adding features, or writing new modules, this guide will help you get started and align with our project's standards. diff --git a/docs/examples/index.md b/docs/examples/index.md index 2dd4afe50..c67652226 100644 --- a/docs/examples/index.md +++ b/docs/examples/index.md @@ -2,7 +2,7 @@ html_theme.sidebar_secondary.remove: true --- -# 📖 Examples +# 📖 Examples In this section, you'll find practical examples showcasing how to use **Bookshelf**. effectively. Each example is designed as a mini-tutorial, demonstrating specific features and their real-world applications. The code provided can be easily converted into fully functional Minecraft datapacks thanks to **Lectern**, ensuring that everything in the documentation is directly applicable in-game. diff --git a/docs/index.md b/docs/index.md index 68ea6f3cb..a03a83637 100644 --- a/docs/index.md +++ b/docs/index.md @@ -19,7 +19,7 @@ sd_hide_title: true -## 🕵️‍♂️ What is Bookshelf? +## 🕵️ What is Bookshelf? Bookshelf (formerly known as Gunivers Libs) is a modular library datapack designed to simplify complex systems in Minecraft maps. It is ideal for mapmakers seeking easy-to-implement tools. diff --git a/docs/modules/index.md b/docs/modules/index.md index 095e19768..957886683 100644 --- a/docs/modules/index.md +++ b/docs/modules/index.md @@ -2,7 +2,7 @@ html_theme.sidebar_secondary.remove: true --- -# 🧩 Modules +# 🧩 Modules Bookshelf is designed with modularity in mind. Features that serve a common purpose are organized into distinct, standalone, namespaced modules. diff --git a/docs/quickstart.md b/docs/quickstart.md index f70f7f94b..e20177b6c 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -1,4 +1,4 @@ -# 🚀 Quickstart +# 🚀 Quickstart This page gives a quick overview of how to get started with the Bookshelf library, and how to use it. diff --git a/docs/special-thanks.md b/docs/special-thanks.md index 5f865db80..35c91f618 100644 --- a/docs/special-thanks.md +++ b/docs/special-thanks.md @@ -6,18 +6,10 @@ html_theme.sidebar_secondary.remove: true Bookshelf is a collaborative project, made possible by the dedication and contributions of numerous individuals. We extend special thanks to those who have made significant contributions to this project, without whom it would not be what it is today. -## 🖥️ Direct Contributors - -```{button-link} https://github.com/mcbookshelf/Bookshelf/graphs/contributors -:color: primary -:align: center -:shadow: - -See all contributors -``` - --- +## 🌟 Direct Contributors + ::::{grid} 2 :::{grid-item-card} Vincent Foriel (aka Leirof) @@ -86,7 +78,7 @@ Contributor of the original Gunivers Libs. ## ✨ Other Contributors -::::{grid} 2 +::::{grid} 3 :::{grid-item-card} Lukas Scheuerle (aka Plagiatus) :link: https://plagiatus.net @@ -134,3 +126,17 @@ Creator of the Bookshelf logo. ::: :::: + +```{button-link} https://github.com/mcbookshelf/Bookshelf/graphs/contributors +:color: primary +:align: center +:shadow: + +See all contributors +``` + +--- + +## 🫶 Acknowledgements + +This website uses the Tossface font, a freely available typeface designed and provided by the [Toss Team](https://toss.im). diff --git a/modules/bs.string/module.json b/modules/bs.string/module.json index fb428ea2d..b43f5ccf6 100644 --- a/modules/bs.string/module.json +++ b/modules/bs.string/module.json @@ -7,7 +7,7 @@ "meta": { "name": "String", "slug": "bookshelf-string", - "description": "Get information about the system string effortlessly.", + "description": "Bookshelf utility for manipulating and transforming strings in Minecraft datapacks.", "documentation": "https://docs.mcbookshelf.dev/en/latest/modules/string.html", "tags": ["runtime"], "weak_dependencies": [