gendex/README.md

64 lines
1.8 KiB
Markdown
Raw Normal View History

2025-01-03 21:44:38 +01:00
# gendex
2025-01-03 21:49:03 +01:00
gendex is a simple script that generates directory listings and writes them into an `index.html` file.
2025-01-03 21:44:38 +01:00
# Usage
`env <some environment variables here> ./gendex.sh`
## Environment variables
gendex supports environment variables for build and output customization.
All environment variables are prefixed with `GENDEX_`.
To avoid unnecessary table bloat, we've decided to leave it out.
For a list of data types, see [this sos!bashutils documentation page](https://bashutils.staropensource.de/introduction/datatypes/).
<table>
<tr>
<th>VARIABLE</th>
<th>TYPE</th>
<th>DEFAULT</th>
<th>DESCRIPTION</th>
</tr>
<tr>
2025-01-03 21:49:03 +01:00
<td><code>NOFANCY</code></td>
<td><code>bool</code></td>
<td><code>false</code></td>
2025-01-03 21:50:12 +01:00
<td>Whether to print things like the "Generation successful" message</td>
2025-01-03 21:44:38 +01:00
</tr>
<tr>
2025-01-03 21:49:03 +01:00
<td><code>RECURSE</code></td>
<td><code>bool</code></td>
<td><code>false</code></td>
2025-01-03 21:50:12 +01:00
<td>Whether to recurse downwards and create a directory index for all directories found</td>
2025-01-03 21:44:38 +01:00
</tr>
<tr>
2025-01-03 21:49:03 +01:00
<td><code>MINIFY</code></td>
<td><code>bool</code></td>
<td><code>false</code></td>
2025-01-03 21:50:12 +01:00
<td>Whether to minify the final output. This will just remove all newlines</td>
2025-01-03 21:44:38 +01:00
</tr>
<tr>
2025-01-03 21:49:03 +01:00
<td><code>OUTPUT</code></td>
<td><code>str</code></td>
<td><code>./index.html</code></td>
2025-01-03 21:50:12 +01:00
<td>Where gendex should output it's generated HTML file to</td>
2025-01-03 21:44:38 +01:00
</tr>
<tr>
2025-01-03 21:49:03 +01:00
<td><code>LOCALPATH</code></td>
<td><code>str</code></td>
<td><code></code></td>
<td>The local location of the specified directory. Used in the index's title and header. This value is always prefixed with a <code>/</code></td>
2025-01-03 21:44:38 +01:00
</tr>
<tr>
2025-01-03 21:49:03 +01:00
<td><code>TEMPLATE</code></td>
<td><code>str</code></td>
<td><code></code></td>
2025-01-03 21:50:12 +01:00
<td>The absolute location of the .html template to use. Uses the standard template if empty</td>
2025-01-03 21:44:38 +01:00
</tr>
</table>
# Templates
Templates are simple HTML files which form the generator's output.
To specify a custom template, pass `GENDEX_TEMPLATE`