If you are looking for Dgraph documentation, you might find https://docs.dgraph.io much more readable.
We use Hugo for our documentation.
- Download and install hugo from here.
- From within the
wiki
folder, run the command below to get the theme.
cd themes && git clone https://github.com/dgraph-io/hugo-docs
- Run
./scripts/local.sh
from within thewiki
folder and gotohttp://localhost:1313
to see the Wiki.
We use ./scripts/local.sh
script to set env variables that our documentation theme internally uses.
Now you can make changes to the docs and see them being updated instantly thanks to Hugo.
- While running locally, the version selector does not work because you need to build the documentation and serve it behind a reverse proxy to have multiple versions.
Depending on what branch you are on, some code examples will dynamically change. For instance, go-grpc code examples will have different import path depending on branch name.
Pass custom Go-GRPC example to the runnable by passing a customExampleGoGRPC
to the runnable
shortcode.
{{< runnable
customExampleGoGRPC="this\nis\nan example"
>}}{
director(func:allofterms(name, "steven spielberg")) {
name@en
director.film (orderdesc: initial_release_date) {
name@en
initial_release_date
}
}
}
{{< /runnable >}}
We cannot pass multiline string as an argument to a shortcode. Therefore, we
have to make the whole custom example in a single line string by replacing newlines with \n
.