From 4953c81bf9d8bffc631894f7a6d23c0992001378 Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Sun, 25 Apr 2021 16:59:37 +0100 Subject: [PATCH] Updated 1 Project Layout (markdown) --- 1-Project-Layout.md | 104 +++++--------------------------------------- 1 file changed, 10 insertions(+), 94 deletions(-) diff --git a/1-Project-Layout.md b/1-Project-Layout.md index ba786e4..ea0bfcf 100644 --- a/1-Project-Layout.md +++ b/1-Project-Layout.md @@ -2,97 +2,13 @@ This Wiki page outlines how the Plugin is constructed and what does what. It has been initially produced as part of [Issue #87](https://github.com/markcheret/footnotes/issues/87), but is a living document and is intended to keep up-to-date with changes to the project structure. As such, it is only intended to provide a high-level overview; more detailed documentation can be found in the automatically-generated documentation [here](https://markcheret.github.io/footnotes/). -# Top-Level Repo. Layout - -| Dir. Name | Description | -|------|-------------| -| `assets/` | Files to be stored in the [`assets/` directory](https://plugins.svn.wordpress.org/footnotes/assets/) on the SVN repo. (e.g., screenshots for the Plugin information page). | -| `docs/` | Automatically-generated documentation files. | -| `src/` | The source code for the Plugin itself. | -| `_tools/` | Useful Bash scripts (@todo this should eventually be merged with `.github/workflows/`). | -| `.github/` | GitHub Actions workflows and Issue templates. | - -# Root Files - -| File Name | Description | -|------|-------------| -| `CHANGELOG.md` | The full project changelog. | -| `CODE_OF_CONDUCT.md` | The project CoC. | -| `composer.json` & `composer.lock` | Declares Composer dependencies and scripts. | -| `CONTRIBUTING.md` | A guide to contributing to the project. | -| `LICENSE` | The license under which the project is released. | -| `package.json` & `package-lock.json` | Declares NPM dependencies and scripts. | -| `README.md` | Provides an overview of the project. | -| `SECURITY.md` | Provides guidance on reporting security-related issues. | -| `wpml-config.xml` | Used by the [WPML Plugin](https://wpml.org/documentation/support/language-configuration-files/) for translation. | -| `.distignore` | Lists files to ignore when building the Plugin for distribution (@todo this is not currently used). | -| `.eslintignore` & `.eslintrc.js` | Config. files for JavaScript linting. | -| `.gitignore` | Lists files to exclude from Git version control. | -| `.prettierignore` & `.prettierrc` | Config. files for JavaScript formatting. | -| `.stylelintignore` & `.stylelinttc.json` | Config. files for stylesheet linting. | - -# Plugin Source (`src/`) Layout - -## Plugin Source Root Files - -| File Name | Description | -|------|-------------| -| `footnotes.php` | The Plugin entry point. | -| `includes.php` | Includes all of the PHP files. | -| `license.txt` | The license under which the Plugin is released. | -| `readme.txt` | The Plugin readme for display on the WordPress Plugin Directory. | - -## Plugin Source Root Directories - -| Dir. Name | Description | -|------|-------------| -| `class/` | Contains the Plugin PHP code, providing most of its functionality. | -| `css/` | Contains the Plugin stylesheets. | -| `img/` | Contains images used by the Plugin (@todo can this be merged with the root `assets/` dir?). | -| `js/` | Contains JavaScript files used by the Plugin. | -| `languages/` | Contains Plugin translation files for various languages. | -| `templates/` | Contains HTML template files used by the Plugin to render various page elements. | - -## `class/` Sub-directory - -### `class/` Root Files - -Important files are highlighted in **bold** text. - -| File Name | Description | -|------|-------------| -| `config.php` | Defines various constants (@todo rename to something more accurate). | -| `convert.php` | Provides various conversion functions. | -| `hooks.php` | Registers actions with various WordPress hooks. | -| **`init.php`** | Defines the Plugin object. | -| `language.php` | Loads translation settings. | -| **`settings.php`** | Defines the various Plugin settings. | -| **`task.php`** | Provides the core function of the Plugin. | -| `templates.php` | Loads the various template files. | -| `wysiwyg.php` | Provides integration with the WordPress WYSIWYG editor. | - -### `class/` Sub-directories - -| Dir. Name | Description | -|------|-------------| -| `dashboard/` | Contains the files that handle dashboard page construction. | -| `widgets/` | Contains the files that handle widget construction. | - -### `class/dashboard/` Sub-sub-directory - -#### `class/dashboard/` Files - -| File Name | Description | -|------|-------------| -| `init.php` | Initialises the Plugin settings page. | -| `layout.php` | Defines a common interface for rendering dashboard pages (@todo merge with `subpage-main.php`) | -| `subpage-main.php` | Defines the Plugin settings page layout. | - -### `class/widgets/` Sub-sub-directory - -#### `class/widgets/` Files - -| File Name | Description | -|------|-------------| -| `base.php` | Defines a base class for all widgets. | -| `reference-container.php` | Defines the Reference Container widget. | \ No newline at end of file +1. Repo. Root +1. Plugin Source directory (`src/`) + 1. Plugin classes sub-directory (`src/class/`) + 1. Plugin Dashboard sub-directory (`src/class/dashboard/`) + 1. Plugin Widgets sub-directory (`src/class/widgets/`) + 1. Plugin stylesheets sub-directory (`src/css/`) + 1. Plugin images sub-directory (`src/img/`) + 1. Plugin scripts sub-directory (`src/js/`) + 1. Plugin translations sub-directory (`src/languages/`) + 1. Plugin templates sub-directory (`src/templates/`) \ No newline at end of file