Skip to content

Commit fb38f2c

Browse files
authored
Merge pull request #108 from dzcode-io/98-add-readmemd-for-d-package
Add installation and usage instructions to README.md for kuliya package
2 parents a9181f9 + 32a55db commit fb38f2c

2 files changed

Lines changed: 41 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ You can find more about each language by clicking on the language name
2121
| [C#](./csharp) | n/a | n/a | n/a | n/a |
2222
| [Rust](./rust) | WIP | WIP | WIP | n/a |
2323
| [C](./c) | ![](https://img.shields.io/conan/v/kuliya) | ![](https://github.com/dzcode-io/kuliya/actions/workflows/c-checks.yml/badge.svg) | WIP | n/a |
24-
| [D](./d) | WIP | WIP | WIP | n/a |
24+
| [D](./d) | ![DUB Version](https://img.shields.io/dub/v/kuliya) | ![](https://github.com/dzcode-io/kuliya/actions/workflows/d-checks.yml/badge.svg) | WIP | n/a |
2525

2626
## Contributing
2727

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)