-
Notifications
You must be signed in to change notification settings - Fork 97
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
Reason/OCaml syntax switching #129
Comments
Hey 👋 Hope this is okay? |
The way I see this feature implemented and run is:
@aantron What do you think about this approach? |
Yeah, or you could just compile refmt to js and do the conversion of the fly. |
@Drup I think it would be harder to achieve that for the signature items' markup. For examples, yes. But the markup is not purely textual, it has links and styling. |
It is, and quite welcome :) @rizo, I think that works. My original thought was to generate both OCaml and Reason output side-by-side in each HTML file, and use CSS to hide/show the right one. But this is probably bad for accessibility, navigation, etc., so separate output trees are likely to be better. |
I liked this idea as well... in my initial draft, I will just generate the whole documentation in ML / RE syntax side by side. Later on we can think of combining the output |
@aantron @Ostera @rizo So my idea to complete all of this was to basically generate both versions, but always hide one unselected version via CSS. By providing the As soon as this is done, we can add a JS-driven toggle for both syntaxes in the doc header. |
Not hard to do but can we make sure to have an option that only generates one or the other rather than both. Personally, I think that setting should be the default, but that's less important than having the option. |
Totally agreed with @lpw25. Maybe the Additionally it would stop producing two file-system sub-trees for each syntax prefixed with I think this should be relatively simple to achieve with the current HTML generation code. @ryyppy is this something you want to work on next? I think we should do this before releasing odoc. |
@rizo Yeah, after doing some integration work in Dune, I think this is the right way to do it. I think I can get this done this week. |
Great, let me know if you need help with this!
I believe you should be able to use Cmdliner.Arg.env_var for that. |
Is there anything left to do on this one? I'm eager to get started trying out odoc. I like the discussion here about always generating both, but allowing doc authors to have total control over it if they want. |
@jordwalke i am currently working on the syntax toggle feature... as soon as we get this in, we can switch the behavior of odoc to render both syntaxes by default and use the Will let you know as soon as this is done, then we should try to rebuild some essential doc pages of e.g. BuckleScript with the new odoc changes. |
@ryyppy How is it going with this PR? Need any help? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This is about outputting docs in Reason syntax.
Nothing needs to be done at the parsing end, because odoc reads docs from parsed ASTs (after the OCaml or Reason parser is done running), so the source syntax doesn't affect odoc.
https://discuss.ocaml.org/t/1841/13, https://discuss.ocaml.org/t/1841/47. The Ocsigen website has an example of switching (http://ocsigen.org/lwt/3.2.1/api/Lwt). cc @Drup
The text was updated successfully, but these errors were encountered: