Skip to content

Commit

Permalink
docs: swap config.yaml reference to RST
Browse files Browse the repository at this point in the history
  • Loading branch information
lengau committed Dec 19, 2024
1 parent ea3cf43 commit 52b4364
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 80 deletions.
80 changes: 0 additions & 80 deletions docs/reference/files/file-config-yaml.md

This file was deleted.

66 changes: 66 additions & 0 deletions docs/reference/files/file-config-yaml.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
.. _file-config-yaml:
.. highlight:: yaml

``config.yaml``
***************

.. important::
Starting with Charmcraft 2.5, this file is created automatically from information
you provide in :ref:`charmcraft.yaml<file-charmcraft-yaml>`. For backwards
compatibility, Charmcraft will continue to allow the use of this file, but you may
not duplicate keys across the two files.

The ``config.yaml`` in a charm's root directory is an optional file that may be used to define the configuration options supported by a charm.

The definitions are collected under a single YAML map called ``options``. The rest of this doc gives details about this map.

``options``
===========

**Status:** Required if the file exists.

**Purpose:** The ``options`` key allows charm authors to declare the configuration options that they have defined for a charm.

**Structure:** The key contains a definition block for each option, where each definition consists of a charm-author-defined option name and an option description, given in 3 fields -- type, description, and default value:

.. code::
options:
<option name>:
default: <default value>
description: <description>
type: <type>
<option name>:
default: <default value>
description: <description>
type: <type>
...
In some cases, it may be awkward or impossible to provide a sensible default. In these cases, ensure that it is noted in the description of the configuration option. It is acceptable to provide ``null`` configuration defaults or omit the ``default`` field.


.. dropdown:: Example

.. code::
options:
name:
default: Wiki
description: The name, or Title of the Wiki
type: string
skin:
default: vector
description: skin for the Wiki
type: string
logo:
default:
description: URL to fetch logo from
type: string
admins:
default:
description: Comma-separated list of admin users to create: user:pass[,user:pass]+
type: string
debug:
default: false
type: boolean
description: turn on debugging features of mediawiki

0 comments on commit 52b4364

Please sign in to comment.