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

Aherman3 api docs add zh #1533

Open
wants to merge 44 commits into
base: main
Choose a base branch
from

Conversation

aherman3
Copy link
Contributor

@aherman3 aherman3 commented Mar 14, 2024

added API docs in Chinese and changed absolute links references to relative to prevent broken link error

Summary by CodeRabbit

  • Documentation
    • Updated links in the references index to use absolute paths for better accessibility.
    • Enhanced documentation structure and content clarity in the Wechaty library overview, including detailed class and method definitions.
  • New Features
    • Introduced documentation for the ContactSelf class, detailing methods for robot self-management.
    • Added comprehensive documentation for the Contact class, covering interaction with contacts.
    • Detailed the Friendship class functionality, including handling friend requests.
    • Provided a thorough description of the Message class, focusing on message handling.
    • Introduced the Room class documentation, explaining group chat interactions and management.
    • Added documentation for the RoomInvitation class, elaborating on handling room invitations.
    • Launched new documentation for the Wechaty class, outlining its construction and Puppet types usage.

aherman3 and others added 30 commits March 8, 2024 17:18
…room.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…friendship.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…wechaty-class.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…friendship.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…contact.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…contact.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…contact.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…contact-self.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…contact.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 3

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 23ef26c and 448cb6b.
Files ignored due to path filters (1)
  • package.json is excluded by: !**/*.json
Files selected for processing (1)
  • docusaurus/i18n/zh/docusaurus-plugin-content-docs/current/api/contact.md (1 hunks)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 448cb6b and 8597070.
Files selected for processing (1)
  • docusaurus/i18n/zh/docusaurus-plugin-content-docs/current/api/friendship.md (1 hunks)
Additional comments: 5
docusaurus/i18n/zh/docusaurus-plugin-content-docs/current/api/friendship.md (5)
  • 5-7: The introduction and example link are clear and provide a good starting point for understanding the Friendship class.
  • 17-25: Consider adding a brief description column to the instance methods table to provide more clarity on what each method does. This would enhance the documentation's usability.
  • 26-31: Similarly, adding a brief description for the add() method in the static methods table could provide more clarity to the readers about its purpose and usage.
  • 5-5: Consider applying the suggested translations throughout the document to enhance readability for Chinese readers. For example, translate "Global Class" to "全局类", "accept friend request" to "接受好友请求", "hello" to "打招呼语", and "enum" to "枚举".
  • 32-62: The examples provided are clear and offer practical guidance on using the Friendship class to handle friend requests.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 3

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 8597070 and 24dea70.
Files selected for processing (1)
  • docusaurus/i18n/zh/docusaurus-plugin-content-docs/current/api/message.md (1 hunks)
Additional comments: 9
docusaurus/i18n/zh/docusaurus-plugin-content-docs/current/api/message.md (9)
  • 6-6: Considering the PR's objective to change absolute links to relative ones for better maintainability, this link should be converted to a relative path if possible. This aligns with the previous comment and remains valid.
    ,
  • 19-19: The term MessageType is mentioned without a clear definition or link to its explanation. It would be beneficial for readers if there was a brief description or a link to a section that elaborates on the different MessageType values. This comment remains relevant.
    ,
  • 26-28: The methods toFileBox(), toContact(), and toUrlLink() all return Promise, but it's not specified what the resolved value of these promises will be. Adding this information would greatly improve the documentation's clarity and usefulness. This comment is still applicable.
    ,
  • 44-61: In the example code, there's a potential issue with assuming contact is not null when calling contact.name(). Since message.from() can return null, it would be safer to add a null check before using the contact object. This comment is still valid and important for preventing runtime errors.
    ,
  • 160-160: The example link provided here is an absolute URL. As mentioned earlier, converting this to a relative path would align with the PR's objective and improve maintainability. This comment remains relevant.
    ,
  • 329-329: The explanation of the age() method includes a specific example with hardcoded times. While this is helpful, it might be more beneficial to explain the general concept (i.e., it calculates the difference in seconds between when the message was sent and when it was received) without relying on a specific example. This comment is still applicable.
    ,
  • 19-19: The term MessageType is flagged as a possible spelling mistake. This seems to be a false positive, as MessageType is a technical term relevant to the context. No action is needed here, but it's good to be aware of how spell checkers interpret technical content.
  • 26-28: The terms toFileBox(), toContact(), and toUrlLink() are flagged as possible spelling mistakes. These are method names and not spelling errors. This highlights the importance of context when interpreting spell checker flags in technical documentation.
  • 158-158: The unpaired symbol warning for the puppet-compatible-table link suggests a formatting issue. However, upon inspection, the markdown link appears to be correctly formatted. This seems to be a false positive, and no action is required.

aherman3 and others added 2 commits March 26, 2024 17:08
…message.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@aherman3 aherman3 requested a review from hcfw007 March 26, 2024 09:34
iamrajiv
iamrajiv previously approved these changes Mar 27, 2024
windmemory
windmemory previously approved these changes Mar 28, 2024
Copy link
Member

@windmemory windmemory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

docusaurus/npm-debug.log Outdated Show resolved Hide resolved
@aherman3 aherman3 dismissed stale reviews from windmemory and iamrajiv via d37d836 March 28, 2024 07:03
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 11

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 24dea70 and d37d836.
Files selected for processing (4)
  • docusaurus/i18n/zh/docusaurus-plugin-content-docs/current/api/contact-self.md (1 hunks)
  • docusaurus/i18n/zh/docusaurus-plugin-content-docs/current/api/contact.md (1 hunks)
  • docusaurus/i18n/zh/docusaurus-plugin-content-docs/current/api/message.md (1 hunks)
  • docusaurus/i18n/zh/docusaurus-plugin-content-docs/current/api/room-invitation.md (1 hunks)
Additional comments (4)
docusaurus/i18n/zh/docusaurus-plugin-content-docs/current/api/contact-self.md (1)
  • 15-18: The method signature for contactSelf.name([name]) suggests it can return either Promise<void> or string, which might be confusing. Typically, a method should have a single return type for clarity and consistency.

Verify the method's implementation to ensure the documentation accurately reflects its behavior. If the method can indeed return different types based on the input, consider providing additional context or examples to clarify its usage.

docusaurus/i18n/zh/docusaurus-plugin-content-docs/current/api/message.md (3)
  • 19-19: The term MessageType is mentioned without a clear definition or link to its explanation. It would be beneficial for readers if there was a brief description or a link to a section that elaborates on the different MessageType values.
  • 26-28: The methods toFileBox(), toContact(), and toUrlLink() all return Promise, but it's not specified what the resolved value of these promises will be. Adding this information would greatly improve the documentation's clarity and usefulness.
  • 329-329: The explanation of the age() method includes a specific example with hardcoded times. While this is helpful, it might be more beneficial to explain the general concept (i.e., it calculates the difference in seconds between when the message was sent and when it was received) without relying on a specific example.

@aherman3 aherman3 requested review from a team and iamrajiv March 28, 2024 08:20
@aherman3 aherman3 removed the request for review from iamrajiv April 24, 2024 07:23
@aherman3
Copy link
Contributor Author

@huan could you approve this PR again? An outstanding request kept your previous approval from meeting merge reqs

@huan
Copy link
Member

huan commented Apr 25, 2024

@aherman3 I only work with English documentation (with approval). For Chinese documentation, please ask for help from @wechaty/writers other than me to approve your PR.

I'd love to work with you on any documentation/PRs in English.

@aherman3 aherman3 requested a review from a team April 25, 2024 06:51
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.

6 participants