diff options
-rw-r--r-- | data/script.js | 3 | ||||
-rw-r--r-- | src/Render.hs | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/data/script.js b/data/script.js index 43cb45e..c3f6bc2 100644 --- a/data/script.js +++ b/data/script.js @@ -116,4 +116,7 @@ $(document).ready (function () { /* hide button “learn more” */ $('#about').on ({'shown.bs.collapse': function () { $('#learnmore').hide (); }, 'hidden.bs.collapse': function () { $('#learnmore').show (); }}); + + /* enable popovers */ + $('[data-toggle="popover"]').popover({template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><textarea readonly rows="5" class="popover-body"></textarea></div>'}); }); diff --git a/src/Render.hs b/src/Render.hs index 146b68d..7b8bab2 100644 --- a/src/Render.hs +++ b/src/Render.hs @@ -10,6 +10,7 @@ import Data.Maybe (catMaybes) import qualified Data.Text as T import Data.Text.Encoding (decodeUtf8) import Text.BibTeX.Entry as E +import Text.BibTeX.Format (entry) import qualified Data.Map as M import Text.Parsec.Error import Text.ParserCombinators.Parsec.Prim @@ -114,6 +115,8 @@ bibentry bib = do span_ [class_ "author"] $ htmlLookup "author" ", " span_ [class_ "year"] $ htmlLookup "year" + " " + button_ [type_ "button", class_ "btn btn-light btn-sm", data_ "toggle" "popover", title_ "BibTeX", data_ "content" $ T.pack $ entry bib] "BibTeX" -- | References section references :: [E.T] -> Html () |