-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Code example improvements in Windows documentation #45055
Conversation
6b5c61a
to
3ef9415
Compare
The test
|
Can we disable those warnings ? It's not like those blocks aren't powershell. |
Looking at all the examples that hit this, all of them have backslashes in them. PS Also, the line-numbers seem to be from different files, and since index.rst seems to be a dummy name, it is very hard for contributors to understand what is going on. @felixfontein @gundalow |
Pygments does not have any issues with the code-blocks, so it only fails through Sphinx. |
Ok, it seems Sphinx run Pygments using And not the backslash itself seems to be the issue, but the colon is: http://pygments.org/demo/6759768/ |
And there is a fix to Sphinx here: sphinx-doc/sphinx#4250 |
3ef9415
to
50a4aca
Compare
Wrt. the powershell lexer, it has 2 issues with colons.
|
50a4aca
to
a7a5145
Compare
Our only true solution is to fix the lexer, but for the time being I have disabled Powershell syntax highlighting for the affected blocks. (I used "guess" which simply fails to use a lexer). I prefer doing this over working around it, so it is documented until fixed properly. When we have a fix for the lexer, we can override the powershell lexer in our tree as we already do for the yaml+jinja lexer. |
This PR includes: - Using explicit yaml+jinja code-blocks - Capital letter to start a comment or description - Use yes/no in YAML instead of true/false - Use true/false in Jinja instead of True/False - Work around pygments lexer issues with colons (in URLs and options)
a7a5145
to
d16828a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not against the changes but I will leave it to @acozine as to whether we want to enforce a standard for comments/examples in the docs.
|
||
- name: use win_dsc module with the Registry DSC resource | ||
- name: Use win_dsc module with the Registry DSC resource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just wondering, is there a consensus as to whether we want upper case or lower case in the docs, I treat the name block as a bullet list so don't worry about starting with caps or ending with a sentence but that's just me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I find it easier to read though. Especially for descriptions and documentation.
I don't mind that much for integration tests, but anything that ends up in the documentation (user-facing) I prefer to use sensible, pleasing standards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trouble with using this as justification is that everybody has different preferences and we could get into an endless loop with these types of edits. If @acozine has a standard that she's trying to set with the documentation then we should be following that standard but right now I'm unsure what that would be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, Red Hat documentation follows the IBM Style guide. That said, it doesn't cover this scenario directly. Our Ansible style guide also doesn't cover this, but documenting modules has an example section:
https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_documenting.html#examples-block
That uses an initial cap. Also the few examples I poked at in https://github.com/ansible/ansible-examples also uses initial cap for names. I'll ask @acozine directly if she wants to adopt this as a standard (and say so in the docs so it's clear).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a Community point of view we need to be careful not to cause "busy work" for Contributors and reviewers.
I think it's is OK to:
- Update "how to document your module" to state how we'd like documentation to be written
- update any examples in
docs/docsite/rst
to use the "best" form (withname:
, capital letters, etc.) - Bulk update of
support:core
modules to use the "best" form. - If others want to update modules that's fine, though that must be the only change in the PR to make it easy to review and backport.
I wouldn't want to add review comments on PRs asking them to add capital letters (or fullstops/periods at the end).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chatted offline w/ @acozine and she doesn't have a preference for either way. So I think the 'gist' of it is:
- Don't comment on another PR to request capitalization etc change
- Recommend to always use a name and make it a useful phrase or sentence.
- no bulk changes to existing content, because there's no 'right or wrong' way to do it.
@@ -222,10 +236,10 @@ The ``Find-DscResource`` cmdlet can also be used to find custom resources. For e | |||
|
|||
.. code-block:: powershell | |||
|
|||
# find all DSC resources in the configured repositories | |||
# Find all DSC resources in the configured repositories |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here, is it really necessary we do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary ? From a technical perspective no, but to me it's more pleasing.
But I am the guy who prefers punctuation marks and correct spelling too ;-)
@dagwieers you won't be able to do |
@jborean93 I am not changing any of them, I hope we can improve the lexer at some point. (However pygments seems to be unmaintained at the moment :-/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generated the docs locally and looks good.
Docs looks okay. @jborean93 @gundalow anything else blocking the merge here? |
I'm ok with the technical content changes so +1 from me. |
This PR includes: - Using explicit yaml+jinja code-blocks - Work around pygments lexer issues with colons (in URLs and options)
This PR includes: - Using explicit yaml+jinja code-blocks - Work around pygments lexer issues with colons (in URLs and options)
SUMMARY
This PR includes:
ISSUE TYPE
COMPONENT NAME
Windows docs
ANSIBLE VERSION
v2.7