From f836086f07fca0cd40fe5eb6cf4c29fa9da9f896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20V=C3=A9ril?= Date: Thu, 5 Sep 2019 15:26:50 +0200 Subject: [PATCH] Better presentation on the web page --- content/pages/index.html | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/content/pages/index.html b/content/pages/index.html index eddb39e6..48dd31c4 100644 --- a/content/pages/index.html +++ b/content/pages/index.html @@ -23,7 +23,7 @@ } async function applyData(dat) { const Cite = require('citation-js'); - // Start a async task to get publi + // Start an async task to get publi data let publitask = Cite.async(dat.doi.string) const LatexInline=['\\(','\\)'] var par=document.getElementById("data_par") @@ -39,15 +39,19 @@ node.innerText= element[0]+': '+element[1]; par.appendChild(node); }); - var node = document.createElement("h"); - node.innerText= "Excitations"; - par.appendChild(node); + var exDiv= document.createElement("div"); + par.appendChild(exDiv); + var exTitle = document.createElement("h2"); + exTitle.innerText= "Excitations"; + exDiv.appendChild(exTitle); + var exPar= document.createElement("p"); + exDiv.appendChild(exPar); await dat.excitations.reduce(async (promise,el)=> { await promise; var node = document.createElement("div"); node.innerHTML= String.raw`${LatexInline[0]} ${el.start.toLaTeX()} \rightarrow ${el.end.toLaTeX()}${LatexInline[1]}, ${LatexInline[0]}${el.Eabs}\:\mathrm{eV}${LatexInline[1]}`; node.hidden=true - par.appendChild(node); + exPar.appendChild(node); await MathJax.typesetPromise(); node.hidden=false; }); @@ -78,6 +82,7 @@
+

Data

Go to file