Skip to content

Commit af79677

Browse files
pat-s6543lafriks
authored
Reformat docs (#13897)
Co-authored-by: 6543 <[email protected]> Co-authored-by: Lauris BH <[email protected]>
1 parent 97ab820 commit af79677

File tree

86 files changed

+1128
-970
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1128
-970
lines changed

docs/content/doc/advanced/cmd-embedded.en-us.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ date: "2020-01-25T21:00:00-03:00"
33
title: "Embedded data extraction tool"
44
slug: "cmd-embedded"
55
weight: 40
6-
toc: true
6+
toc: false
77
draft: false
88
menu:
99
sidebar:
@@ -15,6 +15,10 @@ menu:
1515

1616
# Embedded data extraction tool
1717

18+
**Table of Contents**
19+
20+
{{< toc >}}
21+
1822
Gitea's executable contains all the resources required to run: templates, images, style-sheets
1923
and translations. Any of them can be overridden by placing a replacement in a matching path
2024
inside the `custom` directory (see [Customizing Gitea]({{< relref "doc/advanced/customizing-gitea.en-us.md" >}})).
@@ -28,7 +32,7 @@ can be used from the OS shell interface.
2832

2933
To list resources embedded in Gitea's executable, use the following syntax:
3034

31-
```
35+
```sh
3236
gitea embedded list [--include-vendored] [patterns...]
3337
```
3438

@@ -48,11 +52,11 @@ a special meaning for your command shell.
4852

4953
If no pattern is provided, all files are listed.
5054

51-
#### Example
55+
### Example
5256

5357
Listing all embedded files with `openid` in their path:
5458

55-
```
59+
```sh
5660
$ gitea embedded list '**openid**'
5761
public/img/auth/openid_connect.svg
5862
public/img/openid-16x16.png
@@ -68,7 +72,7 @@ templates/user/settings/security_openid.tmpl
6872

6973
To extract resources embedded in Gitea's executable, use the following syntax:
7074

71-
```
75+
```sh
7276
gitea [--config {file}] embedded extract [--destination {dir}|--custom] [--overwrite|--rename] [--include-vendored] {patterns...}
7377
```
7478

@@ -91,19 +95,19 @@ as `filename.bak`. Previous `.bak` files are overwritten.
9195
At least one file search pattern must be provided; see `list` subcomand above for pattern
9296
syntax and examples.
9397

94-
#### Important notice
98+
### Important notice
9599

96100
Make sure to **only extract those files that require customization**. Files that
97101
are present in the `custom` directory are not upgraded by Gitea's upgrade process.
98102
When Gitea is upgraded to a new version (by replacing the executable), many of the
99103
embedded files will suffer changes. Gitea will honor and use any files found
100104
in the `custom` directory, even if they are old and incompatible.
101105

102-
#### Example
106+
### Example
103107

104108
Extracting mail templates to a temporary directory:
105109

106-
```
110+
```sh
107111
$ mkdir tempdir
108112
$ gitea embedded extract --destination tempdir 'templates/mail/**.tmpl'
109113
Extracting to tempdir:

docs/content/doc/advanced/customizing-gitea.en-us.md

Lines changed: 40 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ environment variable; this can be used to override the default path to something
4545

4646
**Note:** Gitea must perform a full restart to see configuration changes.
4747

48-
# Table of Contents
48+
**Table of Contents**
4949

5050
{{< toc >}}
5151

@@ -127,8 +127,8 @@ copy javascript files from https://gitea.com/davidsvantesson/plantuml-code-highl
127127
<script src="https://your-server.com/encode.js"></script>
128128
<script src="https://your-server.com/plantuml_codeblock_parse.js"></script>
129129
<script>
130-
<!-- Replace call with address to your plantuml server-->
131-
parsePlantumlCodeBlocks("http://www.plantuml..com/plantuml")
130+
<!-- Replace call with address to your plantuml server-->
131+
parsePlantumlCodeBlocks("http://www.plantuml..com/plantuml");
132132
</script>
133133
{{end}}
134134
```
@@ -148,38 +148,50 @@ The script will detect tags with `class="language-plantuml"`, but you can change
148148
#### Example: STL Preview
149149

150150
You can display STL file directly in Gitea by adding:
151+
151152
```html
152153
<script>
153-
function lS(src){
154-
return new Promise(function(resolve, reject) {
155-
let s = document.createElement('script')
156-
s.src = src
157-
s.addEventListener('load', () => {
158-
resolve()
159-
})
160-
document.body.appendChild(s)
161-
});
162-
}
163-
164-
if($('.view-raw>a[href$=".stl" i]').length){
165-
$('body').append('<link href="/Madeleine.js/src/css/Madeleine.css" rel="stylesheet">');
166-
Promise.all([lS("/Madeleine.js/src/lib/stats.js"),lS("/Madeleine.js/src/lib/detector.js"), lS("/Madeleine.js/src/lib/three.min.js"), lS("/Madeleine.js/src/Madeleine.js")]).then(function() {
167-
$('.view-raw').attr('id', 'view-raw').attr('style', 'padding: 0;margin-bottom: -10px;');
168-
new Madeleine({
169-
target: 'view-raw',
170-
data: $('.view-raw>a[href$=".stl" i]').attr('href'),
171-
path: '/Madeleine.js/src'
154+
function lS(src) {
155+
return new Promise(function (resolve, reject) {
156+
let s = document.createElement("script");
157+
s.src = src;
158+
s.addEventListener("load", () => {
159+
resolve();
160+
});
161+
document.body.appendChild(s);
172162
});
173-
$('.view-raw>a[href$=".stl"]').remove()
174-
});
175-
}
163+
}
164+
165+
if ($('.view-raw>a[href$=".stl" i]').length) {
166+
$("body").append(
167+
'<link href="/Madeleine.js/src/css/Madeleine.css" rel="stylesheet">'
168+
);
169+
Promise.all([
170+
lS("/Madeleine.js/src/lib/stats.js"),
171+
lS("/Madeleine.js/src/lib/detector.js"),
172+
lS("/Madeleine.js/src/lib/three.min.js"),
173+
lS("/Madeleine.js/src/Madeleine.js"),
174+
]).then(function () {
175+
$(".view-raw")
176+
.attr("id", "view-raw")
177+
.attr("style", "padding: 0;margin-bottom: -10px;");
178+
new Madeleine({
179+
target: "view-raw",
180+
data: $('.view-raw>a[href$=".stl" i]').attr("href"),
181+
path: "/Madeleine.js/src",
182+
});
183+
$('.view-raw>a[href$=".stl"]').remove();
184+
});
185+
}
176186
</script>
177187
```
188+
178189
to the file `templates/custom/footer.tmpl`
179190

180191
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.
181192

182193
You should end-up with a folder structucture similar to:
194+
183195
```
184196
custom/templates
185197
-- custom
@@ -267,7 +279,7 @@ To add a custom license, add a file with the license text to `custom/options/lic
267279

268280
Locales are managed via our [crowdin](https://crowdin.com/project/gitea).
269281
You can override a locale by placing an altered locale file in `custom/options/locale`.
270-
Gitea's default locale files can be found in the [`options/locale`](https://github.com/go-gitea/gitea/tree/master/options/locale) source folder and these should be used as examples for your changes.
282+
Gitea's default locale files can be found in the [`options/locale`](https://github.com/go-gitea/gitea/tree/master/options/locale) source folder and these should be used as examples for your changes.
271283

272284
To add a completely new locale, as well as placing the file in the above location, you will need to add the new lang and name to the `[i18n]` section in your `app.ini`. Keep in mind that Gitea will use those settings as **overrides**, so if you want to keep the other languages as well you will need to copy/paste the default values and add your own to them.
273285

@@ -289,10 +301,12 @@ currently there are `{Name}` (name of repository), `{Description}`, `{CloneURL.S
289301
### Reactions
290302

291303
To change reaction emoji's you can set allowed reactions at app.ini
304+
292305
```
293306
[ui]
294307
REACTIONS = +1, -1, laugh, confused, heart, hooray, eyes
295308
```
309+
296310
A full list of supported emoji's is at [emoji list](https://gitea.com/gitea/gitea.com/issues/8)
297311

298312
## Customizing the look of Gitea

docs/content/doc/advanced/environment-variables.en-us.md

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,54 +15,58 @@ menu:
1515

1616
# Environment variables
1717

18+
**Table of Contents**
19+
20+
{{< toc >}}
21+
1822
This is an inventory of Gitea environment variables. They change Gitea behaviour.
1923

2024
Initialize them before Gitea command to be effective, for example:
2125

22-
```
26+
```sh
2327
GITEA_CUSTOM=/home/gitea/custom ./gitea web
2428
```
2529

2630
## From Go language
2731

2832
As Gitea is written in Go, it uses some Go variables, such as:
2933

30-
* `GOOS`
31-
* `GOARCH`
32-
* [`GOPATH`](https://golang.org/cmd/go/#hdr-GOPATH_environment_variable)
34+
- `GOOS`
35+
- `GOARCH`
36+
- [`GOPATH`](https://golang.org/cmd/go/#hdr-GOPATH_environment_variable)
3337

3438
For documentation about each of the variables available, refer to the
3539
[official Go documentation](https://golang.org/cmd/go/#hdr-Environment_variables).
3640

3741
## Gitea files
3842

39-
* `GITEA_WORK_DIR`: Absolute path of working directory.
40-
* `GITEA_CUSTOM`: Gitea uses `GITEA_WORK_DIR`/custom folder by default. Use this variable
41-
to change *custom* directory.
42-
* `GOGS_WORK_DIR`: Deprecated, use `GITEA_WORK_DIR`
43-
* `GOGS_CUSTOM`: Deprecated, use `GITEA_CUSTOM`
43+
- `GITEA_WORK_DIR`: Absolute path of working directory.
44+
- `GITEA_CUSTOM`: Gitea uses `GITEA_WORK_DIR`/custom folder by default. Use this variable
45+
to change _custom_ directory.
46+
- `GOGS_WORK_DIR`: Deprecated, use `GITEA_WORK_DIR`
47+
- `GOGS_CUSTOM`: Deprecated, use `GITEA_CUSTOM`
4448

4549
## Operating system specifics
4650

47-
* `USER`: System user that Gitea will run as. Used for some repository access strings.
48-
* `USERNAME`: if no `USER` found, Gitea will use `USERNAME`
49-
* `HOME`: User home directory path. The `USERPROFILE` environment variable is used in Windows.
51+
- `USER`: System user that Gitea will run as. Used for some repository access strings.
52+
- `USERNAME`: if no `USER` found, Gitea will use `USERNAME`
53+
- `HOME`: User home directory path. The `USERPROFILE` environment variable is used in Windows.
5054

5155
### Only on Windows
5256

53-
* `USERPROFILE`: User home directory path. If empty, uses `HOMEDRIVE` + `HOMEPATH`
54-
* `HOMEDRIVE`: Main drive path used to access the home directory (C:)
55-
* `HOMEPATH`: Home relative path in the given home drive path
57+
- `USERPROFILE`: User home directory path. If empty, uses `HOMEDRIVE` + `HOMEPATH`
58+
- `HOMEDRIVE`: Main drive path used to access the home directory (C:)
59+
- `HOMEPATH`: Home relative path in the given home drive path
5660

5761
## Macaron (framework used by Gitea)
5862

59-
* `HOST`: Host Macaron will listen on
60-
* `PORT`: Port Macaron will listen on
61-
* `MACARON_ENV`: global variable to provide special functionality for development environments
62-
vs. production environments. If MACARON_ENV is set to "" or "development", then templates will
63-
be recompiled on every request. For more performance, set the MACARON_ENV environment variable
64-
to "production".
63+
- `HOST`: Host Macaron will listen on
64+
- `PORT`: Port Macaron will listen on
65+
- `MACARON_ENV`: global variable to provide special functionality for development environments
66+
vs. production environments. If MACARON_ENV is set to "" or "development", then templates will
67+
be recompiled on every request. For more performance, set the MACARON_ENV environment variable
68+
to "production".
6569

6670
## Miscellaneous
6771

68-
* `SKIP_MINWINSVC`: If set to 1, do not run as a service on Windows.
72+
- `SKIP_MINWINSVC`: If set to 1, do not run as a service on Windows.

docs/content/doc/advanced/external-renderers.en-us.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ date: "2018-11-23:00:00+02:00"
33
title: "External renderers"
44
slug: "external-renderers"
55
weight: 40
6-
toc: true
6+
toc: false
77
draft: false
88
menu:
99
sidebar:
@@ -15,12 +15,16 @@ menu:
1515

1616
# Custom files rendering configuration
1717

18+
**Table of Contents**
19+
20+
{{< toc >}}
21+
1822
Gitea supports custom file renderings (i.e., Jupyter notebooks, asciidoc, etc.) through external binaries,
1923
it is just a matter of:
2024

21-
* installing external binaries
22-
* add some configuration to your `app.ini` file
23-
* restart your Gitea instance
25+
- installing external binaries
26+
- add some configuration to your `app.ini` file
27+
- restart your Gitea instance
2428

2529
This supports rendering of whole files. If you want to render code blocks in markdown you would need to do something with javascript. See some examples on the [Customizing Gitea](../customizing-gitea) page.
2630

@@ -29,7 +33,7 @@ This supports rendering of whole files. If you want to render code blocks in mar
2933
In order to get file rendering through external binaries, their associated packages must be installed.
3034
If you're using a Docker image, your `Dockerfile` should contain something along this lines:
3135

32-
```
36+
```docker
3337
FROM gitea/gitea:{{< version >}}
3438
[...]
3539
@@ -49,7 +53,7 @@ RUN pip3 install jupyter docutils
4953

5054
add one `[markup.XXXXX]` section per external renderer on your custom `app.ini`:
5155

52-
```
56+
```ini
5357
[markup.asciidoc]
5458
ENABLED = true
5559
FILE_EXTENSIONS = .adoc,.asciidoc

0 commit comments

Comments
 (0)