# presentation/views/grammar.view.ts

> 48 lines of code and 4 definitions.

Tree: Site tree
Language: typescript
Layer: product
Canonical: https://banes-lab.com/anatomy/tree#file-presentation-views-grammar-view-ts
Source text: https://banes-lab.com/assets/sources/source.c92339937ef201e898c29a28e6cb63cc7d64b6cbf660ad0f2f82b02b0e4c53cf.generated.txt

## Definitions

- `renderGrammar` (lexical_declaration, line 33)
- `GRAMMAR_ENTITY` (lexical_declaration, line 13)
- `DEFINITION` (lexical_declaration, line 25)
- `PAGE` (lexical_declaration, line 39, exported)

## Uses

- [presentation/widgets/tab.widget.ts](https://banes-lab.com/source/tree/presentation/widgets/tab.widget.ts.md)

## Source

```typescript
import { GRAMMAR_DESCRIPTION, GRAMMAR_LICENSE, GRAMMAR_TITLE } from "#configuration/strings/page.strings";
import { GRAMMAR_REPOSITORY, LICENSE_FILE, SITE_URL, pagePath } from "#assets/link.assets";
import { mountTabSwitching, renderTabbedPage } from "#presentation/widgets/tab.widget";
import { COMPANY_OWNER } from "#configuration/strings/company.strings";
import { GRAMMAR_META } from "#configuration/strings/grammar.strings";
import { GRAMMAR_PAGE } from "#core/ids/page.ids";
import { GRAMMAR_TABS } from "#configuration/strings/site.strings";
import { GRAMMAR_TONE } from "#configuration/constants/tab.constants";
import type { PageDefinition } from "#types/page.types";
import type { SchemaEntity } from "#types/schema.types";
import type { TabbedPage } from "#types/tab.types";

const GRAMMAR_ENTITY: SchemaEntity = {
    "@type": "DefinedTerm",
    creator: { "@type": "Person", name: COMPANY_OWNER },
    description: GRAMMAR_DESCRIPTION,
    license: SITE_URL + LICENSE_FILE,
    name: GRAMMAR_META.title,
    sameAs: GRAMMAR_REPOSITORY,
    termCode: GRAMMAR_TITLE,
    url: SITE_URL + pagePath(GRAMMAR_PAGE),
    version: GRAMMAR_META.version,
};

const DEFINITION: TabbedPage = {
    layout: "chapter",
    meta: GRAMMAR_META,
    page: GRAMMAR_PAGE,
    tabs: GRAMMAR_TABS,
    tone: GRAMMAR_TONE,
};

const renderGrammar = function renderGrammar(): Element {
    return renderTabbedPage(DEFINITION);
};

void mountTabSwitching(DEFINITION);

export const PAGE: PageDefinition = {
    content: {
        kind: "tabbed",
        layout: DEFINITION.layout,
        meta: GRAMMAR_META,
        tabs: GRAMMAR_TABS,
        tone: DEFINITION.tone,
    },
    description: GRAMMAR_DESCRIPTION,
    entities: [GRAMMAR_ENTITY],
    id: GRAMMAR_PAGE,
    license: GRAMMAR_LICENSE,
    render: renderGrammar,
    title: GRAMMAR_TITLE,
};
```
