5.6 KiB
title | template | taxonomy | routes | ||||
---|---|---|---|---|---|---|---|
Write documentation | docs |
|
|
! This page is outdated and should be reworked
Via GitHub
The YunoHost documentation is managed through a Git repository.
If you are not familiar with GitHub, there is an "Edit" button at the top of each page that will redirect you to the GitHub online editor that will help you making your change proposals (Pull Requests).
Directly on GitHub, you can fork the repository, make your changes, and send pull requests.
Because the online editor doesn't support uploading files, using Git is the prefered way if you need to upload media (e.g. images).
Grav
Under the hood, the documentation is served by the Grav CMS.
The structure of the repository is described below:
+-- config
+-- site.yaml
+-- system.yaml
+-- themes
+-- yunohost-docs.yaml
# Some settings for the documentation theme
+-- images
# Contains the images used in the documentation pages.
+-- pages
# The directory containing the documentation pages.
# The pages hierarchy is reflected by the directory hierarchy.
+-- 00.home
+-- 01.administrate
+-- 02.applications
+-- 03.community
+-- 04.contribute
+-- themes
+-- learn4
+-- yunohost-docs
# Contains the theme's code, which extends Learn4 theme's code
+-- .gitignore
# Contains the instructions to not send sensitive
# or useless files over to the Git repository
+-- README.md
!!!! To learn more about Grav's features, you can head over to its documentation. The remainder of this page will show you some specific instructions to contribute to YunoHost's documentation.
Grav header
Each page starts with a header that gives instructions to Grav on how to process them. Let us have a look into the header of this page:
---
title: Write documentation
template: docs
taxonomy:
category: docs
routes:
default: '/write_documentation'
---
- The header starts and ends with a line containing
---
- The
title
key manages the first heading title of the page, its name in the navigation menu on the left, and its name in the browser tab template
andtaxonomy
keys should always be left as is. They instruct Grav to use the proper theme and order the pages properly.routes
'default
key makes the page available by default onhttps://yunohost.org/docs/write_documentation
instead of needing to reaching it onhttps://yunohost.org/docs/contribute/write_documentation
, which is where it is stored in the directory hierarchy.
Syntax
You can use Markdown syntax, refer to the documentation for further information.
To improve Markdown capabilities, additional plugins are installed in Grav. You can refer to their own documentation on GitHub to see how to use them.
anchors
external_links
flex-objects
highlight
image-captions
markdown-notices
presentation
presentation-deckset
shortcode-core
Special pages
Some pages of the documentation are automatically or dynamically generated.
Page | Path | Notes |
---|---|---|
Apps catalog | /pages/02.applications/01.catalog/apps.md |
Retrieves and processes app.json |
Apps helpers | pages/04.contribute/04.packaging_apps/11.helpers/packaging_apps_helpers.md |
Generated by this script, from this template |
Per-app documentation | pages/02.applications/02.docs/docs.md |
Lists the subpages in the same directory which have taxonomy.category: docs, apps in its header |
Host your own testing documentation
! These instructions are yet to be fully tested. Please help us by reporting any issue you may have with them.
- Fork YunoHost documentation repository
- Install Grav's YunoHost package:
yunohost app install grav
- Install the following plugins through Grav's admin panel or CLI:
anchors
breadcrumbs
external_links
feed
flex-objects
git-sync
highlight
image-captions
langswitcher
markdown-notices
presentation
presentation-deckset
shortcode-core
tntsearch
- Set-up Git Sync plugin.
- Choose GitHub and your credentials on GitHub
- Set the repo, e.g.
https://github.com/username/doc
- Copy the Webhook's URL, e.g.
https://grav.example/_git-sync-ca25c111f0de
- Basic settings > Folders to Sync:
pages
images
themes
- Git Repo Settings > User not required: Enabled
- Git Repo Settings > Web Hooks secret: Enabled
- Advanced settings > local branch:
master
- Advanced settings > remote branch:
master
(you can changemaster
if you want to work on another branch, but do not forget to create it on GitHub first) - Advanced settings > Committer Name: your GitHub username
- Advanced settings > Committer Email: your email saved on GitHub
- Save and Reset Local Copy
- Set
commits
andtree
keys inconfig/themes/yunohost-docs.yaml
to point to your fork's repository - Make sure
user/pages/01.home
anduser/pages/02.typography
directories are deleted. - Configuration > System:
- Language > Supported:
en
fr
de
es
ar
- Language > Override Default Language:
en
- Language > Set language from browser:
Yes
- HTTP Headers > Etag:
Yes
- Advanced > Blueprint Compatibility:
Yes
- Advanced > YAML Compatibility:
Yes
- Advanced > Twig Compatibility:
Yes
- Language > Supported: