Module write_webmenu

Source
Expand description

Write a single HTML file that serves as a Web Menu for all processes in a Process Library

The purpose of this module is to write a nice HTML file that lists useful information about all processes in a library. Carl Sagan: “If you want to make an apple pie from scratch, you must first invent the universe.”

  • What processes are in the library?
  • What is the useful information?

All information from all processes in a Process Library (user’s flat list of folders) is stored in the Library struct, which essentially houses a vector of crate::read_ebml::Process structs. This module defines the Library struct, creates one, and then reads it to create “useful” HTML.

The Library struct is public, but its associated fields are private. “Get” and “Set”/“Add” functions exist to safely read/write Library fields.

Structs§

Library
Top-level struct containing all information read from an entire Process Library

Functions§

_list_files 🔒
Helper function that looks at the name of every directory that shares a parent with the stanhope application binary.
compose_body_footer 🔒
TODO: currently empty
compose_body_header 🔒
The header tag on this page is preceded by a scroll-by advertisement; the header itself is sticky.
compose_body_of_webmenu 🔒
The entire composition of the body contents you see on screen, broken up into
compose_body_table 🔒
Compose the actual functional purpose of this module: make a useful table that has information about every process in a library.
compose_bottom_of_webmenu 🔒
Simply close out the HTML tag.
compose_head_of_webmenu 🔒
All “head” metadata, including:
compose_top_of_webmenu 🔒
Simple: doctype declaration and opening of the HTML tag.
find_all_process_folders 🔒
Wrapper function that calls the wrapper function.
find_name_of_library 🔒
Returns the name of the library, which… we define as the folder name of the directory that contains the stanhope binary and all process folders.
generate_complete_webmenu
The only public function, because the only purpose of this module is to write an HTML file!
list_files 🔒
Wrapper function that calls the recursive helper to get the list of non-“assets” folders that exist next to the stanhope binary.