-
Notifications
You must be signed in to change notification settings - Fork 331
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
Output man pages #1962
Comments
It probably makes the most sense for us to have a markdown output. Then you can use something like |
I remember some years ago I proposed having a Markdown formatter. I think having the documentation in this format opens up the possibility to a lot of things. Now that I have some free time I can look into working on an implementation. What would the basic requirements be? |
I can't think of many requirements, actually. I guess the only question is if it is one markdown file per module or one per function. If it is one per module, then it is equivalent to our other formatters, but probably considerably simpler. |
One per module matches the old OTP man pages, so for this use case, it's perfect. |
I would go with one file per module per file. This way the documentation could be readable over a terminal with |
We have an escript that converts a subset of markdown to man pages: https://github.com/erlang/otp/blob/master/make/markdown_to_man.escript. So if ex_doc could generate markdown documents for each module, that escript could be used to create man pages for it. Note that the escript is on intended for general use, only of the subset of markdown used by the Erlang/OTP docs. |
I'm already working on it, and I have a draft working version. I will create soon an issue so we can discuss about anything related to this feature. |
Here's the PR #1992 with the Markdown implementation. You can see the generated markdown files in this repo https://github.com/eksperimental/ex_doc_markdown_formatter_docs and tell me if that would suit your needs for generating the man pages or if there is something that needs to be changed/added. |
When OTP switched to using
ex_doc
in OTP 27, we lost the man pages for the OTP modules.Would you accept a PR to produce man pages, or is there a way to access the intermediate markdown format and use an external tool (e.g. pandoc) to generate man pages from it?
Example of an OTP man page from OTP 26:
The text was updated successfully, but these errors were encountered: