-
Notifications
You must be signed in to change notification settings - Fork 99
Markdown output #1341
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
Open
davesnx
wants to merge
37
commits into
ocaml:master
Choose a base branch
from
davesnx:markdown-output
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Markdown output #1341
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* 'master' of github.com:/ocaml/odoc: (31 commits) Update docs Parser: Ensure parser can be called concurrently Parser: Fixes following PR review Parser: more tests Parser: Allow \ddd escape sequence in code-block metadata Parser: Use lexer for quoted strings in code block metadata Simplify code-block tag types and parser Warn on escaped character that does not need escaping Tag parsing: Unescape everything Make ocamlformat ignore cppo file Fix odoc_of_md wrt new tag type Fix typo Disable extract-code on OCaml < 4.10 Extract code: handle error Add location to the whole tag block Add location to binding key and value Add location for tag/binding Fix unescaping of quoted strings Parse code block tags OCaml 4.14 compatibility ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
This PR might come out of the blue, but there's a good reason. Let me explain myself in the "Why" below.
Also, when I was half done, I discovered a stale PR (#791) targeting the same problem, and I thought it could be helpful to other people.
Why
We use
odoc
in Melange's documentation, to generate API references for Melange libraries, such as Belt, Js, and Stdlib. While the rest of the documentation is handled by vitepress a static site generator working with Markdown files, with a lot of interesting features.This works reasonably well, but creates a big barrier between the documentation sites:
For this reason, I wanted to generate markdown from odoc and (in the melange case) have another process that manipulates those markdown files to expand the documentation.
Another big use case for Markdown generation is Github, or any markdown renderer platform really.
How
I forked the HTML backend into a
markdown2
, removed what's unnecessary, and implemented Markdown construction with cmarkit.I currently name it
markdown2
since there isodoc_md
anddoc_of_md
under the markdown folder. I suggest renamingmarkdown -> odoc-md
(or justmd
) andmarkdown2 -> markdown
in a new PRNotes about implementation
--allow-html
where I enable this functionality of outputting HTMLmarkdown-with-belt.t
andmarkdown.t
. I could probably split them or organise them differentlyExample
melange-re/melange-re.github.io#224
Future work
—allow-html
option I mentioned above