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

fix: use consistent markup in examples #1373

Merged
merged 14 commits into from
Jul 3, 2023
Merged

Conversation

@12rambau
Copy link
Collaborator Author

12rambau commented Jul 2, 2023

@choldgraf I think I identified all the pages with markup example. To check how it looks, I tested on 1 page and the prettier pre-commit is refactoring the tab directive with "````". As you have more experience with md. could you advise what's happening ?

I'm writing the following and there seems to be conflicts between "```". What should I do ?

```{tab-set}
```{tab-item} rst
```rst
.. code-block:: python
    :caption: python.py

    print("A code block with a caption.")
```
```
```{tab-item} markdown
```md
```{code-block} python
:caption: python.py

print("A code block with a caption.")
```
```
```
```

@12rambau
Copy link
Collaborator Author

12rambau commented Jul 2, 2023

I finally followed instructions from here: https://myst-parser.readthedocs.io/en/latest/syntax/roles-and-directives.html#nesting-directives. That's very dificult to read but that works.

@12rambau 12rambau marked this pull request as ready for review July 2, 2023 20:20
@@ -7,9 +7,20 @@ This is [similar to how the TOML language defines nested configuration](https://

For example, to remove the secondary sidebar, we use a page metadata key like this:

`````{tab-set}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep this is the right way to do it. If you want to I believe that you can indent everything within the directive just to make it easier to read.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI indentation does not work (which is a shame because it does help readability of the source). It yields

  File "/opt/mambaforge/envs/pst/lib/python3.11/site-packages/sphinx_design/tabs.py", line 243, in run
    tab_label, tab_content = tab_item.children
    ^^^^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I get I think we can leave it as it is

@trallard trallard added the kind: documentation Improvements or additions to documentation label Jul 3, 2023
Copy link
Collaborator

@choldgraf choldgraf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have time to go through this in a lot of detail, but in general it looks good to me and I'm +1 on merging this and then making gradual improvements from there because I think it's a clear improvement!

@12rambau 12rambau merged commit 00c3575 into pydata:main Jul 3, 2023
@12rambau 12rambau deleted the markup branch July 3, 2023 15:29
@drammock
Copy link
Collaborator

drammock commented Jul 3, 2023

argh, was in the middle of reviewing this. I'll open a new PR with the fixes I guess.

Copy link
Collaborator

@drammock drammock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll submit the changes I had queued up in a separate PR

@@ -7,9 +7,20 @@ This is [similar to how the TOML language defines nested configuration](https://

For example, to remove the secondary sidebar, we use a page metadata key like this:

`````{tab-set}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI indentation does not work (which is a shame because it does help readability of the source). It yields

  File "/opt/mambaforge/envs/pst/lib/python3.11/site-packages/sphinx_design/tabs.py", line 243, in run
    tab_label, tab_content = tab_item.children
    ^^^^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1)

@12rambau
Copy link
Collaborator Author

12rambau commented Jul 3, 2023

argh, was in the middle of reviewing this. I'll open a new PR with the fixes I guess.

oupsss sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Be consistent in our use of markup languages in examples
4 participants