-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Tracking: Website plans #105
Comments
Brain dump from Discord: I think in rough order of priority, we should document:
the playground is probably somewhat challenging, and something I can dedicate my time to. Contributions are very much appreciated for other stuff. In the meantime, I revived the old website here: https://bucklescript.vercel.app/, which should be a good starting point. even though it probably takes more work, it'd be great to build the docs website at https://melange.re/ with Melange itself, so we can make sure we're dogfooding the project. |
Add to the docs:
|
|
if melange can consume rescript-generated libraries in a single pipeline (i.e. having just one build invocation that will run rescript over the rescript source then run melange and generate javascript that imports the rescript-generated library) that would be a great thing to document |
In lack of better idea how to approach this, I would like to offer my help to start a website here. I think we could start with something simple and then iterate from there. |
I'm willing to contribute some time working on the website for melange :) |
I have been exploring https://github.com/dmbaturin/soupault. It was recommended on Discord and the ideas behind it looked interesting. Quick summary: it's a static site generation tool influenced by Unix philosophy and quite easily plugged into any kind of setup, as it operates on html elements. One way to define it would be a "Like jQuery, but written in OCaml, well integrated with command line, and running at build time". To test Soupault and see if it could be a good fit, I put up a small skeleton site that does the following:
All that is done with less than 20 source files in the project. It looks promising, but this setup might become too complex if we want to integrate things like React, Next.js etc. In general, I'm not convinced as this approach makes "dogfooding" a bit harder. Also it can be a barrier for contributors. What do you all think? Source: https://github.com/jchavarri/melange-docs |
Looks great @jchavarri. I am exploring an Odoc fork that is able to pick up markdown files in the repository. This can also be a possible option for documentation generation. It has some of the advantages of your approach and some other advantages:
I am still hacking on it and might run into some roadblocks so not sure if it's a viable option for now. But let me know what you think about this approach! An interesting aspect is, that with melange we can render pages both statically and hydrate them in JavaScript using React. There is still some work necessary to make this work, especially in writing a React-ppx that works with my native static renderer, and is API compatible with the React-ppx in melange. It's more of a stretch goal, but it would surely show the capabilities of melange. |
Better integration with markdown would be great to have in odoc @jfrolich 👍 thank you for your work on that.
Last time I checked odoc —for the jsoo-react docs— I ran into this problem where syntax in odoc seems to be a top level setting. I mean that either one exports all docs with OCaml syntax or with Reason syntax. And there is no awareness of this setting in "in-docs snippets" which are handled just like text. But I wanted to have "dual" output to later allow users to switch syntax without reloading the page for better experience. Is this possible in some way? For completion, another approach I've seen other projects use is run "standard" odoc first, and then run soupault after it to add enhancements in a small postprocessing step (example in Dream makefile). But if markdown files were added with this approach we'd lose cross-reference as you mention.
This project looks great. I specially like the one-file packing and offline search mode —although it has the obvious counter side of increased bundle sizes. I will take a closer look 👀 thanks for sharing! Edit: here's the branch where I attempted to add a "dual syntax" output to odoc: https://github.com/ocaml/odoc/compare/master...jchavarri:generator_both?expand=1. As mentioned, it only affected signatures, but could not find out how to include snippets in documentation comments as well. |
Yes that is true, but the capability is there to generate both, so storing both in the HTML should just be a matter of adapting the data model and store both (that's why I am forking). About the code blocks. Perhaps we can make a specially annotated codeblocks that are always in the source language of the file itself, and will be parsed to different syntaxes by odoc?
Yeah I saw projects do this as well. It's mostly just a hack, would be great to have a proper solution for this.
I don't think we necessarily loose that (the markdown files are just translated to ocamldoc).
I probably first try to generate into this layout and not necessarily the one file packing. (although it would be nice if we could generate the one-file packing for portability). |
I meant with an "off-the-hook" approach with |
Managed to thread OCaml code snippets through melange |
@jchavarri FWIW, not sure what the target audience for the site is, but I dread the previous, top, next setup. |
Bystander comment. My ideal static site (assuming unbundled development is too bleeding edge) would use bucklescript-tea, simple routing, manually configure the code splitting, remark js, and tailwind for the homepage, general content pages. Do the initial mockups in webflow, then use tailwind to implement the designs. |
Yes, I'm not a fan either 😄 Right now I'm prototyping and experimenting, and open to ideas and help to build a decent 1st version without having to create a whole design system or stuff like that, as the whole thing will most likely be thrown away at some point. I am currently checking https://pmarsceill.github.io/just-the-docs/ which looks much nicer than the typesettings.css template I was using before. I have adapted it to Soupault to get index / side bar generated automatically. There are still some things to fix, but a preview can be seen at the same url: https://jchavarri.github.io/melange-docs/
How would something like auto-generation of translated Reason code + I might be too insisting on having a nice automated pipeline to transform OCaml snippets to get Reason and JS code, but it's probable that the site will end up having a lot of them. For an example, I took the interop page from the original BuckleScript doc site and adapted to remove all |
Added a page with goals and history: https://jchavarri.github.io/melange-docs/intro/ |
There is quite some work to create the docs. As some folks have expressed interest in helping, if you think the approach in the repo linked above is good enough for v1, here are some self-contained tasks where any help is welcome: Content
If none of the above is appealing, there could be a new UI
Edit: in progress
|
I can research this a bit. I am sure there is a solution for generic markdown to html rendering. I assume you are specifically asking about invoking compiler logic to perform conversions, in the browser, as well as some general integration with code highlighting? |
Love your work @jchavarri! I also made a bit more progress on This might take a while to get right so until that time we can do some magic with Soupault. |
I think doing this in the browser would create an enormous dependency. We can generate them when compiling the docs. Basically trying if it parses, and if so print the reason or rescript syntax as alternative code blocks. |
Sounds good @jfrolich ! I am looking into migrating the articles in the "Interop" section articles to the docs, and there are a lot of links to API modules like |
There is now a website in melange.re, and playground in https://melange.re/v1.0.0/playground (or https://melange.re/unstable/playground if you want to use the bleeding edge) 🎉 . Improvements, additions or bugs can be reported either in this repo or in https://github.com/melange-re/melange-re.github.io. |
Well, I guess we need a website.
No specific issue opened — someone make one:
The text was updated successfully, but these errors were encountered: