From c4b66a1e761faf991762dd56b0cb73e49aaa14b5 Mon Sep 17 00:00:00 2001 From: Simon Repp Date: Fri, 3 Oct 2025 20:25:15 +0200 Subject: [PATCH] Separate desktop application and CLI docs, extend CLI argument texts --- ARCHITECTURE.md | 5 ++ README.md | 26 ++---- cli/src/args.rs | 23 ++++- docs/assets/REUSE.toml | 5 +- .../01 Preface and overview.md | 43 ++++++++++ .../02 Installation and usage.md | 83 +++++++++++++++++++ .../03 Argument reference.md | 71 ++++++++++++++++ .../desktop_application/01 Getting started.md | 17 ++++ .../02 Supported formats.md} | 8 +- .../03 Linking to timecodes.md} | 4 +- docs/index.md | 35 +++++--- docs/src/layout.rs | 17 ++-- docs/src/main.rs | 52 +++++++++--- docs/topics/01 Installation.md | 8 -- docs/topics/02 Getting Started.md | 40 --------- docs/topics/03 Command-line Arguments.md | 24 ------ 16 files changed, 327 insertions(+), 134 deletions(-) create mode 100644 docs/command_line_interface/01 Preface and overview.md create mode 100644 docs/command_line_interface/02 Installation and usage.md create mode 100644 docs/command_line_interface/03 Argument reference.md create mode 100644 docs/desktop_application/01 Getting started.md rename docs/{topics/04 Supported Formats.md => desktop_application/02 Supported formats.md} (83%) rename docs/{topics/05 Linking to timecodes.md => desktop_application/03 Linking to timecodes.md} (98%) delete mode 100644 docs/topics/01 Installation.md delete mode 100644 docs/topics/02 Getting Started.md delete mode 100644 docs/topics/03 Command-line Arguments.md diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index fc3bf7f..a05cbb0 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -1,3 +1,8 @@ + + # Architectural documentation ## System overview diff --git a/README.md b/README.md index ed17dfe..2d0046f 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,9 @@ **A static site generator for video publishing** -Hyper 8 lets you create video sites, from single videos to playlists to entire -video archives. Use the graphical user interface to build and publish your -site, or do it all from your text editor and terminal, or both. Hyper 8 -generates sites that require no database, no programming, no maintenance, and -are compatible with virtually every webhost on this planet. +Build and publish video sites, from single videos to large archives.
+No database, no programming, no maintenance required.
+Compatible with virtually every webhost on this planet. Latest Release: **`0.24`** – Visit the [website](https://simonrepp.com/hyper8) for more information. @@ -26,12 +24,12 @@ The [website](https://simonrepp.com/hyper8) is the central information hub: - Showcase of sites using Hyper 8 - Links to further resources -The [docs](https://simonrepp.com/hyper8/docs) cover specific aspects: +The [docs](https://simonrepp.com/hyper8/docs) provide detailed guidance on these aspects: -- Usage instructions -- Reference -- Examples -- Information on various topics +- Desktop application (Getting started, Various topics) +- Command line interface (Overview, Usage, Reference) +- Site directory specification (How a Hyper 8 site is represented and edited on disk) +- Site directory examples (Different site directory examples as reference) The [release notes](https://simonrepp.com/hyper8/changes) give insight into development: @@ -39,14 +37,6 @@ The [release notes](https://simonrepp.com/hyper8/changes) give insight into deve - What changed in previous versions - Sometimes also: What's coming in an upcoming version -## Hyper 8 is in Beta - -Hyper 8 provides a complete package for video publishing on the web. A dozen -sites are already live out there using it! Officially, Hyper 8 is still in -Beta though, so occasionally things might still be moving around a bit in -the interface. Making backups of your Hyper 8 site directory is also -generally recommended while Hyper 8 is still in beta. - ## Development in 2025 Major developments in 2025 are being funded by [netidee](https://netidee.at), a campaign by the austrian [Internet Stiftung](https://internetstiftung.at/en/). diff --git a/cli/src/args.rs b/cli/src/args.rs index ea36717..ae81bc5 100644 --- a/cli/src/args.rs +++ b/cli/src/args.rs @@ -6,6 +6,7 @@ use std::path::PathBuf; use clap::{Arg, ArgAction, ArgMatches, Command}; use clap::value_parser; +use indoc::indoc; use hyper8_version::VERSION_WITH_PATCH_AND_REVISION; @@ -42,12 +43,26 @@ pub fn parse(arg_mode: ArgMode) -> ArgMatches { .short('b'); let build_dir = Arg::new("build-dir") - .help("The path to which the deployable, built site is written") + .help(indoc!(" + The path to which the deployable, built site is written + + WARNING: This directory is WIPED during the build process. + Please pay very close attention where you point this to. + + (Default location: .hyper8_build/ inside the site directory) + ").trim_end()) .long("build-dir") .value_parser(value_parser!(PathBuf)); let cache_dir = Arg::new("cache-dir") - .help("The path at which all computational results are stored (computed metadata, images and videos)") + .help(indoc!(" + The path at which all computational results (computed metadata, resized images, temporary encoding artifacts) are stored. + + WARNING: This directory may be WIPED during the build process. + Please pay very close attention where you point this to. + + (Default location: .hyper8_cache/ inside the site directory) + ").trim_end()) .long("cache-dir") .value_parser(value_parser!(PathBuf)); @@ -58,12 +73,12 @@ pub fn parse(arg_mode: ArgMode) -> ArgMatches { .short('d'); let ip = Arg::new("ip") - .help("Manually sets the ip address used by the web editor (otherwise defaults to localhost)") + .help("Manually sets the ip address used by the editor or preview server (otherwise defaults to localhost)") .long("ip") .value_parser(value_parser!(IpAddr)); let port = Arg::new("port") - .help("Manually sets the port used by the web editor (otherwise hyper8 chooses an available port on its own)") + .help("Manually sets the port used by the web editor (otherwise chooses an available port on its own)") .long("port") .value_parser(value_parser!(u16)); diff --git a/docs/assets/REUSE.toml b/docs/assets/REUSE.toml index 5e52ebf..9a922fc 100644 --- a/docs/assets/REUSE.toml +++ b/docs/assets/REUSE.toml @@ -1,7 +1,10 @@ version = 1 [[annotations]] -path = "docs.css" +path = [ + "docs.css", + "favicon.png" +] SPDX-FileCopyrightText = "2025 Simon Repp" SPDX-License-Identifier = "AGPL-3.0-or-later" diff --git a/docs/command_line_interface/01 Preface and overview.md b/docs/command_line_interface/01 Preface and overview.md new file mode 100644 index 0000000..98bfed8 --- /dev/null +++ b/docs/command_line_interface/01 Preface and overview.md @@ -0,0 +1,43 @@ + + +# Preface and overview of the command line interface + +> Heads up: If you're not familiar with command line interfaces, this section + is likely not relevant for you, as it's primarily intended for people who + are already +> familiar with them. However, if you're curious to explore new technical +> skills and possibilities, you are still warmly invited to read it! In the + worst +> case it will be confusing and/or boring, but in the best case it might +> introduce you to a new, powerful way of working with computers. + +At its core, the command line interface provides exactly the same +functionality as the desktop application - it is neither less powerful nor +less rich in features, instead it just provides different workflows that the +graphical interface can not offer (such as automation and scripting). + +The command line interface provides the following functionality: + +- Without any specific options passed, the CLI will start a **web server** + that hosts the Hyper 8 editor, which you (and, if you want, others) + can use through a browser. The options `--ip`, `--port` and + `--workers` can be used to set the server configuration. + +- The options `--build`/`-b` (optionally paired with `--preview`/`-p`) and + `--deploy`/`-d` can be used to perform the respective actions directly + from the CLI (without the graphical editor). The optional `--preview` + flag interacts with the `--ip` and `--port` options to determine the + preview server configuration. + +- The options `--build-dir` and `--cache-dir` let you manually override + to which directory Hyper 8 writes the build (or respectively) cache + files. + + **WARNING: Both directories are WIPED during the build process.**
+ Please pay very close attention where you point them to. + + (By default, build and cache files are written to `.hyper8_build/` + and `.hyper8_cache/` inside the root of your site directory) diff --git a/docs/command_line_interface/02 Installation and usage.md b/docs/command_line_interface/02 Installation and usage.md new file mode 100644 index 0000000..de26537 --- /dev/null +++ b/docs/command_line_interface/02 Installation and usage.md @@ -0,0 +1,83 @@ + + +# Installation and usage + +You can download and install either the full desktop edition +or the command line edition from the +[download page](https://simonrepp.com/hyper8/download.html) – **both include +the command line interface**. + +All remaining sections on this page will assume that you already have a +[site directory](introduction.html) to work with - if you don't, you can +simply create an empty folder on your disk (anywhere you like), for instance +by running the command below, and that will be your site directory: + +```bash +mkdir my-site-dir +``` + +## Running the editor + +Simply pass the site directory path to `hyper8` and it will start a web server +hosting the graphical editor. You can open the displayed address in your +browser and then perform every action that the desktop application provides +as well (authoring, previewing, building and deploying your site). + +```bash +hyper8 my-site-dir +``` + +You can press `Ctrl+C` to shut down the editor at any point. + +## Building (and previewing) the site + +The `--build` option (short: `-b`) will build the site: + +```bash +hyper8 my-site-dir --build +``` + +With the added `--preview` flag (short: `-p`) the site will be opened in the browser afterwards: + +```bash +hyper8 my-site-dir --build --preview +``` + +## Deploying the site + +If you've already set up a deployment configuration for your site you can deploy it straight from the command line interface by adding the `--deploy` (short: `-d`) option: + +```bash +hyper8 my-site-dir --build --deploy +``` + +## Manually setting the build directory + +By default, Hyper 8 will generate the site inside a `.hyper8_build/` directory +that is placed at the root of your site directory (e.g. `my-site-dir/.hyper8_build/`). + +If you want to build (or if you will, *locally deploy*) the site to another directory +on your disk you can pass an option to do so, but please read the warning first: + +**WARNING: The build directory gets WIPED during each build. Specifying the wrong +directory can lead to severe loss of data, so triple check what you pass here.** + +With that covered, here is the magic option to override the build directory: + +```bash +hyper8 my-site-dir --build --build-dir [danger-this-path-will-be-wiped] +``` + +## Using Hyper 8 without the graphical editor + +You can populate and configure your site by putting content in +your site directory, using solely your file browser, text editor, terminal, +custom scripts, or whichever workflow you aim for or prefer. + +How this works is thoroughly explained in the [Site directory specification](introduction.html) +and [Site directory examples](single-video-only.html) sections. For a quick +introduction there is also a video showcasing the process at +[simonrepp.com/video/hyper8/without-editor](https://simonrepp.com/video/hyper8/without-editor). diff --git a/docs/command_line_interface/03 Argument reference.md b/docs/command_line_interface/03 Argument reference.md new file mode 100644 index 0000000..dbe220a --- /dev/null +++ b/docs/command_line_interface/03 Argument reference.md @@ -0,0 +1,71 @@ + + +# Argument reference + +General usage is: + +``` +hyper8 [OPTIONS] [SITE_DIR] +``` + +If you are using the **full desktop edition** of Hyper 8, calling `hyper8` +without any arguments starts the graphical launcher (and conversely, passing +any argument at all enables command line mode). + +If you are using the **command line edition** of Hyper 8, the `SITE_DIR` +argument is mandatory, and not passing any argument at all will just print +the usage information. + +## Options + +- `--build`, `-b` + + Directly builds the site without starting the editor + +- `--build-dir ` + + The path to which the deployable, built site is written. + + **WARNING: This directory is WIPED during the build process.**
+ Please pay very close attention where you point this to. + + (Default location: .hyper8_build/ inside the site directory). + +- `--cache-dir ` + + The path at which all computational results (computed metadata, resized images, temporary encoding artifacts) are stored. + + **WARNING: This directory may be WIPED during the build process.**
+ Please pay very close attention where you point this to. + + (Default location: .hyper8_cache/ inside the site directory) + +- `--deploy`, `-d` + + Directly deploys the site - only applicable in combination with `--build` + +- `--ip ` + + Manually sets the ip address used by the editor or preview server (otherwise defaults to localhost) + +- `--port ` + + Manually sets the port used by the editor or preview server (otherwise chooses an available port on its own) + +- `--preview`, `-p` + + Use in conjunction with `--build` to immediately open the site in the browser after the build is complete + +- `--workers ` + + Set how many background workers should be run. The count can be no less than 2 - one worker for fast jobs (video analysis, thumbnails), one worker for slow jobs (audio/video transcoding). + +## Note on accuracy + +This page will generally be kept up-to-date with Hyper 8's latest CLI usage +information, but for the most authoritative and up-to-date information it is +still recommended to just consult `hyper8 --help` for your installed +version. diff --git a/docs/desktop_application/01 Getting started.md b/docs/desktop_application/01 Getting started.md new file mode 100644 index 0000000..cb8bb47 --- /dev/null +++ b/docs/desktop_application/01 Getting started.md @@ -0,0 +1,17 @@ + + +# Getting started with the desktop application + +Download and install the **full desktop edition** from the +[download page](https://simonrepp.com/hyper8/download.html) +on the [website](https://simonrepp.com/hyper8/). + +After the installation is complete, open the application from your desktop's +application menu and click `Create new site` to get started. + +The editor is - at least intended to be - mostly self-explanatory, but to get +some guidance on how it is operated, you can have a look at a number of +videos showcasing Hyper 8 at [simonrepp.com/video/hyper8](https://simonrepp.com/video/hyper8/). diff --git a/docs/topics/04 Supported Formats.md b/docs/desktop_application/02 Supported formats.md similarity index 83% rename from docs/topics/04 Supported Formats.md rename to docs/desktop_application/02 Supported formats.md index 25b4e4d..dfe7551 100644 --- a/docs/topics/04 Supported Formats.md +++ b/docs/desktop_application/02 Supported formats.md @@ -41,8 +41,8 @@ The audio formats Hyper 8 currently recognizes are: ## Images -These are the formats you can use for poster images. Poster images -are always resized and transcoded for site builds. +These are the formats you can use for poster images. Poster images are always +resized and transcoded for site builds, and this happens automatically. - gif - jpg/jpeg @@ -51,9 +51,7 @@ are always resized and transcoded for site builds. ## Subtitles -You can add any number of subtitle files alongside your video file(s) and they -will automatically show up in the video player on your built site. The supported -formats are: +The supported subtitle file formats are: - srt - vtt diff --git a/docs/topics/05 Linking to timecodes.md b/docs/desktop_application/03 Linking to timecodes.md similarity index 98% rename from docs/topics/05 Linking to timecodes.md rename to docs/desktop_application/03 Linking to timecodes.md index 281d57e..906c72b 100644 --- a/docs/topics/05 Linking to timecodes.md +++ b/docs/desktop_application/03 Linking to timecodes.md @@ -26,8 +26,7 @@ from within a video page. Assuming you are publishing a vlog, just released a ne and want to link to various parts of your video, this is what you could put into your `description` field for the episode: -```eno --- description +``` In today's vlog entry I show off my favorite memes! [What is a meme](#time=1m20s) @@ -35,7 +34,6 @@ In today's vlog entry I show off my favorite memes! [The Einstein-Rosen-Podolsky bridge theory meme](#time=52m12s) [The new Bielefeld conspiracy meme](#time=1h26m3s) [1080 Stunt Dog meme](#time=2h7m) --- description ``` ## Details on the syntax used diff --git a/docs/index.md b/docs/index.md index e5cc212..24df67d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,25 +5,34 @@ # Hyper 8 Video System -## Topics +## Desktop application -For an introduction go through the topics in order. These show how Hyper 8 -works in general and swiftly guide you to your first hyper8 site. +This section addresses all users equally - it provides all basic information +to simply get started using Hyper 8 through the **desktop application**. If +you're unsure what to do or where to start, this is your first destination. -## Reference +## Command line interface -The reference pages explain all available options and metadata that you can -set in your manifests, giving detailed info for each setting. +This section is mostly for people familiar with command line interfaces (and it +is entirely optional). With the command line interface you are able to +automate and script various workflows that utilize the Hyper 8. -## Examples +## Site directory specification -These each explain a fictional Hyper 8 site - how the files and folders are -laid out, which manifests are placed where, and what content they hold. This -teaches by example, but does not nearly show every feature there is in -hyper8, so also consider going through the reference to get the full -picture. +This section lets you take a peek *under the hood* of a - or actually, all - +Hyper 8 sites. Here you will find complete and detailed information on how a +site is stored on disk (spoiler: it's a simple system) and how you can +therefore manually edit and extend it using any tool(s) you like - from a +file explorer to a text editor to scripted workflows. **It's all just +(plaintext) files and folders underneath.** -This section is still partially in progress. +## Site directory examples + +These each explain a fictional Hyper 8 site directory - how the files and +folders are laid out, which manifests are placed where, and what content they +hold. This teaches by example, but does not nearly show all features +available in Hyper 8, so it is recommended to additionally go through the +site directory specification to get the full picture. ## Other resources diff --git a/docs/src/layout.rs b/docs/src/layout.rs index 72ed295..c913842 100644 --- a/docs/src/layout.rs +++ b/docs/src/layout.rs @@ -7,9 +7,10 @@ use hyper8_version::VERSION_WITHOUT_PATCH; use crate::{Docs, Page}; use crate::{ + COMMAND_LINE_INTERFACE_TITLE, + DESKTOP_APPLICATION_TITLE, SITE_DIRECTORY_EXAMPLES_TITLE, - SITE_DIRECTORY_TITLE, - TOPICS_TITLE + SITE_DIRECTORY_TITLE }; const ASSET_HASH_DOCS_CSS: &str = env!("HYPER8_DOCS_STATIC_ASSET_HASH_DOCS_CSS"); @@ -34,9 +35,10 @@ pub fn layout( .join("\n") }; + let command_line_interface = section_links(&docs.command_line_interface); + let desktop_application = section_links(&docs.desktop_application); let site_directory = section_links(&docs.site_directory); let site_directory_examples = section_links(&docs.site_directory_examples); - let topics = section_links(&docs.topics); let index_active = if active_page == &docs.index { "active" } else { "" }; let logo_polychrome_icon = hyper8_icons::logo_polychrome(Some("Hyper 8")); @@ -68,8 +70,11 @@ pub fn layout(
diff --git a/docs/src/main.rs b/docs/src/main.rs index 1368b84..16db40a 100644 --- a/docs/src/main.rs +++ b/docs/src/main.rs @@ -18,15 +18,17 @@ mod layout; use layout::layout; +const COMMAND_LINE_INTERFACE_TITLE: &str = "Command line interface"; +const DESKTOP_APPLICATION_TITLE: &str = "Desktop application"; const SITE_DIRECTORY_EXAMPLES_TITLE: &str = "Site directory examples"; -const SITE_DIRECTORY_TITLE: &str = "The site directory"; -const TOPICS_TITLE: &str = "Topics"; +const SITE_DIRECTORY_TITLE: &str = "Site directory specification"; struct Docs { + command_line_interface: Vec, + desktop_application: Vec, index: Page, site_directory: Vec, - site_directory_examples: Vec, - topics: Vec + site_directory_examples: Vec } struct NextPage<'a> { @@ -114,8 +116,8 @@ pub fn main() { fs::create_dir(&docs_out_dir).unwrap(); let next_page = NextPage::next_section( - TOPICS_TITLE, - docs.topics.first().unwrap() + DESKTOP_APPLICATION_TITLE, + docs.desktop_application.first().unwrap() ); render_page( @@ -125,9 +127,29 @@ pub fn main() { &docs.index ); - let mut topics_iter = docs.topics.iter().peekable(); - while let Some(page) = topics_iter.next() { - let next_page = topics_iter + let mut desktop_application_iter = docs.desktop_application.iter().peekable(); + while let Some(page) = desktop_application_iter.next() { + let next_page = desktop_application_iter + .peek() + .map(|page| NextPage::same_section(page)) + .unwrap_or_else(|| { + NextPage::next_section( + COMMAND_LINE_INTERFACE_TITLE, + docs.command_line_interface.first().unwrap() + ) + }); + + render_page( + &docs, + &docs_out_dir, + Some(next_page), + page + ); + } + + let mut command_line_interface_iter = docs.command_line_interface.iter().peekable(); + while let Some(page) = command_line_interface_iter.next() { + let next_page = command_line_interface_iter .peek() .map(|page| NextPage::same_section(page)) .unwrap_or_else(|| { @@ -214,18 +236,24 @@ fn read_docs() -> Docs { title: format!("Hyper 8 Video System {VERSION_WITHOUT_PATCH}") }; + let command_line_interface = read_pages(&Path::new("docs/command_line_interface")); + let desktop_application = read_pages(&Path::new("docs/desktop_application")); let site_directory = read_pages(&Path::new("docs/site_directory")); let site_directory_examples = read_pages(&Path::new("docs/site_directory_examples")); - let topics = read_pages(&Path::new("docs/topics")); Docs { + command_line_interface, + desktop_application, index, site_directory, - site_directory_examples, - topics + site_directory_examples } } +/// Reads all .md files inside the given directory and returns the parsed +/// pages. Pages are sorted by filename, the title of each page is derived by +/// removing the leading numbering and following whitespace in the file name, +/// and the content is simply transformed from markdown to html. fn read_pages(dir: &Path) -> Vec { let mut pages: Vec = fs::read_dir(dir) .unwrap() diff --git a/docs/topics/01 Installation.md b/docs/topics/01 Installation.md deleted file mode 100644 index 0fb312c..0000000 --- a/docs/topics/01 Installation.md +++ /dev/null @@ -1,8 +0,0 @@ - - -# Installation - -Download and install Hyper 8 from the [download page](https://simonrepp.com/hyper8/download.html) on the [website](https://simonrepp.com/hyper8/). diff --git a/docs/topics/02 Getting Started.md b/docs/topics/02 Getting Started.md deleted file mode 100644 index f8fd4aa..0000000 --- a/docs/topics/02 Getting Started.md +++ /dev/null @@ -1,40 +0,0 @@ - - -# Getting Started - -## Create your site directory - -After having installed Hyper 8, create an empty directory -somewhere on your disk. This will be your *site directory* -that contains all your content. For this guide we'll assume -we created the directory at the path `/users/alice/demo`. - -## Using Hyper 8 through the graphical user interface - -Open a terminal to start Hyper 8, passing the site directory path. - -``` -hyper8 /users/alice/demo -``` - -This opens the graphical Hyper 8 editor in your browser. From here on you can -author, preview, build and deploy your entire site using the browser interface. - -The editor is (at least intended to be) mostly self-explanatory, but to get -some guidance on how it is operated, you can have a look at a number of -videos showcasing Hyper 8 at [simonrepp.com/video/hyper8](https://simonrepp.com/video/hyper8/). - -## Using Hyper 8 without the included editor - -You can also populate and configure your site by putting content in -your site directory, using solely your file browser, text editor, terminal, -custom scripts, or whichever workflow you aim for or prefer. - -Most of the content in the reference and examples section in the docs -explains the things you need to know in order to operate Hyper 8 without -the editor, so feel free to look through these resources! For a quick -introduction there is also a video showcasing the process at -[simonrepp.com/video/hyper8/without-editor](https://simonrepp.com/video/hyper8/without-editor). diff --git a/docs/topics/03 Command-line Arguments.md b/docs/topics/03 Command-line Arguments.md deleted file mode 100644 index 14d7a5b..0000000 --- a/docs/topics/03 Command-line Arguments.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# Command-line arguments - -General usage is: - -``` -hyper8 [OPTIONS] -``` - -Consult `hyper8 --help` for the most authoritative and up-to-date information on available arguments. - -That said here's a glimpse at some particularly interesting ones: - -- `--build`, `-b` Directly builds the site without starting the editor -- `--build-dir ` Override build directory (default is .hyper8_build/ inside the catalog directory). **Pay close attention where you point this to - this directory is wiped during the build process (!)** -- `--cache-dir ` Override cache directory (default is .hyper8_cache/ inside the catalog directory). **Pay close attention where you point this to - this directory is wiped during the build process (!)** -- `--ip ` Manually sets the ip address used by the editor or preview server (otherwise defaults to localhost) -- `--port ` Manually sets the port used by the editor or preview server (otherwise hyper8 chooses an available port on its own) -- `--preview`, `-p` Use in conjunction with `--build` to immediately open the site in the browser after the build is complete -- `--workers ` Set how many background workers should be run. The count can be no less than 2 (one worker for fast jobs - video analysis, thumbnails, one worker for slow jobs - video transcoding).