Skip to content

Commit

Permalink
YAMLize netkan spec
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Aug 19, 2021
1 parent afa7145 commit dde3180
Showing 1 changed file with 25 additions and 41 deletions.
66 changes: 25 additions & 41 deletions Spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ consumes `.netkan` files to produce `.ckan` files. `.netkan` files are a *strict

##### YAML Option

A `.netkan` file may be in either JSON or YAML format. All examples shown below assume JSON, but the YAML equivalents will work the same way.
A `.netkan` file may be in either JSON or YAML format. All examples shown below assume YAML, but the JSON equivalents will work the same way.

Note that `#` is the comment character in YAML, so even if you choose YAML syntax, you still can't omit the quotes around a value that includes `#`, such as typical values of `$kref` and `$vref`:

Expand Down Expand Up @@ -790,10 +790,8 @@ Optionally, one of `asset_match` with `:filter_regexp` *or* `version_from_asset`

An example `.netkan` excerpt:

```json
{
"$kref": "#/ckan/github/pjf/DogeCoinFlag/version_from_asset/^DogeCoinFlag-(?<version>.+).zip$"
}
```yaml
$kref: '#/ckan/github/pjf/DogeCoinFlag/version_from_asset/^DogeCoinFlag-(?<version>.+).zip$'
```

An `x_netkan_github` field may be provided to customize how the metadata is fetched from GitHub. It is an `object` with the following fields:
Expand Down Expand Up @@ -835,15 +833,12 @@ If any options are not present their default values are used.

An example `.netkan` excerpt:

```json
{
"$kref": "#/ckan/jenkins/https://jenkins.kspmods.example/job/AwesomeMod/",
"x_netkan_jenkins": {
"build": "stable",
"asset_match": "\\.zip$",
"use_filename_version": false
}
}
```yaml
$kref: '#/ckan/jenkins/https://jenkins.kspmods.example/job/AwesomeMod/'
x_netkan_jenkins:
build: stable
asset_match: \.zip$
use_filename_version: false
```

###### `#/ckan/http/:url`
Expand Down Expand Up @@ -896,12 +891,10 @@ The following conditions apply:

An example `.netkan` including all required fields for a valid metanetkan:

```json
{
"spec_version": 1,
"identifier": "AwesomeMod",
"$kref": "#/ckan/netkan/https://www.kspmods.example/AwesomeMod.netkan"
}
```yaml
spec_version: 1,
identifier: AwesomeMod
$kref: '#/ckan/netkan/https://www.kspmods.example/AwesomeMod.netkan'
```

##### `$vref`
Expand Down Expand Up @@ -949,10 +942,8 @@ release.

An example `.netkan` excerpt:

```json
{
"x_netkan_epoch": 1
}
```yaml
x_netkan_epoch: 1
```

##### `x_netkan_allow_out_of_order`
Expand All @@ -966,10 +957,8 @@ of order version.

An example `.netkan` excerpt:

```json
{
"x_netkan_allow_out_of_order": true
}
```yaml
x_netkan_allow_out_of_order: true
```

##### `x_netkan_force_v`
Expand All @@ -982,10 +971,8 @@ field *only* contains the actual version string.

An example `.netkan` excerpt:

```json
{
"x_netkan_force_v": true
}
```yaml
x_netkan_force_v: true
```

##### `x_netkan_version_edit`
Expand All @@ -1008,15 +995,12 @@ the default values for the `replace` and `strict` fields are used.

An example `.netkan` excerpt:

```json
{
"$kref": "#/ckan/jenkins/https://jenkins.kspmods.example/job/AwesomeMod/",
"x_netkan_version_edit": {
"find": "^[vV]?(?<version>.+)$",
"replace": "${version}",
"strict": true
}
}
```yaml
$kref: '#/ckan/jenkins/https://jenkins.kspmods.example/job/AwesomeMod/'
x_netkan_version_edit:
find: ^[vV]?(?<version>.+)$
replace: ${version}
strict: true
```

##### `x_netkan_override`
Expand Down

0 comments on commit dde3180

Please sign in to comment.