Skip to content

Latest commit

 

History

History
72 lines (46 loc) · 1.11 KB

api-reference.md

File metadata and controls

72 lines (46 loc) · 1.11 KB

API Reference

This document provides a detailed reference for the Zenith API.

Zenith.WApp

The Zenith.WApp class is used to create a Zenith application.

Example:

app = Zenith.WApp()

Methods

  • serve(): Starts the Zenith server.

Example:

app.serve()

Zenith.Builder

The Zenith.Builder class is used to create Zenith components.

Example:

builder = Zenith.Builder({"home": homePageContent})

Methods

  • Build(): Builds the Zenith components.

Example:

built = builder.Build()
  • getRoutes(): Returns the routes from the built components.

Example:

for route in builder.getRoutes():
    app.register_route(f'{route}', built[route])

Stylesheet

The Stylesheet class is used to style Zenith components.

Example:

stylesheet = Stylesheet(builder, "HomePage", {
    "id.header": 
    {
        "foreColor": "#000",
        "fontSize": 22
    }
})

Conclusion

This is a brief overview of the Zenith API. For more detailed information, please refer to the official Zenith documentation.