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

Add optionlisting directive #9995

Closed
marxin opened this issue Dec 20, 2021 · 7 comments
Closed

Add optionlisting directive #9995

marxin opened this issue Dec 20, 2021 · 7 comments
Labels
type:enhancement enhance or introduce a new feature

Comments

@marxin
Copy link
Contributor

marxin commented Dec 20, 2021

Please support a new optionlisting directive:

..optionlisting:

  :option:`-fdiagnostics-plain-output`
  :option:`-fdiagnostics-show-location`:samp:`=[once|every-line]`
  :option:`-fdiagnostics-color`:samp:`=[auto|never|always]`

That would emit |gol| at the end of each line? Instead of manually placing the |gol| at the end of every line.

Originally reported in #9925.

@marxin marxin added the type:enhancement enhance or introduce a new feature label Dec 20, 2021
@jakobandersen
Copy link
Contributor

Do you mean this for declare multiple options a la the normal option directive (.. option::) but with a common description?
You can already now do

.. option:: -fdiagnostics-plain-output
            -fdiagnostics-show-location=[once|every-line]
            -fdiagnostics-color=[auto|never|always]

   Diagnostics options.

@marxin
Copy link
Contributor Author

marxin commented Dec 20, 2021

Do you mean this for declare multiple options a la the normal option directive (.. option::) but with a common description?

No, it's about using option role for a listing of already defined options. Something like:

Enable with -O2 optimization level:

..optionlisting:

  :option:`-fdiagnostics-plain-output`
  :option:`-fdiagnostics-show-location`:samp:`=[once|every-line]`
  :option:`-fdiagnostics-color`:samp:`=[auto|never|always]`

@jakobandersen
Copy link
Contributor

Would it be possible to use a normal list?

@marxin
Copy link
Contributor Author

marxin commented Dec 20, 2021

Well, I don't want to emit the bullet points at the beginning of a line.

@jakobandersen
Copy link
Contributor

Right. Then perhaps a line block might be useful:

| :option:`-fdiagnostics-plain-output`
| :option:`-fdiagnostics-show-location`:samp:`=[once|every-line]`
| :option:`-fdiagnostics-color`:samp:`=[auto|never|always]`

@marxin
Copy link
Contributor Author

marxin commented Dec 20, 2021

Kudos! It works perfectly well.

@marxin marxin closed this as completed Dec 20, 2021
@marxin
Copy link
Contributor Author

marxin commented Dec 20, 2021

However, a small difference is the vertical spacing:

Screenshot from 2021-12-20 17-14-55

for

  Normal option3. Test :samp:`{samp}` and ``emph``.

  | :option:`-fdiagnostics-plain-output`
  | :option:`-fdiagnostics-show-location`:samp:`=[once|every-line]`
  | :option:`-fdiagnostics-color`:samp:`=[auto|never|always]`

Using GOL:

  :option:`-fdiagnostics-plain-output` |gol|
  :option:`-fdiagnostics-show-location`:samp:`=[once|every-line]` |gol|
  :option:`-fdiagnostics-color`:samp:`=[auto|never|always]` |gol|
rst_prolog = r'''
.. |gol| raw:: latex

               \\
'''

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type:enhancement enhance or introduce a new feature
Projects
None yet
Development

No branches or pull requests

2 participants