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

Support newline between autodoc identifer and YAML options #450

Closed
Archmonger opened this issue Jul 2, 2022 · 4 comments
Closed

Support newline between autodoc identifer and YAML options #450

Archmonger opened this issue Jul 2, 2022 · 4 comments
Labels
feature New feature or request

Comments

@Archmonger
Copy link

Archmonger commented Jul 2, 2022

The current syntax of ...

::: my_package.my_module.MyClass
    handler: python
    options:
      members:
        - method_a
        - method_b
      show_root_heading: false
      show_source: false

... does not play well with markdown formatters.

Consider changing the syntax. Here's some ideas.

A markdown list, in conjunction with a flag variable

::: my_package.my_module.MyClass has_options=true

    - handler: python
    - options
      - members
        - method_a
        - method_b
      - show_root_heading: false
      - show_source: false

A markdown list, with an indicator flag

::: my_package.my_module.MyClass

    - #!mkdocstrings
    - handler: python
    - options
      - members
        - method_a
        - method_b
      - show_root_heading: false
      - show_source: false
@Archmonger Archmonger added the feature New feature or request label Jul 2, 2022
@pawamoy
Copy link
Member

pawamoy commented Aug 17, 2022

Hello, thanks for the suggestion. We will probably not change the syntax any time soon. Have you tried:

::: my_package.my_module.MyClass

    handler: python
    options:
      members:
        - method_a
        - method_b
      show_root_heading: false
      show_source: false

?

That would make the YAML options equivalent to a code block, which would then not be re-formatted by tools, and would fallback gracefully when displaying in GitHub or else. If it does not work, I'm OK for us to bring support.

@Archmonger
Copy link
Author

Archmonger commented Aug 17, 2022

That seems to work for preventing markdown formatters from breaking the syntax.

However, mkdocstrings no longer parses it as configuration values.

@pawamoy
Copy link
Member

pawamoy commented Aug 17, 2022

I see, thank you for trying. Let's make it work then.

@pawamoy pawamoy changed the title Consider changing the default syntax Support newline between autodoc identifer and YAML options Aug 17, 2022
@pawamoy
Copy link
Member

pawamoy commented Apr 27, 2024

This will be released in the next version 🙂

@pawamoy pawamoy closed this as completed Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants