Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions apps/docs/autogen/netlogopreferences.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,35 @@ empty model.
If you use an editor outside of NetLogo to change the model or any included .nls
files, the changed file is updated in NetLogo.

### Enable remote commands

When this option is enabled, NetLogo listens for commands to execute on a Unix Domain Socket. Received commands are executed in the observer context as if they were entered in the Command Center. This can be used by external software such as editor plugins for better integration with NetLogo.

If the environment variable `XDG_RUNTIME_DIR` is set, the listening socket is created under `XDG_RUNTIME_DIR`. Otherwise, it is created under the NetLogo directory:
- On Mac OS X: `Library/Application Support/NetLogo/{{versionMajorMinor}}`
- On Windows: `AppData\NetLogo\\{{versionMajorMinor}}`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the double slash intended?

- On Linux: `.netlogo/{{versionMajorMinor}}`

The listening socket is named using the following pattern `netlogo-<PID>` where `<PID>` is the process ID of the associated NetLogo process.

To send a command to NetLogo, encode the command in a JSON object as follows, replacing `<COMMAND>` with the command. The resulting string should then be written to the listening socket.

```json
{
"type": "nl-run-code",
"code": "<COMMAND>"
}
```

Once the command is received and processed, NetLogo will respond with the following JSON object. If the command is successfully parsed and executed, `<STATUS>` will be `ok`. Otherwise, it will be a message describing the error that occurred. Note that this will only report errors that occur during the processing of the request. Runtime errors that occur as a result of executing the provided command are not reported here.

```json
{
"type": "nl-status",
"status": "<STATUS>"
}
```

### Bold widget text

By default, widget text is not in bold, use this option to bold it.
Expand Down
4 changes: 3 additions & 1 deletion apps/docs/lib/docs/runDocsAutogen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ export default async function runDocsAutogen() {
netlogoDictionary: prebuildHandlebarsHelper,
});

const version = process.env["PRODUCT_VERSION"] || "7.0.1";
const buildVariables = {
version: process.env["PRODUCT_VERSION"] || "7.0.1",
version: version,
versionMajorMinor: version.match(/^[^.]+\.[^.]+/)?.[0],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer matching on \d over [^.].

Log a warning on failure to match to prevent uncaught artifacts in build.

buildDate: process.env["PRODUCT_BUILD_DATE"] || new Date().toISOString(),
};

Expand Down