Download index.html from idiouf/African-Books-Recovery-Project: direct link, hf CLI and curl.
- Browser
- Download file 119 kB
-
https://huggingface.co/spaces/idiouf/African-Books-Recovery-Project/resolve/main/index.html
- Command line
-
hf download hf://spaces/idiouf/African-Books-Recovery-Project/index.html
-
curl -L -o index.html https://huggingface.co/spaces/idiouf/African-Books-Recovery-Project/resolve/main/index.html
119 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title>African Books Recovery Project</title> | |
| <meta name="description" content="Books by African authors published by presses based in Africa, c. 1950-1979: catalogue, atlas, rights and recovery stages."> | |
| <link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect x='5' y='4' width='22' height='24' rx='3' fill='%238c4a2f'/%3E%3Crect x='9' y='9' width='14' height='2.5' fill='%23fffdf8'/%3E%3Crect x='9' y='14' width='10' height='2.5' fill='%23fffdf8'/%3E%3C/svg%3E"> | |
| <link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | |
| <link href="https://fonts.googleapis.com/css2?family=Jost:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap" rel="stylesheet"> | |
| <style> | |
| :root{ | |
| --frame:#6b84b7;--sheet:#ffffff;--bg:#ffffff;--panel:#f6f8fc;--panel2:#eef3fa;--ink:#12283f;--text:#24384f;--muted:#5a6f87; | |
| --grid:#e6edf6;--line:#d5e0ee;--absent:#d3d8df;--accent:#2c5f96;--accent2:#1f4a78;--onacc:#fff; | |
| --hero:#2b3a63;--hero2:#33467a;--heroline:rgba(255,255,255,.16);--gold:#e8b931; | |
| --good:#12805c;--warn:#b7791f;--bad:#b93049;--city:#e2832b;--halo:#ffffff; | |
| --sans:"Jost","Ubuntu",system-ui,-apple-system,"Segoe UI",sans-serif; | |
| --mono:"IBM Plex Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; | |
| } | |
| :root[data-theme="dark"]{ | |
| --frame:#050f1b;--sheet:#0e2439;--bg:#0e2439;--panel:#122c45;--panel2:#16334f;--ink:#eaf2fa;--text:#cfdcea;--muted:#9db8d2; | |
| --grid:#1e3c57;--line:#2a5273;--absent:#3a4a5c;--accent:#7fb2e8;--accent2:#a6cbf2;--onacc:#0e2439; | |
| --hero:#0a1a2e;--hero2:#12294a;--heroline:rgba(141,187,234,.18);--gold:#e8b931; | |
| --good:#3fbf8f;--warn:#e0a23a;--bad:#f2778d;--city:#f0a04b;--halo:#0e2439; | |
| } | |
| *{box-sizing:border-box} | |
| html{-webkit-text-size-adjust:100%} | |
| body{margin:0;background:var(--frame);color:var(--text);font:16.5px/1.6 var(--sans)} | |
| a{color:var(--accent)} a:hover{color:var(--accent2)} | |
| code{font-family:var(--mono);font-size:.88em} | |
| .wrap{max-width:1760px;margin:0 auto;padding:0 clamp(14px,3vw,48px)} | |
| /* top band */ | |
| header.top{background:var(--frame);color:#fff} | |
| .bar{display:flex;flex-wrap:wrap;gap:14px 24px;align-items:center;justify-content:space-between;padding:14px 0} | |
| .brandL{display:flex;align-items:center;gap:18px;min-width:0} | |
| .logo{display:flex;align-items:center;gap:10px;background:#fff;border-radius:8px;padding:9px 16px;color:#12283f;flex:none} | |
| .logo svg{flex:none} | |
| .logo .l1{font:500 17px/1.05 var(--sans)} .logo .l2{font:400 15px/1.15 var(--sans);color:#4a6580} | |
| .btitle{border-left:1px solid rgba(255,255,255,.35);padding-left:18px;min-width:0} | |
| .btitle .t{font:600 21px/1.2 var(--sans);color:#fff} | |
| .btitle .s{font:400 13.5px/1.35 var(--sans);color:rgba(255,255,255,.88)} | |
| .brandR{display:flex;align-items:center;flex-wrap:wrap;gap:10px 18px} | |
| .brandR a.tl{color:#fff;text-decoration:none;font:600 15px var(--sans)} | |
| .brandR a.tl:hover{text-decoration:underline} | |
| .seg{display:inline-flex;border:1px solid rgba(255,255,255,.55);border-radius:6px;overflow:hidden} | |
| .seg button{border:0;background:transparent;color:#fff;font:600 14px var(--sans);padding:8px 13px;cursor:pointer} | |
| .seg button.on{background:#fff;color:#12283f} | |
| .tbtn{width:40px;height:40px;border-radius:8px;border:1px solid rgba(255,255,255,.55);background:transparent;color:#fff;cursor:pointer;display:grid;place-items:center} | |
| .tbtn:hover{background:rgba(255,255,255,.12)} | |
| /* tab band */ | |
| nav.tabs{background:var(--sheet);border-bottom:1px solid var(--line)} | |
| nav.tabs .wrap{display:flex;flex-wrap:wrap;gap:0 4px} | |
| nav.tabs button{border:0;border-bottom:3px solid transparent;background:transparent;color:var(--ink);font:500 16px var(--sans);padding:13px 12px 11px;cursor:pointer} | |
| nav.tabs button:hover{color:var(--accent)} | |
| nav.tabs button.on{color:var(--accent);border-bottom-color:var(--accent)} | |
| /* sheet */ | |
| .sheet{background:var(--sheet);max-width:1760px;margin:0 auto 32px;width:calc(100% - clamp(0px,4vw,96px));padding:0 0 30px} | |
| .inner{padding:0 clamp(14px,2.2vw,40px)} | |
| #herobox:empty + .inner{padding-top:24px} | |
| /* hero */ | |
| .hero{position:relative;overflow:hidden;background:var(--hero);color:#fff;border-radius:0 0 22px 22px;padding:clamp(24px,3vw,44px) clamp(18px,2.2vw,40px);display:grid;grid-template-columns:minmax(0,1.55fr) minmax(0,1fr);gap:28px 40px;margin-bottom:26px} | |
| .hero::before{content:"";position:absolute;inset:0;pointer-events:none;background: | |
| linear-gradient(115deg,transparent 46%,var(--heroline) 46.1%,transparent 46.4%), | |
| linear-gradient(140deg,transparent 62%,var(--heroline) 62.1%,transparent 62.35%), | |
| linear-gradient(28deg,transparent 70%,var(--heroline) 70.1%,transparent 70.3%), | |
| linear-gradient(160deg,transparent 78%,var(--heroline) 78.1%,transparent 78.3%);opacity:.6} | |
| .hero>*{position:relative} | |
| .eyebrow{font:600 12.5px/1.4 var(--mono);letter-spacing:.24em;text-transform:uppercase;color:rgba(255,255,255,.85)} | |
| .hero h1{font:700 clamp(32px,4.2vw,58px)/1.05 var(--sans);letter-spacing:-.01em;margin:12px 0 16px;color:#fff} | |
| .hero .lead{font-size:clamp(16px,1.25vw,19px);line-height:1.55;color:rgba(255,255,255,.92);max-width:46rem;margin:0 0 20px} | |
| .people{display:flex;flex-wrap:wrap;gap:16px 34px;margin:6px 0 18px} | |
| .person{display:flex;align-items:center;gap:14px} | |
| .av{width:84px;height:84px;border-radius:50%;padding:4px;background:rgba(255,255,255,.14);box-shadow:0 0 0 2px rgba(255,255,255,.28);flex:none;position:relative} | |
| .av.sm{width:64px;height:64px} | |
| .av img,.av span{width:100%;height:100%;border-radius:50%;object-fit:cover;display:grid;place-items:center;background:#5a73a6;color:#fff;font:600 22px var(--sans)} | |
| .av.sm span{font-size:18px} | |
| .person .nm{font:600 20px/1.2 var(--sans);color:#fff} | |
| .person .rl{font-size:14.5px;color:rgba(255,255,255,.85);line-height:1.4} | |
| .tags{display:flex;flex-wrap:wrap;gap:10px} | |
| .tag{display:inline-flex;align-items:center;gap:9px;border:1px solid rgba(255,255,255,.28);background:rgba(255,255,255,.06);border-radius:999px;padding:6px 14px;font:500 14.5px var(--sans);color:#fff} | |
| .tag::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--gold)} | |
| .status{align-self:start;border:1px solid rgba(255,255,255,.22);background:rgba(255,255,255,.05);border-radius:16px;padding:22px 22px} | |
| .status .big{display:flex;align-items:center;gap:12px;font:700 clamp(22px,2.2vw,32px)/1.15 var(--sans);margin:12px 0 8px;color:#fff} | |
| .status .big::before{content:"";width:15px;height:15px;border-radius:50%;background:#5cc98a;box-shadow:0 0 0 4px rgba(92,201,138,.25);flex:none} | |
| .status .sub{font-size:14.5px;color:rgba(255,255,255,.85)} | |
| .sstats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;border-top:1px solid rgba(255,255,255,.2);border-bottom:1px solid rgba(255,255,255,.2);margin:18px 0 14px;padding:14px 0} | |
| .sstats .k{font-size:13.5px;color:rgba(255,255,255,.85)} .sstats .v{font:700 26px/1.1 var(--sans);color:#fff;margin-top:4px} | |
| .status .aff{font-size:14px;line-height:1.75;color:rgba(255,255,255,.9)} | |
| /* filters */ | |
| .filters{margin:0 0 6px;background:var(--panel);border:1px solid var(--line);border-top:3px solid var(--accent);border-radius:10px;padding:14px 16px} | |
| .fhead{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:baseline;justify-content:space-between;margin-bottom:6px} | |
| .fhead b{color:var(--ink);font-size:16px} | |
| .fgroups{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:8px 22px} | |
| .fg .fl,.fl{font:600 11.5px var(--mono);letter-spacing:.14em;text-transform:uppercase;color:var(--muted);margin:6px 0 6px} | |
| .pills{display:flex;flex-wrap:wrap;gap:6px} | |
| .pill{border:1px solid var(--line);background:var(--sheet);color:var(--text);font:500 14px var(--sans);padding:5px 12px;border-radius:6px;cursor:pointer;line-height:1.35} | |
| .pill:hover{border-color:var(--accent);color:var(--accent)} | |
| .pill.on{background:var(--accent);border-color:var(--accent);color:var(--onacc)} | |
| .search{display:flex;gap:8px;align-items:center} | |
| .search input{flex:1;min-width:0;border:1px solid var(--line);background:var(--sheet);color:var(--ink);font:15px var(--sans);padding:9px 12px;border-radius:6px} | |
| .btn{border:1px solid var(--accent);background:transparent;color:var(--accent);font:600 14px var(--sans);padding:7px 14px;border-radius:6px;cursor:pointer;text-decoration:none;display:inline-block} | |
| .btn:hover{background:var(--accent);color:var(--onacc)} | |
| main{padding:6px 0 10px;counter-reset:sec} | |
| h2{counter-increment:sec;font:700 clamp(24px,2.5vw,34px)/1.15 var(--sans);color:var(--ink);margin:34px 0 8px;padding-top:16px;border-top:3px solid var(--accent);letter-spacing:-.01em} | |
| h2::before{content:counter(sec,decimal-leading-zero);display:block;font:600 13px var(--mono);letter-spacing:.12em;color:var(--muted);margin-bottom:6px} | |
| h3{font:600 18px/1.3 var(--sans);color:var(--ink);margin:22px 0 6px} | |
| .cap{color:var(--muted);font-size:14.5px;margin:4px 0 12px;max-width:78rem} | |
| .tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:14px;margin:18px 0 12px} | |
| .tile{display:flex;flex-direction:column;background:var(--sheet);border:1px solid var(--line);border-top:3px solid var(--hero);border-radius:10px;padding:14px 18px} | |
| :root[data-theme="dark"] .tile{border-top-color:var(--accent);background:var(--panel)} | |
| .tile .k{order:-1;font:600 11.5px/1.45 var(--mono);letter-spacing:.14em;text-transform:uppercase;color:var(--muted)} | |
| .tile .v{font:700 31px/1.15 var(--sans);color:var(--ink);font-variant-numeric:tabular-nums;margin-top:6px} | |
| .tile .s{font-size:14px;margin-top:4px;line-height:1.4;color:var(--muted)} | |
| .note,.warn{background:var(--panel);border-left:3px solid var(--accent);border-radius:0 8px 8px 0;padding:12px 16px;margin:14px 0;font-size:15px} | |
| .warn{border-left-color:var(--warn)} | |
| .note b,.warn b{color:var(--ink)} | |
| .g2{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:22px} | |
| .g2>*{min-width:0} | |
| .g2.map{grid-template-columns:minmax(0,1.4fr) minmax(0,1fr)} | |
| .panel{background:var(--sheet);border:1px solid var(--line);border-top:3px solid var(--accent);border-radius:10px;padding:16px 18px} | |
| :root[data-theme="dark"] .panel{background:var(--panel)} | |
| .ct{font:600 16.5px var(--sans);color:var(--ink);margin:0} | |
| .cs{font-size:13.5px;color:var(--muted);margin:2px 0 12px} | |
| .hb{display:grid;grid-template-columns:minmax(90px,max-content) 1fr;gap:6px 10px;align-items:center;font-size:14px} | |
| .hb .l{color:var(--text);text-align:right;line-height:1.25} | |
| .hb .t{position:relative;height:19px;background:var(--grid);border-radius:3px} | |
| .hb .f{position:absolute;left:0;top:0;bottom:0;border-radius:3px;background:var(--accent);min-width:2px} | |
| .hb .f.tg{background:var(--absent)} | |
| .hb .n{position:absolute;top:0;font:600 12.5px/19px var(--sans);color:var(--ink);padding-left:6px;white-space:nowrap;font-variant-numeric:tabular-nums} | |
| .hb .n.in{padding:0 6px 0 0;color:#fff;text-shadow:0 0 3px rgba(0,0,0,.5)} | |
| .legend{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:13px;margin:10px 0 4px} | |
| .legend i{display:inline-block;width:11px;height:11px;border-radius:2px;margin-right:6px;vertical-align:-1px} | |
| .vb{display:flex;align-items:flex-end;gap:12px;height:200px;padding:0 4px;border-bottom:1px solid var(--line)} | |
| .vb .c{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%} | |
| .vb .c .b{width:100%;max-width:64px;background:var(--accent);border-radius:4px 4px 0 0} | |
| .vb .c .n{font:600 13px var(--sans);color:var(--ink);margin-bottom:3px} | |
| .vbl{display:flex;gap:12px;padding:5px 4px 0;font-size:13px} | |
| .vbl span{flex:1;min-width:0;text-align:center;overflow-wrap:anywhere} | |
| .mapbox svg{width:100%;height:auto;display:block} | |
| .mapbox .cty{stroke:var(--halo);stroke-width:.7;cursor:pointer} | |
| .mapbox .cty:hover,.mapbox .cty.sel{stroke:var(--ink);stroke-width:1.6} | |
| .mapbox .grat{stroke:var(--grid);stroke-width:.6;stroke-dasharray:2 3;fill:none} | |
| .mapbox .gl{fill:var(--muted);font:10px var(--sans)} | |
| .mapbox .lbl{font-family:var(--sans);font-weight:600;paint-order:stroke;stroke-linejoin:round;pointer-events:none;text-anchor:middle;dominant-baseline:middle} | |
| .mapbox .city{fill:var(--city);fill-opacity:.92;stroke:var(--halo);stroke-width:1;cursor:pointer} | |
| .mapinfo{min-height:44px;background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:8px 12px;font-size:14px;margin-top:8px} | |
| .mapinfo b{color:var(--ink)} | |
| .mlegend{display:flex;flex-wrap:wrap;gap:12px 26px;align-items:flex-end;font-size:12.5px;color:var(--muted);margin-top:10px} | |
| .grad{height:10px;width:220px;border-radius:2px} | |
| .gticks{display:flex;justify-content:space-between;width:220px;font-size:11.5px} | |
| .card{background:var(--sheet);border:1px solid var(--line);border-radius:10px;padding:14px 18px;margin:10px 0} | |
| :root[data-theme="dark"] .card{background:var(--panel)} | |
| .card h4{margin:0 0 3px;font:600 17px/1.35 var(--sans);color:var(--ink)} | |
| .card .meta{font-size:13px;color:var(--muted);margin-bottom:6px} | |
| .card p{margin:6px 0 0;font-size:15px} | |
| .card .foot{margin-top:8px;font-size:13px;line-height:1.7} | |
| .card,.note,.warn,.dossier,.tbl td{overflow-wrap:anywhere} | |
| .cards2{display:grid;grid-template-columns:repeat(auto-fit,minmax(340px,1fr));gap:0 14px} | |
| .chip{display:inline-block;font:600 11.5px var(--sans);letter-spacing:.02em;padding:2px 8px;border-radius:4px;border:1px solid var(--line);color:var(--text);margin:0 5px 3px 0;white-space:nowrap;background:var(--sheet)} | |
| .chip.hi{border-color:var(--good);color:var(--good)} .chip.me{border-color:var(--warn);color:var(--warn)} .chip.lo{border-color:var(--bad);color:var(--bad)} | |
| .tbl{width:100%;border-collapse:collapse;font-size:14.5px} | |
| .tbl th{text-align:left;font:600 11.5px var(--mono);text-transform:uppercase;letter-spacing:.1em;color:var(--muted);border-bottom:2px solid var(--line);padding:9px 8px;cursor:pointer;white-space:nowrap} | |
| .tbl th.on{color:var(--accent)} | |
| .tbl td{border-bottom:1px solid var(--line);padding:9px 8px;vertical-align:top} | |
| .tbl tbody tr{cursor:pointer} | |
| .tbl tbody tr:hover td{background:var(--panel)} | |
| .tbl tr.sel td{background:var(--panel2)} | |
| .tbl td.ttl{color:var(--ink);font-weight:600} | |
| .pager{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:10px 0} | |
| .pager .info{font-size:14px;color:var(--muted);margin-right:8px} | |
| .dossier{border:1px solid var(--line);border-top:4px solid var(--hero);border-radius:10px;padding:16px 18px;margin:16px 0;background:var(--sheet)} | |
| .dossier h3{margin-top:0;font:700 24px/1.25 var(--sans)} | |
| .kv{margin:0;padding:0;list-style:none} | |
| .kv li{padding:4px 0;border-bottom:1px dashed var(--line);font-size:15px} | |
| .kv li b{color:var(--ink);display:inline-block;min-width:110px} | |
| ul.plain{margin:6px 0;padding-left:20px} ul.plain li{margin:3px 0} | |
| pre.cite{white-space:pre-wrap;overflow-wrap:anywhere;background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:12px 14px;font:13.5px/1.6 var(--mono);color:var(--ink)} | |
| .pd{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:20px;align-items:start} | |
| .stepper{display:flex;align-items:center;gap:8px;margin:6px 0} | |
| .stepper input[type=number]{width:100px;border:1px solid var(--line);background:var(--sheet);color:var(--ink);font:600 17px var(--sans);padding:6px 8px;border-radius:6px;text-align:center} | |
| .stepper input[type=range]{flex:1;accent-color:var(--accent)} | |
| footer{color:rgba(255,255,255,.9);padding:4px 0 34px;font-size:14px} | |
| footer .links{display:flex;flex-wrap:wrap;gap:8px 20px;margin-top:10px} | |
| footer .links a{color:#fff;font-weight:600;text-decoration:none} footer .links a:hover{text-decoration:underline} | |
| .muted{color:var(--muted)} | |
| .team{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px} | |
| .sortpills{display:none} | |
| @media (max-width:1000px){ .hero{grid-template-columns:minmax(0,1fr)} } | |
| @media (max-width:860px){ | |
| .g2,.g2.map,.pd,.team{grid-template-columns:minmax(0,1fr)} | |
| .sheet{width:100%} | |
| .btitle{border-left:0;padding-left:0} | |
| } | |
| @media (max-width:640px){ | |
| body{font-size:15.5px} | |
| .brandL{flex-wrap:wrap;gap:10px} | |
| .btitle .t{font-size:18px} | |
| nav.tabs button{font-size:14.5px;padding:10px 8px 8px} | |
| .hero{border-radius:0 0 14px 14px} | |
| .av{width:66px;height:66px} .av.sm{width:54px;height:54px} | |
| .sstats .v{font-size:22px} | |
| .hb{grid-template-columns:minmax(0,1fr);gap:1px} | |
| .hb .l{text-align:left;font-size:13px;margin-top:6px} | |
| .tbl thead{display:none} | |
| .tbl,.tbl tbody,.tbl tr,.tbl td{display:block;width:100%} | |
| .tbl tr{border:1px solid var(--line);border-radius:8px;margin:8px 0;padding:6px 10px;background:var(--sheet)} | |
| .tbl td{border:0;padding:2px 0} | |
| .tbl td[data-k]::before{content:attr(data-k) " · ";color:var(--muted);font-size:11.5px;text-transform:uppercase;letter-spacing:.04em} | |
| .tbl td.ttl{font-size:16px} | |
| .cards2{grid-template-columns:minmax(0,1fr)} | |
| .vb{height:160px;gap:4px} .vbl{gap:4px;font-size:10.5px} .vb .c .n{font-size:11px} | |
| .grad,.gticks{width:180px} | |
| .sortpills{display:flex} | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <header class="top"><div class="wrap"><div class="bar"> | |
| <div class="brandL"> | |
| <div class="logo"><svg width="34" height="34" viewBox="0 0 40 40" aria-hidden="true"><path d="M6 9c5-2 10-2 14 1v23c-4-3-9-3-14-1z" fill="#2c5f96"/><path d="M34 9c-5-2-10-2-14 1v23c4-3 9-3 14-1z" fill="#6f9fd8"/><path d="M4 30l32-20" stroke="#e8b931" stroke-width="2.2" stroke-linecap="round"/></svg><div><div class="l1" id="logo1"></div><div class="l2" id="logo2"></div></div></div> | |
| <div class="btitle"><div class="t" id="btitle"></div><div class="s" id="bsub"></div></div> | |
| </div> | |
| <div class="brandR"><span id="toplinks" style="display:contents"></span><div class="seg" id="segLang"></div><button class="tbtn" id="tbtn" data-act="toggletheme" aria-label="theme"></button></div> | |
| </div></div></header> | |
| <nav class="tabs"><div class="wrap" id="tabs"></div></nav> | |
| <div class="sheet"><div id="herobox"></div><div class="inner"> | |
| <section class="filters" id="filters"></section> | |
| <main id="main"></main> | |
| </div></div> | |
| <footer><div class="wrap" id="foot"></div></footer> | |
| <script src="data.js"></script> | |
| <script> | |
| ; | |
| const D = window.ABRP; | |
| const T = D.titles, P = D.presses, R = D.rights, G = D.digitization, H = D.holdings, | |
| CITIES = D.cities, COUNTRIES = D.countries, MAP = D.map; | |
| const YEAR_NOW = 2026; | |
| /* ------------------------------------------------------------ state */ | |
| function ls(k, v){ try{ if(v===undefined) return localStorage.getItem(k); localStorage.setItem(k, v);}catch(e){ return null; } } | |
| const S = { | |
| lang: ls("abrp_lang") || ((navigator.language||"").toLowerCase().startsWith("fr") ? "fr" : "en"), | |
| theme: ls("abrp_theme") || (matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), | |
| tab: (location.hash||"").slice(1) || "overview", | |
| f: {reg:new Set(), dec:new Set(), lg:new Set(), conf:new Set()}, q: "", | |
| measure: "titles", mapSel: null, pressSort: 0, pressN: 30, | |
| catSort: {k:"year", d:1}, catPage: 0, dossier: null, | |
| pilot: null, pdC: "Kenya", pdY: 1975, holdOu: "all" | |
| }; | |
| const TABS = ["overview","atlas","presses","catalogue","recovery","rights","copies","methods"]; | |
| if(!TABS.includes(S.tab)) S.tab = "overview"; | |
| const FILTERED_TABS = ["overview","atlas","presses","catalogue"]; | |
| /* ------------------------------------------------------------ i18n */ | |
| const B = (en, fr) => S.lang === "en" ? en : fr; | |
| const esc = s => String(s==null ? "" : s).replace(/[&<>"]/g, c => ({"&":"&","<":"<",">":">",'"':"""}[c])); | |
| const nf = v => v==null ? B("n.d.","n.d.") : (S.lang==="en" ? Number(v).toLocaleString("en-US") : Number(v).toLocaleString("fr-FR").replace(/ | /g, " ")); | |
| const pct = (a, b) => b ? (100*a/b).toLocaleString(S.lang==="en"?"en-US":"fr-FR",{maximumFractionDigits:1}) + (S.lang==="en"?"%":" %") : "0"; | |
| const REGIONS = ["West Africa","Central Africa","East Africa","Horn of Africa","North Africa","Southern Africa","Indian Ocean","Diaspora (Europe)"]; | |
| const REG_FR = {"West Africa":"Afrique de l'Ouest","Central Africa":"Afrique centrale","East Africa":"Afrique de l'Est","Horn of Africa":"Corne de l'Afrique","North Africa":"Afrique du Nord","Southern Africa":"Afrique australe","Indian Ocean":"Océan Indien","Diaspora (Europe)":"Diaspora (Europe)"}; | |
| const CAT = ["#2a78d6","#eb6834","#1baf7a","#eda100","#e87ba4","#008300","#4a3aa7","#e34948"]; | |
| const REG_COL = Object.fromEntries(REGIONS.map((r,i)=>[r,CAT[i]])); | |
| const LG = ["English","French","Portuguese","Arabic","African languages","Unrecorded"]; | |
| const LG_FR = {"English":"Anglais","French":"Français","Portuguese":"Portugais","Arabic":"Arabe","African languages":"Langues africaines","Unrecorded":"Non renseignée"}; | |
| const CONF = ["high","medium","low"]; | |
| const CONF_FR = {high:"élevée", medium:"moyenne", low:"faible"}; | |
| const DECS = ["1950s","1960s","1970s","Undated"].filter(d => T.some(t => t.decade===d)); | |
| const OWN_FR = {"african-owned":"propriété africaine","government/parastatal":"État / parapublic","mission":"mission","university":"université","african-branch-of-foreign-firm":"filiale africaine d'un groupe étranger","african-founded-diaspora-based":"fondée par des Africains, basée hors d'Afrique","unknown":"inconnue"}; | |
| const OWN_EN = {"african-owned":"African-owned","government/parastatal":"government / parastatal","mission":"mission","university":"university","african-branch-of-foreign-firm":"African branch of a foreign firm","african-founded-diaspora-based":"African-founded, based abroad","unknown":"unknown"}; | |
| const TYPE_FR = {pamphlet:"pamphlets",literary:"littéraire",trade:"généraliste",educational:"scolaire",university:"universitaire",religious:"religieuse",unknown:"inconnu"}; | |
| const GENRE_FR = {"Drama":"Théâtre","Politics & political economy":"Politique et économie politique","Popular pamphlet & self-help":"Pamphlet populaire et conseils","Fiction & popular fiction":"Fiction et fiction populaire","History & biography":"Histoire et biographie","Poetry":"Poésie","Other / unrecorded":"Autre / non renseigné","Children's & folklore":"Jeunesse et folklore","Language & reference":"Langue et ouvrages de référence","Essays & criticism":"Essais et critique"}; | |
| const SCAN = ["full_text_open","scanned_restricted","catalog_only","unknown"]; | |
| const SCAN_EN = {full_text_open:"full text open",scanned_restricted:"scanned, restricted",catalog_only:"catalogue record only",unknown:"not checked"}; | |
| const SCAN_FR = {full_text_open:"texte intégral ouvert",scanned_restricted:"numérisé, accès restreint",catalog_only:"notice seule",unknown:"non vérifié"}; | |
| const PRINT_FR = {yes:"oui",no:"non",unknown:"inconnu"}; | |
| const KIND_FR = {"National library / legal deposit":"Bibliothèque nationale / dépôt légal","University library":"Bibliothèque universitaire","Literary archive":"Archive littéraire","Mission & seminary":"Mission et séminaire","School & education system":"École et système éducatif","Community & personal":"Communauté et particuliers","Book market":"Marché du livre","Estate & family":"Ayants droit et familles","Press archive":"Archives d'éditeurs","External repository":"Dépôt hors d'Afrique","Trade & market":"Commerce et librairie"}; | |
| const ACCESS_FR = {open:"ouvert",partial:"partiel",restricted:"restreint",unknown:"inconnu"}; | |
| const DREG_FR = {"North America":"Amérique du Nord","Europe":"Europe","Global":"Mondial","Africa":"Afrique"}; | |
| const PROV_FR = {"project brief":"cahier des charges","press register":"registre des maisons"}; | |
| const C_FR = {"Nigeria":"Nigéria","Ghana":"Ghana","South Africa":"Afrique du Sud","Kenya":"Kenya","Zimbabwe":"Zimbabwe","Senegal":"Sénégal","Zambia":"Zambie","Tanzania":"Tanzanie","DR Congo":"RD Congo","Lesotho":"Lesotho","Cameroon":"Cameroun","Sierra Leone":"Sierra Leone","Malawi":"Malawi","Egypt":"Égypte","Algeria":"Algérie","Madagascar":"Madagascar","Tunisia":"Tunisie","Namibia":"Namibie","Angola":"Angola","Mozambique":"Mozambique","Somalia":"Somalie","Côte d'Ivoire":"Côte d'Ivoire","Morocco":"Maroc","Liberia":"Libéria","Gambia":"Gambie","Ethiopia":"Éthiopie","Botswana":"Botswana","Equatorial Guinea":"Guinée équatoriale","Eritrea":"Érythrée","Gabon":"Gabon","Cabo Verde":"Cap-Vert","Chad":"Tchad","Burkina Faso":"Burkina Faso","Burundi":"Burundi","Benin":"Bénin","Central African Republic":"République centrafricaine","Comoros":"Comores","Djibouti":"Djibouti","Guinea-Bissau":"Guinée-Bissau","Guinea":"Guinée","Rwanda":"Rwanda","Congo":"Congo","Libya":"Libye","Mali":"Mali","Niger":"Niger","Mauritania":"Mauritanie","São Tomé and Príncipe":"Sao Tomé-et-Principe","Sudan":"Soudan","South Sudan":"Soudan du Sud","Somaliland":"Somaliland","Uganda":"Ouganda","Togo":"Togo","Western Sahara":"Sahara occidental","Eswatini":"Eswatini","France":"France","Portugal":"Portugal"}; | |
| const C_SHORT_EN = {"Central African Republic":"C.A.R.","Western Sahara":"W. Sahara","South Sudan":"S. Sudan","Burkina Faso":"Burkina","Sierra Leone":"S. Leone","Côte d'Ivoire":"Côte d'Ivoire","Equatorial Guinea":"Eq. Guinea","Guinea-Bissau":"G.-Bissau"}; | |
| const C_SHORT_FR = {"Central African Republic":"RCA","Western Sahara":"Sahara occ.","South Sudan":"S. du Sud","Burkina Faso":"Burkina","Sierra Leone":"S. Leone","Equatorial Guinea":"G. équat.","Guinea-Bissau":"G.-Bissau","Mauritania":"Mauritanie"}; | |
| const tr = (m, v) => S.lang==="en" ? v : (m[v] || v); | |
| const reg = r => tr(REG_FR, r), cname = c => tr(C_FR, c), lgrp = g => tr(LG_FR, g), conf = c => tr(CONF_FR, c); | |
| const own = o => S.lang==="en" ? (OWN_EN[o]||o) : (OWN_FR[o]||o); | |
| const scan = s => S.lang==="en" ? (SCAN_EN[s]||s) : (SCAN_FR[s]||s); | |
| const dec = d => d==="Undated" ? B("Undated","Non daté") : (S.lang==="en" ? d : "années " + d.slice(0,4)); | |
| const cShort = c => (S.lang==="en" ? C_SHORT_EN[c] : C_SHORT_FR[c]) || cname(c); | |
| const mapToCountry = Object.fromEntries(COUNTRIES.map(c => [c.map_country, c.country])); | |
| const LINKS = [ | |
| ["https://scientific-hub-lab.github.io/Dr-Ibrahima-Diouf/", () => B("Personal page","Page personnelle")], | |
| ["https://huggingface.co/idiouf", () => B("Dashboards on Hugging Face","Tableaux de bord sur Hugging Face")], | |
| ["https://www.linkedin.com/in/dr-ibrahima-diouf-610872108/", () => "LinkedIn"], | |
| ]; | |
| const SPACE_URL = "https://huggingface.co/spaces/idiouf/African-Books-Recovery-Project"; | |
| /* ------------------------------------------------------------ filtering */ | |
| function anyFilter(){ const f=S.f; return f.reg.size||f.dec.size||f.lg.size||f.conf.size||S.q.trim(); } | |
| function filt(rows, kind){ | |
| const f = S.f, q = S.q.trim().toLowerCase(); | |
| return rows.filter(r => { | |
| if(f.reg.size && !f.reg.has(r.region)) return false; | |
| if(kind==="t"){ | |
| if(f.dec.size && !f.dec.has(r.decade)) return false; | |
| if(f.lg.size && !f.lg.has(r.language_group)) return false; | |
| } | |
| if(f.conf.size && !f.conf.has(r.confidence)) return false; | |
| if(q){ | |
| const hay = (kind==="t" ? [r.title,r.author,r.press_name,r.city,r.country,r.language,r.genre] | |
| : [r.name,r.city,r.country,r.description,r.key_figures]).join(" ").toLowerCase(); | |
| if(!hay.includes(q)) return false; | |
| } | |
| return true; | |
| }); | |
| } | |
| function tf(){ return FILTERED_TABS.includes(S.tab) ? filt(T,"t") : T; } | |
| function pf(){ return FILTERED_TABS.includes(S.tab) ? filt(P,"p") : P; } | |
| /* ------------------------------------------------------------ components */ | |
| const count = (rows, key) => { const m = new Map(); rows.forEach(r => { const k = typeof key==="function" ? key(r) : r[key]; m.set(k, (m.get(k)||0)+1); }); return m; }; | |
| function tiles(items){ return `<div class="tiles">${items.map(([v,k,s]) => `<div class="tile"><div class="v">${v}</div><div class="k">${k}</div>${s?`<div class="s">${s}</div>`:""}</div>`).join("")}</div>`; } | |
| const note = (h, k="note") => `<div class="${k}">${h}</div>`; | |
| const card = (t, meta, body, foot) => `<div class="card"><h4>${t}</h4>${meta?`<div class="meta">${meta}</div>`:""}${body?`<p>${body}</p>`:""}${foot?`<div class="foot">${foot}</div>`:""}</div>`; | |
| const chip = c => `<span class="chip ${({high:"hi",medium:"me",low:"lo"})[c]||""}">${B("confidence","fiabilité")} ${conf(c)}</span>`; | |
| const pill = (on, act, label) => `<button class="pill${on?" on":""}" data-act="${esc(act)}">${label}</button>`; | |
| function srcLinks(r, lim=4){ | |
| const urls = String(r.source_urls||"").split(" | ").filter(u => u.trim()); | |
| const names = String(r.source_titles||"").split(" | "); | |
| const out = urls.slice(0, lim).map((u,i) => { let lab = (names[i]||"").trim(); if(!lab){ try{ lab = new URL(u).hostname; }catch(e){ lab = u; } } return `<a href="${esc(u)}" target="_blank" rel="noopener">${esc(lab)}</a>`; }); | |
| if(urls.length > lim) out.push(`+${urls.length-lim}`); | |
| return out.length ? out.join(" · ") : "-"; | |
| } | |
| function head(t, s){ return `<p class="ct">${t}</p>${s?`<p class="cs">${s}</p>`:""}`; } | |
| /* horizontal bars: rows = [{l, v, c?, tip?}] */ | |
| function hbars(rows, o={}){ | |
| const max = o.max || Math.max(1, ...rows.map(r => r.v)); | |
| const fmt = o.fmt || (v => nf(v)); | |
| return `<div class="hb">${rows.map(r => { | |
| const w = Math.max(0, 100*r.v/max); | |
| const tg = r.target!=null ? `<div class="f tg" style="width:${100*r.target/max}%"></div>` : ""; | |
| const lab = r.lab!=null ? r.lab : fmt(r.v); | |
| const ref = Math.max(w, r.target!=null ? 100*r.target/max : 0); | |
| return `<div class="l">${r.l}</div><div class="t" title="${esc(r.tip||"")}">${tg}<div class="f" style="width:${w}%;${r.c?`background:${r.c}`:""}"></div>${numLab(ref, lab, r.c)}</div>`; | |
| }).join("")}</div>`; | |
| } | |
| function numLab(w, lab, c){ | |
| if(w <= 80) return `<span class="n" style="left:${w}%">${lab}</span>`; | |
| let light = false; | |
| if(c && c[0]==="#"){ const [r,g,b] = hex2(c); light = (0.2126*r+0.7152*g+0.0722*b)/255 > 0.6; } | |
| return `<span class="n in" style="right:${100-w}%;${light?"color:#241a10;text-shadow:none":""}">${lab}</span>`; | |
| } | |
| /* stacked horizontal bars: rows=[{l, parts:[{v,c,tip}]}] */ | |
| function sbars(rows){ | |
| const max = Math.max(1, ...rows.map(r => r.parts.reduce((a,p)=>a+p.v,0))); | |
| return `<div class="hb">${rows.map(r => { | |
| const tot = r.parts.reduce((a,p)=>a+p.v,0); | |
| return `<div class="l">${r.l}</div><div class="t"><div style="display:flex;height:100%;width:${100*tot/max}%;border-radius:4px;overflow:hidden">${r.parts.filter(p=>p.v).map(p => `<span title="${esc(p.tip)}" style="flex:${p.v};background:${p.c};border-right:1px solid var(--bg)"></span>`).join("")}</div>${numLab(100*tot/max, nf(tot))}</div>`; | |
| }).join("")}</div>`; | |
| } | |
| function legend(items){ return `<div class="legend">${items.map(([c,l]) => `<span><i style="background:${c}"></i>${l}</span>`).join("")}</div>`; } | |
| function vbars(rows){ | |
| const max = Math.max(1, ...rows.map(r => r.v)); | |
| return `<div class="vb">${rows.map(r => `<div class="c" title="${esc(r.l)}: ${r.v}"><span class="n">${nf(r.v)}</span><div class="b" style="height:${Math.max(1,88*r.v/max)}%;${r.c?`background:${r.c}`:""}"></div></div>`).join("")}</div><div class="vbl">${rows.map(r => `<span>${r.l}</span>`).join("")}</div>`; | |
| } | |
| function filterBanner(){ | |
| if(!anyFilter()) return ""; | |
| const t = tf().length, p = pf().length; | |
| return note(B(`<b>Filtered view</b>: ${nf(t)} of ${nf(T.length)} titles, ${nf(p)} of ${nf(P.length)} presses. Clear the filters above to see the whole catalogue.`, | |
| `<b>Vue filtrée</b> : ${nf(t)} titres sur ${nf(T.length)}, ${nf(p)} maisons sur ${nf(P.length)}. Effacez les filtres ci-dessus pour revoir l'ensemble.`)); | |
| } | |
| function csvDownload(rows, cols, name){ | |
| const q = v => { const s = v==null ? "" : String(v); return /[",\n]/.test(s) ? '"' + s.replace(/"/g,'""') + '"' : s; }; | |
| const txt = [cols.join(",")].concat(rows.map(r => cols.map(c => q(r[c])).join(","))).join("\n"); | |
| const a = document.createElement("a"); | |
| a.href = URL.createObjectURL(new Blob([""+txt], {type:"text/csv;charset=utf-8"})); | |
| a.download = name; document.body.appendChild(a); a.click(); a.remove(); | |
| } | |
| /* ------------------------------------------------------------ colour ramps */ | |
| const RAMPS = { | |
| light:{sepia:["#f6e2c6","#e5b27a","#c98443","#93561f","#5b310f"], blue:["#d6e5f6","#9cc0e9","#5a8cc4","#2c5f96","#12335a"], green:["#c9ead9","#7fcaa8","#3aa87a","#1f8a5f","#0d5c3d"]}, | |
| dark:{sepia:["#6b4520","#8a5a28","#b87c40","#d9a86e","#f2e0c8"], blue:["#1b3d63","#2c5f96","#5a8cc4","#9cc0e9","#dcebfa"], green:["#0f4f35","#1f8a5f","#3aa87a","#7fcaa8","#cdeee0"]} | |
| }; | |
| const hex2 = h => [1,3,5].map(i => parseInt(h.slice(i,i+2),16)); | |
| function rampAt(stops, t){ | |
| t = Math.max(0, Math.min(1, t)); const x = t*(stops.length-1), i = Math.min(stops.length-2, Math.floor(x)), f = x-i; | |
| const a = hex2(stops[i]), b = hex2(stops[i+1]); | |
| return "#" + a.map((v,k) => Math.round(v+(b[k]-v)*f).toString(16).padStart(2,"0")).join(""); | |
| } | |
| const STATUS = () => ({good:getCss("--good"), warn:getCss("--warn"), bad:getCss("--bad")}); | |
| const getCss = v => getComputedStyle(document.documentElement).getPropertyValue(v).trim(); | |
| /* ------------------------------------------------------------ header */ | |
| const MOON = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/></svg>'; | |
| const SUN = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>'; | |
| function renderHeader(){ | |
| document.documentElement.lang = S.lang; | |
| document.documentElement.dataset.theme = S.theme; | |
| document.title = B("African Books Recovery Project","Projet de récupération du livre africain"); | |
| const yrs = T.map(t=>t.year).filter(y=>y!=null), y0 = Math.min(...yrs), y1 = Math.max(...yrs); | |
| S.y0 = y0; S.y1 = y1; | |
| document.getElementById("logo1").textContent = B("African Books","Livre africain"); | |
| document.getElementById("logo2").textContent = B("Recovery","Récupération"); | |
| document.getElementById("btitle").textContent = B("African Books Recovery Project","Projet de récupération du livre africain"); | |
| document.getElementById("bsub").textContent = B(`Study led by Prof. Sally Nuamah · ${T.length} titles, ${P.length} presses · ${y0}-${y1}`,`Étude dirigée par la Pr Sally Nuamah · ${T.length} titres, ${P.length} maisons · ${y0}-${y1}`); | |
| document.getElementById("toplinks").innerHTML = [["https://scientific-hub-lab.github.io/Dr-Ibrahima-Diouf/","Dr Ibrahima Diouf"],["https://huggingface.co/idiouf",B("Dashboards","Tableaux de bord")],["https://www.linkedin.com/in/dr-ibrahima-diouf-610872108/","LinkedIn"]].map(([u,l]) => `<a class="tl" href="${u}" target="_blank" rel="noopener">${l}</a>`).join(""); | |
| document.getElementById("segLang").innerHTML = `<button data-act="lang:fr" class="${S.lang==="fr"?"on":""}">FR</button><button data-act="lang:en" class="${S.lang==="en"?"on":""}">EN</button>`; | |
| const tb = document.getElementById("tbtn"); tb.innerHTML = S.theme==="dark" ? SUN : MOON; tb.setAttribute("aria-label", S.theme==="dark" ? B("Light mode","Mode clair") : B("Dark mode","Mode sombre")); | |
| const TL = {overview:B("Overview","Vue d'ensemble"),atlas:"Atlas",presses:B("Presses","Maisons"),catalogue:"Catalogue",recovery:B("Recovery","Récupération"),rights:B("Rights","Droits"),copies:B("Copies","Exemplaires"),methods:B("About & methods","Projet et méthodes")}; | |
| document.getElementById("tabs").innerHTML = TABS.map(k => `<button data-act="tab:${k}" class="${S.tab===k?"on":""}">${TL[k]}</button>`).join(""); | |
| renderHero(); | |
| renderFooter(); | |
| } | |
| function avatar(src, initials, small){ | |
| return `<div class="av${small?" sm":""}">${src ? `<img src="${src}" alt="" onerror="this.outerHTML='<span>${initials}</span>'">` : `<span>${initials}</span>`}</div>`; | |
| } | |
| function renderHero(){ | |
| const box = document.getElementById("herobox"); | |
| if(S.tab!=="overview"){ box.innerHTML = ""; return; } | |
| const nzero = COUNTRIES.filter(c => !c.searched).length; | |
| box.innerHTML = `<section class="hero"><div> | |
| <div class="eyebrow">${B("Research catalogue · African presses · ","Catalogue de recherche · presses africaines · ")}${S.y0}-${S.y1}</div> | |
| <h1>${B("African Books Recovery Project","Projet de récupération du livre africain")}</h1> | |
| <p class="lead">${B(`Books written by African authors and published by presses based in Africa: the pamphlet houses of Onitsha, the state and mission presses, the university imprints, the independence-era houses of Ibadan, Accra, Nairobi, Dar es Salaam, Yaoundé, Dakar, Lusaka and Johannesburg. Most of this writing left circulation without ever entering a durable catalogue.`, | |
| `Des livres écrits par des auteurs africains et publiés par des maisons établies en Afrique : les imprimeurs de pamphlets d'Onitsha, les presses d'État et de mission, les presses universitaires, les maisons des indépendances à Ibadan, Accra, Nairobi, Dar es Salaam, Yaoundé, Dakar, Lusaka et Johannesburg. L'essentiel de cette écriture a quitté la circulation sans jamais entrer dans un catalogue durable.`)}</p> | |
| <div class="people"> | |
| <div class="person">${avatar("photo.jpg","ID")}<div><div class="nm">Dr Ibrahima Diouf</div><div class="rl">${B("Dashboard · Lecturer-researcher, Faculty of Sciences and Techniques (FST), University of Labé","Tableau de bord · Enseignant-chercheur, Faculté des sciences et techniques (FST), Université de Labé")}</div></div></div> | |
| <div class="person">${avatar(null,"SN",true)}<div><div class="nm">Prof. Sally Nuamah</div><div class="rl">${B("Study lead · Northwestern University","Direction de l'étude · Northwestern University")}</div></div></div> | |
| </div> | |
| <div class="tags">${[B(`${T.length} titles, ${P.length} presses, ${new Set(T.map(t=>t.country)).size} countries`,`${T.length} titres, ${P.length} maisons, ${new Set(T.map(t=>t.country)).size} pays`), B("Six recovery stages, from located to taught","Six étapes, de localisé à enseigné"), B(`Copyright in ${R.length} jurisdictions`,`Droit d'auteur dans ${R.length} juridictions`), B("Every record cited to its source","Chaque notice citée à sa source")].map(x => `<span class="tag">${x}</span>`).join("")}</div> | |
| </div> | |
| <aside class="status"><div class="eyebrow">${B("Status of the catalogue","Statut du catalogue")}</div> | |
| <div class="big">${B("Open research catalogue","Catalogue de recherche ouvert")}</div> | |
| <div class="sub">${B("Every record carries its sources and a confidence flag; nothing is estimated.","Chaque notice porte ses sources et un indice de fiabilité ; rien n'est estimé.")}</div> | |
| <div class="sstats"><div><div class="k">${B("titles","titres")}</div><div class="v">${nf(T.length)}</div></div><div><div class="k">${B("presses","maisons")}</div><div class="v">${nf(P.length)}</div></div><div><div class="k">${B("countries unsearched","pays non explorés")}</div><div class="v">${nzero}</div></div></div> | |
| <div class="aff">Northwestern University (USA)<br>FST, ${B("University of Labé (Guinea)","Université de Labé (Guinée)")}<br>LPAO-SF, ESP, UCAD (${B("Senegal","Sénégal")})<br>${B("Updated","Mis à jour")} : ${fmtDate(D.built)}</div> | |
| </aside></section>`; | |
| } | |
| function fmtDate(iso){ try{ return new Date(iso+"T12:00:00").toLocaleDateString(S.lang==="en"?"en-GB":"fr-FR",{day:"numeric",month:"long",year:"numeric"}); }catch(e){ return iso; } } | |
| function renderFilters(full){ | |
| const box = document.getElementById("filters"); | |
| if(!FILTERED_TABS.includes(S.tab)){ box.style.display = "none"; return; } | |
| box.style.display = ""; | |
| const f = S.f; | |
| const groups = [ | |
| ["reg", B("Region","Région"), REGIONS.filter(r => T.some(t=>t.region===r) || P.some(p=>p.region===r)), reg], | |
| ["dec", B("Decade","Décennie"), DECS, dec], | |
| ["lg", B("Language","Langue"), LG.filter(g => T.some(t=>t.language_group===g)), lgrp], | |
| ["conf", B("Confidence","Fiabilité"), CONF, conf], | |
| ]; | |
| const pills = groups.map(([k, lab, opts, fmt]) => `<div class="fg"><div class="fl">${lab}</div><div class="pills">${opts.map(o => pill(f[k].has(o), `f:${k}:${o}`, esc(fmt(o)))).join("")}</div></div>`).join(""); | |
| if(full || !document.getElementById("q")){ | |
| box.innerHTML = `<div class="fhead"><b>${B("Filters","Filtres")}</b><span class="cap" style="margin:0">${B("Every option is on screen and takes one click. Filters apply to the Overview, Atlas, Presses and Catalogue tabs.","Toutes les options sont à l'écran et se prennent en un clic. Les filtres s'appliquent aux onglets Vue d'ensemble, Atlas, Maisons et Catalogue.")}</span></div> | |
| <div class="fgroups" id="fpills">${pills}</div> | |
| <div class="search" style="margin-top:10px"><input id="q" type="search" placeholder="${B("Search a title, author, press or city","Rechercher un titre, un auteur, une maison ou une ville")}" value="${esc(S.q)}" aria-label="${B("Search","Rechercher")}"><span id="fclear"></span></div>`; | |
| document.getElementById("q").addEventListener("input", e => { S.q = e.target.value; S.catPage = 0; S.pressN = 30; renderClear(); renderMain(); }); | |
| } else { | |
| document.getElementById("fpills").innerHTML = pills; | |
| } | |
| renderClear(); | |
| } | |
| function renderClear(){ | |
| const el = document.getElementById("fclear"); if(!el) return; | |
| el.innerHTML = anyFilter() ? `<button class="btn" data-act="fclear">${B("Clear all filters","Effacer les filtres")}</button>` : ""; | |
| } | |
| /* ------------------------------------------------------------ OVERVIEW */ | |
| function vOverview(){ | |
| const TF = tf(), PF = pf(); | |
| const nzero = COUNTRIES.filter(c => !c.searched).length; | |
| const dated = TF.filter(t => t.year!=null).length; | |
| const pres = TF.filter(t => t.stage2_preserved).length; | |
| const ctry = new Set(TF.map(t=>t.country)).size, regs = new Set(TF.map(t=>t.region)).size; | |
| const langs = new Set(TF.map(t=>t.language)).size, afr = TF.filter(t=>t.african_language).length; | |
| let h = filterBanner(); | |
| h += tiles([ | |
| [nf(TF.length), B("titles catalogued","titres au catalogue"), B(`${nf(dated)} dated · ${nf(TF.length-dated)} undated`,`${nf(dated)} datés · ${nf(TF.length-dated)} non datés`)], | |
| [nf(PF.length), B("presses in the register","maisons au registre"), B(`${nf(PF.filter(p=>p.based_in_africa).length)} with an African imprint`,`${nf(PF.filter(p=>p.based_in_africa).length)} à adresse africaine`)], | |
| [nf(ctry), B("countries of publication","pays de publication"), B(`${regs} regions`,`${regs} régions`)], | |
| [nf(langs), B("languages of publication","langues de publication"), B(`${nf(afr)} titles in African languages`,`${nf(afr)} titres en langues africaines`)], | |
| [nf(pres), B("with a known scan","avec une numérisation connue"), B(`${pct(pres,TF.length)} of these titles`,`${pct(pres,TF.length)} de ces titres`)], | |
| [nf(nzero), B("countries with no record yet","pays sans aucune notice"), B(`of 54: unsearched, not empty`,`sur 54 : non explorés, pas vides`)], | |
| ]); | |
| h += note(B(`<b>Read the last two tiles together.</b> The catalogue is the easy part. Of ${nf(TF.length)} titles, ${nf(pres)} have a scan anyone can point to, none has teaching material, and ${nzero} African countries carry no record here at all. That distance, between a book that exists and a book a teacher can use, is the project.`, | |
| `<b>Lisez les deux dernières tuiles ensemble.</b> Le catalogue est la partie facile. Sur ${nf(TF.length)} titres, ${nf(pres)} ont une numérisation que l'on peut montrer, aucun n'a de matériel pédagogique, et ${nzero} pays africains ne portent ici aucune notice. Cette distance, entre un livre qui existe et un livre qu'un enseignant peut utiliser, c'est le projet.`)); | |
| const dc = count(TF, "decade"); | |
| const decRows = DECS.map(d => ({l:dec(d), v:dc.get(d)||0, c: d==="Undated" ? "var(--absent)" : null})); | |
| const rc = count(TF, "region"); | |
| const regRows = REGIONS.filter(r => rc.get(r)).map(r => ({l:reg(r), v:rc.get(r), c:REG_COL[r]})).sort((a,b)=>b.v-a.v); | |
| h += `<div class="g2" style="margin-top:18px"><div class="panel">${head(B("Titles by decade of publication","Titres par décennie de publication"), B("The 1960s peak is the independence decade. Grey: undated, never assigned a plausible decade.","Le pic des années 1960 est celui des indépendances. Gris : non datés, jamais rattachés à une décennie plausible."))}${vbars(decRows)}<p class="cs" style="margin-top:12px">${B("Undated records are almost all Onitsha pamphlets, where library dates are conjectural.","Les notices non datées sont presque toutes des pamphlets d'Onitsha, dont les dates de bibliothèque sont conjecturales.")}</p></div> | |
| <div class="panel">${head(B("Titles by region of publication","Titres par région de publication"), B("Coverage reflects where the research reached, not where the books are.","La couverture reflète l'avancée de la recherche, pas la géographie réelle des livres."))}${hbars(regRows)}<p class="cs" style="margin-top:12px">${B("North Africa, the Horn and Lusophone Africa are thin: read them as gaps in the search, never as gaps in the record.","L'Afrique du Nord, la Corne et l'Afrique lusophone sont minces : ce sont des lacunes de la recherche, jamais du fonds.")}</p></div></div>`; | |
| const oc = count(PF, "ownership"); | |
| const ownRows = [...oc].map(([k,v]) => ({l:esc(own(k)), v})).sort((a,b)=>b.v-a.v); | |
| const lc = count(TF, "language"); | |
| const lgRows = [...lc].sort((a,b)=>b[1]-a[1]).slice(0,12).map(([k,v]) => ({l:esc(k==="unknown"?B("unrecorded","non renseignée"):k), v})); | |
| h += `<div class="g2" style="margin-top:22px"><div class="panel">${head(B("Who owned the presses","À qui appartenaient les maisons"), B("Ownership decides who holds the rights today.","La propriété décide de qui détient les droits aujourd'hui."))}${hbars(ownRows)}<p class="cs" style="margin-top:12px">${B("An African-owned house that closed leaves orphan works; a branch of a foreign firm leaves the rights with a company that still exists, and often still says no.","Une maison africaine disparue laisse des œuvres orphelines ; une filiale de groupe étranger laisse les droits à une société qui existe toujours, et qui refuse souvent.")}</p></div> | |
| <div class="panel">${head(B("Languages of publication (top 12)","Langues de publication (12 premières)"), B("English and French dominate the surviving record.","L'anglais et le français dominent le fonds conservé."))}${hbars(lgRows)}<p class="cs" style="margin-top:12px">${B("Partly what was published, partly what got catalogued: African-language imprints were the least likely to reach a library that indexed them.","En partie ce qui fut publié, en partie ce qui fut catalogué : les impressions en langues africaines avaient le moins de chances d'atteindre une bibliothèque qui les indexait.")}</p></div></div>`; | |
| const cc = count(TF, "confidence"), st = STATUS(); | |
| h += `<div class="panel" style="margin-top:22px">${head(B("What the evidence rests on","Sur quoi repose la preuve"))}${hbars(CONF.map((c,i) => ({l:conf(c), v:cc.get(c)||0, c:[st.good,st.warn,st.bad][i]})))}<p class="cs" style="margin-top:12px">${B("High = a library or publisher catalogue record. Medium = a scholarly source, or a dealer listing transcribed from a title page. Low = a single unconfirmed mention: a lead, not a fact.","Élevée = une notice de catalogue de bibliothèque ou d'éditeur. Moyenne = une source savante, ou une annonce de libraire transcrite d'une page de titre. Faible = une seule mention non confirmée : une piste, pas un fait.")}</p></div>`; | |
| return h; | |
| } | |
| /* ------------------------------------------------------------ ATLAS */ | |
| function mapSVG(values, ramp, unit, withCities, citiesRows){ | |
| const W = MAP.w, Hh = MAP.h, k = 10*0.9962; | |
| const vals = Object.values(values).filter(v=>v>0), max = Math.max(1, ...vals); | |
| const stops = RAMPS[S.theme][ramp]; | |
| const col = v => rampAt(stops, Math.sqrt(v)/Math.sqrt(max)); | |
| const px = lon => (lon - MAP.lon0)*MAP.kx, py = lat => (MAP.lat1 - lat)*MAP.ky; | |
| let g = ""; | |
| for(let lon=-20; lon<=50; lon+=10){ g += `<line class="grat" x1="${px(lon)}" y1="0" x2="${px(lon)}" y2="${Hh}"/><text class="gl" x="${px(lon)+3}" y="${Hh-6}">${Math.abs(lon)}°${lon<0?B("W","O"):lon>0?"E":""}</text>`; } | |
| for(let lat=-30; lat<=30; lat+=10){ g += `<line class="grat" x1="0" y1="${py(lat)}" x2="${W}" y2="${py(lat)}"/><text class="gl" x="4" y="${py(lat)-4}">${Math.abs(lat)}°${lat<0?"S":lat>0?"N":""}</text>`; } | |
| let paths = "", labels = ""; | |
| const box = document.getElementById("main").clientWidth || 900; | |
| const mapW = box < 860 ? box - 34 : (box*1.4/2.4) - 34; | |
| const scale = mapW / W; // screen px per map unit | |
| const minPx = 9, fsMin = minPx/scale; | |
| const lum = h => { if(!h || h[0]!=="#") return S.theme==="light" ? 0.8 : 0.25; const [r,g,b] = hex2(h); return (0.2126*r+0.7152*g+0.0722*b)/255; }; | |
| const placed = []; | |
| const order = Object.entries(MAP.countries).sort((a,b)=>b[1].area-a[1].area); | |
| for(const [pays, c] of Object.entries(MAP.countries)){ | |
| const v = values[pays] || 0; | |
| const fill = v>0 ? col(v) : "var(--absent)"; | |
| const ctry = mapToCountry[pays] || pays; | |
| paths += `<path class="cty${S.mapSel===pays?" sel":""}" data-c="${esc(pays)}" d="${c.d}" fill="${fill}"><title>${esc(cname(ctry))}: ${v>0?nf(v):B("no record yet","aucune notice")}</title></path>`; | |
| } | |
| for(const [pays, c] of order){ | |
| if(!c.c) continue; | |
| const v = values[pays] || 0, ctry = mapToCountry[pays] || pays; | |
| const name = cShort(ctry), side = Math.sqrt(c.area); | |
| const fs = Math.max(fsMin, Math.min(side/6.5, 15)); | |
| const w = name.length*fs*0.58, hgt = fs*1.1; | |
| if(w > side*1.35) continue; | |
| const bx = [c.c[0]-w/2, c.c[1]-hgt/2, c.c[0]+w/2, c.c[1]+hgt/2]; | |
| if(placed.some(p => !(bx[2]<p[0] || bx[0]>p[2] || bx[3]<p[1] || bx[1]>p[3]))) continue; | |
| placed.push(bx); | |
| const L = lum(v>0 ? col(v) : null), darkTxt = L > 0.5; | |
| labels += `<text class="lbl" x="${c.c[0]}" y="${c.c[1]}" style="font-size:${fs.toFixed(1)}px;fill:${darkTxt?"#241a10":"#fff"};stroke:${darkTxt?"rgba(255,255,255,.65)":"rgba(0,0,0,.6)"};stroke-width:${(2.4/scale).toFixed(1)}px">${esc(name)}</text>`; | |
| } | |
| const gfs = Math.max(10, 9/scale).toFixed(1); | |
| g = g.replace(/class="gl"/g, `class="gl" style="font-size:${gfs}px"`); | |
| let cities = ""; | |
| if(withCities){ | |
| const cm = Math.max(1, ...citiesRows.map(c=>c.titles)); | |
| citiesRows.filter(c=>c.titles>0).sort((a,b)=>b.titles-a.titles).forEach(c => { | |
| const r = 2.4 + 12*Math.sqrt(c.titles/cm); | |
| cities += `<circle class="city" data-city="${esc(c.city)}" cx="${px(c.lon).toFixed(1)}" cy="${py(c.lat).toFixed(1)}" r="${r.toFixed(1)}"><title>${esc(c.city)}: ${c.titles} ${B("titles","titres")}</title></circle>`; | |
| }); | |
| } | |
| return {svg:`<svg viewBox="0 0 ${W} ${Hh}" role="img" aria-label="${esc(unit)}">${g}${paths}${cities}${labels}</svg>`, max, col, stops}; | |
| } | |
| function vAtlas(){ | |
| const TF = tf(), PF = pf(); | |
| const M = {titles:[B("Titles catalogued","Titres au catalogue"),"blue"], presses:[B("Presses in the register","Maisons au registre"),"sepia"], preserved:[B("Titles with a scan","Titres numérisés"),"green"]}; | |
| const [unit, ramp] = M[S.measure]; | |
| const values = {}; | |
| if(S.measure==="titles") count(TF,"map_country").forEach((v,k)=>values[k]=v); | |
| if(S.measure==="presses") count(PF,"map_country").forEach((v,k)=>values[k]=v); | |
| if(S.measure==="preserved") count(TF.filter(t=>t.stage2_preserved),"map_country").forEach((v,k)=>values[k]=v); | |
| const onMap = new Set(Object.keys(MAP.countries)); | |
| const ngrey = [...onMap].filter(c => !(values[c]>0)).length; | |
| const cityCount = count(TF, "city"); | |
| const cityRows = CITIES.filter(c => c.on_map).map(c => ({...c, titles: cityCount.get(c.city)||0})); | |
| const m = mapSVG(values, ramp, unit, S.measure==="titles", cityRows); | |
| const ticks = [0, .25, .5, .75, 1].map(f => Math.round(m.max*f*f)); | |
| const rank = Object.entries(values).filter(([k,v]) => v>0 && onMap.has(k)).sort((a,b)=>b[1]-a[1]); | |
| let h = filterBanner(); | |
| h += `<h2>${B("The geography of a vanished publishing industry","La géographie d'une édition disparue")}</h2> | |
| <p class="cap">${B("Country outlines: Natural Earth 1:50m, public domain. City dots are placed from a public gazetteer and are a cartographic aid only: they are not part of any bibliographic record. Tap or hover a country or a city.","Contours des pays : Natural Earth 1:50m, domaine public. Les points de villes sont placés d'après un répertoire géographique public et ne sont qu'une aide à la lecture : ils ne font partie d'aucune notice. Touchez ou survolez un pays ou une ville.")}</p> | |
| <div class="pills" style="margin:6px 0 14px">${Object.entries(M).map(([k,[l]]) => pill(S.measure===k, "measure:"+k, l)).join("")}</div> | |
| <div class="g2 map"><div><div class="panel">${head(unit, B(`${ngrey} countries in grey: no record yet, which is not the same as nothing to find.`,`${ngrey} pays en gris : aucune notice à ce jour, ce qui n'est pas la même chose que rien à trouver.`))} | |
| <div class="mapbox" id="mapbox">${m.svg}</div> | |
| <div class="mlegend"><div><div>${unit}</div><div class="grad" style="background:linear-gradient(90deg,${m.stops.join(",")})"></div><div class="gticks">${ticks.map(t=>`<span>${nf(t||1)}</span>`).join("")}</div></div> | |
| <div><span style="display:inline-block;width:14px;height:10px;background:var(--absent);border-radius:2px;margin-right:6px"></span>${B("no record yet","aucune notice")}</div> | |
| ${S.measure==="titles"?`<div><svg width="70" height="26" viewBox="0 0 70 26"><circle cx="8" cy="18" r="3" fill="var(--city)"/><circle cx="26" cy="15" r="6" fill="var(--city)"/><circle cx="52" cy="12" r="11" fill="var(--city)"/></svg> ${B("titles per city","titres par ville")}</div>`:""}</div> | |
| <div class="mapinfo" id="mapinfo">${mapInfo(values, rank)}</div></div></div> | |
| <div class="panel">${head(B("Ranking","Classement"), B("The map carries the shape, the ranking carries the numbers.","La carte porte la forme, le classement porte les chiffres."))}${rank.length ? hbars(rank.slice(0,20).map(([k,v]) => ({l:esc(cname(mapToCountry[k]||k)), v, c: m.col(v)}))) : `<p>${B("Nothing to rank under these filters.","Rien à classer avec ces filtres.")}</p>`}</div></div>`; | |
| if(S.measure==="titles") h += `<p class="cap" style="margin-top:12px">${B("The dots are the cities that actually printed. A whole country can be coloured by a single city: Nigeria's shade is Onitsha and Ibadan, not Nigeria.","Les points sont les villes qui imprimaient réellement. Un pays entier peut être coloré par une seule ville : la teinte du Nigéria, c'est Onitsha et Ibadan, pas le Nigéria.")}</p>`; | |
| const zero = COUNTRIES.filter(c => !c.searched).map(c => cname(c.country)).sort((a,b)=>a.localeCompare(b, S.lang)); | |
| h += note(B(`<b>The grey is the finding.</b> ${zero.length} of the 54 countries on this map carry no record at all: ${zero.join(", ")}. Not one of them lacked a printing press between 1950 and 1979. They are grey because this catalogue has not searched them yet.`, | |
| `<b>Le gris est le résultat.</b> ${zero.length} des 54 pays de cette carte ne portent aucune notice : ${zero.join(", ")}. Aucun d'eux n'était dépourvu d'imprimerie entre 1950 et 1979. Ils sont gris parce que ce catalogue ne les a pas encore explorés.`), "warn"); | |
| const cv = [...cityCount].filter(([c]) => c).sort((a,b)=>b[1]-a[1]).slice(0,16); | |
| const decOrder = DECS.filter(d => d!=="Undated"); | |
| const presentRegs = REGIONS.filter(r => TF.some(t => t.region===r && t.decade!=="Undated")); | |
| const stk = decOrder.map(d => ({l:dec(d), parts: presentRegs.map(r => { const v = TF.filter(t=>t.decade===d && t.region===r).length; return {v, c:REG_COL[r], tip:`${reg(r)}: ${v}`}; })})); | |
| h += `<div class="g2" style="margin-top:20px"><div class="panel">${head(B("The publishing cities","Les villes d'édition"), B("Titles catalogued, by city of imprint","Titres catalogués, par ville d'impression"))}${hbars(cv.map(([c,v]) => ({l:esc(c), v, c:"var(--city)"})))}</div> | |
| <div class="panel">${head(B("Where publishing happened, decade by decade","Où l'on publiait, décennie par décennie"), B("Dated titles only, stacked by region.","Titres datés seulement, empilés par région."))}${sbars(stk)}${legend(presentRegs.map(r => [REG_COL[r], reg(r)]))}</div></div>`; | |
| return h; | |
| } | |
| function mapInfo(values, rank){ | |
| const sel = S.mapSel; | |
| if(!sel) return `<span class="muted">${B("Tap or hover a country or a city to read its value.","Touchez ou survolez un pays ou une ville pour lire sa valeur.")}</span>`; | |
| if(sel.startsWith("city:")){ | |
| const c = sel.slice(5), TF = tf(); | |
| const n = TF.filter(t => t.city===c).length, np = pf().filter(p => p.city===c).length; | |
| return `<b>${esc(c)}</b> · ${nf(n)} ${B("titles","titres")} · ${nf(np)} ${B("presses","maisons")}`; | |
| } | |
| const v = values[sel]||0, name = cname(mapToCountry[sel]||sel); | |
| if(!v) return `<b>${esc(name)}</b> · ${B("no record yet: not searched, which is not the same as empty","aucune notice : non exploré, ce qui n'est pas la même chose que vide")}`; | |
| const i = rank.findIndex(([k]) => k===sel); | |
| return `<b>${esc(name)}</b> · ${nf(v)} · ${B("rank","rang")} ${i+1}/${rank.length}`; | |
| } | |
| /* ------------------------------------------------------------ PRESSES */ | |
| function vPresses(){ | |
| const TF = tf(), PF = pf(); | |
| const tc = count(TF, "press_id"); | |
| let PP = PF.map(p => ({...p, n: tc.get(p.press_id)||0})); | |
| let h = filterBanner(); | |
| h += tiles([ | |
| [nf(PP.length), B("presses","maisons"), B(`of ${nf(P.length)} in the register`,`sur ${nf(P.length)} au registre`)], | |
| [nf(PP.filter(p=>p.based_in_africa).length), B("African imprint","adresse africaine"), B("printed on the continent","imprimé sur le continent")], | |
| [nf(new Set(PP.map(p=>p.country)).size), B("countries","pays"), B("of publication","de publication")], | |
| [nf(PP.reduce((a,p)=>a+p.n,0)), B("titles","titres"), B("attached to these presses","rattachés à ces maisons")], | |
| ]); | |
| const ty = count(PP, "type"); | |
| const fo = PP.filter(p => p.founded!=null); | |
| const fd = count(fo, p => Math.floor(p.founded/10)*10); | |
| const decs = [...fd.keys()].sort((a,b)=>a-b); | |
| if(PP.length) h += `<div class="g2"><div class="panel">${head(B("What kind of house","Quel type de maison"))}${hbars([...ty].sort((a,b)=>b[1]-a[1]).map(([k,v]) => ({l:esc(tr(TYPE_FR,k)), v})))}</div> | |
| <div class="panel">${head(B("Presses by decade of founding","Maisons par décennie de fondation"), B(`${PP.length-fo.length} presses have no verified founding year and are left out rather than dated by inference.`,`${PP.length-fo.length} maisons n'ont pas d'année de fondation vérifiée : écartées plutôt que datées par déduction.`))}${vbars(decs.map(d => ({l: S.lang==="en" ? `${d}s` : `${d}`, v: fd.get(d)})))}</div></div>`; | |
| const SORTS = [B("Most titles here","Le plus de titres ici"), B("Oldest first","Les plus anciennes"), B("By name","Par nom")]; | |
| if(S.pressSort===0) PP.sort((a,b)=>b.n-a.n || a.name.localeCompare(b.name)); | |
| else if(S.pressSort===1) PP.sort((a,b)=>(a.founded??9999)-(b.founded??9999)); | |
| else PP.sort((a,b)=>a.name.localeCompare(b.name)); | |
| h += `<h2>${B("The register","Le registre")}</h2><div class="pills" style="margin-bottom:8px">${SORTS.map((s,i) => pill(S.pressSort===i, "psort:"+i, s)).join("")}</div>`; | |
| if(!PP.length) h += `<p>${B("No press matches these filters.","Aucune maison ne correspond à ces filtres.")}</p>`; | |
| h += `<div class="cards2">` + PP.slice(0, S.pressN).map(p => { | |
| const flag = p.based_in_africa ? "" : ` <span class="chip lo">${B("imprint outside Africa","adresse hors d'Afrique")}</span>`; | |
| const figs = p.key_figures ? ` · ${B("key figures","figures")} : ${esc(p.key_figures)}` : ""; | |
| const ser = p.notable_series ? ` · ${B("series","collections")} : ${esc(p.notable_series)}` : ""; | |
| return card(esc(p.name)+flag, `${esc(p.city)}, ${esc(cname(p.country))} · ${esc(p.active_span)} · ${esc(own(p.ownership))} · ${esc(tr(TYPE_FR,p.type))} · ${p.n} ${B("titles","titres")}${figs}${ser}`, | |
| esc(p.description), `${chip(p.confidence)} ${B("Sources","Sources")} : ${srcLinks(p)}`); | |
| }).join("") + `</div>`; | |
| if(PP.length > S.pressN) h += `<p><button class="btn" data-act="pmore">${B(`Show more (${PP.length - S.pressN} left)`,`Afficher plus (${PP.length - S.pressN} restantes)`)}</button></p>`; | |
| return h; | |
| } | |
| /* ------------------------------------------------------------ CATALOGUE */ | |
| const PAGE = 25; | |
| function vCatalogue(){ | |
| const TF = tf(); | |
| let h = filterBanner(); | |
| h += tiles([ | |
| [nf(TF.length), B("titles","titres"), B(`of ${nf(T.length)}`,`sur ${nf(T.length)}`)], | |
| [nf(new Set(TF.map(t=>t.press_id)).size), B("presses","maisons"), B("with a title in this view","avec un titre dans cette vue")], | |
| [nf(TF.filter(t=>t.stage2_preserved).length), B("with a scan","numérisés"), B("open or restricted","ouverts ou restreints")], | |
| [nf(TF.filter(t=>t.in_print==="no").length), B("confirmed out of print","épuisés confirmés"), B(`${nf(TF.filter(t=>t.in_print==="unknown").length)} unverified`,`${nf(TF.filter(t=>t.in_print==="unknown").length)} non vérifiés`)], | |
| ]); | |
| if(TF.length){ | |
| const gg = count(TF, "genre_group"), st = STATUS(), dg = count(TF, "digitization_status"); | |
| h += `<div class="g2"><div class="panel">${head(B("What was actually published","Ce qui fut réellement publié"))}${hbars([...gg].sort((a,b)=>b[1]-a[1]).map(([k,v]) => ({l:esc(tr(GENRE_FR,k)), v})))}</div> | |
| <div class="panel">${head(B("Does a scan exist?","Une numérisation existe-t-elle ?"), B("'Catalogue record only': a record exists, no scan. 'Not checked': nobody has looked yet.","« Notice seule » : une notice existe, pas de numérisation. « Non vérifié » : personne n'a encore regardé."))}${hbars(SCAN.map((k,i) => ({l:esc(scan(k)), v:dg.get(k)||0, c:[st.good,"var(--city)",st.warn,st.bad][i]})))}</div></div>`; | |
| } | |
| const cols = [["title",B("Title","Titre")],["author",B("Author","Auteur")],["press_name",B("Press","Maison")],["country",B("Country","Pays")],["year",B("Year","Année")],["language",B("Language","Langue")],["digitization_status",B("Scan","Numérisation")],["confidence",B("Confidence","Fiabilité")]]; | |
| const {k, d} = S.catSort; | |
| const rows = TF.slice().sort((a,b) => { | |
| let x = a[k], y = b[k]; | |
| if(x==null && y==null) return a.title.localeCompare(b.title); | |
| if(x==null) return 1; if(y==null) return -1; | |
| const r = typeof x==="number" ? x-y : String(x).localeCompare(String(y), S.lang); | |
| return r*d || a.title.localeCompare(b.title); | |
| }); | |
| const pages = Math.max(1, Math.ceil(rows.length/PAGE)); | |
| S.catPage = Math.min(S.catPage, pages-1); | |
| const slice = rows.slice(S.catPage*PAGE, S.catPage*PAGE+PAGE); | |
| h += `<h2>${B("Records","Notices")}</h2><p class="cap">${B("Click a column title to sort, click a row to open its full dossier.","Cliquez un titre de colonne pour trier, une ligne pour ouvrir son dossier complet.")}</p>`; | |
| h += `<div class="pills sortpills" style="margin:4px 0">${cols.slice(0,5).map(([c,l]) => pill(k===c, "csort:"+c, l + (k===c?(d>0?" ▲":" ▼"):""))).join("")}</div>`; | |
| h += pager(rows.length, pages); | |
| h += `<table class="tbl"><thead><tr>${cols.map(([c,l]) => `<th data-act="csort:${c}" class="${k===c?"on":""}">${l}${k===c?(d>0?" ▲":" ▼"):""}</th>`).join("")}<th>${B("Source","Source")}</th></tr></thead><tbody>` + | |
| slice.map(t => `<tr data-act="dossier:${t.title_id}" class="${S.dossier===t.title_id?"sel":""}"><td class="ttl">${esc(t.title)}</td><td data-k="${B("Author","Auteur")}">${esc(t.author)}</td><td data-k="${B("Press","Maison")}">${esc(t.press_name)}, ${esc(t.city)}</td><td data-k="${B("Country","Pays")}">${esc(cname(t.country))}</td><td data-k="${B("Year","Année")}">${t.year??`<span class="muted">${B("undated","non daté")}</span>`}</td><td data-k="${B("Language","Langue")}">${esc(t.language)}</td><td data-k="${B("Scan","Numérisation")}">${esc(scan(t.digitization_status))}</td><td>${chip(t.confidence)}</td><td>${(String(t.source_urls||"").split(" | ")[0]) ? `<a href="${esc(String(t.source_urls).split(" | ")[0])}" target="_blank" rel="noopener">↗</a>` : "-"}</td></tr>` + | |
| (S.dossier===t.title_id ? `<tr class="sel"><td colspan="9" style="cursor:default">${dossier(t)}</td></tr>` : "")).join("") + `</tbody></table>`; | |
| h += pager(rows.length, pages); | |
| h += `<p><button class="btn" data-act="dlsel">${B("Download this selection (CSV)","Télécharger cette sélection (CSV)")}</button> <a class="btn" href="titles.csv" download>${B("Full catalogue (CSV)","Catalogue complet (CSV)")}</a></p>`; | |
| return h; | |
| } | |
| function pager(n, pages){ | |
| if(pages<=1) return `<div class="pager"><span class="info">${nf(n)} ${B("records","notices")}</span></div>`; | |
| const p = S.catPage, btns = []; | |
| const show = new Set([0, pages-1, p-1, p, p+1].filter(i => i>=0 && i<pages)); | |
| let last = -1; | |
| [...show].sort((a,b)=>a-b).forEach(i => { if(i-last>1) btns.push(`<span class="muted">…</span>`); btns.push(pill(i===p, "cpage:"+i, i+1)); last = i; }); | |
| return `<div class="pager"><span class="info">${nf(n)} ${B("records","notices")} · ${B("page","page")} ${p+1}/${pages}</span>${pill(false,"cpage:"+Math.max(0,p-1),"‹")}${btns.join("")}${pill(false,"cpage:"+Math.min(pages-1,p+1),"›")}</div>`; | |
| } | |
| function dossier(t){ | |
| const pr = P.find(p => p.press_id===t.press_id), rr = R.find(r => r.country===t.country); | |
| const an = t.year ?? B("undated","non daté"); | |
| const kv = [[B("Author","Auteur"),t.author],[B("Title","Titre"),t.title],[B("Language","Langue"),t.language],[B("Country","Pays"),cname(t.country)],[B("City","Ville"),t.city],[B("Press","Maison"),t.press_name],[B("Year","Année"),an],["Pages",t.pages ?? B("unrecorded","non renseigné")],["Genre",t.genre],[B("In print","Disponible"),tr(PRINT_FR,t.in_print)],[B("Scan","Numérisation"),scan(t.digitization_status)]]; | |
| const todo = B("Author's dates (nothing can be calculated without them)|Alternative title, edition and printing|ISBN, if one was ever assigned|Illustrator, cover artist and translator|Physical condition of a located copy|Rights holder and rights status|Digitization permission|Subjects, age group and curriculum relevance", | |
| "Dates de l'auteur (rien ne se calcule sans elles)|Titre alternatif, édition et tirage|ISBN, s'il en existe un|Illustrateur, maquettiste et traducteur|État matériel d'un exemplaire localisé|Ayant droit et statut des droits|Autorisation de numériser|Sujets, tranche d'âge et usage pédagogique").split("|"); | |
| return `<div class="dossier"><h3>${esc(t.title)}</h3><div class="meta" style="margin-bottom:8px">${chip(t.confidence)}${t.banned===true?`<span class="chip lo">${B("recorded as banned","signalé comme interdit")}</span>`:""}${t.pilot_cluster?`<span class="chip">${B("pilot","pilote")} ${esc(t.pilot_cluster.slice(0,1))}</span>`:""}<button class="btn" data-act="dossier:" style="float:right;padding:3px 10px">✕</button></div> | |
| <div class="g2"><div><h3>${B("Bibliographic record","Notice bibliographique")}</h3><ul class="kv">${kv.map(([a,b]) => `<li><b>${a}</b> ${esc(b)}</li>`).join("")}</ul> | |
| <h3>${B("Still to record","Reste à renseigner")}</h3><ul class="plain">${todo.map(x=>`<li>${x}</li>`).join("")}</ul></div> | |
| <div><h3>${B("Provenance and notes","Provenance et notes")}</h3><p>${t.notes ? esc(t.notes) : `<i class="muted">${B("No researcher note on this record.","Aucune note de recherche sur cette notice.")}</i>`}</p> | |
| <h3>Sources</h3><p>${srcLinks(t, 6)}</p> | |
| ${t.digitization_url ? `<p><b>${B("Scan","Numérisation")}</b> · <a href="${esc(t.digitization_url)}" target="_blank" rel="noopener">${esc(t.digitization_holder||"↗")}</a></p>` : ""} | |
| ${pr ? `<h3>${B("The press","La maison")}</h3><p>${esc(pr.name)}, ${esc(pr.city)}, ${esc(cname(pr.country))} · ${esc(pr.active_span)} · ${esc(own(pr.ownership))}.${pr.archive_holdings ? `<br><b>${B("Known holdings","Fonds connus")}</b> · ${esc(pr.archive_holdings)}` : ""}</p>` : ""} | |
| <h3>${B("Rights context","Contexte juridique")}</h3><p>${rr ? `<b>${esc(cname(rr.country))}</b>, ${esc(rr.copyright_term)} (${esc(rr.statute)}). ${esc(rr.recovery_implication)}` : B("Not yet researched for this country.","Pas encore étudié pour ce pays.")}</p></div></div></div>`; | |
| } | |
| /* ------------------------------------------------------------ RECOVERY */ | |
| const STAGES = [ | |
| ["stage1_located","1 · Located","1 · Localisé","A catalogue record or a copy has been identified.","Une notice de catalogue ou un exemplaire a été identifié."], | |
| ["stage2_preserved","2 · Preserved","2 · Préservé","A conservation-quality scan exists.","Une numérisation de qualité conservation existe."], | |
| ["stage3_rights_identified","3 · Rights identified","3 · Ayants droit identifiés","The author, estate or successor publisher has been traced.","L'auteur, ses ayants droit ou l'éditeur successeur ont été retrouvés."], | |
| ["stage4_cleared","4 · Cleared","4 · Autorisé","Written permission to publish has been obtained.","L'autorisation écrite de publier a été obtenue."], | |
| ["stage5_republished","5 · Republished","5 · Réédité","The book is legally available again.","Le livre est de nouveau disponible légalement."], | |
| ["stage6_curriculum_ready","6 · Curriculum-ready","6 · Prêt pour l'enseignement","Teaching notes, vocabulary, activities and context exist.","Notes pédagogiques, vocabulaire, activités et contexte existent."], | |
| ]; | |
| const PILOT = { | |
| "A · Onitsha market pamphlets":[25,"A · Pamphlets du marché d'Onitsha","Popular writing produced and sold outside every colonial and missionary institution: the first large-scale independent book trade in British West Africa. It teaches literacy, commerce and voice at once, and almost none of it is reliably dated, which makes it a good exercise in reading evidence.","Une écriture populaire produite et vendue en dehors de toute institution coloniale ou missionnaire : le premier commerce du livre indépendant à grande échelle en Afrique de l'Ouest britannique. Elle enseigne à la fois l'alphabétisation, le commerce et la voix, et presque rien n'y est daté de façon sûre : bon exercice de lecture des sources."], | |
| "B · Ghanaian children's & folklore":[20,"B · Jeunesse et folklore ghanéens","The most immediately usable material in the catalogue and the most poorly recorded. The Ghana Publishing Corporation's Children's Library series was explicitly commissioned as books by Africans for African children, the exact brief this project inherits.","Le matériel le plus immédiatement utilisable du catalogue, et le plus mal enregistré. La collection Children's Library de la Ghana Publishing Corporation fut explicitement commandée comme des livres d'Africains pour des enfants africains, exactement le programme dont ce projet hérite."], | |
| "C · East African popular fiction":[20,"C · Fiction populaire d'Afrique de l'Est","Novels and plays from Nairobi and Dar es Salaam at the height of the East African Publishing House and Tanzania Publishing House. Kenya and Tanzania's life + 50 term also makes this the cluster most likely to be clearable.","Romans et pièces de Nairobi et Dar es Salaam à l'apogée de l'East African Publishing House et de la Tanzania Publishing House. La durée vie + 50 du Kenya et de la Tanzanie en fait aussi le groupe le plus facile à libérer."], | |
| "D · Francophone (CLE, NEA & related)":[20,"D · Francophone (CLE, NEA et apparentées)","Éditions CLE in Yaoundé and the Nouvelles Éditions Africaines in Dakar are the institutionally anchored African francophone houses, and CLE still exists: a living counterparty rather than an orphan-works problem.","Les Éditions CLE à Yaoundé et les Nouvelles Éditions Africaines à Dakar sont les maisons francophones africaines réellement ancrées, et CLE existe toujours : un interlocuteur vivant plutôt qu'un problème d'œuvres orphelines."], | |
| "E · African-language works":[15,"E · Œuvres en langues africaines","Swahili, Hausa, Yoruba, Igbo, Shona, isiZulu, Akan, Sesotho, Malagasy and more. The least digitised and least catalogued part of the corpus, and the part whose loss is least recoverable from anywhere else.","Swahili, haoussa, yoruba, igbo, shona, isiZulu, akan, sesotho, malgache et d'autres. La part la moins numérisée et la moins cataloguée du corpus, et celle dont la perte est la moins réparable ailleurs."], | |
| }; | |
| function miniTable(rows, cols){ | |
| return `<table class="tbl"><thead><tr>${cols.map(([,l])=>`<th style="cursor:default">${l}</th>`).join("")}</tr></thead><tbody>${rows.map(r => `<tr style="cursor:default">${cols.map(([c,l],i) => `<td ${i?`data-k="${l}"`:`class="ttl"`}>${c==="year" ? (r.year ?? B("undated","non daté")) : c==="confidence" ? chip(r.confidence) : esc(r[c])}</td>`).join("")}</tr>`).join("")}</tbody></table>`; | |
| } | |
| function vRecovery(){ | |
| let h = `<h2>${B("From located to curriculum-ready","De « localisé » à « prêt pour l'enseignement »")}</h2><p class="cap">${B("A recovered book passes through six states. Only the first is bibliographic; the rest are physical, legal and editorial work.","Un livre récupéré traverse six états. Seul le premier est bibliographique ; les autres sont matériels, juridiques et éditoriaux.")}</p>`; | |
| h += `<div class="panel">${head(B("Titles at each stage of recovery","Titres à chaque étape de la récupération"), B("Independent flags, not a funnel.","Indicateurs indépendants, pas un entonnoir."))}${hbars(STAGES.map(s => ({l: B(s[1],s[2]), v: T.filter(t=>t[s[0]]).length, tip: B(s[3],s[4])})), {max:T.length})}</div>`; | |
| const n5 = T.filter(t=>t.stage5_republished).length; | |
| h += note(B(`<b>These are independent flags, not a funnel.</b> ${n5} titles are commercially in print (stage 5) because a publisher reissued them, not because this project traced their rights. Stages 3, 4 and 6 stand at zero: no estate traced, no permission obtained, no teaching apparatus written. That is the true starting line, and the dashboard refuses to flatter it.`, | |
| `<b>Ce sont des indicateurs indépendants, pas un entonnoir.</b> ${n5} titres sont commercialement disponibles (étape 5) parce qu'un éditeur les a réédités, non parce que ce projet a retrouvé leurs ayants droit. Les étapes 3, 4 et 6 sont à zéro : aucun ayant droit retrouvé, aucune autorisation obtenue, aucun appareil pédagogique écrit. C'est la vraie ligne de départ, et le tableau de bord refuse de l'embellir.`)); | |
| h += `<h3>${B("What each stage requires","Ce qu'exige chaque étape")}</h3><div class="cards2">${STAGES.map(s => card(B(s[1],s[2]), `${nf(T.filter(t=>t[s[0]]).length)} ${B("titles","titres")}`, B(s[3],s[4]))).join("")}</div>`; | |
| h += `<h2>${B("The first phase: a pilot of 100 titles","Première phase : un pilote de 100 titres")}</h2><p class="cap">${B("Five clusters, each testing a different recovery problem: an uncatalogued pamphlet trade, a children's list, a popular-fiction backlist, a francophone imprint with a living publisher, and African-language texts.","Cinq groupes, chacun éprouvant un problème différent : un commerce de pamphlets non catalogué, un fonds pour la jeunesse, un catalogue de fiction populaire, une maison francophone encore vivante, et des textes en langues africaines.")}</p>`; | |
| const keys = Object.keys(PILOT); | |
| const asg = Object.fromEntries(keys.map(k => [k, T.filter(t=>t.pilot_cluster===k).length])); | |
| h += `<div class="panel">${head(B("Pilot clusters: assigned against target","Groupes du pilote : affectés / cible"), B("Grey is the target; colour is what the catalogue can currently fill.","Le gris est la cible ; la couleur est ce que le catalogue peut remplir."))}${hbars(keys.map(k => ({l: B(k, PILOT[k][1]), v: asg[k], target: PILOT[k][0], lab: `${asg[k]} / ${PILOT[k][0]}`})), {max:25})}</div>`; | |
| const short = keys.filter(k => asg[k] < PILOT[k][0]); | |
| if(short.length){ | |
| const n = short.reduce((a,k)=>a+PILOT[k][0]-asg[k],0); | |
| h += note(B(`<b>Cluster B is ${n} titles short, and that is a finding rather than a data problem.</b> Ghanaian children's and folklore publishing of the period is severely under-catalogued: the Bureau of Ghana Languages published in eleven languages from 1951 and almost none of it is indexed anywhere online. Filling this cluster needs on-site work in Accra and Tamale.`, | |
| `<b>Le groupe B est incomplet de ${n} titres, et c'est un résultat, non un défaut de données.</b> L'édition ghanéenne pour la jeunesse et le folklore de cette période est très mal cataloguée : le Bureau of Ghana Languages a publié en onze langues à partir de 1951 et presque rien n'en est indexé en ligne. Compléter ce groupe demande un travail sur place à Accra et Tamale.`), "warn"); | |
| } | |
| if(!S.pilot) S.pilot = keys[0]; | |
| const sub = T.filter(t => t.pilot_cluster===S.pilot).sort((a,b)=>(a.year??9999)-(b.year??9999)); | |
| h += `<h3>${B("Titles in each cluster","Les titres de chaque groupe")}</h3><div class="pills" style="margin-bottom:8px">${keys.map(k => pill(S.pilot===k, "pilot:"+k, `${B(k,PILOT[k][1])} (${asg[k]})`)).join("")}</div>`; | |
| h += note(B(PILOT[S.pilot][2], PILOT[S.pilot][3])); | |
| h += miniTable(sub, [["title",B("Title","Titre")],["author",B("Author","Auteur")],["press_name",B("Press","Maison")],["year",B("Year","Année")],["language",B("Language","Langue")],["confidence",B("Confidence","Fiabilité")]]); | |
| h += `<h2>${B("From a recovered book to a taught text","Du livre récupéré au texte enseigné")}</h2>`; | |
| h += note(B("<b>Three layers, three different rights positions.</b> A freely searchable bibliography is publishable now: facts about books are not the books. Full texts require cleared rights, title by title. Curriculum modules sit in between: original teaching material the project owns outright, quoting only short excerpts. That middle layer is how a still-copyrighted book becomes teachable before clearance is finished.", | |
| "<b>Trois couches, trois situations juridiques.</b> Une bibliographie librement consultable est publiable dès maintenant : les faits sur les livres ne sont pas les livres. Les textes intégraux exigent des droits libérés, titre par titre. Les modules pédagogiques sont entre les deux : un matériel original dont le projet est propriétaire, ne citant que de courts extraits. C'est cette couche intermédiaire qui rend enseignable un livre encore protégé, avant que les autorisations soient acquises.")); | |
| const banned = T.filter(t => t.banned===true); | |
| h += tiles([ | |
| [nf(T.filter(t=>t.genre_group==="Children's & folklore").length), B("children's & folklore","jeunesse et folklore"), B("the readiest classroom material","le matériel le plus immédiatement utilisable")], | |
| [nf(T.filter(t=>t.african_language).length), B("African-language titles","titres en langues africaines"), `${new Set(T.filter(t=>t.african_language).map(t=>t.language)).size} ${B("languages","langues")}`], | |
| [nf(banned.length), B("recorded as banned","signalés comme interdits"), B("censorship as a teachable subject","la censure comme sujet d'enseignement")], | |
| [nf(new Set(T.map(t=>t.press_id)).size), B("presses","maisons"), B("publishing history itself","l'histoire de l'édition elle-même")], | |
| ]); | |
| if(banned.length){ | |
| h += `<h3>${B("Titles recorded as banned","Titres signalés comme interdits")}</h3><p class="cap">${B("Apartheid-era banning is a direct cause of these books leaving circulation, and the ban record is itself curriculum material.","L'interdiction sous l'apartheid est une cause directe de la disparition de ces livres, et le registre des interdictions est lui-même un matériau pédagogique.")}</p>`; | |
| h += miniTable(banned.sort((a,b)=>(a.year??9999)-(b.year??9999)), [["title",B("Title","Titre")],["author",B("Author","Auteur")],["press_name",B("Press","Maison")],["city",B("City","Ville")],["year",B("Year","Année")],["notes","Note"]]); | |
| } | |
| return h; | |
| } | |
| /* ------------------------------------------------------------ RIGHTS */ | |
| function vRights(){ | |
| const st = STATUS(); | |
| let h = `<h2>${B("Out of print is not out of copyright","Épuisé ne veut pas dire libre de droits")}</h2><p>${B("Almost every book in this catalogue is still protected. Literary copyright commonly runs for the author's life plus fifty years, and in several of these countries seventy. Acquiring, cataloguing and preserving a physical copy is lawful in far more situations than publishing its full text online.","Presque tous les livres de ce catalogue sont encore protégés. Le droit d'auteur littéraire court communément pendant la vie de l'auteur plus cinquante ans, et dans plusieurs de ces pays soixante-dix. Acquérir, cataloguer et conserver un exemplaire matériel est licite dans beaucoup plus de cas que d'en publier le texte intégral en ligne.")}</p>`; | |
| h += note(B("This page describes published legal materials: statutes and treaty membership. It is not legal advice, and clearance for any individual title should be confirmed with counsel in the relevant jurisdiction.","Cette page décrit des textes juridiques publiés : lois et adhésions aux traités. Elle ne vaut pas conseil juridique : l'autorisation pour un titre donné doit être confirmée par un juriste de la juridiction concernée."), "warn"); | |
| const RR = R.slice().sort((a,b)=>a.term_years-b.term_years || a.country.localeCompare(b.country)); | |
| h += `<div class="panel">${head(B("Copyright term after the author's death","Durée de protection après la mort de l'auteur"), B(`${R.length} jurisdictions researched so far.`,`${R.length} juridictions étudiées à ce jour.`))}${hbars(RR.map(r => ({l:esc(cname(r.country)), v:r.term_years, lab: B(`life + ${r.term_years} years`,`vie + ${r.term_years} ans`), c: r.term_years<=50 ? st.good : st.warn, tip:r.statute})), {max:80})}<p class="cs" style="margin-top:12px">${B("Kenya, Tanzania and South Africa run life + 50. An author there who died in 1975 or earlier is out of copyright now, which makes them the obvious place to begin a first tranche that needs no clearance at all.","Le Kenya, la Tanzanie et l'Afrique du Sud appliquent vie + 50. Un auteur de ces pays mort en 1975 ou avant est aujourd'hui dans le domaine public : c'est par là qu'il faut commencer, avec une première tranche qui ne demande aucune autorisation.")}</p></div>`; | |
| const row = R.find(r => r.country===S.pdC) || R[0]; | |
| const exp = S.pdY + row.term_years, free = YEAR_NOW > exp; | |
| h += `<h2>${B("Public domain check","Vérification du domaine public")}</h2><p class="cap">${B("Arithmetic on the statutory term only. It does not account for anonymous, corporate, posthumous or folklore rules, and it is not a clearance.","Arithmétique sur la seule durée légale. Elle ne tient compte ni des règles sur l'anonymat, les personnes morales, les œuvres posthumes ou le folklore, et ne vaut pas autorisation.")}</p> | |
| <div class="pd"><div class="panel"><div class="fl" style="font:600 11px var(--sans);letter-spacing:.08em;text-transform:uppercase;color:var(--muted)">${B("Country","Pays")}</div><div class="pills" style="margin:6px 0 14px">${R.slice().sort((a,b)=>cname(a.country).localeCompare(cname(b.country),S.lang)).map(r => pill(r.country===row.country, "pdc:"+r.country, esc(cname(r.country)))).join("")}</div> | |
| <div class="fl" style="font:600 11px var(--sans);letter-spacing:.08em;text-transform:uppercase;color:var(--muted)">${B("Author's year of death","Année de mort de l'auteur")}</div> | |
| <div class="stepper"><button class="pill" data-act="pdy:-1">−</button><input type="number" id="pdy" min="1850" max="${YEAR_NOW}" value="${S.pdY}"><button class="pill" data-act="pdy:1">+</button></div> | |
| <div class="stepper"><input type="range" id="pdyr" min="1900" max="${YEAR_NOW}" value="${S.pdY}"></div></div> | |
| <div class="card" style="border-left:5px solid ${free?st.good:st.warn};margin:0"><h4>${free ? B("Likely public domain in this country","Probablement dans le domaine public dans ce pays") : B("Still in copyright in this country","Encore protégé dans ce pays")}</h4> | |
| <div class="meta">${B(`Protection ${free?"ran":"runs"} to the end of ${exp} under a life + ${row.term_years} year term (${esc(row.statute)}).`,`La protection ${free?"a couru":"court"} jusqu'à la fin de ${exp}, sous une durée de vie + ${row.term_years} ans (${esc(row.statute)}).`)}</div><p>${esc(row.public_domain_notes)}</p></div></div>`; | |
| h += `<h2>${B("Jurisdiction by jurisdiction","Juridiction par juridiction")}</h2>`; | |
| h += R.slice().sort((a,b)=>cname(a.country).localeCompare(cname(b.country),S.lang)).map(r => card(esc(cname(r.country)), | |
| `${esc(r.copyright_term)} · ${esc(r.statute)} · ${B("Berne member","membre de Berne")} : ${r.berne_member?B("yes","oui"):B("no","non")}`, | |
| `<b>${B("Corporate / anonymous works","Personnes morales / œuvres anonymes")}</b> · ${esc(r.anonymous_or_corporate_term||"-")}<br><br><b>${B("Orphan works","Œuvres orphelines")}</b> · ${esc(r.orphan_works_mechanism||B("No orphan-works mechanism recorded.","Aucun mécanisme pour les œuvres orphelines."))}<br><br><b>${B("What this means for a 1960s book","Ce que cela implique pour un livre des années 1960")}</b> · ${esc(r.recovery_implication)}`, | |
| `${chip(r.confidence)} ${B("Sources","Sources")} : ${srcLinks(r)}`)).join(""); | |
| h += `<p class="cap">${B("The legal analysis on this page is written in English, the language of most of the statutes cited.","L'analyse juridique de cette page est rédigée en anglais, langue de la plupart des textes cités.")}</p>`; | |
| const STEPS = [ | |
| ["Author","L'auteur","Trace the author, then the estate: national writers' union, university department, obituary, family. Record dates of birth and death; nothing can be calculated without them.","Retrouver l'auteur, puis les ayants droit : union nationale des écrivains, département universitaire, nécrologie, famille. Noter les dates de naissance et de mort ; rien ne se calcule sans elles."], | |
| ["Original publisher","L'éditeur d'origine","Establish whether the house still trades, was absorbed, or closed. Company registries settle this faster than literature does.","Établir si la maison existe encore, a été absorbée ou a fermé. Les registres du commerce tranchent plus vite que la littérature."], | |
| ["Successor in title","Le successeur","If absorbed, follow the chain of acquisition. If closed, look for whether contracts reverted rights to authors: the press archive is where that document lives.","Si absorbée, suivre la chaîne des rachats. Si fermée, chercher si les contrats rendaient les droits aux auteurs : c'est dans les archives de la maison que vit ce document."], | |
| ["Contributors","Les contributeurs","Translator, illustrator and cover artist hold separate rights. A cleared text with an uncleared cover is not cleared.","Traducteur, illustrateur et maquettiste détiennent des droits distincts. Un texte autorisé avec une couverture non autorisée n'est pas autorisé."], | |
| ["Territory and format","Territoire et support","Confirm the grant covers digital use and the territories you intend to serve, not just the original print run.","Vérifier que la cession couvre l'usage numérique et les territoires visés, et pas seulement le tirage d'origine."], | |
| ["Record the negative","Consigner les échecs","Log every dead end with date and method. The value of the file is the evidence that the search was real.","Consigner chaque impasse avec sa date et sa méthode. La valeur du dossier, c'est la preuve que la recherche a été réelle."], | |
| ]; | |
| h += `<h2>${B("The diligent-search file","Le dossier de recherche diligente")}</h2><p class="cap">${B("Where the rights holder cannot be found, the defensible position is a documented search, kept per title, showing what was tried and what it returned.","Lorsque l'ayant droit reste introuvable, la position défendable est une recherche documentée, tenue titre par titre, montrant ce qui a été tenté et ce que cela a donné.")}</p><div class="cards2">${STEPS.map((s,i) => card(`${i+1}. ${B(s[0],s[1])}`, "", B(s[2],s[3]))).join("")}</div>`; | |
| h += note(B("<b>A fair offer to authors and families.</b> A non-exclusive agreement, proper attribution, a preservation copy given back to the family, transparent usage statistics, and either royalties or an explicitly agreed cultural-access licence. Non-exclusive matters: it leaves the family free to license elsewhere, which is what makes the offer easy to accept.", | |
| "<b>Une offre honnête aux auteurs et aux familles.</b> Un accord non exclusif, une attribution correcte, une copie de conservation rendue à la famille, des statistiques d'usage transparentes, et soit des redevances soit une licence d'accès culturel explicitement convenue. Le caractère non exclusif compte : il laisse la famille libre de céder ailleurs, et c'est ce qui rend l'offre acceptable.")); | |
| return h; | |
| } | |
| /* ------------------------------------------------------------ COPIES */ | |
| function vCopies(){ | |
| const inA = H.filter(x => x.in_africa), out = H.filter(x => !x.in_africa); | |
| const docu = out.reduce((a,x)=>a+(x.approx_items||0),0); | |
| let h = `<h2>${B("Where the surviving copies are","Où sont les exemplaires survivants")}</h2><p>${B("Recovery is a physical problem before it is a digital one. Institutional catalogues find the books that were already privileged enough to be catalogued; the rest are in school storerooms, mission libraries, market stalls and family houses.","La récupération est un problème matériel avant d'être un problème numérique. Les catalogues institutionnels retrouvent les livres déjà assez privilégiés pour avoir été catalogués ; les autres sont dans des réserves d'école, des bibliothèques de mission, des étals de marché et des maisons de famille.")}</p>`; | |
| h += tiles([ | |
| [nf(H.length), B("search channels","pistes de recherche"), B("institutions and routes","institutions et circuits")], | |
| [nf(inA.length), B("in Africa","en Afrique"), B("libraries, missions, markets, estates","bibliothèques, missions, marchés, familles")], | |
| [nf(out.length), B("outside Africa","hors d'Afrique"), B("mostly northern repositories","surtout des dépôts du Nord")], | |
| [nf(docu)+"+", B("items documented abroad","pièces documentées à l'étranger"), B("Onitsha pamphlets, AWS papers, CRL","pamphlets d'Onitsha, archives AWS, CRL")], | |
| ]); | |
| h += note(B("<b>The asymmetry is the finding.</b> The best-documented, best-preserved holdings of this literature sit in Kansas, Bloomington, London and Chicago, while the in-Africa channels, where most surviving copies actually are, carry the lowest confidence because nobody has surveyed them. Every recovered digital master should be deposited with an African institution as a condition of the work.", | |
| "<b>L'asymétrie est le résultat.</b> Les fonds les mieux documentés et les mieux conservés de cette littérature sont au Kansas, à Bloomington, à Londres et à Chicago, tandis que les pistes africaines, où se trouvent la plupart des exemplaires survivants, sont les moins fiables parce que personne ne les a recensées. Chaque master numérique produit devrait être déposé dans une institution africaine, comme condition du travail.")); | |
| const kinds = [...new Set(H.map(x=>x.kind))]; | |
| const rows = kinds.map(k => ({l: esc(tr(KIND_FR,k)), parts:[{v:H.filter(x=>x.kind===k&&x.in_africa).length, c:CAT[0], tip:B("In Africa","En Afrique")},{v:H.filter(x=>x.kind===k&&!x.in_africa).length, c:CAT[1], tip:B("Outside Africa","Hors d'Afrique")}]})).sort((a,b)=>(b.parts[0].v+b.parts[1].v)-(a.parts[0].v+a.parts[1].v)); | |
| h += `<div class="panel">${head(B("Search channels by kind","Pistes de recherche par nature"))}${legend([[CAT[0],B("In Africa","En Afrique")],[CAT[1],B("Outside Africa","Hors d'Afrique")]])}${sbars(rows)}</div>`; | |
| const OU = {all:B("All","Toutes"), in:B("In Africa","En Afrique"), out:B("Outside Africa","Hors d'Afrique")}; | |
| const hf = H.filter(x => S.holdOu==="all" || (S.holdOu==="in") === !!x.in_africa).sort((a,b)=>a.kind.localeCompare(b.kind)||a.name.localeCompare(b.name)); | |
| h += `<h3>${B("The channels, one by one","Les pistes, une à une")}</h3><div class="pills" style="margin-bottom:6px">${Object.entries(OU).map(([k,l]) => pill(S.holdOu===k, "hold:"+k, l)).join("")}</div><div class="cards2">` + hf.map(x => card(esc(x.name), | |
| `${esc(tr(KIND_FR,x.kind))} · ${x.city?esc(x.city)+", ":""}${esc(cname(x.country))}${x.approx_items?` · ~${nf(x.approx_items)} ${B("items","pièces")}`:""}${x.url?` · <a href="${esc(x.url)}" target="_blank" rel="noopener">${B("website","site")} ↗</a>`:""}`, | |
| esc(x.what_it_holds) + (x.notes?`<br><i>${esc(x.notes)}</i>`:""), | |
| `<span class="chip">${esc(tr(PROV_FR,x.provenance))}</span>${chip(x.confidence)}`)).join("") + `</div>`; | |
| h += `<h2>${B("Digitization initiatives already in the field","Les initiatives de numérisation déjà à l'œuvre")}</h2><p class="cap">${B("Existing projects to partner with rather than duplicate. Access and format decide whether their material can be reused at all.","Des projets existants avec qui s'associer plutôt que de les refaire. L'accès et le format décident si leur matériel est réutilisable.")}</p>`; | |
| const ac = count(G, "access"), st = STATUS(); | |
| h += `<div class="panel">${head(B("How open are they?","Quel degré d'ouverture ?"))}${hbars(["open","partial","restricted","unknown"].map((k,i) => ({l:esc(tr(ACCESS_FR,k)), v:ac.get(k)||0, c:[st.good,st.warn,st.bad,"var(--absent)"][i]})))}</div>`; | |
| h += `<div class="cards2">` + G.slice().sort((a,b)=>a.region.localeCompare(b.region)||a.name.localeCompare(b.name)).map(g => card( | |
| `<a href="${esc(g.url)}" target="_blank" rel="noopener">${esc(g.name)} ↗</a>`, | |
| `${esc(g.host_institution)} · ${esc(tr(DREG_FR,g.region))}`, | |
| `${esc(g.scope)}<br><br><b>${B("Why it matters","Pourquoi c'est utile")}</b> · ${esc(g.relevance)}`, | |
| `<span class="chip">${B("access","accès")} ${esc(tr(ACCESS_FR,g.access))}</span><span class="chip">${esc(g.formats)}</span><span class="chip">API ${esc(g.api)}</span>${chip(g.confidence)}`)).join("") + `</div>`; | |
| h += note(B("<b>Aluka is the cautionary precedent.</b> It began as a freely accessible pan-African resource and is now a licensed JSTOR collection, so African institutions may need a subscription to reach material their own archives supplied. Design the licence before the scanning, not after.", | |
| "<b>Aluka est le précédent qui doit servir d'avertissement.</b> Née comme ressource panafricaine librement accessible, c'est aujourd'hui une collection JSTOR sous licence : des institutions africaines peuvent devoir s'abonner pour atteindre un matériel que leurs propres archives ont fourni. La licence se conçoit avant la numérisation, pas après.")); | |
| return h; | |
| } | |
| /* ------------------------------------------------------------ METHODS */ | |
| function vMethods(){ | |
| const nzero = COUNTRIES.filter(c => !c.searched).length; | |
| const nunk = T.filter(t => t.digitization_status==="unknown").length; | |
| const nund = T.filter(t => t.year==null).length; | |
| const wa = T.filter(t => t.region==="West Africa"), waA = wa.filter(t=>t.african_language).length, waEF = wa.filter(t=>["English","French"].includes(t.language)).length; | |
| let h = `<h2>${B("About this project","À propos de ce projet")}</h2>`; | |
| h += `<p>${B(`The <b>African Books Recovery Project</b> is a study led by <b>Prof. Sally Nuamah</b> (Northwestern University) to record the books written by African authors from the 1950s to today. This dashboard, developed by <b>Dr Ibrahima Diouf</b>, is its working instrument for the books published by presses based in Africa between ${S.y0} and ${S.y1}: it holds what has been located and measures how far each title still is from being a text a teacher can use. The collaboration began at the Rockefeller Foundation Bellagio Center in 2026.`, | |
| `Le <b>Projet de récupération du livre africain</b> est une étude dirigée par la <b>Pr Sally Nuamah</b> (Northwestern University) pour recenser les livres écrits par des auteurs africains depuis les années 1950. Ce tableau de bord, développé par le <b>Dr Ibrahima Diouf</b>, en est l'instrument de travail pour les livres publiés par des maisons établies en Afrique entre ${S.y0} et ${S.y1} : il rassemble ce qui a été localisé et mesure la distance qui sépare encore chaque titre d'un texte utilisable en classe. La collaboration a commencé au Bellagio Center de la Fondation Rockefeller en 2026.`)}</p>`; | |
| h += `<div class="team">` + card(B("Prof. Sally Nuamah, study lead","Pr Sally Nuamah, direction de l'étude"), | |
| B("Associate Professor of Human Development and Social Policy, Northwestern University","Professeure associée de développement humain et de politique sociale, Northwestern University"), | |
| B(`Her work at the Bellagio Center centres on translating indigenous archives in Ghana toward a publicly accessible curriculum on archival translation and knowledge preservation in West Africa. That meets this catalogue's largest gap: of ${wa.length} West African titles recorded here, ${waEF} are in English or French and ${waA} are in an African language.`, | |
| `Son travail au Bellagio Center porte sur la traduction d'archives autochtones au Ghana, vers un curriculum public sur la traduction d'archives et la conservation des savoirs en Afrique de l'Ouest. Il rejoint la plus grande lacune de ce catalogue : sur ${wa.length} titres ouest-africains ici recensés, ${waEF} sont en anglais ou en français et ${waA} dans une langue africaine.`), | |
| `<a href="https://sesp.northwestern.edu/people/faculty/sally-afia-nuamah.html" target="_blank" rel="noopener">Northwestern SESP</a> · <a href="https://www.sallynuamah.com/" target="_blank" rel="noopener">sallynuamah.com</a> · <a href="https://www.ipr.northwestern.edu/who-we-are/faculty-experts/nuamah.html" target="_blank" rel="noopener">Institute for Policy Research</a>`) | |
| + card(B("Dr Ibrahima Diouf, dashboard","Dr Ibrahima Diouf, tableau de bord"), | |
| B("Physicist, climate and health scientist · Faculty of Sciences and Techniques, University of Labé, Guinea · LPAO-SF, ESP, Cheikh Anta Diop University, Dakar · Rockefeller Foundation Bellagio Resident 2026","Physicien, chercheur climat et santé · Faculté des sciences et techniques, Université de Labé, Guinée · LPAO-SF, ESP, Université Cheikh Anta Diop de Dakar · Résident de la Fondation Rockefeller à Bellagio, 2026"), | |
| B("Built the catalogue pipeline, the governance checks and this dashboard: sourced research files, ETL, atlas, rights review and recovery-stage model.","A construit la chaîne du catalogue, les contrôles de gouvernance des données et ce tableau de bord : fichiers de recherche sourcés, ETL, atlas, revue juridique et modèle des étapes de récupération."), | |
| LINKS.map(([u,l]) => `<a href="${u}" target="_blank" rel="noopener">${l()}</a>`).join(" · ")) + `</div>`; | |
| h += `<div class="g2" style="margin-top:6px"><div><h3>${B("Sources, not partners","Des sources, pas des partenaires")}</h3><p>${B("The libraries, publishers and scholars cited in the catalogue are named as sources. None of them is a partner of the project unless this page says so.","Les bibliothèques, maisons d'édition et chercheurs cités dans le catalogue y sont nommés comme sources. Aucun n'est partenaire du projet sauf mention sur cette page.")}</p> | |
| <p>${B("The catalogue, the sourced research files and the code that builds them are all in this Space's repository, in one flat folder. Anyone can rebuild it, check it, or fork it.","Le catalogue, les fichiers de recherche sourcés et le code qui les produit sont tous dans le dépôt de ce Space, dans un seul dossier plat. N'importe qui peut le reconstruire, le vérifier ou le reprendre.")}</p> | |
| <p><b>${B("To get in touch or contribute a record:","Pour écrire ou proposer une notice :")}</b> ${B(`open a thread in the <a href="${SPACE_URL}/discussions" target="_blank" rel="noopener">Community tab of this Space</a>.`,`ouvrez un fil dans <a href="${SPACE_URL}/discussions" target="_blank" rel="noopener">l'onglet Community de ce Space</a>.`)}</p></div> | |
| <div><h3>${B("What would help most","Ce qui aiderait le plus")}</h3><ul class="plain">${B(`A shelf list of Bureau of Ghana Languages output|Authors' dates of death: they unlock stage 3|Verified scan status for the ${nunk} unchecked titles|Any imprint from the ${nzero} countries with no record`,`Un inventaire du fonds du Bureau of Ghana Languages|Les dates de décès des auteurs : elles débloquent l'étape 3|L'état de numérisation des ${nunk} titres non vérifiés|Toute impression des ${nzero} pays sans aucune notice`).split("|").map(x=>`<li>${x}</li>`).join("")}</ul></div></div>`; | |
| h += `<h3>${B("How to cite","Comment citer")}</h3><pre class="cite">African Books Recovery Project (2026). Books by African authors published by African presses, c. ${S.y0}-${S.y1} [dataset and dashboard]. Study led by S. Nuamah; dashboard by I. Diouf. CC BY 4.0. ${SPACE_URL}</pre>`; | |
| h += card("Melville J. Herskovits Library of African Studies", "Northwestern University, Evanston", | |
| B("The largest separate Africana collection in the world, and the first stop for verifying an imprint that appears nowhere else. It also sits on one side of this project's central asymmetry: the best-preserved holdings of African-published books are in Evanston, Bloomington, Lawrence, London and Chicago, while the channels inside Africa remain unsurveyed.", | |
| "La plus grande collection africaniste distincte au monde, et le premier recours pour vérifier une impression qui n'apparaît nulle part ailleurs. Elle se trouve aussi d'un côté de l'asymétrie centrale de ce projet : les fonds les mieux conservés de livres publiés en Afrique sont à Evanston, Bloomington, Lawrence, Londres et Chicago, tandis que les pistes africaines restent non recensées."), | |
| B("Listed in the Copies tab as a search channel.","Inscrite comme piste de recherche dans l'onglet Exemplaires.")); | |
| h += `<h2>${B("How this catalogue was built, and what it is not","Comment ce catalogue fut construit, et ce qu'il n'est pas")}</h2><p>${B("A recovery project is only as good as its willingness to say what it does not know. These are the rules the data follows, all of them enforced in <code>build_data.py</code> and checked in <code>selftest.py</code>, which refuses to pass a dashboard that overstates its evidence.","Un projet de récupération ne vaut que par sa capacité à dire ce qu'il ignore. Voici les règles que suivent les données, toutes appliquées dans <code>build_data.py</code> et vérifiées par <code>selftest.py</code>, qui refuse de valider un tableau de bord qui exagérerait ses preuves.")}</p>`; | |
| const RULES = [ | |
| ["Every record carries its sources","Chaque notice porte ses sources","A record with no citable source is dropped at build time. Source URLs travel with the row into the CSV export.","Une notice sans source citable est écartée à la construction. Les URL des sources voyagent avec la ligne jusqu'à l'export CSV."], | |
| ["Nothing is estimated","Rien n'est estimé",`${nund} titles have no year. They are shown as undated rather than given a plausible decade. Library conjecture dates, the bracketed [1964?] of the Onitsha records, are recorded at medium confidence and flagged in the note.`,`${nund} titres n'ont pas d'année. Ils sont affichés comme non datés plutôt que rattachés à une décennie plausible. Les dates conjecturales des bibliothèques, les [1964?] des notices d'Onitsha, sont enregistrées en fiabilité moyenne et signalées dans la note.`], | |
| ["Confidence is always visible","La fiabilité est toujours affichée","High means a library or publisher catalogue record. Medium means a scholarly source or a dealer listing transcribed from a title page. Low means a single unconfirmed mention and should be treated as a lead.","Élevée : une notice de catalogue de bibliothèque ou d'éditeur. Moyenne : une source savante ou une annonce de libraire transcrite d'une page de titre. Faible : une seule mention non confirmée, à traiter comme une piste."], | |
| ["Out of print is never rendered as out of copyright","« Épuisé » n'est jamais rendu par « libre de droits »","They are separate fields, computed separately, and the Rights tab carries the warning on every view.","Ce sont deux champs distincts, calculés séparément, et l'onglet Droits porte l'avertissement à chaque affichage."], | |
| ["Presses outside Africa are flagged, not hidden","Les maisons hors d'Afrique sont signalées, pas cachées","Présence Africaine, Éditions Nubia and the Casa dos Estudantes do Império were African-founded and African-directed but printed in Paris and Lisbon. Excluding them would falsify the intellectual history; including them silently would falsify the geography.","Présence Africaine, les Éditions Nubia et la Casa dos Estudantes do Império furent fondées et dirigées par des Africains, mais imprimaient à Paris et à Lisbonne. Les exclure fausserait l'histoire intellectuelle ; les inclure en silence fausserait la géographie."], | |
| ["Grey is never zero","Le gris n'est jamais zéro","On every map, a country with no record is grey and the subtitle counts them. Nothing is interpolated from a neighbour.","Sur chaque carte, un pays sans notice est gris et le sous-titre les dénombre. Rien n'est interpolé depuis un voisin."], | |
| ["City coordinates are a cartographic aid, not a record","Les coordonnées de villes sont une aide cartographique, pas une notice","The dots on the atlas come from a public gazetteer declared in villes.json, where every city spelling variant found in the sources is normalised in the open.","Les points de l'atlas viennent d'un répertoire géographique public déclaré dans villes.json, où chaque variante d'orthographe trouvée dans les sources est normalisée à découvert."], | |
| ["Derived fields are computed, never hand-entered","Les champs dérivés sont calculés, jamais saisis","Region, decade, genre grouping, recovery stage, pilot cluster and city normalisation all come out of build_data.py and can be recomputed from the source JSON.","Région, décennie, regroupement de genres, étape de récupération, groupe pilote et normalisation des villes sortent tous de build_data.py et sont recalculables depuis le JSON source."], | |
| ]; | |
| h += `<div class="cards2">${RULES.map(r => card(B(r[0],r[1]), "", B(r[2],r[3]))).join("")}</div>`; | |
| const nh = T.filter(t=>t.provenance==="harvested").length; | |
| h += `<h2>${B("Two tiers, kept apart","Deux niveaux, jamais mêlés")}</h2><p>${B(`The catalogue holds <b>${nf(T.length-nh)} hand-verified records</b> and <b>${nf(nh)} harvested leads</b>. A verified record was established by a person against a library or publisher catalogue. A harvested lead is returned by a machine query (Wikidata, OpenLibrary, BnF, Library of Congress), carries the exact URL of that query, enters at low confidence and can never reach high: only a person can do that. A lead that duplicates a verified record is discarded at build time.`, | |
| `Le catalogue contient <b>${nf(T.length-nh)} notices vérifiées à la main</b> et <b>${nf(nh)} pistes moissonnées</b>. Une notice vérifiée a été établie par une personne contre un catalogue de bibliothèque ou d'éditeur. Une piste moissonnée est renvoyée par une requête automatique (Wikidata, OpenLibrary, BnF, Library of Congress), porte l'URL exacte de cette requête, entre en fiabilité faible et ne peut jamais atteindre élevée : cela, seule une personne le fait. Une piste qui double une notice vérifiée est écartée à la construction.`)}</p>`; | |
| const GAPS = [ | |
| ["Half the continent has not been searched","La moitié du continent n'a pas été explorée",`${nzero} of the 54 African countries carry no record. Nigeria, Ghana, East Africa, Francophone Africa and Southern Africa were researched in depth; North Africa, the Horn, Lusophone Africa and the Indian Ocean were not.`,`${nzero} des 54 pays africains ne portent aucune notice. Le Nigéria, le Ghana, l'Afrique de l'Est, l'Afrique francophone et l'Afrique australe ont été étudiés en profondeur ; l'Afrique du Nord, la Corne, l'Afrique lusophone et l'océan Indien ne l'ont pas été.`], | |
| ["Northern Nigerian and Hausa publishing is the thinnest major gap","L'édition du Nord-Nigéria et en haoussa est la plus grande lacune",`${T.filter(t=>t.language==="Hausa").length} Hausa titles stand in for the output of the Gaskiya Corporation and the Northern Nigerian Publishing Company.`,`${T.filter(t=>t.language==="Hausa").length} titres en haoussa tiennent lieu de toute la production de la Gaskiya Corporation et de la Northern Nigerian Publishing Company.`], | |
| ["Ghanaian-language publishing is barely represented","L'édition en langues ghanéennes est à peine représentée","The Bureau of Ghana Languages published in eleven languages from 1951 and only one in-period imprint could be verified online. It needs on-site work.","Le Bureau of Ghana Languages a publié en onze langues à partir de 1951 et une seule impression de la période a pu être vérifiée en ligne. Il exige un travail sur place."], | |
| ["Scan status is mostly unverified","L'état de numérisation est peu vérifié",`${nunk} titles have no checked digitization status. That is a research task not yet done, not a finding that no scan exists.`,`${nunk} titres n'ont pas d'état de numérisation vérifié. C'est une tâche de recherche non faite, pas un constat d'absence de numérisation.`], | |
| ["Author dates are absent","Les dates des auteurs manquent","No copyright calculation here is applied to a specific author, because the catalogue does not yet hold dates of death. That field is the single highest-value addition to the next pass.","Aucun calcul de droits n'est ici appliqué à un auteur précis, car le catalogue ne contient pas encore les dates de décès. C'est l'ajout le plus précieux de la prochaine passe."], | |
| ["Dealer listings underpin a meaningful minority of records","Les annonces de libraires fondent une minorité notable de notices","Booksellers transcribe title pages, so publisher and place are usually sound, but years get mis-keyed. These rows are capped at medium confidence.","Les libraires transcrivent les pages de titre : éditeur et lieu sont donc généralement fiables, mais les années sont souvent mal saisies. Ces lignes sont plafonnées en fiabilité moyenne."], | |
| ]; | |
| h += `<h2>${B("Known gaps","Lacunes connues")}</h2><div class="cards2">${GAPS.map(r => card(B(r[0],r[1]), "", B(r[2],r[3]))).join("")}</div>`; | |
| h += `<h2>${B("Sources and reference tools","Sources et instruments de référence")}</h2><p>${B("The catalogue was assembled from library digital collections (the University of Kansas Onitsha Market Literature collection, Indiana, Yale, the Center for Research Libraries, SOAS), the BnF <i>Catalogue général</i> SRU API for francophone imprints, publisher histories, scholarly work on African publishing, national bibliographies and antiquarian listings. Rights information comes from national statutes via WIPO Lex, cited per jurisdiction. Country outlines are Natural Earth 1:50m (public domain).", | |
| "Le catalogue a été constitué à partir de collections numériques de bibliothèques (fonds Onitsha Market Literature de l'université du Kansas, Indiana, Yale, Center for Research Libraries, SOAS), de l'API SRU du <i>Catalogue général</i> de la BnF pour les impressions francophones, d'histoires d'éditeurs, de travaux savants sur l'édition africaine, de bibliographies nationales et d'annonces de libraires. L'information juridique provient des lois nationales via WIPO Lex, citée par juridiction. Les contours sont ceux de Natural Earth 1:50m (domaine public).")}</p> | |
| <p>${B("Next instruments to build on: the historical volumes of the <b>African Book Publishing Record</b>, the <b>national bibliographies</b> of Nigeria, Ghana, Kenya and Tanzania, <b>publishers' own catalogues</b>, and <b>Hans Zell's bibliographic research</b>.","Les instruments sur lesquels bâtir la suite : les volumes historiques de l'<b>African Book Publishing Record</b>, les <b>bibliographies nationales</b> du Nigéria, du Ghana, du Kenya et de la Tanzanie, les <b>catalogues des éditeurs eux-mêmes</b>, et les <b>travaux bibliographiques de Hans Zell</b>.")}</p>`; | |
| h += `<h2>${B("The data","Les données")}</h2><p class="links">${[["titles.csv",B("Full catalogue","Catalogue complet")],["presses.csv",B("Press register","Registre des maisons")],["countries.csv",B("Country coverage","Couverture par pays")],["rights.csv",B("Rights by jurisdiction","Droits par juridiction")],["holdings.csv",B("Search channels","Pistes de recherche")],["digitization.csv",B("Digitization initiatives","Initiatives de numérisation")]].map(([f,l]) => `<a href="${f}" download>${l} (CSV) ↓</a>`).join("")}</p> | |
| <p class="cap">${B(`Open data under CC BY 4.0. Rebuild with <code>python build_data.py</code>, then check with <code>python selftest.py</code>. Data built on ${D.built}.`,`Données ouvertes sous licence CC BY 4.0. Reconstruire avec <code>python build_data.py</code>, puis vérifier avec <code>python selftest.py</code>. Données construites le ${D.built}.`)}</p>`; | |
| return h; | |
| } | |
| /* ------------------------------------------------------------ footer & render */ | |
| function renderFooter(){ | |
| document.getElementById("foot").innerHTML = `<div>${B("African Books Recovery Project · study led by Prof. Sally Nuamah (Northwestern University) · dashboard by Dr Ibrahima Diouf (FST, University of Labé, Guinea; LPAO-SF, ESP, Cheikh Anta Diop University, Dakar) · every record carries its sources and a confidence flag · rights information describes published statutes and is not legal advice · country outlines Natural Earth 1:50m · CC BY 4.0", | |
| "Projet de récupération du livre africain · étude dirigée par la Pr Sally Nuamah (Northwestern University) · tableau de bord : Dr Ibrahima Diouf (FST, Université de Labé, Guinée ; LPAO-SF, ESP, Université Cheikh Anta Diop de Dakar) · chaque notice porte ses sources et un indice de fiabilité · l'information juridique décrit des textes publiés et ne vaut pas conseil juridique · contours Natural Earth 1:50m · CC BY 4.0")}</div><div class="links">${LINKS.map(([u,l]) => `<a href="${u}" target="_blank" rel="noopener">${l()} ↗</a>`).join("")}</div>`; | |
| } | |
| const VIEWS = {overview:vOverview, atlas:vAtlas, presses:vPresses, catalogue:vCatalogue, recovery:vRecovery, rights:vRights, copies:vCopies, methods:vMethods}; | |
| function renderMain(){ | |
| const m = document.getElementById("main"); | |
| m.innerHTML = VIEWS[S.tab](); | |
| bindLocal(); | |
| } | |
| function bindLocal(){ | |
| const y = document.getElementById("pdy"), yr = document.getElementById("pdyr"); | |
| const setY = v => { v = parseInt(v,10); if(!isFinite(v)) return; S.pdY = Math.max(1850, Math.min(YEAR_NOW, v)); renderMain(); }; | |
| if(y) y.addEventListener("change", e => setY(e.target.value)); | |
| if(yr) yr.addEventListener("input", e => setY(e.target.value)); | |
| const mb = document.getElementById("mapbox"); | |
| if(mb){ | |
| const hov = e => { | |
| const c = e.target.closest("[data-c]"), ci = e.target.closest("[data-city]"); | |
| const key = ci ? "city:"+ci.dataset.city : c ? c.dataset.c : null; | |
| if(key && key!==S.mapSelHover){ S.mapSelHover = key; const keep = S.mapSel; S.mapSel = key; document.getElementById("mapinfo").innerHTML = mapInfo(currentValues(), currentRank()); S.mapSel = keep; } | |
| }; | |
| mb.addEventListener("mousemove", hov); | |
| mb.addEventListener("click", e => { | |
| const c = e.target.closest("[data-c]"), ci = e.target.closest("[data-city]"); | |
| S.mapSel = ci ? "city:"+ci.dataset.city : c ? c.dataset.c : null; | |
| mb.querySelectorAll(".cty.sel").forEach(p => p.classList.remove("sel")); | |
| if(c && !ci) c.classList.add("sel"); | |
| document.getElementById("mapinfo").innerHTML = mapInfo(currentValues(), currentRank()); | |
| }); | |
| } | |
| } | |
| function currentValues(){ | |
| const v = {}, TF = tf(), PF = pf(); | |
| const src = S.measure==="presses" ? count(PF,"map_country") : count(S.measure==="preserved" ? TF.filter(t=>t.stage2_preserved) : TF, "map_country"); | |
| src.forEach((n,k) => v[k] = n); return v; | |
| } | |
| function currentRank(){ return Object.entries(currentValues()).filter(([k,v]) => v>0 && MAP.countries[k]).sort((a,b)=>b[1]-a[1]); } | |
| function renderAll(){ renderHeader(); renderFilters(true); renderMain(); } | |
| document.addEventListener("click", e => { | |
| const el = e.target.closest("[data-act]"); if(!el) return; | |
| const a = el.dataset.act, i = a.indexOf(":"), k = i<0 ? a : a.slice(0,i), v = i<0 ? "" : a.slice(i+1); | |
| if(e.target.closest("a")) return; | |
| switch(k){ | |
| case "lang": S.lang = v; ls("abrp_lang", v); renderAll(); return; | |
| case "toggletheme": S.theme = S.theme==="dark" ? "light" : "dark"; ls("abrp_theme", S.theme); renderHeader(); renderMain(); return; | |
| case "theme": S.theme = v; ls("abrp_theme", v); renderHeader(); renderMain(); return; | |
| case "tab": S.tab = v; history.replaceState(null, "", "#"+v); renderHeader(); renderFilters(true); renderMain(); window.scrollTo({top: 0}); return; | |
| case "f": { const [g, val] = [v.slice(0, v.indexOf(":")), v.slice(v.indexOf(":")+1)]; const s = S.f[g]; s.has(val) ? s.delete(val) : s.add(val); S.catPage = 0; S.pressN = 30; renderFilters(false); renderMain(); return; } | |
| case "fclear": Object.values(S.f).forEach(s => s.clear()); S.q = ""; const q = document.getElementById("q"); if(q) q.value = ""; renderFilters(false); renderMain(); return; | |
| case "measure": S.measure = v; S.mapSel = null; renderMain(); return; | |
| case "psort": S.pressSort = +v; renderMain(); return; | |
| case "pmore": S.pressN += 30; renderMain(); return; | |
| case "csort": S.catSort = S.catSort.k===v ? {k:v, d:-S.catSort.d} : {k:v, d:1}; S.catPage = 0; renderMain(); return; | |
| case "cpage": S.catPage = +v; renderMain(); document.querySelector(".tbl")?.scrollIntoView({block:"start"}); return; | |
| case "dossier": S.dossier = (v && S.dossier!==v) ? v : null; renderMain(); return; | |
| case "dlsel": csvDownload(tf(), Object.keys(T[0]), "abrp_selection.csv"); return; | |
| case "pilot": S.pilot = v; renderMain(); return; | |
| case "pdc": S.pdC = v; renderMain(); return; | |
| case "pdy": S.pdY = Math.max(1850, Math.min(YEAR_NOW, S.pdY + (+v))); renderMain(); return; | |
| case "hold": S.holdOu = v; renderMain(); return; | |
| } | |
| }); | |
| let rt; window.addEventListener("resize", () => { clearTimeout(rt); rt = setTimeout(() => { if(S.tab==="atlas") renderMain(); }, 250); }); | |
| window.addEventListener("hashchange", () => { const h = location.hash.slice(1); if(TABS.includes(h) && h!==S.tab){ S.tab = h; renderHeader(); renderFilters(true); renderMain(); } }); | |
| renderAll(); | |
| </script> | |
| </body> | |
| </html> | |