generator.nv
initial facts
use library
stacks iteration case inline strings system filesystem nokogiri
create tar archive
generate source code graph
generate source code visualizer
copy the static assets
output the website
wrap each page
insert source code
add anchors to headings
insert table of contents
render backlinks
collect backlinks
get html for each page
no toc
index wiki projects about
rules
get html for each page
get files in pages folder
get page data
get page data
got files
File
get base name of File
> name
read html fragment from File
> html
pages = @ name @ html
get page data
collect backlinks
pages
Page Html
find elements with tag ba in Html
collect backlinks for Page
seen
Page Html
collect backlinks
backlink
Page Source URL Anchor Content
backlink on Page
Source URL Anchor Content
collect backlinks
move seen to pages
collect backlinks for URL
found elements
Link
get content of Link
> content
get attribute href of Link
> page
replace - with in URL
> source
= replace with - in $ content
> anchor
backlink = @ page @ source URL @ anchor @ content
switch tag of Link to a
append .html to Link href
set id to content of Link
collect backlinks for Page
render backlinks
pages
Page Html
create element ul in Html
> list
render backlinks for Page Html
seen
Page Html
render backlinks
move seen to pages
render backlinks for Page Html
list
List
backlink on Page
Source URL Anchor Content
join! <li> Source : <a href='/ URL .html# Anchor '> Content </a> </li>
= append element @ result to List
found backlink on Page
render backlinks for Page Html
list
List
found backlink on Page
join! <div class='backlinks'> <h2>backlinks</h2> List </div>
= append element @ result to Html
render backlinks for Page Html
list
List
insert table of contents
no toc
Page
pages
Page Html
seen
Page Html
insert table of contents
pages
Page Html
seen
Page Html
last level
2
html
Html
create element ul in Html
> toc and position
find elements with tag h2,h3,h4,h5,h6 in Html
process headings
insert toc element
insert table of contents
move seen to pages
process headings
found elements
Heading
heading
Heading
update level
move to new level
get anchor from heading
add heading to list
process headings
update level
last level
Last
heading
Heading
get level of heading Heading
> level
last level = $ level
change = ( Last @ level sub )
move to new level
change
Change
compare Change and 0
case less
move down
case more
repeat Change times
move up
end
move down
html
Html
position
Position
create element ul in Html
> list and position
= append element @ list to Position
move up
position
Position
get parent of Position
> parent
position = @ parent
get anchor from heading
heading
Heading
get content of Heading
> content
= replace with - in $ content
> anchor
add heading to list
position
Position
anchor
Anchor
content
Content
join! <li> <a href='# Anchor '> Content </a> </li>
= append element @ result to Position
insert toc element
toc
List
get amount of children of List
> count
= compare @ count and 2
case more
insert toc
end
insert toc
toc
List
html
Html
join! <details class='toc'> <summary>table of contents</summary> List </details>
= insert @ result before children of Html
add anchors to headings
get headings for all pages
get headings
for
Page Html
find elements with tag h2,h3,h4,h5,h6 in Html
set id for all found elements
set id
for
Heading
set id to content of Heading
insert source code
pages
source Html
find element with id #generator in Html
> container
get file content of generator.nv
> content
= set content of @ container to @ content
wrap each page
pages
Page Html
read html from wrapper.html
> wrapper
= find element with tag main in $ wrapper
> main
= find element with tag title in $ wrapper
> title
replace - with in Page
> heading
attach heading
set page title
= append element Html to @ main
seen = Page @ wrapper
wrap each page
move seen to pages
attach heading
heading
index
attach heading
heading
Heading
main
Main
join! <h1> Heading </h1>
= append element @ result to Main
set page title
heading
Heading
title
Title
join! autumn: Heading
= set content of Title to @ result
output the website
ensure site directory exists
output each page
output each page
pages
Page Html
join! site/ Page .html
> path
= write file @ path with content Html
output each page
copy the static assets
copy files static/. to site
copy files /home/eevie/files/srht/yarnstar/dist/. to site/yarnstar
copy files /home/eevie/files/srht/miraquad/artifact/web/. to site/miraquad
copy files /home/eevie/files/srht/pyra/examples/axowotw/. to site/axowotw
generate source code visualizer
snippet
`lua ../pyra/pyra.lua docs generator.nv > site/source-visualizer.html`
generate source code graph
snippet
`lua ../pyra/pyra.lua graph generator.nv | dot -Tsvg > site/img/source_graph.svg`
create tar archive
snippet
`cd site && tar --exclude eevie.dev.tar.gz -czvf eevie.dev.tar.gz *`