You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/formats.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,23 +35,24 @@ Note that `DocInventories` internally uses the `text/x-intersphinx` MIME type fo
35
35
36
36
## TOML Format
37
37
38
-
The TOML format is another text output format that is optimized for human readability. It starts with a header section of the form
38
+
The TOML format is a text output format that is optimized for human readability. It starts with a header section of the form
39
39
40
-
```
41
-
[Inventory]
42
-
format = "DocInventories v0"
40
+
```toml
41
+
# DocInventory version 0
43
42
project = "<project>"
44
43
version = "<version>"
45
44
```
46
45
47
-
The `format` line is mandatory and identifies the file as containing inventory data in the format described here.
46
+
The comment in the first line is mandatory and identifies the file as containing inventory data in the format described here.
48
47
49
48
!!! warning
50
-
As indicated by the `v0` in the `format` line, the format described here is currently experimental and may change without notice
49
+
As indicated by the "version 0" in the header comment line, the format described here is currently experimental and may change without notice
50
+
51
+
The `project` line must specify the name of the project described by the inventory. It is mandatory. The `version` line may specify the version of the project. It is optional, but recommended.
51
52
52
53
After that, each [`InventoryItem`](@ref) is represented by a multi-line block of the form
53
54
54
-
```
55
+
```toml
55
56
[[<domain>.<role>]]
56
57
name = "<name>"
57
58
uri = "<uri>"
@@ -61,7 +62,7 @@ priority = <priority>
61
62
62
63
The four lines for `name`, `uri`, `dispname`, and `priority` may occur in any order. Also, for items with the default priority (`-1` for the `std` domain, `1` otherwise), the `priority` line may be omitted. If `dispname` is equal to `name` (usually indicated by `dispname="-"`), the `dispname` line may also be omitted.
63
64
64
-
The item-blocks may be grouped/separated by blank lines. In `.toml`file generated by `DocInventories.save("inventory.toml", inventory)` items will be grouped into blocks with the same `[[<domain>.<role>]]` with a blank line between each block.
65
+
The item-blocks may be grouped/separated by blank lines. In `.toml`files generated by `DocInventories.save("inventory.toml", inventory)` items will be grouped into blocks with the same `[[<domain>.<role>]]` with a blank line between each block.
65
66
66
67
Any TOML parser should read a `.toml` file with the above structure into a nested dictionary, so that `item_dict = toml_data[domain][role][i]` corresponds to the `i`'th inventory item with the given `domain` and `role`. That `item_dict` will then map `"name"`, `"uri"`, and potentially `"dispname"` and `"priority"` to their respective values.
0 commit comments