Giter Site home page Giter Site logo

jaredly / redoc Goto Github PK

View Code? Open in Web Editor NEW
116.0 6.0 11.0 22.6 MB

A clean & easy documentation generator for reason/bucklescript/ocaml

Home Page: https://jaredforsyth.com/redoc/index.html

Shell 0.01% OCaml 19.10% C++ 0.51% Standard ML 0.45% JavaScript 79.38% CSS 0.48% HTML 0.07%

redoc's Introduction

Redoc

A clean & easy documentation generator for reason/bucklescript/ocaml.

Check out the generated docs at https://jaredforsyth.com/redoc.

How to use:

get the binary (either by downloading it, or building it yourself).

To build:

npm install
npm start

The binary is then in ./lib/bs/native/main.native. You can run ./redoc.sh, which delegates to that.

Common options

  --root (default: current directory)
      expected to contain bsconfig.json, and bs-platform in the node_modules
  --target (default: {root}/docs)
      where we should write out the docs
  --name (default: the name of the directory, capitalized)
      what this project is called
  --ignore-code-errors
      don't print warnings about parse & type errors in code blocks
  --ml
      assume code snippets are in ocaml syntax, not reason
  -h, --help
      print this help

Less used options

  --project-file (can be used multiple times)
      specified as /abs/path/to/.cmt:rel/path/from/repo/root
  --project-directory (can be used multiple times)
      path/to/cmt/directory:rel/path/from/root
  --dependency-directory (can be used multiple times)
      a directory containing ".cmj" files that should be '-I'd when compiling snippets
  --bs-root (default: root/node_modules/bs-platform)
  --skip-stdlib-completions
      don't include completions for the stdlib in the playground
  --no-bundle
      don't bundle the code examples. This disables editor support
  --just-input
      just parse the options & show the debug output of parsing cli args
  --debug
      output debugging information

Related work

http://davidchristiansen.dk/drafts/final-pretty-printer-draft.pdf

ooh check this out https://github.com/martinklepsch/cljdoc

redoc's People

Contributors

jaredly avatar chenglou avatar

Stargazers

Toan Tran avatar Hyeseong Kim avatar Martin Kinoo avatar Jaap Frolich avatar Ciro Nunes avatar Aitor Oses avatar Nick Seagull avatar Robin Weser avatar RiN avatar Alec avatar Alexis H. Munsayac avatar kiran ps avatar Jordan Mackie avatar schinns avatar Josiah Savary avatar Adam Recvlohe avatar Max Thirouin avatar  avatar Matt D avatar  avatar Andreas Eldh avatar Jindřich K. Smitka avatar Cameron Yick avatar Alan Soares avatar M∎∎r avatar  avatar Sean Powell avatar Andrejs Agejevs avatar Chris Pearce avatar 文蔺 avatar Stephen Ely avatar Joe Graham avatar Steven Scaffidi avatar 0xNil avatar Layla  avatar Alexander Schwabauer avatar Léo LE BRAS avatar Glenn Reyes avatar Taras Vozniuk avatar Lan Qingyong avatar Khoa Nguyen avatar George Lima avatar B. Cedric Cogell avatar cz avatar Michael Martin avatar Harsh Vardhan avatar LY Cheng avatar Blaine Bublitz avatar James Kraus avatar  avatar Yoshiya Hinosawa avatar Cláudio Caseiro avatar Dave avatar Thomas Deconinck avatar Leandro Ostera avatar HISAME SHIZUMARU avatar 王下邀月熊 avatar Alexey Golev avatar nhducit avatar Jasim A Basheer avatar Yamada Yuki avatar Bram Hoendervangers avatar James Lal avatar Medson Oliveira avatar Alain Armand avatar David Udelson avatar Iddan Aaronsohn avatar Tomasz Cichocinski avatar Meillet Robin avatar Gabriel avatar Alexander Ryzhikov avatar Lila avatar  avatar Jihchi Lee avatar John Haley avatar Dafne Kiyui avatar Alessandro Strada avatar Rauan Mayemir avatar Natalie Cuthbert avatar Wojtek Czekalski avatar  avatar Seb Mondet avatar Thomas Gazagnaire avatar Metin Akat avatar Guilherme Decampo avatar David Kopal avatar Brandon Orther avatar Kamil Chmielewski avatar Akin avatar Soichiro Isobe avatar Victor Nakoryakov avatar Joel Marcey avatar Andrea Cognolato avatar Vincent Taing avatar Ethan Zhang avatar Sibelius Seraphini avatar Bruno Sato avatar Gage Peterson avatar Daniel Ramirez avatar Bastian avatar

Watchers

James Lal avatar James Cloos avatar Cem Turan avatar Rafa Yepes avatar Soichiro Isobe avatar  avatar

redoc's Issues

Js.t objects generate invalid signatures

For example, the following code:

type point = {
  .
  "x": float,
  "y": float,
};

Generates this line of documentation:

type point = Js.t(< x : float; y : float >)

This is invalid Reason and looks to be a combination of Reason and OCaml syntax. As far as I have seen this happens for every Js.t type.

Relationship to Odoc and Ocamldoc?

Hi! What's the relationship of this project to Odoc and Ocamldoc? Perhaps it could be explained somewhere to answer the question "why does this project exist separately"?

add a "watch mode"

So when you're editing documentation, you can see the results quickly

maybe list all non-referenced items at the bottom of the page?

Currently if you have a module-level comment, and you don't @doc mention something, then it doesn't get rendered at all. This breaks assumptions about links...
I think maybe I should just render everything you haven't mentioned in a list at the end.

The binary distribution has hardcoded paths

The binary distribution has hardcoded paths at some point (I didn't investigate). It results in errors like:

Fatal error: exception Failure("Unable to copy ./../../../static/block-script.js to /Users/wczekalski/Documents/Work/Projects/bs-react-native/docs/block-script.js")
Raised at file "pervasives.ml", line 30, characters 22-33
Called from file "/Users/jared/clone/tools/docre/src/ModelToOutput.re", line 242, characters 4-92
Called from file "/Users/jared/clone/tools/docre/src/utils/Infix.re", line 10, characters 68-73
Called from file "/Users/jared/clone/tools/docre/src/ModelToOutput.re", line 241, characters 40-670
Called from file "/Users/jared/clone/tools/docre/src/Main.re", line 112, characters 9-15

Generating MD files for Docusaurus

This is definitely more of a question than a bug report (or even feature request)...

I'm hoping to end up with Docusaurus docs for a library I'm working on. I'd like these docs to be a mix of hand-written "guide" pages and API docs generated from docblock comments in my code.

redoc's ability to make sense of both docblock comments and rei/mli interface files seems incredibly promising, but it generates a full HTML site, while Docusaurus expects to find Markdown pages. How suitable is redoc for this task, and where would you recommend I start digging in if I want to modify it for this use case?

Thanks for building this sweet tool!

$$$

😍😍😍😍
💸💸💸💸
🤑🤑🤑🤑

docre.sh no longer works after recompile

david@linux:~/reasondocs/using_belt_set> ~/docre/docre.sh
Fatal error: exception Failure("lib/js not found")
Raised at file "pervasives.ml", line 30, characters 22-33
Called from file "/home/david/docre/src/utils/Infix.re", line 2, characters 42-53
Called from file "/home/david/docre/src/CliToInput.re", line 350, characters 71-102
Called from file "/home/david/docre/src/utils/Infix.re", line 10, characters 68-73
Called from file "/home/david/docre/src/utils/Infix.re", line 9, characters 62-67
Called from file "/home/david/docre/src/CliToInput.re", line 374, characters 18-45
Called from file "/home/david/docre/src/Main.re", line 102, characters 14-40
Called from file "/home/david/docre/src/Main.re", line 112, characters 9-15

Environment:

david@linux:~/reasondocs/using_belt_set> ls -l node_modules/bs-platform
lrwxrwxrwx 1 david users 67 May 18 11:21 node_modules/bs-platform -> /home/david/.nvm/versions/node/v10.1.0/lib/node_modules/bs-platform

After further research: it appears that if I create an empty js folder in the project’s lib directory, I no longer get the error, but don’t get docs/index.html either.

After more research: the error happens sometime between these two commits:

 3d453080442edf261d76a9649228cde2abc2dc0a # works (Apr 21) 
 64331abea4594193cd9f088b575f65c722b79a30 # doesn't work (Apr 21) 

Could this line in src/Main.re be part of the problem:

let stdlib = bucklescript.bsRoot /+ "lib/js";

search suffixes

I noticed that searching for ocamldoc in the official redoc demo doesn't find the module MarkdownToOCamldoc. I thought I would report it in case this is not expected.

How to use?

I see docs for the executable, but where does it source written documentation? I'm guessing I need to write comments in my code somewhere, are there any instructions on where and formatting?

Somehow getting duplicate output

Hi there,

I am getting duplicate output, any idea what could be causing this?

screen shot 2018-08-22 at 15 48 32

here with another project:

screen shot 2018-08-22 at 15 46 26

Here is a screenshot of the terminal output to create a basic demonstration of this issue:

screen shot 2018-08-22 at 15 48 09

I've stored a minimal example with output in a repo here: https://github.com/wires/redoc-issue

Maybe it is because certain directories are listed twice (see redoc_debug_output.txt:

  compiledDependencyDirectories:
    /private/tmp/test/lib/bs : /private/tmp/test/lib/js/
    /private/tmp/test/lib/bs : /private/tmp/test/lib/js/
    /private/tmp/test/lib/bs/src : /private/tmp/test/lib/js/src

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.