Skip to content

Commit 4ab3361

Browse files
committed
Add Using Generated Bindings section
1 parent a55e696 commit 4ab3361

File tree

12 files changed

+154
-28
lines changed

12 files changed

+154
-28
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
target/
22
scripts/.coursier
33
scripts/.scalafmt-*
4+
/docs/_book/

build.sbt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,11 @@ lazy val tools = project in file("tools")
9191

9292
lazy val docs = project
9393
.in(file("docs"))
94-
.enablePlugins(ParadoxPlugin)
94+
.enablePlugins(GhpagesPlugin, ParadoxSitePlugin)
9595
.settings(
9696
paradoxTheme := Some(builtinParadoxTheme("generic")),
97-
paradoxProperties in Compile ++= Map(
97+
paradoxProperties in Paradox ++= Map(
9898
"github.base_url" -> "https://github.com/kornilova-l/scala-native-bindgen/tree/master/"
99-
)
99+
),
100+
git.remoteRepo := "[email protected]:kornilova-l/scala-native-bindgen.git"
100101
)

docs/src/main/paradox/obtaining-bindgen/index.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/src/main/paradox/command-line-usage/index.md renamed to docs/src/paradox/command-line-usage/index.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ scala-native-bindgen --name uv /usr/include/uv.h -- > uv.scala
1414

1515
## Bindgen Options
1616

17-
| Option | Description |
18-
|----------------------|--------------------------------------------------------------------------------------------------------------|
19-
| `--link` | Library to link with, e.g. `--link` uv for libuv. |
20-
| `--no-link` | Library is static and does not require linking. |
21-
| `--name` | Scala object name that contains bindings. If `--no-link` is specified then `name` should match library name. |
22-
| `--package` | Package name of generated Scala file. |
23-
| `--exclude-prefix` | Functions and unused typedefs will be removed if their names have given prefix. |
24-
| `--extra-arg` | Additional argument to append to the compiler command line. |
25-
| `--extra-arg-before` | Additional argument to prepend to the compiler command line. |
17+
| Option | Description |
18+
|----------------------|---------------------------------------------------------------------------------|
19+
| `--link` | Library to link with, e.g. `--link` uv for libuv. |
20+
| `--no-link` | Library does not require linking. |
21+
| `--name` | Scala object name that contains bindings. Default value set to library name. |
22+
| `--package` | Package name of generated Scala file. |
23+
| `--exclude-prefix` | Functions and unused typedefs will be removed if their names have given prefix. |
24+
| `--extra-arg` | Additional argument to append to the compiler command line. |
25+
| `--extra-arg-before` | Additional argument to prepend to the compiler command line. |

docs/src/main/paradox/index.md renamed to docs/src/paradox/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
@@@ index
44

5-
* [Obtaining bindgen](obtaining-bindgen/index.md)
6-
* [Usage](command-line-usage/index.md)
5+
* [Obtaining Bindgen](obtaining-bindgen/index.md)
6+
* [Command Line Usage](command-line-usage/index.md)
77
* [Limitations](limitations/index.md)
8+
* [Using Generated Bindings](using-generated-bindings/README.md)
89

910
@@@
1011

File renamed without changes.
File renamed without changes.
File renamed without changes.

docs/src/main/paradox/obtaining-bindgen/docker-container.md renamed to docs/src/paradox/obtaining-bindgen/docker-container.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ docker run -v "$(pwd)":/src -v /usr/include:/usr/include \
1818

1919
The docker image does not contain standard headers so it is important to
2020
mount all system include directories that are used by the header file
21-
passed to `scala-native-bindgen`. See the @github[docker-bindgen.sh](/scripts/docker-bindgen.sh) script for
22-
how to wrap the dockerized program. The `$CWD` of the container is
23-
`/src` which should be mounted from `$(pwd)` in case relative paths are
24-
used.
21+
passed to `scala-native-bindgen`.
22+
23+
See the [docker-bindgen.sh] script for how to wrap the dockerized program.
24+
The `$CWD` of the container is `/src` which should be mounted from `$(pwd)`
25+
in case relative paths are used.
2526

2627
Note, the `scalabindgen/scala-native-bindgen:latest` image is updated on
2728
each merge to the `master` branch.
2829

2930
[Docker]: https://www.docker.com/
31+
[docker-bindgen.sh]: https://github.com/kornilova-l/scala-native-bindgen/blob/master/scripts/docker-bindgen.sh
3032

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Obtaining Bindgen
2+
3+
@@@ index
4+
5+
* [Use Docker Container](docker-container.md)
6+
* [Build Binary with CMake](cmake.md)
7+
* [Build Binary with docker-compose](docker-compose.md)
8+
9+
@@@
10+
11+
There are 3 ways to obtain bindgen:
12+
13+
* @ref:[Use docker container](docker-container.md)
14+
15+
* @ref:[Build binary with CMake](cmake.md)
16+
17+
* @ref:[Build binary with docker-compose](docker-compose.md)

0 commit comments

Comments
 (0)