#!/usr/bin/env julia # # Reads the Julia source files and makes an HTML manual out of # the Markdown documentation. # # Author: Daniel Carrera (danielc@astro.lu.se) # # REQUIREMENTS: python-markdown library # --> apt-get install python-markdown # # Usage: julia make_manual.jl using PyCall @pyimport markdown text = "" md_files = [ "README.md" ] jl_files = [ "src/timeseries.jl", "src/particles.jl", "src/averages.jl", "src/dimensions.jl" ] for file = md_files info("Processing $file") src = open(file, "r") text = text * readall(src) close(src) end for file = jl_files info("Processing $file") src = open(file, "r") save = false for line = readlines(src) if line[1:5] == "#>doc" save = true elseif line[1:5] == "#>end" save = false elseif save if line[1:1] "#" start = 2 end if line[1:2] "# " start = 3 end text = text * line[start:end] end end close(src) end # # Write the HTML documentation as one file. # header = "
"; footer = " "; ext = ["tables","fenced_code", "codehilite", "toc", "def_list", "extra"] html = header * markdown.markdown(text, extensions=ext) * footer # # Alternate row styles. # count = 0 lines = split(html,"\n") for i = 1:length(lines) if contains(lines[i],"