-
Notifications
You must be signed in to change notification settings - Fork 0
How to add a new statistic
Alexandre Henrique Afonso Campos edited this page Mar 16, 2019
·
5 revisions
When running python3 src/index.py
, every .html
file that starts with stat-
is going to be listed in the main page. So what it takes is to create a file with the content of the statistics named stat-{foo}.html
.
This is the process followed in order to use the automated page creation available.
Every file that starts with stat-
in src/ generates a page with statistics (a stat-{foo}.html
).
- Create a python3 program and name it
src/stat-{foo}.py
- This file must produce a dictionary
out
containing at least a keys namedtitle
andtable
-
table
is a list of lists and must contain the statistics info. -
title
is self explanatory, but it's also going to be used to create a link on the main page (index). -
out
might also contain the keyslabels
(for the table),subtitle
,explanation
- Call the function
build_results
from build_page.py and runbuild_results(out, args)
whereargs = sys.argv
. - If you run
python3 stat-{foo}.py page=true
, a page will be created inside pages/. Else, statistics are going to be shown in terminal.