Skip to content
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

Exceptions problem + general structure of definitions + link structure #23

Closed
dbuenzli opened this issue Sep 20, 2016 · 4 comments
Closed
Labels

Comments

@dbuenzli
Copy link
Contributor

Exceptions are not well marked up. See for example http://docs.mirage.io/odoc/alcotest/Alcotest/index.html

  1. They are not in a <div class="region"> block but in a <div class="exn">.
  2. They use invalid ocaml syntax to render, the keyword for exceptions is exception not exn.
  3. They lack an anchor for referencing.

Related to the general structure #18 and #19 I would prefer if we drop the region class. I think each definition should be marked up as follows:

<div class = "spec $(KIND)">
  <a href="#$(KIND)-$(ID)" class="anchor"></a>
  <div class="def $(KIND)"><code>...</code></div>
  <div class="doc">...</div>
</div>

Where $(KIND) is the kind of construct. spec comes from the vocabulary of the module system.

Regarding anchor fragments I find #/$(ID).$(kind) to be noisy in practice. In the above proposal I dropped the / and also reversed the $(KIND) and $(ID) as it then matches the order we write them in OCaml. Replaced the . by - to avoid confusion with OCaml paths.

@dbuenzli
Copy link
Contributor Author

(Also I think it would be easier to hack urls if type was not abbreviated to typ)

@lpw25 lpw25 added the output label Sep 25, 2016
@trefis
Copy link
Contributor

trefis commented Oct 20, 2016

The exception was indeed completely wrong and has been fixed.
I also updated the layout following your remarks and removed the use of the region class everywhere.

@dbuenzli
Copy link
Contributor Author

This looks ok except I suggest suggest that for $(KIND) we actually use the OCaml keywords (module-type not modt, type not typ, etc.), replacing spaces by dashes if needed and that we replace id.$(KIND) by $(KIND)-id which makes it more the way you would write this in OCaml.

@dbuenzli dbuenzli changed the title Exceptions problem + general structure of definitions Exceptions problem + general structure of definitions + link structure Dec 1, 2016
@dbuenzli
Copy link
Contributor Author

dbuenzli commented Dec 1, 2016

I also notice that the strings typ val modt etc. are scattered as string literals in the code base. This should be defined at a single point.

jonludlam pushed a commit to jonludlam/odoc-parser-cleaned that referenced this issue Jul 1, 2021
There are still a few ugly points in the code, but the produced html should now
be correct.
So I think we can say this commit
- fixes ocaml/odoc#23
- fixes ocaml/odoc#25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants