From 316db0fe79a5d0e48c5171c937e56ef6b6b8a3e1 Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Wed, 22 Apr 2020 19:02:54 +0200 Subject: [PATCH] Add documentation to display STL preview (#11181) * Update customizing-gitea.en-us.md * Update customizing-gitea.en-us.md * only load assets when needed * remove useless var * fix missing 'i' modifier --- .../doc/advanced/customizing-gitea.en-us.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/docs/content/doc/advanced/customizing-gitea.en-us.md b/docs/content/doc/advanced/customizing-gitea.en-us.md index 2c06de67b5..b52a713e40 100644 --- a/docs/content/doc/advanced/customizing-gitea.en-us.md +++ b/docs/content/doc/advanced/customizing-gitea.en-us.md @@ -180,6 +180,89 @@ You can then add blocks like the following to your markdown: The script will detect tags with `class="language-plantuml"`, but you can change this by providing a second argument to `parsePlantumlCodeBlocks`. +#### Example: STL Preview + +You can display STL file directly in Gitea by adding: +```html + +``` +to the file `templates/custom/footer.tmpl` + +You also need to download the content of the library [Madeleine.js](https://jinjunho.github.io/Madeleine.js/) and place it under `custom/public/` folder. + +You should end-up with a folder structucture similar to: +``` +custom/templates +-- custom + `-- footer.tmpl +custom/public +-- Madeleine.js + |-- LICENSE + |-- README.md + |-- css + | |-- pygment_trac.css + | `-- stylesheet.css + |-- examples + | |-- ajax.html + | |-- index.html + | `-- upload.html + |-- images + | |-- bg_hr.png + | |-- blacktocat.png + | |-- icon_download.png + | `-- sprite_download.png + |-- models + | |-- dino2.stl + | |-- ducati.stl + | |-- gallardo.stl + | |-- lamp.stl + | |-- octocat.stl + | |-- skull.stl + | `-- treefrog.stl + `-- src + |-- Madeleine.js + |-- css + | `-- Madeleine.css + |-- icons + | |-- logo.png + | |-- madeleine.eot + | |-- madeleine.svg + | |-- madeleine.ttf + | `-- madeleine.woff + `-- lib + |-- MadeleineConverter.js + |-- MadeleineLoader.js + |-- detector.js + |-- stats.js + `-- three.min.js +``` + +Then restart gitea and open a STL file on your gitea instance. + ## Customizing Gitea mails The `custom/templates/mail` folder allows changing the body of every mail of Gitea.