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

Using the details tag #76

Open
niosus opened this issue Aug 31, 2023 · 7 comments
Open

Using the details tag #76

niosus opened this issue Aug 31, 2023 · 7 comments

Comments

@niosus
Copy link

niosus commented Aug 31, 2023

Hey there! Thanks for an amazing plugin!

I do have an issue with it though. I am trying to use the <details> tag with my generated docs and it fails on me.

If I use the following in my md file:

<details>
<summary>my_class</summary>

::: doxy.lidar.Class
    name: my_class
    indent_level: 4

</details>

This does not render in mkdocs generated page. It does generate without the details tag.

I do have all the needed extensions (I think) in my config:

markdown_extensions:
  - admonition
  - markdown.extensions.md_in_html
  - pymdownx.highlight
  - pymdownx.superfences
  - pymdownx.details
  - pymdownx.snippets:
      check_paths: true
  - toc:
      permalink: true
  - pymdownx.blocks.details:
  - pymdownx.blocks.html:
  - pymdownx.blocks.definition:
  - pymdownx.blocks.tab:
  - pymdownx.tabbed:
      alternate_style: true

Any ideas what I might be doing wrong?

@JakubAndrysek
Copy link
Owner

@niosus
Copy link
Author

niosus commented Sep 4, 2023

Thanks for doing this! I did try it already with the indent level but it still does not work for me. Does it work also with the class for you?

In my example, I am getting the code blocks rendered correctly but all the rest of the markdown is not rendered within the details tag:

<details>
<summary>MyClass</summary>

::: doxy.lidar.Class
  name: MyClass
  indent_level: 4

</details>

The result looks something like this.
Screenshot 2023-09-04 at 10 04 57

Do you have any further ideas on what I might be missing here?

@niosus
Copy link
Author

niosus commented Sep 4, 2023

Ooooh, I found it. Maybe you'd like to also include it in the example that you provided in the branch that you linked above. I need to add the markdown attribute to the details tag like so:

<details markdown>
<summary>MyClass</summary>

::: doxy.lidar.Class
  name: MyClass
  indent_level: 4

</details>

This renders correctly for me.

I will keep this issue open for now for visibility so that you can add this to the example if you wish, but feel free to close this as you see fit. Thanks again for your help and your work!

@JakubAndrysek
Copy link
Owner

Thank you for your research. I will add this info to the docs.

@JakubAndrysek
Copy link
Owner

I have tried your recommended option with "markdown" tag and it fixed it only partially.
Everything is rendered successfully, but the header stays as MD tag. Have you found any result to fix that? Or is it just my problem?

image

## Add MkDoxy tag into the `<details>` tag
If you want to add MkDoxy tag into the `<details>` tag, you can use the `details` option.
In some cases, it might be tricky to configure indentation, so you can use the `indent_level` option to indent generated markdown block.


<details markdown="1">
<summary>my_class</summary>

::: doxy.animal.file.list
indent_level: 2

</details>

@JakubAndrysek
Copy link
Owner

If you find something, I will be very appreciative if you finish the PR https://github.com/JakubAndrysek/MkDoxy/tree/details-tag.

Thanks, Jacob

@niosus
Copy link
Author

niosus commented Sep 4, 2023

Strange, in my case I can see a fully rendered markdown. 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants