#242 Doc on one big page

cbeust Tue 17 Jun 2008

Hi everyone,

I was wondering if it would be a lot of work to make the entire fanDoc available on one big page (and/or PDF)? As you can tell from http://testng.org/doc/documentation-main.html, I prefer this kind of documentation because it makes it easier to search through stuff, but maybe it's just me...

-- Cedric

andy Wed 18 Jun 2008

We probably won't do that here on Fandev - but you could do this yourself if you're feeling brave. All the source for building the documentation is available in the builds (docCompiler). And the actual docs are in fan/src/doc/.

Search is high on my list and will be improved in time to encompass the entire site including docs.

brian Wed 18 Jun 2008

Cedric,

That might be a nice feature to add to docCompiler - although probably not something I'll be able to get to quickly unless a lot of people ask for it. In the meantime try this script:

using fandoc

class FlatDoc
{
  Void main(Str[] args := Sys.args)
  {
    if (args.isEmpty) { echo("flatdoc <dir>"); return }
    dir := File.os(args.first)

    // write to stdout
    html := HtmlDocWriter.make
    html.out.printLine("<html><head/><body>")

    // read index file and process each chapter file
    Obj[] index := (dir+`index.fog`).readObj
    index.each |Obj row|
    {
      // chapters are serialized as [name, blurb]
      item := row as Obj[]
      if (item == null) return
      f := dir + "${item[0]}.fandoc".toUri
      html.out.printLine("<h1 class='chapter'>${item[0]}</h1>")
      doc := FandocParser.make.parse(f.name, f.in)
      doc.writeChildren(html)
      html.out.printLine("<hr/>")
    }
    html.out.printLine("</body></html>")
  }
}

It will generate a big flat HTML file to stdout from source for an entire pod:

flatdoc doc\docLang\doc >flat.html

That script works OK, but won't do hyperlinks correctly - you'd have to write a custom hook for the link nodes.

Login or Signup to reply.