Skip to content

Instantly share code, notes, and snippets.

@shashi
Last active October 12, 2015 12:00

Revisions

  1. shashi revised this gist Oct 12, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion docgen.jl
    Original file line number Diff line number Diff line change
    @@ -26,6 +26,6 @@ function main(window)
    m1 = copy(m)
    pop!(m1, m)
    vbox(
    [showdoc(k, v) for (k, v) in m1]...
    [showdoc(k, v) for (k, v) in m1]
    ) |> pad(2em)
    end
  2. shashi created this gist Oct 12, 2015.
    31 changes: 31 additions & 0 deletions docgen.jl
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    using Lazy

    function methoddoc(name, sign, doc)
    vbox(
    fontweight(bold, code(string(name) * "(" * join(map(string, sign.types), ", ") *")" )),
    doc
    )
    end

    function showdoc(fn::Function, fndoc)
    vbox(
    h2(code(string(fn))),
    [methoddoc(fn, typ, fndoc.meta[typ]) for typ in fndoc.order]...
    )
    end

    function showdoc(name, docstr)
    vbox(
    h2(code(name)),
    docstr
    )
    end

    function main(window)
    m = Lazy.__META__
    m1 = copy(m)
    pop!(m1, m)
    vbox(
    [showdoc(k, v) for (k, v) in m1]...
    ) |> pad(2em)
    end