html -> md

This commit is contained in:
Flummi 2025-03-17 10:47:11 +01:00
parent b72ed99fb8
commit 63bdc0d0ed
19 changed files with 682 additions and 1830 deletions

View File

@ -1 +0,0 @@
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.

11
docs/README.md Normal file
View File

@ -0,0 +1,11 @@
**flummpress**
***
# flummpress
## Classes
- [default](classes/default.md)
- [Router](classes/Router.md)
- [Tpl](classes/Tpl.md)

View File

@ -1 +0,0 @@
window.hierarchyData = "eJyrVirKzy8pVrKKjtVRKkpNy0lNLsnMzwMKVNfWAgCbHgqm"

View File

@ -1,22 +0,0 @@
:root {
--light-code-background: #FFFFFF;
--dark-code-background: #1E1E1E;
}
@media (prefers-color-scheme: light) { :root {
--code-background: var(--light-code-background);
} }
@media (prefers-color-scheme: dark) { :root {
--code-background: var(--dark-code-background);
} }
:root[data-theme='light'] {
--code-background: var(--light-code-background);
}
:root[data-theme='dark'] {
--code-background: var(--dark-code-background);
}
pre, code { background: var(--code-background); }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
window.navigationData = "eJyLrlYqSa0oUbJSSklNSyzNKVHSUSpILMkACiTnJBYXpxbrQyX0Mkpyc4Cy2Zl5KUpWhkYWtTpwvUH5pSWpRZhaIeL4dIYU5GBqAwpi6okFADDFOEw="

View File

@ -1 +0,0 @@
window.searchData = "eJytmE2P2zYQhv8LcxUcz9iy5b2mTdFDgCAocjGMQrG4u0IkS9BHUsDwfy9JfXAY0jRXyGW9kuZ9Z0Q+JEVeWVP9bNnT8cq+55eMPQEmEbukJWdPLOPPaV90LGJ9U4jrc5G2LW/fj/dXr11ZiIfjbRHAbtHkEwPOPufq0nZNf+6qxuv1zgwkvhGr04ZfOlKUTgVr3M65mqrv+IM0c8yiDF1d+O2HgEXeZZ5lBf8pov0pjLjQTLje6r7t2wcphoBF3kX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mw5k+IjFOsRh2vwQaklHY1ijTmfCxIR4DKKwNtH7POJF2gXD3kpvpknjENwwbFDTXS0xIrMDhuGit9/EhoxJDOvu6ZSEmJABAGGDSJ2wawcyV27GZSRsglCnk9qHTFLxoICA5Uise3Ve8yK/COXxdLv9D8b2ErY=";

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

347
docs/classes/Router.md Normal file
View File

@ -0,0 +1,347 @@
[**flummpress**](../README.md)
***
[flummpress](../README.md) / Router
# Class: Router
Defined in: router.ts:7
## Constructors
### new Router()
> **new Router**(): `Router`
Defined in: router.ts:12
#### Returns
`Router`
## Methods
### delete()
> **delete**(`path`, ...`callback`): `this`
Defined in: router.ts:158
Registers a route for HTTP DELETE requests.
#### Parameters
##### path
The URL path or pattern for the route.
`string` | `RegExp`
##### callback
...`Handler`[]
An array of middleware or handler functions to execute for this route.
#### Returns
`this`
The current instance for method chaining.
***
### get()
> **get**(`path`, ...`callback`): `this`
Defined in: router.ts:114
Registers a route for HTTP GET requests.
#### Parameters
##### path
The URL path or pattern for the route.
`string` | `RegExp`
##### callback
...`Handler`[]
An array of middleware or handler functions to execute for this route.
#### Returns
`this`
The current instance for method chaining.
***
### getRoute()
> **getRoute**(`path`, `method`): `any`
Defined in: router.ts:220
Finds and returns the route matching the given path and method.
#### Parameters
##### path
`string`
The requested path.
##### method
`string`
The HTTP method (e.g., "GET").
#### Returns
`any`
The matching route or undefined.
***
### group()
> **group**(`basePath`, `callback`): `this`
Defined in: router.ts:42
Registers a new route group with common base path and middleware.
#### Parameters
##### basePath
The base path or RegExp.
`string` | `RegExp`
##### callback
(`methods`) => `void`
Callback to define routes within the group.
#### Returns
`this`
The Router instance for chaining.
***
### head()
> **head**(`path`, ...`callback`): `this`
Defined in: router.ts:136
Registers a route for HTTP HEAD requests.
#### Parameters
##### path
The URL path or pattern for the route.
`string` | `RegExp`
##### callback
...`Handler`[]
An array of middleware or handler functions to execute for this route.
#### Returns
`this`
The current instance for method chaining.
***
### importRoutesFromPath()
> **importRoutesFromPath**(`p`, `tpl`): `Promise`\<`Router`\>
Defined in: router.ts:22
Dynamically imports routes from a directory and registers them.
#### Parameters
##### p
`string`
Path to the directory containing route files.
##### tpl
Optional template instance to use with the routes.
`false` | [`Tpl`](Tpl.md)
#### Returns
`Promise`\<`Router`\>
The Router instance for chaining.
***
### patch()
> **patch**(`path`, ...`callback`): `this`
Defined in: router.ts:169
Registers a route for HTTP PATCH requests.
#### Parameters
##### path
The URL path or pattern for the route.
`string` | `RegExp`
##### callback
...`Handler`[]
An array of middleware or handler functions to execute for this route.
#### Returns
`this`
The current instance for method chaining.
***
### post()
> **post**(`path`, ...`callback`): `this`
Defined in: router.ts:125
Registers a route for HTTP POST requests.
#### Parameters
##### path
The URL path or pattern for the route.
`string` | `RegExp`
##### callback
...`Handler`[]
An array of middleware or handler functions to execute for this route.
#### Returns
`this`
The current instance for method chaining.
***
### put()
> **put**(`path`, ...`callback`): `this`
Defined in: router.ts:147
Registers a route for HTTP PUT requests.
#### Parameters
##### path
The URL path or pattern for the route.
`string` | `RegExp`
##### callback
...`Handler`[]
An array of middleware or handler functions to execute for this route.
#### Returns
`this`
The current instance for method chaining.
***
### static()
> **static**(`options`): `this`
Defined in: router.ts:270
Serves static files from a specified directory.
#### Parameters
##### options
Options for serving static files.
###### dir?
`string` = `...`
Directory containing the static files.
###### route?
`RegExp` = `...`
Regular expression to match the route for static files.
#### Returns
`this`
The Router instance for chaining.
***
### use()
> **use**(`obj`): `void`
Defined in: router.ts:96
Merges routes or assigns a template instance to the Router.
#### Parameters
##### obj
An instance of Router or Tpl.
[`Tpl`](Tpl.md) | `Router`
#### Returns
`void`

File diff suppressed because one or more lines are too long

221
docs/classes/Tpl.md Normal file
View File

@ -0,0 +1,221 @@
[**flummpress**](../README.md)
***
[flummpress](../README.md) / Tpl
# Class: Tpl
Defined in: template.ts:4
## Constructors
### new Tpl()
> **new Tpl**(): `Template`
Defined in: template.ts:11
#### Returns
`Template`
## Methods
### escape()
> **escape**(`str`): `string`
Defined in: template.ts:147
Escapes a string for safe usage in HTML.
#### Parameters
##### str
`string`
The string to escape.
#### Returns
`string`
The escaped string.
***
### forEach()
> **forEach**(`o`, `f`): `void`
Defined in: template.ts:163
Iterates over an object or array and applies a callback function.
#### Parameters
##### o
`any`
The object or array to iterate over.
##### f
(`value`, `key`) => `void`
The callback function.
#### Returns
`void`
***
### getMtime()
> **getMtime**(`file`): `number`
Defined in: template.ts:180
Retrieves the last modification time of a file.
#### Parameters
##### file
`string`
The file path to check.
#### Returns
`number`
The last modification time in milliseconds.
***
### render()
> **render**(`file`, `data`, `locals`): `string`
Defined in: template.ts:103
Renders a template with the provided data and local variables.
#### Parameters
##### file
`string`
The name of the template file (without extension).
##### data
`Record`\<`string`, `any`\> = `{}`
Data object to inject into the template.
##### locals
`Record`\<`string`, `any`\> = `{}`
Local variables to be used within the template.
#### Returns
`string`
The rendered HTML string.
***
### setCache()
> **setCache**(`cache`): `void`
Defined in: template.ts:48
Enables or disables the template caching mechanism.
#### Parameters
##### cache
`boolean`
If true, enables caching.
#### Returns
`void`
***
### setDebug()
> **setDebug**(`debug`): `void`
Defined in: template.ts:23
Enables or disables debug mode.
#### Parameters
##### debug
`boolean`
If true, enables debug mode.
#### Returns
`void`
***
### setGlobals()
> **setGlobals**(`globals`): `void`
Defined in: template.ts:40
Sets global variables to be used in all templates.
#### Parameters
##### globals
`Record`\<`string`, `any`\>
An object containing global variables.
#### Returns
`void`
***
### setViews()
> **setViews**(`views`): `void`
Defined in: template.ts:31
Sets the directory for template files and preloads all templates.
#### Parameters
##### views
`string`
The directory path for template files.
#### Returns
`void`

File diff suppressed because one or more lines are too long

100
docs/classes/default.md Normal file
View File

@ -0,0 +1,100 @@
[**flummpress**](../README.md)
***
[flummpress](../README.md) / default
# Class: default
Defined in: index.ts:12
## Constructors
### new default()
> **new default**(): `Flummpress`
Defined in: index.ts:18
#### Returns
`Flummpress`
## Properties
### middleware
> **middleware**: `Handler`[]
Defined in: index.ts:16
***
### router
> **router**: [`Router`](Router.md)
Defined in: index.ts:14
***
### tpl
> **tpl**: [`Tpl`](Tpl.md)
Defined in: index.ts:15
## Methods
### listen()
> **listen**(...`args`): `this`
Defined in: index.ts:80
Starts the HTTP server and begins listening for incoming requests.
#### Parameters
##### args
...`any`[]
Arguments passed to `http.Server.listen`.
#### Returns
`this`
- The current instance for chaining.
***
### use()
> **use**(`plugin`): `this`
Defined in: index.ts:37
Adds a plugin to the application, which can be a Router instance, Tpl instance,
or a middleware handler function. The method determines the type of the plugin
and performs the appropriate action.
- If the plugin is an instance of `Router`, it is added to the application's router.
- If the plugin is an instance of `Tpl`, it sets the application's template engine.
- If the plugin is a middleware function, it is added to the middleware stack.
#### Parameters
##### plugin
The plugin to add, which can be a `Router` instance,
a `Tpl` instance, or a middleware handler function.
[`Tpl`](Tpl.md) | [`Router`](Router.md) | `Handler`
#### Returns
`this`
The current instance for method chaining.

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,7 @@
"type": "module",
"devDependencies": {
"@types/node": "^22.13.10",
"typedoc": "^0.27.9",
"typedoc-plugin-markdown": "^4.5.0",
"typescript": "^5.8.2"
}
}

View File

@ -1,4 +1,5 @@
{
"entryPoints": ["./src/index.ts"],
"out": "docs"
"out": "docs",
"plugin": ["typedoc-plugin-markdown"]
}