MCJack123 / PrimeUI

A collection of UI component primitives for ComputerCraft.
26 stars 7 forks source link

Update docs #15

Open ascpial opened 1 month ago

ascpial commented 1 month ago

I updated the doc to reflect the current state of the library.

The documentation has been generated with ldoc. To do so, I wrote a small python script to pack everything in one file:

files = []
with open("init.lua", 'r') as file:
    for line in file.readlines():
        elements = line.strip().split("require ")
        if len(elements) > 1:
            files.append(elements[1][1:-1])

with open("PrimeUI.lua", 'w') as file:
    for modulename in files:
        print(modulename)
        with open(modulename+".lua", 'r') as module:
            content = module.read().strip()
            if "-- Start copy" in content:
                content = "\n".join(content.split("\n")[4:])
            if "-- DO NOT COPY" in content:
                content = "\n".join(content.split("\n")[:-2])
            content = content.strip()
            file.write(content+"\n\n")

    file.write("return PrimeUI")

I then added this comment under local PrimeUI = {} to declare the module description, or it will take the one from addTask: --- A collection of UI component primitives for ComputerCraft. I also added an empty doc comment above the doc of addTask.

The command to generate the docs from the above file is: lua ../ldoc/ldoc.lua PrimeUI.lua -d docs

ascpial commented 1 month ago

The description for addTask is missing