Commit Graph

16 Commits

Author SHA1 Message Date
Kefu Chai
73dfb8d5a8 doc/_ext: compose name using cur_module and option name
so a mgr option can be referenced using
`mgr/<module_name>/<option_name>`.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-11 15:43:59 +08:00
Kefu Chai
e6254a9dcb doc/_ext: rewrite directive using ObjectDescription
which allows us to use different scheme when defining an option,

without this change, if two options in different mgr module share the
same name we cannot differentiate them, after this change, their id
would prefixed with the module name.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-06 22:21:43 +08:00
Kefu Chai
98dc0d4e85 doc/_ext: load options defined by mgr modules
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-06 20:54:42 +08:00
Kefu Chai
659d01dcb5 doc/_ext: ignore desc if it is unavailable
there is chance that we don't have desc, desc_long or fmt_desc, in that
case, we should just skip desc before checking its length. so, just use
'if desc' which is able to check for None or empty string.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-02 19:57:29 +08:00
Kefu Chai
ab7cb630ae doc/_ext: check "default" for None
default could be None and we don't reference the default value using
`opt.default`, so this variable is always defined. to avoid printing
a None default value, check for a None value. see
https://jinja.palletsprojects.com/en/2.11.x/templates/#none

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-02 18:17:02 +08:00
Kefu Chai
d1aacf555e doc/_ext: print 0B if option value is 0
before this change, the rendered Default is "0Ei" if the default size is 0,
would be more readable if it is "0B" or "0".

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-02 17:50:38 +08:00
Kefu Chai
a2ed53a7fa doc/_ext/ceph_confval: print "false" default values
before this change, we check the exisitence of default value of an
option using "if default", but this is wrong. what if "default" is an
empty string or a numeric value of 0, or just False?

after this change, its exisitence is checked using "if default is
defined", so all "false" default values are rendered as well.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-28 10:39:12 +08:00
Kefu Chai
977ed06f9e doc/_ext/ceph_confval: print out option name if it does not render
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-22 13:00:43 +08:00
Kefu Chai
fffa02706b doc/_ext: use iec_size() instead of filesizeformat()
to format size options in the same format supported by our C++
strict_iec_cast() parser. so they are more consistent from user's
perspective.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-19 17:08:46 +08:00
Kefu Chai
76fb3d147d doc: use "confsec" role for configure section
and rename confval_section to confsec for shorter name

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-19 17:08:45 +08:00
Kefu Chai
02a15a81d8 doc: use ":confval:" role to reference options defined using confval
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-19 17:08:45 +08:00
Kefu Chai
d1c6182fa2 doc/_ext: render see_also field
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-19 17:08:45 +08:00
Kefu Chai
1128f4e22f doc/_ext: render more fields in an option
* print "enum_value" as a list
* print "note" and "warning"

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-19 17:08:45 +08:00
Kefu Chai
4da18aaf57 common/options,doc: extract formatted desc into .yaml.in
* add a field named "fmt_desc", which is the description formatted using
  reStructuredText. it is preserved as it is if it's different from the
  desc or long_desc of an option. we can consolidate it with long_desc
  in future, and use pretty printer which has minimal support for
  reStructuredText for printing the formatted descriptions for a better
  user experience of command line. but at this moment, fmt_desc has
  only one consumer: the "ceph_confval" sphinx extension which extracts
  and translate the options yaml file to reStructuredText, which is in
  turn rendered by sphinx.
* remove unused options from the doc
  - journal_queue_max_ops
  - journal_queue_max_bytes

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-17 00:02:45 +08:00
Kefu Chai
bd9b597242 doc: add "confval_section" directive
instead of reusing "confval" directive, define a new directive just
for configration sections

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-16 20:27:24 +08:00
Kefu Chai
4b6a3f8161 doc/_ext: extract confval into an extension
better readability this way

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-15 00:37:45 +08:00