executablebooks / rst-to-myst

Convert ReStructuredText to MyST Markdown
https://rst-to-myst.readthedocs.io
MIT License
59 stars 10 forks source link

👌 IMPROVE: Add support for doctest_block nodes #38

Closed zsol closed 1 year ago

zsol commented 1 year ago

Currently these are treated like a paragraph. Treating them like a literal_block is better.

codecov[bot] commented 1 year ago

Codecov Report

Base: 84.27% // Head: 84.40% // Increases project coverage by +0.12% :tada:

Coverage data is based on head (1c94475) compared to base (13c6fb1). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #38 +/- ## ========================================== + Coverage 84.27% 84.40% +0.12% ========================================== Files 9 9 Lines 1622 1629 +7 ========================================== + Hits 1367 1375 +8 + Misses 255 254 -1 ``` | Flag | Coverage Δ | | |---|---|---| | pytests | `84.40% <100.00%> (+0.12%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/executablebooks/rst-to-myst/pull/38?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks) | Coverage Δ | | |---|---|---| | [rst\_to\_myst/markdownit.py](https://codecov.io/gh/executablebooks/rst-to-myst/pull/38/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks#diff-cnN0X3RvX215c3QvbWFya2Rvd25pdC5weQ==) | `92.03% <100.00%> (+0.39%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

chrisjsewell commented 1 year ago

Thanks, do you want to look into adding a test?

My only thought though, is that perhaps there should be a warning and/or some hint in the output, that this conversion (and this loss of information) occurred

zsol commented 1 year ago

Oh! Hi! :) Yeah, of course. I can add a warning as well as a test case.

zsol commented 1 year ago

Done!

chrisjsewell commented 1 year ago

Hey @zsol, from the lack of test coverage, I realised your test example wasn't actually a doctest block 😅

So I fixed it, and also added the pycon pygment lexer to the output block.

Have a look, and let me know if that looks ok

zsol commented 1 year ago

Oh 😆 thanks for fixing :) lgtm

welcome[bot] commented 1 year ago

Congrats on your first merged pull request in this project! :tada: congrats
Thank you for contributing, we are very proud of you! :heart: