[PR #2570] [MERGED] Add external markup render support #16474

Closed
opened 2025-11-02 12:11:29 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/2570
Author: @lunny
Created: 9/22/2017
Status: Merged
Merged: 11/7/2017
Merged by: @lafriks

Base: masterHead: lunny/external_markup


📝 Commits (10+)

  • c5940d0 add external markup render support
  • 0feec65 bug fixed
  • f39e5ab refacotr codes and fix wrong error log
  • 754332b fix comments and add check to prevent leaks
  • c3f0803 add check for config file and improve the example
  • c44ff2e check file close error
  • 4f0155b use ioutil.TempFile instead uuid
  • 83f9a3a correct Render -> Parser
  • 9c18491 improve warning when incorrect markup setting
  • 640eaba fix typos

📊 Changes

4 files changed (+149 additions, -1 deletions)

View changed files

📝 cmd/web.go (+3 -0)
📝 conf/app.ini (+9 -0)
modules/markup/external/external.go (+88 -0)
📝 modules/setting/setting.go (+49 -1)

📄 Description

Will close #374.

Usage:
Add the below to your custom/conf/app.ini file. You can add one or more sections. The section name should markup.xxxxx, which you can name it as you like. Follow the below config items then restart your gitea, it's done. For example:

On MacOS,

brew install asciidoc

Then add below config to your custom/conf/app.ini file and restart. Migration https://github.com/maxandersen/gdoc2adoc.git and then view the .adoc file.

[markup.asciidoc]
ENABLED = true
; List of file extensions that should be rendered by an external command
FILE_EXTENSIONS = .adoc,.asciidoc
; External command to render all matching extensions
RENDER_COMMAND = "asciidoc --out-file=- -"
; Input is not a standard input but a file
IS_INPUT_FILE = false

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/2570 **Author:** [@lunny](https://github.com/lunny) **Created:** 9/22/2017 **Status:** ✅ Merged **Merged:** 11/7/2017 **Merged by:** [@lafriks](https://github.com/lafriks) **Base:** `master` ← **Head:** `lunny/external_markup` --- ### 📝 Commits (10+) - [`c5940d0`](https://github.com/go-gitea/gitea/commit/c5940d04110eb1ae8fcf837982fa5780cdb5c470) add external markup render support - [`0feec65`](https://github.com/go-gitea/gitea/commit/0feec653e0c58e0bd84b777d2ab1092e05ef81f8) bug fixed - [`f39e5ab`](https://github.com/go-gitea/gitea/commit/f39e5ab974b5be0e247e32eb7835d5628fa8d80a) refacotr codes and fix wrong error log - [`754332b`](https://github.com/go-gitea/gitea/commit/754332b6248243161df014f7c4e0ca984559b248) fix comments and add check to prevent leaks - [`c3f0803`](https://github.com/go-gitea/gitea/commit/c3f0803b37fb2a58e296c9130d50735e04efea40) add check for config file and improve the example - [`c44ff2e`](https://github.com/go-gitea/gitea/commit/c44ff2e9c8aa4c14af2d12b2e27c9759ec68a43a) check file close error - [`4f0155b`](https://github.com/go-gitea/gitea/commit/4f0155b4bf2fb0afebdcca843bc26db2305968fe) use ioutil.TempFile instead uuid - [`83f9a3a`](https://github.com/go-gitea/gitea/commit/83f9a3a5da920620d13c6d8bdbeb93001e8d9e93) correct Render -> Parser - [`9c18491`](https://github.com/go-gitea/gitea/commit/9c184916fb26e4dc155d3032bed0558273bd79ad) improve warning when incorrect markup setting - [`640eaba`](https://github.com/go-gitea/gitea/commit/640eabaefe6868a7a9dc07f026e0f4d2b0a57eca) fix typos ### 📊 Changes **4 files changed** (+149 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `cmd/web.go` (+3 -0) 📝 `conf/app.ini` (+9 -0) ➕ `modules/markup/external/external.go` (+88 -0) 📝 `modules/setting/setting.go` (+49 -1) </details> ### 📄 Description Will close #374. Usage: Add the below to your `custom/conf/app.ini` file. You can add one or more sections. The section name should `markup.xxxxx`, which you can name it as you like. Follow the below config items then restart your `gitea`, it's done. For example: On MacOS, ``` brew install asciidoc ``` Then add below config to your `custom/conf/app.ini` file and restart. Migration `https://github.com/maxandersen/gdoc2adoc.git` and then view the `.adoc` file. ```ini [markup.asciidoc] ENABLED = true ; List of file extensions that should be rendered by an external command FILE_EXTENSIONS = .adoc,.asciidoc ; External command to render all matching extensions RENDER_COMMAND = "asciidoc --out-file=- -" ; Input is not a standard input but a file IS_INPUT_FILE = false ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 12:11:29 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#16474