Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ navigates rather than just fetching needs that guard.
**A backend** — add `src/tetrak_ocr/backends/<name>.py` exposing
`SUPPORTED_EXTENSIONS` and `ocr_image`, guarding its import with `_IMPORT_OK`;
register it in `registry.py`; add its extra to `pyproject.toml`; add a page
section to [`site/content/reference/engines.md`](site/content/reference/engines.md). The CLI needs no change.
section to [`site/content/ocr/reference/engines.md`](site/content/ocr/reference/engines.md). The CLI needs no change.

`_IMPORT_OK` must answer "can this actually run", not "did the import
statement succeed". `paddle-vl` imports its class from `paddleocr` and then
Expand Down Expand Up @@ -390,7 +390,7 @@ What goes where: `docs/` is everything about *using* the package —
installation, the command line and Python API guides, the tutorials, and the
reference generated from the parser and the docstrings. The Hugo site is the
research: the corpus, the engines as measured, routing, results and method,
and the articles. The site's `/reference/cli/` page is a stub that links to
and the articles. The site's `/ocr/reference/cli/` page is a stub that links to
the guide; the generated API page it used to carry (`tools/generate_api_docs.py`)
was retired in favour of Sphinx's, so the two could not drift. Build the
Sphinx site locally with `pip install -e '.[apidocs]'` and
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/backends.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ strategy built on top of them.

The measurements behind every claim on this page are on
[tetrak.dev](https://tetrak.dev/): the [engines
page](https://tetrak.dev/reference/engines/) for each backend's measured
page](https://tetrak.dev/ocr/reference/engines/) for each backend's measured
strengths and failure cases, and the [research](https://tetrak.dev/research/)
for the full benchmark and what it does and does not establish. Figures are
deliberately not repeated here, where nothing would keep them current.
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ writing, GPL-3.0, with a commercial-use exception offered by their author.
That does not affect Tetrak itself, since extras are optional dependencies
resolved at install time and never vendored, but it does affect anyone
redistributing a bundle that includes them. Check the current terms upstream;
licence terms change. See [licensing](https://tetrak.dev/reference/licensing/).
licence terms change. See [licensing](https://tetrak.dev/ocr/reference/licensing/).
```

## Model weights
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/armenian.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ has never seen the script, and Apple's Vision framework has no Armenian at
all. `easyocr-hy` keeps EasyOCR's detector, which already finds Armenian
text, and swaps in `tetrak_hy`, a recogniser trained for the script. Where
it stands against the other Armenian engines, register by register, is on
[tetrak.dev](https://tetrak.dev/reference/engines/#armenian-with-our-own-recogniser).
[tetrak.dev](https://tetrak.dev/ocr/reference/engines/#armenian-with-our-own-recogniser).

## 1. Install the recogniser

Expand Down
50 changes: 49 additions & 1 deletion site/assets/js/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Tetrak OCR — the small amount of behaviour the site actually needs.
* Tetrak — the small amount of behaviour the site actually needs.
*
* Everything here genuinely requires the browser: a search UI, a theme the
* reader chooses, and a clipboard. Everything else — the search index, the
Expand Down Expand Up @@ -297,8 +297,56 @@ function initMenu() {
});
}

// --- Nav dropdowns -----------------------------------------------------------
// A menu entry with children (Products) renders as a link, a disclosure button
// and a list. The button is what opens the list, so the keyboard and a screen
// reader get the same menu as the mouse: no hover. Escape closes it and hands
// focus back to the button; a click elsewhere, or focus leaving the group,
// closes it too. Below the nav breakpoint the stylesheet shows the list
// permanently and hides the button, so nothing here runs on a phone.

function initSubmenus() {
const groups = document.querySelectorAll("[data-submenu]");
if (!groups.length) return;

const setOpen = (group, open) => {
group.classList.toggle("is-open", open);
group.querySelector("[data-submenu-toggle]").setAttribute("aria-expanded", String(open));
};

groups.forEach(group => {
const button = group.querySelector("[data-submenu-toggle]");
if (!button) return;

button.addEventListener("click", () => {
setOpen(group, !group.classList.contains("is-open"));
});

group.addEventListener("keydown", e => {
if (e.key === "Escape" && group.classList.contains("is-open")) {
e.preventDefault();
setOpen(group, false);
button.focus();
}
});

// relatedTarget is where focus is going; null means it left the document,
// which happens on a window blur and should not snap the menu shut.
group.addEventListener("focusout", e => {
if (e.relatedTarget && !group.contains(e.relatedTarget)) setOpen(group, false);
});
});

document.addEventListener("click", e => {
groups.forEach(group => {
if (!group.contains(e.target)) setOpen(group, false);
});
});
}

initTheme();
initCopyButtons();
initSearch();
initLightbox();
initMenu();
initSubmenus();
106 changes: 96 additions & 10 deletions site/assets/scss/_app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@
letter-spacing: -0.015em;
}

&__version {
font-family: var(--font-mono);
font-size: 0.7rem;
color: var(--clay);
letter-spacing: 0.06em;
}

&__nav {
display: flex;
gap: 22px;
Expand All @@ -62,14 +55,68 @@
}

// The current page is marked by weight and colour rather than an
// underline, which would collide with the link hover treatment.
&[aria-current="page"] {
// underline, which would collide with the link hover treatment. A
// parent whose child is current gets the same mark, so Products reads
// as current on a product page.
&[aria-current] {
color: var(--ink);
font-weight: 600;
}
}
}

// A menu entry with children: its link, the disclosure button beside it,
// and the list the button opens. On a wide screen the list drops below the
// masthead on the paper-2 ground with the one border colour the system
// has, which is the same treatment the phone menu gets; on a phone the
// list is part of the column (see the narrow-screen rules).
&__group {
position: relative;
display: flex;
align-items: center;
gap: 2px;

&.is-open .masthead__submenu {
display: flex;
}
}

&__disclosure {
appearance: none;
border: 0;
background: none;
padding: 4px 2px;
font: inherit;
font-size: 0.8rem;
line-height: 1;
color: var(--ink-soft);
cursor: pointer;

&:hover,
&[aria-expanded="true"] {
color: var(--clay-deep);
}
}

&__submenu {
display: none;
position: absolute;
top: calc(100% + 10px);
left: -14px;
flex-direction: column;
gap: 2px;
min-width: 15rem;
margin: 0;
padding: 10px 14px;
list-style: none;
background: var(--paper-2);
border: 1px solid var(--rule);

li {
list-style: none;
}
}

&__tools {
display: flex;
align-items: center;
Expand Down Expand Up @@ -240,14 +287,53 @@
}
}

// --- Home --------------------------------------------------------------------
// The latest articles, under the tiles and the services panel. The rows are
// the articles index's own; only the spacing around the block is new.
.home-articles {
margin-top: 3.5rem;

&__foot {
margin-top: 1.6rem;
}
}

// --- Narrow screens ----------------------------------------------------------
// Below the prototype's 1000px breakpoint the nav and rail both go, leaving a
// single column. The burger reveals the nav.
// single column. The burger reveals the nav, with the products shown
// indented under their parent rather than behind a second disclosure.
@media (width <= 1000px) {
.masthead__nav {
display: none;
}

// Left-aligned as a column, so the products read as indented under their
// parent; centred, the group sat as a left-aligned block in a centred list.
.masthead__nav.is-open {
align-items: flex-start;
}

.masthead__group {
flex-direction: column;
align-items: flex-start;
gap: 10px;
}

.masthead__disclosure {
display: none;
}

.masthead__submenu {
display: flex;
position: static;
min-width: 0;
padding: 0 0 0 18px;
border: 0;
border-left: 2px solid var(--clay);
background: none;
gap: 10px;
}

.page {
grid-template-columns: minmax(0, 1fr);
gap: 0;
Expand Down
16 changes: 12 additions & 4 deletions site/config/_default/hugo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Tetrak OCR — Hugo configuration.
# Tetrak — Hugo configuration.
#
# Themeless: layouts/, assets/ and content/ live at the repository root,
# following velostevie. There is one site here, so a theme directory would add
# a layer of indirection without buying separation.

title = "Tetrak OCR"
# "Tetrak", not "Tetrak OCR", since October 2026 (brief 017): the site is the
# home of every Tetrak tool and of the services, and the OCR tool has its own
# page at /ocr/. The tool keeps its name wherever the tool is meant.
title = "Tetrak"
baseURL = "https://tetrak.dev/"
locale = "en-gb"
defaultContentLanguage = "en"
Expand All @@ -13,7 +16,7 @@ enableRobotsTXT = true
enableInlineShortcodes = true

# Hugo title-cases the titles it derives for list pages, which turned the tag
# `ocr` into a page headed "Ocr" and titled "Ocr · Tetrak OCR" in the browser
# `ocr` into a page headed "Ocr" and titled "Ocr · Tetrak" in the browser
# tab. Tags are lowercase and hyphenated by convention here, and the term is the
# tag -- capitalising it publishes a word the site does not use. The list pages
# that want a proper title all have an _index.md that gives them one, including
Expand Down Expand Up @@ -67,8 +70,13 @@ capitalizeListTitles = false
tabWidth = 2

[params]
description = "Local-first OCR orchestration for archival material, and a benchmark comparing five OCR engines against a corpus of Los Angeles stage and picture-palace ephemera, c. 1910-1945."
description = "Tetrak makes archive collections readable and searchable, especially in scripts that mainstream software serves poorly: free, open-source tools for turning scans of old print into searchable text and for searching across scripts, and services for the collections that would rather we did the work."
# The repository behind this site: the OCR pipeline, its evaluation and the
# site itself. Used for the "Edit this page" links and the footer.
repo = "https://github.com/scattercode/tetrak"
# The organisation, which the masthead links to since October 2026: the site
# describes several tools, each in its own repository under it.
org = "https://github.com/scattercode"

# Plausible: privacy-friendly, no cookies, no consent banner needed.
#
Expand Down
90 changes: 56 additions & 34 deletions site/config/_default/menus/menu.en.toml
Original file line number Diff line number Diff line change
@@ -1,47 +1,69 @@
# Top navigation: the product page, the tutorial, the consolidated research
# section, the reference, and the page saying who is behind the tool. There was
# an Install entry until October 2026; installation now lives in the user guide
# on GitHub Pages, and /install/ is an alias of the tutorial, which opens with it.
# Restructured August 2026 -- the previous eight-entry nav spread the research
# story across four tabs (Engines, Results, Method, Why) while leaving the
# corpus, the tool comparison and auto-local routing out of the nav entirely.
# Those pages now live under /research/, whose landing page is the index the nav
# used to be. The count is deliberately not written down here: it was, and the
# first entry added afterwards left the header saying "five".

[[main]]
name = "What it is"
pageRef = "/"
# Top navigation: Products (a dropdown of the three tools, whose own label is
# the overview page), Services, Research, Articles, and the page saying who is
# behind it all.
#
# Restructured October 2026 (brief 017). Until then the site was about one
# tool and the nav said so: "What it is" was the OCR pitch, and Tutorial and
# Reference sat in the top row. There are now three open-source tools and a
# service side, so the nav groups the tools under Products and the OCR page
# links to its own tutorial and reference, which moved under /ocr/ with it.
# Restructured before that in August 2026, when the previous eight-entry nav
# spread the research story across four tabs. The count is deliberately not
# written down here: it was, and the first entry added afterwards left the
# header saying "five".
#
# A child entry names its parent's identifier. The header partial renders a
# parent with children as a link plus a disclosure button; the phone menu
# shows the children indented under it. The parent must keep its pageRef so
# the overview is reachable without the dropdown.

[[main]]
name = "Products"
identifier = "products"
pageRef = "/products"
weight = 10

[[main]]
name = "Tutorial"
pageRef = "/tutorial"
weight = 30
name = "Tetrak OCR"
parent = "products"
pageRef = "/ocr"
weight = 1

[[main]]
name = "Research"
pageRef = "/research"
weight = 40
name = "Armenian text recognition"
parent = "products"
pageRef = "/armenian-ocr"
weight = 2

[[main]]
name = "Reference"
pageRef = "/reference/cli"
weight = 50
name = "Transliteration"
parent = "products"
pageRef = "/translit"
weight = 3

# Added August 2026. Not a research tab, which is what the restructure above was
# trimming: it is the one page that says who is behind the tool, and burying
# that in the footer is how an unfamiliar reader fails to find it.
# Beside Products rather than at the end: the split between the free tools
# and the paid work is the first thing a visitor should be able to see.
[[main]]
name = "About"
pageRef = "/about"
weight = 60
name = "Services"
pageRef = "/services"
weight = 20

[[main]]
name = "Research"
pageRef = "/research"
weight = 30

# Added August 2026 with the articles section. It sits next to Research rather
# than next to Reference because it is the same kind of thing: writing about the
# problem and about the tool's progress, alongside the fixed evidence. Reference
# stays where it is, as the last stop for someone already using the tool.
# Added August 2026 with the articles section. It sits next to Research
# because it is the same kind of thing: writing about the problem and about
# the tools' progress, alongside the fixed evidence.
[[main]]
name = "Articles"
pageRef = "/articles"
weight = 45
weight = 40

# Added August 2026. The one page that says who is behind the work, and
# burying that in the footer is how an unfamiliar reader fails to find it.
[[main]]
name = "About"
pageRef = "/about"
weight = 50
Loading
Loading