Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

requirements.layout.repository_links

Requirements index · View definition

evidence Valid

Requirement

The Habeas Codicem book MUST configure mdBook’s Git repository link for nikomatsakis/habeas-codicem and its page edit links for the main branch.

Rationale

The requirement has one MUST. It splits into two obligations: configure the Git repository link for nikomatsakis/habeas-codicem, and configure page edit links for the main branch.

  • Repository link: book.toml line 18, in [output.html], sets git-repository-url = "https://github.com/nikomatsakis/habeas-codicem". It carries an {impl} reference.
  • Edit links: book.toml line 20, in [output.html], sets edit-url-template = "https://github.com/nikomatsakis/habeas-codicem/edit/main/{path}". It carries an {impl} reference. The template uses the edit/main path on the same repository.
  • Tests: tests/repository.rs has book_links_to_the_repository_and_main_branch_edit_pages, which carries a {test} reference. It parses book.toml and asserts that both output.html values equal those exact strings.

I found no unspecified behavior or gaps in the {impl} code. The other [output.html] keys carry references to other requirements or none.

One thing I noticed but did not count as a gap: mdBook’s {path} is relative to src, which is md here, so the generated edit URLs may omit the md/ directory. The requirement text only asks for the repository and the main branch, so I judged against that.

Inputs

Implementation

Input 2: outline book.toml table[output.html]/pair[git-repository-url]
  • File: book.toml
  • Selector: table[output.html]/pair[git-repository-url]
  • Kind: pair
  • book.toml:17–18
# {impl}`requirements.layout.repository_links`
git-repository-url = "https://github.com/nikomatsakis/habeas-codicem"
Input 3: outline book.toml table[output.html]/pair[edit-url-template]
  • File: book.toml
  • Selector: table[output.html]/pair[edit-url-template]
  • Kind: pair
  • book.toml:19–20
# {impl}`requirements.layout.repository_links`
edit-url-template = "https://github.com/nikomatsakis/habeas-codicem/edit/main/{path}"
Input 7: outline book.toml table[output.html]
[output.html]
additional-css = ["md/habeas.css", "md/intro.css"]
# {impl}`requirements.integration.ci`
site-url = "/habeas-codicem/"
# {impl}`requirements.layout.repository_links`
git-repository-url = "https://github.com/nikomatsakis/habeas-codicem"
# {impl}`requirements.layout.repository_links`
edit-url-template = "https://github.com/nikomatsakis/habeas-codicem/edit/main/{path}"

Tests

Input 4: outline tests/repository.rs fn[book_links_to_the_repository_and_main_branch_edit_pages]
// {test}`requirements.layout.repository_links`
#[test]
fn book_links_to_the_repository_and_main_branch_edit_pages() {
    let book = repository_toml("book.toml");
    let html = &book["output"]["html"];
    assert_eq!(
        html["git-repository-url"].as_str(),
        Some("https://github.com/nikomatsakis/habeas-codicem")
    );
    assert_eq!(
        html["edit-url-template"].as_str(),
        Some("https://github.com/nikomatsakis/habeas-codicem/edit/main/{path}")
    );
}

Other sources

Input 1: requirements selection requirements.layout.repository_links
:::{req} repository_links
The Habeas Codicem book MUST configure mdBook's Git repository link for `nikomatsakis/habeas-codicem` and its page edit links for the `main` branch.
:::
Input 5: outline book.toml table[book]
[book]
title = "Habeas Codicem"
language = "en"
# {impl}`requirements.layout.project`
src = "md"

Input 6: outline book.toml table[preprocessor.habeas]
  • File: book.toml
  • Selector: table[preprocessor.habeas]
  • Kind: table
  • book.toml:7–12
[preprocessor.habeas]
# {impl}`requirements.cli.mdbook`
# {impl}`requirements.layout.project`
command = "cargo habeas mdbook"
renderers = ["html"]

Input 8: outline book.toml table[output.html.fold]
[output.html.fold]
enable = true
level = 0