lua-language-server icon indicating copy to clipboard operation
lua-language-server copied to clipboard

A document generate

Open CppCXY opened this issue 11 months ago • 12 comments

see: https://github.com/CppCXY/emmylua-analyzer-rust/actions/runs/12963074050

I wrote a simple documentation generation tool, see the link above, feel free to give it a try. I haven't released it yet because I need to go home from work. I will complete the related work later.

CppCXY avatar Jan 25 '25 07:01 CppCXY

after generate, you can use mkdocs-material, you will get:

Image

Image

CppCXY avatar Jan 25 '25 07:01 CppCXY

Oh, I would love this tool!

I just tried this on https://github.com/beyond-all-reason/recoil-lua-library and got no output

C:\Users\rhysv\Downloads\emmylua_doc_cli-win32-x64>git clone https://github.com/beyond-all-reason/recoil-lua-library.git

Cloning into 'recoil-lua-library'...
remote: Enumerating objects: 302, done.
remote: Counting objects: 100% (302/302), done.
remote: Compressing objects: 100% (136/136), done.
remote: Total 302 (delta 239), reused 223 (delta 165), pack-reused 0 (from 0)
Receiving objects: 100% (302/302), 101.12 KiB | 3.06 MiB/s, done.
Resolving deltas: 100% (239/239), done.

C:\Users\rhysv\Downloads\emmylua_doc_cli-win32-x64>emmylua_doc_cli.exe --input recoil-lua-library/library --output out2
collect_files from: ["recoil-lua-library/library"] match_pattern: ["**/*.lua"] exclude: []
load files from workspace count: 57
loaded file: "recoil-lua-library/library\\generated\\LuaArchive.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaAtlasTextures.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaBitOps.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaConstCMD.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaConstCMDTYPE.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaConstCOB.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaConstEngine.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaConstGame.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaConstGL.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaConstPlatform.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaFBOs.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaFeatureDefs.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaFonts.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaGaia.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaHandle.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaHandleSynced.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaInputReceiver.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaInterCall.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaIntro.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaIO.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaMaterial.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaMathExtra.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaMemPool.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaMenu.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaMetalMap.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaObjectRendering.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaOpenGL.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaOpenGLUtils.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaParser.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaPathFinder.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaRBOs.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaRules.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaRulesParams.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaScream.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaShaders.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaSyncedCtrl.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaSyncedMoveCtrl.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaSyncedRead.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaSyncedTable.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaTableExtra.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaTextures.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaTracyExtra.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaUI.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaUICommand.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaUnitDefs.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaUnsyncedCtrl.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaUnsyncedRead.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaUtils.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaVAO.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaVAOImpl.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaVBO.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaVBOImpl.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaVFS.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaVFSDownload.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaWeaponDefs.lua"
loaded file: "recoil-lua-library/library\\generated\\LuaZip.lua"
loaded file: "recoil-lua-library/library\\Types.lua"
Creating types directory: "out2\\docs\\types"
Creating modules directory: "out2\\docs\\modules"

See output.zip

I also tried with the latest crate from master with the same results:

cargo install --git https://github.com/CppCXY/emmylua-analyzer-rust.git emmylua_doc_cli

rhys-vdw avatar Feb 02 '25 05:02 rhys-vdw

please try absolutely path

CppCXY avatar Feb 02 '25 05:02 CppCXY

please try absolutely path

I'm getting the exact same behaviour with absolute path:

C:\Users\rhysv\Downloads\emmylua_doc_cli-win32-x64\recoil-lua-library\library>emmylua_doc_cli --input C:\Users\rhysv\Downloads\emmylua_doc_cli-win32-x64\recoil-lua-library\library --output out5
collect_files from: ["C:\\Users\\rhysv\\Downloads\\emmylua_doc_cli-win32-x64\\recoil-lua-library\\library"] match_pattern: ["**/*.lua"] exclude: []
load files from workspace count: 57
loaded file: "C:\\Users\\rhysv\\Downloads\\emmylua_doc_cli-win32-x64\\recoil-lua-library\\library\\generated\\LuaArchive.lua"
loaded file: "C:\\Users\\rhysv\\Downloads\\emmylua_doc_cli-win32-x64\\recoil-lua-library\\library\\generated\\LuaAtlasTextures.lua"
loaded file: "C:\\Users\\rhysv\\Downloads\\emmylua_doc_cli-win32-x64\\recoil-lua-library\\library\\generated\\LuaBitOps.lua"
loaded file: "C:\\Users\\rhysv\\Downloads\\emmylua_doc_cli-win32-x64\\recoil-lua-library\\library\\generated\\LuaConstCMD.lua"
...

The only difference is that the "loaded file" logs include the full path.

rhys-vdw avatar Feb 02 '25 05:02 rhys-vdw

please report to the project repo,I'll take a look when I have time.

CppCXY avatar Feb 02 '25 05:02 CppCXY

It work well, on my local machine

Image

Image

CppCXY avatar Feb 02 '25 10:02 CppCXY

the web Image

CppCXY avatar Feb 02 '25 10:02 CppCXY

I see, you didn’t place the resources alongside the CLI tool, and they contain basic type definitions and template files.

CppCXY avatar Feb 02 '25 11:02 CppCXY

I see, you didn’t place the resources alongside the CLI tool, and they contain basic type definitions and template files.

I don't understand. Can you explain what I need to do to get it to work? Which resources?

rhys-vdw avatar Feb 02 '25 14:02 rhys-vdw

I see, you didn’t place the resources alongside the CLI tool, and they contain basic type definitions and template files.

I don't understand. Can you explain what I need to do to get it to work? Which resources?

in my project's resources dir

CppCXY avatar Feb 02 '25 14:02 CppCXY

Thanks, I opened the above issue in your repo. I will try to integrate these docs into our website soon. ❤

rhys-vdw avatar Feb 03 '25 02:02 rhys-vdw

Just wanted to say I had great success using emmylua_cli_doc.

The workflow needed to auto-generate docs is pretty concise

https://github.com/ColinKennedy/nvim-best-practices-plugin-template/blob/e9bb024fe7f9a067f70a84c6d67ebb567f9a5d83/.github/workflows/documentation.yml#L29-L50

and the output uploads to gh-pages super easily, here: https://colinkennedy.github.io/nvim-best-practices-plugin-template/

Highly recommended 👍. Thank you @CppCXY!

ColinKennedy avatar Feb 16 '25 05:02 ColinKennedy