Updates a README.md
file on execution with a visualization of the latest progress state.
Prerequisites:
Have nodejs
installed and install all dev dependencies (not necessary afterwards)
npm install
Create updateProgress.mjs
(and optionally progress.schema.json
)
# Create dist/updateProgress.mjs
npm run build
npm run createBundle
# Optionally create progress.schema.json
npm run createJsonSchema
Create for example the following file structure:
repo
|_ README.md
|_ progress
|_ progress.json
|_ progress.schema.json
|_ updateProgress.mjs
Insert in the README.md
a begin/end comment somewhere:
....
# Progress title
[//]: # (Progress EXAMPLE_ID begin)
| Points >= 50% | Passed Exercises >= 4 |
| --- | --- |
| 75%/50% :heavy_check_mark: | 1/4 :x: |
| Exercise | Points | Notes |
| --- | --- | --- |
| [1](ex01) (2020.10.06) | 12.5/15 (*theoretical*) + 10/15 (*programming*) = [22.5/30](ex01/feedback.pdf) (75%) | |
[//]: # (Progress EXAMPLE_ID end)
...
An example progress.json
: (you can check the examples
directory for more examples)
{
"$schema": "./progress.schema.json",
"exercises": [
{
"directory": "ex01",
"feedbackFile": "feedback.pdf",
"name": 1,
"submission": [
{
"achievedPoints": 12.5,
"name": "theoretical",
"points": 15
},
{
"achievedPoints": 10,
"name": "programming",
"points": 15
}
],
"submissionDate": "2020-10-05T22:00:00.000Z"
}
],
"name": "Course Example 02 SS20",
"progressName": "EXAMPLE_ID",
"requirements": {
"minimumPointsPercentage": {
"allSubmissions": 0.5
},
"minimumPassedExercises": {
"number": 4
}
},
"version": 5
}
Run the program without any other dependencies:
node ./progress/updateProgress.mjs PROGRESS_JSON=progress/progress.json
npm run lint:fix
npm test
npm run runExamples
Ctrl
+ Shift
+ D
If you use the date property and want to change the timezone (because it is executed on a server somewhere else or something do the following):
Add TZ='XYZ'
before running node
to set the timezone for the process.
Possible values are for example:
UTC
(UTC+00:00)Europe/Amsterdam
(UTC+05:00 / DST mixes this up)Europe/Berlin
(UTC+01:00 / DST mixes this up)America/Washington
(UTC−08:00 / DST mixes this up)Example for America/Washington
:
TZ='America/Washington' node ./progress/updateProgress.mjs
Generated using TypeDoc