Skip to content

oznogon/EmptyEpsilon-html-sciencedb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

generate_science_database.lua

This is a standalone Lua script that generates an HTML interface for the default EmptyEpsilon science database by loading content from EmptyEpsilon's scripts/science_db.lua, scripts/factionInfo.lua, and ship and station templates in its scripts/shiptemplates/ path.

The result is a self-contained HTML file that, when placed in the parent directory of EmptyEpsilon assets and opened in a browser, approximates the default science database interface as accessed from the Science, Operations, or Database screens in EmptyEpsilon. It also includes a rudimentary topic-name search function, and the file is responsive to small screens or narrow viewports that EmptyEpsilon doesn't support.

image

An optional packaging feature allows the database viewer to be served from any standard web server, including the experimental HTML server built into EmptyEpsilon.

Limitations and known issues

This script doesn't automatically incorporate science database content from other EmptyEpsilon sources, including scenarios or active EE games. It can be modified or extended with new entries, but this must be done manually and separately from any content used by EmptyEpslion itself. See Modify the database for details.

The resulting page doesn't follow any EmptyEpsilon theme settings and has only English content. Also, no 3D models are displayed even if they aren't packed.

Tab navigation is generally compliant and content is conventionally structured into ordered columns, but the page hasn't been tested with accessibility tools.

The script depends on the json.lua library being in the same location as the script.

Usage

To generate basic output using a directory containing either the EmptyEpsilon repository or EmptyEpsilon's resources and scripts directories, run:

lua generate_science_db.lua --ee-path /path/to/EmptyEpsilon

or make the script executable:

chmod u+x generate_science_db.lua
mv generate_science_db.lua generate_science_db
generate_science_db --ee-path /path/to/EmptyEpsilon

On Windows:

lua55.exe generate_science_db.lua --ee-path C:\path\to\EmptyEpsilon

Modify the database

This generates a science_database.html file in the EmptyEpsilon directory given in --ee-path, which depends on fonts and images in that repoisoty's resources directory. If you move or distribute this file, fonts and images will likely break.

This also generates a JSON file, science_database.json, from the parsed Lua science database contents and saves it to the same path. Subsequent runs of the script check for this JSON cache and use it instead of re-parsing Lua scripts. You can also edit this JSON file to change, add, or remove entries. Any such modifications are limited to this viewer and won't appear in-game.

If you edit the JSON file, re-run this script to update the generated result. If you edit EmptyEpsilon's science database Lua sources, use the --regenerate-json flag when running this script or delete science_database.json before running this script to capture those changes.

Create a distributable version

To create a distributable version, use the --package flag, which copies the necessary images and fonts into the provided path:

lua generate_science_db.lua \
  --ee-path /path/to/EmptyEpsilon \
  --package /path/to/science_db_dir

or

lua55.exe generate_science_db.lua --ee-path C:\path\to\EmptyEpsilon --package C:\path\to\science_db_dir

In this case, /path/to/science_db_dir contains science_database.html, science_database.json, and a resources directory with assets used in the database.

You can then archive the directory using any tool you prefer and distribute it as desired, or serve the directory using a web server for network access.

Flag reference

  • --ee-path: Required. Path to the root of the EmptyEpsilon repository, or the parent directory of EmptyEpsilon's resources and scripts directories.
  • --package: Output content to the specified directory and copy relevant resources and scripts to distribute the generated database viewer.
  • --regenerate-json: Overwrites any existing science_database.json. Without this flag, the script defaults to using any valid cached science_database.json it finds at --ee-path.

Releases

0.2 (2026-02-11)

  • Fix duplicate image and radar trace display on ship and station articles.

0.1 (2026-02-11)

  • Initial release.

License

Copyright (c) 2026 Oznogon (Garrett Guillotte)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


json.lua is copyright (c) 2020 rxi. See that file's header for license details.

About

Lua script to generate an HTML interface to an EmptyEpsilon science database

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages