#!/usr/bin/ruby index = < The Problem with the Mainstream Engineering Establishment

Articles – Read In Order

EOF list = [] Dir.glob("*.html") do |i| if i != "index.html" raise i unless i.match?(/^\d+\.html$/) else next end i = i.to_i list << i end list.sort! titles = [] list.each_with_index do |i, index| index += 1 raise unless i == index end puts list.max list.each do |i| prev = i - 1 if prev == 0 prev = "index" end next_ = i + 1 if next_ == 17 next_ = "index" end end_ = "
Previous article Next article
" text = File.read(i.to_s + ".html") v = text.gsub(/(<\/body|<\/html>).*/, "").gsub(/^\s*.*/, "").gsub(/
.*/, "").strip if i == 11 v = " The Solution of Foundationallib

The Solution of Foundationallib

By G.C.

" v += "\n" * 20 v += File.read("../README.md") end v = v.gsub /!\[Alt text\]\((.*?)\)/ do |q| "" end v << end_.strip File.write i.to_s + ".html", v title = nil text.scan(/(.*?)<\/title>/) do |i| title = $1 end titles << [i, title] end fmt = "" titles.each do |i| fmt << (" <li style=\"padding:12px;\"><a href=\"%s.html\">%s</a></li>\n" % i) end File.write("index.html", index % fmt)