4/// Subcommands understood by the CLI.
5pub const COMMANDS: &[&str] = &["build", "serve", "watch", "check", "lint", "fmt", "lsp"];
10htmlang {} - a minimalist layout language that compiles to static HTML
12Usage: htmlang [options] <file.hl | directory>
13 htmlang <command> [args]
16 build <dir> [-o <out>] [--minify] [--strict]
17 Compile every .hl file under a directory, except
18 libraries (files that hold only @let definitions)
19 serve [dir|file] [-p N] [--open]
20 Dev server with live reload
21 watch [dir|file] [-o <out>]
22 Recompile on change, without a server
23 check <file.hl | dir> [--format json]
24 Report diagnostics without writing output
25 lint <file.hl | dir> [--format json]
26 Stricter checks (accessibility, nesting)
27 fmt <file.hl>... Format files in place
28 lsp Start the language server (stdio)
31 -o, --output <path> Output file or directory
32 -w, --watch Recompile on change
33 -s, --serve Dev server with live reload (implies --watch)
34 -p, --port <N> Dev server port (default: 3000)
35 --open Open the browser (with --serve)
36 -d, --dev Development mode (readable output, source maps)
37 -c, --check Check for errors without writing output
38 --strict Treat warnings as errors
39 --partial Output an HTML fragment without the document wrapper
40 --format json Print diagnostics as JSON
41 -h, --help Show this help
42 -V, --version Show version
45 htmlang page.hl Compile page.hl to page.html
46 htmlang site/ Compile every .hl file in a directory
47 htmlang -s --open site/ Serve a site and open the browser
48 htmlang build src/ -o dist/ Compile src/ into dist/
49 htmlang check src/ Check every file in a directory",
50 env!("CARGO_PKG_VERSION")
55 let self_exe = env::current_exe().ok();
56 let lsp_name = if cfg!(windows) {
62 let lsp_path = self_exe
64 .and_then(|exe| exe.parent())
65 .map(|dir| dir.join(lsp_name))
66 .filter(|p| p.exists());
68 let lsp_cmd = lsp_path
69 .map(|p| p.to_string_lossy().to_string())
70 .unwrap_or_else(|| lsp_name.to_string());
72 let status = std::process::Command::new(&lsp_cmd)
73 .stdin(std::process::Stdio::inherit())
74 .stdout(std::process::Stdio::inherit())
75 .stderr(std::process::Stdio::inherit())
81 process::exit(s.code().unwrap_or(1));
85 eprintln!("error: could not find htmlang-lsp binary");
87 "hint: ensure htmlang-lsp is in the same directory as htmlang, or in your PATH"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list