From e86646288edac5f038b57faafd72673ff58babc3 Mon Sep 17 00:00:00 2001 From: ArthurW Date: Sun, 23 Oct 2022 14:52:49 +0200 Subject: [PATCH] add readme --- LICENSE | 21 +++++++++++++++++++++ README.md | 19 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..674ecf63 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Arthur Wendling, Tarides + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 00000000..3597c795 --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +**Try it online at [doc.sherlocode.com](https://doc.sherlocode.com) !** + +A rough prototype of a Hoogle-like search engine for OCaml documentation. It's full of bugs and todos, but works well enough for my purpose: Perhaps it will be useful to you too. +- The fuzzy type search is supported by a polarity search. As an example, the type `string -> int -> char` gets simplified to `{ -string, -int, +char }` which means that it consumes a `string` and an `int` and produces a `char` (irrespective of the order of the arguments). This yields good search results, but the sorting could be improved. +- The real magic is all the package documentation generated for [`ocaml.org/packages`](https://ocaml.org/packages), which I got my hands on thanks to insider trading (but don't have the bandwidth to share back... sorry!) + +``` +$ opam install --deps-only ./sherlodoc.opam + # Note: your odoc version must match your odocl files + +# To index all the odocl files in `/path/to/doc`: +$ dune exec -- ./index/index.exe /path/to/doc /path/to/result.db + # `/path/to/doc` should contain a hierarchy of subfolders `libname/1.2.3/**/*.odocl` + # `result.db` will be created or replaced + +# To run the website: +$ dune exec -- ./www/www.exe /path/to/result.db +22.10.22 17:17:33.102 Running at http://localhost:1234 +```