executablebooks / rst-to-myst

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

ENH: Add option to convert code to code-cell directives in md output #24

Open mmcky opened 3 years ago

mmcky commented 3 years ago

This PR adds the option to convert code in rst to code-cell in markdown for use with jupyter-book and enables the direct conversion to executable code-cell directives that are available in myst.

This is enabled using:

--code-to-code-cell

in the cli or

code_to_code_cell: true

in the config.yaml

welcome[bot] commented 3 years ago

Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out EBP's Code of Conduct and our Contributing Guide, as this will greatly help the review process.
Welcome to the EBP community! :tada:

codecov[bot] commented 3 years ago

Codecov Report

Merging #24 (06c8a75) into main (bb74674) will decrease coverage by 0.04%. The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #24      +/-   ##
==========================================
- Coverage   84.33%   84.28%   -0.05%     
==========================================
  Files          10       10              
  Lines        1621     1629       +8     
==========================================
+ Hits         1367     1373       +6     
- Misses        254      256       +2     
Flag Coverage Δ
pytests 84.28% <75.00%> (-0.05%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
rst_to_myst/mdformat_render.py 97.24% <ø> (ø)
rst_to_myst/markdownit.py 91.41% <66.66%> (-0.39%) :arrow_down:
rst_to_myst/cli.py 84.02% <100.00%> (+0.16%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update bb74674...06c8a75. Read the comment docs.