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

Test Python docstring in markdown files #38

Merged
merged 3 commits into from
May 3, 2023
Merged

Test Python docstring in markdown files #38

merged 3 commits into from
May 3, 2023

Conversation

sgillies
Copy link
Contributor

@sgillies sgillies commented May 3, 2023

And experiment with tested snippets

And experiment with tested snippets
## Snippet test

```python
--8<-- "tests/test_cli.py:map"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kevinlacaille here's my first snippet test!

@@ -68,6 +68,9 @@ nav:
- "Topics": 'topics'

markdown_extensions:
- pymdownx.inlinehilite
- pymdownx.snippets:
dedent_subsections: True
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Extension configuration here

Choose a reason for hiding this comment

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

Oh, maybe this is what I'm missing! I'll have to give this a shot.

)
# --8<-- [end:map]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here's the snippet

@sgillies
Copy link
Contributor Author

sgillies commented May 3, 2023

@kevinlacaille looks good to me!

Screenshot from 2023-05-03 11-28-06

--8<-- [end:reduce]
""".splitlines()[
2
].strip()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kevinlacaille I've got some tested CLI snippets! It's a little tortured, I'm working against Python to keep quotes out of the snippet section, but it works!

Screenshot from 2023-05-03 15-38-14

@sgillies sgillies merged commit 967c63a into main May 3, 2023
@sgillies sgillies deleted the snippets branch May 3, 2023 21:50
@kevinlacaille
Copy link

This is really helpful, I'm absolutely going to refer to this in planetlabs/planet-client-python#941 - thanks!

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

Successfully merging this pull request may close these issues.

2 participants