6 this.el = document.createElement('div')
11 this.install = (host) => {
12 console.log('Wiki', 'Installing..')
14 host.appendChild(this.el)
18 console.log('Wiki', 'Starting..')
19 this.el.innerHTML = 'hello.'
23 console.log('Wiki', 'Fetching..')
24 for (const site of sites) {
25 if (!site.wiki || !site.author) { continue }
26 fetch(site.wiki, { cache: 'no-store' }).then(x => x.text()).then((content) => {
27 this.parse(site, content)
30 console.warn(`${site.wiki}`, err)
35 this.refresh = () => {
36 console.log(Object.keys(this.index).length + ' terms')
39 this.add = (name, value, cat, origin) => {
40 if (!this.index[name]) {
43 this.index[name].push({ value, cat, origin })
46 this.parse = (site, content) => {
47 console.log('Wiki', 'Parsing ' + site.wiki)
48 const cats = indental(this.filter(content))
49 for (const cat in cats) {
50 const terms = cats[cat]
51 for (const name in terms) {
52 this.add(name, terms[name], cat, site)
57 this.filter = (lines) => {
58 return lines.split('\n').filter((line) => { return line.indexOf(' = `') < 0 && line.trim().length > 1 }).join('\n')
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list