fix type links to qt docs

This commit is contained in:
outfoxxed 2024-10-16 19:15:04 -07:00
parent e20c5126f9
commit b398aafcce
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E

View file

@ -131,7 +131,7 @@ export function getQMLTypeLink({
type,
module,
name,
//mtype,
mtype,
mname,
}: QMLTypeLinkObject) {
if (type === "unknown") {
@ -139,15 +139,16 @@ export function getQMLTypeLink({
}
const qtStart = "https://doc.qt.io/qt-6/";
const localStart = "/docs/types";
const isSpecific = mname ? `#${mname}` : "";
const hashMap = {
local: () => {
const isSpecific = mname ? `#${mname}` : "";
const localLink = `${localStart}/${module}/${name}${isSpecific}`;
return localLink;
},
qt: () => {
const qtLink = `${qtStart}${module!.toLowerCase().replace(".", "-")}-${name!.toLowerCase()}${isSpecific.toLowerCase()}.html`;
const isSpecific = mname ? `#${mname}-${mtype === "func" ? "method" : mtype}` : "";
const qtLink = `${qtStart}${module!.toLowerCase().replace(".", "-")}-${name!.toLowerCase()}.html${isSpecific}`;
return qtLink;
},
self: () => {