Skip to content

Commit

Permalink
Initial draft of architecture document
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Warren committed Oct 4, 2023
1 parent af8c506 commit 187edf6
Showing 1 changed file with 117 additions and 0 deletions.
117 changes: 117 additions & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# iXBRL architecture

This document provides developer documentation for various aspects of the
Inline XBRL Viewer.

## JSON data

The viewer relies on a block of JSON data that is embedded within the primary
XHTML file of the viewer. This avoids having to do full XBRL processing within
the viewer, and avoids the need to access the report's taxonomy from the
viewer.

The format of the JSON data is described below. Newer viewers are expected to
work correctly with data generated by an older plugin version within the same
major version, degrading new features gracefully if required.


```
{
"features": [],
"prefixes": {},
"roles": {},
"languages": {},
"sourceReports": [
{
"docSetFiles": [],
"targetReports": [
{
"localDocs": {},
"roleDefs": {},
"concepts": {},
"facts": {},
"rels": {},
}
]
}
],
"validation": [],
"filingDocuments": "foo.zip"
}
```

A viewer can contain one or more "source reports", each producing one or more
target report.

A source report is an Inline XBRL Document Set, comprising one or more Inline
XBRL Documents. A target report is the XBRL data obtained from extracting a
given target document from the source report.

Target documents are not yet supported, so at present, there will always be one
target report per source report.

### prefixes

`prefixes` is a map of namespace prefixes to namespace URIs. It is shared by
all Target Reports.

### languages


```
"languages": {
"en-us": "English (US)",
"en": "English",
"fr": "French",
},
```

A map of language codes to language labels. There should be an entry here for
every language code used by a label in a report.

### sourceReports

`sourceReports` is an array of objects of report data. Prior to multi-document
support, this property was not present, and the `docSetFiles` property, and the
properties of the objects within `targetReports` appeared at the top-level.

There is an object in this array for each separate Inline XBRL Document Set in
the viewer.

### docSetFiles

`docSetFiles` is a list of files in the document set. It is used to load other
documents in the document set into iframes in tabs in the viewer. For single
file, non-stub viewers, this property is not present.

### targetReports

An array of objects, one for each target document obtained from the enclosing
source report.

### localDocs

```
{
"filename.xsd": ["schema"],
"inline.xhtml": ["inline"],
}
```

`localDocs` is the set of XBRL files local to the filing (i.e. the Inline XBRL
files, and any extension taxonomies).

The property is used to populate a summary of the files in the filing in the
document summary panel.

## IDs and Viewer Unique IDs

The viewer requires all iXBRL facts to have `id` attributes. The Python plugin
will add `id` attributes to facts if present. IDs are required to be unique
within an Inline XBRL Document Set. In order to avoid collisions between IDs
in different Inline XBRL Document Sets when multiple source reports are
present, the viewer prefixes IDs with a source report index. e.g `0-f1` is
`f1` in the first report.


0 comments on commit 187edf6

Please sign in to comment.