-
Notifications
You must be signed in to change notification settings - Fork 46
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
Markdown -> Ocamldoc conversion #215
base: master
Are you sure you want to change the base?
Conversation
Thanks! Could you say a few words about the intended use-case for this? |
We are looking to support markdown syntax for documentation in Reason to make documenting code more accessible for newcomers. As markdown is ubiquitous, ocamldoc is just another indirection that adds friction. Additionally markdown has proven itself to be much more readable in plain text, so that is more ergonomic when reading source code instead of generated documentation from ocamldoc. If you don't think this printer should be in scope of By the way. Did you think about creating a markdown output, this will allow creating a pretty printer for markdown (automatic prose-wrapping)? |
There is a pretty extensive test suite with input/output snapshots in the prettier repo: https://github.com/prettier/prettier/tree/master/tests/markdown. |
Sounds like a good idea, indeed.
Well, on the one hand, it sounds like a cute addition. On the other, it look like something slightly specific that can very well be coded client-side, and I am a bit reticent to add a feature that will be used by a single project. I would like to think about this a bit more.
Yes, we used to have a Markdown backend, but I removed it because it was incomplete/buggy. However, recently someone else also requested a markdown backend, so am planning to put it back in (but haven't done so yet). |
a01807e
to
4026767
Compare
Nice, this would allow getting rid of https://github.com/mseri/md2mld The rationale there was that many packages have extensive README that would be nice to bundle as documentation introductions or tutorials (instead of always relegating them to the repository) |
Yes! |
We'll revisit this once we've stabilized the AST and have some answers to #205. In the meantime, I wonder if it would make sense to connect with the ocamldoc maintainers to see how they feel about this kind of feature, and if they have any opinions/suggestions on how to execute in way that would work best with the rest of the ecosystem. |
Sure! @jfrolich in the meantime, feel free to submit any improvement from this PR that you may need to |
The interface of odoc has already changed since 2.0.0~alpha1, this is based on @jfrolich PR ocaml-community/omd#215 and is intended as an intermediate step to ease the port to the next release of omd. Issue #5 will not be closed for the time being. In particular there is a regression in the way we deal with blockquotes. These need to be addressed anyway, see #2. Signed-off-by: Marcello Seri <[email protected]>
The interface of omd has already changed since 2.0.0~alpha1, this is based on @jfrolich PR ocaml-community/omd#215 and is intended as an intermediate step to ease the port to the next release of omd. Issue #5 will not be closed for the time being. In particular there is a regression in the way we deal with blockquotes. These need to be addressed anyway, see #2. Signed-off-by: Marcello Seri <[email protected]>
CHANGES: - use html blockquotes - port to omd 2.0.0~alpha1 -- including cross-linking features (from ocaml-community/omd#215) - trim output - modified argument parsing
Work in progress.
I am not stoked to introduce
Str
here, there's probably a better way to do this, I just wanted it to make it work first.You can test it with the following:
create file
test.md
:Now get the result with the following command:
dune build && ./_build/default/tests/omd_ocamldoc.exe test.md
It yields: