From d10bf3d8e4389b1aed9c9fa9f1f4c6cc2e5ba482 Mon Sep 17 00:00:00 2001 From: Brian Broll Date: Wed, 10 Jan 2024 14:14:53 -0600 Subject: [PATCH 1/3] Move adv/ to deploy/ --- docs/{adv => deploy}/cli.rst | 0 docs/{adv => deploy}/deploy.rst | 0 docs/{adv => deploy}/installation.rst | 0 docs/{adv => deploy}/rpc-support.rst | 0 docs/dev/hello-custom-services.rst | 2 +- docs/index.rst | 8 ++++---- 6 files changed, 5 insertions(+), 5 deletions(-) rename docs/{adv => deploy}/cli.rst (100%) rename docs/{adv => deploy}/deploy.rst (100%) rename docs/{adv => deploy}/installation.rst (100%) rename docs/{adv => deploy}/rpc-support.rst (100%) diff --git a/docs/adv/cli.rst b/docs/deploy/cli.rst similarity index 100% rename from docs/adv/cli.rst rename to docs/deploy/cli.rst diff --git a/docs/adv/deploy.rst b/docs/deploy/deploy.rst similarity index 100% rename from docs/adv/deploy.rst rename to docs/deploy/deploy.rst diff --git a/docs/adv/installation.rst b/docs/deploy/installation.rst similarity index 100% rename from docs/adv/installation.rst rename to docs/deploy/installation.rst diff --git a/docs/adv/rpc-support.rst b/docs/deploy/rpc-support.rst similarity index 100% rename from docs/adv/rpc-support.rst rename to docs/deploy/rpc-support.rst diff --git a/docs/dev/hello-custom-services.rst b/docs/dev/hello-custom-services.rst index 22109fd8..39361e7c 100644 --- a/docs/dev/hello-custom-services.rst +++ b/docs/dev/hello-custom-services.rst @@ -7,7 +7,7 @@ This assumes you are using OSX or linux. Create the service ------------------ -First, set up a local development environment (see :doc:`/adv/installation`). +First, set up a local development environment (see :doc:`/deploy/installation`). Creating the server support for a simple service can be done as follows (assuming ``*nix`` shell starting at the project root): diff --git a/docs/index.rst b/docs/index.rst index 2f9012ea..21172314 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -20,10 +20,10 @@ NetsBlox Documentation :maxdepth: 2 :caption: Deployment - adv/installation.rst - adv/deploy.rst - adv/cli.rst - adv/rpc-support.rst + deploy/installation.rst + deploy/deploy.rst + deploy/cli.rst + deploy/rpc-support.rst .. toctree:: :maxdepth: 2 From 0513721a618db91524039dc334fa1274cbf2277e Mon Sep 17 00:00:00 2001 From: Brian Broll Date: Wed, 10 Jan 2024 14:27:33 -0600 Subject: [PATCH 2/3] WIP Started URL docs --- docs/adv/url.rst | 5 +++++ docs/index.rst | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 docs/adv/url.rst diff --git a/docs/adv/url.rst b/docs/adv/url.rst new file mode 100644 index 00000000..ab75f97f --- /dev/null +++ b/docs/adv/url.rst @@ -0,0 +1,5 @@ +Sharing Projects via URLs +========================= + +When opening NetsBlox, there are a number of URL parameters that can be used to modify the behavior when it opens. This includes things like opening a public project or setting the language. + diff --git a/docs/index.rst b/docs/index.rst index 21172314..dd4953b9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -16,6 +16,12 @@ NetsBlox Documentation <%= services %> +.. toctree:: + :maxdepth: 2 + :caption: Advanced + + adv/url.rst + .. toctree:: :maxdepth: 2 :caption: Deployment From a1416cea7d0413c1bcce26f74877c31039de0918 Mon Sep 17 00:00:00 2001 From: Brian Broll Date: Tue, 16 Jan 2024 14:11:24 -0600 Subject: [PATCH 3/3] Flesh out the support actions, URL params in docs --- docs/adv/url.rst | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/docs/adv/url.rst b/docs/adv/url.rst index ab75f97f..0551d6e6 100644 --- a/docs/adv/url.rst +++ b/docs/adv/url.rst @@ -1,5 +1,39 @@ Sharing Projects via URLs ========================= -When opening NetsBlox, there are a number of URL parameters that can be used to modify the behavior when it opens. This includes things like opening a public project or setting the language. +When opening NetsBlox, there are a number of URL parameters that can be used to modify the behavior when it opens. This includes things like opening a public project or setting the language. Although NetsBlox supports configuration using hash parameters in the URL (i.e., adding text after a "#" in the URL), the recommended approach is to use query string parameters instead (i.e., text after a "?" in the URL). +Actions +------- +The most common use of custom URLs in NetsBlox is for sharing public projects or automatically opening example projects. This is supported through setting the "action" parameter. Below is a list of supported actions. + +- **open**: Immediately open a project or block library. + - Parameters: + - *data*: the project or block library to open. It can be specified as a URL or as a (URI encoded) XML string. **required** +- **run**: Open a project and run it. + - Parameters: + - *data*: the project or block library to open. It can be specified as a URL or as a (URI encoded) XML string. **required** + - *editMode*: If set, the project will be open in a regular mode. Otherwise, it will be opened in "app mode" (see the **appMode** setting). + - *noRun*: This action will run the project on open (see the **run** setting). Adding this parameter to the URL will revert this behavior so the project will not run on start. +- **present**: Open a public project and run it. + - Parameters: + - *Username*: The owner of the public project to open **required** + - *ProjectName*: The name of the public project to open **required** + - *editMode*: If set, the project will be open in a regular mode. Otherwise, it will be opened in "app mode" (see the **appMode** setting). + - *noRun*: This action will run the project on open (see the **run** setting). Adding this parameter to the URL will revert this behavior so the project will not run on start. +- **dl**: Download a public project. + - Parameters: + - *Username*: The owner of the public project to open **required** + - *ProjectName*: The name of the public project to open **required** +- **signup**: Open the signup dialog on start. + +Other Settings +-------------- +The following settings are generally available, regardless of the action: +- **appMode**: Start NetsBlox in fullscreen mode. Some actions, such as "present", will set this to true unless explicitly overridden. +- **embedMode**: Open NetsBlox and customize the UI for embedding in a bigger site like on the social project sharing/commenting sites by Snap or Scratch. Expected to be used with **appMode**. +- **run**: Trigger the green flag as soon as NetsBlox starts. +- **hideControls**: Hide the control bar (with the green flag, red stop sign, etc). +- **noExitWarning**: Don't confirm that the user wants to leave the page on tab close. +- **lang**: Set the language immediately. For example, "lang=hu" will set NetsBlox to Hungarian on start. +- **setVariable**: Set a variable to the given value on start. The value is expected to be a URL-encoded pair so setting "hello" to "world" would be "hello%3Dworld".