Skip to content

Commit 4860f0c

Browse files
committed
added a lot of documentation
1 parent eedae02 commit 4860f0c

File tree

7 files changed

+68
-4
lines changed

7 files changed

+68
-4
lines changed

dataherb/command.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def search(flora, id=None, keywords=None):
141141
@dataherb.command()
142142
@click.option("--flora", "-f", default=which_flora)
143143
@click.option("--workdir", "-w", default=WD, required=True)
144-
@click.option("--dev_addr", "-a", metavar="<IP:PORT>")
144+
@click.option("--dev_addr", "-a", default="localhost:52125", metavar="<IP:PORT>")
145145
@click.option("--recreate", "-r", default=False, required=False)
146146
def serve(flora, workdir, dev_addr, recreate):
147147
fl = Flora(flora=flora)
@@ -150,8 +150,8 @@ def serve(flora, workdir, dev_addr, recreate):
150150

151151
mkdocs_config = str(Path(workdir) / "serve" / "mkdocs.yml")
152152

153-
click.echo("Open http://localhost:8000")
154-
click.launch("http://localhost:8000")
153+
click.echo(f"Open http://{dev_addr}")
154+
click.launch(f"http://{dev_addr}")
155155
_serve(config_file=mkdocs_config, dev_addr=dev_addr)
156156

157157

docs/tutorials/create/index.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,4 +224,18 @@ Two things happened after this.
224224
]
225225
}
226226
}
227-
```
227+
```
228+
229+
230+
231+
### Sync to Remote
232+
233+
234+
!!! warning "WIP"
235+
Sync local dataset to remote is still a WIP.
236+
237+
238+
After creating the dataset, run the command `dataherb upload`.
239+
240+
!!! warning "Using Experimental Feature"
241+
Use `dataherb upload --experimental True` to use experimental feature. For example, git repo will automatically add, commit ,and push.

docs/tutorials/download/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## Download
2+
3+
Download dataset by dataherb id
4+
5+
```
6+
dataherb download git-dataherb-python-demo-dataset
7+
```
8+
9+
The dataset will be downloaded to the workdir set in the configuration step. The folder name will be the dataset id.

docs/tutorials/search/index.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## Search
2+
3+
4+
### Search by keyword
5+
6+
```bash
7+
dataherb search demo
8+
```
9+
10+
From the returns, we can find the dataset id which can be used to download the dataset.
11+
12+
For example, we find this `git-dataherb-python-demo-dataset` id as we just added this dataset in the creation step.
13+
14+
15+
### Search by ID
16+
17+
Search by dataherb id
18+
19+
```bash
20+
dataherb search -i covid19_eu_data
21+
```
22+
315 KB
Loading

docs/tutorials/serve/index.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Serve
2+
3+
!!! warning "WIP"
4+
5+
Though it works, we are still improving the UI.
6+
7+
8+
We can serve the whole flora as a website. To achive this, simple run
9+
10+
```bash
11+
dataherb serve
12+
```
13+
14+
This is an example. You can search for datasets using the search box.
15+
16+
![](assets/dataherb_serve_demo_dataset.png)

mkdocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ nav:
7777
- "Tutorials": tutorials/index.md
7878
- "Configuration": tutorials/configuration/index.md
7979
- "Create Dataset": tutorials/create/index.md
80+
- "Search Dataset": tutorials/search/index.md
81+
- "Download Dataset": tutorials/download/index.md
82+
- "Serve Flora": tutorials/serve/index.md
8083
- References:
8184
- "Introduction": references/index.md
8285
- "dataherb.command": references/command.md

0 commit comments

Comments
 (0)