Skip to content

Commit cc616b5

Browse files
committed
Add installation and usage instructions to README.md for kuliya package
1 parent a9181f9 commit cc616b5

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

d/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
22

33
Algeria's college hierarchy dataset as a D package
44

5+
# Installation
6+
7+
You can use `kuliya` package with one of these 2 options:
8+
9+
1. Build it locally as it shown in [Get Started](#get-started) section then copy `kuliya.d` and `data.d` to your project.
10+
2. Use dub package manager in your DUB project by following these steps:
11+
- Add `kuliya` dependency to your `dub.json`:
12+
```json
13+
{
14+
"name": "sandbox",
15+
"dependencies": {
16+
"kuliya:d": "~>1.0.0"
17+
}
18+
}
19+
```
20+
- Run `dub build` to fetch and build the package.
21+
- Use the package in your project.
22+
23+
You can check the usage [here](#usage).
24+
525
# Prerequisites
626
- One of these compilers:
727
- [DMD](https://dlang.org/download.html#dmd) official compiler (works fine with dub)
@@ -26,6 +46,26 @@ cd d && dub test
2646
cd d/build && dub
2747
```
2848

49+
# Usage
50+
51+
```d
52+
import std.stdio;
53+
import kuliya;
54+
55+
void main()
56+
{
57+
auto res = getNodeByPath("umkb/fst/dee/sec");
58+
if (res is null)
59+
{
60+
writeln("Node not found");
61+
}
62+
else
63+
{
64+
writeln(res.name);
65+
}
66+
}
67+
```
68+
2969
# Contribute
3070

3171
Feel free to ask for help in [#kuliya](https://dzcode.slack.com/archives/C01C0155CKC) group chat

0 commit comments

Comments
 (0)