mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-22 22:12:24 +01:00
Update docs, rename desc to long_description
This commit is contained in:
parent
8225e4098b
commit
05c140da78
@ -49,7 +49,7 @@ Tokens can be attained by visiting [Settings > API Tokens](/user/tokens/).
|
||||
* `content_Warnings`: List of content warning names, see [misc](#misc).
|
||||
* `license`: A license name.
|
||||
* `media_license`: A license name.
|
||||
* `desc`: Long markdown description.
|
||||
* `long_description`: Long markdown description.
|
||||
* `repo`: Git repo URL.
|
||||
* `website`: Website URL.
|
||||
* `issue_tracker`: Issue tracker URL.
|
||||
@ -63,7 +63,7 @@ Examples:
|
||||
# Edit packages
|
||||
curl -X PUT http://localhost:5123/api/packages/username/name/ \
|
||||
-H "Authorization: Bearer YOURTOKEN" -H "Content-Type: application/json" \
|
||||
-d '{ "title": "Foo bar", "tags": ["pvp", "survival"], "license": "WTFPL" }'
|
||||
-d '{ "title": "Foo bar", "tags": ["pvp", "survival"], "license": "MIT" }'
|
||||
|
||||
# Remove website URL
|
||||
curl -X PUT http://localhost:5123/api/packages/username/name/ \
|
||||
|
@ -44,17 +44,17 @@ and for mods only:
|
||||
You can include a `.cdb.json` file in the root of your content directory (ie: next to a .conf)
|
||||
to update the package meta.
|
||||
|
||||
It should be a JSON dictionary with one or more of the following optional keys.
|
||||
It should be a JSON dictionary with one or more of the following optional keys:
|
||||
|
||||
* `type`: One of `GAME`, `MOD`, `TXP`.
|
||||
* `title`: Human-readable title.
|
||||
* `name`: Technical name (needs permission if already approved).
|
||||
* `short_description`
|
||||
* `tags`: List of tag names, see [/api/tags/](/api/tags/).
|
||||
* `content_Warnings`: List of content warning names, see [/api/content_warnings/](/api/content_warnings/).
|
||||
* `content_warnings`: List of content warning names, see [/api/content_warnings/](/api/content_warnings/).
|
||||
* `license`: A license name, see [/api/licenses/](/api/licenses/).
|
||||
* `media_license`: A license name.
|
||||
* `desc`: Long markdown description.
|
||||
* `description`: Long markdown description.
|
||||
* `repo`: Git repo URL.
|
||||
* `website`: Website URL.
|
||||
* `issue_tracker`: Issue tracker URL.
|
||||
@ -68,7 +68,8 @@ Example:
|
||||
{
|
||||
"title": "Foo bar",
|
||||
"tags": ["pvp", "survival"],
|
||||
"license": "WTFPL"
|
||||
"license": "MIT",
|
||||
"website": null
|
||||
}
|
||||
```
|
||||
|
||||
@ -83,8 +84,9 @@ choose Git as the method when creating a release.
|
||||
|
||||
### Automatic Release Creation
|
||||
|
||||
The preferred way is to use [webhooks from GitLab or GitHub](/help/release_webhooks/).
|
||||
You can also use the [API](/help/api/) to create releases.
|
||||
See [Git Update Detection](/help/update_config/).
|
||||
You can also use [GitLab/GitHub webhooks](/help/release_webhooks/) or the [API](/help/api/)
|
||||
to create releases.
|
||||
|
||||
### Min and Max Minetest Versions
|
||||
|
||||
|
@ -34,9 +34,10 @@ There are some situations where the settings are correct, but you want to mark a
|
||||
up-to-date - for example, if you don't want to make a release for a particular tag.
|
||||
Clicking "Save" on "Update Settings" will mark a package as up-to-date.
|
||||
|
||||
## Configuring
|
||||
## Configuring Release Creation
|
||||
|
||||
See the [Package Configuration and Releases Guide](/help/package_config/) for
|
||||
documentation on configuring the release creation.
|
||||
You can set the min/max Minetest version from the Git repository, and also
|
||||
configure what files are included.
|
||||
|
||||
From the Git repository, you can set the min/max Minetest versions, which files are included,
|
||||
and update the package meta.
|
||||
|
@ -51,6 +51,7 @@ ALLOWED_FIELDS = {
|
||||
"content_warnings": list,
|
||||
"license": any,
|
||||
"media_license": any,
|
||||
"long_description": str,
|
||||
"desc": str,
|
||||
"repo": str,
|
||||
"website": str,
|
||||
@ -59,6 +60,13 @@ ALLOWED_FIELDS = {
|
||||
"forums": int,
|
||||
}
|
||||
|
||||
ALIASES = {
|
||||
"short_description": "short_desc",
|
||||
"issue_tracker": "issueTracker",
|
||||
"long_description": "desc"
|
||||
}
|
||||
|
||||
|
||||
def is_int(val):
|
||||
try:
|
||||
int(val)
|
||||
@ -98,7 +106,7 @@ def do_edit_package(user: User, package: Package, was_new: bool, data: dict, rea
|
||||
not package.checkPerm(user, Permission.CHANGE_NAME):
|
||||
raise LogicError(403, "You do not have permission to change the package name")
|
||||
|
||||
for alias, to in { "short_description": "short_desc", "issue_tracker": "issueTracker" }.items():
|
||||
for alias, to in ALIASES.items():
|
||||
if alias in data:
|
||||
data[to] = data[alias]
|
||||
|
||||
|
@ -407,7 +407,7 @@ class Package(db.Model):
|
||||
"name": self.name,
|
||||
"title": self.title,
|
||||
"short_description": self.short_desc,
|
||||
"desc": self.desc,
|
||||
"long_description": self.desc,
|
||||
"type": self.type.toName(),
|
||||
"created_at": self.created_at.isoformat(),
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user