This repository contains the source files of the Arango documentation as published on docs.arango.ai.
The Arango documentation is licensed under Apache-2.0. See LICENSE for details.
To suggest a concrete change to the documentation, you may edit files directly on GitHub. It will fork the repository automatically if necessary. Commit the changes to a new branch, give it a succinct name, and open a pull request (PR).
To add more changes to a PR, click on the branch name below the headline
of the PR (the latter link of "<User> wants to merge <n> commits
into main from branch-name"). Then locate and edit the next file.
Commit the changes directly to your PR branch.
For general suggestions, feel free to create an issue.
In every pull request, the arangodb-docs-automation bot comments with a deploy preview link. Whenever you push a change to the PR branch, a preview is built. If it succeeds, then you can view the preview hosted on Netlify by following the link.
Note that the automatic previews run plain builds, which means that generated content is not updated. The Arango documentation team takes of regenerating this content if necessary.
To accept external contributions, we need you to fill out and sign our Contributor License Agreement (CLA):
You can scan and email the CLA PDF file to cla@arango.ai or send it via fax to +49-221-2722999-88.
The following section describes how you can build the documentation locally. This is not strictly necessary when contributing. You can also rely on automatic previews for basic changes.
At the core, docs are generated with the static site generator
Hugo. The hugo build command generates static HTML
content from the Markdown, data, and theme files.
The documentation toolchain is containerized and uses Docker Compose to orchestrate builds. The following containers are created:
toolchain- contains the code for controlling the toolchain and the generated content, spawning the other containersdocs_arangoproxy- contains the arangoproxy web server written in Go that handles generated content using arangosh to run examples against a server and assemble the OpenAPI descriptionsdocs_site- contains Hugo and the logic to start itdocs_server_<version>- an ArangoDB single serverdocs_server_<version>_cluster- an ArangoDB clusterdocs_client_<version>- the ArangoDB client tools (arangoshetc.), only for versions with separate server and client tools images (4.x). Otherwise, the client tools run in thedocs_server_<version>container
-
Hugo: Change
HUGO_VERSIONintoolchain/docker/Dockerfileto the desired release of https://github.com/gohugoio/hugo/releases and rebuild the images with thecreate-docs-images-amd64andcreate-docs-images-arm64CircleCI workflows (see CIRCLECI.md). Check the release notes for breaking changes and test a build locally first (see below). -
Testing image changes locally: The compose files and the toolchain use the images by name, so build them with the official names to replace your local copies. Changes to the
Dockerfilecan affect all three images (the stageshugo,arangoproxy, andtoolchain), so rebuild all of them, e.g. in thetoolchain/dockerfolder (usearm64on ARM):docker build --target hugo -t arangodb/docs-hugo:site-amd64 . docker build --target arangoproxy -t arangodb/docs-hugo:arangoproxy-amd64 . docker build --target toolchain -t arangodb/docs-hugo:toolchain-amd64 .
Then run a plain build and an example generation. To go back to the published images, pull them again (e.g.
docker pull arangodb/docs-hugo:site-amd64). -
Go modules of arangoproxy: arangoproxy is compiled from the source code in the repository when its container starts, so updating the modules doesn't require new images:
cd toolchain/arangoproxy go get -u ./... # all modules, or e.g. go get -u github.com/dlclark/regexp2 go mod tidy go mod vendor go build ./... && go test ./...
Commit the changes to
go.mod,go.sum, andvendor/. If you raise thegoversion ingo.mod, rebuild the images to get a matching Go toolchain. -
Everything else (Alpine packages, Go, yq, oasisctl) uses the latest versions at the time the images are built. Rebuild the images regularly to get security updates.
For headlines, links, images, and fenced code blocks in Markdown, Hugo can run template files that are called Render Hooks to trigger special processing. This is used to extract and execute examples against actual ArangoDB servers and place the output into the rendered documentation, for example.
-
Heading render hook
Defined in
site/themes/arangodb-docs-theme/layouts/_default/_markup/render-heading.htmlChecks that there is no level 1
# Headlinein the content, as this is reserved for thetitledefined in the front matter. Also injects the widget to copy anchor links to the clipboard. -
Link render hook
Defined in
site/themes/arangodb-docs-theme/layouts/_default/_markup/render-link.htmlScans all the hrefs in a file and tries to retrieve the page from that link. If the page is not found, the build fails because of a broken link.
-
Image render hook
Defined in
site/themes/arangodb-docs-theme/layouts/_default/_markup/render-image.htmlTransforms the style attributes defined in the image link as
{path.png?{attribute1=value1&attribute2=value2&..}}in a style attribute inside theimgHTML tag. -
Codeblock render hook
Defined in
site/themes/arangodb-docs-theme/layouts/_default/_markup/render-codeblock-*.htmlTriggers a remote call to the arangoproxy web server for assembling the OpenAPI descriptions as well as to run the example generation if the code starts with a front matter block surrounded by
---, like this:```aql --- name: the_answer description: AQL block with front matter --- RETURN 42 ```
The following codeblocks are supported:
```jsfor arangosh / JavaScript API examples```aqlfor AQL query examples```openapifor HTTP API descriptions```curlfor HTTP API examples
There is also a
```mermaidcodeblock for Diagrams that does not involve arangoproxy at all.
The hooks trigger a POST call to the dedicated arangoproxy endpoint
(/js, /aql, /curl, openapi) with the entire codeblock as request body.
The arangoproxy endpoint parses the request, checks if the examples is cached, otherwise executes the code against the ArangoDB instance with the version as determined from the version folder name and saves the example output in the cache.
The input/output (as defined in the YAML render option) is returned as JSON to Hugo in the render hook, which generates HTML replacing the codeblock in the file with the input/output of the example.
The following build workflows exist:
-
Plain build workflow
Build docs without re-generating examples (using a committed cache file).
Includes the assembly of the HTTP API descriptions (OpenAPI) with validation at each run.
```curlexamples require a different workflow.You may need to specify upstream branches.
-
Scheduled workflow
The following generated content is re-generated periodically using CircleCI:
- Metrics
- Error codes and meanings
- AQL optimizer rules
- Startup options
- oasisctl documentation
-
Example generation workflow
Build docs including re-generating examples for AQL, arangosh (JavaScript API), and cURL (HTTP API).
Specifying upstream branches is required for all versions in which you modified example code and thus require a re-generation. These can be a Docker Hub images or GitHub pull request links.
Go to the toolchain/docker/<architecture> folder, with <architecture> being
either amd64 for x86-64 CPUs and arm64 for 64-bit ARM CPUs (including
Apple silicon like M1).
Run the docker compose services using the docker-compose.plain-build.yml file.
docs-hugo/toolchain/docker/amd64> docker compose -f docker-compose.plain-build.yml up --exit-code-from site-frontend--exit-code-from site-frontend stops the arangoproxy service when the site
service exits and returns its exit code (for static builds, see below). A live
server runs until you press Ctrl+C.
The site will be available at http://localhost:1313.
The stable and devel paths are second mounts of the version folders they
point to (see module.mounts in site/config/_default/config.yaml). When you
edit a file in one of these folders, the live server only rebuilds the page
under the alias path. For example, if stable is 3.12, an edit to
site/content/arangodb/3.12/aql/_index.md shows up at
http://localhost:1313/arangodb/stable/aql/ but not at
http://localhost:1313/arangodb/3.12/aql/, which keeps the old content until
you restart the server. Preview such changes under the alias path. Static builds
render both paths correctly.
To make the documentation tooling not start a live server in watch mode but
rather create a static build and exit, set the environment variable ENV to
any value other than local before calling docker compose ...:
export ENV=static # Bash
set -xg ENV static # Fish
$Env:ENV='static' # PowerShellThe output files will be written to site/public/.
You can additionally set the HUGO_URL environment variable to
https://docs.arango.ai/ to create a production-like build that
includes Google Analytics etc.
Browser tests with Playwright check the
functionality of the built site, like the navigation, version selector, copy
buttons, tabs, tables, details boxes, image viewer, and keyboard access, in Chromium, Firefox, and WebKit on desktop and
mobile viewports. They are in toolchain/frontend-tests/.
CircleCI runs them before deploying a release, after scheduled and example
generation builds, and after plain builds if the changes compared to main
touch the theme, site configuration, static files, versions, the tests, or the
CircleCI configuration (in parallel to the deploy preview).
To run them locally, create a static build first (see Plain build
with ENV=static) so that site/public/ exists. Then install the dependencies
and browsers once, and run the tests:
cd toolchain/frontend-tests
npm ci
npx playwright install chromium firefox # add webkit if your system supports it
npx playwright test --project chromium --project mobile-chromium --project firefoxThe tests serve site/public/ themselves. You can test another build with
SITE_DIR=path/to/public or a deployed site, like a deploy preview, with
BASE_URL:
BASE_URL=https://deploy-preview-1234--docs-hugo.netlify.app npx playwright testTo run all browsers including WebKit, which doesn't run natively on every Linux
distribution, use the same Docker image as CircleCI. Arguments are passed to
playwright test:
toolchain/frontend-tests/run-in-docker.sh
toolchain/frontend-tests/run-in-docker.sh --project webkit -g "version selector"After a run, npm run report opens the report with screenshots and traces of
failed tests, and npx playwright test --ui lets you run and debug tests
interactively. For writing tests and updating Playwright, see
toolchain/frontend-tests/README.md.
Configuration
The toolchain is configured with environment variables:
GENERATORS: the generators to run as a space-separated string (see below). All generators run if it is empty.ARANGODB_BRANCH_{VERSION}: the ArangoDB Docker image to use for a docs version, for example,arangodb/enterprise-preview:3.12-nightly,arangodb/core-preview:devel-nightly, orarangodb/enterprise:3.12.9(Docker Hub if no registry is given, other registries likegcr.io/gcr-for-testing/arangodb/core-preview:devel-nightlywork, too), or the absolute path of a local build (see Local builds below). It can also be a branch name of thearangodb/arangodbrepository if an image was built for it (see CIRCLECI.md): the toolchain then uses the image of the commits checked out inARANGODB_SRC_{VERSION}(including itsenterprisefolder), named as configured in.circleci/upstream.yaml. No server is started for a version if it is empty, and its content is not regenerated.ARANGODB_SRC_{VERSION}: the absolute path to a working copy of thearangodb/arangodbrepository. Required for themetrics,error-codes, andexit-codesgenerators. Don't use~for your home folder in the.envfile or in quotes, it isn't expanded there.ARANGODB_STARTER: the absolute path of an ArangoDB Starter executable for the cluster of local builds (see Local builds below). Optional.EXAMPLES_SCOPE:changedto only run the examples of pages that have changed or new examples, and to show the saved output for all other pages, orallto run all examples. The default ischangedfor local builds andallin CI.OVERRIDEimpliesall.OVERRIDE: only save the output of the examples that match these comma-separated regular expressions, whether the example code changed or not. They are matched against the example name (e.g.HttpGharialCreate) and the name of the cache entry (e.g.HttpGharialCreate_single). The output of other new and changed examples isn't saved. A regular expression that matches no example is reported as a warning. Without it, only the output of new examples and of examples whose code changed is saved tosite/data/<version>/cache.json, regardless of the scope (see Saved example output and previews). It only applies to the current run and isn't saved to the.envfile (see below).
Substitute {VERSION} with the docs version in uppercase and with underscores,
like 3_12 for 3.12 and 4_X for 4.x. There is one setting per docs version,
so you can use one server per version.
# Bash
export GENERATORS="examples options optimizer"
export ARANGODB_BRANCH_3_12="arangodb/enterprise:3.12.9"
export ARANGODB_SRC_3_12="path/to/arangodb"
export ARANGODB_BRANCH_4_X="arangodb/core-preview:devel-nightly"
export ARANGODB_SRC_4_X="path/to/arangodb2"# Fish
set -xg GENERATORS "examples options optimizer"
set -xg ARANGODB_BRANCH_4_X arangodb/core-preview:devel-nightlyOn Windows using PowerShell, use a Unix-like path:
$Env:ARANGODB_SRC_{VERSION} = "/Drive/path/to/arangodb"A local run saves the settings to a .env file next to the compose file
(e.g. toolchain/docker/amd64/.env), which docker compose reads by default.
This means that you only need to specify the settings once. Subsequent runs use
the saved settings unless you set the environment variables to different values.
Set a variable to an empty string to clear a saved setting, for example, to no
longer start a server for a version:
ARANGODB_BRANCH_3_12= docker compose up # Bash and FishYou can also edit the .env file directly. It isn't committed to the repository.
Exceptions are OVERRIDE, HUGO_URL, HUGO_ENV, and ENV: they only apply to
the run you set them for and aren't saved, so that, for example, OVERRIDE=".*"
doesn't save the output of all examples again in every later run. Set them in
the shell, not in the .env file: each run rewrites the file with the saved
settings only, so these variables would only take effect once. Variables that
you export (Bash) or set -x (Fish) stay set for the rest of the shell
session, unset them afterwards (unset OVERRIDE or set -e OVERRIDE), or set
them for a single command:
OVERRIDE=".*" docker compose up # Bash and FishStarting with 4.x, the server (arangod, without V8) and the client tools
(including arangosh) are in separate images, for example,
arangodb/core-preview:devel-nightly and arangodb/client-tools-preview:devel-nightly.
Only specify the server image (core/core-preview). The toolchain derives the
matching client tools image (client-tools/client-tools-preview in the same
registry, with the same tag; generally, a repository name core or core-<suffix>
becomes client-tools or client-tools-<suffix>), pulls it if necessary, and runs
arangosh and the other client tools in a separate container. For images that bundle the server and the client tools
(like arangodb/enterprise:3.12.9), the client tools run in the server container.
The nightly images are built from the arangodb/arangodb branches that the docs
versions are based on:
| Docs version | Branch | Nightly image |
|---|---|---|
| 4.x | devel |
arangodb/core-preview:devel-nightly (also tagged 4.0-nightly) with arangodb/client-tools-preview:devel-nightly |
| 3.12 | 3.12 |
arangodb/enterprise-preview:3.12-nightly |
| 3.11 | 3.11 |
None, use release images or build images (see CIRCLECI.md) |
devel is where the 4.0 development happens. It used to be the 3.12 development
branch, so arangodb/enterprise-preview:devel-nightly is an outdated 3.12 image
that is no longer updated. Use arangodb/enterprise-preview:3.12-nightly for 3.12
instead. The toolchain checks that the version of the server in an image matches
the docs version and aborts if not (e.g. a 3.12 image for 4.x).
Images that exist locally are used as they are, otherwise the toolchain pulls them. To get the latest build of an image with a tag that is updated regularly, like the nightly images, pull it manually before running the toolchain. For versions with separate server and client tools images, pull both:
docker pull arangodb/core-preview:devel-nightly
docker pull arangodb/client-tools-preview:devel-nightlyThe same applies to the images of the toolchain itself
(arangodb/docs-hugo:toolchain-amd64, arangodb/docs-hugo:site-amd64,
arangodb/docs-hugo:arangoproxy-amd64, or -arm64). CI always pulls the latest
images. When someone publishes new toolchain images (e.g. with a new Hugo
version), everyone else keeps using their older local images until they pull the
new ones. Content that relies on the changes may then fail to build locally, so
pull the toolchain images after such updates:
docker pull arangodb/docs-hugo:toolchain-amd64
docker pull arangodb/docs-hugo:site-amd64
docker pull arangodb/docs-hugo:arangoproxy-amd64Local builds
Instead of an image, you can set ARANGODB_BRANCH_{VERSION} to the absolute path
of a local build directory of ArangoDB, for example,
/path/to/arangodb/build-presets/nightly-package-x64. The toolchain runs the
arangod, arangosh, and other executables of this build, without creating an
image. It uses the JavaScript files of the source tree from
ARANGODB_SRC_{VERSION}, or of the working copy that contains the build
directory if it isn't set. Its version should be the same as the one of the
build: the JavaScript code of another patch version can be incompatible with the
executables, and the toolchain warns about it.
- Only static builds are supported, like the ones of the CMake presets except the
sanitizer presets (
*-tsan,*-alubsan). Builds of the official build container (e.g.arangodb/ubuntubuildarangodb-devel) work, too. - The version of the build needs to match the docs version and the version of the source tree (major and minor version).
- Up to 3.12, the servers need V8 for server-side JavaScript, so don't use the
*-no-v8presets of 3.12. 4.x is V8-free: onlyarangoshuses JavaScript, and the presets don't have such variants. - Prefer release-like presets like
nightly-package-x64orpr-non-maintainer-x64. Developer builds with maintainer mode and assertions (e.g. thedeveloper-x64preset) work, but the example output can differ from release builds, so don't commit it. The toolchain warns about such builds. - Don't rebuild or switch branches in the source tree while the toolchain runs, as the files are used directly.
The executables run in containers of the toolchain image. Two executables that the
official images include are missing in builds: the ArangoDB Starter (for the
cluster) and rclone-arangodb (for hot backup uploads and downloads). The
toolchain uses the versions that the source tree specifies (STARTER_REV and
RCLONE_* in the VERSIONS file), like the official images. It downloads them
from GitHub once (verifying the checksum of rclone-arangodb) and keeps them in
the docs_local_tools Docker volume, so subsequent runs work offline. If a
download fails (e.g. no internet connection), it uses another version that is
available locally (downloaded before, or from a locally available arangodb/core,
arangodb/enterprise, or -preview image) and warns about the version mismatch.
To use a specific Starter executable instead, e.g. a self-compiled one, set
ARANGODB_STARTER to its absolute path. Note that compiling the Starter
requires an internet connection unless the Go modules are already cached, because
its repository doesn't include the dependencies.
Available generators
examplesmetricserror-codesexit-codesoptimizeroptionsoasisctl
Run the toolchain
Go to the toolchain/docker/<architecture> folder, with <architecture> being
either amd64 for x86-64 CPUs and arm64 for 64-bit ARM CPUs (including
Apple silicon like M1).
Run the docker compose services without specifying a file:
docs-hugo/toolchain/docker/arm64> docker compose upThe site will be available at http://localhost:1313
To stop the toolchain, press Ctrl+C once or run
docker compose down in the same folder. This also removes the containers that
the toolchain started (servers, arangoproxy, site). If an error occurs, the
toolchain keeps all containers running so that you can inspect them (e.g. their
logs with docker logs docs_server_4.x) until you stop it. If you force-stop it, the
containers keep running until the next toolchain run removes them. They can
block the port of a subsequent plain build, for instance. You can remove them
with docker ps -aq --filter name=docs_ | xargs docker rm -f.
In the site/content directory, the directories 3.10, 3.11 etc. represent
the individual ArangoDB versions and their documentation. There is only one
maintained version of the documentation for every minor and major version (3.12,
4.x, etc.) but not for every patch release (e.g. 3.12.1).
Having a folder per version has the advantage that all versions can be built at once, but the drawback of Git cherry-picking not being available and therefore requiring to manually apply changes to different versions as necessary.
site/- Folder with all files that Hugo needs to generate the siteconfig/- The base Hugo configuration in_default/as well as additional configurations for different build workflowscontent/- The Markdown source files in version folders as well as a shared folder for imagesdata/- Contains JSON and YAML files for the documentation versions, the OpenAPI tag lists, the example cache, etc. See OpenAPI configuration and code block options forversions.yaml(e.g.allowedAPIVersions) andopenapi_services.yaml.public/- Default output directory for the generated site (not committed)resources/- Holds the various cached resources that are generated by Hugo when usinghugo servethemes/- Folder for Hugo themes, containing the customized Arango docs theme
toolchain/- Folder for the docs toolchain tools and scriptsarangoproxy/- Source code of the arangoproxy web serverdocker/- The Docker container and compose files, with two sets of configurations for theamd64andarm64architectures that are needed for the scheduled and example generation build workflowsscripts/- The toolchain scripts
The documentation is written in the light-weight markup language Markdown, using the GitHub flavor, and further extended by Hugo shortcodes for advanced templating needs.
For an overview over the basic markup, see the CommonMark help.
The following extensions are available:
You can use admonitions for hints and callouts that render in a colored box with an icon, highlighting useful or important information.
{{< danger >}}
Critical information to prevent data loss or similarly impactful events.
{{< /danger >}}{{< warning >}}
Be careful and mind restrictions to avoid issues.
{{< /warning >}}{{< security >}}
Mind this information to keep the system and your data safe.
{{< /security >}}{{< info >}}
Helpful information to have.
{{< /info >}}{{< tip >}}
Follow best practices and utilize features to set yourself up for success.
{{< /tip >}}Admonitions can also be used in description fields inside of ```openapi
code blocks but the syntax then needs to be like this:
```openapi
paths:
/_api/endpoint:
post:
description: |
{{</* warning */>}}
Admonition inside of HTTP API description.
{{</* /warning */>}}
...
```For the OpenAPI JSON output, this is rendered as > **WARNING:** ...
(a blockquote with the admonition type in bold and uppercase).
Only a single paragraph is properly supported by the toolchain. Additional
paragraphs will not be part of the blockquote.
Admonitions inside of other shortcodes need to use the special syntax, too:
{{< details summary="Outer shortcode" >}}
{{</* tip */>}}
Inner shortcode
{{</* /tip */>}}
{{< /details >}}Pages of a section can be grouped under a non-clickable label in the sidebar
by setting group in their front matter:
---
title: Architecture
menuTitle: Architecture
group: Overview
weight: 5
---The label is printed once whenever the group value changes while the pages
of a section are rendered in weight order, so the pages of a group have to be
contiguous by weight. Use a weight band per group (for example 100 to 199 for
the first group, 200 to 299 for the second) to keep it that way. Pages without
group are listed without a label. Within one section, either every page
sets group or none does, and the pages of a group have to be adjacent by
weight; the build fails with an error if either rule is broken, so a page
cannot end up under a label by accident. The Contextual Data Platform section uses
the labels Overview, Install, Build, Query & explore, Develop & extend,
Operate, and Reference.
Tags let you display badges, usually below a headline.
This is mainly used for pointing out if a feature is only available in the Agentic AI Suite, the Contextual Data Platform, the Arango Managed Platform (AMP), or multiple of them. See Environment remarks for details.
It is also used for Edition remarks in content before version 3.12.5.
Display content with a tabbed interface, like for code examples using different languages or if there are multiple ways of achieving a goal like configuring ArangoDB.
{{< tabs "startup-options" >}}
{{< tab "Command-line" >}}
Start _arangod_ with the startup option `--log.level startup=trace`.
{{< /tab >}}
{{< tab "Configuration file" >}}
Include the following startup option setting in your `arangod.conf`:
```cfg
[log]
level = startup=trace
```
{{< /tab >}}
{{< /tabs >}}The parameter for the tabs shortcode is a group identifier. If there are
multiple tab groups in one page, changing the active tab of one of them also
changes the active tabs of all other groups with the same identifier while
groups with different identifiers are unaffected. The browser remembers the last
active tab of each group.
The parameter for the tab shortcode is the label to display for the tab in the
tab panel. Tab groups using the same identifier should use the same tab labels.
Use the native Markdown syntax for including images, using a relative file path:
If you need more control over the styling of a specific image, you can use the
image shortcode:
{{< image src="../images/file.png" alt="Description" class="inline-img" style="max-height: 50vh" >}}Available attributes:
src: location of the image filealt: image description for accessibilityclass: CSS classes to applystyle: CSS inline styles to apply
The main content column is only about 800 pixels wide. Wider images are scaled down to fit, which can make text and other details illegible. Keep the following in mind when taking screenshots of web interfaces:
- Avoid wide screenshots: Don't capture an entire browser window with an extreme aspect ratio, like a maximized window on an ultra-wide display.
- Zoom the page: Even with a normal aspect ratio, text can end up too small after scaling. Zoom in on the page, e.g. to 150% or 175%, rather than making the browser window smaller. This results in a higher-resolution screenshot that stays sharp.
- Don't zoom in too much: Excessive zoom levels can break the page layout or make the interface look worse than it does under normal conditions, like by causing excessive text wrapping.
- Capture only what is relevant: It is often best to screenshot only the part of the interface that the surrounding documentation is about instead of the entire viewport. Don't include the address bar or other browser chrome, and no artificial effects like drop shadows around the window.
- Prepare the content: Set up the content in the interface so that it looks tidy and representative, e.g. with meaningful names and example data.
- Touch up the page: You can use the browser's developer tools to edit the page before taking a screenshot, like changing text or removing elements in the border areas that are not relevant for what should be shown.
When adding or updating images, the files should be reduced in size as much as possible before merging to the main branch. This helps to keep the Git history small and images load faster over the internet.
Squoosh is a web app to easily re-compress images with various options to reduce the file size.
- It runs the compression locally in your browser.
- You can visually inspect how the options affect the output quality.
There is a modified version that adds batch processing so you can apply the same compression to multiple files in one go:
https://squoosh-multiple-export.vercel.app
- Open the web app and drop one or multiple image files.
- Adjust the options in the bottom-right panel (see below).
- Check that the compression doesn't cause too strong visual artifacts like color banding, color shifts, hard-to-read text, and so on. You can switch between input images using the dropdown menu at the bottom center.
- Click the Download All # Files button below the options panel to download them all at once.
- The file names are preserved, so you can paste the re-compressed files over the original files to replace them.
Suggested options:
- Reduce palette, typically
64colors is enough for screenshots. - Dithering, can be left at
1to make up for the reduced color palette. - OxiPNG as the compressor (if the input is also PNG)
If a web interface uses icons, especially as buttons without labels, use
the icon shortcode to inline an SVG file for a visual reference as
demonstrated below:
Select all nodes ({{< icon "select-all" >}}), then right-click.Icons are supposed to supplement the text, i.e. not be embedded in sentences. They are hidden from screen readers.
To add new icons to the toolchain, save them to site/content/images/icons/.
They are referenced by file name (without extension) in the shortcode.
SVG icon files should not define the attributes width, height, aria-hidden,
and focusable on the <svg> tag.
To embed an SVG inline (so its text, shapes, and links remain part of the page
DOM and stay clickable), use the embed-svg shortcode:
{{< embed-svg "Platform-Architecture" >}}{{< embed-svg "Platform-Architecture" "Click a component to learn more." >}}Positional parameters:
- The SVG file name without extension, resolved against
site/content/images/. For{{< embed-svg "Platform-Architecture" >}}, the toolchain readssite/content/images/Platform-Architecture.svg. - An optional caption rendered below the figure. Markdown is supported.
Defaults to
Click a component to learn more.Pass an empty string ("") to suppress the default text.
Unlike the image shortcode (which emits an <img> tag), embed-svg inlines
the file contents with readFile and safeHTML, which means:
- Links inside the SVG are clickable in the rendered page.
- Text inside the SVG is selectable and indexable.
- CSS classes set on SVG elements can be styled from the theme stylesheet.
The build fails with an errorf if the named SVG cannot be found.
Links live inside the SVG file itself, not in the shortcode call. To make a
shape or label clickable, wrap it in an SVG <a> element with an xlink:href
attribute:
<a class="card-link" xlink:href="/arangodb/4.x/develop/http-api/">
<rect x="340" y="145" width="220" height="72" rx="10" class="node" .../>
<text x="450" y="174" ...>Envoy</text>
</a>To change where an existing block links to, open the SVG under
site/content/images/, find the <a ... xlink:href="..."> that wraps the
block, and edit the xlink:href value.
Conventions used in the existing diagrams:
- Internal docs links use an absolute path, e.g.
/arangodb/4.x/deploy/cluster/or/contextual-data-platform/container-manager/. - External links use a full URL and add
target="_blank", e.g.<a xlink:href="https://kubernetes.io/" target="_blank">. - Use
class="card-link"on the<a>tag so the link picks up the shared hover styling defined in the theme.
Every link in an embedded SVG is a tab stop, and screen readers announce it by its text. Keep the following in mind so that diagrams work without a mouse:
-
Document order: The order of the
<a>elements in the file is the order in which they are focused and read. Arrange them like the layout, top to bottom and left to right, and the link of a container (like the title of a box) before the links inside of it. Later elements are drawn on top of earlier ones, so a container's own shapes still come first. -
Link text: Put the visible
<text>inside the<a>. A link around a transparent shape without text has no name for screen readers. -
Few duplicates: Each link is a stop when tabbing. Avoid many links to the same page in a row.
-
Scoped styles: The
<style>element of an SVG applies to the whole page once inlined. Scope all rules with a class on the SVG's top-level group, like.cdp-arch .card-link { ... }. -
Focus state: Apply hover styles on keyboard focus, too:
.arch .card-link:is(:hover, :focus-visible) .node { fill: #1f5c38; }
-
Focus ring color: The theme draws a 2px focus ring in the color of the
--focus-ringcustom property, dark teal by default. It is hardly visible on dark backgrounds. Set the property to the lime of the theme for the links there, and only there, for example with a class:.arch .on-dark { --focus-ring: #befe99; }
Where a ring is still easy to miss, like around a large box among other green borders, change the border of the focused shape, too (
.arch .on-dark:focus-visible > rect { stroke: #befe99; stroke-width: 3; }). -
Room for the ring: The ring is a rectangle around the bounding box of the link, 3px outside of it. Leave at least 10px between links that are next to each other, as the ring of the earlier link is otherwise drawn below the later one.
-
Ring inside a shape: For links that fill a box edge to edge, like a title strip, the ring would cover the box border. Firefox ignores a negative
outline-offsetin SVGs, so draw a shape inside the link instead, withoutline: nonefor the link and a stroke for the shape on focus. See thetitle-focuspaths inArango-Contextual-Data-Platform-Overview.svg. -
Shapes within borders: Draw fills that adjoin a border (like a title strip in a box) inside the border, inset by its stroke width, so that they don't show through or overlap it.
Check diagrams by tabbing through them in Chrome and Firefox, on the page and in the image viewer (Enlarge), which pans to the focused link.
For flowcharts and similar schematics that you want to maintain as text instead
of as an image file, use a fenced mermaid codeblock:
```mermaid
flowchart LR
A([Start]) --> B["Do the work"] --> C([Done])
```For the available diagram types and their syntax, see the Mermaid documentation.
Unlike the other codeblock render hooks, mermaid blocks are not sent to
arangoproxy. The hook only wraps the block in a <pre class="mermaid">
element, and theme.js renders it in the browser using the Mermaid version
pinned there. A diagram with a syntax error therefore does not fail the build.
Mermaid draws an error graphic in place of the diagram and logs a warning to the
browser console instead, so always check diagrams in the preview.
Each diagram is rendered into a box of a fixed height and can be panned and zoomed:
- Drag the diagram to pan it. Dragging continues while the pointer is outside the box, but a diagram cannot be moved out of view entirely.
- Use the mouse wheel or the
+and-buttons to zoom, andRESETto fit the diagram into the box again.
The relevant files are the hook
site/themes/arangodb-docs-theme/layouts/_default/_markup/render-codeblock-mermaid.html,
the rendering and pan/zoom setup in static/js/theme.js, and the pre.mermaid
rules in static/css/theme.css.
Labels in Mermaid are plain text by default, so ["**Execute**"] renders the
asterisks literally. To use Markdown in a label, wrap the label text in
backticks inside the quotes:
```mermaid
flowchart TD
A([Request received]) --> B["`**Execute**
Runs query by calling
<code>POST /_api/cursor</code>`"]
```In such a label, a line break in the source becomes a line break in the label and the indentation of continuation lines is stripped. Two subsequent line breaks are an exception: they wrap the text like a single line break but keep the indentation, because Mermaid starts a new paragraph (rendered without any extra spacing) instead of continuing the current one.
Plain labels support line breaks in the source as well, but keep the indentation
of continuation lines as a leading space, and two subsequent line breaks create
an empty line. <br> works in both kinds of labels. The \n escape sequence
only works in plain labels — a Markdown label renders it literally.
For inline code, use <code>. You cannot use backticks in a Markdown label as
that is a syntax error.
To document hotkeys and key combinations to press in a terminal or graphical
user interface, use the kbd shortcode:
Press {{< kbd "Ctrl Return" >}} respectively {{< kbd "Cmd Return" >}} to run the query.To prominently link to other content, you may use cards:
{{< cards >}}
{{% card title="Graphs" link="graphs/" %}}
Learn everything about graphs.
{{% /card %}}
{{% card title="Data science" link="data-science/" icon="graph.svg" %}}
Read about ArangoDB's features for analytics.
{{% /card %}}
{{< /cards >}}The cards are shown in as many columns as fit. The optional icon is the file
name of an image in site/content/images/, shown at 48 × 48 pixels.
To lay out a sequence of instructions as a numbered, visually separated list,
use the steps shortcode with a nested step shortcode for each step:
{{< steps >}}
{{< step title="Install the package" >}}
Download and install the package for your platform.
{{< /step >}}
{{< step title="Start the server" >}}
Run the following command:
```sh
arangod --server.endpoint http://0.0.0.0:8529
```
{{< /step >}}
{{< /steps >}}Each step is automatically numbered in the order it appears. The content
between the step tags can be any Markdown, including code blocks, admonitions,
and other shortcodes.
Available parameters for the step shortcode:
title: the title of the step, which can also be passed as the first positional parameter. Supports inline Markdown.icon: an optional icon to display instead of the step number, referenced by file name like theiconshortcode (e.g.icon="download"). The name must consist of lowercase letters, digits, and hyphens only.id: an optionalidattribute for the step's HTML element so you can link to a specific step with an anchor, e.g.id="start-the-server".
Available parameter for the steps shortcode:
titleSize: the HTML element to use for the step titles. Defaults top(a styled paragraph). Set it to a heading level fromh2toh6if the step titles should be semantic headings, e.g.{{< steps titleSize="h3" >}}.
The build fails with an error if an invalid titleSize (anything other than
p or h2 to h6) or an invalid icon name is used.
If you want to place a remark in the source files that should not end up in the generated output, you can use a comment as follows:
{{< comment >}}
Content or reminder that should not be rendered.
{{< /comment >}}You can display endpoint URLs of HTTP APIs with some formatting to make them look neater:
{{< endpoint "METHOD" "https://<PLACEHOLDER>:8529/path/{PARAM}/action">}}Available positional parameters:
-
The HTTP method. Possible values:
HEAD,GET,POST,PATCH,PUT,DELETE, or empty string ("") to omit the method. -
The URL, which can include the protocol, host, port, path, and query parameters.
You can wrap path parameters that the user is supposed to fill in with curly braces, e.g.
{GRAPH_ID}. This is rendered as:GRAPH_IDfor compatibility with tools like Postman and it is highlighted to make it visually distinct from static parts of the URL.You can wrap any other placeholders that the user is supposed to substitute in angled brackets, e.g.
<EXTERNAL_ENDPOINT>. This is rendered verbatim and it is highlighted to make it visually distinct from static parts of the URL.
The following shortcodes also exist but are rarely used:
-
{{< details summary="A short description" >}} Content that is collapsed by default but can be expanded. {{< /details >}}It renders a rounded box like the table of contents on narrow screens, which expands in place. Add
open="true"to expand it initially. To stack several boxes with a single outline, wrap them in{{< accordion >}}and{{< /accordion >}}. -
{{< youtube id="dQw4w9WgXcQ" >}}can be used to embed a single YouTube video, and{{< youtube-playlist id="PL0tn-TSss6NV45d1HnLA57VJFH6h1SeH7" >}}for a YouTube playlist. -
{{% optimizer-rules %}}is used once to render the list of AQL optimizer rules from a JSON source file. -
{{% program-options name="arangod" %}}renders the startup options of a component like the ArangoDB server (arangod) or shell (arangosh). -
{{% error-codes %}}renders the ArangoDB server error codes and their meaning. -
{{% exit-codes %}}renders the ArangoDB client and server exit codes and their meaning. -
{{% metrics %}}renders the list of ArangoDB server metrics. -
{{% service-versions %}}renders the service versions that every release of the Arango Contextual Data Platform bundles, see Add a Contextual Data Platform release.
-
Use American English spelling, e.g. behavior instead of behaviour.
-
Use inclusive language, e.g. work-hours instead of man-hours.
-
Get to point quickly on every page. Add lead paragraphs that summarizes what the page is about.
-
Target end-users and focus on the outcome. It should be about solutions, not features.
-
Do not use jargon or technical abbreviations in headlines or the navigation. Define the meaning if you use it in the content.
-
Do not add too many admonitions or everything ends up being a callout.
-
Wrap text at 80 characters where possible. This helps tremendously in version control. Pre-wrap lines if necessary.
-
Put Markdown links on a single line
[link label](target.md#hash), even if it violates the guideline of 80 characters per line. -
Avoid breaking lines of code blocks and where Markdown does not allow line breaks, e.g. in Markdown table rows (you can use
<br>if really necessary). -
Avoid using
hereas link label. Describe what the link points to instead. -
Avoid overly long link labels, such as entire sentences.
-
Use relative links for cross-references to other documentation pages, e.g.
../../contextual-data-platform/_index.mdinstead of/contextual-data-platform/_index.mdorhttps://docs.arango.ai/contextual-data-platform/. -
Avoid bold and italic markup in headlines. If you have to use it, then prefer
**bold**and*italic*over__bold__and_italic_because the underscores are preserved in anchor links but asterisks are removed! -
Inline
`code`in headlines is acceptable for code values, and required for startup options because--otherwise gets turned into an n-dash. -
-is preferred for bullet points in unordered lists over* -
Don't use
#or===for level 1 headlines. Every page should only have a single<h1>headline, and this is automatically generated from thetitlefront matter parameter. -
Use
##for level 2 headlines, not---underlines. -
There should be a blank line above and below fenced code blocks and headlines (except if it is at the top of the document, right after the end of the front matter
---). -
Use all lowercase languages in fenced code blocks without whitespace before or after the language, and use the following languages in favor of the ones in parentheses for consistency:
```cfg(instead of```confor```ini)```py(instead of```python)```yaml(instead of```yml)```sh(instead of```shell)```js(instead of```javascript)```(instead of```plainor```text)
-
Use the exact spelling of Enterprise Edition and its features, as well as for all other terms coined by ArangoDB:
- EnterpriseGraphs
- SmartGraphs, Disjoint SmartGraphs
- SmartGraphs using SatelliteCollection, not
Hybrid SmartGraphs - SmartJoins
- OneShard
- Community Edition
- Enterprise Edition
- DB-Server, not
dbserver,db-server,DBserver(unless it is a code value) - Coordinator (uppercase C)
- Agent, Agency (uppercase A)
- Arango Managed Platform (AMP) and AMP for short, but not
Oasis,ArangoDB Oasis,ArangoDB Cloud,ArangoGraph Insights Platform, orArangoGraph - Arango Contextual Data Platform
and data platform for short in prose that refers to it many times, but not
platform(ambiguous with Arango Managed Platform),Data Platform,Arango Data Platform,Arango AI Services Data Platform,Arango AI Suite Data Platform, orArango AI Data Platform - Arango Platform Suite and Arango Agentic AI Suite, but not
AI Services,GenAI Suite, orAI Suite - Arango Control Plane, but not
GenAI ServiceorAI Orchestrator - Deployment mode (single server, cluster, etc.), not
deployment type
-
Use object storage, not
blob storagewhen referring to S3-like services, as it is more precise (includes the metadata and identifier) and to avoid confusion with RocksDB BLOB storage. -
Use HTTP API, not
REST (HTTP) APIorRESTful (HTTP) APIunless it truly adheres to the REST principles, especially regarding hypermedia (HATEOAS). -
Never capitalize the names of executables or code values, e.g. write arangosh instead of Arangosh.
-
When referring to programs by their executable names, like the server or client-tool binaries, make the name italic using underscores, e.g.
_arangod_or_oasisctl_. In headlines, use asterisks, e.g.*oasisctl*and*arangod*, because underscores would affect the generated fragment IDs.Exceptions: Don't make it italic in the following cases:
-
In the
menuTitlefront matter
menuTitle: Get started with oasisctlbuttitle: Get started with _oasisctl_ -
If it's the full label of a link
[oasisctl](...)but[The _oasisctl_ reference](...) -
If it's the only text of a headline
### arangodumpbut### Create backups with *arangodump* -
If it specifically refers to the file on disk or is a command to run (use inline code instead)
The ArangoDB server executable is named `arangod` -
Inside of code including comments
const aql = require('@arangodb').aql; // not needed in arangosh
Don't write the name as inline code, e.g.
`oasisctl`, unless the user is supposed to run it as a command or if it's specifically used as a code value or file name. -
-
Do not write TODOs right into the content and avoid using
<!-- HTML comments -->. Use{{< comment >}}...{{< /comment >}}instead.
Describe required permissions the same way everywhere, especially in the
HTTP API descriptions (endpoint descriptions and 403/401 responses) and in
the release notes:
-
Refer to access levels by their code values in inline code:
rw,ro, andnone. Don't useAdministrate,Read Only,Write,No access,read access,write access,read/write access, oradministrate access. -
Write at least
roaccess ifrwaccess is sufficient as well. -
Name the database or collection the access level applies to, e.g.
rwaccess to the_systemdatabase orroaccess to this database. Admin permissions are expressed asrwaccess to the_systemdatabase. -
Make the user account the subject: The user account you authenticate with needs … in descriptions, and … has
noneaccess to … or … lacksrwaccess to … in error responses. -
Write superuser JWT, not
superuser token,superuser rights,superuser privileges, orthe superuser. Link it to the JWT superuser tokens section at least once per description, using a relative link like[superuser JWT](../authentication.md#jwt-superuser-tokens). For exceptions, write unless you authenticate with a superuser JWT or Requests with a superuser JWT are not affected.
Examples:
| Instead of | Write |
|---|---|
The user needs Administrate access to the _system database. |
The user account you authenticate with needs rw access to the _system database. |
…needs at least read access to this database as well as write access to the _system database. |
…needs at least ro access to this database and rw access to the _system database. |
Returned if you have No access database access level to the _system database. |
Returned if you have none access to the _system database. |
…lacks write access to the _system database. |
…lacks rw access to the _system database. |
| This is a protected API and can only be executed with superuser rights. | This endpoint requires a superuser JWT. |
| …with the exception of the superuser. | …unless you authenticate with a superuser JWT. |
For external links, use standard Markdown. Clicking these links automatically opens them in a new tab:
[Arango Managed Platform (AMP)](https://dashboard.arangodb.cloud)For internal links, use relative paths to the Markdown files. Always link to
files, not folders (e.g. ../graphs/_index.md instead of ../graphs/).
This way, links can be followed in tools like Visual Studio Code and on GitHub.
[Graphs](../graphs/_index.md)For anchor links, append #fragment-identifier to the path if the content is
in a different file, or use the fragment ID only to link to a headline in the
same file:
See [Named Graphs](#named-graphs)If features are added or removed in the middle of a release series, use version remarks to point this out.
This is not necessary for the first release of a series as this is expected and the changes are described in detail in the release notes. However, if a significant change sits inside content that otherwise still applies to the previous release series, a version remark can be helpful.
If features are deprecated, this should be pointed out with a version remark regardless of the version, including the first release of a series.
Examples:
- v3.12.0: A new feature can be added to the docs without version remark.
- v3.12.1: A new feature should have a version remark so that users on v3.12.0 know that it's not available in their version (v3.12 release series).
- v4.0.0: A removed feature has the description removed from the content. You can learn about the removal from the release notes, and in case of a larger feature, also from the Deprecated and removed features page.
- v4.1.0: A removed feature has the description still present in the content for users on older v4.x.x versions (v4.x release series). A version remark needs be added to let users know that it can't be used from v4.1.0 onward anymore.
- v5.0.0: A feature deprecated in v5.0.0 is still available and usable. It needs a version remark to inform users that it shouldn't be used anymore. The feature will be removed in a future version (e.g. v6.0.0).
Implied versions and multiple versions
The value v3.12.1 implies that all later versions also have this feature
(v3.12.2, v3.12.3, and so on, as well as v4.0.0 and later). If this is not the
case, then also mention the other relevant versions. For example, if a feature is
added to v3.11.5 and v3.12.2, then write the following in the 3.12 documentation:
<small>Introduced in: v3.11.5, v3.12.2</small>All later documentation versions generally use a copy of the content, therefore the 4.x documentation would contain the same.
In the 3.11 documentation, only mention versions up to this documentation version (excluding 3.12 and later in this example), pretending no later version exists to be consistent with the rest of the 3.11 documentation and to avoid additional maintenance burden:
<small>Introduced in: v3.11.5</small>Remark styles
The style and formatting of a version remark depends on whether it is applicable to an entire page or section, a single option/parameter, or just a single paragraph/sentence.
-
Page scope: The main page about a new feature should indicate the version the feature was added in, as shown below.
--- title: New feature ... --- <small>Introduced in: v3.12.1</small> ...
-
Section scope: If there is an existing page and you add a section about a new (sub-)feature to it, add the version remark as shown below.
## Existing feature ... ### New feature section <small>Introduced in: v3.12.1</small> ...
-
Option/parameter scope: New options and response fields in the JavaScript and HTTP APIs are covered by the release notes, but if new attributes are added mid release series, then this should be pointed out.
You may also add a remark if an existing feature or option is significantly extended by a new (sub-)option in the first release of a series, specifically if it sits inside content that otherwise still applies to the previous release series. This is to indicate that the availability of the feature as a whole differs from the availability of the later added sub-feature. This is rarely the case, however.
If an attribute of type object is added, its sub-attributes don't need a separate version remark - they inherit it.
If the same attribute is described in multiple request and response schemas of a page, add the version remark to every copy. Readers typically jump to a specific endpoint rather than reading the page top to bottom.
If a version remark applies to the entire description of an option, then use the following style, even if it's a single sentence:
newOption: description: | <small>Introduced in: v3.11.5, v3.12.2</small> ...If the version remark only applies to single sentence of a larger text, a single enum value, or similar, you can use a more compact version remark. You may use a list for this:
newOption: description: | ... - Option A ... - Option B ... (introduced in v3.11.5 and v3.12.2).In case the behavior is significantly changed between versions, you may describe the before and after in detail stating the versions and no version remark as described above. This is a good option if a whole paragraph is needed to explain the differences.
newOption: description: | ... In versions up to v3.12.5, ... From version 3.12.6 onward, ...
Remark types
While version remarks are mostly used for newly added features, you can also mark deprecated features in the same manner. The same goes for removals, although they are rare mid release series.
Introduced in: .../(introduced in ...)Deprecated in: .../(deprecated in ...)Removed in: .../(removed in ...)
When to remove version remarks
The documentation content between subsequent ArangoDB versions is largely the same and copied when creating the folder for the next release series. Therefore, version remarks get copied over as well. They can generally remain in the content (except if the first release of a series removes a feature or option, then the version remark is deleted along with the page or description).
When an old, unsupported version is removed from the documentation, then version remarks mentioning this or older versions should be removed from the remaining content. If there are multiple mentioned versions but at least one of them is still present in the documentation, then the version remark should remain as-is until all mentioned versions are removed.
Examples:
- When deleting 3.10 from the docs, version remarks like
(introduced in v3.10.2)should be removed from the 3.11+ content. - When deleting 3.10 from the docs, version remarks like
(introduced in v3.9.6 and v3.10.2)should be removed because 3.9 is already deleted and 3.10 is being deleted. - When deleting 3.10 from the docs, version remarks like
(introduced in v3.10.6 and v3.11.1)should not be removed or modified because 3.11 is still present and changing the remark would distort the original information.
Pages and sections about features that are only available in certain environments
such as in ArangoDB Shell should indicate where they are available using the
tag shortcode.
Features exclusive to the Contextual Data Platform, the Arango Managed Platform (AMP), and ArangoDB generally don't need to be tagged because they are in dedicated parts of the documentation. Within the Contextual Data Platform documentation, the Platform Suite and the Agentic AI Suite are licenses rather than chapters, so pages of services that require one of them are tagged. If there are subsections with different procedures, each can be tagged accordingly.
In the Contextual Data Platform only:
{{< tag "Contextual Data Platform" >}}Requires the Platform Suite license of the Contextual Data Platform:
{{< tag "Platform Suite" >}}Requires the Agentic AI Suite license of the Contextual Data Platform:
{{< tag "Agentic AI Suite" >}}In the Arango Managed Platform (AMP) only:
{{< tag "AMP" >}}In the ArangoDB Shell but not the server-side JavaScript API:
{{< tag "arangosh" >}}This shortcode should be placed immediately after a headline, before any version
remarks (<small>Introduced in: ...</small>).
You can define a tooltip for each tag in the
tag.html template.
From version 3.12.5 onward, all features formerly exclusive to the Enterprise Edition are also included in the Community Edition. Therefore, using tags and other kinds of remarks to indicate what features require the Enterprise Edition should not be necessary.
In the content before version 3.12.5, pages and sections about Enterprise Edition features should indicate that the Enterprise Edition is required using a tag. Use the following include in the general case:
{{< tag "ArangoDB Enterprise Edition" "AMP" >}}Features that are available for testing but may still change or get removed and should thus not be used in production can be tagged as follows:
{{< tag "Experimental" >}}A lead paragraph is the opening paragraph of a written work that summarizes its main ideas. Only few pages have one so far, but new content should be written with such a brief description. It is supposed to clarify the scope of the article so that the reader can quickly assess whether the following information is of relevance, but also acts as an introduction.
You can set the lead paragraph via the description parameter in the
front matter of a page:
---
title: Feature X
description: >-
You can do this and that with X, and it is ideal to solve problem Y
---
...The lead paragraph text should end without a period, contain no links, and
usually avoid other markup as well. However, bold, italic, and
inline code are acceptable.
Start off by finding a file name. It should be:
- All lower-case
- Use hyphen-minus
-instead of spaces - Be very short but descriptive
- Follow the patterns of existing files
Note that the file name is independent of what will show in the navigation or
what will be used as headline for that page. The file name will be used as
part of the final URL, however. For example, arangodb/3.12/aql/examples.md
will become http://docs.arango.ai/arangodb/3.12/aql/examples/.
Create a new file with the file name and a .md file extension. Open the file
in a text editor (Visual Studio Code is recommended). Add the following
front matter:
---
title: The level 1 headline
description: >-
A meaningful description of the page
menuTitle: Short navigation menu title
weight: 42 # controls navigation position within the current section (low to high)
---Add the actual content formatted in Markdown syntax below the front matter.
There are two options for setting up redirects when renaming or moving content:
- Netlify redirects: Server-side, testable in Netlify deploy previews. Use for unversioned content as well as when removing versioned content that the version selector can't lead to, i.e. pages removed from all versions.
- Hugo aliases: Server-side on Netlify (generated) and client-side when running the docs toolchain locally. Use when renaming/moving versioned content, or removing it from some versions only, to keep the version selector working.
Note that turning a page topic.md into a section topic/_index.md (in
order to add child pages) does not affect the resulting URL (/topic/) and
does therefore not require a redirect!
Netlify supports server-side redirects configured with a text file (documentation). This is helpful when renaming folders with many subfolders and files because there is support for splatting and placeholders (but not regular expressions). See Redirect options for details.
The manual rules are in site/_redirects. Hugo publishes
them as part of the generated _redirects file, after a forced 301! rule
for every alias (see below). The general format is /old/url/ /new/url/ 301, where 301 is for a permanent
redirect and 302 for a temporary one. Use 302 until the redirects have been
tested, then change them to 301 - this avoids caching issues (browser, CDN)
should it be necessary to fix some of the redirects.
Netlify redirects are preferable for SEO because search engines are more likely to
update links in their indexes if they get a server-side 301 Permanent Redirect
HTTP status code, and it also works better when using e.g. cURL
(curl -L ... to automatically follow redirects).
Where Netlify redirects don't work is when you run the docs toolchain locally.
This is generally not an issue because they can be tested using the automatic
deploy previews, and you can only hit the redirects if you manually enter the
old URLs. There is one exception, however: the version selector. If you
switch between versions of a page, you can get a 404 Not Found when running
the docs toolchain locally, while in the Netlify deploy previews, you get
redirected. This is because the version selector merely substitutes the version
in the current URL and we hope that this page exists.
To ensure a working version selector locally, which can be helpful when
reviewing content, use Hugo aliases when moving or renaming versioned pages
(i.e. /arangodb/<version>/...), and when removing a page from some versions
but not others. Hugo aliases create
client-side redirect files (<meta http-equiv="refresh">), and Netlify only
applies a redirect rule if there is no file for a given URL, unless the status
code has an exclamation mark (301!). Therefore, Hugo generates a forced rule
for every alias at the top of the published _redirects file
(site/themes/arangodb-docs-theme/layouts/_default/home.redirects):
/arangodb/4.x/old-feature/ /arangodb/4.x/release-notes/deprecated-and-removed-features/ 301!
Do not add manual rules for URLs that are aliases. The generated rules take precedence as they come first. Manual rules for URLs without an alias don't need an exclamation mark. Hugo warns if an alias is the URL of an existing page (no rule is generated) or if two pages use the same alias.
The following steps are necessary for moving/renaming versioned content:
- Rename file or folder
- Set up
aliasesvia the front matter as needed - consider all version switcher actions, like switching from an older version to any of the newer, renamed/moved versions, and possibly vice versa! - Adjust
weightof pages in the front matter if necessary - Update cross-references in all of the content to use the new file path
The URL of a page is derived from the file name and the parent folders, with
special handling for sections (folders with a _index.md file).
For example, arangodb/3.12/aql/operators.md becomes the URL path
/arangodb/3.12/aql/operators/, and arangodb/3.12/aql/functions/_index.md
becomes /arangodb/3.12/aql/functions/.
If you rename a file, from section/old-name.md to section/new-name.md for
instance, make sure to add a redirect for the old URL by adding the following to
the front matter of section/new-name.md:
aliases:
- old-nameDon't forget to update any references to the old file in the content to the new path.
Also don't forget to check whether an alias needs to be added for the opposite
direction so that you can switch between old and new versions without getting
a 404 error:
| File | Alias |
|---|---|
/arangodb/3.11/old-name.md |
new-name |
/arangodb/3.12/new-name.md |
old-name |
/arangodb/stable/new-name.md |
old-name |
If you move a file from one folder to another, from old/file.md to new/file.md
for instance, use a relative path as shown below:
aliases:
- ../old/fileIf you rename a folder, from old/ to new/ for instance, add the following
front matter to new/_index.md:
aliases:
- oldFor aliases in _index.md files, think of the folder they are in as a file.
In the above example, the folder is new/. Treating it like the file that
defines the page means that the alias old is relative to its parent folder
(here: the root folder of the content, site/content/). Therefore, the alias
needs to be old, not ../old.
Note that you need to set up aliases for all files in new/ so that every URL
which includes the old folder name redirects to the corresponding new URL.
For example, for a file new/other.md (previously old/other.md), add the
following:
aliases:
- ../old/otherAliases create HTML files with client-side redirects before any content is
rendered to HTML, which means that aliases can get overwritten by content files.
If this is not a mistake, the affected aliases should be removed. Hugo warns
about such aliases (Alias ... is the URL of another page).
The table of contents (ToC) or "On this page" on the right-hand side at the top of a page lists the headlines if there are at least two headlines on the page (excluding the title).
The ToC can be restricted to a maximum headline level to omit the deeper nested headlines for less clutter:
---
...
pageToc:
maxHeadlineLevel: 3
---A setting of 3 means that <h1>, <h2>, and <h3> headlines will be listed
in the ToC, whereas <h4>, <h5>, and <h6> will be ignored.
When an ArangoDB version reaches End-of-Life,
its documentation needs to be marked as such. For the respective version, set
the deprecated attribute to true in the site/data/versions.yaml file:
- name: "3.10"
version: "3.10.9"
alias: "3.10"
- deprecated: false
+ deprecated: trueIt makes a warning show at the top of every page for that version.
-
In the
site/data/versions.yamlfile, add a new entry for the version you want to add. Example:+- name: "4.x" + version: "4.0.0" + alias: "4.x" + deprecated: false + - name: "3.12" version: "3.12.0" alias: "devel" deprecated: false
-
Near the top of the
.circleci/config.ymlfile underparameters, find the last entry with the formatarangodb-X_XXwhereX_XXis a version number like3_12, soarangodb-3_12for example. Duplicate the block and adjust the version number. Example:arangodb-3_12: type: string default: "undefined" + + arangodb-4_x: + type: string + default: "undefined"Under
jobs.generate-config.environment, add an environment variable for the parameter. Example:PARAM_ARANGODB_3_12: << pipeline.parameters.arangodb-3_12 >> + PARAM_ARANGODB_4_X: << pipeline.parameters.arangodb-4_x >>Near the end of the file under
jobs.generate-config.steps[0].run.command, find the line of code that callspython3 generate_config.py. In one of the following lines, a parameter for every version is passed as argument. Add one for the new version. Example:python3 generate_config.py \ --workflow="$PARAM_WORKFLOW" \ - --arangodb-branches 3.11="$PARAM_ARANGODB_3_11" 3.12="$PARAM_ARANGODB_3_12" \ + --arangodb-branches 3.11="$PARAM_ARANGODB_3_11" 3.12="$PARAM_ARANGODB_3_12" 4.x="$PARAM_ARANGODB_4_X" \Each entry is
VERSION=REF, withVERSIONbeing thenameof the version inversions.yaml. The order doesn't matter.In the
.circleci/upstream.yamlfile, add an entry for the new version with thearangodb/arangodbbranch it is based on (develfor the version in development), the defaultarangodb/enterprisebranch, the naming of the images that the CI ofarangodb/arangodbbuilds for branches, and the nightly image (see the comments in the file and CIRCLECI.md). Example:"4.x": branch: "devel" enterprise: "devel" image: "public.ecr.aws/b0b8h2r4/arangodb/core-preview:{main7}_{enterprise7}" nightly: "arangodb/core-preview:devel-nightly"
-
In the
toolchain/docker/amd64/docker-compose.ymlfile, add an entry underservices.toolchain.volumesfor the new version. Simply increment the value after:-/tmp/. Example:- ${ARANGODB_SRC_3_12:-/tmp/2}:/tmp/3.12 + - ${ARANGODB_SRC_4_X:-/tmp/3}:/tmp/4.xUnder
services.toolchain.environment, you need to add two different entries for the new version. Example:ARANGODB_SRC_3_11: ${ARANGODB_SRC_3_11:-} ARANGODB_SRC_3_12: ${ARANGODB_SRC_3_12:-} + ARANGODB_SRC_4_X: ${ARANGODB_SRC_4_X:-} ARANGODB_BRANCH_3_11: ${ARANGODB_BRANCH_3_11:-} ARANGODB_BRANCH_3_12: ${ARANGODB_BRANCH_3_12:-} + ARANGODB_BRANCH_4_X: ${ARANGODB_BRANCH_4_X:-}The same changes are required in the
toolchain/docker/arm64/docker-compose.ymlandtoolchain/docker/docker-compose.local.ymlfiles. The toolchain script reads the versions fromsite/data/versions.yaml, so it doesn't need changes. -
In the
site/datafolder, create a new folder with the short version number as the name, e.g.4.x. In the newsite/data/4.xfolder, create acache.jsonfile with the following content:{}Add this untracked file to Git!
-
Duplicate the folder of the most recent version in
site/content, e.g. the3.12folder, and rename the copy to the new version, e.g.4.x.The
menuTitlein the front matter of the version homepage, e.g.site/content/4.x/_index.md, needs to adjusted to the new version, likemenuTitle: '4.x'.In the folder for release notes, e.g.
site/content/4.x/release-notes/, duplicate the folder of the most recent version, e.g.version-3.12, and rename it, e.g. toversion-4.x. In this folder, rename the files to replace the old with the new version number, e.g.api-changes-in-3-12.mdtoapi-changes-in-4-x.mdand so on.In the
_index.mdfile in the folder, e.g.site/content/4.x/release-notes/version-4.x/_index.md, you need to replace the version numbers in the front matter and links. You also need to adjust theweightin the front matter. Decrement the value by one to make the new version appear before the existing versions, but make sure that it is greater than0, which may require adjusting the weights in all of the section files.In the other files of the release notes, remove the version-specific content and only leave the front matter, introductions, and headlines that are commonly used across different versions in the release notes. Adjust the version numbers in the front matter and content.
Search the entire version folder, e.g.
site/content/4.x/, for links that are meant to point to the release notes of the own version, but which are still pointing to the version the content has been copied from. For example, if you duplicated the3.12folder, search the4.xfolder forversion-3.12/. You should find links toversion-3.12/known-issues-in-3-12.mdthat need to be updated toversion-4.x/known-issues-in-4-x.md.In the release notes root file, e.g.
site/content/4.x/release-notes/_index.md, add the links for the new version following the existing pattern. Do this after updating the links to the known issues so that you don't accidentally change the 3.12 link in the release notes root file.In the Highlights by Version page, e.g.
site/content/4.x/introduction/features/highlights-by-version.md, add a section for the new version including a link to the release notes.Add the new, untracked files to Git!
-
Check whether you need to add additional
aliasesin the front matter of pages. This is necessary keep the switching using the version selector working, from renamed/moved pages in older versions to the corresponding pages in the newer versions.aliases: - ../arangodb/3.12/data-science/arangographml - ../arangodb/stable/data-science/arangographml + - ../arangodb/4.x/data-science/arangographml + - ../arangodb/devel/data-science/arangographml
-
In the
PULL_REQUEST_TEMPLATE.mdfile, add a new line for the new version. Example:- 3.12: +- 4.x:Stage all changes and commit them. Open a pull request (PR) on GitHub. You only need to specify a Docker image or PR link for
- 4.x:if you plan to use the/generateor/generate-commitcommand to re-generate the examples. If you follow the next step, the example generation is run manually along with some other generators, so using the commands shouldn't be necessary.Expect the plain build to fail for the time being because of missing data files.
-
You can use CircleCI to initially generate the data files for the new version, like the startup option dumps. You can also populate the example cache at the same time.
Before you continue, make sure there are no conflicts in the PR with the
mainbranch. The CircleCI workflow will otherwise create a merge commit favoring themainbranch (in order to update the cache file but also affecting other files), and this can cause e.g. theversions.yamlfile to get reverted in case of a conflict. The toolchain would then be unaware of the newly added version.In CircleCI at https://app.circleci.com/pipelines/github/arangodb/docs-hugo, select the branch of your PR and click Trigger Pipeline. Enter the parameters similar to this example:
Type Name Value string workflowgeneratestring arangodb-4_xImage (e.g. arangodb/core-preview:devel-nightly) orarangodb/arangodbbranch with a built image (see CIRCLECI.md)string generatorsexamples metrics error-codes exit-codes optimizer optionsstring deploy-urldeploy-preview-{PR-number}with the number of the docs PRboolean commit-generatedtrueAfter a successful run, you should see a commit in the docs PR with the updated data files, as well as an updated example cache file. The plain build should no longer fail and provide you with a Netlify preview.
The process is similar to adding a version but you need to undo the changes.
For example, if the current stable version is 3.11 and the devel version is 3.12,
the site/data/versions.yaml file may look like this:
/arangodb/:
- name: "4.x"
version: "4.0.0"
alias: "4.x"
deprecated: false
inDevelopment: true
allowedAPIVersions: [v1, experimental]
- name: "3.12"
version: "3.12.9"
alias: "devel"
deprecated: false
inDevelopment: true
allowedAPIVersions: [v0, experimental]
- name: "3.11"
version: "3.11.14"
alias: "stable"
deprecated: false
inDevelopment: false
allowedAPIVersions: [v0]To make 3.12 the new stable version, you need to set alias to "stable" for
the 3.12 entry. As there can only be a single stable version (in the
documentation sense), the alias value of the former stable version needs to be
changed. In this example, it is the 3.11 entry where you need to change alias
to the version name, which is "3.11" in this case. Finally, you need to
re-assign the "devel" alias to the version that comes after the new stable
version. In this example, you need to adjust the alias of the 4.x entry.
The work-in-progress versions of the ArangoDB documentation need to have
inDevelopment set to true. Make sure to change it to false for the former
devel version when it becomes the new stable version.
The version with the "devel" alias is the one developed in the devel branch
of arangodb/arangodb. When the former devel version gets a branch of its own
(e.g. 4.x when the 5.0 development starts in devel), update .circleci/upstream.yaml:
set branch of the former devel version to its new branch, adjust enterprise,
image, and nightly accordingly, and add an entry for the new devel version
(see Add a new version). Also update the links to the
devel branch in the content of the former devel version, like the changelog in
release-notes/_index.md and CONTRIBUTING.md and LICENSE
(git grep -E "arangodb/arangodb/(blob|tree)/devel|arangodb/arangodb/devel/" site/content/arangodb/4.x),
and copy them with devel to the new version.
The final configuration would then look like this:
/arangodb/:
- name: "4.x"
version: "4.0.0"
alias: "devel" # was "4.x"
deprecated: false
inDevelopment: true
allowedAPIVersions: [v1, experimental]
- name: "3.12"
version: "3.12.9"
alias: "stable" # was "devel"
deprecated: false
inDevelopment: false # was true
allowedAPIVersions: [v0, experimental]
- name: "3.11"
version: "3.11.14"
alias: "3.11" # was "stable"
deprecated: false
inDevelopment: false
allowedAPIVersions: [v0]The Service versions
page lists the version of every Platform Suite and Agentic AI Suite service that
each release of the Arango Contextual Data Platform bundles. It is generated by
the {{% service-versions %}} shortcode from two data sources, so adding a
release means adding a data file, not editing the page.
-
Download the platform configuration of the release from https://github.com/arangodb/arangodb-platform-config/releases/ and save it to
site/data/data_platform/under its original name, e.g.AI_Suite.v4.1.0.yaml. The file name is not interpreted, but keeping it makes it obvious which release a file describes. -
Add a
datekey to the file by hand. The configuration files do not carry a release date, but the headline needs one, and the build fails with an error naming the file if the key is missing:version: 4.1.0 +date: August 2026Use the same month and year as the corresponding headline in What's new in the data platform (respectively what the GitHub Release indicates for the platform config). Leave the rest of the file untouched: only the
version,date, andpackageskeys are read, and the unused keys are harmless. -
Map any new package to the feature it implements in
site/data/data_platform_services.yaml. Every entry has afeatureslist, because one package can ship several features that the documentation describes separately:arango-control-plane: features: - name: Arango Control Plane (ACP) link: platform-suite/control-plane-acp/_index.md - name: Secrets Manager link: platform-suite/secrets-manager.md
The
linkis relative to the content root (site/content/) and optional. The shortcode rewrites it to a path relative to the page it renders into, so that the emitted Markdown links are checked like any other link.A package that is missing from the mapping is still listed, but its Features cell stays empty and the build warns about it, naming the package and the page (it fails instead if
failOnBrokenLinksis set).
Releases are sorted by their version key, newest first, and the rows of each
table by the first feature of the package, so the order of the files and of the
keys inside them does not matter.
A complete example:
```js
---
name: ensureUniquePersistentSingle
description: Create a unique persistent index on a single document attribute
---
~db._create("ids");
db.ids.ensureIndex({ type: "persistent", fields: [ "myId" ], unique: true });
db.ids.save({ "myId": 123 });
db.ids.save({
"myId": 123
}); // xpError(ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED)
~db._drop("ids");
```Groups of examples should have the same name prefix.
If an example needs to be run against an ArangoDB cluster instead of a single server (default), then add the following front matter option:
type: clusterTo not render the transcript comprised of input and output but only the input
or output, set the render front matter option:
render: input # or 'output', default 'input/output'After the front matter, you can write the JavaScript code for arangosh:
db._create("collection");
db.collection.save({ _key: "foo", value: 123 });
db._query(`FOR doc IN collection RETURN doc.value`).toArray();
db._drop("collection");Statements can span multiple lines:
db.collection.save([
{ multiple: true },
{ lines: true }
]);The statements as well as the results will be visible in the example transcript.
To hide certain statements from the output, e.g. for setup/teardown that is not
relevant for the example, you can use a leading tilde ~ to suppress individual
lines:
~db._create("collection");
db.collection.save({ _key: "foo" });
~db._drop("collection");After each example, the toolchain automatically removes the resources that the
example created: collections, Views, graphs, Analyzers, users, databases, and
tasks. It also aborts running Stream Transactions, kills running AQL queries,
and switches back to the _system database. The examples therefore don't need
to clean up (but it doesn't hurt). Other changes like new indexes on existing
collections or server settings (e.g. the read-only mode) aren't reset, so
examples need to undo them.
To use resources in subsequent examples on the same page, exempt them from the removal:
~db._create("collection");
~db._createView("view", "arangosearch", {...});
db.collection.save({...});
~addIgnoreView("view");
~addIgnoreCollection("collection");This is helpful for creating collections and Views once and using them in
multiple examples instead of creating them in each example. For other kinds of
resources, use addIgnoreGraph(), addIgnoreAnalyzer(), addIgnoreUser(),
addIgnoreDatabase(), and addIgnoreTask() with the name. A graph is also
exempt if all of its collections are.
When all examples of a page ran, the toolchain removes the exempted resources
of the page, so that they can't affect examples on other pages. You can end an
exemption earlier with the corresponding removeIgnore...() function. The
resource is then removed after the example:
~removeIgnoreCollection("collection");
~removeIgnoreView("view");If an example fails because a resource doesn't exist that a previous example created, check whether the previous example exempts it. The log shows what the toolchain removed after each example.
Note that a series of examples needs to be contained within a single file.
Use assertions to verify that an example does what it is supposed to do, especially if the effect isn't visible in the output, like for operations that drop, remove, or change something, or for asynchronous operations that you wait for. A failed assertion is reported as an error with the condition:
~db._create("example");
var coll = db._collection("example");
db._drop(coll.name());
~assert(db._collection("example") === null);When waiting for an asynchronous operation, poll in short intervals and stop on any final state, then assert the expected state. Otherwise, a failure leads to waiting until the time limit and isn't noticed:
for (var count = 0; count < 150; ++count) {
var progress = hotbackup.uploadProgress(upload.uploadId);
if (progress.DBServers.SNGL.Status !== "STARTED") {
break;
}
internal.wait(0.1);
}
assert(progress.DBServers.SNGL.Status === "COMPLETED");Create test data in batches (e.g. with an AQL query like
FOR i IN 1..10000 INSERT { value: i } INTO coll) instead of inserting documents
one by one, as every insert is a request to the server.
If a statement is expected to fail (e.g. to demonstrate the error case), then this has to be indicated with a special JavaScript comment:
db._document("collection/does_not_exist"); // xpError(ERROR_ARANGO_DOCUMENT_NOT_FOUND)This will make the example generation continue despite the error. See Error codes and meanings for a list of all error codes and their names. If a unexpected error is raised, then the example generation will abort with an error.
Every backslash in a query needs to be escaped with another backslash, i.e. JSON escape sequences require two backslashes, and literal backslashes four:
db._query(`RETURN REGEX_SPLIT("foo\\t bar\\r baz\\n foob", "\\\\s+|(?:b\\\\b)")`).toArray();This does not apply to backslashes in bind variables:
db._query(`RETURN REGEX_SPLIT(@t, @r)`, {t: "foo\t bar\r baz\n foob", r: "\\s+|(?:b\\b)"}).toArray();Complete example:
```aql
---
name: joinTuples
description:
bindVars: {
friend: "friend"
}
dataset: joinSampleDataset
explain: true
---
FOR u IN users
FILTER u.active == true
LIMIT 0, 4
FOR f IN relations
FILTER f.type == @friend && f.friendOf == u.userId
RETURN {
"user" : u.name,
"friendId" : f.thisUser
}
```An example can optionally specify a dataset in the front matter that will be
loaded before the query is run:
dataset: name_of_datasetSee datasets.json for the available datasets.
To get the query explain output including the execution plan instead of the
actual query result, you can optionally specify the explain option in the
front matter:
explain: trueThen the actual AQL query follows, e.g.
FOR i IN 1..3
RETURN i
The query can optionally use bind parameters that can be set via the bindVars
option in the front matter:
---
...
bindVars:
'@coll': products
attr:
- title
- de
# or using JSON notation:
#bindVars: { "@coll": "products", "attr": ["title", "de"] }
---
FOR doc IN @@coll
RETURN doc.@attrThe query is handed to arangosh as a JavaScript string literal, so the AQL parser sees exactly what you write in the example. Escape backslashes by the AQL rules alone, the same way you would when typing the query into the query editor of the web interface:
\\in an AQL string literal for a single literal backslash. A regular expression shorthand like\d,\s, or\btherefore needs to be written as\\d,\\s, and\\bto survive the string literal\n,\r, and\tfor a line feed, carriage return, and tabulation
```aql
---
name: regexExample
description: ''
---
RETURN REGEX_MATCHES("foo=1, bar=22", "(\\w+)=(\\d+)")
```Do not add a second level of escaping for arangosh. An example can be copied from the rendered documentation straight into the query editor and run unchanged.
For the same reason, ${...} and backticks carry no special meaning in the query
and need no escaping. A named capturing group can be referenced in a replacement
string as usual:
```aql
---
name: namedGroupExample
description: ''
---
RETURN REGEX_REPLACE("Jane Roe", "(?<first>\\w+) (?<last>\\w+)", "${last}, ${first}")
```In the generated output, arangosh prints strings with JSON-style escaping.
A single backslash in a result value is therefore displayed as \\. A query that
returns the three-character string a\b renders like this:
[
"a\\b"
]
Used to describe an HTTP API endpoint using the OpenAPI Specification standard in version 3.1.0.
The content inside the codeblock is a standard OpenAPI endpoint description in YAML format for a single ArangoDB endpoint. The headline above the code block is also used as the endpoint summary automatically:
### Get the service README
```openapi
paths:
/_api/foxx/readme:
get:
operationId: getFoxxReadme
description: |
Fetches the service's README or README.md file's contents if any.
parameters:
- name: mount
in: query
required: true
description: |
Mount path of the installed service.
schema:
type: string
responses:
'200':
description: |
Returned if the request was successful.
'204':
description: |
Returned if no README file was found.
tags:
- Foxx
```Only define a single tag in tags as this is used to categorize the endpoints.
The tag descriptions live in site/data/openapi_tags/
and are merged into the openapi.json files (see below). For the ArangoDB
HTTP API, the files are stored as:
arangodb_0.yaml(API v0)arangodb_1.yaml(API v1)arangodb_2.yaml(experimental API)
For other services, use site/data/openapi_tags/<Service-Name>.yaml
if you need tags.
The HTTP API endpoint descriptions are rendered in the documentation, but
arangoproxy also converts the YAML to JSON and assembles full OpenAPI
specifications when creating a static build. These are saved to
disk under site/data/<version>/ for the ArangoDB API, so one folder per ArangoDB
version and with one or more files depending on the supported API versions:
0-openapi.json(API v0)1-openapi.json(API v1)2-openapi.json(experimental API)
These files are checked into the OpenAPI folder in the
arangodb/arangodb
repository at the moment, to be used for serving requests like
/_arango/<API-Version>/openapi.json (from v3.12.8 onward).
Such a JSON file is also needed by the web interface for Swagger UI.
For ArangoDB endpoints, you can define what API versions they are available
in using front matter at the beginning of openapi code blocks:
### Get the service README
```openapi
---
apiVersions: [v0]
---
paths:
/_api/foxx/readme:
...A value of [v0] for the apiVersions option will add the endpoint only to
0-openapi.json. The experimental API uses the next available number, hence
2-openapi.json.
## Get the activities (experimental)
```openapi
---
apiVersions: [experimental]
---
paths:
/_db/{database-name}/_admin/activities:
...Endpoint paths are automatically prefixed for ArangoDB as follows:
- No prefix for API v0
/_arango/v1for API v1/_arango/experimentalfor the experimental API
To write OpenAPI descriptions for something other than ArangoDB, use the
service front matter option. This writes the OpenAPI specification to
site/data/<service>/openapi.json:
### Deploy an `arango-cypher2aql` service
```openapi
---
service: cypher2aql
---
paths:
/_platform/acp/v1/service:
...The default front matter values allow you to omit the front matter block entirely in many cases. The defaults are:
service: arangodbapiVersions: [v0]for ArangoDB 3.10apiVersions: [v0]for ArangoDB 3.11apiVersions: [v0, v1]for ArangoDB 3.12apiVersions: [v1]for ArangoDB 4.x
site/data/versions.yaml
For each ArangoDB documentation version, you can set allowedAPIVersions to
declare which API versions (v0, v1, experimental) are valid for that version.
arangoproxy uses this to know which OpenAPI files to expect per version
(e.g. 0-openapi.json, 1-openapi.json, 2-openapi.json under
site/data/<version>/). Example:
- name: "4.x"
version: "4.0.0"
allowedAPIVersions: [v1, experimental]
- name: "3.12"
version: "3.12.7"
allowedAPIVersions: [v0, v1, experimental]
- name: "3.11"
version: "3.11.14"
allowedAPIVersions: [v0]Allowed values are v0, v1, and experimental. If you add a new docs version,
set allowedAPIVersions accordingly; omitting it means the toolchain falls back
to allowing all indices for that version.
site/data/openapi_services.yaml
This file defines base metadata per OpenAPI service (title, summary, contact,
externalDocs, and for non-ArangoDB services also version). arangoproxy
merges this with the per-version OpenAPI content. For ArangoDB (service: arangodb),
version and license are computed in Go from versions.yaml and the API
version index; for other services, all fields are read from this file. Example:
arangodb:
title: ArangoDB Core API
summary: The HTTP API of the ArangoDB graph database system
contact:
name: ArangoDB Inc.
url: https://arango.ai
externalDocs:
description: ArangoDB Documentation
url: https://docs.arango.ai/arangodb/
cypher2aql:
title: Cypher to AQL Translation Service API
version: "1.0.0"
# ...Add new API versions or change the toolchain behavior
To adjust the rendering of prefixes for https://docs.arango.ai and the
handling of front matter such as apiVersions, see
render-codeblock-openapi.html.
To adjust the OpenAPI processing and how the *openapi.json files are written,
see service.go.
If a new API version is added to ArangoDB, both need to adjusted to handle it,
and you also need to update allowedAPIVersions fields for affected versions in
versions.yaml, as well as add a new file with the
OpenAPI tags (site/data/openapi_tags/arangodb_#.yaml).
Complete example:
```curl
---
name: HttpAqlToBase64
description: Encode example credentials using the HTTP API
---
var url = "/_api/cursor";
var body = { query: `RETURN TO_BASE64("user:pass")` };
var response = logCurlRequest('POST', url, body);
assert(response.code === 201);
logJsonResponse(response);
```
If an endpoint requires the _system database as the context, the URL should be
set accordingly, e.g. var url = "/_db/_system/_api/database";. This ensures
that the request is issued correctly as the toolchain may process other examples
that change the database context simultaneously.
Unlike arangosh examples (```js), requests and responses
need to be output explicitly by calling one of the following functions:
logCurlRequest(method, url, body) → response: make and output an HTTP requestlogCurlRequestRaw(method, url, body) → response: make and output an HTTP request without code highlightinglogCurlRequestPlain(method, url, body) → response: make and output an HTTP request, with the payload decoded (new lines instead of\r\netc.). Useful for formatting complex requests.logJsonResponse(response): output a JSON server reply (fails on invalid JSON)logJsonLResponse(response): output a JSONL server reply (fails on invalid JSON)logRawResponse(response): output plaintext response (do not use for JSON replies; can be used for endpoint calls that return an empty body to output the headers)logPlainResponse(response): output decoded response (new lines instead of\r\netc.). Useful for formatting complex responses, like from batch requests.logHtmlResponse(response): output HTMLlogErrorResponse(response): dump reply to error log for testing (makes example generation fail)
To test whether requests and replies are as expected, you can add
assert(expression) calls. Expressions that evaluate to false will make the
example generation fail. You can inspect the CircleCI logs for details.
To use specialized assertions, you need to import them from
jsunity,
like assertTrue(), assertEqual(), assertTypeOf(), assertUndefined(), etc.
var assertTypeOf = require("jsunity").jsUnity.assertions.assertTypeOf;
assertTypeOf("string", response.parsedBody.name);