Giter Club home page Giter Club logo

arangodb / docs Goto Github PK

View Code? Open in Web Editor NEW
20.0 33.0 59.0 215.46 MB

⚠ DEPRECATED! Source code of the legacy ArangoDB online documentation. See arangodb/docs-hugo

Home Page: https://github.com/arangodb/docs-hugo/

License: Apache License 2.0

HTML 9.84% Dockerfile 0.30% Ruby 30.71% JavaScript 3.59% CSS 55.26% Shell 0.31%
nosql multi-model graph-database document-database key-value database distributed-database arangodb graphdb documentation

docs's Introduction

ArangoDB Documentation

Netlify Status

This is the ArangoDB documentation repository containing all documentation for all versions as published on arangodb.com/docs/.

The documentation uses the static site generator Jekyll.

View the latest successful preview build of the main branch.

Contributing

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.

Automatic Previews

In every pull request, there is a number of so-called checks (above the text field for entering a comment). The last entry should be netlify/zealous-morse-14392b/deploy-preview with a Details link. Whenever you push a change to the PR branch, Netlify will build a preview. While it is doing that or if it fails building the docs, then the Details link will get you to the build log. If it succeeded, then it gets you to the hosted preview of that PR. If no checks show up at all, then Netlify is probably busy with another build (or down). The checks should eventually appear, however.

Contributor License Agreement

To accept external contributions, we need you to fill out and sign our Contributor License Agreement (CLA). We use an Apache 2 CLA for ArangoDB, which can be found here: https://www.arangodb.com/documents/cla.pdf You can scan and email the CLA PDF file to [email protected] or send it via fax to +49-221-2722999-88.

Building the Documentation

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.

Symlink Support Required

Make sure that symlink support is enabled before you clone the repository with Git. It is turned off by default in Git for Windows. Start a terminal as administrator and run:

git config --system core.symlinks true

Options for Building

To work locally on the documentation you can:

Docker is generally easier, but may also be slower (at least under Windows).

Note that the Algolia plugin has a dependency which does not support Ruby 2.6+.

Jekyll

If you want to build the docs the first time, run bundle install to ensure that all dependencies (gems / plugins) are installed.

For local development, start Jekyll in watch mode:

bundle exec jekyll serve

This will build the documentation, rebuild it if you change files, and serve the documentation site locally using Jekyll's built-in web server.

You can then browse the docs in a browser at http://127.0.0.1:4000/docs/stable/. Note that it has to be /docs/stable/ (or another version than stable). Both paths / and /docs do not work (404 Page not found) because of the configured baseurl in _config.yml, and /docs/ redirects you to the online version of the documentation.

To let Jekyll build the static site without serving it or watching for file changes, use:

bundle exec jekyll build

The generated content will be stored in the _site/docs/ folder.

To serve the content from a previous build without watching for changes, use:

bundle exec jekyll serve --skip-initial-build --no-watch

Docker Container

In the docs directory, execute:

docker run --rm -v $(pwd):/docs -p 4000:4000 arangodb/arangodb-docs

This will watch for file changes and you will be able to see the resulting static site on http://127.0.0.1:4000/docs/stable/.

Note that Jekyll's --incremental build option is enabled. In addition, DocuBlocks are parsed once per invocation and then cached in memory. If you encounter stale content, then stop the container and run:

docker run --rm -v $(pwd):/docs -p 4000:4000 arangodb/arangodb-docs bundler exec jekyll serve -H 0.0.0.0 --trace

Alternatively, you may stop the container, execute either of the following commands, and run the normal Docker command again (without additional arguments).

  • rm -rf .jekyll-cache/ .jekyll-metadata _site/
  • docker run --rm -v $(pwd):/docs arangodb/arangodb-docs bundler exec jekyll clean

To build the documentation without watch mode or serving the resulting site, you can execute:

docker run --rm -v $(pwd):/docs arangodb/arangodb-docs bundler exec jekyll build --trace

After that the HTML files in _site/ are ready to be served by a webserver:

cd _site
python3 -m http.server

To check for broken references (e.g. internal links), you can run htmltest:

docker run --rm -v $(pwd):/docs arangodb/arangodb-docs htmltest

Performance

A full build (all versions) will take quite a while. You can use Jekyll's watch mode to let it continuously rebuild the pages you change after an initial build. For simple documentation changes this process normally works perfect.

However there are cases where Jekyll won't detect changes. This is especially true when changing plugins and configuration (including the navigation YAML when adding a new page). To be sure you have an up-to-date version remove the _site directory and then abort and restart the watch mode.

To speed up the build process you may disable certain versions from being built by changing the _config.yml:

exclude:
# - 3.12/
# - 3.11/
# - 3.10/
  - 3.9/
  - 3.8/

Above example disables versions 3.8 and 3.9, so that only 3.10 through 3.12 are built. Do not commit these changes of the configuration!

Note that building may fail if you disable certain versions that contain the files that other versions refer to with symlinks, or required versions as defined in _config.yml:

versions:
  stable: "3.8"
  devel: "3.9"

Documentation Structure

Versions

In the root directory, the directories 3.8, 3.9 etc. represent the individual ArangoDB versions and their documentation. We only maintain one version of the documentation for every minor and major version (3.9, 4.0, etc.) but not for every patch release (e.g. 3.8.2).

The content for different documentation versions used to be in version branches (2.7, devel, etc.) in the arangodb/arangodb repository, but now all documentation versions live in the main branch of this repository. This 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 (copy-pasting text or files).

Books (Parts)

The documentation is split into different parts, called "books" for historical reasons. The core book (Manual) of a version does not have an own folder for its content, but the files are found in the version directory, e.g. 3.8/*.md. Other books (AQL, HTTP) have subfolders in the version folder, e.g. 3.8/aql/.

There are also books (Drivers, ArangoGraph) that are not directly couple to ArangoDB versions, that have their files in an own folders in the root directory, e.g. arangograph/*.md. These folders are symlinked in multiple version folders. Some files, like release notes, are also symlinked to reduce maintenance costs.

The organization of documents is flat, namely there are no subdirectories per book (as opposed to the previous documentation system). For example, all files of the AQL part are in the aql/ folder. It does not have any subfolders like aql/examples/. Instead, the file name reflects which files belong together, e.g. aql/examples-counting.md.

Special Folders

Content folders aside, there are the following other directories:

Name Description
_data data files which are used by plugins and layouts, including the navigation definitions
_includes templates for custom tags and layout partials
_layouts layout definitions that can be used in YAML frontmatter like layout: default
_plugins Jekyll extensions for the navigation, version switcher, custom tags / blocks etc.
_site default output directory (not committed)
assets files not directly related to the documentation content that also need to be served (e.g. the ArangoDB logo)
js JavaScript files used by the documentation site
scripts Scripts which were used in the migration process from Gitbook to Jekyll (not really needed anymore)
styles CSS files for the site, including a lot of legacy from Gitbook

Working with the Documentation Content

Markup Overview

The documentation is written in the light-weight markup language Markdown. There are different flavors of Markdown and it is further extended by Liquid, Jekyll's templating language, as well as our own customization.

Below is a list of the most commonly used markup, and an approximation of how it gets rendered:

Element Markdown Preview HTML
Text line
A single line
of text
A single line of text A single line of text
Paragraph
A single
paragraph.

Another paragraph.

A single paragraph.

Another paragraph.

<p>A single paragraph.</p>
<p>Another paragraph.</p>
Heading 1 # Level 1

Level 1

<h1>Level 1</h1>
Heading 1 (Variant)
Level 1
=======

Level 1

<h1>Level 1</h1>
Headling 2 ## Level 2

Level 2

<h2>Level 2</h2>
Headling 2 (Variant)
Level 2
-------

Level 2

<h2>Level 2</h2>
Headling 3 ### Level 3

Level 3

<h3>Level 3</h3>
Headling 4 #### Level 4

Level 4

<h4>Level 4</h4>
Headling 5 ##### Level 5
Level 5
<h5>Level 5</h5>
Headling 6 ###### Level 6
Level 6
<h6>Level 6</h6>
Italic *italic* italic <em>italic</em>
Italic _italic_ italic <em>italic</em>
Bold **bold** bold <strong>bold</strong>
Bold __bold__ bold <strong>bold</strong>
Bold & Italic ***bold & italic*** bold & italic <strong><em>bold & italic</em></strong>
Bold & Italic ___bold & italic__ bold & italic <strong><em>bold & italic</em></strong>
Superscript 2<sup>32</sup> 232 2<sup>32</sup>
Subscript 2<sub>32</sub> H2O H<sub>2</sub>O
Blockquote > quote
quote
<blockquote>quote</blockquote>
Ordered List
1. First
2. Second
3. Third
  1. First
  2. Second
  3. Third
<ol>
  <li>First</li>
  <li>Second</li>
  <li>Third</li>
</ol>
Unordered List
- First
- Second
- Third
  • First
  • Second
  • Third
<ul>
  <li>First</li>
  <li>Second</li>
  <li>Third</li>
</ul>
Unordered List
* First
* Second
* Third
  • First
  • Second
  • Third
<ul>
  <li>First</li>
  <li>Second</li>
  <li>Third</li>
</ul>
Inline Code `code value` code value <code>code value</code>
Fenced Code
```js
new Date(); // JavaScript
```
new Date(); // JavaScript
<pre><code>new Date(); // JavaScript</code></pre>
Code Block
    shell> pwd
    /home/alice
shell> pwd
/home/alice
<pre><code>shell&gt; pwd
/home/alice</code></pre>
Horizontal Rule ---
<hr />
Link (Internal) [label](book/file.html) label <a href="book/file.html">label</a>
Link (Anchor) [label](#element-id) label <a href="#element-id">label</a>
Link (External) [label](https://www.arangodb.com/){:target="_blank"} label <a href="https://www.arangodb.com" target="_blank">label</a>
Link (External) <https://www.arangodb.com/>{:target="_blank"} https://www.arangodb.com/ <a href="https://www.arangodb.com" target="_blank">https://www.arangodb.com/</a>
Image ![ArangoDB Logo](assets/arangodb_logo_small_2016.png) ArangoDB Logo <img src="assets/arangodb_logo_small_2016.png" alt="ArangoDB Logo">
Table
| A  | B  | C  |
|----|----|----|
| A1 | B1 | C1 |
| A2 | B2 | C2 |
ABC
A1B1C1
A2B2C2
<table>
  <thead>
    <tr>
      <th>A</th>
      <th>B</th>
      <th>C</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>A1</td>
      <td>B1</td>
      <td>C1</td>
    </tr>
    <tr>
      <td>A2</td>
      <td>B2</td>
      <td>C2</td>
    </tr>
  </tbody>
</table>
Frontmatter
---
layout: default
description: Page about X
title: Feature X
---
<title>Feature X | ArangoDB Documentation</title>
<meta itemprop="description" name="description" content="Page about X" />
Danger
{% hint 'danger' %}
Unrecoverable fault
{% endhint %}
❌ Unrecoverable fault
<div class="alert alert-danger" …>
Unrecoverable fault
</div>
Warning
{% hint 'warning' %}
Common pitfall
{% endhint %}
⚠ Common pitfall
<div class="alert alert-warning" …>
Common pitfall
</div>
Security
{% hint 'security' %}
Security warning
{% endhint %}
🛡 Security warning
<div class="alert alert-warning" …>
Security warning
</div>
Info
{% hint 'info' %}
Informative note
{% endhint %}
ℹ Informative note
<div class="alert alert-info" …>
Informative note
</div>
Tip
{% hint 'tip' %}
Useful hint
{% endhint %}
✔ Useful hint
<div class="alert alert-success" …>
Useful hint
</div>
Include {% include hint-ee-arangograph.md feature="SmartGraphs" plural=true %}
ℹ SmartGraphs are only available in the Enterprise Edition, including the ArangoGraph Insights Platform.
<div class="alert alert-info" …>
SmartGraphs are only available in the
<a href="https://www.arangodb.com/enterprise-server/" target="_blank">Enterprise Edition</a>,
including the <a href="https://cloud.arangodb.com/home" target="_blank">ArangoGraph Insights Platform</a>.
</div>
Version (full) {{ site.data.versions[page.version.name] }} v3.9.0-devel v3.9.0-devel
Version (major.minor) {{ page.version.version }} 3.9 3.9
Version Condition
{%- assign ver = "3.8" | version: ">=" %}
{%- if ver %}
Current version is greater than 3.8
{%- else %}
Current version is less than or equal to 3.8
{%- endif %}
Current version is greater than 3.8 Current version is greater than 3.8
Version Remark <small>Introduced in: v3.8.2</small> Introduced in: v3.8.2 <small>Introduced in: v3.8.2</small>

Content Guidelines

  • 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 a Lead Paragraph 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 hint boxes or everything ends up being a highlight.

Syntax Guidelines

  • 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.html#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 here as 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. ../drivers/js.html instead of /docs/stable/drivers/js.html or https://www.arangodb.com/docs/stable/drivers/js.html.

  • Append {:target="_blank"} to Markdown links which point to external sites, e.g. [external link](https://www.github.com/){:target="_blank"}.

  • Avoid **bold** and _italic_ markup in headlines. Inline `code` is acceptable for code values, nonetheless.

  • - is preferred for bullet points in unordered lists over *

  • Use # and ## for level 1 and 2 headlines for new content over === and --- 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 frontmatter ---).

  • Use aql as language in fenced code blocks for highlighting AQL queries in version 3.10 and later. Use js for 3.9 and older.

    FOR i IN 1..3 RETURN CONCAT("a", i)
    
  • 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:

    • ```py (instead of ```python)
    • ```yaml (instead of ```yml)
    • ```sh (instead of ```shell)
    • ```js (instead of ```javascript)
    • ``` (instead of ```plain or ```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)
    • Active Failover
    • Datacenter-to-Datacenter Replication (note the hyphens), DC2DC
    • ArangoGraph Insights Platform and ArangoGraph for short, but not Oasis, ArangoDB Oasis, or ArangoDB Cloud
  • Do not capitalize the names of executables or code values, e.g. write arangosh instead of Arangosh.

  • Do not write TODOs right into the content. Use an HTML comment <!-- An HTML comment --> if it is okay that the comment will be visible in the page source of the generated files. Otherwise use {% comment %}...{% endcomment %}.

Adding links

The official way to cross-reference other pages within the documentation would be to use Jekyll's link tag ({% link path/to/file.md %}). This mechanism is not used, however. We use plain Markdown links, but this has the drawback of having to change the file extension from .md to .html so that it will work once the documentation is built.

This is an [internal link](aql/functions-numeric.html#max).

Note that internal links should be relative, i.e. not include a version number, unless it is supposed to point to a different version of the documentation on purpose. To point from one book to another, you may need to use .. to refer to the parent folder of a file.

From To Markdown
3.9/tutorials.md 3.9/graphs.md [Graphs](graphs.html)
3.9/tutorials.md 3.9/aql/operators.md [AQL Operators](aql/operators.html)
3.9/aql/operators.md 3.9/tutorials.md [Tutorials](../tutorials.html)
3.9/aql/operators.md 3.9/http/pregel.md [Pregel HTTP API](../http/pregel.html)
3.9/tutorials.md 3.8/architecture.md [Architecture v3.8](../3.8/architecture.html)
3.9/aql/operators.md 3.8/tutorials.md [Tutorials v3.8](../../3.8/tutorials.html)

You can also link to headlines within a page like [label](#anchor-id). The anchor ID is the headline text but with the characters converted to Latin base characters, all lower-case, spaces and other special characters replaced by hyphens -. Underscores remain, however. Some examples:

Headline Anchor
Some Text #some-text
Ümläuté #umlaute
Insert / Save #insert--save
TO_HEX() #to_hex
norm Analyzer #norm-analyzer
--startup.option-name #--startupoption-name

For external links, please add {:target="_blank"} so that they open in a new tab when clicked:

This is an [external link](https://www.arangodb.com/){:target="_blank"}

Version Remarks

The main page about a new feature should indicate the version the feature was added in, as shown below:

---
layout: default
description: >-
  Feature summary
---
# New feature

<small>Introduced in: v3.10.0</small>

{{ page.description }}
{:class="lead"}

...

Similarly, the remark should be added if only a section is added to an existing page, as shown below:

# Existing feature

...

## New feature section

<small>Introduced in: v3.10.0</small>

...

The value v3.10.0 implies that all later versions also have this feature (3.10.1, 3.10.2, etc., as well as 3.11.0 and later). If this is not the case, then also mention the other relevant versions. For example, if a feature is added to 3.9.6 and 3.10.2, then write the following in the 3.10 documentation:

<small>Introduced in: v3.9.6, v3.10.2</small>

All later documentation versions should use a copy of the content, as thus the 3.11 documentation would contain the same.

In the 3.9 documentation, only mention versions up to this documentation version (excluding 3.10 and later in this example), pretending no later version exists to be consistent with the rest of the 3.9 documentation and to avoid additional maintenance burdens:

<small>Introduced in: v3.9.6</small>

New options in the JavaScript and HTTP APIs are covered by the release notes, but if new options are added mid-release (not in the x.x.0 release but a later bugfix version), then this should be pointed out as follows:

- `existingOption` (number, _optional_): ...
- `newOption` (string, _optional_): ... (introduced in v3.9.6, v3.10.2).

You may also add a remark if an existing feature or option is significantly extended by a new (sub-)option in a x.x.0 release.

Edition Remarks

Pages and sections about Enterprise Edition features should indicate that the Enterprise Edition is required using a hint box. Use the following include in the general case:

{% include hint-ee-arangograph.md feature="New feature X" %}

This should be placed after version remarks if there are any.

Most Enterprise Edition features are also available in ArangoGraph, but some features are not or in a different form (e.g. DC2DC, Hot Backup). If a feature is not available in ArangoGraph, use the following include instead:

{% include hint-ee.md feature="New feature X" %}

If the feature name is a plural form of a word, set the plural option to true (this works with both includes):

{% include hint-ee-arangograph.md feature="EnterpriseGraphs" plural=true %}

In the release notes, add the following at the end of a section about a new Enterprise Edition feature:

This feature is only available in the Enterprise Edition.

API options that are only available in the Enterprise Edition should have a remark as follows:

- `enterpriseOption` (boolean, _optional_): ...
  (Enterprise Edition only).

If there are both a version remark and an Enterprise Edition remark, use:

- `enterpriseOption` (boolean, _optional_): ...
  (introduced in v3.9.6 and v3.10.2, Enterprise Edition only).

Adding a Lead Paragraph

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.

# Using Feature X

You can do this and that with X, and it is ideal to solve problem Y
{:class="lead"}

The lead paragraph needs to be placed between the top-level headline and the first content paragraph. It should end without a period, contain no links and usually avoid other markup as well (bold, italic). This also enables the use of the lead paragraph as metadata for the page:

---
layout: default
description: >-
  You can do this and that with X, and it is ideal to solve problem Y
title: Feature X
---
# Using Feature X

{{ page.description }}
{:class="lead"}

The generated metadata looks like this:

<meta property="og:title" content="Feature X | ArangoDB Documentation" />
<meta property="og:description" content="You can do this and that with X, and it is ideal to solve problem Y" />

Adding a page

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, 3.8/aql/examples.md will become http://www.arangodb.com/docs/3.8/aql/examples.html.

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 frontmatter:

---
layout: default
description: A meaningful description of the page
title: Short title
---

Add the actual content formatted in Markdown syntax below the frontmatter.

Then add the page to the navigation. Each book has a navigation tree represented as a nested data structure in YAML syntax. The NavigationTag plugin creates the navigation on the left-hand side from it. The YAML file for a book can be found here: _data/<version>-<book>.yml.

Open the respective navigation definition file, e.g. _data/3.8-aql.yml if the page should be added to the AQL book of version 3.8. Let us assume the file is aql/operations-create.md and the page is supposed to show above the FOR language construct in the navigation. Locate where that other page is added and insert a new pair of lines for the new page:

 - text: High level Operations
   href: operations.html
   children:
+    - text: CREATE
+      href: operations-create.html
     - text: FOR
       href: operations-for.html

text will be used as label in the navigation. href is the name of the file, relative to the current book. Note that the file extension needs to be .html, not .md!

Renaming a page

The URL of a page is derived from the file name. If you rename a file, e.g. from old-name.md to new-name.md, make sure to add a redirect for the old URL by adding the following to the frontmatter:

 ---
 layout: default
 description: ...
 title: ...
 ---
+redirect_from:
+  - old-name.html # 3.8 -> 3.9

The URL should be relative and the comment (#) indicate the versions it was renamed in (can also be the same version twice, e.g. # 3.8 -> 3.8).

Setting anchor IDs

Headlines are assigned automatically generated identifiers based on their text. In some cases you may want to set an ID explicitly:

### A headline {: #custom-id }

Disable or limit table of contents

The table of contents (ToC) on the right-hand side at the top of a page lists the headlines if there at least three on the page. It can be disabled for individual pages with the following frontmatter:

---
layout: default
page-toc:
  disable: true
---

It can also be restricted to a maximum headline level to omit the deeper nested headlines for less clutter:

---
layout: default
page-toc:
  max-headline-level: 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.

Updating version numbers

Version number schema

The version number schema is vMajor.Minor.Patch, e.g. v3.9.5. Patch releases contain bugfixes only. Minor releases often add new features and come with some breaking changes. Major releases add new features and may contain substantial breaking changes.

Non-stable versions can have a suffix. The devel version usually ends with -devel, e.g. v3.9.0-devel. Preview releases can also have suffixes like -alpha.1, -beta.2, -rc.3.

Patch releases

When a new patch release is published, the respective version number in _data/versions.yml is incremented by the release automation:

-"3.8": "v3.8.1"
+"3.8": "v3.8.2"

The examples should be re-generated to ensure that they match the actual server behavior of the new version.

Major and minor releases

When a new major or minor version is released to the public, the new stable version needs to be made the default version for the documentation. It will be available under the stable alias at https://www.arangodb.com/docs/stable/. At the same time, the in-development version needs to be updated as well. It will be available under the devel alias at https://www.arangodb.com/docs/devel/.

The stable and devel versions can be adjusted in the _config.yml under the versions key:

 versions:
-  stable: "3.8"
-  devel: "3.9"
+  stable: "3.9"
+  devel: "3.10"

Also update the version number in the _redirects file to the latest stable version, so that Netlify previews default to this version:

-/              /docs/3.8/
+/              /docs/3.9/

Update the list of files to exclude to let Algolia index the new stable version:

 algolia:
   ...
   files_to_exclude:
     - 3.10/**/*
-    - 3.9/**/*
-#   - 3.8/**/*  # OUR STABLE VERSION
+#   - 3.9/**/*  # OUR STABLE VERSION
+    - 3.8/**/*
     - 3.7/**/*
     - ...

Do not forget to re-generate the examples before publishing.

Deprecating a version

When an ArangoDB version reaches End-of-Life, its documentation needs to be marked as such. The respective version needs to be added to the _data/deprecations.yml file for that:

 - "3.5"
 - "3.6"
+- "3.7"

It makes a warning show at the top of every page for that version.

Adding a new version

  • Run below commands in Bash. If you use Git Bash on Windows, it will dereference symlinks by default (copies the referenced files)! To avoid that, start Git Bash as administrator and run export MSYS=winsymlinks:nativestrict before you continue.
  • Copy the latest devel version to a new directory i.e. cp -a 3.9 4.0
  • Create the necessary navigation definition files in _data by copying, e.g.
    cd _data
    for book in aql drivers http manual arangograph; do
      cp -a "3.9-${book}.yml" "4.0-${book}.yml"
    done
    cd ..
  • Create relative symlinks to program option JSON files and the metrics YAML file in _data, like
    cd _data
    for prog in backup bench d dump export import inspect restore sh vpack; do
      ln -s "../4.0/generated/arango${prog}-options.json" "4.0-program-options-arango${prog}.json"
    done
    ln -s "../4.0/generated/allMetrics.yaml" "4.0-allMetrics.yaml"
    cd ..
  • Adjust the version numbers in redirect_from URLs in the frontmatter to match the new version folder, e.g.
     redirect_from:
    -  - /3.9/path/to/file.html # 3.6 -> 3.7
    +  - /4.0/path/to/file.html # 3.6 -> 3.7
    This is only necessary for absolute redirects. Relative redirects are preferred, e.g. - old.html in new.html (may also include ..). If pages were removed, then you may want to use absolute redirects to point to older versions or redirect to completely different pages.
  • Create release note pages for the new version (here: 4.0 / 40) and add them to the navigation (4.0-manual.yml):
     - text: Release Notes
       href: release-notes.html
       children:
    +    - text: Version 4.0
    +      href: release-notes-40.html
    +      children:
    +        - text: What's New in 4.0
    +          href: release-notes-new-features40.html
    +        - text: Known Issues in 4.0
    +          href: release-notes-known-issues40.html
    +        - text: Incompatible changes in 4.0
    +          href: release-notes-upgrading-changes40.html
    +        - text: API changes in 4.0
    +          href: release-notes-api-changes40.html
  • Add the relevant links to the release notes overview page 4.0/release-notes.html
  • Delete the release note pages of the previous version (here: 3.9) in the folder of the new version (here: 4.0) and symlink the files instead:
    cd 4.0
    rm release-notes-39.md
    rm release-notes-new-features39.md
    rm release-notes-known-issues39.md
    rm release-notes-upgrading-changes39.md
    rm release-notes-api-changes39.md
    ln -s ../3.9/release-notes-39.md release-notes-39.md
    ln -s ../3.9/release-notes-new-features39.md release-notes-new-features39.md
    ln -s ../3.9/release-notes-known-issues39.md release-notes-known-issues39.md
    ln -s ../3.9/release-notes-upgrading-changes39.md release-notes-upgrading-changes39.md
    ln -s ../3.9/release-notes-api-changes39.md release-notes-api-changes39.md
    cd ..
  • Check if any links to version-specific pages such as the release notes need to be updated, e.g.
    -See [Known Issues](release-notes-known-issues39.html).
    +See [Known Issues](release-notes-known-issues40.html).
  • Add a section Version 4.0 to 4.0/highlights.html including a link to What's New in 4.0
  • Add the version to _data/versions.yml with the full version name
  • Add all books of that version to _data/books.yml
  • Add entries for the new version in _config.yml to the algolia and exclude keys:
     algolia:
       files_to_exclude:
    +    - 4.0/**/*
         - 3.9/**/*
     exclude:
       - ...
    +  - 4.0/generated
       - 3.9/generated
       - ...
    +# - 4.0/
     # - 3.9/

Adding a new arangosh example

A complete example with the preferred indentation:

    {% arangoshexample examplevar="examplevar" script="script" result="result" %}
    @startDocuBlockInline ensureUniquePersistentSingle
    @EXAMPLE_ARANGOSH_OUTPUT{ensureUniquePersistentSingle}
    ~ 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");
    @END_EXAMPLE_ARANGOSH_OUTPUT
    @endDocuBlock ensureUniquePersistentSingle
    {% endarangoshexample %}
    {% include arangoshexample.html id=examplevar script=script result=result %}

Jekyll requires the example code to be encapsulated by an arangoshexample block, followed by an include tag to embed the example:

{% arangoshexample examplevar="examplevar" script="script" result="result" %}
...
{% endarangoshexample %}
{% include arangoshexample.html id=examplevar script=script result=result %}

Inside the block, two more wrappers are needed. The outer one marks the beginning and end of a so-called DocuBlock and gives it a unique name that will be used as file name for the example transcript (e.g. 3.9/generated/Examples/name_of_docublock.generated). The inner one indicates that it is an arangosh example and not a curl example and repeats the DocuBlock name:

@startDocuBlockInline name_of_docublock
@EXAMPLE_ARANGOSH_OUTPUT{name_of_docublock}
...
@END_EXAMPLE_ARANGOSH_OUTPUT
@endDocuBlock name_of_docublock

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 give the name a suffix of _cluster.

Inside the wrappers, 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");

Each statement needs to be either on a single line, or indicate that line continuation is required for statements spanning multiple lines. A leading pipe character | is required for all lines except the last line of a multi-line statement:

  db._create("collection");
| db.collection.save([
|   { multiple: true },
|   { lines: true }
  ]);
| for (var i = 0; i < 3; i++) {
|   db.collection.save({ _key: "k" + i });
  }
  db._drop("collection");

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");

Examples need to remove the collections and Views they create. Not dropping them will raise an error unless they are specifically exempt:

~ db._create("collection");
~ db._createView("view", "arangosearch", {...});
  db.collection.save({...});
~ addIgnoreView("view");
~ addIgnoreCollection("collection");

This is helpful for creating collections and Views once, using them in multiple examples, and finally dropping them instead of having to create and drop them in each example. You need to choose the names for the DocuBlocks so that they are alphabetically sortable to have them execute in the correct order. The last example of the series should undo the ignore to catch unintended leftovers:

~ removeIgnoreCollection("collection");
~ removeIgnoreView("view");
~ db._dropView("view");
~ db._drop("collection");

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.

If you want to wrap the special comment to a new line but suppress and empty line in the output, you can use | on the first and ~ on the second line:

| db._document("collection/does_not_exist");
~ // xpError(ERROR_ARANGO_DOCUMENT_NOT_FOUND)

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();

Adding a new AQL example

Complete example with the preferred indentation:

    {% aqlexample examplevar="examplevar" type="type" query="query" bind="bind" result="result" %}
    @startDocuBlockInline joinTuples
    @EXAMPLE_AQL{joinTuples}
    @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
        }
    @BV {
      friend: "friend"
    }
    @END_EXAMPLE_AQL
    @endDocuBlock joinTuples
    {% endaqlexample %}
    {% include aqlexample.html id=examplevar type=type query=query bind=bind result=result %}

Similar to arangosh examples, several wrappers are required. The aqlexample block encapsulates the example for Jekyll, and the include tag embeds it:

{% aqlexample examplevar="examplevar" type="type" query="query" bind="bind" result="result" %}
...
{% endaqlexample %}
{% include aqlexample.html id=examplevar type=type query=query bind=bind result=result %}

Inside the block, there is a DocuBlock wrapper and a wrapper to indicate that this is an AQL example:

@startDocuBlockInline name_of_docublock
@EXAMPLE_AQL{name_of_docublock}
...
@END_EXAMPLE_AQL
@endDocuBlock name_of_docublock

The example can optionally specify a dataset that will be loaded before the query is run:

@DATASET{name_of_dataset}

See https://github.com/arangodb/arangodb/blob/devel/js/common/modules/@arangodb/examples/examples.js for the available datasets.

To get the query explain output including the execution plan instead of the actual query result, you can optionally specify:

@EXPLAIN{TRUE}

Then the actual AQL query follows, e.g.

FOR i IN 1..3
  RETURN i

The query can optionally use bind parameters that can be passed like this:

FOR elem IN @arr
  RETURN elem
@BV {
  arr: ["foo", "bar"]
}

Adding a new DocuBlock

DocuBlocks define reusable pieces of content but the DocuBlocks system is mainly used for describing the HTTP API by now. It is also used for arangosh and AQL examples, using inline DocuBlocks (see above).

To embed a DocuBlock in the documentation, use the docublock tag in a Markdown file:

{% docublock name %}

HTTP API DocuBlocks

The source files for DocuBlocks that describe and demonstrate the HTTP API are located in the main repository at Documentation/DocuBlocks/Rest/: https://github.com/arangodb/arangodb/tree/devel/Documentation/DocuBlocks/Rest They are written in a proprietary text format that can be converted to Swagger 2.0 definitions as well as rendered by the documentation tooling.

A complete example of such a DocuBlock:

@startDocuBlock post_api_foo
@brief creates a foo

@RESTHEADER{POST /_api/foo/{param}, Create foo, createFoo}

@HINTS
{% hint 'warning' %}
Text to be displayed in a callout box.
{% endhint %}

@RESTDESCRIPTION
Detailed description of the endpoint.

@RESTURLPARAMETERS

@RESTURLPARAM{param,string,required}
Dynamic piece of the URL path, signified by curly {braces} in the @RESTHEADER route.

@RESTQUERYPARAMETERS

@RESTQUERYPARAM{creationOption,boolean,optional}
One-off setting that is not persisted unlike e.g. collection properties.

@RESTHEADERPARAMETERS

@RESTHEADERPARAM{If-Match,string,optional}
An HTTP header field that you can set.

@RESTBODYPARAM{name,string,required,string}
Primitive body parameter that is of type string and mandatory.

@RESTBODYPARAM{fooOptions,object,optional,post_api_foo_opts}
Complex body parameter with key `fooOptions` and an object as value.
The object is described by @RESTSTRUCTs that reference `post_api_foo_opts`.

@RESTSTRUCT{type,post_api_foo_opts,integer,required,int64}
A nested parameter with parent `fooOptions`, key `type`, and expecting an integer as value.

@RESTRETURNCODES

@RESTRETURNCODE{200}
HTTP status code returned if the request was successful.

@RESTREPLYBODY{error,boolean,required,}
`false` in this case

@RESTRETURNCODE{400}
HTTP status code returned if the request failed.

@RESTREPLYBODY{error,boolean,required,}
`true` in this case

@EXAMPLES

@EXAMPLE_ARANGOSH_RUN{RestFooCreate}
    var url = "/_api/foo/example?creationOption=true";
    var body = {
      name: "testFoo",
      fooOptions: {
        type: 123
      }
    };

    var response = logCurlRequest('POST', url, body);
    assert(response.code === 200);
    logJsonResponse(response);
@END_EXAMPLE_ARANGOSH_RUN

@endDocuBlock

@startDocuBlock / @endDocuBlock

Every DocuBlock starts with @startDocuBlock followed by a name, and ends with @endDocuBlock.

@startDocuBlock post_api_foo
...
@endDocuBlock

There is typically just one DocuBlock in a file but a single file can contain multiple DocuBlocks.

The naming convention is to use snake_case and the pattern method_path, e.g. post_api_collection for the POST /_api/collection endpoint. The DocuBlock name is often used as file name, too, but it can deviate. The file extension is .md as the content is Markdown-formatted text (DocuBlock markup aside).


@brief

The first structural element in a DocuBlock should be @brief, followed by a summary of what the endpoint does:

@brief creates a foo

@RESTHEADER

The next element should be the @RESTHEADER:

@RESTHEADER{VERB /url/{param}, Description, operationId}
  • VERB: An HTTP method, one of: GET, POST, PATCH, PUT, DELETE, HEAD
  • /url…: URL path of the endpoint. Should start with a /. May contain placeholders in curly braces for URL parameters (here: {param}) that need to be described in a subsequent @RESTURLPARAMETERS section by a @RESTURLPARAM element.
  • Description: A short description of what the endpoint is for. More or less the same as @brief.
  • operationId: A string that identifies this endpoint. Needs to be unique across all endpoint descriptions. It defaults to a de-spaced Description. It should not be changed anymore.

@HINTS

There can optionally be a @HINTS element with one or more hint blocks:

@HINTS
{% hint 'type' %}
Remarks to highlight.
{% endhint %}
  • type: One of tip, info, warning, security, danger

@RESTURLPARAMETERS / @RESTURLPARAM

If @RESTHEADER contains at least one {placeholder} for URL parameters, then a @RESTURLPARAMETERS section with @RESTURLPARAM elements for every placeholder is required:

@RESTURLPARAMETERS

@RESTURLPARAM{param,type,necessity}
Description.

@RESTURLPARAM...
  • param: Name of the URL parameter. Needs to match the placeholder in @RESTHEADER.
  • type: Swagger type (should always be string)
  • necessity: needs to be required. optional is not supported anymore. Create a second DocuBlock without the parameter if necessary.

@RESTQUERYPARAMETERS / @RESTQUERYPARAM

If an endpoint supports query parameters (like ?param1=aaa&param2=bbb after the URL path), then a @RESTQUERYPARAMETERS section with @RESTQUERYPARAM elements for every query parameter is needed:

@RESTQUERYPARAMETERS

@RESTQUERYPARAM{name,type,necessity}
Description.

@RESTQUERYPARAM...
  • param: Name of the query parameter.
  • type: Swagger type (typically string or boolean)
  • necessity: either required or optional

@RESTHEADERPARAMETERS / @RESTHEADERPARAM

If an endpoint supports options that can be set in the HTTP header, then a @RESTHEADERPARAMETERS section with @RESTHEADERPARAM elements for every header field is needed:

@RESTHEADERPARAMETERS

@RESTHEADERPARAM{Field,type,necessity}
Description.

@RESTHEADERPARAM...
  • Field: Name of the HTTP header field.
  • type: Swagger type (should always be string)
  • necessity: either required or optional

@RESTBODYPARAM

To describe the request payload, use @RESTBODYPARAM elements. Note that there is no @RESTBODYPARAMETERS section:

@RESTBODYPARAM{name,type,necessity,subtype}
Description.

@RESTBODYPARAM...
  • name: The name of the body parameter.
  • type: Swagger type (typically string, boolean, integer, number), array, or object
  • necessity: either required or optional
  • subtype: can be a Swagger format, reference a @RESTSTRUCT by name (if type is object or array), or be empty.

Example of a body parameter that expects an array of strings:

@RESTBODYPARAM{fields,array,required,string}

Example of a body parameter that expects an array of objects without further description of these objects:

@RESTBODYPARAM{primarySort,array,optional,object}

Example of a body parameter that expects an array of objects. Each object needs to have a username key with a string value, and can optionally have an active key with a boolean value:

@RESTBODYPARAM{users,array,optional,user_object}

@RESTSTRUCT{username,user_object,string,required,}
Login name of an existing user or one to be created.

@RESTSTRUCT{active,user_object,boolean,optional,}
Whether the account should be activated or not. Defaults to `true`.

Note that you can reference @RESTSTRUCTs that are defined in other files. This is useful for sharing common data structures. The files called 1_structs.md are used for this kind of sharing. The 1_ prefix was chosen because operating systems typically iterate folder contents in alphabetical order, ensuring that it gets processed before other files in the same folder, so that the @RESTSTRUCT definition is available before it gets referenced.


@RESTALLBODYPARAM

If an endpoint has a schemaless JSON body or plaintext payload, then you can use a single @RESTALLBODYPARAM element instead of any @RESTBODYPARAMs:

@RESTALLBODYPARAM{name,type,necessity}
Description.
  • name: A name, unused
  • type: json / object or string (plaintext)
  • necessity: required or optional

@RESTRETURNCODES / @RESTRETURNCODE / @RESTREPLYBODY

To describe the response payload, use a @RESTRETURNCODES section with one or more @RESTRETURNCODE subsections. You should add a subsection for every relevant HTTP status code. General status codes that are not specific to the endpoint (e.g. 503 Service Unavailable) should not be described. Each subsection may have @RESTREPLYBODY elements that describe the response data structure:

@RESTRETURNCODES

@RESTRETURNCODE{status}
Description.

@RESTREPLYBODY{name,type,necessity,subtype}
Description.

@RESTREPLYBODY...

@RESTRETURNCODE...

@RESTREPLYBODY...
  • status: A 3-digit HTTP status code.
  • name: The name of the reply body attribute.
  • type: Swagger type (typically string, boolean, integer, number), array, or object
  • necessity: either required or optional
  • subtype: can be a Swagger format, reference a @RESTSTRUCT by name (if type is object or array), or be empty.

@RESTSTRUCT

For nested data structures, as well for sharing structural descriptions between DocuBlocks, you can use @RESTSTRUCT. Such structs can be referenced in @RESTBODYPARAM, @RESTREPLYBODY, and other @RESTSTRUCT elements.

@RESTSTRUCT{name,struct,type,necessity,subtype}
Description.
  • name: The name of the body parameter.
  • struct: A name for this data structure that you can refer to in subtype of a @RESTBODYPARAM, @RESTREPLYBODY, or another @RESTSTRUCT element.
  • type: Swagger type (typically string, boolean, integer, number), array, or object
  • necessity: either required or optional
  • subtype: can be a Swagger format, reference a @RESTSTRUCT by name (if type is object or array), or be empty.

Special case of a @RESTREPLYBODY element referencing a @RESTSTRUCT as top-level object description (note the empty name):

@RESTREPLYBODY{,object,required,collection_info}

Example of a response description with an array at the top-level (note the empty name):

@RESTREPLYBODY{,array,required,get_api_query_rules}

@EXAMPLES

You can add an arbitrary number of examples to a DocuBlock in an @EXAMPLES section. An HTTP API example needs to be wrapped by @EXAMPLE_ARANGOSH_RUN and @END_EXAMPLE_ARANGOSH_RUN:

@EXAMPLES

@EXAMPLE_ARANGOSH_RUN{name}
    /* code */
@END_EXAMPLE_ARANGOSH_RUN

@EXAMPLE_ARANGOSH_RUN...
  • name: The name of the example. Will be used as file name Documentation/Examples/<name>.generated. The convention for Rest DocuBlocks is to use PascalCase, Rest as prefix, the endpoint name, and succinct description of what the example is about, e.g. RestCollectionCreateKeyopt.

Unlike arangosh examples (@EXAMPLE_ARANGOSH_OUTPUT), 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 request
  • logCurlRequestRaw(method, url, body) → response: make and output an HTTP request without code highlighting
  • logCurlRequestPlain(method, url, body) → response: make and output an HTTP request, with the payload decoded (new lines instead of \r\n etc.). 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)
  • logPlainResponse(response): output decoded response (new lines instead of \r\n etc.). Useful for formatting complex responses, like from batch requests.
  • logHtmlResponse(response): output HTML
  • logErrorResponse(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 may inspect the generated JavaScript code of the failed example in arangosh.examples.js.

Troubleshooting

  • Liquid Exception: No title found for /x.x/xxx.html.
    Maybe you forgot to link it to the navigation? in /_layouts/default.html
    

    Jekyll points you to the wrong file. _layouts/default.html should be fine. Jekyll has no native support for navigation menus. _plugins/NavigationTag.rb is a custom plugin to generate the left-hand side navigation from _data/<version>-<book>.yml. You probably forgot to add your new page there.

  • docs/page.html
      target does not exist --- docs/page.html --> target.md
    

    If you see this error and the target ends with an .md extension then change it to .html. The resulting page has to be referenced, not the source file!

  • docs/page1.html
      target does not exist --- docs/page1.html --> target.html
    docs/page2.html
      target does not exist --- docs/page2.html --> target.html
    ...
    

    or

    docs/page.html
      target is a directory, no index --- docs/page.html --> /docs/newfolder/
    

    If you get dozens of these errors for the same target, then you likely forgot to add a frontmatter to that page (docs/target.md):

    ---
    layout: default
    description: ...
    ---

    The error is issued once per page of the same book because the target page is linked in the navigation.

    Another reason can be a faulty reference in the navigation file (e.g. _data/3.9-manual.yml). The file name or directory might simply be wrong, or the file extension could be wrong or incomplete in the href attribute:

    - text: Missing L in .html
      href: page.htm
    
  • docs/page.html
      hash does not exist --- docs/page.html --> target.html#hash
    
    docs/page.html
      target does not exist --- docs/page.html --> target.html
    

    Check if the target file exists and if the anchor is correct (if applicable). Look at the generated .html file if in doubt. A redirect_from frontmatter might be bad (e.g. wrong version number in path) and accidentally overwrite a page, removing the original content and links.

  • docs/<version>/programs-arangod-options.html
      target does not exist --- docs/<version>/programs-arangod-options.html --> programs-arangod-<something>.html
    

    This error may start to occur after an update of the generated examples.

    The ArangoDB server (arangod) has numerous startup options. Each startup option section (--section.name) has its own page programs-arangod-<section>.md. The parent page programs-arangod-options.md automatically links to these subpages (see _includes/program-options.html) without checking if this page actually exists.

    When a new section is added to arangod (seldom), it is necessary to create a corresponding page in the docs. If no detailed descriptions are available for the newly added startup options, then reuse the arangod option descriptions.

  • Configuration file: none
                Source: /path/to/docs/3.9
           Destination: /path/to/docs/3.9/_site
     Incremental build: disabled. Enable with --incremental
          Generating...
         Build Warning: Layout 'default' requested in subfolder/page.md does not exist.
         Build Warning: Layout 'default' requested in other.md does not exist.
      Liquid Exception: Liquid syntax error (line 11): Unknown tag 'docublock' in
    

    Warnings and exceptions like above show if you try to run Jekyll from a subfolder. Change your working directory to the root folder of the working copy (/path/to/docs).

  • Liquid Exception: undefined method `captures' for nil:NilClass
    

    This error can be raised by the navvar method in _plugins/ExtraFilters.rb (run Jekyll with --trace to verify). Check that the working copy is clean. Stray folders with untracked Markdown files may cause this problem, e.g. the output of oasisctl generate-docs. Either remove the files or add the folder to the list of excludes in _config.yml.

  • /docs/_plugins/PageNavFilter.rb:13:in `create_flat_nav': undefined method `each' for nil:NilClass (NoMethodError)
    

    This error can originate from a missing symlink, e.g. the navigation definition file for a specific version like 3.11-arangograph.yml being absent. Create a symlink that points to e.g. ../arangograph.yml to resolve the problem.

  • /opt/build/repo/_plugins/versions/version.rb:45:in `<=>': undefined method `version' for nil:NilClass (NoMethodError)
    

    This error occurs sporadically in the Netlify preview builds. The cause is unclear. So far it was sufficient to trigger another build, e.g. by pushing an empty commit, and it succeeded.

  • Please append `--trace` to the `build` command
    for any additional information or backtrace.
    

    This is a generic error message which requires the inspection of the stack trace to figure out the root cause of the problem.

    • …lib/jekyll/utils.rb:141:in `initialize': No such file or directory @ rb_sysopen - /path/to/file
      

      Jekyll can't open the specified file. A possible reason is that it is a binary file which is not supposed to be in the source tree in the first place or which should be excluded via _config.yml

    • …lib/safe_yaml/load.rb:143:in `parse': (/path/to/docs/_data/3.x-manual.yml):
      mapping values are not allowed in this context at line 274 column 15 (Psych::SyntaxError)
      

      The specified navigation definition file is not valid YAML. Check if the indention is correct and that you use children: if the following entries are child pages.

CI/Netlify

For the CI process we currently use Netlify. This service has been built so that you can quickly test and deploy static sites. We only use it to have a live preview and a CI pipeline, not for hosting the actual documentation site.

There are a few files in the repo required for Netlify:

  • _redirects

    Defines redirects for Netlify. There is only one redirect going from / to the docs so that the site preview doesn't start with a 404 (we are generating pages into /docs/). As Netlify doesn't understand symlinks we are linking absolutely to a version.

  • netlify.toml

    Defines the build pipeline. Not much going on there.

  • netlify.sh

    Special script for Netlify build. Because we cannot just use a Docker container we have to download htmltest every time.

For details please check out the Netlify documentation.

License

The ArangoDB documentation is licensed under Apache-2.0. See LICENSE for details.

Parts not licensed under Apache-2.0 are outlined in LICENSES-OTHER-COMPONENTS.md

docs's People

Contributors

ajanikow avatar ansoboleva avatar arangodb-release-bot avatar bertaherpla avatar cpjulia avatar cw00dw0rd avatar dothebart avatar dronplane avatar ewoutp avatar fceller avatar gnusi avatar goedderz avatar graetzer avatar hkernbach avatar ifcologne avatar joerg84 avatar jsteemann avatar kvahed avatar kvs85 avatar m0ppers avatar maierlars avatar markuspf avatar mpoeter avatar nerpaula avatar neunhoef avatar obiwahn avatar rashtao avatar santanu82021 avatar simran-b avatar sonyarianto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docs's Issues

Cursor TTL renewed on every access

pluma:
When accessing a cursor from the HTTP API (reading the next batch), is the ttl reset or will it still expire according to the initial ttl? IOW, does the ttl set a total cursor lifetime or just a "dead man's switch" for inactivity? (the HTTP API docs don't explain this, btw, they only mention ttl when creating the cursor). It looks like it does (from manual testing) but the docs don't indicate this.

jsteemann:
The TTL is renewed every time the cursor is accessed.

Last navigation entry occluded by link under the cursor

nav-no-hover
nav-hover

When hovering over a link, which is always the case while scrolling in the navigation, the last entry in the navigation is occluded by the link displayed by the browser. I've stumbled a few times over this, when I could not find a menu entry I knew should be there.

Use local bundle path?

Would it be possible to use a local path for bundle? I just used bundler --path .local exec jekyll build which seems preferable to installing stuff systemwide (which bundler tries to do otherwise)

Update compilation instructions (Windows)

  • How to determine if errors occurred?
  • Log output to file
    cmake --build . --config RelWithDebInfo > build.log | type build.log
  • Uninstall old OpenSSL versions (0.x) and use https://slproweb.com/download/Win64OpenSSL-1_1_1c.exe (3.5/devel) or https://slproweb.com/download/Win64OpenSSL-1_1_0k.exe (3.4)
  • Windows 8.1 SDK and UCRT SDK is an option on its own!
  • 3.4 needs Windows SDK 8.1 while 3.5 and devel need Windows SDK 10 (due to different V8 versions)
  • Desktop development with C++ option in installer (additional ones?)
  • VS 2019 not supported (errors out intentionally)
  • How to start the server after compilation

Storage engine differences

There are some remarks here and there which do not distinguish between MMFiles and RocksDB, e.g.

`collection.figures()`

Returns an object containing statistics about the collection.

{% hint 'info' %}
Retrieving the figures will always load the collection into memory.
{% endhint %}

Does RocksDB load the collection metadata only, and does it so on first use or is it always in memory?

Redirect_from does not support version aliases (stable, devel)

https://github.com/jekyll/jekyll-redirect-from

A file /3.4/new.md with frontmatter redirect_from: /3.4/old.html will generate a page 3.4/old.html which redirects to /3.4/new.html. Because /stable is a symlink to /3.4, the redirect page will also be used for /stable/old.html, but forward you to /3.4/new.html instead of /stable/new.html - which is bad.

How to support version aliases?

  • Fork plugin and favor the alias over the version number?
    It would then put you from /3.4/old.html onto /stable/new.html which is also not ideal.
  • Materialized alias versions (copy /3.4 to /stable and fully build both)?
    Would require a customized plugin to substitute the redirect path...

Index utilization: optimizer looks for FILTER, not SORT conditions

Raphael Cohen in community slack:

I have a very simple query that is really slow:

FOR item IN my_collection
    FILTER item.type == "foo"
    SORT item.modified DESC 
    LIMIT 0, 1 
    RETURN item

Using the explaining capabilities I can see the following:

Execution plan:
 Id   NodeType           Est.   Comment
  1   SingletonNode         1   * ROOT
  9   IndexNode         18684     - FOR item IN my_collection   /* hash index scan */
  5   CalculationNode   18684       - LET #3 = item.`modified`   /* attribute expression */   /* collections used: item : my_collection */
  6   SortNode          18684       - SORT #3 DESC   /* sorting strategy: constrained heap */
  7   LimitNode             1       - LIMIT 0, 1
  8   ReturnNode            1       - RETURN item

Indexes used:
 By   Name          Type   Collection     Unique   Sparse   Selectivity   Fields       Ranges
  9   idx_6156493   hash   stix_objects   false    false         0.01 %   [ `type` ]   (item.`type` == "foo")

Optimization rules applied:
 Id   RuleName
  1   move-calculations-up
  2   move-filters-up
  3   move-calculations-up-2
  4   move-filters-up-2
  5   use-indexes
  6   remove-filter-covered-by-index
  7   remove-unnecessary-calculations-2
  8   sort-limit

Basically it is using the index on the type field that has a selectivity of 0.01% instead of the index on modified that has a selectivity of 99.99%. I don't understand why it is using the "wrong" index when choosing one. If I use a hint to specify the index to use then it performs way better ...

tobias.arangodb:

Because you're not doing a lookup on modified. Basically the optimizer tries to find the best index for

FOR item IN my_collection
    FILTER item.type == "foo"

After the index is chosen, it will remove the SORT node if its possible with the chosen index.
The difference in speed with your query comes from this:
With the type index, you get less results in the FOR, but you have to look at all of them before you can return the first item in order.
With the modified index, you have to possibly iterate the whole collection, but can stop on the first document with item.type == "foo", because they are already in the right order.

Raphael Cohen:
Thank you for your answer. Is there a way to use both of the indexes to get the best of both world ? Apart from creating an index based on this 2 fields.

tobias.arangodb:
No. You'd have to create an index on ["type", "modified"], in that order.

Use HTML5 <details> and <summary> to fit more content on pages?

Pros:

  • Could remove the need for a page ToC
  • Force a flatter structure? (details = h2, h3+ only inside a box?)
  • More content could be placed on a single page (avoiding sub-pages) without looking too crowded
  • Better on mobile devices? (not all content has to be rendered unless all detail boxes are expanded)

Cons:

  • Not supported in IE/Edge (except new Edge based on Chromium)
  • Limited styling support and browser differences
    (list-style: none as per specs, but ::-webkit-details-marker in Chromium based browsers)
  • Accessibility / in-page search???
  • Needs JavaScript to expand box for deep-linking (anchor links)

Sandbox:
https://jsbin.com/dobigumuve/1/edit?html,css,js,output

Ref:

Add units to HTTP API docs

For example, --cluster.synchronous-replication-timeout-minimum accepts a double as data type, which is interpreted as seconds. We need to check if we miss the unit information for other startup options as well as for endpoint parameters and result descriptions.

Missing ability to test examples in a branch before merging

Adding e.g. AQL inline examples is not really testable at the moment. What Jenkins does is copy the docs from this repository into the folder structure of the main repo, then generate the examples and commit the changes back to the master branch of the docs repo. It is not capable of committing the examples to a PR branch.

Long-term solution should be to replace the old system which processes examples with something that better integrates with Jekyll and with the ability to generate a subset of examples without copy-pasting between docs and main repo.

Short-term solution could be to accept a branch name and use the old process to generate the examples from the docs repo files and commit all examples to the PR branch instead. This is pretty messy however, because only a small subset of examples is needed and the generated files will be overwritten during the night anyway.

Sub-objects at depth 3+ missing in HTTP response description

Compare get_api_collection_figures.md
to https://www.arangodb.com/docs/3.4/http/collection-getting.html#return-statistics-for-a-collection

The response format is deeply nested, e.g:

  • figures
    • dead
      • count
      • size

count and size are absent in the docs, as well as other nested objects at level 3:

image

The definition looks okay:

@RESTSTRUCT{dead,collection_figures,object,required,collection_figures_dead}
the items waiting to be swept away by the cleaner

@RESTSTRUCT{count,collection_figures_dead,integer,required,int64}
The number of dead documents. This includes document
versions that have been deleted or replaced by a newer version. Documents
deleted or replaced that are contained the write-ahead log only are not reported
in this figure.

@RESTSTRUCT{size,collection_figures_dead,integer,required,int64}
The total size in bytes used by all dead documents.

@RESTSTRUCT{deletion,collection_figures_dead,integer,required,int64}
The total number of deletion markers. Deletion markers
only contained in the write-ahead log are not reporting in this figure.

Confusion about index types (hash, skiplist, persistent)

The "Indexing" section in the manual (https://www.arangodb.com/docs/stable/indexing.html) shows all the different types of indexes.
Clicking on "Persistent indexes", one gets to the page https://www.arangodb.com/docs/stable/indexing-persistent.html.
This page directly at its top states

The persistent index type is considered as deprecated from version 3.4.0 on. It will be removed in 4.0.0. If you use the RocksDB storage engine, you can replace it with a skiplist index, which uses the same implementation.

This is misleading.
The persistent index is deprecated for MMFiles only. For MMFiles the index types "hash", "skiplist" and "persistent" index are actually different index types with different implementations.
However, for the RocksDB engine the "hash", "skiplist" and "persistent" indexes are exactly the same (apart from the type names). So for RocksDB the persistent index is not deprecated.
And as for RocksDB the indexes are all the same, it does not make sense to offer them all. Especially offering a "hash" index for RocksDB that is not even a hash index, or a "skiplist" index for RocksDB that is not a skiplist index makes no sense.
We have already made a UI change in 3.5 and offer only "persistent" indexes in the web UI when creating new indexes with RocksDB. For MMFiles all index types are still present in the web UI.
Now, with "persistent" being the only type of index offered in the web UI, and the manual saying it is deprecated, this leaves the docs in a very confusing state.

I see the following two ways forward:

  1. split the indexes section in the manual into a RocksDB-specific and an MMFiles-specific section. Then say for the RocksDB that the index types "hash", "skiplist" and "persistent" are the same internally, and that "hash" and "skiplist" are only there for compatibility reasons with MMFiles.
  2. don't split the section, but on each individual index type page explain the differences between RocksDB and MMFiles.

Probably related: #84

Better descriptions for client tool installation

Jason:
I just wanted to suggest a few updates to the documentation especially for Oasis. First in reference to tools like arrangoimp, they need to utilize ssl instead of tcp protocol when communicating with Oasis servers. I will provide example later. Second, I think there needs page or section for installing client tools. For example, I tried to download the client tools for the Mac and it took a little digging/experimenting to find it.

Remove references to Mesos deployments

In devel, references to Mesos setups have been removed from README_maintainers.md recently.
Our documentation still mentions Mesos setups, and I am not sure if we still want to encourage such deployments. I guess the answer is no.

Index types hash and skiplist removed from UI only in case of RocksDB

There is some confusion about what index types are available in 3.5 vs. what Aardvark suggests.

https://www.arangodb.com/docs/devel/indexing-index-basics.html

  • UI does not list hash and skiplist index types anymore if storage engine is RocksDB
  • Server supports them still (for compatibility), but they are treated as deprecated in the RestHandlers already (effect?)
  • There is a warning if a persistent index is used in MMFiles engine, that one should rather switch to RocksDB engine (where?)

Also, some information might be about the persistent index type in MMFiles, which is based on RocksDB, but it's possibly misunderstood as information about the RocksDB storage engine. Need to check if up-to-date and make clear what is talked about.

JS endpoints white-/blacklist issues

--javascript.endpoints-whitelist / --javascript.endpoints-blacklist

  • If no port specified in whitelist argument then it doesn't seem to match anything under Windows. Seems to work under Linux though, but needs retesting.
  • :80 allows the port to be different (e.g. :8080), should be :80$
  • host.tld should have the . escaped as \. to not allow other characters (company.co.uk will let company-co.uk through, which is a different domain)
  • without protocol and a leading ^, any subdomain will accepted
  • only protocol, host and port of a request are compared against the whitelist/blacklist entries (what about user:pass@?)
  • always use ^, $ and don't leave out protocol for maximum security?

Debugging:

--log.level security=debug

[HTTP API] Named Indexes documentation missing

The named indexes are not mentioned in the HTTP API documentation. The only sentence I can find is this:

Optionally, an index name may be specified as a string in the name attribute. Index names have the same restrictions as collection names. If no value is specified, one will be auto-generated.

The name attribute should be added to every index type as an optional parameter when creating an index.

Subquery optimization: Updates docs

There is an ongoing effort to improve subquery performance, which seems to introduce new Node types to the execution plan / explain output. The docs probably need an update when this is done.

Hint boxes broken (if used in a DocuBlock)

Content missing and stray closing divs:

image

https://www.arangodb.com/docs/stable/drivers/js-reference-database-transactions.html#databasetransaction

Markdown not processed:

image

https://www.arangodb.com/docs/3.5/data-modeling-documents-document-address.html#document-revision

The callouts work in other places however.

The first issue is probably whitespace related. The HintBlock.rb script does not remove leading whitespace from the input based on the indentation of the first line. This shouldn't result in a completely messed up markup however...

The second issue is DocuBlock related: the content comes from Documentation/DocuBlocks/documentRevision.md via allComments.txt.

Port changes in arangodb/arangodb to here

site.css not up to date on Pantheon

In particular, it is missing the .page-nav { margin-top: 30px; } rule. Is this a caching issue or are the changes to the file ignored for some reason?

Make site more mobile-friendly

adityamukho in Community Slack:
the site doesn't appear to be too mobile friendly

image

  1. topnav: other "books" not shown
  2. hamburger button only reachable if content on the right-hand side is scrolled up to the top
  3. clicking on the << previous / next >> links at the bottom re-opens the sidebar if it was closed

Query Cache: include system collections

Docs might not be clear enough about this option.


For the query cache there is a setting that allows inclusion of "system collections"

  • Does "system collections" mean the collections whose name start with a _ in the current database or collections in the _system database?
  • What are the (known) implications of setting the setting to include system collections in query cache to true?

-> System collections here means any collection whose name starts with an _, regardless of from which database it is.

is this caching global to the arangodb instance then?
-> Yes
Normally system collections can be ignored in the query cache. For example, buffering any query results for queries on the _statistics collection normally doesn't make any sense, as new data will be added regularly. So each (internal) query on _statistics will see a different state of data anyway.
It could be cached, but it would be useless and simply waste memory.
_users are cached in memory anyway, so buffering AQL query results on _users in the query cache again doesn't make much sense.
In short: data from system collections could be cached, but normally it is not worth doing it.

there's no "security" considerations or suchlike?
-> No, Permissions/privileges are still checked even if the query cache is turned on

Connect existing Ingress service on Google Cloud

Theo in Community Slack (about k8s cluster):

I am trying to connect an existing Ingress service on Google Cloud with my ArangoDB instance (using the operator). I do not choose LoadBalancer as an external service since this is going to create a new LoadBalancer (which I do not want), so I create a manual NodePort service which I assign to my Ingress controller yaml. However the Ingress cannot see the service.

...

Ok I found the issue here. The Google Cloud Ingress creates a Level 7 LoadBalancer for HTTP and HTTPS traffic. It demands a health check for all containers. The ArangoDB coordinator containers include a readiness probe, however the schema is set to HTTPS. However the default connection between an Ingress resource defaults to HTTP when communicating with a Service and the Ingress controller cannot access the readinessProbe. The solution is to default the Service with this annotation:

kind: Service
apiVersion: v1
metadata:
  name: arangodb-staging-service-nodeport
  annotations:
    cloud.google.com/app-protocols: '{"https-port":"HTTPS"}'
spec:
  selector:
    arango_deployment: arangodb-staging
    role: coordinator
  type: NodePort
  ports:
    - name: https-port
      port: 8529
      targetPort: 8529

This enables the Ingress to connect with the readiness probe.

Cluster: curl -L to follow redirects to leader?

See discussion in arangodb/arangodb#8742 (review)

There might be multiple places in the docs with such a statement. It doesn't seem to be the case anymore that a follower sends a HTTP redirect to the leader (in what versions was this the case?), e.g. to get the current config (can also read parts of the config from follower, at least in latest versions).

AQL: Multi-line comments must be terminated from 3.6.0 on

The following is not allowed in current devel anymore:

RETURN 1
/*
RETURN 2

There must not be an unterminated multi-line comment:

RETURN 1
/*
RETURN 2
*/

Counts don't have to match, as anything between /* and */ is considered as comment body, including additional /*.

Prism.js needs to be updated as well!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.