From c2710e72590ccd4ac5a75ce24526838d17723881 Mon Sep 17 00:00:00 2001 From: "Dita Aji Pratama (Home Server)" Date: Sun, 29 Dec 2024 14:25:09 +0700 Subject: [PATCH] Update structure doc --- pages/structure.md | 53 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/pages/structure.md b/pages/structure.md index 808cdc4..25b42be 100644 --- a/pages/structure.md +++ b/pages/structure.md @@ -1,17 +1,48 @@ -# Known the structure +# Known the Structure -![CostaPy structure](../images/structure.png "CostaPy have a 4 type of file") +This section outlines the directory structure for the framework and provides descriptions for each directory and its purpose. Understanding this structure is crucial for configuring and extending the framework effectively. -It have a 4 type of file: -- Main -- Core -- Configuration -- Content +## Directory Overview -`Main` is the file that you will run with the Python. +### `core` +This directory contains static directory and templating core scripts. It is a critical part of the framework with the following contents: -`Core` is the place to put the extension script. +- **`staticdir` (required):** + - Used by the launcher `costa.py` to merge a static handler from directory configuration. +- **`template` (required):** + - Supports `config.directory` by adding a static handler from templates. +- **`html` (optional):** + - Provides a HTML templating. Will not be used if you do not have a template. + +### `config` +This directory holds configuration files for the framework. + +### `script` (optional) +A directory to store additional patches or scripts for extending the functionality of the framework. + +### `procedure` (optional) +Contains stable, update-less functions. One or more modules might use these functions. + +### `modules` +A mandatory directory that contains the modules of the framework. This is the core functionality of your application. + +### `static` (optional) +A front-end static directory. This directory can hold assets like: +- CSS +- JavaScript +- Fonts +- Other front-end libraries + +### `templates` (optional) +A front-end directory specifically for templates. Use this to organize reusable front-end templates. + +### `pages` (optional) +A front-end directory for pages. Use this to organize individual front-end pages. + +## Notes +- Required directories such as `core`, `config`, and `modules` must be present for the framework to function properly. +- Optional directories like `script`, `procedure`, `static`, `templates`, and `pages` can be added as needed based on the project's requirements. + +By adhering to this structure, you ensure clarity, consistency, and modularity in your framework. -`Configuration` is for configuration. -and `Content` is the place for you to create a content.