This commit is contained in:
tree🌴 2023-11-21 09:20:41 +01:00
parent 78f4787f98
commit f6457de2e3
4 changed files with 18 additions and 13 deletions

View file

@ -45,7 +45,7 @@ research and community of [Web3Privacy Now](https://web3privacy.info).
| meetup | `por1`* | 2024/May | 🇵🇹 Porto | 3 | [ETHPorto](https://ethporto.org/) | - | | | meetup | `por1`* | 2024/May | 🇵🇹 Porto | 3 | [ETHPorto](https://ethporto.org/) | - | |
| meetup | `ber1` | 2024/May | 🇩🇪 Berlin | 3 | ETHBerlin 4 | Tree | | | meetup | `ber1` | 2024/May | 🇩🇪 Berlin | 3 | ETHBerlin 4 | Tree | |
| summit | `s3` | 2024/Jun | 🇨🇿 Prague | 16 | ETHPrague 2024 | Tree (+3) | | | summit | `s3` | 2024/Jun | 🇨🇿 Prague | 16 | ETHPrague 2024 | Tree (+3) | |
| hackathon | `h1` | 2024/Jun | 🇸🇮 Bled | 10 | | Tree (+3) | | | hackathon | `h1` | **2024-06-19** - 2024-06-26 (7) | 🇸🇮 Bled | 10 | | Tree (+3) | |
| meetup | `lju1` | 2024/Jun | 🇸🇮 Ljubljana | 5 | W3PN Hackathon | Tree (+3) | | | meetup | `lju1` | 2024/Jun | 🇸🇮 Ljubljana | 5 | W3PN Hackathon | Tree (+3) | |
| meetup | `bcn2`* | 2024/Jul | 🇪🇸 Barcelona | 3 | ETHBarcelona (?) | - | | | meetup | `bcn2`* | 2024/Jul | 🇪🇸 Barcelona | 3 | ETHBarcelona (?) | - | |
| meetup | `bru1` | 2024/Jul | 🇧🇪 Brussels | 3 | [EthCC 7](https://www.ethcc.io/) | Mykola (+1) | | | meetup | `bru1` | 2024/Jul | 🇧🇪 Brussels | 3 | [EthCC 7](https://www.ethcc.io/) | Mykola (+1) | |

View file

@ -27,7 +27,7 @@ research and community of [Web3Privacy Now](https://web3privacy.info).
| type | # id | date | location | 🎰 | coincidence | dri | links | | type | # id | date | location | 🎰 | coincidence | dri | links |
| --- | --- | --- | --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- | --- | --- | --- |
<% it.events.forEach(function(event, i){ %> <% it.events.forEach(function(event, i){ %>
| <%= event.type %> | `<%= event.id.replace("w3pm-", "").replace(/^w3p/, '') %>`<% if (event.optional) { %>*<% } %> | <%= event.date.match(/^\d{4}-\d{2}-\d{2}$/) ? `**${event.date}**` : event.date %> | <%= it.getFlagEmoji(event.country) %> <%= event.city %> | <%= event.slots || '-' %> | <%= event.coincidence %> | <%= event.lead || "-" %><% if (event.helpers && event.helpers.length > 0) { %> (+<%= event.helpers.length%>)<% } %> | <%= (event.links && Object.keys(event.links).map(k => `[${k}](${event.links[k]})`).join(", ")) || "" %> | | <%= event.type %> | `<%= event.id.replace("w3pm-", "").replace(/^w3p/, '') %>`<% if (event.optional) { %>*<% } %> | <%= event.date.match(/^\d{4}-\d{2}-\d{2}$/) ? `**${event.date}**` : event.date %><% if (event.days && event.days > 1) { %> - <%= it.dateFns.format(it.dateFns.addDays(new Date(event.date), event.days), 'yyyy-MM-dd') %> (<%= event.days %>)<% } %> | <%= it.getFlagEmoji(event.country) %> <%= event.city %> | <%= event.slots || '-' %> | <%= event.coincidence %> | <%= event.lead || "-" %><% if (event.helpers && event.helpers.length > 0) { %> (+<%= event.helpers.length%>)<% } %> | <%= (event.links && Object.keys(event.links).map(k => `[${k}](${event.links[k]})`).join(", ")) || "" %> |
<% }) %> <% }) %>
`*` - Optional event (can be cancelled due to lack of interest) `*` - Optional event (can be cancelled due to lack of interest)

View file

@ -135,7 +135,7 @@
- id: w3ph1 - id: w3ph1
type: hackathon type: hackathon
date: "2024/Jun" date: "2024-06-19"
days: 7 days: 7
city: Bled city: Bled
country: si country: si

View file

@ -2,18 +2,19 @@ import Ajv from "npm:ajv@8.8.2";
import addFormats from "npm:ajv-formats@2.1.1"; import addFormats from "npm:ajv-formats@2.1.1";
import { load as yamlLoad } from "https://deno.land/x/js_yaml_port@3.14.0/js-yaml.js"; import { load as yamlLoad } from "https://deno.land/x/js_yaml_port@3.14.0/js-yaml.js";
import { emptyDir } from "https://deno.land/std@0.173.0/fs/mod.ts"; import { emptyDir } from "https://deno.land/std@0.173.0/fs/mod.ts";
import { Eta } from "https://deno.land/x/eta@v3.0.3/src/index.ts" import { Eta } from "https://deno.land/x/eta@v3.0.3/src/index.ts";
import * as dateFns from "npm:date-fns";
async function _loadYaml(fn) { async function _loadYaml(fn) {
return yamlLoad(await Deno.readTextFile(fn)); return yamlLoad(await Deno.readTextFile(fn));
} }
function getFlagEmoji(countryCode) { function getFlagEmoji(countryCode) {
if (countryCode === 'xx') return "🏴‍☠️"; if (countryCode === "xx") return "🏴‍☠️";
const codePoints = countryCode const codePoints = countryCode
.toUpperCase() .toUpperCase()
.split('') .split("")
.map(char => 127397 + char.charCodeAt()); .map((char) => 127397 + char.charCodeAt());
return String.fromCodePoint(...codePoints); return String.fromCodePoint(...codePoints);
} }
@ -32,10 +33,10 @@ async function test() {
throw validator.errors; throw validator.errors;
} }
if (ids.includes(item.id)) { if (ids.includes(item.id)) {
throw `ID exists: ${item.id}` throw `ID exists: ${item.id}`;
} }
ids.push(item.id) ids.push(item.id);
}); });
} }
} }
@ -47,17 +48,21 @@ async function build() {
await Deno.writeTextFile(fn, JSON.stringify(list, null, 2)); await Deno.writeTextFile(fn, JSON.stringify(list, null, 2));
console.log(`File saved: `, fn); console.log(`File saved: `, fn);
const readmeFn = "./README.md" const readmeFn = "./README.md";
const eta = new Eta({ views: "./" }) const eta = new Eta({ views: "./" });
//console.log(output) //console.log(output)
const warning = `<!-- const warning = `<!--
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
DO NOT EDIT THIS FILE DIRECLY DO NOT EDIT THIS FILE DIRECLY
EDIT "./README.tpl.eta" INSTEAD EDIT "./README.tpl.eta" INSTEAD
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-->` -->`;
await Deno.writeTextFile(readmeFn, warning + "\n\n" + eta.render("./README.tpl.eta", { events: list, getFlagEmoji })) await Deno.writeTextFile(
readmeFn,
warning + "\n\n" +
eta.render("./README.tpl.eta", { events: list, getFlagEmoji, dateFns }),
);
console.log(`File saved: `, readmeFn); console.log(`File saved: `, readmeFn);
} }