Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/documentation automation #3013

Open
wants to merge 5 commits into
base: feature
Choose a base branch
from

Conversation

kooliokey
Copy link
Contributor

@kooliokey kooliokey commented Jan 15, 2023

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • Bundle size optimization
  • Performance optimization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

#2832

💡 Background and solution

Documentation for the site will now be automatically generated with a combination of XML documentation comments and data attributes put on library components. All comments are expected/assumed to be in English and translations are made to generate the Chinese documentation. We still retain the ability to specify the Chinese translation for summaries though in cases where the automatic translation may be invalid.

Full details can be read in the new markdown file DOCUMENTATION.md in this PR.

There are also a handful of spots where things were never used that have been removed. It may be worth skimming through to generate a changelog at somepoint for those changes.

📝 Changelog

Language Changelog
🇺🇸 English Documentation is generated from the code files now so the site should match the library much closer. Removed a handful of public properties, methods, etc that should not have been public. Some never did anything and some were for internal component functionality. See full changelog for detailed list.
🇨🇳 Chinese 文档现在是从代码文件生成的,因此该站点应该更接近于库。删除了一些不应该公开的公共属性、方法等。有些什么都没做,有些是为了内部组件功能。有关详细列表,请参阅完整的更新日志。

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Changelog is provided or not needed

@github-actions
Copy link

github-actions bot commented Jan 15, 2023

Prepare preview

@ElderJames
Copy link
Member

Very cool @kooliokey , please rebase to release branch for this PR.

@kooliokey kooliokey force-pushed the feature/documentation-automation branch from 8e47b02 to eb08d6e Compare January 15, 2023 22:30
@kooliokey
Copy link
Contributor Author

Very cool @kooliokey , please rebase to release branch for this PR.

I rebased off feature and still have a bunch of changes that weren't mine. Perhaps master hasn't been merged into feature in a while?

@ElderJames
Copy link
Member

Yes, we haven't merge the master to feature. You can skip the commit not yours during the rebase.

@kooliokey kooliokey force-pushed the feature/documentation-automation branch 2 times, most recently from 0251b25 to 6f02d14 Compare January 17, 2023 02:07
…XML comments and attributes in the library. Translation will be done where necessary to generate the Chineese site.

Did some small code clean up on the way.
Removed or removed from public APIs:

AnchorLink.LinkDom
Button.RemoveAnimationAfter
Button.Icons - never used
Calendar.PrefixCls
All date pickers - method OnOkClick
Descriptions.Items
ListItem.PrefixName
AntList.PrefixName
ListItemMeta.PrefixName
Menu.Submenus
Menu.MenuItems
Transfer.ChildContent
Table.ColumnContext
Space.SetClass
Steps.Handler
Radio.OnClick
@kooliokey kooliokey force-pushed the feature/documentation-automation branch from 6f02d14 to 7aedb59 Compare January 17, 2023 02:36
@codecov
Copy link

codecov bot commented Jan 17, 2023

Codecov Report

Base: 43.11% // Head: 43.17% // Increases project coverage by +0.06% 🎉

Coverage data is based on head (7aedb59) compared to base (978ffcb).
Patch coverage: 31.50% of modified lines in pull request are covered.

❗ Current head 7aedb59 differs from pull request most recent head 06e580e. Consider uploading reports for the commit 06e580e to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           feature    #3013      +/-   ##
===========================================
+ Coverage    43.11%   43.17%   +0.06%     
===========================================
  Files          556      559       +3     
  Lines        26176    26174       -2     
  Branches       263      263              
===========================================
+ Hits         11285    11300      +15     
+ Misses       14851    14834      -17     
  Partials        40       40              
Impacted Files Coverage Δ
components/affix/Affix.razor.cs 0.00% <ø> (ø)
components/alert/Alert.razor.cs 98.38% <ø> (ø)
components/anchor/Anchor.razor.cs 0.00% <ø> (ø)
components/anchor/AnchorLink.razor.cs 0.00% <0.00%> (ø)
components/anchor/AnchorLinkEqualityComparer.cs 0.00% <ø> (ø)
components/auto-complete/AutoComplete.razor.cs 0.00% <0.00%> (ø)
components/auto-complete/AutoCompleteInput.cs 0.00% <ø> (ø)
...onents/auto-complete/AutoCompleteOptGroup.razor.cs 0.00% <ø> (ø)
...mponents/auto-complete/AutoCompleteOption.razor.cs 0.00% <ø> (ø)
components/auto-complete/AutoCompleteSearch.cs 0.00% <ø> (ø)
... and 219 more

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.

@ElderJames
Copy link
Member

hello @kooliokey , google tanslate service is not available in China, so we may need to use bing.

@kooliokey
Copy link
Contributor Author

hello @kooliokey , google tanslate service is not available in China, so we may need to use bing.

Oh, I didn't realize that. I'll have to see if it is possible to use Bing this way. Ideally we need to replace this implementation with a real API. Are there any that Microsoft gives for being in the dot net foundation? Or maybe some service you can get since the project is open source?

@kooliokey
Copy link
Contributor Author

@ElderJames We may be able to get away with using Azure Translator's API. It allows 2 million characters a month for free. The total characters currently translated are just under 95k so we could translate the entire documentation 21 times a month. I can set up an account for me to test with. Could a Github build translate in PRs and commit the change to the JSON file to the PR? I think that's the only way it would make sense for an API requiring credentials to be used. Individuals could always provide their own to run locally if desired.

Pricing https://azure.microsoft.com/en-us/pricing/details/cognitive-services/translator/#pricing
image

…ate appsettings JSON file to translate locally with it.
@kooliokey kooliokey force-pushed the feature/documentation-automation branch from 37ba11a to 9712250 Compare January 27, 2023 23:53
@kooliokey
Copy link
Contributor Author

@ElderJames We may be able to get away with using Azure Translator's API. It allows 2 million characters a month for free. The total characters currently translated are just under 95k so we could translate the entire documentation 21 times a month. I can set up an account for me to test with. Could a Github build translate in PRs and commit the change to the JSON file to the PR? I think that's the only way it would make sense for an API requiring credentials to be used. Individuals could always provide their own to run locally if desired.

Pricing https://azure.microsoft.com/en-us/pricing/details/cognitive-services/translator/#pricing image

@ElderJames I went ahead and added an AzureTranslate service as the default one used, but left Google in there as an option as well if someone wants to switch. The Azure one will require a user to set up an account and provide a Key to use.

@ElderJames
Copy link
Member

ElderJames commented Jan 28, 2023

Thank you @kooliokey , I think we need to fallback to English while the translate service is blocken.

…cache not cache it and return text asked to translate.
@kooliokey
Copy link
Contributor Author

Thank you @kooliokey , I think we need to follback to English while the translate service is blocken.

Yeah, that makes sense. I went ahead and did that now. It also won't cache it so that when build is ran again it will still try to translate it since it wasn't able to the first time.

@ElderJames
Copy link
Member

That's fine. I will continue to fix the building and merge.

@kooliokey
Copy link
Contributor Author

@ElderJames Is there anything I can do to help get this merged?

@kooliokey
Copy link
Contributor Author

@ElderJames Would this action help with committing the changes to the translations made in the PR? https://github.com/marketplace/actions/git-auto-commit

Looks like it allows committing changes to the branch of the PR and lets you provide a glob pattern for selecting the file(s) to commit which would let us just target the translation cache file.

@ElderJames
Copy link
Member

@kooliokey Thank you, I will rebase these commits to the feature branch.

@ElderJames
Copy link
Member

I haven't success to build the site yet. 😂

2 similar comments
@ElderJames
Copy link
Member

I haven't success to build the site yet. 😂

@ElderJames
Copy link
Member

I haven't success to build the site yet. 😂

@ElderJames
Copy link
Member

@kooliokey We will merge this feature when we rewrite the documentation site for antd v5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants