From 9064deb6f98abdb7f0588e46e14f7c57819aebf3 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 28 Jul 2021 21:39:46 -0600 Subject: [PATCH] Pre-fill suggested New File 'name' and 'content' with Query Params (#16556) * feature: add (GitHub-style) querystrings for pre-filling new file content * docs: add query parameters for new files --- doc/developers/integrations.en-us.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/doc/developers/integrations.en-us.md b/doc/developers/integrations.en-us.md index 8a111a3a..15d5e7e5 100644 --- a/doc/developers/integrations.en-us.md +++ b/doc/developers/integrations.en-us.md @@ -24,3 +24,22 @@ If you are looking for [CI/CD](https://gitea.com/gitea/awesome-gitea#user-conten an [SDK](https://gitea.com/gitea/awesome-gitea#user-content-sdk), or even some extra [themes](https://gitea.com/gitea/awesome-gitea#user-content-themes), you can find them listed in the [awesome-gitea](https://gitea.com/gitea/awesome-gitea) repository! + +## Pre-Fill New File name and contents + +If you'd like to open a new file with a given name and contents, +you can do so with query parameters: + +```txt +GET /{{org}}/{{repo}}/_new/{{filepath}} + ?filename={{filename}} + &value={{content}} +``` + +For example: + +```txt +GET https://git.example.com/johndoe/bliss/_new/articles/ + ?filename=hello-world.md + &value=Hello%2C%20World! +```