-
Notifications
You must be signed in to change notification settings - Fork 10
Markdown processing pipeline design #245
Comments
Possible steps:
|
Are there hooks in the nextjs build process to fire a task before all pages build or after all pages have been built? Alternatively, should we introduce inotify-wait to implement a third command |
We should use a different file extension for inputs / outputs of each stage. Possibly: .omdx, .md, .mdtoc |
Leaning towards Ashish's suggestion of invoking an external operating system process (invoking ocaml logic) from rescript as the first step of processing a markdown file, where the process writes the result to stdout, and rescript continues working with the result. |
We need to experiment with invoking ocaml-mdx soon, in order to get more clarity on what is possible. In particular, will dune become a runtime dependency of the nextjs build? |
So far I'm thinking of a system with 3 build tools in this order:
All 3 tools support a watch mode, so ideally a developer launches all 3 and clearly gets incremental builds across all stages. |
I would move that comment into a new issue. This issue is for the specifics of integrating ReScript with remark, omd, and ocaml-mdx, possibly using nodejs child process. The comment above addresses this at a high level, but also is useful for structuring the build for other processing like #140 . |
It will be useful to understand rescript-lang's highlightjs integration (https://github.com/rescript-association/rescript-lang.org/blob/master/src/common/HighlightJs.res) while contemplating this design. |
Starting to add diagrams and descriptions of options here - https://docs.google.com/document/d/1dCfHnYwCM8-lCZZ38ZwpLBrP_Ru6NISBHS12qO2Wo90/edit?usp=sharing |
I'm going to run with spikes to explore how the following combination might work:
Based on the findings from the spikes, I will either continue pursuing that design or regroup and come up with a new design or select one of other alternatives. |
The spike #290 did not reveal any significant problems with using node child_process or using ocaml-mdx. I'm going to pursue the design noted above. |
If we decide to use omd later, we can use rehype-parse and rehype-react to accept generated html. |
@tmattio This issue might be interesting for you. There is no action needed here. |
Create a diagram and brief explanation of the phases in markdown processing and how data will be passed between phases.
Demonstrate the contents of the markdown after each transformation
Related to #222 #243 #229 #137
The text was updated successfully, but these errors were encountered: