diff --git a/docs/docs/99-api/index.md b/docs/docs/99-api/index.md deleted file mode 100644 index 731d9285..00000000 --- a/docs/docs/99-api/index.md +++ /dev/null @@ -1,82 +0,0 @@ ---- -id: "index" -title: "memory-viz" -sidebar_label: "Readme" -sidebar_position: 0 -custom_edit_url: null ---- - -# MemoryViz: Creating memory model diagrams - -This package generates memory model diagrams for Python code in the style of CSC110/111/148 at the University of Toronto. -This uses the [Rough.js](https://roughjs.com/) Javascript library to emulate the look of hand-drawn diagrams. - -**Note**: this project is currently experimental, and may undergo significant changes before stabilizing. - -## Installation (users) - -1. Install [Node.js](https://nodejs.org/en/). -2. Install the `memory-viz` package from GitHub (it is currently not on npm): - - ```console - $ npm install git+https://github.com/david-yz-liu/memory-viz.git -g - ``` - - _Note_: omit the `-g` flag if you want to install the package into just the current working directory. - -## Installation (developers) - -1. First, clone this repository. -2. Install [Node.js](https://nodejs.org/en/). -3. Open a terminal in your local code of the repository, and then run: - - ```console - $ npm install - ``` - -4. Compile the Javascript assets using [webpack](https://webpack.js.org/guides/getting-started/): - - ```console - $ npm run build-dev --workspace=memory-viz - ``` - -5. Install the pre-commit hooks to automatically format your code when you make commits: - - ```console - $ npx husky install - $ npm pkg set scripts.prepare="husky install" - $ npx husky add .husky/pre-commit "npx lint-staged" - ``` - -That's it! -You should then be able to try out the demo in the [Example usage](#example-usage) section below. - -### Automatic Javascript compilation - -Rather than running `npm run build-dev` to recompile your Javascript bundle every time you make a change, you can instead run the following command: - -```console -$ npm run watch --workspace=memory-viz -``` - -This will use `webpack` to watch for changes to the Javascript source files and recompile them automatically. - -_Note_: this command will keep running until you manually terminate it (Ctrl + C), and so you'll need to open a new terminal window to enter new terminal commands like running the demo below. - -## Usage - -The only function that a user will ever have to call is `user_functions.draw`. - -This function has three parameters: - -1. `objs`: The array of objects (including stack-frames) to be drawn. Each object must follow - a strict structure which is thoroughly outlined in the `object_structure.md` file. -2. `automation`: A boolean, indicating whether the location of the memory-model boxes should - be automatically generated. If this is false, the user must x and y attributes for each object - (representing the object's coordinates). -3. `configuration`: A JS object representing configuration such as the user-specified width. - Defining a `width` property is mandatory if `automation` is `true`. - -(**Note**: If the array of objects to be drawn is stored in a JSON file, the user can simply choose to pass the path to -that JSON as the first parameter to `draw`. The implementation automatically handles the case that `typeof objs === "string"`. -) diff --git a/docs/docs/99-api/modules.md b/docs/docs/99-api/modules.md index 2a26432e..63094e23 100644 --- a/docs/docs/99-api/modules.md +++ b/docs/docs/99-api/modules.md @@ -32,4 +32,4 @@ the produced canvas #### Defined in -[user_functions.ts:29](https://github.com/david-yz-liu/memory-viz/blob/4d72b15/memory-viz/src/user_functions.ts#L29) +[user_functions.ts:29](https://github.com/david-yz-liu/memory-viz/blob/442d14c/memory-viz/src/user_functions.ts#L29) diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 9cd92905..e40bd058 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -143,6 +143,7 @@ const config = { // Plugin / TypeDoc options { entryPoints: ["../memory-viz/src/user_functions.ts"], + readme: "none", tsconfig: "../tsconfig.json", out: "99-api", },