ig-typedoc-theme
Version:
infragistics theme for typedoc API documentation with versioning and localization
38 lines (37 loc) • 1.4 kB
JavaScript
import { JSX } from 'typedoc';
import { localize } from 'typedoc-plugin-localization';
export const memberSources = (context, props) => {
const sources = [];
if (props.implementationOf) {
sources.push(JSX.createElement("p", null,
localize('Implementation of') + ' ',
context.typeAndParent(props.implementationOf)));
}
if (props.inheritedFrom) {
sources.push(JSX.createElement("p", null,
localize('Inherited from') + ' ',
context.typeAndParent(props.inheritedFrom)));
}
if (props.overwrites) {
sources.push(JSX.createElement("p", null,
localize('Overrides') + ' ',
context.typeAndParent(props.overwrites)));
}
if (props.sources) {
sources.push(JSX.createElement("ul", null, props.sources.map((item) => item.url ? (JSX.createElement("li", null,
localize('Defined in') + ' ',
JSX.createElement("a", { href: item.url },
item.fileName,
":",
item.line))) : (JSX.createElement("li", null,
localize('Defined in') + ' ',
" ",
item.fileName,
":",
item.line)))));
}
if (sources.length === 0) {
return JSX.createElement(JSX.Fragment, null);
}
return JSX.createElement("aside", { class: "tsd-sources" }, sources);
};