doc: fixed detail
Massimo Melina committed
Mar 24, 2025 at 18:55 UTC
aa67b63d43436efe8b2027d7fab150e0628f4b87
4 files changed
+16
-9
README.md
+2
-2
@@ -77,9 +77,9 @@ If you don't like this behavior, disable it in the Admin-panel or enter this con
77
78
### Other systems
79
80
-If your system is not Windows/Linux/Mac or you just don't want to run the binaries, you can try this alternative version:
80
+If can't or don't want to run our binary versions, you can try this:
81
82
-1. [install node.js](https://nodejs.org) version 18.20
82
+1. [install node.js](https://nodejs.org) version 18.20 (or greater, but then compatibility is not guaranteed)
83
2. execute at command line `npx hfs@latest`
84
85
The `@latest` part is optional, and ensures that you are always up to date.
config.md
+4
-2
@@ -4,8 +4,10 @@ This file contains details about the configuration files.
4
5
Configuration is stored in the file `config.yaml`, exception made for custom HTML which is stored in `custom.html`.
6
7
-These files are kept in the Current Working Directory (cwd), which is by default the same folder of `hfs.exe`
8
-if you are using this kind of distribution on Windows, or `USER_FOLDER/.hfs` on other systems.
7
+These files are kept in the same folder of `hfs.exe` if you are using this kind of distribution on Windows,
8
+or `$HOME/.hfs` on other systems, where *$HOME* varies with the system and is the user's home folder.
9
+Anyway, the current working directory (CWD) is printed by HFS in the first lines of the console.
10
+
11
Many things are stored in the CWD, like the plugins you install.
12
You can decide a different CWD passing `--cwd SOME_FOLDER` parameter at command line.
13
dev-plugins.md
+8
-4
@@ -423,11 +423,11 @@ HFS object is the same you access globally. Here just for legacy, consider it de
423
Some frontend events can return HTML, which can be expressed in several ways:
424
- as a string containing markup
425
- as DOM Nodes, using methods like `document.createElement()`
426
-- as a ReactElement
427
-- as an array of ReactNode
428
-- `null`, `undefined`, `false`, and empty strings will be discarded
426
+- as a ReactNode or an array of them
427
- as a Promise for any of the above
428
429
+So when referring to type `Html`, below, we are actually meaning `Promisable<string | Element | ReactNode | ReactNode[]>`.
430
+
431
These events will receive a `def` property (in addition event's specific properties),
432
with the default content that will be displayed if no callback return a valid output.
433
You can decide to embed such default content inside your content.
@@ -455,7 +455,8 @@ This is a list of available frontend-events, with respective object parameter an
455
- `entry`
456
- you receive each entry of the list, and optionally produce HTML code that will completely replace the entry row/slot.
457
- parameter `{ entry: DirEntry }` (refer above for DirEntry object)
458
- - output `Html | null` return null if you want to hide this entry
458
+ - output `Html`
459
+ - return null if you want to hide this entry, or undefined to leave it unchanged
460
- `afterEntryName`
461
- you receive each entry of the list, and optionally produce HTML code that will be added after the name of the entry.
462
- parameter `{ entry: DirEntry }` (refer above for DirEntry object)
@@ -470,9 +471,11 @@ This is a list of available frontend-events, with respective object parameter an
471
- `beforeLogin`
472
- no parameter
473
- output `Html`
474
+ - you can generate inputs with a name, and they will be sent to the login API
475
- `beforeLoginSubmit`
476
- no parameter
477
- output `Html`
478
+ - you can generate inputs with a name, and they will be sent to the login API
479
- `fileMenu`
480
- add or manipulate entries of the menu. If you return something, that will be added to the menu.
481
You can also delete or replace the content of the `menu` array.
@@ -610,6 +613,7 @@ This section is still partially documented, and you may need to have a look at t
613
- parameters: { ctx, username, inputs }
614
- inputs: object
615
- merge of all inputs both from body and URL
616
+ - all fields with a `name` attribute in the form, included those added by plugins, are included
617
- async supported
618
- `config ready`
619
- `config.KEY` where KEY is the key of a config that has changed
dev.md
+2
-1
@@ -2,7 +2,8 @@ This file is mostly aimed to developers.
2
3
# Building instructions
4
5
-0. Install [Node.js](https://nodejs.org/) 18+
5
+0. Install [Node.js](https://nodejs.org/) 18.15+
6
+ - 18.15 is required for statfs function
7
1. Install Typescript: launch `npm -g i typescript`
8
3. Launch `npm run build-all` in the root
9