# Produces the documentation text from within KLayout def xml2html(t) # strip XML processing instructions and DTD t = t.sub(/^.*
/m, "") t = t.sub(/<\/body>.*$/m, "") # insert title in front of navigator t = t.sub(/KLayout Documentation (Qt #{$qt}): ") # replace .xml references in hrefs t = t.gsub(/href=\"(.*?)\.xml\"/) { "href=\"#{$1}.html\""; } t = t.gsub(/href=\"(.*?)\.xml#(.*?)\"/) { "href=\"#{$1}.html##{$2}\""; } # replace simplified XML tags with an opening/closing tag t = t.gsub(/<(\w+)([^<>]*?)\/>/) { "<#{$1}#{$2}>#{$1}>" } # replace some closing tags which are not allowed t = t.gsub(/<\/br>/, "").gsub(/<\/img>/, "") t end title = "KLayout " title += ($klayout_version || "$version") + " " title += "(" title += ($klayout_version_date || "$date") + " " title += ($klayout_version_rev || "$rev") title += ") " title += ($target_info && $target_info != "" ? "[#{$target_info}] " : "") HEADER=<<"END"