Minetest Lua API Python Parser - lua_api.txt as HTML !

Post Reply
User avatar
LMD
Member
Posts: 1397
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Minetest Lua API Python Parser - lua_api.txt as HTML !

by LMD » Post

Minetest Lua API Python Parser
[mt-lua-api-pyparse]
So, well, I was continuing the development of Magic-CTF, and that forced me to look at lua_api.txt more and more, as the developer wiki didn't contain enough or was even wrong. I was told it couldn't be maintained.
And that's fine.
Therefore, I wrote this little stuff in Python, HTML & CSS. It uses Bootstrap 4 and JQuery.

HTML Version : https://appgurueu.github.io/lua_api.html
Note there's also rubenwardy's version : http://rubenwardy.com/minetest_modding_ ... a_api.html
But our versions are different.
Spoiler
Image
ImageImage
IMO it can really help you navigating in the Lua API Docs, and is beautiful, too !

Give it a try !

Video : https://www.youtube.com/watch?v=7RcMpAu ... e=youtu.be
Instructions/Features : This small python script creates a HTML file out of the newest lua_api.txt, and, for fun, a background, too. The HTML tries to look nice and be easily navigable; therefore, a navigable table of content is there.
If you want to see the features, watch the video !

And if you want to execute it yourself :
1. Download repository
2. Execute python script ("python parserv5.py"). Note it requires python 3.2 or higher.
3. This is how it should look like :

Code: Select all

**Minetest lua_api.txt Markdown parser - mt-lua-api-pyparse - converts Markdown to HTML document with navigation**
**Written by Lars Müller alias LMD in Python 3.5 - requires Python >= 3.2**
**Furthermore, this script has to be in the same folder as generate_bg.py, template.html, jumbotron.css, and the images taken from Minetest Game.**
**The images taken from Minetest Game are licensed under CC-BY-SA 3.0, credits go to the Minetest Artists.**
**Generating underground Minetest scene...**
**...finished generating scene.**
**Grabbing newest lua_api.txt, make sure you have an internet connection...**
**...grabbed newest lua_api.txt from official Minetest repository.**
**Starting parsing...**
**...finished parsing.**
**Creating content table...**
**...finished creating content table. 321 Headers are included.**
**Inserting content into template file...**
**...finished inserting content.**
**Inserting content table into template file...**
**...finished inserting content table.**
**Saving as lua_api.html...**
**...saved.**
**Parser finished successfully and lua_api.html was generated.**
Licence : GPLv3
GitHub/Source : https://github.com/appgurueu/mt-lua-api-pyparse

If you notice minor bugs, please submit them as "Issues" on GitHub.
My stuff: Projects - Mods - Website

Post Reply

Who is online

Users browsing this forum: No registered users and 38 guests