Skip to content

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

Closed
11Haoyu wants to merge 3 commits intoexecutablebooks:mainfrom
11Haoyu:master
Closed

Support for Exercises directive & Added Chinese translation (zh_CN) #90
11Haoyu wants to merge 3 commits intoexecutablebooks:mainfrom
11Haoyu:master

Conversation

@11Haoyu
Copy link

@11Haoyu 11Haoyu commented Sep 13, 2022

  • 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 vivym@live.com

@11Haoyu
Copy link
Author

11Haoyu commented Sep 13, 2022

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
Copy link

Codecov Report

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

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%) ⬆️

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%) ⬆️
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.

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

@mmcky
Copy link
Member

mmcky commented Sep 13, 2022

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
Copy link
Member

mmcky commented Sep 14, 2022

@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
Copy link
Author

11Haoyu commented Sep 14, 2022

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
Copy link
Member

mmcky commented Sep 14, 2022

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
Copy link
Member

mmcky commented Sep 14, 2022

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 executablebooks/sphinx-exercise#13) then we may need to rename the node to avoid conflicts. Let me think about this for a day or so.

@11Haoyu
Copy link
Author

11Haoyu commented Sep 14, 2022

Yes, I understand that.

@mmcky
Copy link
Member

mmcky commented Mar 11, 2025

thanks @11Haoyu for this PR. Greatly appreciated.

I have added your work via #137 and will look to add support to sphinx-exercise via executablebooks/sphinx-exercise#73

@mmcky mmcky closed this Mar 11, 2025
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.

3 participants