Skip to content

doc: add backtick around *.?* description #1752

Merged
BareosBot merged 2 commits intobareos:masterfrom
bruno-at-bareos:dev/bruno/master/doc-fix-acl-all
Apr 2, 2024
Merged

doc: add backtick around *.?* description #1752
BareosBot merged 2 commits intobareos:masterfrom
bruno-at-bareos:dev/bruno/master/doc-fix-acl-all

Conversation

@bruno-at-bareos
Copy link
Contributor

@bruno-at-bareos bruno-at-bareos commented Mar 27, 2024

this PR fix our documentation, where The special acl value *all* gets printed as all when printed in our documentation (in the normal text flow).

  • we adapt the documentation description generator to include :strong: around this value
  • fix systemtests with all instead all

OP#5543

Thank you for contributing to the Bareos Project!

Backport of PR #0000 to bareos-2x (remove this line if this is no backport; for backport use cherry-pick -x)

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
  • Check backport line
  • Required backport PRs have been created
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR

@joergsteffens
Copy link
Member

Not sure, if we really want to have RST formatted descriptions in our code. An other approach would be to adapt the script that generated the documentation, so it creates valid RST, without losing information (in doubt, do the same replacement as now done manually: *all* to :strong:*all*).

@joergsteffens
Copy link
Member

I suggest:

+++ b/docs/manuals/scripts/generate-resource-descriptions.py
@@ -260,7 +260,10 @@ class BareosConfigurationSchema2Sphinx(BareosConfigurationSchema):
     def getDescription(self, data):
         description = ""
         if data.get("description"):
-            description = self.indent(data.get("description"), 3)
+            # Some descriptions contains text surrounded by '*'.
+            # This regex puts backticks around these texts.
+            description_rst = re.sub("(\*.*?\*)", "`\\1`", data.get("description"))
+            description = self.indent(description_rst, 3)
         return description

@bruno-at-bareos
Copy link
Contributor Author

bruno-at-bareos commented Mar 28, 2024

I suggest:

+++ b/docs/manuals/scripts/generate-resource-descriptions.py
@@ -260,7 +260,10 @@ class BareosConfigurationSchema2Sphinx(BareosConfigurationSchema):
     def getDescription(self, data):
         description = ""
         if data.get("description"):
-            description = self.indent(data.get("description"), 3)
+            # Some descriptions contains text surrounded by '*'.
+            # This regex puts backticks around these texts.
+            description_rst = re.sub("(\*.*?\*)", "`\\1`", data.get("description"))
+            description = self.indent(description_rst, 3)
         return description

adding only backstick is not enough, you need the :strong: too, but I don't see why we would like to change the method used already.
i just fixed something the way the code already is doing so.

see

grep -Rn "\`" docs/manuals/source/include/autogenerated/*.json

54 times used

@joergsteffens
Copy link
Member

adding only backstick is not enough, you need the :strong: too,

okay, that is very easy to adapt.

but I don't see why we would like to change the method used already. i just fixed something the way the code already is doing so.

The description field has not been intended to be used in RST documentation only. In fact, when starting with this, documentation has been in Latex. Also it might be used in the future for some online help in the webui/bconsole. Therefore I would prefer if the description would stay as plain text.

@bruno-at-bareos
Copy link
Contributor Author

adding only backstick is not enough, you need the :strong: too,

okay, that is very easy to adapt.

but I don't see why we would like to change the method used already. i just fixed something the way the code already is doing so.

The description field has not been intended to be used in RST documentation only. In fact, when starting with this, documentation has been in Latex. Also it might be used in the future for some online help in the webui/bconsole. Therefore I would prefer if the description would stay as plain text.

This make sense. shall I move those extra information to the corresponding extra file in docs/manuals/source/manually_added_config_directive_descriptions ?

@bruno-at-bareos bruno-at-bareos force-pushed the dev/bruno/master/doc-fix-acl-all branch from e78cdb4 to bf09df9 Compare March 28, 2024 11:02
@bruno-at-bareos bruno-at-bareos changed the title dird: add backtick around *all* ACL description doc: add backtick around *.?* description Mar 28, 2024
bruno-at-bareos and others added 2 commits April 2, 2024 09:42
- generate-resource-description.py will add :strong:` ` formating
  to all word surronded by *
- fix systemtests with fixed *all* keyword instead all

Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
@BareosBot BareosBot force-pushed the dev/bruno/master/doc-fix-acl-all branch from c43d1f1 to d5fe131 Compare April 2, 2024 09:42
@BareosBot BareosBot merged commit a3f149a into bareos:master Apr 2, 2024
@bruno-at-bareos bruno-at-bareos deleted the dev/bruno/master/doc-fix-acl-all branch November 25, 2024 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants