8.22.0 • Published 2 months ago

@covalent/markdown-navigator v8.22.0

Weekly downloads
140
License
MIT
Repository
github
Last release
2 months ago

MarkdownNavigatorComponent

A component for rendering and navigating through markdown, such as documentation. Supports github urls.

API Summary

Inputs

  • items: IMarkdownNavigatorItem[]
    • List of IMarkdownNavigatorItems to be rendered
  • labels?: IMarkdownNavigatorLabels
    • Translated labels
  • startAt?: IMarkdownNavigatorItem | IMarkdownNavigatorItem[]
    • Item or path to jump to
  • compareWith?: IMarkdownNavigatorCompareWith
    • Function used to find startAt item
    • Defaults to comparison by strict equality (===)
  • footer:? Type
    • Custom component to be used as global footer
  • copyCodeToClipboard?: boolean
    • Display copy button on code snippets to copy code to clipboard.
  • copyCodeTooltips?: ICopyCodeTooltips
    • Tooltips for copy button to copy and upon copying.

Outputs

  • buttonClicked: ITdFlavoredMarkdownButtonClickEvent
    • Emitted when a button is clicked
  • itemSelected: IMarkdownNavigatorItem
    • Emitted the selected item when a item is selected

For reference:

interface IMarkdownNavigatorItem {
  id?: string; // used to compare items by default and as attr id for content
  title?: string;
  url?: string;
  httpOptions?: object;
  markdownString?: string; // raw markdown
  anchor?: string;
  children?: IMarkdownNavigatorItem[];
  childrenUrl?: string;
  description?: string;
  icon?: string;
  footer?: Type<any>;
}

interface ICopyCodeTooltips {
  copy?: string;
  copied?: string;
}

Setup

import { CovalentMarkdownNavigatorModule } from '@covalent/markdown-navigator';
@NgModule({
  imports: [CovalentMarkdownNavigatorModule],
})
export class MyModule {}

Usage

<td-markdown-navigator [items]="items"></td-markdown-navigator>
const items = [
  {
    id: 'covalent',
    title: 'Covalent',
    children: [
      {
        id: 'component',
        title: 'Components',
        children: [
          {
            id: 'td-loading',
            url: 'https://raw.githubusercontent.com/Teradata/covalent/main/src/platform/core/loading/README.md',
            title: 'tdLoading',
          },
        ],
      },
    ],
  },
];

MarkdownNavigatorWindowComponent

A component that contains a MarkdownNavigator component and a toolbar

API Summary

Inputs

  • items: IMarkdownNavigatorItem[]
    • List of IMarkdownNavigatorItems to be rendered
  • labels?: IMarkdownNavigatorLabels
    • Translated labels
  • startAt?: IMarkdownNavigatorItem | IMarkdownNavigatorItem[]
    • Item or path to jump to
  • compareWith?: IMarkdownNavigatorCompareWith
    • Function used to find startAt item
    • Defaults to comparison by strict equality (===)
  • toolbarColor?: ThemePalette
    • Toolbar color
    • Defaults to 'primary'
  • footer:? Type;
    • Custom component to be used as global footer

Outputs

  • closed: void
    • Event emitted when the close button is clicked.
  • buttonClicked: ITdFlavoredMarkdownButtonClickEvent
    • Emitted when a button is clicked
  • itemSelected: IMarkdownNavigatorItem
    • Emitted the selected item when a item is selected

Setup

import { CovalentMarkdownNavigatorModule } from '@covalent/markdown-navigator';
@NgModule({
  imports: [CovalentMarkdownNavigatorModule],
})
export class MyModule {}

Usage

<td-markdown-navigator-window [items]="items"></td-markdown-navigator-window>

MarkdownNavigatorWindowService

A service that opens a MarkdownNavigatorWindowComponent inside a draggable dialog. Uses the openDraggable method of the TdDialogService.

API Summary

Methods

  • open: function(config: IMarkdownNavigatorWindowConfig)
    • Opens a MarkdownNavigatorWindowComponent inside a draggable dialog.

For reference:

interface IMarkdownNavigatorWindowConfig {
  items: IMarkdownNavigatorItem[];
  dialogConfig?: MatDialogConfig;
  labels?: IMarkdownNavigatorWindowLabels;
  toolbarColor?: ThemePalette;
  startAt?: IMarkdownNavigatorItem | IMarkdownNavigatorItem[];
  compareWith?: IMarkdownNavigatorCompareWith;
  footer?: Type<any>;
}

Setup

import { CovalentMarkdownNavigatorModule } from '@covalent/markdown-navigator';
@NgModule({
  imports: [CovalentMarkdownNavigatorModule],
})
export class MyModule {}

Usage

import {
  TdMarkdownNavigatorWindowComponent,
  TdMarkdownNavigatorWindowService,
  IMarkdownNavigatorItem,
} from '@covalent/markdown-navigator';
import { MatDialogRef } from '@angular/material/dialog';

export class SampleComponent {
  constructor(
    private _markdownNavigatorWindowService: TdMarkdownNavigatorWindowService
  ) {}

  ngOnInit(): void {
    const ref: MatDialogRef<TdMarkdownNavigatorWindowComponent> =
      this._markdownNavigatorWindowService.open({
        items: [
          {
            url: 'https://github.com/Teradata/covalent/blob/main/README.md',
          },
        ],
      });
    ref.afterOpened().subscribe(() => {});
    ref.afterClosed().subscribe(() => {});
  }
}

MarkdownNavigatorWindowDirective

A directive that calls the TdMarkdownNavigatorWindowService open method on click events.

API Summary

Inputs

  • tdMarkdownNavigatorWindow: IMarkdownNavigatorWindowConfig
    • Config to open window with
  • disabled: boolean
    • Whether disabled or not

Setup

import { CovalentMarkdownNavigatorModule } from '@covalent/markdown-navigator';
@NgModule({
  imports: [CovalentMarkdownNavigatorModule],
})
export class MyModule {}

Usage

Example:

<button
  mat-button
  [tdMarkdownNavigatorWindow]="{ items: [] }"
  [disabled]="false"
>
  Open window
</button>
8.22.0

2 months ago

8.21.2

2 months ago

8.21.1

3 months ago

8.21.0

3 months ago

8.20.2

4 months ago

8.20.3

4 months ago

8.20.4

4 months ago

8.20.5

4 months ago

8.20.6

4 months ago

8.20.7

4 months ago

8.20.8

4 months ago

8.19.1

4 months ago

8.19.0

4 months ago

8.12.2

7 months ago

8.12.3

7 months ago

8.13.0

7 months ago

8.14.0

6 months ago

8.14.2

5 months ago

8.14.1

6 months ago

8.14.4

5 months ago

8.14.3

5 months ago

8.15.0-beta.13

5 months ago

8.15.0-beta.12

5 months ago

8.15.0-beta.11

5 months ago

8.15.0-beta.10

6 months ago

8.15.0

5 months ago

8.15.0-beta.17

5 months ago

8.15.0-beta.16

5 months ago

8.15.0-beta.15

5 months ago

8.15.0-beta.14

5 months ago

4.17.3

5 months ago

4.17.4

5 months ago

4.17.0

5 months ago

4.17.1

5 months ago

8.16.0

5 months ago

8.16.1

5 months ago

8.17.1

5 months ago

8.17.0

5 months ago

8.20.0

4 months ago

8.20.1

4 months ago

8.15.0-beta.4

6 months ago

8.15.0-beta.3

6 months ago

8.15.0-beta.2

6 months ago

8.15.0-beta.1

6 months ago

8.15.0-beta.8

6 months ago

8.15.0-beta.7

6 months ago

8.15.0-beta.6

6 months ago

8.15.0-beta.5

6 months ago

8.15.0-beta.9

6 months ago

8.18.0

5 months ago

8.18.1

5 months ago

8.12.1

7 months ago

8.11.0

8 months ago

8.12.0

8 months ago

8.10.0

8 months ago

8.10.1

8 months ago

8.9.2

9 months ago

8.9.1

9 months ago

8.9.0

9 months ago

8.8.1

9 months ago

8.8.0

9 months ago

8.8.0-beta.1

9 months ago

8.7.0

9 months ago

8.6.1

9 months ago

8.7.0-beta.9

9 months ago

8.7.0-beta.8

9 months ago

8.7.0-beta.7

9 months ago

8.7.0-beta.6

9 months ago

8.7.0-beta.5

9 months ago

8.7.0-beta.4

10 months ago

8.6.0

10 months ago

8.7.0-beta.3

10 months ago

8.7.0-beta.2

10 months ago

8.7.0-beta.1

10 months ago

8.6.0-beta.1

10 months ago

8.5.4

10 months ago

8.5.5

10 months ago

8.5.3

10 months ago

8.5.2

10 months ago

8.5.1

10 months ago

8.4.0

10 months ago

8.5.0

10 months ago

8.3.1

10 months ago

8.4.0-beta.3

10 months ago

8.4.0-beta.2

10 months ago

8.4.0-beta.1

10 months ago

8.3.0

10 months ago

8.3.0-beta.3

10 months ago

8.3.0-beta.2

10 months ago

8.2.1

10 months ago

8.3.0-beta.1

10 months ago

8.2.0-beta.1

10 months ago

8.2.0

10 months ago

8.1.0

10 months ago

8.1.0-beta.9

11 months ago

8.1.0-beta.8

11 months ago

8.1.0-beta.7

11 months ago

8.1.0-beta.6

11 months ago

8.1.0-beta.5

11 months ago

8.1.0-beta.4

11 months ago

8.1.0-beta.3

11 months ago

8.1.0-beta.2

11 months ago

8.1.0-beta.1

11 months ago

7.5.0-beta.4

12 months ago

7.5.0-beta.5

12 months ago

8.0.0

12 months ago

7.4.7

1 year ago

7.4.6

1 year ago

7.4.5

1 year ago

7.4.4

1 year ago

7.4.3

1 year ago

7.5.0-beta.3

1 year ago

6.1.2

1 year ago

6.1.3

1 year ago

7.3.1

1 year ago

7.3.0

1 year ago

7.4.2

1 year ago

7.4.1

1 year ago

7.5.0-beta.2

1 year ago

7.5.0-beta.1

1 year ago

6.2.1

1 year ago

6.2.0

1 year ago

6.2.3

1 year ago

6.2.2

1 year ago

7.4.0-beta.1

1 year ago

7.4.0-beta.2

1 year ago

7.0.0

1 year ago

7.4.0

1 year ago

4.16.3

1 year ago

4.16.0

1 year ago

4.16.1

1 year ago

4.16.2

1 year ago

6.3.0

1 year ago

7.1.0-beta.2

1 year ago

7.1.0-beta.1

1 year ago

7.1.0-beta.3

1 year ago

7.1.1

1 year ago

7.1.0

1 year ago

6.4.0

1 year ago

6.3.0-beta.1

1 year ago

6.3.0-beta.2

1 year ago

6.3.0-beta.3

1 year ago

6.3.0-beta.4

1 year ago

7.2.0

1 year ago

6.1.0

1 year ago

6.1.1

1 year ago

6.0.0-beta.1

2 years ago

6.0.0-beta.2

2 years ago

6.0.1

2 years ago

6.0.0

2 years ago

6.0.3

2 years ago

6.0.2

2 years ago

6.0.5

2 years ago

6.0.4

2 years ago

5.1.0-beta.1

2 years ago

5.0.2

2 years ago

5.0.0-beta.1

2 years ago

5.0.1

2 years ago

5.0.0

2 years ago

4.16.0-beta.2

2 years ago

4.16.0-beta.1

2 years ago

4.12.3

2 years ago

4.12.0

2 years ago

4.10.2

2 years ago

4.12.1

2 years ago

4.14.0

2 years ago

4.12.2

2 years ago

4.15.0

2 years ago

4.11.0

2 years ago

4.13.0

2 years ago

4.7.1

2 years ago

4.6.1

2 years ago

4.6.0

2 years ago

4.8.0

2 years ago

4.6.2

2 years ago

4.5.0

2 years ago

4.7.0

2 years ago

4.4.0

2 years ago

3.2.2

2 years ago

3.2.1

2 years ago

3.2.0

2 years ago

3.2.4

2 years ago

3.2.3

2 years ago

4.2.1

2 years ago

4.3.0

2 years ago

4.1.9

3 years ago

4.1.11-develop.1

3 years ago

4.2.0

3 years ago

4.1.10

3 years ago

4.1.11

3 years ago

4.1.12

3 years ago

4.1.13

3 years ago

4.1.14

3 years ago

4.1.15

3 years ago

4.1.8

3 years ago

4.1.7

3 years ago

4.1.4

3 years ago

4.1.3

3 years ago

4.1.6

3 years ago

4.1.5

3 years ago

4.1.2

3 years ago

4.1.1

3 years ago

4.1.1-develop.1

3 years ago

4.1.0-develop.5

3 years ago

4.1.0-develop.6

3 years ago

4.1.0-develop.7

3 years ago

4.1.0-develop.8

3 years ago

4.1.0-develop.9

3 years ago

4.1.0-develop.2

3 years ago

4.1.0-develop.4

3 years ago

4.1.0-develop.11

3 years ago

4.1.0-develop.10

3 years ago

4.1.0

3 years ago

4.1.1-next.1

3 years ago

4.1.1-beta.3

3 years ago

4.0.0-beta.4

3 years ago

4.0.0-beta.2

3 years ago

0.0.1

3 years ago

3.1.2

3 years ago

4.0.0-beta.1

3 years ago

4.0.0

3 years ago

3.1.2-beta.7

3 years ago

4.0.0-alpha.0

3 years ago

3.1.2-beta.6

3 years ago

3.1.2-beta.4

3 years ago

3.1.1

3 years ago

3.1.1-beta.1

4 years ago

3.1.0

4 years ago

3.1.0-beta.2

4 years ago

3.1.0-beta.1

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

3.0.0-rc.2

5 years ago

3.0.0-rc.1

5 years ago

3.0.0-beta.3

5 years ago

3.0.0-beta.2

5 years ago

3.0.0-beta.1-2

5 years ago

3.0.0-beta.1-1

5 years ago

3.0.0-beta.1

5 years ago