Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions generate_build_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from sys import argv

import dacite
import humanize
from git import Repo
from jinja2 import Environment, FileSystemLoader
from urllib3 import request
Expand Down Expand Up @@ -57,6 +58,7 @@ def get_language_repo_and_completion(
logging.basicConfig(level=logging.INFO)
logger.info('starting at %s', generation_time)
env = Environment(loader=FileSystemLoader('templates'))
env.filters['naturaltime'] = humanize.naturaltime
if (index_path := Path('build/index.json')).exists():
index_json = loads(Path('build/index.json').read_text())
else:
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ gitpython
urllib3
potodo
jinja2
humanize
docutils
git+https://github.com/m-aciek/sphinx.git@copilot/fix-last-four-cases-issue-14162
python-docs-theme
Expand Down
7 changes: 6 additions & 1 deletion templates/build-details.html.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@
<tr>
<td data-label="language">{{ project.language.name }} ({{ project.language.code }})</td>
<td data-label="branch">{{ project.branch }}</td>
<td data-label="updated">{{ metadata[2].strftime("%Y/%m/%d %T") if metadata[2] else '' }}</td>
<td data-label="updated">
{% if metadata[2] %}
<time datetime="{{ metadata[2].isoformat() }}"
title="{{ metadata[2].strftime('%Y/%m/%d %T') }}">{{ metadata[2] | naturaltime(when=generation_time) }}</time>
{% endif %}
</td>
<td data-label="warnings">
{% if project.completion %}
<a href="warnings-{{ project.language.code }}.txt">{{ metadata[0] }}</a>
Expand Down
Loading