All Projects → aphelionz → hypatia

aphelionz / hypatia

Licence: MIT license
Convert JavaScript doctrings (in jsdoc AST format) to ijavascript Jupyter Notebooks

Programming Languages

ocaml
1615 projects

Projects that are alternatives of or similar to hypatia

Docdown
A simple JSDoc to Markdown generator.
Stars: ✭ 191 (+1491.67%)
Mutual labels:  jsdoc
granary
Tezos smart contract & dapp development toolkit
Stars: ✭ 67 (+458.33%)
Mutual labels:  reasonml
reason-epitath
CPS sugar usage for React Render Props composition in ReasonML
Stars: ✭ 16 (+33.33%)
Mutual labels:  reasonml
Openapi Comment Parser
⚓️ JSDoc Comments for the OpenAPI Specification
Stars: ✭ 221 (+1741.67%)
Mutual labels:  jsdoc
rk
The remote Jupyter kernel/kernels administration utility
Stars: ✭ 53 (+341.67%)
Mutual labels:  jupyter-notebooks
remotedata-re
Tools for fetching data from remote sources in Reason
Stars: ✭ 32 (+166.67%)
Mutual labels:  reasonml
Vscode Fundamentals
👨‍🏫 Mike's Visual Studio Code Course
Stars: ✭ 175 (+1358.33%)
Mutual labels:  jsdoc
TeachingDataScience
Course notes for Data Science related topics, prepared in LaTeX
Stars: ✭ 102 (+750%)
Mutual labels:  jupyter-notebooks
jupyter-extensions
Jupyter extensions for SWAN
Stars: ✭ 56 (+366.67%)
Mutual labels:  jupyter-notebooks
app-template-rescript-react
Adding ReScript with rescript-react on top of @snowpack/app-template-react
Stars: ✭ 44 (+266.67%)
Mutual labels:  reasonml
Esdoc
ESDoc - Good Documentation for JavaScript
Stars: ✭ 2,706 (+22450%)
Mutual labels:  jsdoc
dimensions-api-lab
Research data analytics tutorials using the Dimensions Analytics API
Stars: ✭ 68 (+466.67%)
Mutual labels:  jupyter-notebooks
zestdb
ZestDB
Stars: ✭ 18 (+50%)
Mutual labels:  reasonml
Type O Rama
👾 JS type systems interportability
Stars: ✭ 217 (+1708.33%)
Mutual labels:  jsdoc
bs-rsuite-ui-react
Reason bindings for React Suite UI library
Stars: ✭ 26 (+116.67%)
Mutual labels:  reasonml
Jsdoc Vuejs
📖 A JSDoc plugin for documenting .vue files.
Stars: ✭ 186 (+1450%)
Mutual labels:  jsdoc
bs-spectacle
No description or website provided.
Stars: ✭ 15 (+25%)
Mutual labels:  reasonml
NAGPythonExamples
Examples and demos showing how to call functions from the NAG Library for Python
Stars: ✭ 46 (+283.33%)
Mutual labels:  jupyter-notebooks
bs-declaredom
Strongly typed declarative markup for the DOM and CSS
Stars: ✭ 66 (+450%)
Mutual labels:  reasonml
rr-2048
2048 game in Reason React
Stars: ✭ 15 (+25%)
Mutual labels:  reasonml

hypatia

Converting JavaScript doctrings (in jsdoc AST format) to ijavascript Jupyter Notebooks

Background

Having interactive documentation in the form of Jupyter notebooks is awesome. So is having accurate and up to date code-level documentation in the form of comments. Wouldn't it be cool if you had a tool that transliterated the latter into the former, giving you fully interactive Jupyter notebook versions of your docstring comments?

In other words, Hypatia turns this:

/**
 * @description
 * Log implements a G-Set CRDT and adds ordering
 * Create a new Log instance
 *
 * From:
 * "A comprehensive study of Convergent and Commutative Replicated Data Types"
 * https://hal.inria.fr/inria-00555588
 *
 * @constructor
 *
 * @example
 * const IPFS = require("ipfs")
 * const Log = require("../src/log")
 * const { AccessController, IdentityProvider } = require("../src/log")
 * const Keystore = require('orbit-db-keystore')
 * const Entry = require("../src/entry")
 * const Clock = require('../src/lamport-clock')
 *
 * const accessController = new AccessController()
 * const ipfs = new IPFS();
 * const keystore = Keystore.create("../test/fixtures/keys")
 * const identitySignerFn = async (id, data) => {
 *   const key = await keystore.getKey(id)
 *   return keystore.sign(key, data)
 * }
 *
 * (async () => {
 *   var identity = await IdentityProvider.createIdentity(keystore, 'username', identitySignerFn)
 *   var log = new Log(ipfs, accessController, identity)
 *
 *   // console.log(Object.keys(log))
 * })()
 *
 *
 * @param  {IPFS}           [ipfs]          An IPFS instance
 * @param  {Object}         [access]        AccessController (./default-access-controller)
 * @param  {Object}         [identity]      Identity (https://github.com/orbitdb/orbit-db-identity-provider/blob/master/src/identity.js)
 * @param  {String}         [logId]         ID of the log
 * @param  {Array<Entry>}   [entries]       An Array of Entries from which to create the log
 * @param  {Array<Entry>}   [heads]         Set the heads of the log
 * @param  {Clock}          [clock]         Set the clock of the log
 * @return {Log}                            Log
 */

into this:

Jupyter Notebook version of the above code

Hypatia is built with native ReasonML and was created to manage the documentation in the orbitdb repositories.

Installation

Prerequisites: esy and pesy

Hypatia currently requires the esy and pesy tools to build and run.

npm install -g esy pesy

Installation Steps

npm install -g hypatia

Then, the binary will be available at hypatia.exe. Move it where you want!

Usage

First, create the jsdoc AST file.

jsdoc -X ./path/to/js/**/**.js > jsdoc-ast.json

Then, use hypatia.exe to generate the ipynb

$ hypatia.exe

Hypatia - jsdoc to ijavascript
Usage: hypatia.exe [input_file] [output_file]
 - input_file: jsondoc output .json file
 - output_file: jupyter notebook .ipynb file

$ hypatia.exe jsdoc-ast.json API.ipynb

Contributing

Feel free to ask questions via GitHub issues. PRs are welcome.

To build the executable locally, follow these steps:

git clone https://github.com/aphelionz/hypatia.git
esy install
esy pesy
esy build

You can then run the example via npm run example or the executable via esy x hypatia.exe.

Then, if you would like, use esy release to build the npm package.

License

MIT © 2018 Mark Henderson

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].