Skip to content

How to add a new statistic

Alexandre Henrique Afonso Campos edited this page Mar 11, 2019 · 5 revisions

Every file that starts with stat- in src/ generates a page with statistics.

  1. Create a python3 program and name the file stat-{foo}.py
  2. This file must produce a dictionary out containing at least a keys named title and table
  3. table is a list of lists and must contain the statistics info.
  4. title is self explanatory, but it's also going to be used to create a link on the main page (index).
  5. out might also contain the keys labels (for the table), subtitle, explanation
  6. call the function build_results from build_page.py.
  7. Include import sys, get argv and pass to build_results.
  8. 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.
Clone this wiki locally