Skip to content

Updates Documentation from Strings to Units#2838

Merged
smallsaucepan merged 1 commit intoTurfjs:masterfrom
conor-f:docs-full-units
May 16, 2025
Merged

Updates Documentation from Strings to Units#2838
smallsaucepan merged 1 commit intoTurfjs:masterfrom
conor-f:docs-full-units

Conversation

@conor-f
Copy link
Copy Markdown
Contributor

@conor-f conor-f commented Feb 11, 2025

In many places the documentation suggested that the only types a method could take were strings like miles or kilometers when the code actually supported all Units. Updated this in any place I could find using grep to find the files that needed changes, and manually updating the comments.

This is a non-breaking change.

Supercedes #2218 but fixes no open issues.

Please provide the following when creating a PR:

  • Meaningful title, including the name of the package being modified.
  • Summary of the changes.
  • Heads up if this is a breaking change.
  • Any issues this resolves.
  • Inclusion of your details in the contributors field of package.json - you've earned it! 👏
  • Confirmation you've read the steps for preparing a pull request.

@smallsaucepan
Copy link
Copy Markdown
Member

Thanks for putting this together @conor-f. Could I please ask a favour? Rather than link to the md file in the repo, it's probably cleaner to point people to the website instead.

Would you have an easy way to update the PR to do that? If it means hand editing them all again, maybe we can put our heads together to automate it somehow.

There is a separate pages for linear and areas units as well:

And then ultimately we'll retire https://github.com/Turfjs/turf/blob/master/packages/turf-helpers/README_UNITS.md

@conor-f conor-f force-pushed the docs-full-units branch from 72d9422 to 7501c18 Compare May 16, 2025 06:59
@conor-f
Copy link
Copy Markdown
Contributor Author

conor-f commented May 16, 2025

Thanks for getting back to me @smallsaucepan :)

Updated the PR to link to the website version of the docs as requested. All of these changes were related to Units and not AreaUnits, so I generated the patch, did a search and replace of the README.md URL and replaced it with the website URL. No more hand-editing needed, but it did end up with me needing to force push the branch.

Let me know if there's any other issues :)

@smallsaucepan
Copy link
Copy Markdown
Member

Thanks @conor-f. That's fantastic. Appreciate you taking care of this!

@smallsaucepan smallsaucepan merged commit faf58b3 into Turfjs:master May 16, 2025
3 checks passed
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