diff --git a/README.md b/README.md new file mode 100644 index 0000000..9f8ee87 --- /dev/null +++ b/README.md @@ -0,0 +1,146 @@ +# EIPs Theme + +Zola theme used by the Ethereum Improvement Proposal (EIP) site, including EIPs and ERCs. This repo contains the shared templates, Sass, static assets, syntax definitions, and Zola configuration used when rendering proposal content. + +## Local Development + +### Minimum Requirements + +Local workspace commands require these tools on `PATH`: + +* Git +* `build-eips` +* Zola 0.22.1 + +Git must be installed separately. The setup script locates or installs `build-eips` and Zola, adds locally installed tool directories to `PATH` for the current shell session, and prints guidance for making those `PATH` changes permanent. + +### Bootstrap The Workspace + +Run the setup script once from this repo. + +Linux and macOS: + +```sh +./scripts/dev-setup +``` + +Windows PowerShell: + +```powershell +.\scripts\dev-setup.ps1 +``` + +The setup script initializes the workspace one directory above this repo, runs `build-eips doctor`, and prints the next local commands. + +After setup, the generated workspace guide is available at `../WORKSPACE.md`. Use that file for the full command reference and workspace details. + +The script expects the theme repo to live inside the surrounding multi-repo workspace. After setup, the workspace has this layout: + +```text +EIPs-project/ +├── .build-eips.toml +├── WORKSPACE.md +├── .local-build/ +├── EIPs/ +├── ERCs/ +└── theme/ +``` + +The script anchors setup through `../EIPs` by default and clones `https://github.com/ethereum/EIPs.git` there when that checkout is missing. Set `ACTIVE_REPO_ROOT` to use another proposal repo checkout: + +```sh +ACTIVE_REPO_ROOT=../ERCs ./scripts/dev-setup +``` + +Validate the workspace at any point with: + +```sh +build-eips -C ../EIPs doctor +``` + +### Advanced Setup Options + +Pass optional flags through the script when you want to work on the system tooling or an additional proposal repo: + +```sh +./scripts/dev-setup --platform-dev +./scripts/dev-setup --template +./scripts/dev-setup --template --platform-dev +``` + +`--template` adds the optional `template/` proposal template repo. `--platform-dev` adds local `preprocessor/` and `eipw/` checkouts for build system development. + +After setup, run local site commands against the active proposal repo: + +```sh +build-eips -C ../EIPs check +build-eips -C ../EIPs serve +build-eips -C ../EIPs doctor +``` + +### Serve And Preview + +Local serving keeps two distinct modes: + +* `build-eips serve` for the runtime dev loop +* `build-eips preview` for serving already-built static output (`build-eips build` must be run first) + +`build-eips serve` runs Zola's fast serve mode under the hood. It watches tracked edits in the active proposal repo and incrementally updates the local site for content changes. + +It also watches tracked edits under `theme/` in the workspace. Theme changes can take longer to apply because they affect the whole rendered site. During `serve`, staging a new theme file with `git add` triggers a theme rescan; no extra file edit or restart should be needed. + +`serve --clean` ignores active-repo dirty edits but still watches the local theme. + +`build-eips preview` serves the resolved output directory for the active repo without invoking Zola, preprocessing markdown, or rebuilding anything. If the output directory does not exist yet, it fails and tells you to run `build-eips build` first. + +### Local Server And Base URL + +The `[server]` table in `.build-eips.toml` controls the local bind address for both `serve` and `preview`; the default is `127.0.0.1:1111`. Per-command `--host` and `--port` flags override `.build-eips.toml` for one run. These settings do not change build base URLs. + +The `[site].base_url` value in `.build-eips.toml` is the default local rendered site URL. Starter `.build-eips.toml` files set it to `http://127.0.0.1:1111`. If you change `[server].port`, update `[site].base_url` too when generated links should match the local server. + +Per-command `--base-url` on `build` or `serve` is a one-run override and wins over `.build-eips.toml`, including with staging or parity commands. + +`preview` serves existing output, so build with `--base-url` first when previewed HTML should contain a different local link target. + +### Target Specific Proposals + +Full local `build` and `serve` runs can take time because they process every proposal file. Use targeted rendering when you only need to test a few proposals or theme changes against a small proposal set: + +```bash +build-eips serve --only 555 +build-eips build --only 555 +build-eips build --only 555 678 +``` + +You can also set a default target list in the workspace `.build-eips.toml`: + +```toml +[render] +only = [555, 678] +``` + +CLI `--only` replaces `[render].only` for that run. For edge cases and exact filtering behavior, see `../WORKSPACE.md`. + +### Source And Output Overrides + +Workspace-local sources come from the standard workspace layout. The local theme is `workspace/theme`, and local sibling repos are `workspace/` from the active repo manifest. + +Use `--remote-siblings` when you need to force remote sibling proposal sources for a single command. + +Use global `--build-root ` when you want a separate prepared repo and output directory, for example to compare two builds side by side. The path replaces the default `.local-build/` location for each command where you pass it, so use the same `--build-root` value when serving or previewing builds. + + +Example: + +```bash +build-eips -C /work/EIPs-project/EIPs --build-root /tmp/eips-local build --base-url http://127.0.0.1:1111 +build-eips -C /work/EIPs-project/EIPs --build-root /tmp/eips-staging --staging build --base-url http://127.0.0.1:1112 + +build-eips -C /work/EIPs-project/EIPs --build-root /tmp/eips-local preview --port 1111 +build-eips -C /work/EIPs-project/EIPs --build-root /tmp/eips-staging preview --port 1112 + +# Or using serve +build-eips -C /work/EIPs-project/EIPs --build-root /tmp/eips-local serve --port 1111 +build-eips -C /work/EIPs-project/EIPs --build-root /tmp/eips-staging --staging serve --port 1112 +``` diff --git a/config.toml b/config.toml index 81e0f5e..a160d5f 100644 --- a/config.toml +++ b/config.toml @@ -22,15 +22,19 @@ generate_feeds = true internal_level = "warn" [markdown] -# Whether to do syntax highlighting -# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola -highlight_code = true +bottom_footnotes = true -highlight_theme = "css" +[markdown.highlighting] +error_on_missing_language = true -highlight_themes_css = [ - { theme = "base16-ocean-dark", filename = "assets/css/syntax-theme-dark.css" }, - { theme = "base16-ocean-light", filename = "assets/css/syntax-theme-light.css" }, +style = "class" + +light_theme = "github-light" +dark_theme = "github-dark" + +extra_grammars = [ + "syntaxes/abnf/ABNF.json", + "syntaxes/csl-json/CSL-JSON.json", ] [extra.github] diff --git a/content/00020/index.md b/content/00020/index.md index 768f9a1..679fc14 100644 --- a/content/00020/index.md +++ b/content/00020/index.md @@ -13,6 +13,7 @@ status = ["Final"] category = ["ERC"] [extra] +proposal_id = "ERC-20" status = "Final" type = "Standards Track" number = 20 diff --git a/content/00165.md b/content/00165.md index 9acf881..c8000ec 100644 --- a/content/00165.md +++ b/content/00165.md @@ -14,6 +14,7 @@ type = ["Standards Track"] category = ["ERC"] [extra] +proposal_id = "ERC-165" status = "Final" type = "Standards Track" number = 165 diff --git a/content/00214.md b/content/00214.md index 8ef9afc..568d1df 100644 --- a/content/00214.md +++ b/content/00214.md @@ -14,6 +14,7 @@ status = ["Final"] category = ["Core"] [extra] +proposal_id = "EIP-214" category = "Core" type = "Standards Track" number = 214 diff --git a/content/00721.md b/content/00721.md index 4c8a4c5..998a452 100644 --- a/content/00721.md +++ b/content/00721.md @@ -14,6 +14,7 @@ type = ["Standards Track"] category = ["ERC"] [extra] +proposal_id = "ERC-721" status = "Draft" discussions_to = "https://github.com/ethereum/eips/issues/721" category = "ERC" diff --git a/content/01155.md b/content/01155.md index c520eda..1555a03 100644 --- a/content/01155.md +++ b/content/01155.md @@ -14,6 +14,7 @@ status = ["Final"] category = ["ERC"] [extra] +proposal_id = "ERC-1155" requires = ["@/00165.md"] discussions_to = "https://github.com/ethereum/EIPs/issues/1155" category = "ERC" diff --git a/content/03475/index.md b/content/03475/index.md index 357107b..f8a8978 100644 --- a/content/03475/index.md +++ b/content/03475/index.md @@ -14,6 +14,7 @@ status = ["Final"] type = ["Standards Track"] [extra] +proposal_id = "ERC-3475" requires = ["@/00020/index.md", "@/00721.md", "@/01155.md"] discussions_to = "https://ethereum-magicians.org/t/eip-3475-multiple-callable-bonds-standard/8691" type = "Standards Track" diff --git a/content/07201.md b/content/07201.md index 2ef91a6..ee17661 100644 --- a/content/07201.md +++ b/content/07201.md @@ -14,6 +14,7 @@ category = ["ERC"] status = ["Final"] [extra] +proposal_id = "ERC-7201" status = "Final" number = 7201 discussions_to = "https://ethereum-magicians.org/t/eip-7201-namespaced-storage-layout/14796" diff --git a/content/_index.md b/content/_index.md index bbf4869..cdf17d9 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,13 +1,15 @@ +++ +[extra] +homepage_badges = [ + { href = "https://discord.gg/Nz6rtfJ8Cu", image = "https://dcbadge.limes.pink/api/server/Nz6rtfJ8Cu?style=flat", alt = "Badge for EIP Editor Discord channel" }, + { href = "https://discord.gg/EVTQ9crVgQ", image = "https://dcbadge.limes.pink/api/server/EVTQ9crVgQ?style=flat", alt = "Badge for Ethereum R&D Discord channel" }, + { href = "https://discord.gg/mRzPXmmYEA", image = "https://dcbadge.limes.pink/api/server/mRzPXmmYEA?style=flat", alt = "Badge for Ethereum Wallets Discord channel" }, + { href = "/atom.xml", image = "https://img.shields.io/badge/rss-Everything-red.svg", alt = "RSS feed for everything" }, + { href = "/status/last-call/atom.xml", image = "https://img.shields.io/badge/rss-Last%20Calls-red.svg", alt = "RSS feed for last calls" }, +] +++ -

EIPs - Discord channel for ECH eip-editer - Discord channel for Eth R&D eip-editing - Discord server for discussions about proposals that impact Ethereum wallets - RSS - RSS -

+# EIPs

Ethereum Improvement Proposals (EIPs) describe standards for the Ethereum platform, including core protocol specifications, client APIs, and contract standards. Network upgrades are discussed separately in the Ethereum Project Management repository.

diff --git a/data/build_eips_search.toml b/data/build_eips_search.toml new file mode 100644 index 0000000..f01055f --- /dev/null +++ b/data/build_eips_search.toml @@ -0,0 +1,2 @@ +enabled = false +base_path = "/" diff --git a/sass/assets/css/style.scss b/sass/assets/css/style.scss index 4bf4052..a56bd86 100644 --- a/sass/assets/css/style.scss +++ b/sass/assets/css/style.scss @@ -33,6 +33,34 @@ $content-width: 1152px; vertical-align: baseline; } +.homepage-badges { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 0.5rem; + margin: -0.25rem 0 1.25rem; +} + +.homepage-badge-link { + display: inline-flex; + align-items: center; + line-height: 1; +} + +.homepage-badge-link:hover { + text-decoration: none; +} + +.homepage-badge-link img { + display: block; + max-width: 100%; + height: 20px; +} + +.homepage-badge-link .badge { + font-size: 0.875rem; +} + .footer-col-wrapper { color: #111; } diff --git a/scripts/check-pagefind-indexing-hooks b/scripts/check-pagefind-indexing-hooks new file mode 100755 index 0000000..a3b30e1 --- /dev/null +++ b/scripts/check-pagefind-indexing-hooks @@ -0,0 +1,397 @@ +#!/bin/sh +set -eu + +die() { + printf 'error: %s\n' "$*" >&2 + exit 1 +} + +say() { + printf '%s\n' "$*" +} + +assert_contains() { + file=$1 + expected=$2 + message=$3 + + if ! grep -Fq "$expected" "$file"; then + die "$message" + fi +} + +assert_not_contains() { + file=$1 + unexpected=$2 + message=$3 + + if grep -Fq "$unexpected" "$file"; then + die "$message" + fi +} + +assert_matches() { + file=$1 + expected_pattern=$2 + message=$3 + + if ! grep -Eq "$expected_pattern" "$file"; then + die "$message" + fi +} + +assert_html_attr_count() { + html_root=$1 + attr=$2 + expected=$3 + message=$4 + + count=$( + find "$html_root" -name '*.html' -exec grep -h -o "$attr" {} + \ + | wc -l \ + | tr -d ' ' + ) + if [ "$count" != "$expected" ]; then + die "$message; expected $expected, found $count" + fi +} + +assert_pagefind_artifact() { + path_pattern=$1 + message=$2 + + if ! find "$pagefind_dir" -path "$path_pattern" -type f | grep -q .; then + die "$message" + fi +} + +write_fixture_project() { + project_dir=$1 + + mkdir -p "$project_dir/content" "$project_dir/themes" + ln -s "$theme_root" "$project_dir/themes/eips-theme" + + cat >"$project_dir/config.toml" <<'EOF' +base_url = "https://example.test/" +title = "Pagefind Hook Fixture" +description = "Pagefind hook fixture" +theme = "eips-theme" +compile_sass = false +build_search_index = false +generate_feeds = false +taxonomies = [ + { name = "status" }, + { name = "category" }, + { name = "type" }, +] + +[extra.github] +eip_repository = "https://github.com/example/eips" + +[extra.taxonomies.status.final] +tooltip = "Final" + +[extra.taxonomies.category.core] +tooltip = "Core" + +[extra.taxonomies.type.standards-track] +tooltip = "Standards Track" +EOF + + cat >"$project_dir/content/_index.md" <<'EOF' ++++ +title = "Home" ++++ + +# Home + +UniqueHomeMarker +EOF + + cat >"$project_dir/content/search.md" <<'EOF' ++++ +title = "Search" +template = "search.html" ++++ + +UniqueSearchMarker +EOF + + cat >"$project_dir/content/about.md" <<'EOF' ++++ +title = "About" ++++ + +UniqueGenericMarker +EOF + + cat >"$project_dir/content/01559.md" <<'EOF' ++++ +title = "Fee Market Change" +description = "A transaction pricing mechanism." +date = 2021-04-13 +slug = "1559" +authors = ["Alice", "Bob", "Carol", "Dan"] +template = "eip.html" + +[taxonomies] +status = ["Final"] +type = ["Standards Track"] +category = ["Core"] + +[extra] +proposal_id = "EIP-1559" +prefix = "EIP" +number = 1559 +status = "Final" +type = "Standards Track" +category = "Core" +withdrawal_reason = "UniquePreambleMarker" + +[[extra.author_details]] +name = "Alice" +email = "alice@example.com" +display = "Alice " + +[[extra.author_details]] +name = "Bob" +github = "bob" +display = "Bob (@bob)" + +[[extra.author_details]] +name = "Carol" +github = "carol" +email = "carol@example.com" +display = "Carol (@carol) " + +[[extra.author_details]] +name = "Dan" +display = "Dan" ++++ + +## Abstract + +PhaseFourBodyMarker + +## Motivation + +This document should be searchable. +EOF +} + +build_fixture_project() { + project_dir=$1 + output_dir=$2 + + (cd "$project_dir" && "$zola" build --force -o "$output_dir" >/dev/null) +} + +assert_no_pagefind_browser_assets() { + html_file=$1 + + assert_not_contains "$html_file" "pagefind.js" "Phase 4 must not import pagefind.js from rendered pages" + assert_not_contains "$html_file" "pagefind-ui.js" "Phase 4 must not import Pagefind UI JavaScript" + assert_not_contains "$html_file" "pagefind-modular-ui.js" "Phase 4 must not import Pagefind modular UI JavaScript" + assert_not_contains "$html_file" "pagefind-highlight.js" "Phase 4 must not import Pagefind highlight JavaScript" + assert_not_contains "$html_file" "pagefind-ui.css" "Phase 4 must not import Pagefind UI CSS" + assert_not_contains "$html_file" "pagefind-highlight.css" "Phase 4 must not import Pagefind highlight CSS" +} + +script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +theme_root=$(CDPATH= cd -- "$script_dir/.." && pwd) +zola=${ZOLA:-zola} +pagefind=${PAGEFIND:-pagefind} +node=${NODE:-node} + +command -v "$zola" >/dev/null 2>&1 || die "zola is required on PATH" +command -v "$pagefind" >/dev/null 2>&1 || die "pagefind is required on PATH" +command -v "$node" >/dev/null 2>&1 || die "node is required on PATH" + +tmp_root=$(mktemp -d "${TMPDIR:-/tmp}/eips-theme-pagefind-hooks.XXXXXX") +trap 'rm -rf "$tmp_root"' EXIT INT HUP TERM + +fixture_project=$tmp_root/project +fixture_output=$tmp_root/output +write_fixture_project "$fixture_project" +build_fixture_project "$fixture_project" "$fixture_output" + +proposal_html=$fixture_output/1559/index.html +search_html=$fixture_output/search/index.html +home_html=$fixture_output/index.html +generic_html=$fixture_output/about/index.html +taxonomy_html=$fixture_output/category/core/index.html + +[ -f "$proposal_html" ] || die "proposal fixture did not render /1559/" +[ -f "$search_html" ] || die "search fixture did not render /search/" +[ -f "$home_html" ] || die "home fixture did not render /" +[ -f "$generic_html" ] || die "generic fixture did not render /about/" +[ -f "$taxonomy_html" ] || die "taxonomy fixture did not render /category/core/" + +assert_html_attr_count "$fixture_output" 'data-pagefind-body' 1 "only the proposal page should carry data-pagefind-body" +assert_contains "$proposal_html" '
' "proposal page must put data-pagefind-body on the proposal article" +assert_contains "$proposal_html" 'EIP-1559: Fee Market Change' "proposal body must include the proposal id and title" +assert_contains "$proposal_html" 'PhaseFourBodyMarker' "proposal body must include rendered proposal markdown content" +assert_not_contains "$search_html" 'data-pagefind-body' "/search/ must not carry data-pagefind-body" +assert_not_contains "$home_html" 'data-pagefind-body' "home must not carry data-pagefind-body" +assert_not_contains "$generic_html" 'data-pagefind-body' "generic pages must not carry data-pagefind-body" +assert_not_contains "$taxonomy_html" 'data-pagefind-body' "taxonomy pages must not carry data-pagefind-body" + +assert_contains "$proposal_html" 'class="h5" data-pagefind-ignore' "proposal badge row must be ignored" +assert_contains "$proposal_html" 'class="table table-borderless preamble" data-pagefind-ignore' "proposal preamble table must be ignored" +assert_contains "$proposal_html" '