create generation of README based on JSON data of people

This commit is contained in:
Frédéric Harper
2022-04-21 12:58:30 -04:00
parent 14744f468a
commit da26eb215b
3 changed files with 64 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
# Coffee Chat
List of awesome people offering their time **for free** to have a "coffee chat" with others about different topics, mostly in a mentorship kind of way.
PLACEHOLDER
## Add yourself to this list
To add your name to this list, you simply need to add another person object in [people.json](people.json). You can simply copy someone else, and change the information. If you don't want to share a piece of information, just leave the value of the field empty. Once done, please do a pull request. If you have no idea how all this works, you can simply send me your information by [email](mailto:hi@fred.dev), and I'll add you to the list myself with pleasure.
⚠️ **Warning**: only add yourself to this list!
## Remove yourself from this list
Simply create a pull request by removing your people definition from [people.json](people.json). As for adding yourself to the list if you are not a technical person, just send me an [email](mailto:hi@fred.dev) and I'll do it for you.
## Future plans
I put this up quickly, and don't have more time this week to finalize what I had in mind, so here's some things left to do.
- Generate a second list by location (when we'll have more people)
- Generate a third list by discussion topics (when we'll have more people)
- Add GitHub Action for JSON linting
- Add GitHub Action for automatic README generation
- Add GitHub Action for links validation
- Create pull request template
- Create a CONTRIBUTION.md
- Better formatting of the list including city & country (suggestions welcome here).

20
scripts/write-readme.js Normal file
View File

@@ -0,0 +1,20 @@
'use strict;'
const fs = require('fs');
//Get the data
const data = fs.readFileSync('../people.json');
const json = JSON.parse(data);
//Order by name
json.people.sort(function (a, b) {
return a.name.localeCompare(b.name);
});
//Generate with proper formating
const peopleList = json.people.map(people =>
`- **[${people.name}](${people.scheduling}) (${(people.linkedin ? "[LinkedIn](" + people.linkedin + "), " : "")}${(people.twitter ? "[Twitter](" + people.twitter + ")" : "")}), ${people.title} at ${people.company}:** ${people.topics.join(', ')})`
).join('\r\n');
//Write README.md
const template = fs.readFileSync('README-TEMPLATE.md', 'utf8');
fs.writeFileSync('../README.md', template.replace('PLACEHOLDER', peopleList));