Language: English
Accessibility

Accessibility

Text size
Reading font

Accessibility statement

House of the People

Who gets India's seats in Parliament, and what the bills before Parliament would change.

Development, testing and release

#Architecture

The site is static HTML, CSS and JavaScript. Python scripts generate pages, data files, downloads and the working-paper HTML. Playwright prints the working-paper PDF and draws social preview cards. Netlify builds the site from the main branch and serves it at delimit.in. The website has no login, database or private API.

PathResponsibility
site/shell.htmlShared page head, favicon, navigation, accessibility controls and footer.
site/pages/Page templates, including the reusable state page.
site/pages.json and site/langs.jsonPage registry and enabled languages.
i18n/en.jsonEnglish public copy. Each translated file (hi, ta, te, kn, ml) has the same keys.
i18n/names.<lang>.jsonNames of the 36 units and six zones in each language.
i18n/parts/The translation split into four parts, with a glossary for each language.
assets/site.cssLayout, typography, themes, responsive breakpoints and chart styling.
assets/map.js, charts.js, story.js, lab.jsMaps, chart rendering, scrolling story and scenario tool.
assets/apportion.jsBrowser seat allocation routines.
scripts/build.pyWrites every page in every language, the state pages, downloads, share-card list and sitemap.
scripts/check.pyThe gate for data, translations, pages, writing rules and stale cards.
scripts/split_translation.py, merge_translation.py, check_translation.pyTranslation tooling. See translation.md.
scripts/make_tables.py, make_map.py, make_inside.py, make_cards.mjsDerived tables, projected map, district and constituency tables, share cards.
scripts/ref_apportion.py, test-apportion.mjsReference implementation of the arithmetic and the 1,800-case comparison with the browser code.
scripts/make_paper.py, make_paper.mjsWorking paper HTML and PDF.
paper/Working paper source, references, stylesheet and generated HTML.
og/Social preview cards and manifest.
.github/workflows/CI, and the forwarding pages for the old GitHub Pages address.

#Build and preview

Use Python 3.12 and Node.js 22. On Ubuntu 24.04, install the renderer and browser:

npm install --no-save --package-lock=false playwright@1.56.1
npx playwright install --with-deps chromium
python3 scripts/make_paper.py --check
node scripts/make_paper.mjs
python3 scripts/check.py
python3 scripts/make_map.py --check
node scripts/test-apportion.mjs
node scripts/test-site.mjs
python3 scripts/build.py --out _site

For a local preview, build into a folder and serve it:

python3 scripts/build.py --out _site
python3 -m http.server 8000 --directory _site

Open http://localhost:8000/. The build replaces the output folder if it exists; do not pass a folder containing other files.

The PDF and paper/meta.json are printed from paper/paper.html and committed with it, because the host has no browser to print them. Changes to the paper's prose belong in paper/source.html. Do not edit the PDF directly.

#Updating content and data

  1. Record source URL, document date, relevant table or page, and any reconciliation decision in data/sources/.
  2. Update the underlying data or the English strings. Do not type calculated figures into prose.
  3. Run scripts/make_tables.py, scripts/make_paper.py, node scripts/make_paper.mjs and the site build. If a page title, description or displayed state figure changed, regenerate the social cards using node scripts/make_cards.mjs _site (or the actual build output path).
  4. Run all checks above. Commit generated tables, paper HTML and changed social cards with their inputs.

A change to an English string is a change to all five translations in the same commit. See translation.md for the workflow, the checks and how to add a language. Enable a language in site/langs.json only when python3 scripts/check_translation.py <lang> passes. Each translated page carries the notice notice.unread saying the page is machine-translated and unreviewed; keep it until a named native reader has read every string.

For a change to the status of the bills, follow legislative-updates.md.

#Pages, languages and URLs

The site has nine page templates (home, calculator, states, the bills, the law, data, sources, terms, corrections) and one state page template used 36 times. English is at the root of the site and each other language under its code (/hi/, /ta/, /te/, /kn/, /ml/), so there are 270 pages. A state page has the same slug in every language, taken from the English name. The calculator reads data/lab.json in English and data/lab.<lang>.json elsewhere, which carry the translated names of units and zones. The language menu, the hreflang links and the sitemap are written by the build from site/langs.json. Asset addresses carry a content hash, so a changed stylesheet reaches returning visitors.

Indian scripts use the reader's own fonts (Noto Sans where installed, Nirmala UI on Windows, the system fonts on Apple and Android). No font is downloaded for them. Letter-spacing and capitals are switched off for these scripts.

#The Read more page

data/reading.json holds every item on the Read more page, in nine groups (A primary documents, B the government's case, C opposition and state governments, D analysis and explainers, E legal commentary, F background, G video, H official accounts, I history). scripts/build.py writes the page from it in every language. Headings and labels are translated (read.* in i18n/); the titles and descriptions of items are English, as published, and are marked lang="en".

  • Adding an item. Open the page or document and read it. Give the title as published, the author or body, the outlet, the date printed on the page (or say that it prints none), the address, a one-sentence description in the author's own terms, and the kind (article, opinion, document, video or account). Set paywall if a subscription may be needed. A quotation is allowed only if it was copied exactly from the page. scripts/check.py fails on a missing field, an address that is not https, an em dash or a duplicate.
  • Neutral by construction. Items are grouped by kind and never ranked. An opposing position needs comparable space. Write to the group's gaps note in read.gaps_p when a position could not be sourced, rather than leaving it out silently.
  • Videos and social media are links only. Embedding would load another site's scripts. Official accounts only; no individual's personal account and no post unless that exact post was opened.
  • Dates. The page says every item was opened and read on 30 November 2026 (read.lede). When items are re-checked, change that date in all six languages, and check the addresses again.
  • Links. A government site or a video address may answer a bot with an error while working in a browser. Open it in a browser before removing it.

#The section menu on a phone

Below 1100 pixels wide the sections fold behind a three-line Menu button (.menu-btn, assets/site.js). The button sits at the right of the title row. The menu also holds the link to the documentation and, when the browser offers it, the install button. From 1100 pixels the sections show in the header as before. The language, accessibility and theme controls are a row of their own above the header, so they cannot cover the section links. Without JavaScript the sections stay visible.

#The documentation section

The pages under /docs/ are built from the Markdown in docs/ by scripts/docs.py, which scripts/build.py calls. The files stay readable on GitHub. docs/_sidebar.md sets the order and the groups, in the same shape Docsify and GitBook use. A link in the footer of every page leads to the documentation in the reader's language.

  • Nothing comes from another site. No script, style or font is loaded from a CDN, so the privacy page stays true. The pages are plain HTML and read without JavaScript. assets/docs.js adds search (over docs/search.json, fetched on first use) and folds the contents list on a phone.
  • Adding a page. Write docs/<name>.md and add one line to docs/_sidebar.md. A relative link to another page in the sidebar becomes a link inside the site. A link to any other file in the repository becomes a link to it on GitHub. scripts/check.py fails if a relative link points at nothing.
  • Supported Markdown. Headings, paragraphs, bullet and numbered lists (nested, with code blocks inside), fenced code, tables, block quotes, links, bold, italic and inline code. Raw HTML is shown as text.
  • Six languages. English is the source. Hindi, Tamil, Telugu, Kannada and Malayalam have a folder each, docs/<lang>/, holding the same files with their own _sidebar.md. python3 scripts/check_docs_translation.py <lang> fails if a translation loses a heading, a table row, a code block, a link or a number, and scripts/check.py runs it for every language. When an English document changes, change the translations in the same commit. Each translated page carries the machine-translation notice and a language menu.

#Installing the site on a phone

The site is an installable web app. Chrome on Android offers "Install app" or "Add to Home screen" when a page meets its criteria, and three things appear when the browser announces that the site can be installed (the beforeinstallprompt event): an "Install app" button in the top bar (from 1100 pixels), an "Install this site as an app" button in the phone menu, and a bar at the foot of the page, shown four seconds after load, with Install and Not now. Not now hides the bar for the rest of the browser session (sessionStorage); nothing is kept after that. Safari on iPhone never announces installability, so nothing appears there; readers use Share, then Add to Home Screen. Installing from a translated page installs the app with that language as its start page.

  • Manifest. scripts/build.py writes manifest.webmanifest for each language, at the root for English and under /<lang>/ for the others. Each has the name, a start page inside the scope /, standalone display, the dark green theme colour and three icons (192 and 512 pixels, and a 512 pixel maskable icon). scripts/check.py fails if a manifest is missing or invalid or an icon file does not exist.
  • Icons. assets/icons/ holds the PNGs drawn from assets/favicon.svg. Android needs PNG, not SVG. Redraw them if the mark changes.
  • Service worker. site/sw.js is filled in by the build and written to sw.js at the root of the site, which is the only place it can control every page. Pages go to the network first and the saved copy is used only when there is no connection, so a reader always gets the latest figures. Styles, scripts and data are served from the saved copy. The version in the worker changes with every build, so old copies are deleted. Downloads and the paper are never cached. A page not yet opened shows an "offline" page, not another page.
  • Privacy. The copies live in the reader's browser and are sent nowhere. The terms page says so (terms.priv_4).
  • Testing. Serve the build with python3 -m http.server, open it in Chromium, and check Application > Manifest and Service Workers. In a script, Page.getInstallabilityErrors through the DevTools protocol must return an empty list. The browser only offers installation on HTTPS or on localhost. Netlify serves HTTPS.

#Release checklist

  • Verify the production branch and latest CI results before starting a change.
  • Work on a development branch; inspect the diff and request approval for a production merge.
  • Check desktop (1280 x 900 and a wider viewport) and mobile (390 x 844), both colour schemes and enlarged text, in English and in at least one translated language.
  • Run axe-core (WCAG 2.1 AA) over the home, calculator, bills, a state and the states index in each language, both themes, at 390 and 1280 pixels wide. The 30 November 2026 run found no violations.
  • Test the geographic and equal-square maps, the Choose a state button and list on a phone (below 900px, shown while the map's section is on screen), label contrast, the scenario presets, custom size, rounding controls, state tables, navigation, downloads, keyboard controls and the PDF's byline and footer.
  • Run the automated checks and inspect the deployment workflow after an authorised merge.
  • Verify the deployed pages and downloads in a browser. A successful build is not proof of a successful deployment.

Netlify builds the site on every push to main. The build runs scripts/check.py and then scripts/build.py --out dist, and publishes dist/. A failing check stops the deploy, and the live site stays on the last good build. netlify.toml holds the build command, the headers and the redirect from the Netlify subdomain. After changing paper/source.html, run python3 scripts/make_paper.py and node scripts/make_paper.mjs, and commit the paper, its PDF and its metadata together.

For recovery, revert the faulty production commit through the normal review process and check the next Netlify deploy. Do not rewrite shared history. Preserve the source data and notes in Git; do not store credentials or raw restricted material in the repository.

The site is served at delimit.in. The domain is registered at Porkbun and its DNS is in Netlify. The old GitHub Pages address, varnasr.github.io/house-of-the-people, forwards every page to the same page on delimit.in (scripts/build_redirects.py). Keep it working so that links already shared still open. Changing the domain again means changing SITE_URL in netlify.toml, the forwarder, the share links in the paper and the citation file.

The research explorer at scenarios/#research-atlas uses assets/atlas.js and the generated data/atlas.json. Browser tests exercise the state selector and population basis switch. Boundary layers are a separate future release subject to the checks in atlas-research-plan.md.

Edit this page on GitHub