forked from CenterForDigitalHumanities/rerum-playground
-
Notifications
You must be signed in to change notification settings - Fork 7
Added the Documentation for all HTML, js files and README #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Devayani1612
wants to merge
16
commits into
main
Choose a base branch
from
dev_devayani
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+28,881
−11
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
6df3c68
Merge pull request #70 from oss-slu/dev_devayani
LuisPalmejar21 e667f69
Documented all .html files located in the /web/ folder to explain the…
LuisPalmejar21 9fcf656
Added docs
joeljoby02 016aafe
Update about.md
Devayani1612 74fb6c7
Update about.md
Devayani1612 508a35c
Merge pull request #71 from oss-slu/dev_luis
Devayani1612 0ce97a8
Docusaurus integration
joeljoby02 23ad4b4
Added node version
joeljoby02 74f5916
Updated my repository content based on Devayani's feedback for Sprint 3.
LuisPalmejar21 557dc78
Merge branch 'dev_luis' of https://github.com/oss-slu/rerum-playgroun…
LuisPalmejar21 a06fbd1
Merge pull request #73 from oss-slu/dev_luis
Devayani1612 4017a6c
Added docs for json-utils.js and json-utils.test.js
joeljoby02 9934ede
Merge pull request #72 from oss-slu/dev_joel
Devayani1612 86e4794
Updated readme.md
joeljoby02 a64df0e
Merge pull request #77 from oss-slu/dev_joel
Devayani1612 cbab18f
Copied sandbox-html.md and tools-html.md from dev_luis branch
Devayani1612 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # about.html Documentation | ||
| ## About the "about.html" File | ||
| This html file presents the about page in the RERUM Playground website explaining what RERUM is about and details of RERUM playground's elements. | ||
|
|
||
|
|
||
| ## Structure Overview | ||
|
|
||
| **head Container** | ||
|
|
||
| - Consists of links to specific JavaScript files for functionality | ||
| and css files for the page aesthetics. | ||
|
|
||
| **body Container** | ||
|
|
||
| - Consists of elements being displayed on the website. | ||
|
|
||
| ### Classes | ||
|
|
||
| **div class = "header"** | ||
| - Represents the top portion of the RERUM about page shown below. | ||
|  | ||
|
|
||
| **div class = "content"** | ||
| - Represents the middle portion of the RERUM about page showing what | ||
| RERUM Playground is and some of their elements in detail shown below. | ||
|
|
||
|  | ||
|
|
||
| **div class = "json"** | ||
| - Represents an example | ||
| a description of an object in JSON looks like shown below. | ||
|
|
||
|  | ||
|
|
||
| **div class = "spacer"** | ||
| - A dedicated empty div element intended to provide necessary vertical spacing at the bottom of the page, ensuring content does not overlap the fixed-position page footer. | ||
|
|
||
| ### IDs | ||
|
|
||
| **div id = "menu-placeholder"** | ||
| - Container where only the | ||
| menu elements would go. | ||
|
|
||
| **div id = "footer-placeholder"** | ||
| - Container where only the | ||
| footer elements would go. | ||
|
|
||
| ### Linked Files | ||
|
|
||
| **JavaScript** | ||
| - playground.js | ||
| - about.js (Not in Repository) | ||
|
|
||
| **CSS** | ||
| - playground.css | ||
| - about.css | ||
|
|
||
| ## Integration with JavaScript | ||
|
|
||
| **function openCloseMenu() function** | ||
| - Triggered when the user clicks | ||
| on the three horizontal lines symbol at the header, which opens or closes the menu. | ||
|
|
||
| **fetch('footer.html')** | ||
| - Fetches elements belonging to the footer-placeholder ID. | ||
|
|
||
| **fetch('menu.html')** | ||
| - Fetches elements belonging to the menu-placeholder ID. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
|
|
||
| # Configuration Reference: config.js | ||
|
|
||
| This document describes the configuration options available in `config.js` for the RERUM Playground web application. | ||
|
|
||
| ## Overview and Purpose | ||
| `config.js` exports a global configuration object for the app, centralizing URLs, event names, logging levels, version info, and catalogs for tools, interfaces, and technologies. This module enables consistent configuration and integration across the playground. | ||
|
|
||
| --- | ||
|
|
||
| ## Property Descriptions | ||
|
|
||
| ### URLS | ||
| - **Type:** `object` | ||
| - **Purpose:** Endpoints for interacting with RERUM services. | ||
| - **Properties:** | ||
| - `CREATE`, `UPDATE`, `PATCH`, `OVERWRITE`, `QUERY`, `SINCE`, `HISTORY` (all `string` URLs) | ||
|
|
||
| ### EVENTS | ||
| - **Type:** `object` | ||
| - **Purpose:** Event names used throughout the app for broadcasting and handling UI/application state changes. | ||
| - **Properties:** | ||
| - `CREATED`, `UPDATED`, `LOADED`, `NEW_VIEW`, `VIEW_RENDERED`, `CLICKED` (all `string` event names) | ||
|
|
||
| ### APPAGENT | ||
| - **Type:** `string` | ||
| - **Purpose:** Identifier for the registered app agent. Should be set after registering a new app with RERUM. | ||
|
|
||
| ### LOGLEVEL | ||
| - **Type:** `number` | ||
| - **Purpose:** Controls the verbosity of logging throughout the app. | ||
| - **Values:** | ||
| - `0`: OFF | ||
| - `6`: TRACE | ||
| - `5`: DEBUG | ||
| - `4`: INFO | ||
| - `3`: WARNING (default) | ||
| - `2`: ERROR | ||
| - `1`: FATAL | ||
|
|
||
| ### VERSION | ||
| - **Type:** `string` | ||
| - **Purpose:** Current version of the playground app. | ||
|
|
||
| ### TOOLS | ||
| - **Type:** `object` | ||
| - **Purpose:** Catalog of available tools for the playground. | ||
| - **Properties:** | ||
| - `id` (`string`): DOM id for the tool set container. | ||
| - `catalog` (`array`): Imported from `toolsCatalog.js`. | ||
|
|
||
| ### INTERFACES | ||
| - **Type:** `object` | ||
| - **Purpose:** Catalog of available interfaces (currently empty). | ||
| - **Properties:** | ||
| - `id` (`string`): DOM id for the interface set container. | ||
| - `catalog` (`array`): Intended for interface definitions. | ||
|
|
||
| ### TECHNOLOGIES | ||
| - **Type:** `object` | ||
| - **Purpose:** Catalog of available technologies (currently empty). | ||
| - **Properties:** | ||
| - `id` (`string`): DOM id for the technology set container. | ||
| - `catalog` (`array`): Intended for technology definitions. | ||
|
|
||
| --- | ||
|
|
||
| ## Example Usage/Workflow Snippet | ||
|
|
||
| ```javascript | ||
| import config from './config.js'; | ||
|
|
||
| // Access the CREATE endpoint | ||
| fetch(config.URLS.CREATE, { method: 'POST', body: JSON.stringify({}) }); | ||
|
|
||
| // Use an event name | ||
| document.dispatchEvent(new CustomEvent(config.EVENTS.CREATED)); | ||
|
|
||
| // List all tool labels | ||
| config.TOOLS.catalog.forEach(tool => console.log(tool.label)); | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Dependencies/Relationships | ||
| - Imports `ToolsCatalog` from `toolsCatalog.js` for the tools catalog. | ||
| - Used by most modules for configuration, event names, and endpoint URLs. | ||
| - Can be extended to import interface/technology catalogs from other repositories. | ||
|
|
||
| --- | ||
|
|
||
| For further details, see the source file: `web/js/config.js`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # footer.html Documentation | ||
| ## About the "footer.html" File | ||
| The footer.html file represents the bottom of the page with various links to specific pages. | ||
|
|
||
|
|
||
| ## Structure Overview | ||
|
|
||
| **footer Container** | ||
| - Consists of elements being displayed on the website shown below. | ||
|
|
||
|  | ||
|
|
||
| ### Classes | ||
|
|
||
| **div class = "footerButtons"** | ||
| - Represents all buttons within the footer container. | ||
|
|
||
|
|
||
| **div class = "button"** | ||
| - Represents a clickable button to a specified link. | ||
|
|
||
| **i class = "fa fa-symbolname"** | ||
| - Represents a symbols on the footer to represent | ||
| specific site locations. | ||
|
|
||
| ### Linked Files | ||
|
|
||
| **CSS** | ||
| - font-awesome.min.css (external link) | ||
| - footer.css |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # index.html Documentation | ||
| ## About the "index.html" File | ||
| This html file is presented as the welcome page of RERUM Playground. | ||
| This displays the welcome messages. | ||
|
|
||
| ## Structure Overview | ||
|
|
||
| **head Container** | ||
|
|
||
| - Consists of links to specific JavaScript files for functionality | ||
| and css files for the page aesthetics. | ||
|
|
||
| **body Container** | ||
|
|
||
| - Consists of elements being displayed on the website. | ||
|
|
||
| ### Classes | ||
|
|
||
| **div class = "header"** | ||
| - Represents the top portion of the RERUM about page shown below. | ||
|  | ||
|
|
||
| **div class = "container"** | ||
| - Represents the page space between the header and the footer. | ||
|
|
||
| **div class = "placeholder"** | ||
| - Represents the spacing between the footer and the welcome | ||
| message content. | ||
|
|
||
| **div class = "content"** | ||
| - Represents the middle portion of the RERUM about page showing a welcome message shown below. | ||
|  | ||
|
|
||
| ### IDs | ||
|
|
||
| **div id = "menu-placeholder"** | ||
| - container where only the | ||
| menu elements would go. | ||
|
|
||
| **div id = "footer-placeholder"** | ||
| - container where only the | ||
| footer elements would go. | ||
|
|
||
| ### Linked Files | ||
|
|
||
| **JavaScript** | ||
| - playground.js | ||
| - about.js (Not in Repository) | ||
|
|
||
| **CSS** | ||
| - playground.css | ||
| - about.css | ||
|
|
||
| ## Integration with JavaScript | ||
|
|
||
| **function openCloseMenu() function** | ||
| - Triggered when the user clicks | ||
| on the three horizontal lines symbol at the header, which opens or closes the menu. | ||
|
|
||
| **fetch('footer.html')** | ||
| - Fetches elements belonging to the footer-placeholder ID. | ||
|
|
||
| **fetch('menu.html')** | ||
| - Fetches elements belonging to the menu-placeholder ID. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| # JSON Utilities Reference: json-utils.js | ||
|
|
||
| This document describes the small JSON helper utilities provided by `json-utils.js` for the RERUM Playground project. | ||
|
|
||
| ## Overview and Purpose | ||
| `json-utils.js` provides two focused helpers for working with JSON strings and objects: | ||
| - `prettifyJSON` — formats JSON with indentation for human-readable display, and returns a helpful error message when input is not valid JSON. | ||
| - `validateJSON` — returns a boolean indicating whether a string is valid JSON. | ||
|
|
||
| These helpers are useful when accepting JSON input from users, preparing JSON for display, or performing quick client-side validation before sending data to APIs. | ||
|
|
||
| --- | ||
|
|
||
| ## Function Descriptions | ||
|
|
||
| ### prettifyJSON(input) | ||
| - **Parameters:** | ||
| - `input` (`string | object`) — A JSON string or a plain JavaScript object. | ||
| - **Returns:** `string` | ||
| - **Behavior:** | ||
| - If `input` is a string, attempts to `JSON.parse` it to an object. If parsing succeeds, returns `JSON.stringify(obj, null, 2)` (pretty-printed JSON with 2-space indentation). | ||
| - If `input` is already an object, returns its pretty-printed JSON representation. | ||
| - If parsing fails, returns a short error string that begins with `Invalid JSON:` and includes the parser's error message. | ||
|
|
||
| ### validateJSON(input) | ||
| - **Parameters:** | ||
| - `input` (`string`) — A string that should contain JSON. | ||
| - **Returns:** `boolean` | ||
| - **Behavior:** | ||
| - Attempts to `JSON.parse(input)` and returns `true` when parsing succeeds, otherwise returns `false` when parsing throws an error. | ||
|
|
||
| --- | ||
|
|
||
| ## Example Usage / Workflow Snippet | ||
|
|
||
| ```javascript | ||
| // CommonJS usage (as in this project) | ||
| const { prettifyJSON, validateJSON } = require('../web/js/json-utils.js'); | ||
|
|
||
| const raw = '{"name":"Alice","age":30}'; | ||
| if (validateJSON(raw)) { | ||
| const pretty = prettifyJSON(raw); | ||
| console.log(pretty); | ||
| } else { | ||
| console.warn('Provided input is not valid JSON'); | ||
| } | ||
|
|
||
| // Passing an object directly | ||
| const obj = { a: 1, b: [2,3] }; | ||
| console.log(prettifyJSON(obj)); | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Dependencies / Relationships | ||
| - No external dependencies — uses the built-in `JSON` global. | ||
| - The test file `web/js/json-utils.test.js` exercises these functions (see `json-utils.test.md`). | ||
| - Use these helpers in UI code that reads user-supplied JSON or displays API responses. | ||
|
|
||
| --- | ||
|
|
||
| For further details, see the source file: `web/js/json-utils.js`. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LTS is node 24 now!