-
-
Notifications
You must be signed in to change notification settings - Fork 25
Description
I'm still working on the configurability of authors aggregation(#4 (comment), 1.) but had to intermittently leave. This caused some rambling considerations while driving, and I had one more idea [hopefully the last one for now since I really have to do some "content" work].
If I'm going to implement this additional idea it would be good to make some design decisions already for the aggregation code (instead of implementing just that one functionality and the changing the code only afterwards), so I'd like to have your opinion first, @timvink.
I would like to add a ninja template git_authors_book_summary that can be placed on a single page and will produce a summary of all authors present in the book rather than on the current page. This may (configurably) show the number of commits, the contribution percentage and the absolute number of lines the author has modified in the current state of the book (i.e. the aggregated lines count of all pages). In the future this could also provide some information about the book itself, e.g. total number of lines, number of pages, total size in characters (and words?), times of first and last commit etc. Although the latter might better be handled in a separate plugin.
The main design decision for this would be to retrieve the Git information not in on_page_markdown but in on_files. Here basically get_authors() will be called in its current implementation, and its results stored in a global Authors object. In the on_page_markdown we don't have to call Git anymore but just read out the stored data.
The aggregation of data for the book summary will only be done upon request, i.e. if the template is found, so there shouldn't be much overhead in this. There will be more memory usage because the information is stored globally and not only while retrieving the info per page, but I'm sure this is OK.