Skip to main content

Module git_ui

Module git_ui 

Source
Expand description

Generates a static git web UI and clonable bare repository. Generates a static git repository web UI and a clonable bare clone.

Produces:

  • <output>/repository/ β€” one HTML log page per branch, refs page, per-commit detail pages
  • <output>/repository.git/ β€” bare clone suitable for dumb HTTP serving

The branch named by git_ui.default_branch is rendered to index.html; every other branch gets <sanitized-name>.html.

It also generates <output>/repository/browse/<hash>/ β€” a full recursive static file tree browser with server-side syntax highlighting (via syntect), generated for every branch tip and every tagged commit.

This is a site-level step called once from main.rs, not a per-version Builder.

StructsΒ§

BranchEntry πŸ”’
BranchNav πŸ”’
One entry in the branch-switcher nav rendered on every log page.
ChangedFile πŸ”’
CommitInfo πŸ”’
A single commit’s metadata, passed to Tera templates. Clone is required so commits can be deduplicated across branches.
CommitParent πŸ”’
Crumb πŸ”’
One level in the breadcrumb navigation on tree and blob pages.
DiffLine πŸ”’
RefBadge πŸ”’
A ref badge shown next to a commit hash on log pages.
RefInfo πŸ”’
TreeEntry πŸ”’
One row in a directory listing.

EnumsΒ§

DiffLineKind πŸ”’
The visual kind of a single unified-diff line. Serialises as lowercase for use as a CSS modifier class.
RefBadgeKind πŸ”’
Discriminates the two kinds of ref badge shown on log pages. Serialises as lowercase ("tag" / "branch") for use as a CSS modifier class.
TreeEntryKind πŸ”’
Kind of an entry in a directory listing. Serialises as lowercase.

ConstantsΒ§

TEMPLATE_GIT_BLOB
TEMPLATE_GIT_COMMIT
TEMPLATE_GIT_LOG
TEMPLATE_GIT_REFS
TEMPLATE_GIT_TREE

FunctionsΒ§

build_browse_pages πŸ”’
Build the full static tree browser for every revision in revisions.
build_git_repository_ui
build_ref_labels πŸ”’
Build a map from commit hash (hex string) to the ref badges pointing at it. Tags come before branches within each entry; both are sorted alphabetically.
collect_branch_entries πŸ”’
Collect all local branches and assign output filenames.
collect_commits πŸ”’
Walk at most max commits reachable from tip, newest first.
collect_refs πŸ”’
Collect tags and branches for the refs overview page.
escape_html πŸ”’
export_bare_clone πŸ”’
generate_clone_command
get_changed_files πŸ”’
make_crumbs πŸ”’
Build breadcrumb entries for a tree or blob page.
make_spinner πŸ”’
Generate the repository web UI and bare clone into config.site.output_dir. Shared spinner style β€” matches the builder spinners in site.rs.
parse_diff_output πŸ”’
Parse the output of git diff-tree -p into per-file ChangedFile entries.
parse_message πŸ”’
Split a raw commit message into (subject, optional body).
render_blob_page πŸ”’
Write one syntax-highlighted blob page to page_dir/<name>.html.
walk_tree_dir πŸ”’
Recursively generate one index.html (directory listing) per tree and one <name>.html per blob, rooted at rev_dir. TODO: Fix clippy warning about too many arguments