mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 14:13:02 -04:00
google knowledge graph
This commit is contained in:
parent
f9dfc8fc93
commit
cb83cc9c5d
2 changed files with 44 additions and 14 deletions
|
@ -34,4 +34,15 @@ module.exports.smallPill = function(content){
|
|||
module.exports.iconPill = function(icon, content){
|
||||
if(!ICONS[icon]) icon = "question"
|
||||
return ICONS[icon] + " **` " + content + " `**"
|
||||
}
|
||||
|
||||
const SUPERSCRIPT_NUMBERS = ["⁰","¹","²","³","⁴","⁵","⁶","⁷","⁸","⁹"]
|
||||
module.exports.citation = function(number = 1, url, tooltip = ""){
|
||||
let formatted = "";
|
||||
for(const n of number.toString().split('')) formatted += SUPERSCRIPT_NUMBERS[parseInt(n)]
|
||||
if(url){
|
||||
if(tooltip.length) tooltip = ` '${tooltip}'`
|
||||
return `[⁽${formatted}⁾](${url}${tooltip})`
|
||||
}
|
||||
return `⁽${formatted}⁾`
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue