Skip to content

Commit

Permalink
Include BaseKeys in docs #126
Browse files Browse the repository at this point in the history
  • Loading branch information
einarf committed Nov 30, 2024
1 parent 2336783 commit ca0d477
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
5 changes: 5 additions & 0 deletions docs/reference/context/base.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@
:members:
:inherited-members:
:show-inheritance:


.. autoclass:: moderngl_window.context.base.BaseKeys
:members:
:undoc-members:
32 changes: 30 additions & 2 deletions make.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import sys
import shutil
import subprocess
import threading
import webbrowser


def docs():
Expand All @@ -31,24 +33,50 @@ def test():
subprocess.run("pytest tests/", shell=True)


def serve():
"""Serve the documentation"""
print("Serving documentation...")

def start_server():
subprocess.run("python -m http.server --directory build/docs", shell=True)

server_thread = threading.Thread(target=start_server)
server_thread.start()

webbrowser.open("http://localhost:8000")
print("Press Ctrl+C to stop the server")
server_thread.join()


def run(args: list[str]):
commands = {
"html": docs,
"lint": lint,
"clean": clean,
"test": test,
"serve": serve,
}
if len(args) == 0:
print("Usage: make.py <command>")
print_help()
return

func = commands.get(args[0])
if func is None:
print(f"Unknown command: {args[0]}")
print_help()
return

func()


def print_help():
print("Usage: make.py <command>")
print("Commands:")
print(" html: Build the documentation")
print(" lint: Run pylint")
print(" clean: Clean up docs and build artifacts")
print(" test: Run tests")
print(" serve: Serve the documentation")


if __name__ == "__main__":
run(sys.argv[1:])

0 comments on commit ca0d477

Please sign in to comment.