mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-31 23:28:34 -04:00
docs: consolidate docs (#2182)
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
8d46d7e39e
commit
ecffebc43c
307 changed files with 1474 additions and 487 deletions
|
@ -7,4 +7,7 @@
|
|||
import { isMockMode } from './test-modes'
|
||||
import { backendUrl } from './backend-url'
|
||||
|
||||
/**
|
||||
* Generates the url to the api.
|
||||
*/
|
||||
export const apiUrl = isMockMode ? `/api/mock-backend/private/` : `${backendUrl}api/private/`
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
import { backendUrl } from './backend-url'
|
||||
import { isMockMode } from './test-modes'
|
||||
|
||||
/**
|
||||
* Generates the url to the assets.
|
||||
*/
|
||||
export const customizeAssetsUrl = isMockMode
|
||||
? `/mock-public/`
|
||||
: process.env.NEXT_PUBLIC_CUSTOMIZE_ASSETS_URL || `${backendUrl}public/`
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -16,7 +16,7 @@ export interface PropsWithDataCypressId {
|
|||
* This works only if the runtime is built in test mode.
|
||||
*
|
||||
* @param identifier The identifier that is used to find the element
|
||||
* @return An object if in test mode, undefined otherwise.
|
||||
* @return An object if in test mode, {@link undefined} otherwise.
|
||||
*/
|
||||
export const cypressId = (
|
||||
identifier: string | undefined | PropsWithDataCypressId
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
/**
|
||||
* Detects if the application is running on client side.
|
||||
*/
|
||||
export const isClientSideRendering = (): boolean => {
|
||||
return typeof window !== 'undefined' && typeof window.navigator !== 'undefined'
|
||||
}
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* Checks if the given string is a positive answer (yes, true or 1)
|
||||
* Checks if the given string is a positive answer (yes, true or 1).
|
||||
*
|
||||
* @param value The value to check
|
||||
*/
|
||||
export const isPositiveAnswer = (value: string) => {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -16,7 +16,7 @@ export enum LogLevel {
|
|||
type OutputFunction = (...data: unknown[]) => void
|
||||
|
||||
/**
|
||||
* Simple logger that prefixes messages with a timestamp and a name
|
||||
* Simple logger that prefixes messages with a timestamp and a name.
|
||||
*/
|
||||
export class Logger {
|
||||
private readonly scope: string
|
||||
|
@ -26,7 +26,8 @@ export class Logger {
|
|||
}
|
||||
|
||||
/**
|
||||
* Logs a debug message
|
||||
* Logs a debug message.
|
||||
*
|
||||
* @param data data to log
|
||||
*/
|
||||
debug(...data: unknown[]): void {
|
||||
|
@ -34,7 +35,8 @@ export class Logger {
|
|||
}
|
||||
|
||||
/**
|
||||
* Logs a normal informative message
|
||||
* Logs a normal informative message.
|
||||
*
|
||||
* @param data data to log
|
||||
*/
|
||||
info(...data: unknown[]): void {
|
||||
|
@ -42,7 +44,8 @@ export class Logger {
|
|||
}
|
||||
|
||||
/**
|
||||
* Logs a warning
|
||||
* Logs a warning.
|
||||
*
|
||||
* @param data data to log
|
||||
*/
|
||||
warn(...data: unknown[]): void {
|
||||
|
@ -50,7 +53,8 @@ export class Logger {
|
|||
}
|
||||
|
||||
/**
|
||||
* Logs an error
|
||||
* Logs an error.
|
||||
*
|
||||
* @param data data to log
|
||||
*/
|
||||
error(...data: unknown[]): void {
|
||||
|
|
|
@ -14,7 +14,7 @@ export enum FileContentFormat {
|
|||
*
|
||||
* @param file The file to read
|
||||
* @param fileReaderMode Defines as what the file content should be formatted.
|
||||
* @throws Error if an invalid read mode was given or if the file couldn't be read.
|
||||
* @throws {Error} if an invalid read mode was given or if the file couldn't be read.
|
||||
* @return the file content
|
||||
*/
|
||||
export const readFile = async (file: Blob, fileReaderMode: FileContentFormat): Promise<string> => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue