Skip to content

Update docs #15

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

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

Update docs #15

wants to merge 3 commits into from

Conversation

ascpial
Copy link
Contributor

@ascpial ascpial commented Sep 13, 2024

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 ascpial marked this pull request as draft September 13, 2024 16:59
@ascpial
Copy link
Contributor Author

ascpial commented Sep 13, 2024

The description for addTask is missing

@ascpial ascpial marked this pull request as ready for review September 13, 2024 17:11
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.

1 participant