Skip to content

Commit

Permalink
Update docs for the v5.3 framework version
Browse files Browse the repository at this point in the history
  • Loading branch information
shalithasuranga committed Jul 26, 2024
1 parent 5db7806 commit 43d5cd3
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 2 deletions.
60 changes: 60 additions & 0 deletions docs/api/filesystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,3 +335,63 @@ Therefore, you can use this method to check for the existance of a file or direc
```js
let stats = await Neutralino.filesystem.getStats('./sampleVideo.mp4');
console.log('Stats:', stats);
```

## filesystem.getAbsolutePath(path)
Returns the absolute path for a given path. This function works with paths that don't exist on the system.

### Parameters

- `path` String: Path.

### Return String (awaited):
Absolute path.

```js
let path = await Neutralino.filesystem.getAbsolutePath('./myFolder');
console.log(path);
```

## filesystem.getRelativePath(path, base)
Returns the relative path for a given path and base. This function works with paths that
don't exist on the system.

### Parameters

- `path` String: Path.
- `base` String (optional): Base path that is used for calculating the relative path
with the `path` parameter. [`NL_CWD`](./global-variables.md#predefined-global-variables) is used
by default if this parameter is not provided.

### Return String (awaited):
Relative path.

```js
let path = await Neutralino.filesystem.getRelativePath('./myFolder');
console.log(path);

path = await Neutralino.filesystem.getRelativePath('./myFolder', '/home/user');
console.log(path);
```

## filesystem.getPathParts(path)
Parses a given path and returns its parts.

### Parameters

- `path` String: Path.

### Return Object (awaited):
- `rootName` String: Root path name.
- `rootDirectory` String: Root path directory.
- `rootPath` String: Root path.
- `relativePath` String: Path relative to the root path.
- `parentPath` String: Parent path or the directory path without filename.
- `filename` String: Filename.
- `extension` String: File extension.
- `stem` String: Filename segment without extension.

```js
let pathParts = await Neutralino.filesystem.getPathParts('./myFolder/myFile.txt');
console.log('Parts:', pathParts);
```
2 changes: 1 addition & 1 deletion docs/api/os.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ Returns known platform-specific folders such as Downloads, Music, Videos, etc.

### Parameters
- `title` String: Name of the folder. Accepted values are: `config`, `data`, `cache`, `documents`, `pictures`, `music`, `video`,
`downloads`, `savedGames1`, and `savedGames2`. Throws `NE_OS_INVKNPT` for invalid folder names.
`downloads`, `savedGames1`, `savedGames2`, and `temp`. Throws `NE_OS_INVKNPT` for invalid folder names.

### Return String (awaited):
Path.
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration/neutralino.config.json.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ windows, windows with custom shadows, and custom-shaped window frames.
The default value is `false` for this option.

:::info
This feature is only available on GNU/Linux and Mac systems and will be implemented soon on Windows.
Unlike in other platforms, Windows native window becomes borderless (window controls will be hidden) with the activation of the transparent mode.
:::

### `modes.window.fullScreen: boolean`
Expand Down
5 changes: 5 additions & 0 deletions docs/release-notes/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ title: CLI

## Unreleased

## v11.2.2

### Bugfixes/improvements
- Fix initial loading issues with frontend library development file patching.

## v11.2.0

## Core: Bundler
Expand Down
5 changes: 5 additions & 0 deletions docs/release-notes/client-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ title: Client Library

## Unreleased

## v5.3.0

### API: filesystem
- Expose `filesystem.getAbsolutePath(path)`, `filesystem.getRelativePath(path, ?base)`, and `filesystem.getPathParts(path)` functions.

## v5.2.0

### API: filesystem
Expand Down
17 changes: 17 additions & 0 deletions docs/release-notes/framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ title: Framework

## Unreleased

## v5.3.0

### Configuration: window transparency on Windows
Window transparency support was added on the Windows version of the Neutralinojs framework. This can be activated with `modes.window.transparent` configuration property or `--window-transparent` command-line option. Unlike in other platforms, Windows native window becomes borderless (window controls will be hidden) with the activation of the transparent mode.

### API: os
- Add the `temp` key for the supported directory list of the `os.getPath(pathKey)` function.

### API: filesystem
- Add the `filesystem.getAbsolutePath(path)` function to let developers get a full path string from a relative path string.
- Add the `filesystem.getRelativePath(path, ?base)` function to get a relative path from a path and a base path.
- Add the `filesystem.getPathParts(path)` to parse and get path segments like filename, extension, root path, etc.

### Improvements/bugfixes
- Fix Unicode issues in the Windows version with filesystem, storage, and general modules.
- Fix standard output/error data display issues on Windows

## v5.2.0

### Configuration: Configless framework initialization
Expand Down

0 comments on commit 43d5cd3

Please sign in to comment.