-
Notifications
You must be signed in to change notification settings - Fork 515
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
Support EEP 48 Docs chunk #1842
Comments
Yeah I'm all in favor for this work. Is there anything needed aside from putting rebar3_docsh in the plugins list? |
It's enough for now. Of course, any kind of feedback is welcome, too. |
Yeah it'll take a while before I have enough time to personally try it. Will have to see what the artifacts look like and so on. Ideally, after the plugin matures, it would be neat to be able to pull that kind of functionality within rebar3, but we'll have to take the time to take a more mature look. So far the instructions seem clear, so that's good. |
Hopefully one day the functionality will also be in edoc (and the |
Yeah. We have no direct control over that in this project, though. |
Would it be reasonable to have this as a default in rebar? If it's going to be opt-in, nobody's going to opt into it, because there's no direct benefit for the maintainer of the library - the benefit is for the consumers, but they can't do anything about it. |
It is my intention to make this happen for OTP-22. Most likely we'll implement the .chunk part of the EEP. |
@garazdawi I would be happy to help :) |
hi, I intend to support this EEP in efene, but more interesting to anyone else, I've built a project that parses the erlang documentation and allows to translate it to any format, I have a half backed restructured text generator here: https://github.com/marianoguerra/beamdocs#build the resulting restructured text is really ugly, I just wanted to see if I could handle all of OTP docs and as of now it works with OTP master, the most interesting part is the xml -> erlang data structures part, after that we can translate it to ExDoc markdown format and use ExDoc for it :) |
here's HTML generated using sphinx: http://marianoguerra.org/tmp/html/ (I generated the index with a bash script, now I'm adding support for the book.xml format to improve the index) |
@lackac We would appreciate any help you can give. The way I imagine it working is to basically take a copy of the xslt rules used to generate the man pages and rework that to output the EEP48 format into a plaintext file and then use a small escript to convert the text to the external term format. Feel free to contact me on irc, slack, email, pigeon post if you want to discuss this further. |
@garazdawi I think we can even store the xml in the chunk because we want to convert the data in the chunk to multiple formats. For example, ansi (or man) in the terminal, HTML for browser docs and so on. In this case, the |
@garazdawi I'm working on a exml to anything translator, right now it translate to erlang terms, markdown (pretty decent) and restructured text, I can make it translate to anything that's needed. @josevalim exdoc is markdown right? here you can see a quick build using mkdocs: http://marianoguerra.org/tmp/site/erts/book/ There are some xml entity scaping issues and encoding issues that I have to look for, but it's evolving pretty fast. maybe we can store them as erlang terms and do the translations later? |
The EEP-48 item entries stored by |
Erlang/OTP itself is in a privileged position because whatever format it picks will be supported by everybody, as you can simply make the tools part of the Erlang/OTP distribution. |
I created an issue here https://bugs.erlang.org/browse/ERL-708 for further discussion. Feel free to chime in. Regarding the format, one thing that I think is important is to have the same format for edoc and erl_docgen documentation, so that all Erlang libraries (OTP and non-OTP) follow the same format. |
I agree with @josevalim. I have no experience with edoc or the exml files but skimmed through the documentation of the former and looked into some examples of the latter. It looks to me that translating to Markdown will result in some loss of information along the way. We would need to decide what to do with each of the special tags. Some of that would be perfect for the docs metadata sections, but others would make more sense to represent in the text documentation. If we translate them into markdown we loose structural information that might be useful in some contexts. |
RestructuredText (reST) might be a better format 'if' one was to standardize on one. It's very pluggable by design unlike markdown, has no ambiguous bits like markdown, is about as easy as markdown for the parts markdown supports (although it supports a LOT more), has lots and lots of tools for it, and is already well used and been around for a very long time. In addition it can output to about anything in existence including HTML and man pages. It's even the default format used by popular documentation engines like Sphinx. |
The Erlang/OTP documentation is based on our own XML DTDs. There are several types of DTDs to be used depending on if it is a User Guide, an Erlang Module reference manual, a commanline utility manual etc. The few uses of Edoc markup in OTP is translated to the XML format mentioned above and the same goes for a few Markdown files on top level. When we have everything in XML format we apply XSLT transforms to produce HTML, Man and PDF. Erl_docgen is the application we use for generation of the documentation it has a backend for edoc which produces the OTP XML format. So when translating the OTP documentation to nicer html, epub, etc. only XML should be used as input. There might be edoc markup in .erl files but it is only used for a few applications. We are thinking of introducing other format for writing documentation and there I think Asciidoc seems attractive as an alternative or complement to XML. When you compare Markdown, RST and Asciidoc with our needs for markup and the ease of writing documentation I think Asciidoc seems the most attractive. Markdown seems to be the most popular but is unfortunately weak when it comes to standardization, markup features etc. |
FYI, I've released docsh 0.7.0 - https://github.com/erszcz/docsh/blob/master/CHANGELOG.md Alas, the pretty screenshot with erl/iex interop is outdated now (temporarily?), since this version stores unmodified EDoc in |
I have some plugins about this https://hex.pm/packages/rebar3_eep48 It's kind of PoC. I tried to make the erlang documentation compatible with elixir ex_doc generators |
The edoc PR for EEP-48 is nearing completion. It includes documentation about how to configure rebar3 to generate chunks by calling In the long run, do we want to make EEP-48 doc generation part of the compile step so that it will always be available in the rebar3 shell? Or would that impact the compilation speed too much? |
EEP 48 proposes a documentation format for BEAM languages. I've authored docsh - a library compiling source code documentation to the proposed
Docs
chunk format.docsh
also extendserl
with helpers enabling access to this documentation.Here's a screenshot showing the interop between Elixir (today's 1.7.0-rc.0) and Erlang with
docsh
(>=0.6.0):One hypothetic future use case, thanks to the shared format, is using ExDoc with non-Elixir projects.
Now once EEP 48 support is in place I think it's time to expose the project to the broader community - a Hex package is already available. Listing
rebar3_docsh
in the official Rebar3 documentation would definitely help, too.It's important to point out that the majority of OTP documentation is not stored in EDoc (the only format docsh can read currently), but in out-of-source OTP SGML. OTP team might change their build system to bundle the docs in EEP 48 format - it would benefit not just Erlang, but Elixir, LFE, Efene, and Alpaca users, too - but they probably have to be convinced that there's enough interest.
What do you think?
cc @josevalim @yurrriq @rvirding @marianoguerra @j14159
The text was updated successfully, but these errors were encountered: