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

Docs code-blocks of task/playbook output should not get err class #50040

Closed
acozine opened this issue Dec 17, 2018 · 6 comments · Fixed by #50836 or #50318
Closed

Docs code-blocks of task/playbook output should not get err class #50040

acozine opened this issue Dec 17, 2018 · 6 comments · Fixed by #50836 or #50318
Labels
affects_2.8 This issue/PR affects Ansible v2.8 docs This issue/PR relates to or includes documentation. support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@acozine
Copy link
Contributor

acozine commented Dec 17, 2018

SUMMARY

The red highlighting/boxes around the commas in the second code-block under https://docs.ansible.com/ansible/devel/user_guide/become.html#administrative-rights are err column spans. The source does not specify a language for pygments, so the code-block is being read as YAML+Jinja per https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/conf.py#L111.

We should be able to highlight Ansible task output without err highlighting.

I'm not sure at this point how difficult the fix would be. Maybe we can just choose a different lexer for those code blocks. Or maybe we need a lexer (Pygments highlighter) for Ansible output.

Available lexers list: http://pygments.org/docs/lexers/

ISSUE TYPE
  • Documentation Report
COMPONENT NAME

docs.ansible.com

ANSIBLE VERSION

N/A

CONFIGURATION

N/A

OS / ENVIRONMENT

N/A

@ansibot
Copy link
Contributor

ansibot commented Dec 17, 2018

Files identified in the description:
None

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 docs This issue/PR relates to or includes documentation. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Dec 17, 2018
@jborean93 jborean93 removed the needs_triage Needs a first human triage before being processed. label Dec 18, 2018
@acozine
Copy link
Contributor Author

acozine commented Jan 2, 2019

There are a few more places where the docs have <span class="err"> in them. From my local build of today's devel branch:

[alicia@tooticky]~/git_repos/ansible/docs/docsite/_build/html$ grep -rl '<span class="err">' ./
.//plugins/lookup.html
.//plugins/inventory.html
.//plugins/lookup/config.html
.//reference_appendices/YAMLSyntax.html
.//user_guide/become.html
.//user_guide/playbooks_filters.html
.//user_guide/windows_usage.html
.//user_guide/playbooks_async.html
.//dev_guide/style_guide/index.html
.//dev_guide/developing_modules_general.html
.//scenario_guides/guide_scaleway.html
.//modules/docker_swarm_service_module.html
.//modules/zabbix_map_module.html
.//modules/telnet_module.html

@felixfontein
Copy link
Contributor

https://docs.ansible.com/ansible/devel/plugins/lookup.html: mixes Ansible playbook with Ansible output in one code block, which the lexer chosen (yaml+jinja2?) cannot handle

https://docs.ansible.com/ansible/devel/plugins/inventory.html: I don't know what it is that is lexed here, but it's definitely not YAML (i.e. wrong lexer) or Ansible output; maybe disable lexing here?

https://docs.ansible.com/ansible/devel/plugins/lookup/config.html: looks like there is something wrong with yaml+jinja2 lexing; the source looks fine to me

https://docs.ansible.com/ansible/devel/reference_appendices/YAMLSyntax.html: a problem with the YAML lexer (\' in a double quoted string doesn't work)

https://docs.ansible.com/ansible/devel/user_guide/playbooks_filters.html:

  • some output (plain text) is trying to be lexed as YAML (or something else); lexing should be disabled for this block (decoration="! " example)
  • strange behavior of yaml+jinja2 lexer in case insensitive search in multiline mode example

https://docs.ansible.com/ansible/devel/user_guide/windows_usage.html: example contains invalid YAML (that's the point of the example), which the YAML lexer doesn't like; might be fine to leave this as-is?

https://docs.ansible.com/ansible/devel/user_guide/playbooks_async.html: problem with yaml+jinja2 lexing (looks a bit like this is the YAML lexer, not the yaml+jinja2 one?)

https://docs.ansible.com/ansible/devel/dev_guide/style_guide/index.html: maybe wrong lexer used?

https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_general.html: looks like the yaml+jinja2 lexer is used for Python code

https://docs.ansible.com/ansible/devel/scenario_guides/guide_scaleway.html: there's a mixture between shell input and Ansible output, probably lexed with yaml+jinja2 lexer. Probably should be split into two code blocks with The output will be: inbetween, and both code blocks should have the appropriate lexer

https://docs.ansible.com/ansible/devel/modules/docker_swarm_service_module.html: Jinja2/Django lexer apparently cannot handle !=

https://docs.ansible.com/ansible/devel/modules/zabbix_map_module.html: Jinja2/Django lexer apparently cannot handle %

https://docs.ansible.com/ansible/devel/modules/telnet_module.html: YAML lexer apparently cannot handle the double quoted string "[>|#]" (it tries to interpret >|)


https://docs.ansible.com/ansible/devel/user_guide/become.html: @acozine what is wrong here with the version your dev build produces?

@felixfontein
Copy link
Contributor

@samccann can you re-open this one? There are some thing which still require fixing (unrelated to the Ansible output lexer); I'll try to work on this later this week or on the weekend.

@samccann
Copy link
Contributor

samccann commented Jan 3, 2019

Sorry about that...reopening

@acozine
Copy link
Contributor Author

acozine commented Jan 24, 2019

@felixfontein I don't know what the issue with user_guide/become.html was, but on your branch for #50836 that error is gone. I agree that the error on the Windows page is probably useful, as the red highlighting helps the reader understand that the syntax there is incorrect.

@ansible ansible locked and limited conversation to collaborators Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 docs This issue/PR relates to or includes documentation. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
5 participants