MichaelHatherly / Lexicon.jl

Julia package documentation generator.
Other
16 stars 18 forks source link

Does Lexicon.jl work with Julia v0.4 built-in doc mechanism? #133

Closed pluskid closed 8 years ago

pluskid commented 8 years ago

att. I tried briefly, but get an empty generated md file. Does Lexicon.jl work with the built-in doc mechanism for Julia v0.4? If not, should I use Docile.jl in v0.4? Would there be conflicting with the built-in documentation related macros? Thanks!

MichaelHatherly commented 8 years ago

Lexicon relies on Docile's internals for doc collection, though it should still work on 0.4. I'll be phasing Lexicon out over the next few months in favour of the https://github.com/MichaelHatherly/Docile.jl/tree/rewrite branch that now supports generating external docs among other things.

The self-generated docs for that branch should provide you an overview of what's been implemented so far. If you do try it out and run into problems with it feel free to open issues in the Docile repo.

pluskid commented 8 years ago

Thanks! I found that there was a configure mistake in my code. Now it works.

However, I still have one question: under Julia v0.4, does Lexicon/Docile use the built-in mechanism to get documentation or does Docile parse the source file itself? I'm asking because I have some functions that are automatically generated (imported from a shared library) during module start-up. I use eval to define those new functions and add documents by

  eval(:(@doc($f_desc, $func_name)))

Now I can see the documents in REPL by typing question mark. However, it seems Lexicon.jl cannot find those documents.

MichaelHatherly commented 8 years ago

does Docile parse the source file itself?

Yes, currently it's still parsing the AST itself which means that generated code cannot be documented. With the rewrite branch most of Docile has been rewritten to make use of the builtin docsystem to generate external docs. I'll hopefully have that branch finalised and released relatively soon.

pluskid commented 8 years ago

@MichaelHatherly Thanks! I see. The rewrite branch looks promising. I will try it out!

randy3k commented 8 years ago

I have the same issue as @pluskid 's : all the files generated are empty. The result of doctest is

running doctest on RCall...
[module summary]

 *   module: RCall
 * exported: 31
 *  entries: 0

[doctest summary]

 * pass:     0 / 0
 * fail:     0 / 0
 * skip:     0 / 0

The build.jl is here. @pluskid, what did you do to fix your problem?

randy3k commented 8 years ago

Figure it out. I am on Julia v0.4. For compatibility issues, our package is still using the v0.3 syntax

@doc "bla bla bla"->
function f(x)
x
end

and Lexicon.jl fails to build the docs. However, if I switch to the v0.4 string type doc syntax,

"bla bla bla"
function f(x)
x
end

then it works.

I guess it is an issue of Docile. Let me file an issue there.