Closed AntumDeluge closed 3 years ago
@SmallJoker, @BuckarooBanzay, if you have suggestions, I would like to hear them.
Wow, the docs look awesome :+1: i like the included items and settings
Just two questions:
ldoc
fork? (i see the LDoc 1.4.6-antum-dev
in the footer)master
branch and instead use a workflow to include them in the gh-pages
branch? (not sure if you just did this here to show progress)does it need your `ldoc` fork?
At the moment, yes. But I have put in a PR upstream to allow using Lua built-in objects & functions. If it doesn't get accepted, I would try to find some kind of workaround so main branch can be used, hopefully.
can we exclude the generated html-docs from the `master` branch and instead use a workflow to include them in the
`gh-pages` branch?
I am new to GitHub workflows, so you probably know better than I do. But I imagine it is possible. Will a workflow allow the docs to be generated on the gh-pages
branch?
Edit: I just found an LDoc PR for this same thing. So I can most likely use it to learn how to build the docs on the gh-pages
branch. That will help solve at least one of the issues I was having, I think, that was requiring using a custom LDoc.
I am new to GitHub workflows, so you probably know better than I do. But I imagine it is possible. Will a workflow allow the docs to be generated on the gh-pages branch?
no pressure, i've done that on some other repos and can do it here afterwards :+1:
@SmallJoker or @BuckarooBanzay: A couple questions:
armor_element
parameter of armor:unequip a string? (code)base
parameter of armor:register_armor_group? (code) (Edit: I made it "Base armor value")This is ready for review. But it does require my fork of LDoc to build the documentation (which is the version used in the workflow). And I think it will take some tweaking to get it to build with a GitHub workflow. The gendoc.sh
script depends on ldoc
command being in the PATH.
Currently, docs are created in the 3d_armor/docs/reference
directory.
Oooh, I figured out how deploy on gh-pages
branch using workflow. 🙂
As it is now, the documentation link will be: https://minetest-mods.github.io/3d_armor/reference
Forgot to change image links when I changed to building in gh-pages
branch.
Edit: Not sure why images are not displaying for me in live preview. Hoping its a browser caching issue as it works for local builds. Turns out to be an issue with the Lua string
global not being recognized on the remote build.
Edit: I just realized what the problem is. I put the import
function in behind the UNSAFE_NO_SANDBOX
flag. So I need to add that to the workflow command.
Edit: Fixed.
The only thing I would like better would be if the navigation panel wasn't static & didn't scroll with the rest of the page. I think maybe it can be done in CSS, but I'm not sure how.
Edit: Ooh, I just figured that out too. 🙂
A bit hard to test locally with all those github-links but it looks good :+1:
Also: leafo/gh-actions-luarocks@v4
is new to me, i think this will help me somewhere else where i did that manually in a workflow
A bit hard to test locally with all those github-links
You mean the links to images? Perhaps it would be better to copy the images to the gh-pages
branch so they can be linked locally?
Perhaps it would be better to copy the images to the gh-pages branch
Nah, thats ok how it is currently, copying it would result in redundant files (although git would handle that properly :thinking:)
@BuckarooBanzay #60 actually does change it to copy images to gh-pages branch.
Yeah i saw :laughing:
I checked the repos i used my mtinfo
mod on (it creates a static page with recipe infos) and i'm copying the textures there too to the gh-pages
branch and it looks like git handles that pretty well :+1: (https://github.com/mt-mods/technic / https://mt-mods.github.io/technic/#/mods/technic/items)
Adds HTML documentation generation using LDoc.
Live preview available here.
File explanation:
gendoc.sh
: Script for automatingldoc
invocation (not needed for using workflow)..ldoc/config.ld
: Configuration read by LDoc..ldoc/parse_src.py
: Script for generating temporary files to create topics for each item type.@topic
calls inarmor.lua
using the--multimodule
command line switch (PR 355).ldoc/parse_settings.py
: Script for generating a temporary file fromsettingtypes.txt
that is LDoc readable..ldoc/parse_crafts.py
: Script for generating temporary file for crafting topic.Usage:
Workflow:
A GitHub workflow is configured to generate documentation & deploy on the
gh-pages
branch when there is a push tomaster
.Manual:
To manually generate documentation, execute shell script
gendoc.sh
in the modpack root directory.By default, documentation files are exported to
3d_armor/docs/reference
. This can be changed by settingexport_dir
environment variable:Notes:
gendoc.sh
script can be executed from any directory.config.ld
is configured to re-add "shields:" prefix.TODO:
hitter
from armor:punch (ObjectRef?)player
&index
from armor:run_callbacks (ObjectRef, int?)armor_element
from armor:unequip (string?)preview
from armor:add_previewitem_name
from armor:get_element (string?)base
from armor:register_armor_groupindex
&stack
from armor:damagepreview
from armor:add_previewname
&listring
from armor:get_armor_formspeclist
from armor:serialize_inventory_listlist_string
from armor:deserialize_inventory_listmsg
from armor:get_valid_player3d_armor/armor.lua
shields/init.lua
3d_armor/docs/settings.luadoc
after HTML docs generatedconfig.ld
custom_see_handler
function (I'm not good with regular expressions)gh-pages
branchCloses: #54