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

docs: add inline documentation #91

Merged
merged 4 commits into from
Aug 13, 2022
Merged

docs: add inline documentation #91

merged 4 commits into from
Aug 13, 2022

Conversation

iShibi
Copy link
Contributor

@iShibi iShibi commented Aug 8, 2022

I have added docs only for the four major functions. Once the writing style gets a green flag I would be happy to document all the other stuff.

Copy link
Contributor

@RafaelGSS RafaelGSS left a comment

Choose a reason for hiding this comment

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

I believe the inline documentation is useful just for the methods exported by this library. Internal methods should have their naming clear enough

@iShibi
Copy link
Contributor Author

iShibi commented Aug 9, 2022

By other stuff I meant the interfaces. Doing so would allow the editor to show what a particular field in an object parameter does.

Copy link
Contributor

@RafaelGSS RafaelGSS left a comment

Choose a reason for hiding this comment

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

Including SearchResult would be great, yeah.

@iShibi iShibi marked this pull request as ready for review August 10, 2022 16:36
@micheleriva micheleriva requested a review from RafaelGSS August 12, 2022 16:18
Copy link
Contributor

@RafaelGSS RafaelGSS left a comment

Choose a reason for hiding this comment

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

Most of the inline documentation is pretty redundant to me. Example:

export interface Lyra<S extends PropertiesSchema> extends Data<S> {
  /**
   * The default language analyzer in use.
   */
  defaultLanguage: Language;
  /**
   * The structure of documents stored in the database.
   */
  schema: S;
  edge: boolean;
}

You don't need to add inline documentation to everything, just mention unclear fields.

For instance:

  /**
   * The maximum [levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance)
   * between the term and the searchable property.
   */
  tolerance?: number;

is a great addition. As said previously, I'd keep just the inline doc for exported functions + unclear fields (tolerance)

@iShibi iShibi requested a review from RafaelGSS August 13, 2022 15:41
@RafaelGSS RafaelGSS merged commit 8456055 into oramasearch:main Aug 13, 2022
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.

2 participants