executablebooks / sphinx-proof

A Sphinx extension for producing proof, theorem, lemma, definition, remark, conjecture, corollary and algorithm directives.
https://sphinx-proof.readthedocs.io/en/latest/
MIT License
30 stars 16 forks source link

Support for Exercises directive & Added Chinese translation (zh_CN) #90

Open 11Haoyu opened 2 years ago

11Haoyu commented 2 years ago

Co-authored-by: Ming Yang vivym@live.com

11Haoyu commented 2 years ago

This is my first time to contribute. I am not familiar with the procedure at first. Now I get it. If there's more additional directives, please keep me posted to add corresponding Chinese translation. Thank you so much!

codecov-commenter commented 2 years ago

Codecov Report

Base: 96.13% // Head: 96.17% // Increases project coverage by +0.04% :tada:

Coverage data is based on head (7d0e596) compared to base (d37495f). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #90 +/- ## ========================================== + Coverage 96.13% 96.17% +0.04% ========================================== Files 6 6 Lines 362 366 +4 ========================================== + Hits 348 352 +4 Misses 14 14 ``` | Flag | Coverage Δ | | |---|---|---| | pytests | `96.17% <100.00%> (+0.04%)` | :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/sphinx-proof/pull/90?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks) | Coverage Δ | | |---|---|---| | [sphinx\_proof/nodes.py](https://codecov.io/gh/executablebooks/sphinx-proof/pull/90/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks#diff-c3BoaW54X3Byb29mL25vZGVzLnB5) | `93.63% <100.00%> (+0.11%)` | :arrow_up: | | [sphinx\_proof/proof\_type.py](https://codecov.io/gh/executablebooks/sphinx-proof/pull/90/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks#diff-c3BoaW54X3Byb29mL3Byb29mX3R5cGUucHk=) | `100.00% <100.00%> (ø)` | | | [sphinx\_proof/translations/\_convert.py](https://codecov.io/gh/executablebooks/sphinx-proof/pull/90/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks#diff-c3BoaW54X3Byb29mL3RyYW5zbGF0aW9ucy9fY29udmVydC5weQ==) | `93.33% <100.00%> (ø)` | | 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.

mmcky commented 2 years ago

thanks @11Haoyu -- you've done well for a first contribution. Thank you! I will review this over the next couple of days and get this merged.

mmcky commented 2 years ago

@11Haoyu we actually have another extension sphinx-exercise that has support for exercise and solution directives. Rather than just a styling admonition they are linked via references so you can reference an exercise directive from a solution etc. You can also reference the exercise in the text.

Maybe you can check that out to see if it meets your needs for exercise styling.

11Haoyu commented 2 years ago

Yes, I am aware of the extension of sphinx-exercise. But it seems that sphinx-exercise doesn't have translation function like sphinx-proof. Therefore, I added the exercise directive in sphinx-proof so people can use it in their own language. I would be so grateful if you can add translation in the sphinx-exercise as well, which is a very challenging task for me to write one from scratch.

mmcky commented 2 years ago

Yes, I am aware of the extension of sphinx-exercise. But it seems that sphinx-exercise doesn't have translation function like sphinx-proof. Therefore, I added the exercise directive in sphinx-proof so people can use it in their own language. I would be so grateful if you can add translation in the sphinx-exercise as well, which is a very challenging task for me to write one from scratch.

I see thanks @11Haoyu that makes sense.

mmcky commented 2 years ago

I will need to think a bit about the exercise node as that may cause conflict for those using sphinx-exercise in the same project. If we enable basic exercise support in this extension (while we get more support for multi language in sphinx-exercise https://github.com/executablebooks/sphinx-exercise/issues/13) then we may need to rename the node to avoid conflicts. Let me think about this for a day or so.

11Haoyu commented 2 years ago

Yes, I understand that.