An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# wn-simpledocs-plugin

Simple documentation for WinterCMS website

![SimpleDocs](https://raw.githubusercontent.com/WebVPF/wn-simpledocs-plugin/main/assets/img/icons/favicon-96x96.png)

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:

![simpledocs_1](https://user-images.githubusercontent.com/61043464/147873706-3d33e189-34aa-48eb-97cd-6861462476a6.jpg)

## 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)