summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/gitlog/gitlog.bbx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/gitlog/gitlog.bbx
Initial commit
Diffstat (limited to 'macros/latex/contrib/gitlog/gitlog.bbx')
-rw-r--r--macros/latex/contrib/gitlog/gitlog.bbx45
1 files changed, 45 insertions, 0 deletions
diff --git a/macros/latex/contrib/gitlog/gitlog.bbx b/macros/latex/contrib/gitlog/gitlog.bbx
new file mode 100644
index 0000000000..87e24ec281
--- /dev/null
+++ b/macros/latex/contrib/gitlog/gitlog.bbx
@@ -0,0 +1,45 @@
+\ProvidesFile{gitlog.bbx}[2015/11/22 0.0.beta]
+
+\defbibenvironment{bibliography}
+ {\list
+ {\printfield{entrykey}}%
+ {\setlength{\leftmargin}{5em}%
+ \setlength{\labelwidth}{0em}%
+ \setlength{\itemindent}{-\leftmargin}%
+ % \setlength{\itemindent}{0pt}%
+ \setlength{\itemsep}{\bibitemsep}%
+ % \addtolength{\leftmargin}{\labelsep}%
+ \setlength{\parsep}{\bibparsep}%
+ \renewcommand*{\makelabel}[1]{%
+ \makebox[5em]{\ttfamily##1}}}}
+ {\endlist}
+ {\item}
+
+\newbibmacro*{begentry}{}
+\newbibmacro*{finentry}{\finentry}
+
+\DeclareBibliographyDriver{gitcommit}{%
+ \usebibmacro{bibindex}%
+ \usebibmacro{begentry}%
+ \usebibmacro{title}%
+ \newblock%
+ \usebibmacro{date+author}%
+ \usebibmacro{finentry}}
+
+\newbibmacro*{commithash}{%
+ \printfield{commithash}%
+}
+
+% \newbibmacro*{entrykey}{%
+ % \href{https://github.com/Hightor/gitlog/commit/\thefield{commithash}}{\printfield{entrykey}}%
+% }
+
+% \DeclareFieldFormat{entrykey}{%
+ % \IfStrEq{}{\gitLog@github}{%
+ % #1
+ % }{%
+ % \href{https://github.com/\gitLog@github/commit/\thefield{commithash}}{#1}
+ % }
+% }
+
+\endinput