diff --git a/docs/common/src/components/SlintProperty.astro b/docs/common/src/components/SlintProperty.astro index 528a8aed429..c9d7c88c71e 100644 --- a/docs/common/src/components/SlintProperty.astro +++ b/docs/common/src/components/SlintProperty.astro @@ -57,6 +57,14 @@ const typeInfo = getTypeInfo(typeName); if (typeInfo.href !== "") { const base = import.meta.env.BASE_URL; typeInfo.href = `${base}${typeInfo.href}`; + + // For enums and structs, we can assume they have a permalink to their header on the target page. + // (These permalinks are also always lower-case.) + if (typeName === "enum") { + typeInfo.href += "#" + enumName.toLowerCase(); + } else if (typeName === "struct") { + typeInfo.href += "#" + structName.toLowerCase(); + } } const enumContent = await getEnumContent(enumName); const structContent = await getStructContent(structName);