sphinx-proof icon indicating copy to clipboard operation
sphinx-proof copied to clipboard

Support for Exercises directive & Added Chinese translation (zh_CN)

Open 11Haoyu opened this issue 3 years ago • 8 comments

  • support for exercise directive
  • add translation to Chinese
  • change encoding to "utf8" in the _convert.py to be compatible more languages
  • translation json for exercise directive
  • pre-commit runs to modify formats

Co-authored-by: Ming Yang [email protected]

11Haoyu avatar Sep 13 '22 08:09 11Haoyu

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!

11Haoyu avatar Sep 13 '22 08:09 11Haoyu

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
@@            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 to find out more.

Impacted Files Coverage Δ
sphinx_proof/nodes.py 93.63% <100.00%> (+0.11%) :arrow_up:
sphinx_proof/proof_type.py 100.00% <100.00%> (ø)
sphinx_proof/translations/_convert.py 93.33% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

codecov-commenter avatar Sep 13 '22 23:09 codecov-commenter

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 avatar Sep 13 '22 23:09 mmcky

@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.

mmcky avatar Sep 14 '22 02:09 mmcky

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.

11Haoyu avatar Sep 14 '22 03:09 11Haoyu

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 avatar Sep 14 '22 03:09 mmcky

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.

mmcky avatar Sep 14 '22 04:09 mmcky

Yes, I understand that.

11Haoyu avatar Sep 14 '22 05:09 11Haoyu