diff --git a/contribute/VERSION b/contribute/VERSION index e5a4a5e..437d26b 100644 --- a/contribute/VERSION +++ b/contribute/VERSION @@ -1 +1 @@ -1.0.9 \ No newline at end of file +1.0.10 \ No newline at end of file diff --git a/contribute/toBrowser.js b/contribute/toBrowser.js index ac25172..c7915e0 100644 --- a/contribute/toBrowser.js +++ b/contribute/toBrowser.js @@ -1,3 +1,11 @@ +/** + * @author Martin Karkowski + * @email m.karkowski@zema.de + * @create date 2022-01-18 13:42:41 + * @modify date 2022-01-18 13:42:43 + * @desc [description] + */ + const { readFileSync, writeFileSync } = require("fs"); const version = readFileSync("./contribute/VERSION", { encoding: "utf-8" }); diff --git a/contribute/toNodejs.js b/contribute/toNodejs.js index b0d4440..c091d68 100644 --- a/contribute/toNodejs.js +++ b/contribute/toNodejs.js @@ -1,3 +1,11 @@ +/** + * @author Martin Karkowski + * @email m.karkowski@zema.de + * @create date 2022-01-18 13:42:45 + * @modify date 2022-01-18 13:42:48 + * @desc [description] + */ + const { readFileSync, writeFileSync } = require("fs"); const version = readFileSync("./contribute/VERSION", { encoding: "utf-8" }); diff --git a/lib/helpers/index.nodejs.ts b/lib/helpers/index.nodejs.ts index 04c6f31..fa75b54 100644 --- a/lib/helpers/index.nodejs.ts +++ b/lib/helpers/index.nodejs.ts @@ -10,4 +10,3 @@ export * from "./index.browser"; export { files }; import * as files from "./fileMethods"; - diff --git a/lib/helpers/singletonMethod.ts b/lib/helpers/singletonMethod.ts index dc89d94..19cdcd1 100644 --- a/lib/helpers/singletonMethod.ts +++ b/lib/helpers/singletonMethod.ts @@ -9,7 +9,7 @@ /** * Function to get a singleton. To create the singleton, the parameter *create* is used. This will be called once. * The singleton will be stored as *global* variable and can be accessed by the identifier - * + * * @author M.Karkowski * @export * @template T The Type of the singleton @@ -17,7 +17,10 @@ * @param {() => T} create The Callback which is used to create the instance. * @return An object, containing the key **instances**, where you'll find the instance and an helper function **setInstance** to redefine the instance */ -export function getSingleton(identifier: string, create: () => T): { +export function getSingleton( + identifier: string, + create: () => T +): { instance: T; setInstance: (value: T) => void; } { diff --git a/lib/index.browser.ts b/lib/index.browser.ts index e7ef369..8cb7e94 100644 --- a/lib/index.browser.ts +++ b/lib/index.browser.ts @@ -17,6 +17,7 @@ import * as observables from "./observables/index"; import * as promises from "./promise/index"; import * as types from "./types/index"; +export { getLayer } from "./communication/index.browser"; export * from "./logger/index.browser"; export { communcation, diff --git a/lib/index.nodejs.ts b/lib/index.nodejs.ts index 2aa1293..f96dd21 100644 --- a/lib/index.nodejs.ts +++ b/lib/index.nodejs.ts @@ -21,6 +21,7 @@ export { readInArgs as readInRunNopeBackendArgs, runNopeBackend, } from "./cli/runNopeBackend"; +export { getLayer } from "./communication/index.nodejs"; export * from "./logger/index.nodejs"; export { communcation, diff --git a/lib/logger/getLogger.ts b/lib/logger/getLogger.ts index b574154..599b00a 100644 --- a/lib/logger/getLogger.ts +++ b/lib/logger/getLogger.ts @@ -27,8 +27,8 @@ export function getCentralNopeLogger(): NopeLogger { /** * Helper Function, to create a Logger. Therefore it uses a specific Level and a Lable of the - * Logger. The Logger-Level can be overwritten by the central-logger see {@link getCentralNopeLogger} - * + * Logger. The Logger-Level can be overwritten by the central-logger see {@link getCentralNopeLogger} + * * * @export * @param {LoggerLevel} level The Level, which should be rendered diff --git a/lib/logger/index.browser.ts b/lib/logger/index.browser.ts index ff8c0e8..1aab35a 100644 --- a/lib/logger/index.browser.ts +++ b/lib/logger/index.browser.ts @@ -51,14 +51,13 @@ export { getLogerAsEventEmitter, TCallback, TCallbackWithLevel, - useEventLogger + useEventLogger, } from "./eventLogging"; export { defineNopeLogger, getCentralNopeLogger, getNopeLogger, - ValidLoggerDefinition + ValidLoggerDefinition, } from "./getLogger"; export { LoggerLevel, LoggerLevels } from "./nopeLogger"; export { setGlobalLoggerLevel } from "./setGlobalLoggerLevel"; - diff --git a/lib/logger/index.nodejs.ts b/lib/logger/index.nodejs.ts index 3c33ae6..479e43f 100644 --- a/lib/logger/index.nodejs.ts +++ b/lib/logger/index.nodejs.ts @@ -5,9 +5,8 @@ * @modify date 2021-08-27 20:19:05 * @desc [description] * @module logger - * [[include lib/logger/README.md]] + * [[include:00-Getting-Started.md]] */ export { generateLogfilePath, useLogFile } from "./fileLogging"; export * from "./index.browser"; - diff --git a/lib/logger/nopeLogger.ts b/lib/logger/nopeLogger.ts index e91784a..eed0284 100644 --- a/lib/logger/nopeLogger.ts +++ b/lib/logger/nopeLogger.ts @@ -59,28 +59,28 @@ Logger.useDefaults({ defaultLevel: (Logger as any).DEBUG, formatter: RUNNINGINNODE ? function (messages, context) { - messages.unshift( - colors.FgBlue, - new Date().toISOString(), - colors.Reset, - "-", - colorMatching[context.level.name], - context.level.name + spacer[context.level.name], - "-", - colors.BgWhite + colors.FgBlack, - context.name, - colors.Reset, - ":" - ); - } + messages.unshift( + colors.FgBlue, + new Date().toISOString(), + colors.Reset, + "-", + colorMatching[context.level.name], + context.level.name + spacer[context.level.name], + "-", + colors.BgWhite + colors.FgBlack, + context.name, + colors.Reset, + ":" + ); + } : function (messages, context) { - messages.unshift( - context.level.name + spacer[context.level.name], - "-", - context.name, - ":" - ); - }, + messages.unshift( + context.level.name + spacer[context.level.name], + "-", + context.name, + ":" + ); + }, }); /** @@ -142,7 +142,7 @@ function _getLogger(level: LoggerLevel, label = ""): ILogger { } /** - * The Nope-Logger. It consits o + * The Nope-Logger. It consits o */ export class NopeLogger { protected _logger: ILogger; @@ -183,7 +183,7 @@ export class NopeLogger { /** * Creates a sublogger with the given name and the - * level. + * level. * * @author M.Karkowski * @param {string} [name=""] The name of the logger @@ -285,7 +285,7 @@ export class NopeLogger { protected _pw = ""; /** - * Lock the Logger Level with a password. This prevents chaning the + * Lock the Logger Level with a password. This prevents chaning the * log level to other log-levels. you must {@link NopeLogger.unlock} to * update the Level again. * diff --git a/lib/types/nope/nopeDispatcher.interface.ts b/lib/types/nope/nopeDispatcher.interface.ts index 1bdaaf1..95d2803 100644 --- a/lib/types/nope/nopeDispatcher.interface.ts +++ b/lib/types/nope/nopeDispatcher.interface.ts @@ -11,14 +11,14 @@ import { ICommunicationBridge } from "./nopeCommunication.interface"; import { IHost, INopeINopeConnectivityTimeOptions, - INopeStatusInfo, + INopeStatusInfo } from "./nopeConnectivityManager.interface"; import { INopeCore } from "./nopeCore.interface"; import { INopeDescriptor } from "./nopeDescriptor.interface"; import { IEventAdditionalData, IEventCallback, - INopeObserver, + INopeObserver } from "./nopeEventEmitter.interface"; import { INopeModule, INopeModuleDescription } from "./nopeModule.interface"; import { INopeObservable } from "./nopeObservable.interface"; @@ -33,7 +33,7 @@ export type IGenerateRemoteInstanceCallback = ( ) => Promise; export type IGenerateRemoteInstanceForOtherDispatcherCallback< I extends INopeModule -> = (dispatcher: INopeDispatcher, identifier: string, ...args) => Promise; + > = (dispatcher: INopeDispatcher, identifier: string, ...args) => Promise; export type IValidPromise = Promise | INopePromise; @@ -102,7 +102,7 @@ export interface IHostOverview extends IHost { } export interface IDispatcherConstructor { - new ( + new( options: INopeDispatcherOptions, _generateObservable: () => INopeObservable ): INopeDispatcher; @@ -142,8 +142,19 @@ export interface INopeDispatcherDescription extends INopeStatusInfo { } /** - * Interface for an Dispatcher. - * + * # NoPE - Dispatcher + * + * The NoPE-Dispatcher is designed as Layer between the different Modules / Dispatchers. They allow distributed computing or just a simple ***Service oriented Architecture*** (*SOA*). A dispatcher is used to link the modules, share data and events and provide a remote procedure call (rpc) interface. + * + * ## Building Blocks of a Dispatcher: + * + * | element | description | + * |-|-| + * | `connectivityManager` | establishes a connection to other dispatchers and manages the status of the remotely connected dispatchers. It checks their health and removes dead dispatchers. | + * | `eventDistributor` | shares events accross the network (or internally). You can use this element to listen for specific events. The subscription to those events allows `mqtt`-patterns. Additionaly, you are allowed to emit event on specific topics, or pattern based topics | + * | `dataDistributor` | shares data accross the network (or internally). In comperisson to events, data is persistent and is available all the time. You can use this sub-module to listen for specific data-changes (install data-hooks), pull specific data or push data. You can pull / push data using a `mqtt`-pattern based path. | + * | `rpcManager` | Used to perform `remote procedure calls` (see [here](https://de.wikipedia.org/wiki/Remote_Procedure_Call)). The manager keeps track of the available services. You must use the sub-module to register/unregister (new) services. | + * | `instanceManager` | Used to create/dispose (remote) instances. The manager keeps track of the available instances in the network, allows to create `wrappers` for those instances. You must use the sub-module to register/unregister (new) instances. To allow the system to provide a service for creating instances of as specific type, you can provide a generator and provide it as `service`. | * @export * @interface INopeDispatcher */ diff --git a/package-lock.json b/package-lock.json index f16a900..b6c9c48 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,14 +1,15 @@ { "name": "nope", - "version": "1.0.9", + "version": "1.0.10", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "nope", - "version": "1.0.9", + "version": "1.0.10", "license": "MIT", "dependencies": { + "argparse": "^2.0.1", "async": "^3.2.2", "comment-parser": "^1.3.0", "cors": "^2.8.5", @@ -947,8 +948,7 @@ "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "node_modules/arr-diff": { "version": "4.0.0", @@ -18992,8 +18992,7 @@ "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "arr-diff": { "version": "4.0.0", diff --git a/package.json b/package.json index 9aaa29a..a8d84b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nope", - "version": "1.0.9", + "version": "1.0.10", "description": "NoPE Runtime for Nodejs. For Browser-Support please use nope-browser", "files": [ "dist-nodejs/**/*", @@ -39,6 +39,7 @@ }, "homepage": "https://git.zema.de/tfs/ZISS/_git/nope-js#readme", "dependencies": { + "argparse": "^2.0.1", "async": "^3.2.2", "comment-parser": "^1.3.0", "cors": "^2.8.5", diff --git a/tsconfig.json b/tsconfig.json index 471fa38..634a7ff 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -30,9 +30,7 @@ "location": "local", "format": "png" }, - "includes": [ - "lib" - ] + "includes": "wiki" }, "include": [ "lib", diff --git a/wiki/.gitignore b/wiki/.gitignore new file mode 100644 index 0000000..58461f2 --- /dev/null +++ b/wiki/.gitignore @@ -0,0 +1 @@ +.ipynb_checkpoints \ No newline at end of file diff --git a/wiki/00-Getting-Started.md b/wiki/00-Getting-Started copy.md similarity index 82% rename from wiki/00-Getting-Started.md rename to wiki/00-Getting-Started copy.md index e7faaf3..e890f0a 100644 --- a/wiki/00-Getting-Started.md +++ b/wiki/00-Getting-Started copy.md @@ -20,7 +20,16 @@ Use the following code: `npm --registry https://npm.zema.de/ install nope` The Documentation is contained in here. Alternative you can create a Documentation using `npm run-script doc`. This will create the Documentation under `docs`. -You'll additional help under `wiki` +You'll additional help under `wiki`. + +The `wiki` is mostly running as `Markdown` or `Jupyter`-Notebook. + +### Run the wiki + +1. Install the documents via: `00-install-jupyter.bat` + 1. Install the `jupyter` with `pip3 install jupyter` + 2. Install a Javascript interpreter for `jupyter` with `npm install -g ijavascript`. Afterwards install the extension `%appdata%\npm\ijsinstall` +2. Run the `01-start-jupyter.bat` --- diff --git a/wiki/01-NoPE.md b/wiki/01-NoPE.md new file mode 100644 index 0000000..073042b --- /dev/null +++ b/wiki/01-NoPE.md @@ -0,0 +1,7 @@ +![Logo](./media/logo.png) + +--- + +## No Programming Environment - `NoPE` + +`NoPE`-Library for `javascript` / `python`. diff --git a/wiki/02-Logging.ipynb b/wiki/02-Logging.ipynb new file mode 100644 index 0000000..fc9fbc7 --- /dev/null +++ b/wiki/02-Logging.ipynb @@ -0,0 +1,24 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "JavaScript (Node.js)", + "language": "javascript", + "name": "javascript" + }, + "language_info": { + "name": "javascript" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/wiki/11-Observables.ipynb b/wiki/11-Observables.ipynb new file mode 100644 index 0000000..de5ba8c --- /dev/null +++ b/wiki/11-Observables.ipynb @@ -0,0 +1,209 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Observables\n", + "## Usage of `nope.observables`\n", + "\n", + "Import Nope.\n", + "\n", + "```typescript\n", + "import * as nope from \"nope\";\n", + "```\n", + "\n", + "In our nodebook, we have to use **javascript** instead of **typescript**:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "// First lets install nope using npm\n", + "const nope = require(\"../dist-nodejs/index.nodejs\")\n", + "\n", + "// Create our Observable:\n", + "const obs = new nope.observables.NopeObservable()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### `setContent`: Change the content of the Observable.\n", + "\n", + "To change the content of an observable use the function `setContent`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "// Set the content to \"1337\"\n", + "obs.setContent(5);\n", + "\n", + "// Print the content (see getContent)\n", + "console.log(\"current value =\",obs.getContent());" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### `setter`: Define a specific setter for the observable.\n", + "\n", + "You can specify a specifc getter for the observable for instance, to limit the number to the following constrains `> 0` and `< 10`.\n", + "\n", + "---\n", + "\n", + "The setter function will receive multiple parameters, as listed below:\n", + "\n", + "1. `value`,\n", + "2. ``options`` containing:\n", + " * `sender`: The Element, which changed the data\n", + " * `timestamp`: The timestamp of the change\n", + " * `args`: additional args. \n", + "\n", + "---\n", + "\n", + "The setter function have to return a `dict` with the following keys:\n", + "| key | type | content |\n", + "| - | - | - |\n", + "| `valid` | `bool` | A Flag, to show whether the data are valid or not. If the data is invalid, the observable wont store them |\n", + "| `value` | `any` | The Data that has been adapted |\n", + "\n", + "---\n", + "\n", + "Below, we will implement an example to show the setter above." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "obs.setter = (value, options) => {\n", + " // Print, which data we received\n", + " console.log(\"setter received\", value, options);\n", + " // Show the result of our comparison\n", + " console.log(\"data is valid:\", (value > 0) && (value < 10));\n", + " return {\n", + " // The Value\n", + " value: value,\n", + " // Valid\n", + " valid: (value > 0) && (value < 10)\n", + " }\n", + "}\n", + "\n", + "// Set the content to \"1337\" ==> But our setter will prevent using this value because it isnt valid.\n", + "obs.setContent(1337);\n", + "\n", + "// Print the content (see getContent) ==> we expect to get \"5\"\n", + "console.log(\"current value =\", obs.getContent());" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To remove such a getter just set the getter property to `null`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "obs.setter = null\n", + "\n", + "// Set the content to \"1337\" we do not have any setter ==> we will use this parameter\n", + "obs.setContent(1337);\n", + "\n", + "// Print the content (see getContent) ==> we expect to get \"1337\"\n", + "console.log(\"current value =\", obs.getContent());" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### `getContent`: Get the current content of the Observable.\n", + "To extract the content of our observable, we are able to use the function `getContent`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "let content = obs.getContent();\n", + "console.log(\"current value =\", content)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If no data is assigned, this will result in `undefined`. Otherwise the current data is returned.\n", + "\n", + "#### `getter`: Define a specific getter for the observable.\n", + "\n", + "You can specify a specifc getter for the observable for instance, to allways return a `string`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "// Define a getter\n", + "obs.getter = (value) => \"Allways this result\";\n", + "console.log(\"current value (with getter) =\", obs.getContent());" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To remove such a getter just set the getter property to `null`. \n", + "\n", + "The Original value is not changed ==> we expect to get \"1337\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "// Reset the getter.\n", + "obs.getter = null;\n", + "console.log(\"current value (after removing the getter) =\", obs.getContent());" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "JavaScript (Node.js)", + "language": "javascript", + "name": "javascript" + }, + "language_info": { + "file_extension": ".js", + "mimetype": "application/javascript", + "name": "javascript", + "version": "17.3.1" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/wiki/12-Dispatcher.ipynb b/wiki/12-Dispatcher.ipynb new file mode 100644 index 0000000..e47e9a4 --- /dev/null +++ b/wiki/12-Dispatcher.ipynb @@ -0,0 +1,84 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# NoPE - Dispatcher\n", + "\n", + "The NoPE-Dispatcher is designed as Layer between the different Modules / Dispatchers. They allow distributed computing or just a simple ***Service oriented Architecture*** (*SOA*). A dispatcher is used to link the modules, share data and events and provide a remote procedure call (rpc) interface.\n", + "\n", + "## Building Blocks of a Dispatcher:\n", + "\n", + "| element | description | \n", + "|-|-|\n", + "| `connectivityManager` | establishes a connection to other dispatchers and manages the status of the remotely connected dispatchers. It checks their health and removes dead dispatchers. |\n", + "| `eventDistributor` | shares events accross the network (or internally). You can use this element to listen for specific events. The subscription to those events allows `mqtt`-patterns. Additionaly, you are allowed to emit event on specific topics, or pattern based topics |\n", + "| `dataDistributor` | shares data accross the network (or internally). In comperisson to events, data is persistent and is available all the time. You can use this sub-module to listen for specific data-changes (install data-hooks), pull specific data or push data. You can pull / push data using a `mqtt`-pattern based path. |\n", + "| `rpcManager` | Used to perform `remote procedure calls` (see [here](https://de.wikipedia.org/wiki/Remote_Procedure_Call)). The manager keeps track of the available services. You must use the sub-module to register/unregister (new) services. |\n", + "| `instanceManager` | Used to create/dispose (remote) instances. The manager keeps track of the available instances in the network, allows to create `wrappers` for those instances. You must use the sub-module to register/unregister (new) instances. To allow the system to provide a service for creating instances of as specific type, you can provide a generator and provide it as `service`. |\n", + "\n", + "## Create a Dispatcher\n", + "\n", + "To start exploring the capabilities of the dispatcher we will firstly create a dispatcher with the code below:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "// First lets install nope using npm\n", + "const nope = require(\"../dist-nodejs/index.nodejs\")\n", + "\n", + "// Lets create our dispatcher\n", + "const dispatcher = nope.dispatcher.getDispatcher({\n", + " // We will use the event layer (which just runs internally)\n", + " communicator: nope.getLayer(\"event\"),\n", + "\n", + " // We will adapt the timings (normally, we send a hartbeat and check for dead dispatchers)\n", + " timings: {\n", + "\n", + " /**\n", + " * Interval for the alive message given in [ms]. If \"0\" is provided,\n", + " * no alive messages are provided\n", + " *\n", + " * @author M.Karkowski\n", + " * @type {number}\n", + " */\n", + " sendAliveInterval: 0,\n", + "\n", + " /**\n", + " * Interval, to check the other dispatcher for being slow, dead, etc..\n", + " * should be lager then the \"sendAliveInterval\". The value is given in [ms]\n", + " * If \"0\" is provided, no alive messages are provided\n", + " *\n", + " * @author M.Karkowski\n", + " * @type {number}\n", + " */\n", + " checkInterval: 0\n", + " \n", + " }\n", + "});\n", + "console.log(dispatcher)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "JavaScript (Node.js)", + "language": "javascript", + "name": "javascript" + }, + "language_info": { + "file_extension": ".js", + "mimetype": "application/javascript", + "name": "javascript", + "version": "17.3.1" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/wiki/install-jupyter.bat b/wiki/install-jupyter.bat new file mode 100644 index 0000000..7087e05 --- /dev/null +++ b/wiki/install-jupyter.bat @@ -0,0 +1,32 @@ +set DIR=%~dp0 +cd "%DIR%" + +if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b) + +@REM Link NPM-Folders +mkdir %PROGRAMDATA%\npm +setx PATH "%PROGRAMDATA%\npm;%PATH%" /M +npm config set prefix %PROGRAMDATA%\npm + +%@Try% + @REM Uninstall IO-Server + pip3 install jupyter + npm install -g ijavascript && ( + npm --registry https://npm.zema.de/ install -g nope && ( + %appdata%\npm\ijsinstall + ) || ( + %appdata%\npm\ijsinstall + ) + ) || ( + npm --registry https://npm.zema.de/ install -g nope && ( + %appdata%\npm\ijsinstall + ) || ( + %appdata%\npm\ijsinstall + ) + + ) +%@EndTry% +:@Catch + echo uninstall IO-Server +:@EndCatch + diff --git a/wiki/media/logo.png b/wiki/media/logo.png new file mode 100644 index 0000000..b28c266 Binary files /dev/null and b/wiki/media/logo.png differ diff --git a/wiki/start-jupyter.bat b/wiki/start-jupyter.bat new file mode 100644 index 0000000..c977f74 --- /dev/null +++ b/wiki/start-jupyter.bat @@ -0,0 +1,7 @@ +set DIR=%~dp0 +cd "%DIR%" + +if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b) +ijsnotebook --notebook-dir=./ +import * as nope from "nope"; +