#!/usr/bin/perl $raise_level = $ENV{'RAISE_LEVEL'}; unlink("problems"); open (IN, "konwert utf8-iso2 < output.html || touch problems |"); open (OUT, "> output.tex"); my $title = shift; $title = "Nemerle documentation" unless defined $title; $header_commands = ' \documentclass[a4paper]{article} \usepackage[latin2]{inputenc} \usepackage{fancyhdr} \usepackage[margin=2cm,tmargin=3cm]{geometry} \usepackage{graphicx} \usepackage{color} \usepackage{parskip} \usepackage{framed} \usepackage[colorlinks,urlcolor=red,linkcolor=blue]{hyperref} \newcommand{\backslashent}{{$\backslash$}} \newcommand{\leftbrace}{{$\{$}} \newcommand{\rightbrace}{{$\}$}} \newcommand{\entlt}{{$\mathtt{<}$}} \newcommand{\entgt}{{$\mathtt{>}$}} \newcommand{\entbar}{{$\mathtt{|}$}} \newcommand{\amp}{{\&}} \newcommand{\nbsp}{\hspace*{0.4em}} \definecolor{frame}{rgb}{0.5,0.5,0.5} \definecolor{background}{rgb}{0.95,0.95,0.95} \renewcommand{\FrameCommand}[1]{ \fboxrule=1pt \fboxsep=10pt \hspace{5mm} \colorbox{background}{#1} \textcolor{frame}{\vrule width 2pt} \hspace{6mm} } '; print OUT <) { // and last; } while () { $_ = fixline($_); s/<\/a>/anchor($1)/eg; s/<\/a>//g; if ($raise_level) { s/

([^<]*)<\/h1>//g; s/

(.*?)<\/h2>/\\section{$1}/g; s/

(.*?)<\/h3>/\\subsection{$1}/g; s/

(.*?)<\/h4>/\\subsubsection{$1}/g; } else { s/

([^<]*)<\/h1>/\\section{$1}/g; s/

(.*?)<\/h2>/\\subsection{$1}/g; s/

(.*?)<\/h3>/\\subsubsection{$1}/g; s/

(.*?)<\/h4>/\\paragraph{$1}/g; } s/