Skip to content

Commit 2b7e1a1

Browse files
committed
Inital commit
All branding was revised Signed-off-by: Sayan Nandan <[email protected]>
0 parents  commit 2b7e1a1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1606
-0
lines changed

.github/dependabot.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: cargo
4+
directory: "/docbuilder"
5+
schedule:
6+
interval: daily
7+
time: "11:00"
8+
open-pull-requests-limit: 10
9+
- package-ecosystem: pip
10+
directory: "/"
11+
schedule:
12+
interval: daily
13+
time: "11:00"
14+
open-pull-requests-limit: 10

.github/workflows/deploy-docs.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Deploy docs
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
build:
9+
name: Deploy docs
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v1
14+
- uses: actions/setup-python@v2
15+
with:
16+
python-version: "3.x"
17+
- name: Install prerequisites
18+
run: |
19+
pip install mkdocs mkdocs-material mkdocs-git-revision-date-plugin
20+
- name: Build docs
21+
env:
22+
BOT_USER: ${{ secrets.BOT_INIT_USER }}
23+
BOT_MAIL: ${{ secrets.BOT_INIT_MAIL }}
24+
BOT_API: ${{ secrets.BOT_API_CALL }}
25+
GIT_SHA: ${{ env.GITHUB_SHA }}
26+
run: |
27+
chmod +x deploy.sh
28+
sh deploy.sh

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**/site
2+
**/target
3+
**/docbuilder/actions.json*

LICENSE

+427
Large diffs are not rendered by default.

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Source for Skytable docs
2+
3+
This repository contains the source code for the documentation hosted [here](https://docs.skytable.io).
4+
5+
## Contributing
6+
7+
The entire documentation website is available for everyone to improve (and reuse!).
8+
9+
If you want to improve an existing page, the best way to do it: is to click the pencil icon on a page that you want to edit. This will take you to the respective file where you can add what you want!
10+
11+
### Steps
12+
13+
1. Fork the repository
14+
2. Head over to the `docs` folder and change what you need to!
15+
3. Create a pull request [here](https://github.com/skytable/docs/pulls)
16+
4. One of the maintainers will respond almost immediately and suggest changes if required (usually they aren't needed - we know you're awesome 😉)
17+
5. Once your changes are approved - it will be merged 🎉
18+
6. Done! Thank you ❤️!
19+
20+
**Note:** The documentation for the "Actions" are automatically generated from [this file](https://github.com/terrabasedb/terrabase/blob/next/actions.jsonc), so if you have any concern regarding the documentation of any action, update the aforementioned file. Thank you 😃
21+
22+
## License
23+
24+
The entire documentation is licensed under the [CC-BY-SA-4.0 License](./LICENSE).

builddoc.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cd docbuilder && cargo run

deploy.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
cd ..
3+
git clone -b gh-pages https://github.com/skytable/docs.git ghp
4+
cd -
5+
mkdocs build
6+
rm -rf ../ghp/*
7+
mv site/* ../ghp/ -v
8+
cd ../ghp
9+
git checkout gh-pages
10+
git config --global user.email "$BOT_MAIL"
11+
git config --global user.name "$BOT_USER"
12+
C_USER=$(git show -s --format='%an' HEAD)
13+
C_MAIL=$(git show -s --format='%ae' HEAD)
14+
git add . && git commit -m "Deployed ${GITHUB_SHA}"
15+
eval '${BOT_API}'
16+
} >>/dev/null

docbuilder/Cargo.lock

+118
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docbuilder/Cargo.toml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[package]
2+
name = "docbuilder"
3+
version = "0.1.0"
4+
authors = ["Sayan Nandan <[email protected]>"]
5+
edition = "2018"
6+
7+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8+
9+
[dependencies]
10+
serde-hjson = "0.9.1"

docbuilder/src/main.rs

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
use serde_hjson::{self, Value};
2+
use std::cmp::Ordering;
3+
use std::io::prelude::*;
4+
use std::process;
5+
6+
#[derive(Debug)]
7+
/// A structure to represent a (ACTION_NAME, ACTION_DOC_MD_FILE)
8+
///
9+
/// The second file (`.1`) contains the entire documentation file for a given
10+
/// action
11+
struct Document(String, String);
12+
13+
impl PartialEq for Document {
14+
fn eq(&self, other: &Self) -> bool {
15+
self.0 == other.0
16+
}
17+
}
18+
19+
impl Eq for Document {}
20+
21+
impl PartialOrd for Document {
22+
fn partial_cmp(&self, other: &Document) -> std::option::Option<std::cmp::Ordering> {
23+
self.0.partial_cmp(&other.0)
24+
}
25+
}
26+
27+
impl Ord for Document {
28+
fn cmp(&self, other: &Self) -> Ordering {
29+
self.0.cmp(&other.0)
30+
}
31+
}
32+
33+
fn main() {
34+
let _dlfile = process::Command::new("wget")
35+
.arg("https://raw.githubusercontent.com/terrabasedb/terrabasedb/next/actions.jsonc")
36+
.output()
37+
.unwrap();
38+
let output = process::Command::new("cat")
39+
.arg("actions.jsonc")
40+
.output()
41+
.unwrap();
42+
let output = output.stdout;
43+
let _rmfile = process::Command::new("rm")
44+
.arg("actions.jsonc")
45+
.output()
46+
.unwrap();
47+
let json: Value =
48+
serde_hjson::from_str(&String::from_utf8_lossy(&output).to_owned().to_string()).unwrap();
49+
let json = json.as_array().unwrap();
50+
let mut actions = Vec::new();
51+
for val in json {
52+
let obj = val.as_object().unwrap();
53+
let name = obj.get("name").unwrap().to_string();
54+
let mut actionpage = String::new();
55+
actionpage.push_str(&format!("# {}\n", name));
56+
actionpage.push_str(&format!(
57+
"<ins>**Since**</ins>: {} \n",
58+
obj.get("since").unwrap()
59+
));
60+
actionpage.push_str(&format!(
61+
"<ins>**Time complexity**</ins>: {} \n",
62+
obj.get("complexity").unwrap()
63+
));
64+
actionpage.push_str(&format!(
65+
"<ins>**Arguments**</ins>: `{}` \n",
66+
obj.get("args").unwrap()
67+
));
68+
actionpage.push_str(&format!(
69+
"<ins>**Returns**</ins>: {} \n",
70+
obj.get("return").unwrap()
71+
));
72+
actionpage.push_str("\n");
73+
actionpage.push_str(&obj.get("desc").unwrap().to_string());
74+
actionpage.push('\n');
75+
actions.push(Document(name, actionpage));
76+
}
77+
actions.sort();
78+
create_docs(actions);
79+
}
80+
81+
fn create_docs(list: Vec<Document>) {
82+
let mut filetop = "# List Of Actions\n\n".to_owned();
83+
filetop.push_str("Skytable currently supports the following actions: \n\n");
84+
for action in list {
85+
let name = action.0;
86+
filetop.push_str(&format!("* [{}](Actions/{}.md)\n", &name, &name));
87+
let mut file = std::fs::File::create(format!("../docs/Actions/{}.md", name)).unwrap();
88+
file.write_all(&action.1.into_bytes()).unwrap();
89+
}
90+
let mut file = std::fs::File::create("../docs/Actions.md").unwrap();
91+
file.write_all(filetop.as_bytes()).unwrap();
92+
}

docs/01-Getting-Started.md

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Getting Started
2+
3+
<html>
4+
<img src="/img/runner_start.svg" style="height: 300px; width: 100%; ">
5+
</html>
6+
<br>
7+
<br>
8+
9+
Getting started with Skytable is easy 😊 (and fun!). You can get started with [native binaries (recommended)](#get-started-with-bundles) or by using the [docker image](#get-started-with-docker).
10+
11+
## Get started with bundles
12+
13+
### Step 1: Download a bundle
14+
15+
Head over to the [releases page](https://github.com/terrabasedb/terrabase/releases) and download the latest version for your platform.
16+
17+
### Step 2: Make the files runnable
18+
19+
Unzip the `zip` file that you just downloaded. If you're on a *nix system, run `chmod +x sdb skysh` to make the files executable. If you're on Windows, right-click the files and then check the `UNBLOCK` checkbox and click on the `APPLY` button.
20+
21+
### Step 3: Start the database server
22+
23+
In the directory where you extracted the files, run `./sdb` on *nix systems or simply `sdb` on Windows systems. That's all there is to starting the database server!
24+
25+
### Step 4: Run the shell `skysh`
26+
27+
`skysh` is the shell that is shipped with the bundle. Run it, just like you did with the database server. Now enter commands in the shell, and have fun! First run `HEYA` to check if everything is fine - the server should reply with _HEY!_.
28+
See all the available actions [here](/List-Of-Actions)
29+
30+
You're done with setting up `sdb` 🎉!
31+
32+
## Get started with Docker
33+
34+
First of all, you need to have Docker installed and available on your `PATH` ; you can read the official guide [here](https://docs.docker.com/get-docker/). Once you've got Docker up and running, follow the steps!
35+
36+
### Step 0: Create a container
37+
38+
Open up a terminal and run:
39+
40+
```
41+
docker create skybasedb/sdb --name skyvm
42+
```
43+
44+
> **NOTE:** You may need superuser priveleges
45+
46+
At the same time, you'll need to set up the bundle by following [Step 1](#step-1-download-a-bundle) and [Step 2](#step-2-make-the-files-runnable) from the previous section.
47+
48+
### Step 1: Start the container
49+
50+
Now run:
51+
52+
```
53+
docker start skyvm
54+
```
55+
56+
> **NOTE:** You may need superuser priveleges
57+
58+
### Step 2: Find the IP address of the container
59+
60+
In order to connect to the container (which, to `skysh` is nothing but a remote server), you'll have to run:
61+
62+
``` shell
63+
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' skyvm
64+
```
65+
66+
> **NOTE:** You may need superuser priveleges
67+
68+
And you'll get a result like:
69+
70+
``` text
71+
172.17.0.1
72+
```
73+
74+
### Step 3: Start the command line client
75+
76+
Open up a terminal in the directory where you downloaded the command line client and run:
77+
78+
``` shell
79+
skysh -h 172.17.0.1
80+
```
81+
82+
And you're done!

0 commit comments

Comments
 (0)