Skip to content

Commit ff581cd

Browse files
committed
Use standard GitHub admonition syntax rather than bespoke one
1 parent fb7749d commit ff581cd

File tree

1 file changed

+66
-22
lines changed

1 file changed

+66
-22
lines changed

README.md

+66-22
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ The build system will look for these libraries and enable/link if available.
6363
- Client libraries for either [MySQL](https://dev.mysql.com) or [MariaDB](https://mariadb.org)
6464
- [SQLite 3](http://sqlite.org)
6565

66-
> :bulb: **Note:** On some systems,
66+
> [!NOTE]
67+
>
68+
> On some systems,
6769
> [libucontext](https://github.com/kaniini/libucontext) will be downloaded
6870
> and built alongside Lwan. This will require a network connection, so keep
6971
> this in mind when packaging Lwan for non-x86_64 or non-aarch64
@@ -133,7 +135,9 @@ Passing `-DCMAKE_BUILD_TYPE=Release` will enable some compiler
133135
optimizations (such as [LTO](http://gcc.gnu.org/wiki/LinkTimeOptimization))
134136
and tune the code for current architecture.
135137

136-
> :exclamation: **Important:** *Please use the release build when benchmarking*.
138+
> [!IMPORTANT]
139+
>
140+
> *Please use the release build when benchmarking*.
137141
> The default is the Debug build, which not only logs all requests to the
138142
> standard output, but does so while holding a lock, severely holding down
139143
> the server.
@@ -199,7 +203,9 @@ Running
199203
Set up the server by editing the provided `lwan.conf`; the format is
200204
explained in details below.
201205

202-
> :bulb: **Note:** Lwan will try to find a configuration file based in the
206+
> [!NOTE]
207+
>
208+
> Lwan will try to find a configuration file based in the
203209
> executable name in the current directory; `testrunner.conf` will be used
204210
> for the `testrunner` binary, `lwan.conf` for the `lwan` binary, and so on.
205211
@@ -213,7 +219,9 @@ settings for the environment it's running on. Many of these settings can
213219
be tweaked in the configuration file, but it's usually a good idea to not
214220
mess with them.
215221

216-
> :magic_wand: **Tip:** Optionally, the `lwan` binary can be used for one-shot
222+
> [!TIP]
223+
>
224+
> Optionally, the `lwan` binary can be used for one-shot
217225
> static file serving without any configuration file. Run it with `--help`
218226
> for help on that.
219227
@@ -231,7 +239,9 @@ can be empty; in this case, curly brackets are optional.
231239
an implementation detail, code reading configuration options will only be
232240
given the version with underscores).
233241

234-
> :magic_wand: **Tip:** Values can contain environment variables. Use the
242+
> [!TIP]
243+
>
244+
> Values can contain environment variables. Use the
235245
> syntax `${VARIABLE_NAME}`. Default values can be specified with a colon
236246
> (e.g. `${VARIABLE_NAME:foo}`, which evaluates to `${VARIABLE_NAME}` if
237247
> it's set, or `foo` otherwise).
@@ -281,7 +291,9 @@ just added together; for instance, "1M 1w" specifies "1 month and 1 week"
281291
| `M` | 30-day Months |
282292
| `y` | 365-day Years |
283293

284-
> :bulb: **Note:** A number with a multiplier not in this table is ignored; a
294+
> [!NOTE]
295+
>
296+
> A number with a multiplier not in this table is ignored; a
285297
> warning is issued while reading the configuration file. No spaces must
286298
> exist between the number and its multiplier.
287299
@@ -335,7 +347,9 @@ e.g. instantiating the `serve_files` module, Lwan will refuse to
335347
start. (This check is only performed on Linux as a safeguard for
336348
malconfiguration.)
337349

338-
> :magic_wand: **Tip:** Declare a Straitjacket right before a `site` section
350+
> [!TIP]
351+
>
352+
> Declare a Straitjacket right before a `site` section
339353
> in such a way that configuration files and private data (e.g. TLS keys)
340354
> are out of reach of the server after initialization has taken place.
341355
@@ -375,7 +389,9 @@ actual values while servicing requests. These include but is not limited to:
375389
- `Transfer-Encoding`
376390
- All `Access-Control-Allow-` headers
377391

378-
> :bulb: **Note:** Header names are also case-insensitive (and case-preserving). Overriding
392+
> [!NOTE]
393+
>
394+
> Header names are also case-insensitive (and case-preserving). Overriding
379395
> `SeRVeR` will override the `Server` header, but send it the way it was
380396
> written in the configuration file.
381397
@@ -385,11 +401,15 @@ Only two listeners are supported per Lwan process: the HTTP listener (`listener`
385401
section), and the HTTPS listener (`tls_listener` section). Only one listener
386402
of each type is allowed.
387403

388-
> :warning: **Warning:** TLS support is experimental. Although it is stable
404+
> [!WARNING]
405+
>
406+
> TLS support is experimental. Although it is stable
389407
> during initial testing, your mileage may vary. Only TLSv1.2 is supported
390408
> at this point, but TLSv1.3 is planned.
391409
392-
> :bulb: **Note:** TLS support requires :penguin: Linux with the `tls.ko`
410+
> [!NOTE]
411+
>
412+
> TLS support requires :penguin: Linux with the `tls.ko`
393413
> module built-in or loaded. Support for other operating systems may be
394414
> added in the future. FreeBSD seems possible, other operating systems
395415
> do not seem to offer similar feature. For unsupported operating systems,
@@ -409,11 +429,15 @@ where the TLS certificate and private key files are located) and takes an
409429
optional boolean `hsts` key, which controls if `Strict-Transport-Security`
410430
headers will be sent on HTTPS responses.
411431

412-
> :magic_wand: **Tip:** To generate these keys for testing purposes, the
432+
> [!TIP]
433+
>
434+
> To generate these keys for testing purposes, the
413435
> OpenSSL command-line tool can be used like the following:
414436
> `openssl req -nodes -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 7`
415437
416-
> :bulb: **Note:** It's recommended that a [Straitjacket](#Straitjacket) with a `chroot` option is declared
438+
> [!NOTE]
439+
>
440+
> It's recommended that a [Straitjacket](#Straitjacket) with a `chroot` option is declared
417441
> right after a `tls_listener` section, in such a way that the paths to the
418442
> certificate and key are out of reach from that point on.
419443
@@ -467,7 +491,9 @@ section can be present in the declaration of a module instance. Handlers do
467491
not take any configuration options, but may include the `authorization`
468492
section.
469493

470-
> :magic_wand: **Tip:** Executing Lwan with the `--help` command-line
494+
> [!TIP]
495+
>
496+
> Executing Lwan with the `--help` command-line
471497
> argument will show a list of built-in modules and handlers.
472498
473499
The following is some basic documentation for the modules shipped with Lwan.
@@ -490,7 +516,9 @@ best to serve files in the fastest way possible according to some heuristics.
490516
| `read_ahead` | `int` | `131702` | Maximum amount of bytes to read ahead when caching open files. A value of `0` disables readahead. Readahead is performed by a low priority thread to not block the I/O threads while file extents are being read from the filesystem. |
491517
| `cache_for` | `time` | `5s` | Time to keep file metadata (size, compressed contents, open file descriptor, etc.) in cache |
492518

493-
> :bulb: **Note:** Files smaller than 16KiB will be compressed in RAM for
519+
> [!NOTE]
520+
>
521+
> Files smaller than 16KiB will be compressed in RAM for
494522
> the duration specified in the `cache_for` setting. Lwan will always try
495523
> to compress with deflate, and will optionally compress with Brotli and
496524
> zstd (if Lwan has been built with proper support).
@@ -534,7 +562,9 @@ Scripts can be served from files or embedded in the configuration file, and
534562
the results of loading them, the standard Lua modules, and (optionally, if
535563
using LuaJIT) optimizing the code will be cached for a while.
536564

537-
> :bulb: **Note:** Lua scripts can't use global variables, as they may be not
565+
> [!NOTE]
566+
>
567+
> Lua scripts can't use global variables, as they may be not
538568
> only serviced by different threads, but the state will be available only
539569
> for the amount of time specified in the `cache_period` configuration
540570
> option. This is because each I/O thread in Lwan will create an instance
@@ -549,7 +579,9 @@ the following signature: `handle_${METHOD}_${ENDPOINT}(req)`, where
549579
`${METHOD}` can be a HTTP method (i.e. `get`, `post`, `head`, etc.), and
550580
`${ENDPOINT}` is the desired endpoint to be handled by that function.
551581

552-
> :magic_wand: **Tip:** Use the `root` endpoint for a catchall. For example,
582+
> [!TIP]
583+
>
584+
> Use the `root` endpoint for a catchall. For example,
553585
> the handler function `handle_get_root()` will be called if no other handler
554586
> could be found for that request. If no catchall is specified, the server
555587
> will return a `404 Not Found` error.
@@ -599,7 +631,9 @@ The `rewrite` module will match
599631
to either redirect to another URL, or rewrite the request in a way that Lwan
600632
will handle the request as if it were made in that way originally.
601633

602-
> :information_source: **Info:** Forked from Lua 5.3.1, the regular expresion
634+
> [!INFORMATION]
635+
>
636+
> Forked from Lua 5.3.1, the regular expresion
603637
> engine may not be as feature-packed as most general-purpose engines, but
604638
> has been chosen specifically because it is a [deterministic finite
605639
> automaton](https://en.wikipedia.org/wiki/Deterministic_finite_automaton)
@@ -609,7 +643,9 @@ will handle the request as if it were made in that way originally.
609643
610644
The new URL can be specified using a simple text substitution syntax, or use Lua scripts.
611645

612-
> :magic_wand: **Tip:** Lua scripts will contain the same metamethods
646+
> [!TIP]
647+
>
648+
> Lua scripts will contain the same metamethods
613649
> available in the `req` metatable provided by the Lua module, so it can be
614650
> quite powerful.
615651
@@ -686,7 +722,9 @@ pattern using the same substitution syntax used for the `rewrite as` or
686722
foo-%1-bar }` will substitute `%1` with the first match from the pattern
687723
this condition is related to.
688724

689-
> :bulb: **Note:** Conditions that do not require a section have to be written
725+
> [!NOTE]
726+
>
727+
> Conditions that do not require a section have to be written
690728
> as a key; for instance, `condition has_query_string = yes`.
691729
692730
For example, if one wants to send `site-dark-mode.css` if there is a
@@ -729,7 +767,9 @@ pattern (%g+) {
729767
}
730768
```
731769

732-
> :bulb: **Note:** In general, this is not necessary, as the file serving
770+
> [!NOTE]
771+
>
772+
> In general, this is not necessary, as the file serving
733773
> module will do this automatically and pick the smallest file available for
734774
> the requested encoding, but this shows it's possible to have a similar
735775
> feature by configuration alone.
@@ -775,7 +815,9 @@ Lwan and a [FastCGI](https://en.wikipedia.org/wiki/FastCGI) server
775815
accessible by Lwan. This is useful, for instance, to serve pages from a
776816
scripting language such as PHP.
777817

778-
> :bulb: **Note:** This is a preliminary version of this module, and
818+
> [!NOTE]
819+
>
820+
> This is a preliminary version of this module, and
779821
> as such, it's not well optimized, some features are missing, and
780822
> some values provided to the environment are hardcoded.
781823
@@ -798,7 +840,9 @@ section with a `basic` parameter, and set one of its options.
798840
| `realm` | `str` | `Lwan` | Realm for authorization. This is usually shown in the user/password UI in browsers |
799841
| `password_file` | `str` | `NULL` | Path for a file containing username and passwords (in clear text). The file format is the same as the configuration file format used by Lwan |
800842

801-
> :warning: **Warning:** Not only passwords are stored in clear text in a file
843+
> [!WARNING]
844+
>
845+
> Not only passwords are stored in clear text in a file
802846
> that should be accessible by the server, they'll be kept in memory for a few
803847
> seconds. Avoid using this feature if possible.
804848

0 commit comments

Comments
 (0)