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

add auto generated Lua docs #3865

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

IamPete1
Copy link
Member

This adds a new submodule: https://github.com/boolangery/sphinx-lua I have then done a patch on top of that to get what we need.

This then adds two new extensions and uses them to auto generate a nearly ( just missing global methods ) complete set of documentation based on that added to AP recently.

Takes a little messing, will need to install https://github.com/boolangery/py-lua-doc and install the new submodule from its setup.py

Formatting is not fantastic, but we can improve that, this is more just a proof that we can grab the docs from the AP repo and generate the wiki.

I have left in the existing API documentation, since this is not fantastically useful until we flesh it out a little more with descriptions and such.

This is what the page ends up looking like:
Lua Scripts — Copter documentation.pdf

For example:
image

One of the classes that has good documentation:
image

@IamPete1
Copy link
Member Author

updated the setup and build script so this gets past CI.

@IamPete1
Copy link
Member Author

Hopefully setup should now work, it also now uploads the build result as a artifact on actions. So can download and see how it turned out.

@IamPete1 IamPete1 force-pushed the lua-docs branch 2 times, most recently from 5d04456 to b354952 Compare October 28, 2021 23:23
@IamPete1
Copy link
Member Author

changed to only retain artifact for 5 days.

@Hwurzburg
Copy link
Contributor

its not on the LUA wiki page after build... common-lua-scripts.html...., where should I look?

@IamPete1 IamPete1 force-pushed the lua-docs branch 2 times, most recently from d400b2b to 7cdf587 Compare October 29, 2021 13:03
@IamPete1
Copy link
Member Author

added missing python package.

@IamPete1
Copy link
Member Author

Updated the templates to better fit our wiki style. Split out into new page for API docs. Currently this includes the existing manual docs because there better than the auto generated ones. The plan in the future would be to migrate those across and for the new page to be completely auto generated.

The auto generation is still missing things like class and method descriptions that are present in doc.lua so there are some future enhancements to be done. I'm not sure if that issue is in the lua parser or the docs generator.

@Hwurzburg
Copy link
Contributor

does not work on my local build of this PR....ran sphinxsetup.sh then try to build wiki...get this error:
Extension error:
Could not import extension sphinxcontrib.luadomain (exception: No module named 'sphinxcontrib.luadomain')
Makefile:56: recipe for target 'html' failed

@TunaLobster
Copy link
Contributor

Need to rerun Sphinxsetup.sh to install the new python packages.

@IamPete1 Might be helpful to add messages like this one in update.py.
7be6cd3


The API documentation described here is not a complete list, but rather some examples. For a **full list of the methods** currently available, the LUA auto-generated document file is a complete list, It can be found `here <https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_Scripting/docs/docs.lua>`__ and lists all the available bindings and their parameters.

See :ref:`API Docs Syntax<common-lua-API>`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this points to itself???


Getting Started
===============
---------------
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you changing these?

@Hwurzburg
Copy link
Contributor

@IamPete1 lets chat on this when you have a chance...been a while...shall we close...dont think we can get the format pretty, right?

@IamPete1
Copy link
Member Author

We could get the format better, just is a weird template method I was having a hard time with.

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

Successfully merging this pull request may close these issues.

3 participants