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

Show docs from any textual chunk in the shell #4579

Merged
merged 1 commit into from
Mar 11, 2021

Conversation

josevalim
Copy link
Contributor

@josevalim josevalim commented Mar 4, 2021

This pull request augments shell_docs to also
handle any chunk with type of "text". Those will
be rendered as is and allow the Erlang shell to
show the documentation of projects that do not
adhere to the application/erlang+html format.
This is useful because many documentation formats
(Markdown, Asciidoc, etc) are readable in their
native format.

This pull request augments shell_docs to also
handle any chunk with type of "text". Those will
be rendered as is and allow the Erlang shell to
show the documentation of projects that do not
adhere to the application/erlang+html format.
@josevalim
Copy link
Contributor Author

One downside of this PR is that if someone has docs of format text/html, it will also print those as is. The alternative here is to explicitly list which formats we want to allow (text/markdown, text/asciidoc, etc) but I think the current approach is a valid compromise, especially because any structured textual format is still readable. Here is an example of how Elixir docs would look like from the Erlang shell:

Screenshot 2021-03-04 at 09 31 23

@garazdawi garazdawi self-assigned this Mar 4, 2021
@garazdawi garazdawi added enhancement team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI labels Mar 4, 2021
@garazdawi garazdawi merged commit 3a7873f into erlang:master Mar 11, 2021
@garazdawi
Copy link
Contributor

Merged! Thanks! I agree with your tradeoffs in the implementation. We can change it in the future if someone want to emit html in as documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants