Skip to content

Commit c62fb88

Browse files
committed
Update snapshots and fix some minor formatting issues
1 parent 76c7d10 commit c62fb88

File tree

6 files changed

+5050
-3526
lines changed

6 files changed

+5050
-3526
lines changed

src/hexdoc/_templates/macros/formatting.html.jinja

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929

3030
{# link to value.id, with spoiler blur if value is a spoiler #}
3131
{% macro maybe_spoilered_link(value) -%}
32-
<a href="#{{ value.id.path }}" class="toc-elem {{ 'spoilered' if value.is_spoiler }}">{{ texture_macros.render_icon(value.icon) }} {{ value.name }}</a>
32+
<a href="#{{ value.id.path }}" class="toc-elem {{ 'spoilered' if value.is_spoiler }}">
33+
{{- texture_macros.render_icon(value.icon) }} {{ value.name -}}
34+
</a>
3335
{%- endmacro %}
3436

3537
{# macro block which spoiler blurs its content if value is a spoiler #}
Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,58 @@
11
{% macro render_icon(item_or_texture, name="") -%}
22
{% if item_or_texture.gaslighting is defined %}
3-
{{ render_item(item_or_texture) }}
4-
{% else %}
5-
{{
6-
render_texture(
7-
name=name,
8-
texture=item_or_texture,
9-
class_names=[],
10-
)
11-
}}
12-
{% endif %}
3+
{{- render_item(item_or_texture) -}}
4+
{% else %}
5+
{{- render_texture(name, item_or_texture) -}}
6+
{% endif %}
137
{%- endmacro %}
148

159
{% macro render_texture(name, texture, class_names=[], lazy=true) -%}
16-
{% if texture.meta is defined %}
10+
{% if texture.meta is defined -%}
1711
<div
1812
role="img"
1913
title="{{ name }}"
2014
aria-label="Animated image of {{ name }}"
2115
class="{{ (class_names + ['texture', 'animated-sync', texture.class_name])|join(' ') }}"
2216
></div>
23-
{% else %}
17+
{%- else -%}
2418
<img
2519
title="{{ name }}"
2620
alt="Image of {{ name }}"
2721
src="{{ texture.url }}"
2822
{{ 'loading="lazy"'|safe if lazy }}
2923
class="{{ (class_names + ['texture'])|join(' ') }}"
3024
>
31-
{% endif %}
25+
{%- endif %}
3226
{%- endmacro %}
3327

3428
{# display a single item, with a badge if the count is greater than 1 #}
35-
{% macro render_item(item, is_first=true, count=1) -%}
36-
{% if item.gaslighting %}
37-
<div class="texture item-texture multi-textures gaslight-textures {{ 'multi-texture-active' if is_first }}">
29+
{% macro render_item(item, is_first=none, count=1) -%}
30+
{% if item.gaslighting -%}
31+
<div class="texture item-texture multi-textures gaslight-textures {{ 'multi-texture-active' if is_first is true }}">
3832
{% for texture in item.textures %}
3933
{{
4034
render_texture(
4135
name=item.name,
4236
texture=texture,
4337
class_names=[
4438
"item-texture",
45-
"multi-texture-active" if is_first,
39+
"multi-texture-active" if loop.first,
4640
],
4741
)
4842
}}
4943
{% endfor %}
5044
</div>
51-
{% else %}
52-
{{
53-
render_texture(
54-
name=item.name,
55-
texture=item.texture,
56-
class_names=[
57-
"item-texture",
58-
"multi-texture-active" if is_first,
59-
],
60-
)
61-
}}
62-
{% endif %}
63-
{% if count > 1 %}
45+
{%- else -%}
46+
{{ render_texture(
47+
name=item.name,
48+
texture=item.texture,
49+
class_names=[
50+
"item-texture",
51+
"multi-texture-active" if is_first is true,
52+
],
53+
) }}
54+
{%- endif -%}
55+
{% if count > 1 -%}
6456
<div class="badge">{{ count }}</div>
65-
{% endif %}
57+
{%- endif %}
6658
{%- endmacro %}

test/integration/__snapshots__/test_cookiecutter/test_cookiecutter[vlatestindex.html].raw

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,35 @@
129129
><i class="bi bi-link-45deg"></i></a></span>
130130
</h2>
131131
<details class="toc-category">
132-
<summary><a href="#foo" class="spoilered">Mod Book</a></summary>
132+
<summary><a href="#foo" class="toc-elem spoilered"><img
133+
title="Amethyst Shard"
134+
alt="Image of Amethyst Shard"
135+
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAjklEQVQ4y2NgGBIg33/1f3RMkuZ/p5+h4BDLrv9Ea97c9xmu8f/fq//PL/hMnAEwm0EGgDBMc2/WGcIGgDSDFMMMALFBYiDNBA2AORtmAMxWmAFEaYYZAHI2TCOIJqgZ5kQQhjmfKJtBAKQAphikEUYTtBnZABhGNojoOEfWDKKJcjYuQ2CBRlG6p1tGAwDsrfXVRK6M0wAAAABJRU5ErkJggg=="
136+
loading="lazy"
137+
class="item-texture texture"
138+
> Mod Book</a></summary>
133139
<ul>
134-
<li><a href="#bar" class="spoilered">This is the online version of the {} documentation.</a></li>
140+
<li><a href="#bar" class="toc-elem spoilered"><img
141+
title="item.minecraft.textures.mob_effect.nausea.png"
142+
alt="Image of item.minecraft.textures.mob_effect.nausea.png"
143+
src="DEBUG_GITHUBUSERCONTENT/test/_submodules/HexMod/doc/resources/assets/minecraft/textures/mob_effect/nausea.png"
144+
loading="lazy"
145+
class="item-texture texture"
146+
> This is the online version of the {} documentation.</a></li>
135147
</ul>
136148
</details>
137149
</nav>
138150
<main class="book-body">
139151
<section id="foo">
140152
<div class="spoilered">
141-
<h2 class="category-title page-header">Mod Book<a
153+
<h2 class="category-title page-header">
154+
<img
155+
title="Amethyst Shard"
156+
alt="Image of Amethyst Shard"
157+
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAjklEQVQ4y2NgGBIg33/1f3RMkuZ/p5+h4BDLrv9Ea97c9xmu8f/fq//PL/hMnAEwm0EGgDBMc2/WGcIGgDSDFMMMALFBYiDNBA2AORtmAMxWmAFEaYYZAHI2TCOIJqgZ5kQQhjmfKJtBAKQAphikEUYTtBnZABhGNojoOEfWDKKJcjYuQ2CBRlG6p1tGAwDsrfXVRK6M0wAAAABJRU5ErkJggg=="
158+
loading="lazy"
159+
class="item-texture texture"
160+
>Mod Book<a
142161
href="#table-of-contents"
143162
class="permalink small"
144163
title="Jump to top"
@@ -149,9 +168,16 @@
149168
><i class="bi bi-link-45deg"></i></a></h2>
150169
<p>The practitioners of this art would cast their so-called <span style="color: #b38ef3">Hexes</span> by drawing strange patterns in the air with a <a href="GITHUB_PAGES_URL/v/0.11.1-7#items/staff"><span style="color: #b0b">Staff</span></a> -- or craft <a href="GITHUB_PAGES_URL/v/0.11.1-7#items/hexcasting"><span style="color: #b0b">powerful magical items</span></a> to do the casting for them. How might I do the same?</p>
151170
</div>
152-
<div id="bar">
171+
<div id="bar" class="entry">
153172
<div class="spoilered">
154-
<h3 class="entry-title page-header">This is the online version of the {} documentation.<a
173+
<h3 class="entry-title page-header">
174+
<img
175+
title="item.minecraft.textures.mob_effect.nausea.png"
176+
alt="Image of item.minecraft.textures.mob_effect.nausea.png"
177+
src="DEBUG_GITHUBUSERCONTENT/test/_submodules/HexMod/doc/resources/assets/minecraft/textures/mob_effect/nausea.png"
178+
loading="lazy"
179+
class="item-texture texture"
180+
>This is the online version of the {} documentation.<a
155181
href="#table-of-contents"
156182
class="permalink small"
157183
title="Jump to top"

test/integration/__snapshots__/test_main/test_files[vlatestindex.css].raw

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ summary {
4949
blockquote.crafting-info {
5050
font-size: inherit;
5151
}
52+
/* to account for the section icons */
53+
.entry-title, .category-title {
54+
display: flex;
55+
align-items: end;
56+
.texture {
57+
margin-right: 4px;
58+
display: inline-block;
59+
}
60+
}
5261
/* we do a bit of crafting (mostly stolen from https://computercraft.info/wiki) */
5362
.crafting-tables {
5463
display: flex;
@@ -111,15 +120,25 @@ blockquote.crafting-info {
111120
.multi-textures .texture {
112121
position: absolute;
113122
}
123+
.toc-elem > .texture {
124+
margin-right: 2px;
125+
display: inline-block;
126+
vertical-align: middle;
127+
position: relative;
128+
}
129+
.toc-elem .texture {
130+
width: 16px;
131+
height: 16px;
132+
}
114133
.multi-textures .texture:not(.multi-texture-active) {
115-
z-index: -1;
134+
visibility: hidden;
116135
}
117136
.spotlight {
118137
position: relative;
119138
width: min-content;
120139
margin: -6px 0 8px 0;
121140
}
122-
.spotlight .texture {
141+
.spotlight > .texture {
123142
position: absolute;
124143
top: 10px;
125144
left: 10px;
@@ -237,6 +256,34 @@ p.todo-note {
237256
background-color: #553455;
238257
}
239258
}
259+
.flay-recipe{
260+
image-rendering: pixelated; /* put it up here so it's inherited */
261+
position: relative;
262+
}
263+
.flay-recipe-background{
264+
position: relative;
265+
top:0;
266+
left: 0;
267+
}
268+
.flay-recipe-block-ingredient{
269+
position: absolute;
270+
top: 70px;
271+
left: 24px;
272+
}
273+
/* entity chamber starts at top: 38px & left: 74px. it is 52px wide & 96px tall */
274+
.flay-recipe-entity{
275+
position: absolute;
276+
top: 86px;
277+
left: 100px;
278+
transform: translate(-50%, -50%);
279+
max-height: 94px;
280+
max-width: 50px;
281+
}
282+
.flay-recipe-result{
283+
position: absolute;
284+
top: 70px;
285+
left: 176px;
286+
}
240287
canvas.spell-viz {
241288
--dot-color: #777f;
242289
--dot-color: #777f;

0 commit comments

Comments
 (0)