Skip to content
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

Update Configuration.md Documentation #282

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

unborn-andy
Copy link

This is a PR for updating the Node-red Configuration section in the user guide to match the latest settings.js options.
I used as a template the settings.js template file from here

Went through it and added the missing options and half way through copy/pasting i realized that some of these option wont apply for people using older versions of Node-red. Dont know how you want to handle that. a message at the top saying that its for version 3 ?

I tested it with Jekyll.
Needs to be reviewed. Hope its useful

@dceejay
Copy link
Member

dceejay commented Jul 28, 2022

Yes - a vast improvement.
Yes - I think a small note to say this is for version 3 would be a good idea. (I guess we could rename the existing ...old or something and link to that ?

We should also add a link to this page on the settings file page https://nodered.org/docs/user-guide/runtime/settings-file - as that talks about this file but doesn't then lead you to the options.

@Steve-Mcl
Copy link
Contributor

Might be better to mark min version for features

E.g. diagnostics >= v3.0.0

Ps, @unborn-andy thanks for this

@unborn-andy
Copy link
Author

I think a small note to say this is for version 3 would be a good idea. (I guess we could rename the existing ...old or something and link to that ?

yes maybe we can use both .. a note at the top saying "Some options may not apply for older versions of Node-red". With this wording we can avoid updating that note every time NR version changes ;) and also write under each option the version when this feature was introduced. Like we see in other parts of the docs. For example for functionExternalModules it says Since Node-RED 1.3.0.

We should also add a link to this page on the settings file page https://nodered.org/docs/user-guide/runtime/settings-file - as that talks about this file but doesn't then lead you to the options.

yes .. i noticed it also .. some changes are needed on other pages also but i avoided editing other sections so it would be easier for you guys to review ;)

Might be better to mark min version for features
E.g. diagnostics >= v3.0.0

this is going to need someone more experienced with the inner workings of settings.js to add. i tried to look for some of this information from the changelog and from Releases but the new feature in not always mentioned in a way that i can easily search.

@Steve-Mcl
Copy link
Contributor

I propose it may be better to switch branch to 2.x and browse the source tree from there. You will see the differences. That should help with marking things as new to v3 or changed in v3

Comment on lines +45 to 50
**nodesDir**
*Since Node-RED 3.0.0.*
: a directory to search for additional installed nodes. Node-RED searches the `nodes`
directory under the *userDir* directory. This property allows an additional directory
to be searched, so that nodes can be installed outside of the Node-RED install
structure. Default: `$HOME/.node-red/nodes`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
**nodesDir**
*Since Node-RED 3.0.0.*
: a directory to search for additional installed nodes. Node-RED searches the `nodes`
directory under the *userDir* directory. This property allows an additional directory
to be searched, so that nodes can be installed outside of the Node-RED install
structure. Default: `$HOME/.node-red/nodes`
**nodesDir**
: This property allows an additional directory to be searched for nodes to import.
*Before Node-RED 3.0.0*
: This setting can be a single path `string` only
*Since Node-RED 3.0.0*
: This setting can be...
* A single path `string`
* An array of path `string`s

I think I forgot to merge the updated comments for nodesDir when i raised the PR (BAH!)
the above (or if you can think of better words for "it can be a string or array of strings") is more up-to-date.

Copy link
Author

Choose a reason for hiding this comment

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

nodesDir is a good example of some settings options that have changed with added features from version to version. If we add how it was Before and after v3 it could start getting messy (can of worms). Personally i think the docs should inform about the configuration as it stands now with the latest Node-red version. and add to the note at the top : "Please note that some of the options may not apply for older versions of Node-red. (consult the comments in your settings.js file)"

Comment on lines -172 to -204
page: {
title: "Node-RED",
favicon: "/absolute/path/to/theme/icon",
css: "/absolute/path/to/custom/css/file",
scripts: [ "/absolute/path/to/custom/script/file", "/another/script/file"]
},
header: {
title: "Node-RED",
image: "/absolute/path/to/header/image", // or null to remove image
url: "http://nodered.org" // optional url to make the header text/image a link to this url
},
deployButton: {
type:"simple",
label:"Save",
icon: "/absolute/path/to/deploy/button/image" // or null to remove image
},
menu: { // Hide unwanted menu items by id. see packages/node_modules/@node-red/editor-client/src/js/red.js:loadEditor for complete list
"menu-item-import-library": false,
"menu-item-export-library": false,
"menu-item-keyboard-shortcuts": false,
"menu-item-help": {
label: "Alternative Help Link Text",
url: "http://example.com"
}
},
tours: false, // disable the Welcome Tour for new users
userMenu: false, // Hide the user-menu even if adminAuth is enabled
login: {
image: "/absolute/path/to/login/page/big/image" // a 256x256 image
},
logout: {
redirect: "http://example.com"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

This info seems to be missing from your PR?

Copy link
Author

Choose a reason for hiding this comment

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

yes, im glad you noticed .. editorTheme is one of the sections that i wanted your input on. editorTheme is also one of the options that has added features, so i wasnt sure how you wanted to handle options that may not apply for older versions .. i'll update the description if its ok to reflect the latest v3

Copy link
Author

Choose a reason for hiding this comment

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

Steve some of those options seem to be missing from the latest settings.js file also ?
i didnt know what sub-options still apply for the latest NR version.

Copy link
Contributor

Choose a reason for hiding this comment

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

I can't answer why Andy. I know Nick did a good deal of tidy up and may have moved these or deleted them as they should be perhaps?
@knolleary can you comment on this one please?

unborn-andy and others added 4 commits July 31, 2022 19:02
Updated `diagnostics` description following Steve's suggestion

Co-authored-by: Stephen McLaughlin <44235289+Steve-Mcl@users.noreply.github.com>
Co-authored-by: Stephen McLaughlin <44235289+Steve-Mcl@users.noreply.github.com>
Co-authored-by: Stephen McLaughlin <44235289+Steve-Mcl@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants