Browse Source

Add GitHub buttons in rendered HTML (#85)

GitHub buttons are rendered in the generated HTML:
one is GitHub project page; another is PDF download.

Close #84
fennecJ 3 năm trước cách đây
mục cha
commit
0e11c00e1b
1 tập tin đã thay đổi với 16 bổ sung5 xóa
  1. 16 5
      html.cfg

+ 16 - 5
html.cfg

@@ -51,9 +51,20 @@
     right: 50px;
 }}
 
-\begin{document}
-\EndPreamble
+\Css{.right {
+    text-align: right;
+}}
 
-\begin{flushright}
-\href{https://github.com/sysprog21/lkmpg/releases/download/latest/lkmpg.pdf}{Download PDF document}
-\end{flushright}
+\AtBeginDocument{%
+\Configure{@HEAD}{\HCode{
+    <script async defer src="https://buttons.github.io/buttons.js"></script>
+    <div class="right">
+        <a class="github-button" href="https://github.com/sysprog21/lkmpg" data-size="large" aria-label="View on GitHub">View on GitHub</a>
+        <a class="github-button" href="https://github.com/sysprog21/lkmpg/releases/download/latest/lkmpg.pdf" data-icon="octicon-download" data-size="large" aria-label="Download PDF document">Download PDF document</a>
+        <br><br>
+    </div>
+    \Hnewline}}
+}
+
+\begin{document}
+\EndPreamble