Skip to content

Conversation

c4710n
Copy link
Contributor

@c4710n c4710n commented Oct 16, 2024

This PR aims to improve doc of URI.encode:

  • Provide a clearer explanation for the predicate argument, including its execution logic and the built-in functions that can be used.
  • List common use cases for the built-in functions. For example, URI.char_unescaped?/1 for the whole URL, URI.char_unreserved?/1 for URI components.
  • Correct the line - "See encode_www_form/1 if you are interested in escaping reserved
    characters too.", which is not very precise:
    • if we want to escape reserved characters, we should use URI.char_unreserved?/1, not URI.encode_www_form/1.
    • We only use URI.encode_www_form/1 when we want to encode a string as "x-www-form-urlencoded".
  • Remove the explanation of truthy and falsy values, as we should assume developers are already familiar with them. Otherwise, we would have to explain them every time they appear.

Feel free to comment, and I'd like to make changes.

@whatyouhide whatyouhide merged commit fa2a49f into elixir-lang:main Oct 16, 2024
9 checks passed
@c4710n c4710n deleted the zd/improve-doc branch October 16, 2024 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants