Skip to content

Commit 32df9df

Browse files
committed
Add constant lists to site
1 parent b3c77b3 commit 32df9df

7 files changed

Lines changed: 479 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ node_modules/
55
docs/.vitepress/dist
66
docs/.vitepress/cache
77
docs/functions/
8+
docs/constants/
89
docs/types.md

docs/.vitepress/config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,19 @@ _paq.push(['enableLinkTracking']);
104104
{ text: "String references", link: "/functions/strref" },
105105
],
106106
},
107+
{
108+
text: "Constants",
109+
items: [
110+
{ text: "IDS", link: "/constants/ids" },
111+
{ text: "Spells", link: "/constants/spells" },
112+
{ text: "Opcodes", link: "/constants/opcodes" },
113+
{ text: "Opcode Parameters", link: "/constants/opcode-params" },
114+
{ text: "Offsets", link: "/constants/structures" },
115+
{ text: "Icons", link: "/constants/icons" },
116+
{ text: "Scrolls", link: "/constants/scrolls" },
117+
{ text: "Miscellaneous", link: "/constants/misc" },
118+
],
119+
},
107120
],
108121

109122
editLink: {

docs/.vitepress/theme/custom.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,13 @@ html {
5555

5656
/* -- Tables -- */
5757
.vp-doc table {
58+
display: table;
5859
width: 100%;
5960
border-collapse: collapse;
6061
margin: 1rem 0;
6162
font-size: 0.9em;
63+
table-layout: auto;
64+
overflow-x: auto;
6265
}
6366

6467
.vp-doc th {
@@ -74,10 +77,22 @@ html {
7477
border: 1px solid var(--vp-c-divider);
7578
}
7679

80+
/* Code in table cells: allow normal word wrapping */
81+
.vp-doc td code {
82+
white-space: normal;
83+
word-break: normal;
84+
}
85+
7786
.vp-doc tr:hover td {
7887
background-color: var(--vp-c-bg-soft);
7988
}
8089

90+
/* -- Feature card links: make them visually distinct -- */
91+
.VPFeature a {
92+
color: var(--vp-c-brand-1);
93+
text-decoration: underline;
94+
}
95+
8196
/* -- Hide markdown horizontal rules (headings provide separation) -- */
8297
.vp-doc hr {
8398
margin: 0;

docs/_data/constants.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Constant sections for documentation generation.
2+
# Each entry maps to one or more .tph source files that get combined into a single doc page.
3+
# "files" paths are relative to project root.
4+
5+
- name: ids
6+
title: IDS
7+
desc: Named constants for IDS file values (animation IDs, effect IDs, gender, slots, etc.).
8+
files:
9+
- ids/animate_ids.tph
10+
- ids/effect_ids.tph
11+
- ids/gender_ids.tph
12+
- ids/projectile_ids.tph
13+
- ids/slots_ids.tph
14+
- ids/types.tph
15+
16+
- name: spells
17+
title: Spells
18+
desc: Spell resref constants by game.
19+
files:
20+
- ids/spell_ids_bg2ee.tph
21+
- ids/spell_ids_bgee.tph
22+
- ids/spell_ids_iwdee.tph
23+
24+
- name: opcodes
25+
title: Opcodes
26+
desc: Named constants for opcode numbers.
27+
files:
28+
- misc/opcode.tph
29+
- misc/opcode_ee.tph
30+
31+
- name: opcode-params
32+
title: Opcode Parameters
33+
desc: Named constants for opcode parameter values.
34+
files:
35+
- opcodes/0_ac_modifier.tph
36+
- opcodes/12_damage.tph
37+
- opcodes/144_279_button_type.tph
38+
- opcodes/146_cast_spell_type.tph
39+
- opcodes/17_current_hp_mod_type.tph
40+
- opcodes/236_project_image.tph
41+
- opcodes/82_script_type.tph
42+
- opcodes/mod_type.tph
43+
44+
- name: structures
45+
title: Offsets
46+
desc: Named offset constants for IE file format structures (ARE, CRE, EFF, ITM, SPL, STO, etc.).
47+
files:
48+
- structures/are/main.tph
49+
- structures/are/container_flags.tph
50+
- structures/are/door_flags.tph
51+
- structures/are/region_flags.tph
52+
- structures/are/region_type.tph
53+
- structures/cre/main.tph
54+
- structures/cre/flags.tph
55+
- structures/eff/main.tph
56+
- structures/eff/iesdp.tph
57+
- structures/eff2/main.tph
58+
- structures/eff2/iesdp.tph
59+
- structures/fx/main.tph
60+
- structures/fx/iesdp.tph
61+
- structures/fx/resist_dispel.tph
62+
- structures/fx/saving_throw.tph
63+
- structures/fx/target.tph
64+
- structures/fx/timing.tph
65+
- structures/itm/main.tph
66+
- structures/itm/attack_type.tph
67+
- structures/itm/damage_type.tph
68+
- structures/itm/depletion.tph
69+
- structures/itm/header_flags.tph
70+
- structures/itm/header_target.tph
71+
- structures/itm/iesdp.tph
72+
- structures/spl/main.tph
73+
- structures/spl/flags.tph
74+
- structures/spl/iesdp.tph
75+
- structures/spl/spell_form.tph
76+
- structures/sto/main.tph
77+
- structures/sto/flags.tph
78+
- structures/sto/iesdp.tph
79+
- structures/sto/item_flags.tph
80+
- structures/item_types.tph
81+
82+
- name: icons
83+
title: Icons
84+
desc: Portrait icon index constants.
85+
files:
86+
- misc/icons.tph
87+
88+
- name: scrolls
89+
title: Scrolls
90+
desc: Scroll resref constants.
91+
files:
92+
- misc/scrolls.tph
93+
- misc/scrolls_iwdee.tph
94+
- misc/scrolls_protection.tph
95+
96+
- name: misc
97+
title: Miscellaneous
98+
desc: Secondary type tables and other constants.
99+
files:
100+
- 2da/sectype.tph

docs/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ hero:
1616
- theme: alt
1717
text: Functions
1818
link: /functions/2da
19+
- theme: alt
20+
text: Constants
21+
link: /constants/ids
1922
- theme: alt
2023
text: Types
2124
link: /types

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"typecheck": "tsc --noEmit",
88
"iesdp-update": "bash scripts/iesdp-update.sh",
99
"test": "vitest run",
10-
"build-site": "tsx scripts/jsdoc-to-md.ts && pnpm exec vitepress build docs",
11-
"serve": "tsx scripts/jsdoc-to-md.ts && pnpm exec vitepress dev docs"
10+
"build-site": "tsx scripts/jsdoc-to-md.ts && tsx scripts/constants-to-md.ts && pnpm exec vitepress build docs",
11+
"serve": "tsx scripts/jsdoc-to-md.ts && tsx scripts/constants-to-md.ts && pnpm exec vitepress dev docs"
1212
},
1313
"dependencies": {
1414
"gray-matter": "^4.0.3",

0 commit comments

Comments
 (0)