doc: update README for GFM syntax

This commit is contained in:
mappu 2018-10-06 13:49:20 +13:00
parent b562ca4bd4
commit 33ca03b9d7

View File

@ -1,17 +1,17 @@
A file / image / paste upload server with a focus on embedding. # contented
Written in Go [![](doc/image1.thumb.png)](doc/image1.png)
A file / image / paste upload server with a focus on embedding.
You can use contented as a standalone upload server, or you can use the SDK to embed its upload widget into another website. You can use contented as a standalone upload server, or you can use the SDK to embed its upload widget into another website.
[go-get]code.ivysaur.me/contented git https://git.ivysaur.me/code.ivysaur.me/contented.git[/go-get] ## Features
=FEATURES=
- Drag and drop upload - Drag and drop upload
- Multiple files upload - Multiple files upload
- Pastebin upload - Pastebin upload
- Custom drawing upload ([url=https://github.com/Leimi/drawingboard.js]via[/url]) - Custom drawing upload ([via drawingboard.js](https://github.com/Leimi/drawingboard.js))
- Ctrl-V upload - Ctrl-V upload
- SDK-oriented design for embedding, including CORS support - SDK-oriented design for embedding, including CORS support
- Mobile friendly HTML interface - Mobile friendly HTML interface
@ -19,12 +19,13 @@ You can use contented as a standalone upload server, or you can use the SDK to e
- Hash verification (SHA512/256) - Hash verification (SHA512/256)
- Detect duplicate upload content and reuse storage - Detect duplicate upload content and reuse storage
- Options to limit the upload filesize and the upload bandwidth - Options to limit the upload filesize and the upload bandwidth
- Short URLs (using [url=http://hashids.org]Hashids[/url] algorithm) - Short URLs (using [Hashids](http://hashids.org) algorithm)
- Image thumbnailing - Image thumbnailing
=USAGE (SERVER)= ## Usage (Server)
`Usage of contented: ```
Usage of contented:
-data string -data string
Directory for stored content (default "") Directory for stored content (default "")
-db string -db string
@ -45,28 +46,31 @@ You can use contented as a standalone upload server, or you can use the SDK to e
Trust X-Forwarded-For reverse proxy headers Trust X-Forwarded-For reverse proxy headers
-concurrentthumbs -concurrentthumbs
Simultaneous thumbnail generation (default 16) Simultaneous thumbnail generation (default 16)
` ```
If you are hosting behind a reverse proxy, remember to set its post body size parameter appropriately (e.g. `client_max_body_size` for nginx). If you are hosting behind a reverse proxy, remember to set its post body size parameter appropriately (e.g. `client_max_body_size` for nginx).
=USAGE (HTTP)= ## Usage (HTTP)
The server responds on the following URLs: The server responds on the following URLs:
- `/get/{ID}`: Download item content URL |Method |Description
- `/info/{ID}`: Get item content metadata (JSON) ---------------------|-------|--
- `/thumb/{Type}/{ID}`: Get item thumbnail image `/get/{ID}` |`GET` |Download item content
- `/about`: Get server metadata (JSON) `/info/{ID}` |`GET` |Get item content metadata (JSON)
`/thumb/{Type}/{ID}` |`GET` |Get item thumbnail image
`/about` |`GET` |Get server metadata (JSON)
=USAGE (EMBEDDING FOR WEB)= ## Usage (Embedding for web)
Your webpage should load the SDK from the contented server, then call the `contented.init` function to display the upload widget over the top of an existing DOM element. Your callback will be passed an array of file IDs of any uploaded items. Your webpage should load the SDK from the contented server, then call the `contented.init` function to display the upload widget over the top of an existing DOM element. Your callback will be passed an array of file IDs of any uploaded items.
`<script type="text/javascript" src="SERVER_ADDR/sdk.js"></script> ```html
<script type="text/javascript" src="SERVER_ADDR/sdk.js"></script>
contented.init("#target", function(/* String[] */ items) {}); contented.init("#target", function(/* String[] */ items) {});
` ```
=CHANGELOG= ## Changelog
NEXT: NEXT:
- Feature: Option to limit concurrent thumbnail generation - Feature: Option to limit concurrent thumbnail generation