# core/renderers/markdown.renderer.ts

> 39 lines of code and 11 definitions.

Tree: Build tree
Language: typescript
Layer: product
Canonical: https://banes-lab.com/anatomy/build#file-build-core-renderers-markdown-renderer-ts
Source text: https://banes-lab.com/assets/sources/source.02add99692a917898691eaf77ae7b54c3c30bd97f8b90ee439eb37380dfc645a.generated.txt

## Definitions

- `link` (lexical_declaration, line 16, exported)
- `section` (lexical_declaration, line 38, exported)
- `tabFileOf` (lexical_declaration, line 20, exported)
- `numbered` (lexical_declaration, line 46, exported)
- `attributionLine` (lexical_declaration, line 24, exported)
- `note` (lexical_declaration, line 34, exported)
- `ITALIC` (lexical_declaration, line 14)
- `owner` (lexical_declaration, line 25, exported)
- `licence` (lexical_declaration, line 26, exported)
- `image` (lexical_declaration, line 30, exported)
- `bullets` (lexical_declaration, line 42, exported)

## Used by

- [core/renderers/faq.renderer.ts](https://banes-lab.com/source/build/core/renderers/faq.renderer.ts.md)
- [core/renderers/readme.renderer.ts](https://banes-lab.com/source/build/core/renderers/readme.renderer.ts.md)
- [core/renderers/wiki.renderer.ts](https://banes-lab.com/source/build/core/renderers/wiki.renderer.ts.md)

## Source

```typescript
import { HEADING_TWO, ORDERED_ITEM } from "#configuration/constants/readme.constants";
import {
    LINK_CLOSE,
    LINK_MIDDLE,
    LINK_OPEN,
    LIST_ITEM,
    MARKDOWN_EXTENSION,
    PARAGRAPH_BREAK,
} from "#configuration/constants/chapter.constants";
import { ATTRIBUTION_SEPARATOR } from "#configuration/strings/chapter.strings";
import type { Attribution } from "#types/chapter.types";
import { LINE_END } from "#configuration/constants/inventory.constants";

const ITALIC = "_";

export const link = function link(label: string, file: string): string {
    return LINK_OPEN + label + LINK_MIDDLE + file + LINK_CLOSE;
};

export const tabFileOf = function tabFileOf(tab: string): string {
    return tab.toUpperCase() + MARKDOWN_EXTENSION;
};

export const attributionLine = function attributionLine(held: Attribution): string {
    const owner = held.copyright + held.author + held.work;
    const licence = held.coveredBy + link(held.licenseName, held.licenseUrl);
    return owner + ATTRIBUTION_SEPARATOR + licence;
};

export const image = function image(src: string, size: string, alt: string): string {
    return `<img src="${src}" alt="${alt}" width="${size}" height="${size}" />`;
};

export const note = function note(label: string, href: string): string {
    return ITALIC + link(label, href) + ITALIC;
};

export const section = function section(title: string, ...parts: readonly string[]): string {
    return [HEADING_TWO + title, ...parts].join(PARAGRAPH_BREAK);
};

export const bullets = function bullets(items: readonly string[]): string {
    return items.map((item) => LIST_ITEM + item).join(LINE_END);
};

export const numbered = function numbered(items: readonly string[]): string {
    return items.map((item, index) => String(index + 1) + ORDERED_ITEM + item).join(LINE_END);
};
```
