(pl)(census) raport 2024 WIP

This commit is contained in:
Andrea Vos 2024-03-05 16:29:20 +01:00
parent 5ee28261a1
commit 67bf60bd88
6 changed files with 1095 additions and 15 deletions

View File

@ -283,8 +283,8 @@ if __name__ == '__main__':
},
'by_age': {
'general': 'Ogół',
'younger': 'Młodsze',
'older': 'Starsze',
'younger': 'Grupa młodsza',
'older': 'Grupa starsza',
},
}

1080
locale/pl/blog/spis-2024.md Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 KiB

After

Width:  |  Height:  |  Size: 352 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 247 KiB

After

Width:  |  Height:  |  Size: 359 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

View File

@ -1,17 +1,6 @@
// TODO make generic
const census_groups = {
location_poland: 'Osoby mieszkające w Polsce',
location_abroad: 'Osoby mieszkające za granicą',
agab_f: 'Osoby o płci przypisanej przy urodzeniu żeńskiej',
agab_m: 'Osoby o płci przypisanej przy urodzeniu męskiej',
};
const census_comparisons = {
by_location: 'Podział ze względu na miejsce zamieszkania',
by_agab: 'Podział ze względu na płeć przypisaną przy urodzeniu',
};
let jsons = undefined;
let census_groups = {};
let census_comparisons = {};
const mainPlusDetails = (dict, wide) => (_, content) => {
return `
@ -130,8 +119,19 @@ export default async function parseMarkdown(markdown, translator) {
.replace(/{favicon=(.+?)}/g, '<img src="https://$1" alt="Favicon" style="width: 1em; height: 1em;"/>')
.replace(/{embed=\/\/(.+?)=(.+?)}/g, '<div style="position: relative;height: 0;padding-bottom: 56.25%;"><iframe src="https://$1" title="$2" allowfullscreen sandbox="allow-same-origin allow-scripts allow-popups" style="position: absolute;top: 0; left: 0;width: 100%;height: 100%;border:0;"></iframe></div>')
.replace(/{graph=([^}]+)}/g, '<iframe class="graph" src="$1.html" loading="lazy"></iframe>')
.replace(/<p>{set_census_groups=(.+?)}<\/p>/gms, (_, value) => {
census_groups = JSON.parse(value.replace(/&quot;/g, '"'));
return '';
})
.replace(/<p>{set_census_comparisons=(.+?)}<\/p>/gms, (_, value) => {
census_comparisons = JSON.parse(value.replace(/&quot;/g, '"'));
return '';
})
.replace(/<p>{census_groups}<\/p>(.+?)<p>{\/census_groups}<\/p>/gms, mainPlusDetails(census_groups, false))
.replace(/<p>{census_comparisons}<\/p>(.+?)<p>{\/census_comparisons}<\/p>/gms, mainPlusDetails(census_comparisons, true))
.replace(/{json=([^=}]+)=([^=}]+)}/g, fetchJson)
.replace(/<h1 id="🏳️🌈-/g, '<h1 id="') // license header
.replace(/{wide_table}/g, '<div class="table-wide table-responsive my-5 headers-nowrap">')