mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 21:13:09 +00:00
chore: comments (#3093)
* chore: comments * revert some sizing --------- Co-authored-by: Matt Hill <mattnine@protonmail.com>
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import { ChangeDetectionStrategy, Component, inject } from '@angular/core'
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core'
|
||||
import { toSignal } from '@angular/core/rxjs-interop'
|
||||
import { ActivatedRoute } from '@angular/router'
|
||||
import { TuiDialogContext, TuiLoader, TuiNotification } from '@taiga-ui/core'
|
||||
import { TuiLoader, TuiNotification } from '@taiga-ui/core'
|
||||
import { NgDompurifyPipe } from '@taiga-ui/dompurify'
|
||||
import { injectContext, PolymorpheusComponent } from '@taiga-ui/polymorpheus'
|
||||
import { catchError, ignoreElements, Observable, of } from 'rxjs'
|
||||
import { catchError, ignoreElements, Observable, of, share } from 'rxjs'
|
||||
import { SafeLinksDirective } from '../directives/safe-links.directive'
|
||||
import { MarkdownPipe } from '../pipes/markdown.pipe'
|
||||
import { getErrorMessage } from '../services/error.service'
|
||||
@@ -34,7 +33,10 @@ import { getErrorMessage } from '../services/error.service'
|
||||
],
|
||||
})
|
||||
export class MarkdownComponent {
|
||||
protected readonly data = injectContext<{ data: Observable<string> }>().data
|
||||
private readonly data = injectContext<{
|
||||
data: Observable<string>
|
||||
}>().data.pipe(share())
|
||||
|
||||
protected readonly content = toSignal<string>(this.data)
|
||||
protected readonly error = toSignal(
|
||||
this.data.pipe(
|
||||
|
||||
@@ -5,11 +5,14 @@ import {
|
||||
InjectionToken,
|
||||
input,
|
||||
} from '@angular/core'
|
||||
import { TuiHintDirective } from '@taiga-ui/core'
|
||||
import { i18nPipe } from '../i18n/i18n.pipe'
|
||||
|
||||
export const VERSION = new InjectionToken<string>('VERSION')
|
||||
|
||||
@Directive({
|
||||
selector: '[docsLink]',
|
||||
hostDirectives: [TuiHintDirective],
|
||||
host: {
|
||||
target: '_blank',
|
||||
rel: 'noreferrer',
|
||||
@@ -20,12 +23,18 @@ export class DocsLinkDirective {
|
||||
private readonly version = inject(VERSION)
|
||||
|
||||
readonly path = input.required<string>()
|
||||
|
||||
readonly fragment = input<string>('')
|
||||
|
||||
protected readonly url = computed(() => {
|
||||
const path = this.path()
|
||||
const relative = path.startsWith('/') ? path : `/${path}`
|
||||
|
||||
return `https://docs.start9.com${relative}?os=${this.version}${this.fragment()}`
|
||||
})
|
||||
|
||||
constructor() {
|
||||
inject(TuiHintDirective).content.set(
|
||||
inject(i18nPipe).transform('Documentation'),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user