https://github.com/webvpf/wn-simpledocs-plugin
Simple documentation for Winter CMS website
https://github.com/webvpf/wn-simpledocs-plugin
docs documentation documentation-site wintercms wintercms-plugin
Last synced: about 1 year ago
JSON representation
Simple documentation for Winter CMS website
- Host: GitHub
- URL: https://github.com/webvpf/wn-simpledocs-plugin
- Owner: WebVPF
- License: mit
- Created: 2021-06-12T11:55:08.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-03-04T07:00:24.000Z (about 2 years ago)
- Last Synced: 2025-03-28T10:50:31.167Z (about 1 year ago)
- Topics: docs, documentation, documentation-site, wintercms, wintercms-plugin
- Language: PHP
- Homepage: https://packagist.org/packages/webvpf/wn-simpledocs-plugin
- Size: 320 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wn-simpledocs-plugin
Simple documentation for WinterCMS website

Screenshots: https://github.com/WebVPF/wn-simpledocs-plugin/issues/2
## Installing Composer
```bash
composer require webvpf/wn-simpledocs-plugin
```
## Documentation creation
To display documentation on the site, create three files (layout template and two CMS pages).
## Documentation layout template
Create a new layout for your documentation template. To do this, create a file `docs.htm` with the following content in the folder `themes/nameTheme/layouts`:
```twig
description = "Template for documentation"
[DocsMenu]
docPage = "docs/item"
==
{{ this.page.title }}
{% styles %}
{% if item.css %}
{{ item.css|raw }}
{% endif %}
{% component 'DocsMenu' %}
{% page %}
{% scripts %}
{% if item.js %}
{{ item.js|raw }}
{% endif %}
```
## Documentation Pages
Now we need to create two CMS pages. One of them will display **Main documentation page**, the second - documentation records.
Both of these pages will be hidden. Hidden pages are only available to logged in users (authorized in the backend). To make your documentation available to everyone on the Internet, simply remove the `is_hidden = 1` parameter from the page settings.
### Documentation main page
Create a file `docs.htm` in the folder `themes/nameTheme/pages/docs`
```ini
title = "Documentation"
url = "/docs"
layout = "docs"
is_hidden = 1
==
This is the main documentation page.
```
### Documentation record output page
Create a file `item.htm` in the folder `themes/nameTheme/pages/docs`
```ini
title = "Documentation record page"
url = "/docs/:slug"
layout = "docs"
is_hidden = 1
[DocsItem]
slug = "{{ :slug }}"
stek = "wn"
theme = "default"
==
{% component 'DocsItem' %}
```
Styles for quick start connected in layout:

## Code highlighting
Use Markdown syntax to insert example code into the text of your document.
Before the beginning of the code and at the end, insert lines of characters ```.
Add the identifier of the programming language or technology to which the code belongs to the first three quotes. For example, for HTML the identifier is `html`, for CSS - `css`, for JavaScript - `javascript` or a short synonym `js`.
Example of inserting PHP code:
```php
public function nameFunction()
{
return 'Text';
}
```
### Language identifiers
- [All identifiers](https://github.com/WebVPF/wn-simpledocs-plugin/wiki/highlight-%D0%92%D1%81%D0%B5-%D1%8F%D0%B7%D1%8B%D0%BA%D0%B8)
- [stack WinterCMS](https://github.com/WebVPF/wn-simpledocs-plugin/wiki/highlight-%D1%81%D1%82%D0%B5%D0%BA-WinterCMS)