{"id":16717970,"url":"https://github.com/dsheets/codoc","last_synced_at":"2025-09-22T07:31:26.424Z","repository":{"id":20162004,"uuid":"23432638","full_name":"dsheets/codoc","owner":"dsheets","description":"OCaml documentation generator","archived":false,"fork":false,"pushed_at":"2017-10-02T10:10:58.000Z","size":6422,"stargazers_count":34,"open_issues_count":40,"forks_count":5,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-04T00:41:23.687Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dsheets.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-28T15:16:13.000Z","updated_at":"2022-09-07T16:24:45.000Z","dependencies_parsed_at":"2022-09-02T20:00:38.525Z","dependency_job_id":null,"html_url":"https://github.com/dsheets/codoc","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/dsheets/codoc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsheets%2Fcodoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsheets%2Fcodoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsheets%2Fcodoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsheets%2Fcodoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsheets","download_url":"https://codeload.github.com/dsheets/codoc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsheets%2Fcodoc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276367031,"owners_count":25629964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-22T02:00:08.972Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T21:34:30.795Z","updated_at":"2025-09-22T07:31:26.195Z","avatar_url":"https://github.com/dsheets.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# codoc [DEPRECATED]\n\nNOTE: codoc is now deprecated in favour of\nhttps://github.com/ocaml-doc/odoc\n\n**codoc** is a new OCaml documentation tool. It does not impose any\n  specific package manager on you or assume a specific\n  workflow. **codoc** requires at least **OCaml** `4.02.2`.\n\n## Quick Start\n\nYou first need to set-up an opam switch with the right environment. We\nare working on making our tools and patches properly integrated\nupstream, so in the future these steps won't be necessary.\n\n```sh\nexport OPAMKEEPBUILDDIR=1\nunset OCAMLPARAM\nopam switch doc -A 4.02.2 # Switch into an empty `4.02.2` switch\nexport OCAMLPARAM=_,bin-annot=1\neval `opam config env`\n```\n\nOnce this is done, you can install your opam packages as usual.\n\n```sh\nopam install ... # Install your package set.\n```\n\nFinally, installing **codoc** itself will be useful.\n\n```sh\nopam install codoc\n```\n\n**codoc** supplies an **opam doc** command to generate cross-referenced\n  documentation for all packages on an opam switch.  This program uses\n  **codoc**'s scriptable CLI and and also offers an easy-to-use\n  `--serve` option for immediately starting a web server for your opam\n  installation's documentation. Using **opam doc** is as easy as:\n\n```sh\nopam doc my-opam-doc/\n```\n\nThe HTML documentation for all packages on the current switch will be\ncreated in `my-opam-doc/` by **opam doc**. When using `--serve`, the\ndocumentation will be generated for the HTTP scheme (omitting\n`index.html`) and `cohttp-server-lwt` will be started in the output\ndirectory.\n\n## The `codoc` Tool\n\nTo generate HTML documentation from a build directory containing files\ncompiled with **OCaml** `4.02.2`, simply run:\n\n```sh\ncodoc doc [CMTI_DIR] -o [OUTPUT_DIR]\n```\n\n**codoc** will recursively search for `.cmti` files in *CMTI_DIR* and\n  use their relative paths to construct a parallel directory hierarchy\n  in *OUTPUT_DIR*. Of course, you can also run **codoc** on individual\n  files and *OUTPUT_DIR* (or *OUTPUT_FILE*) does not need to exist.\n\n**codoc** will refuse to overwrite already extracted or rendered\n  documentation unless the `-f` flag is provided.\n\n**codoc** understands package hierarchies. To output documentation for a\n  specific package, simply pass `--package` followed by a\n  `slash/separated/package/path`. The *OUTPUT_DIR* will be the base of\n  the hierarchy and the documentation inside will cross-reference.\n\n`codoc doc` has some other options that are described below in the\n  section about the `html` subcommand.\n\n## Scriptable Command Line\n\nThe `doc` subcommand of **codoc** is actually a composition of 3\ndifferent subcommands: `extract`, `link`, and `html`. Each of these\ncommands can take the `-f` and `--index` arguments. Documentation\nindexes can be generated by providing the `--index` flag.\n\nThe `html` subcommand takes extra options, `--css`, `--scheme`,\nand `--share`. It does not yet support `--package`, though, [support\nis planned](https://github.com/dsheets/codoc/issues/42). Of these,\n`--scheme file` is the most useful for browsing documentation in a web\nbrowser directly off of the disk.\n\n## Interfaces\n\nThe toolchain that **codoc** realizes was designed to have many\ninterfaces to subcomponents should you wish to customize your\ndocumentation generation more radically than the tool provides.\n\n[octavius](https://github.com/lpw25/octavius) parses documentation\ncomments written in `ocamldoc` format.\n\n[doc-ock](https://github.com/lpw25/doc-ock) parses OCaml interfaces,\nexposes types for signatures and identifiers, and defines resolution\nprocedures. **doc-ock** uses **octavius** for documentation comment\nparsing.\n\n[doc-ock-xml](https://github.com/lpw25/doc-ock-xml/) defines XML\nserialization and parsing for the types in **doc-ock**. This XML\nformat will eventually provide mechanism for extensible documentation\ncontent.\n\n**codoc** defines a documentation index XML format for tracking package\n  hierarchies, documentation issues, and hierarchically localized\n  configuration. **codoc** also defines a scriptable command-line\n  interface.\n\nMost of these interfaces are not stable. The basics of **codoc**'s CLI,\nthough, are likely to remain consistent.\n\n## Contributions\n\nContributions are very welcome! Please feel free to report issues,\nideas, comments, or concerns to the [codoc issue\ntracker](https://github.com/dsheets/codoc/issues).\n\n## Documentation Feature Tests\n\nSee\n[dsheets/ocamlary-test-library](https://github.com/dsheets/ocamlary-test-library)\nfor some documentation feature tests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsheets%2Fcodoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsheets%2Fcodoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsheets%2Fcodoc/lists"}