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

Update ixdtf crate documentation #4866

Merged
merged 3 commits into from May 17, 2024
Merged

Conversation

nekevss
Copy link
Contributor

@nekevss nekevss commented May 5, 2024

This PR cleans up the crate docs and README for ixdtf.

The changes consist of:

  • RFC 9557 link was added in place of SEDATE.
  • It adds a section and example for implementing annotation handlers.
  • Some changes to general wording and formatting to hopefully make some sections clearer.

@nekevss nekevss requested a review from a team as a code owner May 5, 2024 04:26
@nekevss nekevss force-pushed the update-ixdtf-docs branch 2 times, most recently from 1b02047 to df9ee56 Compare May 5, 2024 05:10
@nekevss nekevss requested a review from sffc May 6, 2024 01:10
Copy link
Member

@sffc sffc left a comment

Choose a reason for hiding this comment

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

Nice! Thanks for adding an annotation handler example here

//! (3) shows an unknown key-value annotation. In this situation, the annotation
//! ##### Example 3
//!
//! This example shows an unknown key-value annotation. In this situation, the annotation
Copy link
Member

Choose a reason for hiding this comment

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

Example 3 is

//! - (3) `2024-03-02T08:48:00-05:00[u-ca=iso8601][!u-ca=iso8601]`

which is inconsistent with this text.

//!
//! let _ = IxdtfParser::new(example_with_custom_key).parse_with_annotation_handler(|annotation| {
//! if annotation.key == "answer-to-universe" {
//! answer = Some(annotation);
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: since this is supposed to show you how to write one of these handlers correctly, please use get_or_insert to retain the first value. Alternatively, implement the additional logic involving mismatched critical annotations.

@sffc
Copy link
Member

sffc commented May 17, 2024

@nekevss Prefer using merge commits over rebases because it makes it harder to track changes, and the individual commits will be squashed anyway when landing on the main branch.

@sffc sffc merged commit 7607353 into unicode-org:main May 17, 2024
30 checks passed
@nekevss
Copy link
Contributor Author

nekevss commented May 17, 2024

@sffc Sounds good. Will do on future any future PRs.

@nekevss nekevss deleted the update-ixdtf-docs branch May 17, 2024 20:25
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.

None yet

2 participants