Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autogenerated lua documentation #4

Closed
3 of 4 tasks
bmatsuo opened this issue Dec 30, 2015 · 5 comments · Fixed by #20 or #76
Closed
3 of 4 tasks

Autogenerated lua documentation #4

bmatsuo opened this issue Dec 30, 2015 · 5 comments · Fixed by #20 or #76
Milestone

Comments

@bmatsuo
Copy link
Owner

bmatsuo commented Dec 30, 2015

The disconnect between implementation and documentation is destined to repeatedly get out of sync. Ideally documentation could be attached to the implementation and extracted by a tool. Bonus points are available to a solution that allows the lark command to be used to browse docs (possibly through an embedded interpreter).

  • collect a list of documentation tools: LuaDoc, annotate, ???
  • choose an existing tool or decide to hand-roll one: write a simple annotation based dsl.
  • switch documentation over.
  • setup generation of static HTML/Markdown.
@bmatsuo
Copy link
Owner Author

bmatsuo commented Dec 31, 2015

I found a couple potential solutions, neither project seems particularly active over the past years though:

  • LuaDoc -- a comment parsing solution. It's not clear how/if this would work for functions defined in Go.
    • I could probably create lua "header" files with stub definitions and all the doc comments. That seems like it would work.
    • LuaDoc probably wouldn't need to be integrated directly into Lark initially. It seems like it could run as an external thing.
  • annotate -- a decorator solution. I believe this should work fine for documenting functions written in Go. The issue becomes loading the library into the binary at compile time. The core lib is pretty small and could potentially be ported to pure Go. The support libraries vary in size but can be quite large. (edit: scratch that I believe a shared C library is required. This may be a non-starter.) (edit 2: Yes. A C library is required. I don't thing I will be porting that library 😞)

@bmatsuo
Copy link
Owner Author

bmatsuo commented Dec 31, 2015

This has made me realize that there is some difficulty in presenting third-party libs as part of the (self-contained) Lark system. The utility of a library needs to be carefully weighed against the cost of integration.

I think a simple decorator based DSL could probably work fine in this case and avoid the need to include a third-partly lib. For users, it's not clear how important a particular documentation solution is. It seems most important that the documentation is available and in a format that makes sense (particularly in regard to function signatures).

@bmatsuo bmatsuo changed the title Standard auto-generated lua documentation Autogenerated lua documentation Dec 31, 2015
@bmatsuo
Copy link
Owner Author

bmatsuo commented Feb 3, 2016

Another desirable result from a documentation solution would be the ability to browse task documentation using the lark command. An annotation based solution seems like it would work the best for this situation.

@bmatsuo
Copy link
Owner Author

bmatsuo commented Mar 3, 2016

This issue was closed accidentally by #20.

@bmatsuo bmatsuo modified the milestones: Unplanned, v0.4.0, v0.5.0 Mar 3, 2016
@bmatsuo
Copy link
Owner Author

bmatsuo commented Mar 6, 2016

I've started working on a static html generator for the lua doc module. But I'm realizing that it may be simpler in this regard if #24 did not include the entire "lark.task" module in the lark.task field. I think it should just include an alias to the create() function.

There is a potential problem generating documentation recursively on nested objects/functions. It's not entirely clear how big of a problem this is. If lark.task is declared as a variable then it can be omitted from any recursive documentation gathering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant