#line 40 "/home/travis/build/felix-lang/felix/src/packages/flx_web.fdoc"
  // pretty printer for *.flx files
  // uses the flx2html plugin
  
  // COPIED from dflx_web ..
  class Css4Html {
  flx_head := """
  <style type="text/css">
  body {margin:3%; }
  h1 {color:gray; font-size:120%;}
  h2 {color:gray; font-size:105%;}
  h3 {font-size:100%;}
  h4 {font-size:95%;}
  h5 {font-size:95%;}
  span.fstring {color:darkblue; font-style:italic; }
  span.comment {font-family:arial; color:blue; font-style:italic; }
  span.doccomment {font-family:arial; color:green; font-style:italic; }
  span.big_keyword {color:#FF1010; }
  span.small_keyword {color:#802040; }
  span.qualifier {color:#A02020; }
  span.library {color:#A02000; }
  span.ctor {color:#406020; }
  span.hack {color:#66DD00; }
  span.preproc {color:#005500; }
  span.embedded_c{background-color:#DDDDDD; }
  span.fpc_fieldname {color:#DD0000; }
  span.lineno {color:#101010; background-color:#E0E0E0; font-size:80%; font-family:"courier",monospace; font-style:normal; }
  pre.flxbg {background-color:#A0FFA0; color:black; padding:2px; box-shadow:5px 5px 2px #807080; }
  pre.uncheckedflxbg {background-color:#D0D0D0; color:black; padding:2px; box-shadow:5px 5px 2px #807080; }
  pre.cppbg {background-color:#80FF80; color:black; }
  pre.prefmtbg {background-color:#D0D0D0; color:black; }
  pre.expected {background-color:#E0FF80; color:black; }
  pre.input {background-color:#E08080; color:black; }
  pre.inclusion {background-color:#D070D0; color:black; }
  code.inclusion {background-color:#D070D0; color:black; }
  .obsolete { background-color:#FFEFEF; font-size: small; color:black; }
  .future { background-color:#FF8080; font-size: small; color:black; }
  .implementation_detail { background-color:#E0E0E0; font-size: small; color:black;  }
  .bug { background-color:#FFE0E0; font-size: small; color:black; }
  .fixed{ background-color:#FFE0E0; font-size: small; color:black; }
  .done { background-color:#FFE0E0; font-size: small; color:black; }
  .caveat { background-color:#FF8080; color:black; }
  </style>
  """;
  }
  mathjax := '''
  <script type="text/x-mathjax-config">
    MathJax.Hub.Config({
      tex2jax: {
          skipTags: ["script","noscript","style","textarea"]
      }
    });
  </script>
  <script type="text/javascript"
    src="http://cdn.mathjax.org/mathjax/latest/MathJax.jsconfig=TeX-AMS-MML_HTMLorMML">
  </script>
  ''';
  
  
  var xlat_felix: string * string -> bool * string;
  
  xlat_felix = Dynlink::load-plugin-func2 [bool * string, string, string] (
    dll-name="flx2html", setup-str="", entry-point="flx2html"
  );
  
  
  var filename = System::argv 1;
  if filename == "--style" do
    println$ Css4Html::flx_head;
  elif filename == "--mathjax" do
    println$ mathjax;
  else
    eprintln$ "Formatting file " + filename;
    var b = load filename;
    needs_mathjax', txt := xlat_felix (b,"");
    println$ "<pre class='flxbg'>\n"+txt+"\n</pre>";
  done