djcev.com

//

Git Repos / blogofile_gitview / commit a3793a6

Last commit to this repo was on 2022-01-23 at 14:14.

Commit: a3793a67bf5f4b360d313d96f870b95546a184f3
Parent: 993ba075ea57234d16b309bb9e612f682da435d1
Author: Cameron Vanderzanden <cvanderz@gmail.com>, 2022-01-23 14:14
Committer: Cameron Vanderzanden <cvanderz@gmail.com>, 2022-01-23 14:14

Commit Message

More file extension handling, small template fix

Strip ".fix" from the end of filenames (helps in rendering my
dotfiles git repo). Probably only useful for my installation,
but here it is.

Change " />" to "/>" in templates (removing that space) because
apparently "/>" is the preferred standard (and vim's syntax
highlighting doesn't like that space).

Change List & Diffs

?File Add Del
M _controllers/gitview.py +3
M _templates/gitview/git_commit.mako +8 -8
M _templates/gitview/git_file.mako +2 -2
M _templates/gitview/git_files.mako +3 -3
M _templates/gitview/git_log.mako +3 -3
M _templates/gitview/git_repo.mako +6 -6
M _templates/gitview/git_repos.mako +1 -1

_controllers/gitview.py

diff --git a/_controllers/gitview.py b/_controllers/gitview.py
index 90fc67f..7d38b1b 100644
--- a/_controllers/gitview.py
+++ b/_controllers/gitview.py
@@ -191,6 +191,9 @@ def format_obj_text(repoinfo, obj, path):
# my mako templates. So let's test file extension...
if obj.name.endswith(".mako"):
lexer = pygments.lexers.get_lexer_by_name("mako")
+ elif obj.name.endswith(".fix"):
+ lexer = pygments.lexers.guess_lexer_for_filename(
+ obj.name.rstrip(".fix"), data)
else:
lexer = pygments.lexers.guess_lexer_for_filename(obj.name, data)
except pygments.util.ClassNotFound:

Return to top of this page or return to the overview of this repository

_templates/gitview/git_commit.mako

diff --git a/_templates/gitview/git_commit.mako b/_templates/gitview/git_commit.mako
index 869103d..88a3460 100644
--- a/_templates/gitview/git_commit.mako
+++ b/_templates/gitview/git_commit.mako
@@ -1,26 +1,26 @@
-<%inherit file="site.mako" />\
+<%inherit file="site.mako"/>\
<%
repolink = bf.util.path_join(bf.config.gitview.path, repo['name'])
%>\
<%def name="git_header(name, l, extra)">\
-<%include file="git_header.mako" args="name=name, lastcommit=l, extra=extra" />\
+<%include file="git_header.mako" args="name=name, lastcommit=l, extra=extra"/>\
</%def>\
<article>
${self.git_header(repo['name'], repo['last_commit'],
"commit " + commitinfo['id'][:7])}
<section class="commitinfo"><p>
-Commit: <a href="${commitinfo['id']}.html">${commitinfo['id']}</a><br />
+Commit: <a href="${commitinfo['id']}.html">${commitinfo['id']}</a><br/>
% for p in commitinfo['parentids']:
% if prev_id and len(commitinfo['parentids']) == 1:
-Parent: <a href="${p}.html">${p}</a><br />
+Parent: <a href="${p}.html">${p}</a><br/>
% else:
-Parent: ${p}<br />
+Parent: ${p}<br/>
% endif
% endfor
Author: ${commitinfo['author']} &lt;${commitinfo['author_email']}&gt;,
-${commitinfo['author_time'].strftime("%Y-%m-%d %H:%M")}<br />
+${commitinfo['author_time'].strftime("%Y-%m-%d %H:%M")}<br/>
Committer: ${commitinfo['committer']} &lt;${commitinfo['committer_email']}&gt;,
-${commitinfo['committer_time'].strftime("%Y-%m-%d %H:%M")}<br />
+${commitinfo['committer_time'].strftime("%Y-%m-%d %H:%M")}<br/>
</p>
<h3>Commit Message</h3>
<pre>${commitinfo['msg']}</pre>
@@ -64,7 +64,7 @@ ${patch}\
% endif
</article>
% if prev_id or next_id:
-<hr class="bright" />
+<hr class="bright"/>
<nav><p class="clearfix">
% if next_id:
<a href="${next_id}.html" title="Next Commit">&lt;&lt; Next Commit</a>

Return to top of this page or return to the overview of this repository

_templates/gitview/git_file.mako

diff --git a/_templates/gitview/git_file.mako b/_templates/gitview/git_file.mako
index 0719005..1bb99f7 100644
--- a/_templates/gitview/git_file.mako
+++ b/_templates/gitview/git_file.mako
@@ -1,11 +1,11 @@
-<%inherit file="site.mako" />\
+<%inherit file="site.mako"/>\
<%
fnamel = file['fullname'].split('/')
fname = " / ".join(fnamel)
repolink = bf.util.path_join(bf.config.gitview.path, repo['name'])
%>\
<%def name="git_header(name, l, extra)">\
-<%include file="git_header.mako" args="name=name, lastcommit=l, extra=extra" />\
+<%include file="git_header.mako" args="name=name, lastcommit=l, extra=extra"/>\
</%def>\
<article>
${self.git_header(repo['name'], repo['last_commit'], fname)}

Return to top of this page or return to the overview of this repository

_templates/gitview/git_files.mako

diff --git a/_templates/gitview/git_files.mako b/_templates/gitview/git_files.mako
index fb3a1f4..00aae8d 100644
--- a/_templates/gitview/git_files.mako
+++ b/_templates/gitview/git_files.mako
@@ -1,4 +1,4 @@
-<%inherit file="site.mako" />\
+<%inherit file="site.mako"/>\
<%
prestyle = "style=\"font-family: 'Inconsolata', monospace; \""
repourl = bf.util.site_path_helper(bf.config.gitview.reporoot,
@@ -10,10 +10,10 @@
third += 'refs'
%>\
<%def name="git_header(name, l, extra)">\
-<%include file="git_header.mako" args="name=name, lastcommit=l, extra=extra" />\
+<%include file="git_header.mako" args="name=name, lastcommit=l, extra=extra"/>\
</%def>\
<%def name="file_list(files)">\
-<%include file="git_file_list.mako" args="files=files" />\
+<%include file="git_file_list.mako" args="files=files"/>\
</%def>\
<article>
${self.git_header(repo['name'], repo['last_commit'], third)}

Return to top of this page or return to the overview of this repository

_templates/gitview/git_log.mako

diff --git a/_templates/gitview/git_log.mako b/_templates/gitview/git_log.mako
index 060b6ca..3692e2f 100644
--- a/_templates/gitview/git_log.mako
+++ b/_templates/gitview/git_log.mako
@@ -1,4 +1,4 @@
-<%inherit file="site.mako" />\
+<%inherit file="site.mako"/>\
<%
prestyle = "style=\"font-family: 'Inconsolata', monospace; \""
repourl = bf.util.site_path_helper(bf.config.gitview.reporoot,
@@ -10,10 +10,10 @@
third += 'refs'
%>\
<%def name="git_header(name, l, extra)">\
-<%include file="git_header.mako" args="name=name, lastcommit=l, extra=extra" />\
+<%include file="git_header.mako" args="name=name, lastcommit=l, extra=extra"/>\
</%def>\
<%def name="commit_list(commits)">\
-<%include file="git_commit_list.mako" args="commits=commits" />\
+<%include file="git_commit_list.mako" args="commits=commits"/>\
</%def>\
<article>
${self.git_header(repo['name'], repo['last_commit'], third)}

Return to top of this page or return to the overview of this repository

_templates/gitview/git_repo.mako

diff --git a/_templates/gitview/git_repo.mako b/_templates/gitview/git_repo.mako
index ae55a70..dfb3b2e 100644
--- a/_templates/gitview/git_repo.mako
+++ b/_templates/gitview/git_repo.mako
@@ -1,4 +1,4 @@
-<%inherit file="site.mako" />\
+<%inherit file="site.mako"/>\
<%
prestyle = "style=\"font-family: 'Inconsolata', monospace; \""
repourl = bf.util.site_path_helper(bf.config.gitview.reporoot,
@@ -6,19 +6,19 @@
repourl = bf.config.site.url + repourl
%>\
<%def name="git_header(name, l, extra)">\
-<%include file="git_header.mako" args="name=name, lastcommit=l, extra=extra" />\
+<%include file="git_header.mako" args="name=name, lastcommit=l, extra=extra"/>\
</%def>\
<%def name="file_list(files)">\
-<%include file="git_file_list.mako" args="files=files" />\
+<%include file="git_file_list.mako" args="files=files"/>\
</%def>\
<%def name="commit_list(commits)">\
-<%include file="git_commit_list.mako" args="commits=commits" />\
+<%include file="git_commit_list.mako" args="commits=commits"/>\
</%def>\
<%def name="branch_list(branches)">\
-<%include file="git_branch_list.mako" args="branches=branches" />\
+<%include file="git_branch_list.mako" args="branches=branches"/>\
</%def>\
<%def name="tag_list(tags)">\
-<%include file="git_tag_list.mako" args="tags=tags" />\
+<%include file="git_tag_list.mako" args="tags=tags"/>\
</%def>\
<article>
${self.git_header(repo['name'], repo['last_commit'], None)}

Return to top of this page or return to the overview of this repository

_templates/gitview/git_repos.mako

diff --git a/_templates/gitview/git_repos.mako b/_templates/gitview/git_repos.mako
index 1cfe71c..76dea6a 100644
--- a/_templates/gitview/git_repos.mako
+++ b/_templates/gitview/git_repos.mako
@@ -1,4 +1,4 @@
-<%inherit file="site.mako" />\
+<%inherit file="site.mako"/>\
<%
bcgp = bf.config.gitview.path
def clfr(name): return "Commit log and file list for {}".format(name)

Return to top of this page or return to the overview of this repository