Git with a cup of tea, painless self-hosted git service
Mirror for internal git.with.parts use
https://git.with.parts
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wxiaoguang
c0d105609f
Add `DumpVar` helper function to help debugging templates (#24262)
I guess many contributors might agree that it's really difficult to
write Golang template. The dot syntax `.` confuses everyone: what
variable it is ....
So, we can use a `{{DumpVar .ContextUser}}` to look into every variable
now.
![image](https://user-images.githubusercontent.com/2114189/233692383-f3c8f24d-4465-45f8-839b-b63e00731559.png)
And it can even dump the whole `ctx.Data` by `{{DumpVar .}}`:
```
dumpVar: templates.Vars
{
"AllLangs": [
{
"Lang": "id-ID",
"Name": "Bahasa Indonesia"
},
...
"Context": "[dumped]",
"ContextUser": {
"AllowCreateOrganization": true,
"AllowGitHook": false,
"AllowImportLocal": false,
...
"TemplateLoadTimes": "[func() string]",
"TemplateName": "user/profile",
"Title": "Full'\u003cspan\u003e Name",
"Total": 7,
"UnitActionsGlobalDisabled": false,
"UnitIssuesGlobalDisabled": false,
"UnitProjectsGlobalDisabled": false,
"UnitPullsGlobalDisabled": false,
"UnitWikiGlobalDisabled": false,
"locale": {
"Lang": "en-US",
"LangName": "English",
"Locale": {}
}
...
---------
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: silverwind <me@silverwind.io>
|
2 years ago |
.. |
eval
|
Use a general Eval function for expressions in templates. (#23927)
|
2 years ago |
scopedtmpl
|
Make HTML template functions support context (#24056)
|
2 years ago |
vars
|
Implement FSFE REUSE for golang files (#21840)
|
2 years ago |
base.go
|
Use a general approach to access custom/static/builtin assets (#24022)
|
2 years ago |
dynamic.go
|
Use a general approach to access custom/static/builtin assets (#24022)
|
2 years ago |
helper.go
|
Add `DumpVar` helper function to help debugging templates (#24262)
|
2 years ago |
helper_test.go
|
Implement FSFE REUSE for golang files (#21840)
|
2 years ago |
htmlrenderer.go
|
Make HTML template functions support context (#24056)
|
2 years ago |
htmlrenderer_test.go
|
Show friendly 500 error page to users and developers (#24110)
|
2 years ago |
mailer.go
|
Use a general approach to access custom/static/builtin assets (#24022)
|
2 years ago |
static.go
|
Use a general approach to access custom/static/builtin assets (#24022)
|
2 years ago |
templates_bindata.go
|
Implement FSFE REUSE for golang files (#21840)
|
2 years ago |
util.go
|
Add `DumpVar` helper function to help debugging templates (#24262)
|
2 years ago |
util_test.go
|
Merge template functions "dict/Dict/mergeinto" (#23932)
|
2 years ago |