We read the html produced by our Story Telling workflow. We can later compare this to further edited versions.
http://ward.dojo.fed.wiki/assets/pages/story-telling/normalize-edits.html HEIGHT 400
import * as norm from 'http://ward.dojo.fed.wiki/assets/pages/story-telling/norm.js' const ref = title => { const href = norm.select('a') .getAttribute('href') .split(/\/+/) return { type: "reference", id: "0511bca1b52a3f62", site: href[1], slug: norm.asSlug(title), title: title, text: "Source Wiki Page" } }
export const titles = () => { const ctitle = norm.frequent('h2','span') console.log({ctitle}, norm.div) const elems = norm.selectAll('.'+ctitle) .filter(elem => elem.className == ctitle) elems.shift() return elems.map(elem => elem.innerText) }
export const items = (title, doitem) => { const citem = norm.frequent('p') let d = norm.selectAll('h2') .find(e => e.innerText.startsWith(title)) return [ref(title), ...norm.repeat(norm.more(d)) .map(doitem)] }