Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some env content provided does not make it into the documentation #4097

Closed
mmattel opened this issue Jul 5, 2022 · 4 comments · Fixed by #4108 or #4110
Closed

Some env content provided does not make it into the documentation #4097

mmattel opened this issue Jul 5, 2022 · 4 comments · Fixed by #4108 or #4110
Labels

Comments

@mmattel
Copy link
Contributor

mmattel commented Jul 5, 2022

There seems to be an issue that some content that is present here in the repo does not make it into the documentation.

screenshot provided by @dragonchaser

image

outcome on the web (admin docs)

image

As you can see, the type and the default are missing, while the description is present.

Another one is FRONTEND_CHECKSUMS_SUPPORTED_TYPES where type and the default are missing too.

It seems that something (tm) is happening inbetween the source and the generated adoc table. admin docs does nothing with it and just includes that file.

@dragonchaser dragonchaser removed their assignment Jul 5, 2022
@wkloucek
Copy link
Contributor

wkloucek commented Jul 5, 2022

@mmattel looks like the default value is not properly escaped: https://github.com/owncloud/ocis/blame/docs/services/_includes/adoc/frontend_configvars.adoc#L289-L294

Could you please give a properly escaped example for this?

|`FRONTEND_CHECKSUMS_SUPPORTED_TYPES`
| 
a| [subs=-attributes]
[sha1 md5 adler32] 
a| [subs=-attributes]
Supported checksum types to be announced to the client (e.g. md5)

EDIT:
same applies to the other example: https://github.com/owncloud/ocis/blame/docs/services/_includes/adoc/thumbnails_configvars.adoc#L123-L128

|`THUMBNAILS_RESOLUTIONS`
| 
a| [subs=-attributes]
[16x16 32x32 64x64 128x128 1920x1080 3840x2160 7680x4320] 
a| [subs=-attributes]
The supported target resolutions in the format WidthxHeight e.g. 32x32. You can provide multiple resolutions separated by a comma.

@dragonchaser
Copy link
Member

could it be related to the fact that both fields are slices ([]string)

@mmattel
Copy link
Contributor Author

mmattel commented Jul 5, 2022

Found the issue 😅 we need to adapt the adoc export.

Reason
We need in the table cell the Antora directive to go for antora language but disable attribute resolution a| [subs=-attributes]. When doing so [ ] becomes as part of the text in the next line different meaning.

Solution 1
To solve this, we need to special escape IN THAT CELL TYPE the square opening and closing brackets in following way:

if string contains "blank [ character" then replace [ with +[
if string contains "character ] blank" then replace ] with ]+

Example replacement (note the leading and trailing blanks):
[16x16 --> +[16x16
7680x4320] --> 7680x4320]+

No replacement would be when (blank between bracket and character):
[ 16x16
7680x4320 ]

Solution 2
Similar as above, we need to put the content written into pass:[bla bla] which passes thru all the stuff.

Solution 1 requires adaption of the rules which is more effort
Solution 2 is just a small change in the docs/templates/ADOC.tmpl in this repo

I will create a PR with solution 2 and @dragonchaser will do a local render test and checks the output for success.

@dragonchaser
Copy link
Member

dragonchaser commented Jul 5, 2022

We need to add a specific regexp to solve this here: https://github.com/owncloud/ocis/blob/master/docs/helpers/adoc-generator.go.tmpl#L97 to replace [ and ] according to the rules @mmattel mentions above.

mmattel added a commit that referenced this issue Jul 5, 2022
Fixes: #4097 (Some env content provided does not make it into the documentation)

Adding the `pass` macro for those two cells is neccessary because the content are go slices (arrays) which would be interpreted differently in Antora.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
3 participants