put all events into one source file

This commit is contained in:
tree🌴 2023-11-05 21:36:11 +01:00
parent 643be5020e
commit 390768c477
5 changed files with 33 additions and 25 deletions

View file

@ -27,7 +27,7 @@ research and community of [Web3Privacy Now](https://web3privacy.info).
| # id | date | location | 👥 | coincidence | dri | links | | # id | date | location | 👥 | coincidence | dri | links |
| --- | --- | --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- | --- | --- |
<% it.events.summits.forEach(function(event, i){ %> <% it.events.filter(e => e.type === 'summit').forEach(function(event, i){ %>
| #<%= i+1%> → `<%= event.id %>` | <%= event.date.match(/^\d{4}-\d{2}-\d{2}$/) ? `**${event.date}**` : event.date %> | <%= it.getFlagEmoji(event.country) %> <%= event.city %> | <%= event.visitors || '-' %> | <%= event.coincidence %> | <%= event.lead || "-" %> | <%= (event.links && Object.keys(event.links).map(k => `[${k}](${event.links[k]})`).join(", ")) || "" %> | | #<%= i+1%> → `<%= event.id %>` | <%= event.date.match(/^\d{4}-\d{2}-\d{2}$/) ? `**${event.date}**` : event.date %> | <%= it.getFlagEmoji(event.country) %> <%= event.city %> | <%= event.visitors || '-' %> | <%= event.coincidence %> | <%= event.lead || "-" %> | <%= (event.links && Object.keys(event.links).map(k => `[${k}](${event.links[k]})`).join(", ")) || "" %> |
<% }) %> <% }) %>
@ -35,7 +35,7 @@ research and community of [Web3Privacy Now](https://web3privacy.info).
| # id | date | location | 👥 | coincidence | dri | links | | # id | date | location | 👥 | coincidence | dri | links |
| --- | --- | --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- | --- | --- |
<% it.events.meetups.forEach(function(event, i){ %> <% it.events.filter(e => e.type === 'meetup').forEach(function(event, i){ %>
| <% if (event.links?.git) { %>[`<%= event.id %>`](<%= event.links.git %>)<% } else { %>`<%= event.id.replace('w3pm-','') %>`<% } %> | <%= event.date.match(/^\d{4}-\d{2}-\d{2}$/) ? `**${event.date}**` : event.date %> | <%= it.getFlagEmoji(event.country) %> <%= event.city %> | <%= event.visitors || '-' %> | <%= event.coincidence %> | <%= event.lead || "-" %> | <%= (event.links && Object.keys(event.links).map(k => `[${k}](${event.links[k]})`).join(", ")) || "" %> | | <% if (event.links?.git) { %>[`<%= event.id %>`](<%= event.links.git %>)<% } else { %>`<%= event.id.replace('w3pm-','') %>`<% } %> | <%= event.date.match(/^\d{4}-\d{2}-\d{2}$/) ? `**${event.date}**` : event.date %> | <%= it.getFlagEmoji(event.country) %> <%= event.city %> | <%= event.visitors || '-' %> | <%= event.coincidence %> | <%= event.lead || "-" %> | <%= (event.links && Object.keys(event.links).map(k => `[${k}](${event.links[k]})`).join(", ")) || "" %> |
<% }) %> <% }) %>

View file

@ -1,4 +1,17 @@
- id: w3ps1
type: summit
date: "2023-06-05"
city: Prague
country: cz
coincidence: "[PBW](https://prgblockweek.com/) w/ [ETHPrague](https://ethprague.com/)"
lead: Tree
visitors: 180
links:
web: https://prague.web3privacy.info/
git: https://github.com/web3privacy/w3ps1
- id: w3pm-rom-1 - id: w3pm-rom-1
type: meetup
date: "2023-10-05" date: "2023-10-05"
city: Rome city: Rome
country: it country: it
@ -9,6 +22,7 @@
web: https://lu.ma/web3privacynow_rome web: https://lu.ma/web3privacynow_rome
- id: w3pm-prg-1 - id: w3pm-prg-1
type: meetup
date: "2023-11-14" date: "2023-11-14"
city: Prague city: Prague
country: cz country: cz
@ -18,12 +32,14 @@
web: https://lu.ma/w3pm-prg1 web: https://lu.ma/w3pm-prg1
- id: w3pm-ist-1 - id: w3pm-ist-1
type: meetup
date: "2023/Nov" date: "2023/Nov"
city: Istanbul city: Istanbul
country: tr country: tr
coincidence: "[Devconnect Istanbul](https://devconnect.org/)" coincidence: "[Devconnect Istanbul](https://devconnect.org/)"
- id: w3pm-ams-1 - id: w3pm-ams-1
type: meetup
date: "2024/May" date: "2024/May"
city: Amsterdam city: Amsterdam
country: nl country: nl
@ -31,6 +47,7 @@
coincidence: "[ETHDam 2024](https://www.ethdam.com/)" coincidence: "[ETHDam 2024](https://www.ethdam.com/)"
- id: w3pm-ber-1 - id: w3pm-ber-1
type: meetup
date: "2024/May" date: "2024/May"
city: Berlin city: Berlin
country: de country: de

View file

@ -1,10 +0,0 @@
- id: w3ps1
date: "2023-06-05"
city: Prague
country: cz
coincidence: "[PBW](https://prgblockweek.com/) w/ [ETHPrague](https://ethprague.com/)"
lead: Tree
visitors: 180
links:
web: https://prague.web3privacy.info/
git: https://github.com/web3privacy/w3ps1

View file

@ -24,10 +24,11 @@ async function test() {
const schema = await _loadYaml("./schema.yaml"); const schema = await _loadYaml("./schema.yaml");
const validator = ajv.compile(schema); const validator = ajv.compile(schema);
for (const type of types) { const list = await _loadYaml(`./events/events.yaml`);
Deno.test(`Check schema: ${type}`, async () => {
const list = await _loadYaml(`./events/${type}.yaml`); for (const item of list) {
if (!validator(list)) { Deno.test(`${item.id}`, async () => {
if (!validator(item)) {
throw validator.errors; throw validator.errors;
} }
}); });
@ -35,14 +36,10 @@ async function test() {
} }
async function build() { async function build() {
const output = {}; const list = await _loadYaml(`./events/events.yaml`);
for (const type of types) {
const list = await _loadYaml(`./events/${type}.yaml`);
output[type] = list;
}
await emptyDir("./dist"); await emptyDir("./dist");
const fn = "./dist/index.json"; const fn = "./dist/index.json";
await Deno.writeTextFile(fn, JSON.stringify(output, 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"
@ -55,7 +52,7 @@ EDIT "./README.tpl.eta" INSTEAD
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-->` -->`
await Deno.writeTextFile(readmeFn, warning + "\n\n" + eta.render("./README.tpl.eta", { events: output, getFlagEmoji })) await Deno.writeTextFile(readmeFn, warning + "\n\n" + eta.render("./README.tpl.eta", { events: list, getFlagEmoji }))
console.log(`File saved: `, readmeFn); console.log(`File saved: `, readmeFn);
} }

View file

@ -1,5 +1,4 @@
type: array $ref: "#/$defs/event"
items: { "$ref": "#/$defs/event" }
$defs: $defs:
event: event:
type: object type: object
@ -12,6 +11,11 @@ $defs:
properties: properties:
id: id:
type: string type: string
type:
type: string
enum:
- summit
- meetup
date: date:
type: string type: string
city: city: