@yookue/typedoc-theme-dumi
Advanced tools
Comparing version 0.1.2 to 0.2.0
import { DefaultThemeRenderContext } from 'typedoc'; | ||
export declare class DumiThemeRenderContext extends DefaultThemeRenderContext { | ||
toolbar: (event: import("typedoc").PageEvent<import("typedoc").Reflection>) => import("typedoc/dist/lib/utils/jsx.elements").JsxElement; | ||
toolbar: (props: import("typedoc").PageEvent<import("typedoc").Reflection>) => import("typedoc/dist/lib/utils/jsx.elements").JsxElement; | ||
sidebarLinks: () => import("typedoc/dist/lib/utils/jsx.elements").JsxElement | null; | ||
header: (event: import("typedoc").PageEvent<import("typedoc").Reflection>) => import("typedoc/dist/lib/utils/jsx.elements").JsxElement; | ||
navigation: (event: import("typedoc").PageEvent<import("typedoc").Reflection>) => import("typedoc/dist/lib/utils/jsx.elements").JsxElement; | ||
header: (props: import("typedoc").PageEvent<import("typedoc").Reflection>) => import("typedoc/dist/lib/utils/jsx.elements").JsxElement; | ||
navigation: (props: import("typedoc").PageEvent<import("typedoc").Reflection>) => import("typedoc/dist/lib/utils/jsx.elements").JsxElement; | ||
footer: () => import("typedoc/dist/lib/utils/jsx.elements").JsxElement; | ||
} |
@@ -0,0 +0,0 @@ "use strict"; |
import { Application } from 'typedoc'; | ||
export declare function load(app: Application): void; |
@@ -29,3 +29,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.load = void 0; | ||
exports.load = load; | ||
const node_fs_1 = __importDefault(require("node:fs")); | ||
@@ -48,3 +48,3 @@ const node_path_1 = __importDefault(require("node:path")); | ||
}); | ||
app.listenTo(app.renderer, typedoc_1.RendererEvent.END, () => { | ||
app.renderer.on(typedoc_1.RendererEvent.END, () => { | ||
const source = node_path_1.default.resolve(__dirname, './assets'); | ||
@@ -56,2 +56,1 @@ const target = node_path_1.default.join(node_path_1.default.resolve(app.options.getValue('out')), 'assets'); | ||
} | ||
exports.load = load; |
@@ -0,0 +0,0 @@ import { type DeclarationOption } from 'typedoc'; |
@@ -0,0 +0,0 @@ "use strict"; |
import { JSX } from 'typedoc'; | ||
import { DumiThemeRenderContext } from '../contexts/DumiThemeRenderContext'; | ||
export declare function footer(context: DumiThemeRenderContext): JSX.Element; | ||
import { type DumiThemeRenderContext } from '../contexts/DumiThemeRenderContext'; | ||
export declare const footer: (context: DumiThemeRenderContext) => JSX.Element; |
@@ -5,3 +5,3 @@ "use strict"; | ||
const typedoc_1 = require("typedoc"); | ||
function footer(context) { | ||
const footer = (context) => { | ||
const hideGenerator = context.options.getValue('hideGenerator'); | ||
@@ -13,11 +13,38 @@ const footerAlign = context.options.getValue('footerAlign'); | ||
} | ||
let generatorDisplay = typedoc_1.JSX.createElement(typedoc_1.JSX.Fragment, null); | ||
if (!hideGenerator) { | ||
const message = context.i18n.theme_generated_using_typedoc(); | ||
const index = message.indexOf("TypeDoc"); | ||
if (index == -1) { | ||
generatorDisplay = typedoc_1.JSX.createElement("p", { class: "tsd-generator" }, message); | ||
} | ||
else { | ||
const pre = message.substring(0, index); | ||
const post = message.substring(index + "TypeDoc".length); | ||
generatorDisplay = (typedoc_1.JSX.createElement(typedoc_1.JSX.Fragment, null, | ||
typedoc_1.JSX.createElement("p", { class: "tsd-generator" }, | ||
pre, | ||
typedoc_1.JSX.createElement("a", { href: "https://typedoc.org/", target: "_blank" }, "TypeDoc"), | ||
post, | ||
' with ', | ||
typedoc_1.JSX.createElement("a", { href: "https://yookue.github.io/typedoc-theme-dumi", target: "_blank" }, "dumi theme")))); | ||
} | ||
} | ||
const customFooterHtml = context.options.getValue("customFooterHtml"); | ||
let customFooterDisplay = typedoc_1.JSX.createElement(typedoc_1.JSX.Fragment, null); | ||
if (customFooterHtml) { | ||
if (context.options.getValue("customFooterHtmlDisableWrapper")) { | ||
customFooterDisplay = typedoc_1.JSX.createElement(typedoc_1.JSX.Raw, { html: customFooterHtml }); | ||
} | ||
else { | ||
customFooterDisplay = (typedoc_1.JSX.createElement("p", null, | ||
typedoc_1.JSX.createElement(typedoc_1.JSX.Raw, { html: customFooterHtml }))); | ||
} | ||
} | ||
return (typedoc_1.JSX.createElement("footer", Object.assign({}, attributes), | ||
context.hook('footer.begin'), | ||
hideGenerator || (typedoc_1.JSX.createElement("p", { class: "tsd-generator" }, | ||
'Generated using ', | ||
typedoc_1.JSX.createElement("a", { href: "https://typedoc.org", target: "_blank" }, "TypeDoc"), | ||
' with ', | ||
typedoc_1.JSX.createElement("a", { href: "https://yookue.github.io/typedoc-theme-dumi", target: "_blank" }, "dumi theme"))), | ||
context.hook('footer.end'))); | ||
} | ||
context.hook("footer.begin", context), | ||
generatorDisplay, | ||
customFooterDisplay, | ||
context.hook("footer.end", context))); | ||
}; | ||
exports.footer = footer; |
import { JSX, type PageEvent, type Reflection } from 'typedoc'; | ||
import { DumiThemeRenderContext } from '../contexts/DumiThemeRenderContext'; | ||
export declare function header(context: DumiThemeRenderContext, event: PageEvent<Reflection>): JSX.Element; | ||
import { type DumiThemeRenderContext } from '../contexts/DumiThemeRenderContext'; | ||
export declare const header: (context: DumiThemeRenderContext, props: PageEvent<Reflection>) => JSX.Element; |
@@ -6,19 +6,19 @@ "use strict"; | ||
const proto_utils_1 = require("../utils/proto-utils"); | ||
function header(context, event) { | ||
const header = (context, props) => { | ||
const hideIndexContentTitle = context.options.getValue('hideIndexContentTitle'); | ||
if (hideIndexContentTitle && event.url === 'index.html') { | ||
if (hideIndexContentTitle && props.url === 'index.html') { | ||
return typedoc_1.JSX.createElement("div", { class: "tsd-page-title-hidden", style: "display: none" }); | ||
} | ||
const HeadingLevel = event.model.isProject() ? 'h2' : 'h1'; | ||
const HeadingLevel = props.model.isProject() ? 'h2' : 'h1'; | ||
return (typedoc_1.JSX.createElement("div", { class: "tsd-page-title" }, | ||
!!event.model.parent && typedoc_1.JSX.createElement("ul", { class: "tsd-breadcrumb" }, context.breadcrumb(event.model)), | ||
typedoc_1.JSX.createElement(HeadingLevel, { class: (0, proto_utils_1.classNames)({ deprecated: event.model.isDeprecated() }) }, | ||
event.model.kind !== typedoc_1.ReflectionKind.Project && `${typedoc_1.ReflectionKind.singularString(event.model.kind)} `, | ||
(0, proto_utils_1.displayName)(event.model), | ||
(0, proto_utils_1.hasTypeParameters)(event.model) && (typedoc_1.JSX.createElement(typedoc_1.JSX.Fragment, null, | ||
!!props.model.parent && typedoc_1.JSX.createElement("ul", { class: "tsd-breadcrumb" }, context.breadcrumb(props.model)), | ||
!props.model.isDocument() && (typedoc_1.JSX.createElement(HeadingLevel, { class: (0, proto_utils_1.classNames)({ deprecated: props.model.isDeprecated() }) }, | ||
props.model.kind !== typedoc_1.ReflectionKind.Project && `${context.internationalization.kindSingularString(props.model.kind)} `, | ||
(0, proto_utils_1.displayName)(props.model), | ||
(0, proto_utils_1.hasTypeParameters)(props.model) && (typedoc_1.JSX.createElement(typedoc_1.JSX.Fragment, null, | ||
"<", | ||
(0, proto_utils_1.joinElements)(", ", event.model.typeParameters, (item) => item.name), | ||
(0, proto_utils_1.joinElements)(", ", props.model.typeParameters, (item) => item.name), | ||
">")), | ||
context.reflectionFlags(event.model)))); | ||
} | ||
context.reflectionFlags(props.model))))); | ||
}; | ||
exports.header = header; |
import { JSX, type PageEvent, type Reflection } from 'typedoc'; | ||
import { DumiThemeRenderContext } from '../contexts/DumiThemeRenderContext'; | ||
export declare function navigation(context: DumiThemeRenderContext, event: PageEvent<Reflection>): JSX.Element; | ||
export declare const navigation: (context: DumiThemeRenderContext, props: PageEvent<Reflection>) => JSX.Element; |
@@ -6,11 +6,11 @@ "use strict"; | ||
const proto_utils_1 = require("../utils/proto-utils"); | ||
function navigation(context, event) { | ||
const navigation = (context, props) => { | ||
const preventModulesLink = context.options.getValue('preventModulesLink'); | ||
return (typedoc_1.JSX.createElement("nav", { class: "tsd-navigation" }, | ||
typedoc_1.JSX.createElement("a", { href: preventModulesLink ? 'javascript:;' : context.urlTo(event.project), class: (0, proto_utils_1.classNames)({ current: event.project === event.model }) }, | ||
typedoc_1.JSX.createElement("a", { href: preventModulesLink ? 'javascript:;' : context.urlTo(props.project), class: (0, proto_utils_1.classNames)({ current: props.project === props.model }) }, | ||
context.icons[typedoc_1.ReflectionKind.Project](), | ||
typedoc_1.JSX.createElement("span", null, (0, proto_utils_1.displayName)(event.project))), | ||
typedoc_1.JSX.createElement("span", null, (0, proto_utils_1.displayName)(props.project))), | ||
typedoc_1.JSX.createElement("ul", { class: "tsd-small-nested-navigation", id: "tsd-nav-container", "data-base": context.relativeURL("./") }, | ||
typedoc_1.JSX.createElement("li", null, "Loading...")))); | ||
} | ||
typedoc_1.JSX.createElement("li", null, context.i18n.theme_loading())))); | ||
}; | ||
exports.navigation = navigation; |
import { JSX } from 'typedoc'; | ||
import { DumiThemeRenderContext } from '../contexts/DumiThemeRenderContext'; | ||
export declare function sidebarLinks(context: DumiThemeRenderContext): JSX.Element | null; | ||
export declare const sidebarLinks: (context: DumiThemeRenderContext) => JSX.Element | null; |
@@ -5,7 +5,7 @@ "use strict"; | ||
const typedoc_1 = require("typedoc"); | ||
function sidebarLinks(context) { | ||
const sidebarLinks = (context) => { | ||
const sidebarLinks = Object.entries(context.options.getValue("sidebarLinks")); | ||
const sidebarLinkTargets = context.options.getValue('sidebarLinkTargets'); | ||
return !sidebarLinks.length ? null : (typedoc_1.JSX.createElement("nav", { id: "tsd-sidebar-links", class: "tsd-navigation" }, sidebarLinks.map(([label, url]) => (typedoc_1.JSX.createElement("a", { href: url, target: sidebarLinkTargets[label] || '_self' }, label))))); | ||
} | ||
}; | ||
exports.sidebarLinks = sidebarLinks; |
import { JSX, type PageEvent, type Reflection } from 'typedoc'; | ||
import { DumiThemeRenderContext } from '../contexts/DumiThemeRenderContext'; | ||
export declare function toolbar(context: DumiThemeRenderContext, event: PageEvent<Reflection>): JSX.Element; | ||
export declare const toolbar: (context: DumiThemeRenderContext, props: PageEvent<Reflection>) => JSX.Element; |
@@ -6,3 +6,3 @@ "use strict"; | ||
const proto_utils_1 = require("../utils/proto-utils"); | ||
function toolbar(context, event) { | ||
const toolbar = (context, props) => { | ||
const logoImage = context.options.getValue('logoImage'); | ||
@@ -31,14 +31,13 @@ const logoWidth = context.options.getValue('logoWidth'); | ||
typedoc_1.JSX.createElement("label", { for: "tsd-search-field", class: "tsd-widget tsd-toolbar-icon search no-caption" }, context.icons.search()), | ||
typedoc_1.JSX.createElement("input", { type: "text", id: "tsd-search-field", "aria-label": "Search" })), | ||
typedoc_1.JSX.createElement("input", { type: "text", id: "tsd-search-field", "aria-label": context.i18n.theme_search() })), | ||
typedoc_1.JSX.createElement("div", { class: "field" }, | ||
typedoc_1.JSX.createElement("div", { id: "tsd-toolbar-links" }, Object.entries(context.options.getValue("navigationLinks")).map(([label, url]) => (typedoc_1.JSX.createElement("a", { href: url, target: navigationLinkTargets[label] || '_self' }, label))))), | ||
typedoc_1.JSX.createElement("ul", { class: "results" }, | ||
typedoc_1.JSX.createElement("li", { class: "state loading" }, "Preparing search index..."), | ||
typedoc_1.JSX.createElement("li", { class: "state failure" }, "The search index is not available")), | ||
typedoc_1.JSX.createElement("li", { class: "state loading" }, context.i18n.theme_preparing_search_index()), | ||
typedoc_1.JSX.createElement("li", { class: "state failure" }, context.i18n.theme_search_index_not_available())), | ||
typedoc_1.JSX.createElement("a", { href: context.options.getValue("titleLink") || context.relativeURL("index.html"), class: "title" }, | ||
buildImageDom(), | ||
logoTitle || (0, proto_utils_1.displayName)(event.project))), | ||
buildImageDom(), logoTitle !== null && logoTitle !== void 0 ? logoTitle : (0, proto_utils_1.displayName)(props.project))), | ||
typedoc_1.JSX.createElement("div", { class: "table-cell", id: "tsd-widgets" }, | ||
typedoc_1.JSX.createElement("a", { href: "#", class: "tsd-widget tsd-toolbar-icon menu no-caption", "data-toggle": "menu", "aria-label": "Menu" }, context.icons.menu()))))); | ||
} | ||
typedoc_1.JSX.createElement("a", { href: "#", class: "tsd-widget tsd-toolbar-icon menu no-caption", "data-toggle": "menu", "aria-label": context.i18n.theme_menu() }, context.icons.menu()))))); | ||
}; | ||
exports.toolbar = toolbar; |
import { DefaultTheme, type PageEvent, type Reflection } from 'typedoc'; | ||
import { DumiThemeRenderContext } from '../contexts/DumiThemeRenderContext'; | ||
export declare class DumiTheme extends DefaultTheme { | ||
getRenderContext(event: PageEvent<Reflection>): DumiThemeRenderContext; | ||
getRenderContext(props: PageEvent<Reflection>): DumiThemeRenderContext; | ||
} |
@@ -7,6 +7,6 @@ "use strict"; | ||
class DumiTheme extends typedoc_1.DefaultTheme { | ||
getRenderContext(event) { | ||
return new DumiThemeRenderContext_1.DumiThemeRenderContext(this, event, this.application.options); | ||
getRenderContext(props) { | ||
return new DumiThemeRenderContext_1.DumiThemeRenderContext(this, props, this.application.options); | ||
} | ||
} | ||
exports.DumiTheme = DumiTheme; |
@@ -0,0 +0,0 @@ import { JSX, Reflection, TypeParameterReflection } from 'typedoc'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.joinElements = exports.hasTypeParameters = exports.displayName = exports.classNames = exports.bindProps = void 0; | ||
exports.bindProps = bindProps; | ||
exports.classNames = classNames; | ||
exports.displayName = displayName; | ||
exports.hasTypeParameters = hasTypeParameters; | ||
exports.joinElements = joinElements; | ||
const typedoc_1 = require("typedoc"); | ||
@@ -8,3 +12,2 @@ function bindProps(fn, first) { | ||
} | ||
exports.bindProps = bindProps; | ||
function classNames(names, extraCss) { | ||
@@ -14,3 +17,2 @@ const css = Object.keys(names).filter((key) => names[key]).concat(extraCss || '').join(' ').trim().replace(/\s+/g, ' '); | ||
} | ||
exports.classNames = classNames; | ||
function displayName(ref) { | ||
@@ -23,7 +25,5 @@ let version = ''; | ||
} | ||
exports.displayName = displayName; | ||
function hasTypeParameters(ref) { | ||
return ((ref instanceof typedoc_1.DeclarationReflection || ref instanceof typedoc_1.SignatureReflection) && ref.typeParameters != null && ref.typeParameters.length > 0); | ||
} | ||
exports.hasTypeParameters = hasTypeParameters; | ||
function joinElements(joiner, list, callback) { | ||
@@ -39,2 +39,1 @@ const result = []; | ||
} | ||
exports.joinElements = joinElements; |
{ | ||
"name": "@yookue/typedoc-theme-dumi", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"title": "TypedocThemeDumi", | ||
@@ -32,3 +32,3 @@ "description": "Dumi theme for typedoc, maybe the most beautiful typedoc theme on Mars", | ||
"devDependencies": { | ||
"@types/node": "^16.18.96", | ||
"@types/node": "^16.18.104", | ||
"@typescript-eslint/eslint-plugin": "^6.21.0", | ||
@@ -40,4 +40,4 @@ "del-cli": "^5.1.0", | ||
"stylelint-config-standard-less": "^3.0.1", | ||
"typedoc": "~0.25.13", | ||
"typescript": "^4.9.5" | ||
"typedoc": "~0.26.5", | ||
"typescript": "^5.5.4" | ||
}, | ||
@@ -44,0 +44,0 @@ "peerDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36453
643
1