Update API docs, add support for code highlighting, add markdown table support

This commit is contained in:
rubenwardy
2021-02-02 17:09:19 +00:00
parent 033f40c263
commit 2f66db5989
13 changed files with 163 additions and 79 deletions

View File

@@ -12,7 +12,6 @@ title: Help
## Help for Package Authors
* [Package Inclusion Policy and Guidance](/policy_and_guidance/)
* [Package Tags](package_tags)
* [Git Update Detection](update_config)
* [Creating Releases using Webhooks](release_webhooks)
* [Package Configuration and Releases Guide](package_config)

View File

@@ -5,11 +5,11 @@ title: API
Not all endpoints require authentication.
Authentication is done using Bearer tokens:
Authorization: Bearer YOURTOKEN
```bash
curl -H "Authorization: Bearer YOURTOKEN" https://content.minetest.net/api/whoami/
```
You can use the `/api/whoami` to check authentication.
Tokens can be attained by visiting [Profile > "API Tokens"](/user/tokens/).
Tokens can be attained by visiting [Settings > API Tokens](/user/tokens/).
## Endpoints
@@ -43,8 +43,8 @@ Tokens can be attained by visiting [Profile > "API Tokens"](/user/tokens/).
### Releases
* GET `/api/packages/<username>/<name>/releases/`
* POST `/api/packages/<username>/<name>/releases/new/`
* GET `/api/packages/<username>/<name>/releases/` (List)
* POST `/api/packages/<username>/<name>/releases/new/` (Create)
* Requires authentication.
* Body is multipart form if zip upload, JSON otherwise.
* `title`: human-readable name of the release.
@@ -55,6 +55,19 @@ Tokens can be attained by visiting [Profile > "API Tokens"](/user/tokens/).
* `file`: multipart file to upload, like `<input type=file>`.
* You can set min and max Minetest Versions [using the content's .conf file](/help/package_config/).
Examples:
```bash
# Create release from Git
curl -X POST https://content.minetest.net/api/packages/username/name/releases/new/ \
-H "Authorization: Bearer YOURTOKEN" -H "Content-Type: application/json" \
-d "{\"method\": \"git\", \"title\": \"My Release\", \"ref\": \"master\" }"
# Create release from zip upload
curl https://content.minetest.net/api/packages/username/name/releases/new/ \
-H "Authorization: Bearer YOURTOKEN" \
-F title="My Release" -F file=@path/to/file.zip
```
### Topics

View File

@@ -1,33 +0,0 @@
title: Package Tags
## Overview
Tags should be added to packages to enable easy identification of different types of mods, games and texture packs.
They are only beneficial when applied correctly, so please use the following guidelines.
## Tag Usage
* **Building** - For mods that focus on adding new materials or nodes to build with.
* **Education** - For mods or games created for educational purposes.
* **Environment** - For mods that add environmental effects, including ambient sound and weather effects.
* **Inventory** - For mods that add new inventory systems or new inventory pages.
* **Machines and Electronics** - For mods that include placeable machinery or electronic components which interact to complete tasks.
* **Maintenance** - For mods that assist with world or player maintenance. This includes large-scale map manipulation, area protection and other administrative tools.
* **Mapgen** - For mods that add new biomes, new mapgen decorations, or any other mapgen elements.
* **Mobs and NPCs** - For mods that add mobs or NPCs, or provide tools that assist with mob and NPC creation or manipulation.
* **Plants and Farming** - For mods that add new plants or other farmable resources.
* **Player effects/Food** - For mods that change player effects, for example speed, jump height or gravity, and food.
* **Tools** - For mods that add new tools or new features for existing tools.
* **Transport** - For mods that add transportation methods. This includes teleportation, vehicles and ridable mobs.
* **Survival** - For mods written specifically for survival games. For example, these mods might focus on game-balance or increase the difficulty level. This tag should also be used for games with a heavy survival focus.
* **Creative** - For mods written specifically (and often exclusively) for use in creative mode. For example, these mods may add a large amount of decorative content, or content without crafting recipes. This tag should also be used for games with a heavy creative focus.
* **Multiplayer-focused** - For games that can be played with other players.
* **Singleplayer-focused** - For games that can be played alone.
* **PvP** - For games designed to be played competitively against other players.
* **PvE** - For games designed for one or multiple players which focus on combat against mobs or NPCs.
* **Puzzle** - For mods and games with a focus on puzzle solving instead of combat.
* **16px** - For 16px texture packs.
* **32px** - For 32px texture packs.
* **64px** - For 64px texture packs.
* **128px+** - For 128px or higher texture packs.

View File

@@ -11,8 +11,10 @@ plus the sum of the score given by reviews.
A review score is 100 if positive, -100 if negative.
reviews_sum = sum(100 * (positive ? 1 : -1))
score = avg_downloads + reviews_sum
```c
reviews_sum = sum(100 * (positive ? 1 : -1));
score = avg_downloads + reviews_sum;
```
## Pseudo rolling average of downloads

View File

@@ -3,7 +3,7 @@ title: Git Update Detection
## Introduction
When you push a change to your Git repository, ContentDB can create a new release automatically or
send you a reminder. ContentDB will check your Git repository every day, but you can use
send you a reminder. ContentDB will check your Git repository one per day, but you can use
webhooks or the API for faster updates.
Git Update Detection is clever enough to not create a release again if you've already created