Skip to content

Commit

Permalink
Merge pull request #92 from MercuryWorkshop/docs
Browse files Browse the repository at this point in the history
Updates to Docs
  • Loading branch information
markrosenbaum authored Sep 28, 2023
2 parents 7c3d699 + d8c1917 commit 1184cbe
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 69 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Formerly known as Chimera. Based off of the AliceWM.
- Make sure you have `Docker` installed and running.
- Run `make rootfs`
- Make sure to add yourself to the Docker group using `usermod -a -G docker $USER`
- (Special Use Case) In the event that you should need to override/manually add the initrd and kernel, remember to keep track of the file names of initrd and vmlinuz in build/images/debian-boot/. Then, copy them to the Anura root directory and rename them to initrd.img and bzimage respectively.(See the extended instructions [here](documentation/Kernel%20Override.md).)
- (Special Use Case) In the event that you should need to override/manually add the initrd and kernel, remember to keep track of the file names of initrd and vmlinuz in build/images/debian-boot/. Then, copy them to the Anura root directory and rename them to initrd.img and bzimage respectively.(See the extended instructions [here](./documentation/Kernel_Override.md).)

### Running Anura

Expand Down Expand Up @@ -61,7 +61,7 @@ Will be utilized after the first Build of AnuraOS.

## Documentation

Still being written. (See documentation folder)
Still being written. (See the current index of documentation [here](./documentation/README.md))

## Security

Expand Down
91 changes: 91 additions & 0 deletions documentation/Anura-API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# The Anura Internal API

This document has a brief explanation of all the Anura JS APIs and how to use them

## anura.settings

This API is used to define system settings in Anura, it is a key value store of JS objects.

**Usage:**

```js
anura.settings.get("applist"); // Get pinned apps in anura's taskbar

anura.settings.get("applist", ["anura.x86mgr", "anura.browser"]); // Set pinned apps in anura's taskbar in this order
```

## anura.x86

This API provides access to Anura's x86 backend; Which is used to create PTYs, write directly to serial terminals (not recommended) or access v86 itself.

**Usage:**

```js
anura.x86.emulator; // Get v86 emulator object

anura.x86.openpty; // Open a PTY terminal (see usage in sourcecode for terminal.app)
```

## anura.fs

This API provides access the Anura's internal filesystem, loosely following the node filesystem spec(slightly out of date).

The best documentation on the usage of this API can probably be found [Here](https://github.com/filerjs/filer).

## anura.notifications

This API provides access to Anura's notification service, useful if you need to display an alert to the user.

**Usage:**

```js

anura.notifications.add({

title: "Test Notification",

description: `This is a test notification`,

callback: function() {console.log('hi')}

timeout: 2000

}) // Show a notification to the user, on click, it says hi in console, it lasts for 2 seconds.

```

## anura.wsproxyURL

This API returns a usable wsproxy url for any TCP application.

**Usage:**

```js
let webSocket = new WebSocket(anura.wsproxyURL + "alicesworld.tech:80", [
"binary",
]);

webSocket.onmessage = async (event) => {
const text = await (await event.data).text();

console.log(text);
};

webSocket.onopen = (event) => {
webSocket.send("GET / HTTP/1.1\r\nHost: alicesworld.tech\r\n\r\n");
};

// Sends HTTP 1.1 request to alicesworld.tech using wsproxy
```

## anura.python

This API creates a python interpreter for use in Anura apps (based on Python 3.10.2).

**Usage:**

```js
let interpreter = await anura.python();

interpreter.runPython("print('Hi')"); // prints Hi in console
```
File renamed without changes.
11 changes: 11 additions & 0 deletions documentation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# The Anura Documentation

**Index of Anura Documentation:**

## [The Anura API](./Anura-API.md)

## [Using the Kernel Override](./Kernel_Override.md)

## [Anura App Development](./appdevt.md)

## [Anura Security Blueprint](./SECURITY-BP.md)
66 changes: 0 additions & 66 deletions documentation/anura.md

This file was deleted.

1 change: 0 additions & 1 deletion documentation/readme.md

This file was deleted.

0 comments on commit 1184cbe

Please sign in to comment.