-
Notifications
You must be signed in to change notification settings - Fork 131
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
[FEATURE REQUEST] Generate OCClasseSettings documentation automatically #755
Comments
For every config key/parameter, we'd need some metadata:
@felix-schwarz @mneuwert would it be feasible to make every parameter like an "array" or JSON like structure? It hould already contain the information for the AppConfig, maybe some more metadata to render in our docs. How could the syntax look like? (for example for the ios-app/docs/modules/ROOT/pages/ios_mdm.adoc Lines 177 to 191 in 0808ad9
Then it should be easier to parse nice docs and XML files? "Category" could be used for the grouping parameters of similar topic. Only config parameters with "Recommended" status should be included in an XML file that gets submitted to EMM vendors… |
MDM options can be autogenerated as JSON now: @dschmidt will help with I was thinking, individual AsciiDoc tables could be generated per category ( Entries should be sorted by status (
Table columns needed:
|
I have prepared the I noticed some configuration items are present multiple times, e.g. The template looks as follows:
The actual
... and afterwards tables can be referenced in the main == Authentication
include::ios_mdm_tables.adoc[tag=authentication]
== Connection
include::ios_mdm_tables.adoc[tag=connection]
== Endpoints
include::ios_mdm_tables.adoc[tag=endpoints]
== Logging
include::ios_mdm_tables.adoc[tag=logging]
== OAuth2
include::ios_mdm_tables.adoc[tag=oauth2]
== OIDC
include::ios_mdm_tables.adoc[tag=oidc]
== Policies
include::ios_mdm_tables.adoc[tag=policies]
== Privacy
include::ios_mdm_tables.adoc[tag=privacy]
== Security
include::ios_mdm_tables.adoc[tag=security] I can prepare a PR for adding it to the repo, as soon as a compatible CONFIGURATION.json is added to this repo. P.S.: this needs |
@dschmidt very cool! 💪 I was able to generate a table from the new complete JSON: Please add 2 more columns:
|
@dschmidt Thanks, that's awesome already!
I have changed the generator code to avoid these. The
Good catch. I fixed that as well.
I'll put together a bash script that generates the JSON documentation, to which Regarding possible values, I also made a change to the JSON format that makes it easier to convert. Previously, possible values could come in either of these formats: "possibleValues" : {
"-1" : "verbose",
"0" : "debug",
"1" : "info",
"2" : "warning",
"3" : "error",
"4" : "off"
} … or more verbose: "possibleValues" : [
{
"description" : "debug",
"value" : 0
},
{
"description" : "error",
"value" : 3
},
{
"description" : "off",
"value" : 4
},
{
"description" : "warning",
"value" : 2
},
{
"description" : "verbose",
"value" : -1
},
{
"description" : "info",
"value" : 1
}
], The generated JSON now always uses the latter, verbose format. Besides normalizing |
@dschmidt I put together a script here now: https://github.com/owncloud/ios-app/blob/feature/settings-metadata/tools/GenerateDocs/generate_docs.sh And also put your template here: https://github.com/owncloud/ios-app/blob/feature/settings-metadata/tools/GenerateDocs/templates/ios_mdm_tables.adoc.tmpl When running the script from its folder, it runs
which partially produces the documentation, then fails with this error:
|
I took the liberty to push to your branch:
How should possible values be rendered in the table? |
For me, just listing them inline would do the job… @felix-schwarz does this make sense for you? |
@dschmidt Thanks! @michaelstingl Personally, I'd prefer a table with possible values in the description column below the description - provided that's possible:
We could have more than one word as description in the future, in which case that formatting would provide a better / easier overview. |
Fine for me. @dschmidt some refinement next week? |
Just noticed I accidentally commited commented out code. Added another commit to revert that. Feel free to fix up the original commit before merging, @felix-schwarz. |
Thanks for the updates @dschmidt, that's looking really good! I've made one little change by putting the possible values in Result here now: |
I have also just updated the app-side JSON file generator to fix a bug that caused possible values to not be sorted. |
UPDATE: The part regarding the AppConfig spec file has been split out and moved to #842.
Is your feature request related to a problem? Please describe.
In ownCloud app we have a comprehensive set of settings which can be used for branding, MDM, configuration during development. Documentation as well as AppConfig spec files are maintained manually. When new setting is added in the code, I think it is not really ensured that all other artefacts are updated accordingly.
Describe the solution you'd like
Would be nice to be able to extract
OCClassSetting
information from the code for example using Apple's SourceKit framework. There is also interesting framework / command line tool which abstractsSourceKit
called SourceKitten - https://github.com/jpsim/SourceKitten which e.g. can create an XML file describing structure from an Objective-C source file.So, we could create a small tool run by a custom build phase in Xcode which could generate the artefacts we need.
May be we would need to augment the definition of our settings by adding special comments describing the setting and e.g. also adding tags: mandatory, nice-to-have, supported, development etc.
TASKS
PR
The text was updated successfully, but these errors were encountered: