Skip to content

Commit

Permalink
feat(addon-doc): support remote url for code source
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Aug 25, 2023
1 parent f059252 commit b0440d1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ export class TuiDocSourceCodeComponent {
@Input()
path = '';

@Input()
remoteCodeUrl = '';

constructor(
@Inject(TUI_DOC_ICONS) readonly icons: TuiDocIcons,
@Inject(TUI_DOC_SOURCE_CODE)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<a
*polymorpheusOutlet="sourceCode as link; context: pathOptions"
*polymorpheusOutlet="remoteCodeUrl || sourceCode as link; context: pathOptions"
appearance="icon"
size="s"
target="_blank"
Expand Down
3 changes: 3 additions & 0 deletions projects/addon-doc/components/page/page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export class TuiDocPageComponent {
@Input()
deprecated: boolean | '' = false;

@Input()
remoteCodeUrl: string | '' = '';

@ContentChildren(TuiDocPageTabConnectorDirective)
readonly tabConnectors: QueryList<TuiDocPageTabConnectorDirective> = EMPTY_QUERY;

Expand Down
1 change: 1 addition & 0 deletions projects/addon-doc/components/page/page.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ <h1 class="t-title">
[header]="header"
[package]="package"
[path]="path"
[remoteCodeUrl]="remoteCodeUrl"
[type]="type"
></tui-doc-source-code>
</header>
Expand Down
5 changes: 4 additions & 1 deletion projects/demo/src/modules/icons/icons.template.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<tui-doc-page header="Icons">
<tui-doc-page
header="Icons"
remoteCodeUrl="https://google.com"
>
<ng-template
*ngFor="let key of keys"
[pageTab]="key"
Expand Down

0 comments on commit b0440d1

Please sign in to comment.