Skip to content

Commit

Permalink
ENH: Add extension catalog entry file schema
Browse files Browse the repository at this point in the history
Co-authored-by: Andras Lasso <[email protected]>
  • Loading branch information
jcfr and lassoan committed Mar 20, 2024
1 parent f73a3a1 commit 3a58c0b
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 0 deletions.
1 change: 1 addition & 0 deletions Docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"sphinx_markdown_tables",
"notfound.extension", # Show a better 404 page when an invalid address is entered
"sphinx_rtd_theme",
"sphinx-jsonschema",
]

suppress_warnings = [
Expand Down
5 changes: 5 additions & 0 deletions Docs/developer_guide/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ It is named after the extension name (e.g `ExtensionName.json`) and may include
- N
```

The full schema for the extension catalog entry file is below:

```{jsonschema} ../../Schema/slicer-extension-catalog-entry-schema-v1.0.0.json
```

(extension-description-file)=
## Extension description file

Expand Down
1 change: 1 addition & 0 deletions Extensions/CLIExtensionTemplate.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://raw.githubusercontent.com/Slicer/Slicer/main/Schemas/slicer-extension-catalog-item-schema-v1.0.0.json#",
"build_dependencies": [],
"build_subdirectory": ".",
"category": "Examples",
Expand Down
1 change: 1 addition & 0 deletions Extensions/LoadableExtensionTemplate.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://raw.githubusercontent.com/Slicer/Slicer/main/Schemas/slicer-extension-catalog-item-schema-v1.0.0.json#",
"build_dependencies": [],
"build_subdirectory": ".",
"category": "Examples",
Expand Down
1 change: 1 addition & 0 deletions Extensions/ScriptedLoadableExtensionTemplate.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://raw.githubusercontent.com/Slicer/Slicer/main/Schemas/slicer-extension-catalog-item-schema-v1.0.0.json#",
"build_dependencies": [],
"build_subdirectory": ".",
"category": "Examples",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://raw.githubusercontent.com/Slicer/Slicer/main/Schemas/slicer-extension-catalog-item-schema-v1.0.0.json#",
"build_dependencies": [],
"build_subdirectory": ".",
"category": "Examples",
Expand Down
1 change: 1 addition & 0 deletions Extensions/SuperBuildExtensionTemplate.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://raw.githubusercontent.com/Slicer/Slicer/main/Schemas/slicer-extension-catalog-item-schema-v1.0.0.json#",
"build_dependencies": [],
"build_subdirectory": "inner-build",
"category": "Examples",
Expand Down
58 changes: 58 additions & 0 deletions Schemas/slicer-extension-catalog-entry-schema-v1.0.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://raw.githubusercontent.com/Slicer/Slicer/main/Schemas/slicer-extension-catalog-item-schema-v1.0.0.json#",
"type": "object",
"title": "3D Slicer extensions catalog entry schema",
"description": "Schema for storing information about a 3D Slicer extension to allow it to be listed in the extension catalog.",
"required": ["$schema", "category", "scmurl"],
"additionalProperties": true,
"properties": {
"@schema": {
"$id": "#schema",
"type": "string",
"title": "Schema",
"description": "URL of versioned schema."
},
"category": {
"$id": "#category",
"type": "string",
"title": "Category used to organize the extension in the extension catalog."
},
"scm_url": {
"$id": "#scm_url",
"type": "string",
"title": "Filename or URL of the repository."
},
"scm_revision": {
"$id": "#scm_revision",
"type": "string",
"title": "Hash, branch or tag name to identify the revision within the repository."
},
"scm_type": {
"$id": "#scm_type",
"type": "string",
"title": "Type of revision control system.",
"enum": ["git", "local"],
"default": "git"
},
"build_dependencies": {
"$id": "#build_dependencies",
"type": "array",
"title": "List of extensions required to build this extension.",
"additionalItems": false,
"items": { "type": "string" }
},
"build_subdirectory": {
"$id": "#build_subdirectory",
"type": "string",
"title": "Name of the inner build directory in case of superbuild based extension.",
"default": "."
},
"enabled": {
"$id": "#enabled",
"type": "boolean",
"title": "Specify if the extension should be enabled after its installation.",
"default": true
}
}
}
1 change: 1 addition & 0 deletions requirements-docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pygments
# Workaround for readthedocs bug (https://github.com/readthedocs/sphinx_rtd_theme/issues/1343)
sphinx~=5.0,!=5.2.0.post0
sphinx-issues
sphinx-jsonschema
sphinx_markdown_tables>=0.0.17
sphinx-notfound-page
sphinx_rtd_theme>=0.5.2

0 comments on commit 3a58c0b

Please sign in to comment.