-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Add some signposting to the String docs for pattern matching #13514
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
Add some signposting to the String docs for pattern matching #13514
Conversation
As a user of the docs, when looking for information on how to pattern match with strings and binaries the first place one looks is the String docs. Currently there isn't anything here for pattern matching besides a small example matching a character. The user would either have to go from the reference section to the patterns and guards guide or go to the <<>>/1 special forms docs. This change just adds a link to the special forms docs and the guide to signpost the user to those resources.
For reference my flow when looking for this information was String module, i just saw the single Then when i was going to make this pull request, doing a search in github i found the patterns and guards reference which is at the very bottom of the guides and this does link to the special forms docs |
lib/elixir/lib/string.ex
Outdated
See the documentation for [`<<>>`](`<<>>/1`) or the Patterns and Guards | ||
guide for more information on binary pattern matching |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can link to the guide as well:
See the documentation for [`<<>>`](`<<>>/1`) or the Patterns and Guards | |
guide for more information on binary pattern matching | |
See the documentation for [`<<>>`](`<<>>/1`) and the [*Patterns and Guards* | |
guide](patterns-and-guards.md) for more information on binary pattern matching. |
Can you try out make docs_elixir
locally with this and see if the link is to the right page?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.md
perhaps?
Another instance from Kernel
doc:
[Patterns and guards](patterns-and-guards.md)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sure yep
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. built the docs and it links to the correct pages
Thanks for the feedback I'll sort that out when I'm home. I might change the order too, "see patterns and guards (link) and <<>> for more information on binary pattern matching. " Go from less specific to more specific. |
💚 💙 💜 💛 ❤️ |
As a user of the docs, when looking for information on how to pattern match with strings and binaries the first place one looks is the String docs.
Currently there isn't anything here for pattern matching besides a small example matching a character. The user would either have to go from the reference section to the patterns and guards guide or go to the <<>>/1 special forms docs.
This change just adds a link to the special forms docs and the guide to signpost the user to those resources.