-
Notifications
You must be signed in to change notification settings - Fork 3k
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
stdlib: markdown conversor to erlang+html #8077
stdlib: markdown conversor to erlang+html #8077
Conversation
CT Test Results 5 files 540 suites 1h 25m 28s ⏱️ Results for commit 767ea13. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
Could you have forgotten to push Btw, we have a module in Elixir for converting markdown to ansi/shell. I assume that if you only care about ansi/shell, it is actually a subset of the problem of converting all of markdown to html: https://github.com/elixir-lang/elixir/blob/main/lib/elixir/lib/io/ansi/docs.ex Tests are here: https://github.com/elixir-lang/elixir/blob/main/lib/elixir/test/elixir/io/ansi/docs_test.exs |
1a22adc
to
79ea9f1
Compare
@josevalim thanks! The thing is that not all of my tests pass, so I did not bother to push what I had... We will see how it goes :) Otherwise, we probably will re-use parts of the Elixir code :) That said, this PR was highly influenced by the Elixir |
From the LSP side it would be more convenient if we could skip |
I believe the docs chunk will have markdown for Erlang from OTP 27 onwards if using |
Yes, docs chunks will have markdown. The erlang+html is just for transforming the erlang shell, so that one can write |
@lukaszsamson From an LSPs perspective you may want to use the new edoc_html_to_markdown module added in Erlang/OTP 27 that converts But, as the others here have said, for all of the Erlang/OTP docs after 27 you will get the markdown directly from beam file using |
Nice. Like you said the translation to markdown will need to stay until support for OTP 26 is dropped but that's not going to happen soon (ElixirLS currently still supports OTP 22) |
34078c4
to
5ea526c
Compare
d6ffd0f
to
f2cf613
Compare
documentation attributes are written in markdown and this parser consumes markdown doc attributes and emits erlang+html. when someone types the `h(mod)`, `shell_docs.erl` converts the markdown documentation attribute to erlang+html, since `shell_docs.erl` knows how to interpret this format.
767ea13
to
bf887e3
Compare
conversor from markdown to
erlang+html
.shell_docs
needs documentation inerlang+html
format, so that it can render the documentation attributes correctly in the shell. documentation attributes are written in markdown and, with thiserlang+html
conversion tool,shell_docs
can interpret documentation attributes.