-
Notifications
You must be signed in to change notification settings - Fork 89
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
Begin new odoc manuals #203
Conversation
src/odoc/page-index.mld
Outdated
@@ -0,0 +1,252 @@ | |||
{1:top odoc} | |||
|
|||
The documentation compiler for OCaml, Reason, and BuckleScript. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does BuckleScript belong here? You could as well say dune in that case. Any tool can use odoc really, I'd keep just "OCaml and Reason".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as we convey properly that this can be used with BuckleScript compilation units, I'm up for rephrasing.
It's not obvious to everyone, particularly since Reason can be used with the OCaml toolchain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be explained later, i.e., the fact that odoc is designed to be integrated into existing build toolchains like BuckleScript and dune. A "documentation compiler" operates on syntax; BuckleScript is a compiler, that's why I find it confusing.
Also, ideally the end users shouldn't worry about how odoc works at all. That's why I think it's important to have a separate guide that describes the documentation features for documentation authors.
src/odoc/page-index.mld
Outdated
|
||
{2:overview What is [odoc] really?} | ||
|
||
[odoc] is not your regular documentation tool. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd mention that it's designed to be build-tool friendly. With focus on parallelism, caching, etc. I don't mind adding those changes separately though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than "regular" I'd say "ordinary". We hope it becomes everyone's regular tool. :)
src/odoc/page-index.mld
Outdated
|> map ~f:compile_to_odoc (* here we have Game.odoc, Player.odoc, etc *) | ||
|> iter ~f:compile_to_html (* here we have Game/index.html, and so on *) | ||
|
||
]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be better to show this in shell syntax? Otherwise people will assume there's actually an OCaml API for this.
src/odoc/page-index.mld
Outdated
on compiler outputs and turns them into compiled documentation, which then | ||
becomes gorgeous HTML. | ||
|
||
A regular [odoc] execution transforms [cmt], [cmti], and [mld] files into [odoc] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you can explain what odoc
files are before mentioning them here? Surely people will ask "what is an odoc file?".
src/odoc/page-index.mld
Outdated
|
||
{[ | ||
# We must tell odoc what the name of this Package is! | ||
λ odoc compile --package Game -o ./src/Player.odoc ./src/Player.cmti |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor thing, but $
would look more familiar to most people.
src/odoc/page-index.mld
Outdated
Now we can compile this to an HTML file: | ||
|
||
{[ | ||
λ odoc html -I src -o . ./src/Player.odoc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The -o
is very important. I would explain that it's typically the root path of the generated documentation for a package.
Don't have time to do a thorough review but I like the idea in general. I would try to clarify who is the target audience for the manual sections. For example, the low-level compilation information is IMO only useful for people who need to integrate odoc into a build tool – I would try to make it more formal and less example-driven. Alternatively, for end users, it's more important to know how to write good documentation with the available features (pages, indexes, references, etc). |
Thank you very much for taking care of this! If there's anyway I can help or get involved, please let me know! It took me a really long time to figure out the process of building a documentation website with
I can only speak for myself, but I wish I knew all that upfront. |
Agreeing with @rizo here, the text so far is for people doing build system integration (and we do need that text). Hopefully, fewer and fewer end users will need to see this over time. odoc developers will always need this. |
One extra comment about the name change from |
I split the manual into smaller pieces that we can extend independently over time: https://ostera.github.io/odoc/Odoc/ However, I don't expect this PR to elaborate on all of them immediately, so I'll mark the Manuals in the TODO list as done. Over the next few days I'll get the build+publish process in place, and then we can review more easily. |
I included the necessary travis config to build and deploy on every commit that makes it to master. It's straightforward to drop if we decide to manually publish docs 👍 |
.travis.yml
Outdated
@@ -8,6 +8,8 @@ env: | |||
- OCAML=4.05.0 | |||
- OCAML=4.06.1 | |||
- OCAML=4.07.0 | |||
global: | |||
secure: jMXf4/x4WZdgYARkH9CEq/zk58fPhiRzUwysBzSSA1f+tb8uRGNaMukZ41tdCsTdH2AckVw8Q5CHDD8RZCtAwftZjOHjjocvPlRtCEtXwy9qri5+a9g3dqMj/0WMW4YUt0Z9oSAXfjObL7vKKTNUx/aZASLx9+vLJNGUYVfhtOWVBiWc9PuAaE+TYKcE4gY43OihgpEy2QK/O/wSkfY2eaf7rsWGMSS/re2dtaBsl9CS2Z8IcWarSfl9+KajDejU2ciTfKwK5JKGx6pSG6We3qj7hNl+zRQJCXsEVflqon8/K/HReFbwoFJ4iRcs3lAQ56sVKzYhhLyCKbGywgZPl3GmhwM+NSLpWeh9KQTbkBEQFK+8J6qRWSYsjaZktbIZIOjYRf+rAwSRdmRnI3rNppP02oxTgi5fBZV+t+3SjLsHZqfzutuAphED23Pj2nu0GUABNzFYV+XkracZFiiTQeWPb5iH2SC334pL+KmY6Dsp8JyP2Kq8NpOsZo8085368Nlkr2EERSrhWeO/bo0kNE9c+/Q8JWmyhSYMwAaglnACudCqNCW2g7lFMUn8p18TrEZsS/wegNXf7MMRmFV5AT8zMR2v2ZGRjJRXFY6hP0Eq4G3TnkQGc7SPp/ayv0qqBQZ3UbHBB74+T9ADUCNvfafbrKsXMKAstXf+AZyuMbc= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aantron I'd feel more comfortable if the $GITHUB_TOKEN
was set up in the repo settings, but we can get this running with this token (it currently only has public_repo
access) and change it if we like the way the docs are published.
I usually publish docs manually, because we want to leave the version for the last release up until the next release. If/when odoc supports version switching, we can start publishing the dev docs automatically (and document that, so other projects can do it :) ). |
Good insight. Published docs from master may not reflect the latest release 👍 — we don't want that, so I'll drop those commits and rebase on master after people have had some time to review their previous comments. |
144471a
to
cda0e95
Compare
Alright, rewritten history without automatic publishing. @aantron can we split this PR so I focus on getting the rest of the TODO's in another one? |
Yes, of course. Let me know when this one is ready for review. |
e590734
to
a1856d2
Compare
The last one point I'll make is about publishing the docs with Github Pages. I'd prefer if we used the simpler mechanism they offer, where the docs site is hosted within the
Alternatively we could publish to If we opt for the latter, then we should have a straightforward way of doing so (a-la, |
68eddf2
to
93ae8e0
Compare
@Ostera Given we are going with republishing the docs only at release time (and for any serious errata), I think we want to avoid 1 and 2. We don't want PRs to I think we just need instructions for how the generated dosc (in a I suggest to leave the generated docs out of |
Makes sense. There’s a |
This removes the old manual_usage and refurbishes the main manual of `odoc` to point to several smaller, more focused ones. It scaffolds manuals for: + System Integrations: where we can explain how it works with `dune`, `bsb`, `esy`, etc. + Internals: where we can dig digger into why are the internal representations the way they are and how they fit together at great length. + Using Odoc: where we can explain in tutorials how to make the best use of the features available for documenting interfaces, writing custom pages, and showcasing what we believe are good docs to get inspired by. + A high-level tutorial of how the generation works. --- It also includes a handy make target that will run in CI.
a1856d2
to
7e83426
Compare
@aantron should be good now 👍 |
I see a |
No idea how this came to be. It's a vim swap file for no file.
No idea how that file came to be. It's a swap file from vim, but I can't tie it back to any edited fail. I'll make sure it's ignored globally. Another small change I couldn't get through (since I already had the folder in place) is that |
Makefile
Outdated
@@ -17,6 +17,7 @@ npm-test : | |||
|
|||
.PHONY : docs | |||
docs : | |||
mkdir docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC this will fail if docs/
already exists, you need mkdir -p docs
to avoid that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to stop working late at night. Thanks for catching this 🙌
Thanks! |
Opening this to gather early feedback and comments 🗣
I feel it's mandatory for
odoc
, since it's goal is to generate documentation, to bootstrap it's own. Soodoc
is documented usingodoc
.Hence I'm opening this PR. I started writing a new index manual, but i'd like a few more things to get done before we merge it.
For the time being I'm hosting it here: https://ostera.github.io/odoc/
TO DO
odoc
odoc
odoc
Automatically publish docs to Github Pagesmake docs
Follow-up Work