Git Product home page Git Product logo

odoc's Introduction

odoc   OCaml-CI Build Status Coverage Status

odoc is a documentation generator for OCaml. It reads doc comments , delimited with (** ... *), and outputs HTML. See example output.

Text inside doc comments is marked up in ocamldoc syntax:

val compare : string -> string -> int
(** [compare s1 s2] compares [s1] and [s2] in {e lexicographic} order. The
    result is negative if [s1] precedes [s2], positive if [s1] follows [s2],
    and zero if [s1] and [s2] are equal. *)

The syntax reference is here. There is also an explanation of how to attach comments to specific types, values, and other elements in your program.


odoc's main advantage over ocamldoc is an accurate cross-referencer, which handles the complexity of the OCaml module system. odoc also offers a good opportunity to improve HTML output compared to ocamldoc, but this is very much a work in progress :)


Using odoc with OCaml

To install odoc with opam:

opam install odoc

If you want to use odoc on the packages you have installed in your opam switch type:

opam install ocaml-manual odig
odig doc

When you are developing the easiest way to use odoc right now is by having Dune drive it. This command should work in most Dune projects out of the box:

dune build @doc

The generated docs can then be found locally at ./_build/default/_doc/_html/index.html.


Using odoc with BuckleScript/Reason

You can use the bsdoc npm package to use odoc in your BuckleScript projects.


Contact

odoc is most discussed on discuss.ocaml.org's Ecosystem category with the odoc tag. Please also don't hesitate to open an issue.


Contributing

Any question asked, issue opened, feedback offered, is a contribution to odoc, and the project and all its users are thankful :) If you'd like to contribute code specifically, you may find the guide in CONTRIBUTING.md helpful. Also see the roadmap there. If anything is missing from it, please don't hesitate to reach out.

odoc's People

Contributors

aantron avatar jonludlam avatar julow avatar trefis avatar lpw25 avatar dbuenzli avatar drup avatar rizo avatar leostera avatar lubegasimon avatar octachron avatar dsheets avatar bobbypriam avatar bluddy avatar craigfe avatar daimrod avatar ryyppy avatar avsm avatar dra27 avatar greedy avatar ulrikstrid avatar misterda avatar jfeser avatar kit-ty-kate avatar kevinji avatar czystyl avatar sharno avatar nikgraf avatar rickyvetter avatar rgrinberg avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.