Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Implement .org file rendering in Wiki#36018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
LinlyBoi wants to merge19 commits intogo-gitea:main
base:main
Choose a base branch
Loading
fromLinlyBoi:main
Draft
Changes from1 commit
Commits
Show all changes
19 commits
Select commitHold shift + click to select a range
30254b9
Detect markup rendering from filename
Nov 24, 2025
cb93344
Detect .org files if .md isn't found in wiki
Nov 24, 2025
cb38c04
Handle .org files in Sidebar and footer of wiki
Nov 24, 2025
51b7680
Detect markup type instead of defaulting to .md
Nov 24, 2025
3931b8f
Add .org file detection to WikiRaw function
Nov 24, 2025
36c23b8
Add .org condition to escapeSegToWeb
Nov 24, 2025
3ae4823
Add org file path resolution for Web and Git paths
Nov 24, 2025
676a785
add .org to WebPathToUserTitle
Nov 24, 2025
83353a8
Add .org to Git path preparation
Nov 24, 2025
e2812ca
Resolve linting issues
Nov 24, 2025
3268f6f
Merge branch 'go-gitea:main' into main
LinlyBoiNov 25, 2025
997ce9f
Add default wiki format setting value to struct
Nov 26, 2025
f0c005b
Add DefaultWikiFormat var and its checks
Nov 26, 2025
a4ccf65
use config option for default wiki format paths
Nov 26, 2025
884a1ed
Integrate DefaultWikiFormat to wiki settings
Nov 27, 2025
535a377
check wiki entry names based on DefaultWikiFormat
Nov 27, 2025
914926f
Add wiki format setting to option tmpl and locales
Nov 27, 2025
4778511
Include defaultWikiFormat in WebPathToGitPath
Nov 27, 2025
1707118
Merge container registry fix to fork
Nov 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
NextNext commit
Detect markup rendering from filename
Instead of hard coding it to be markdown only and allow for org files tobe detected and rendered properly
  • Loading branch information
Aly Sewelam committedNov 24, 2025
commit30254b941b21d1544a464f962b70bcccf4744a18
14 changes: 11 additions & 3 deletionsrouters/web/repo/wiki.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -252,7 +252,7 @@ func renderViewPage(ctx *context.Context) (*git.Repository, *git.TreeEntry) {

rctx := renderhelper.NewRenderContextRepoWiki(ctx, ctx.Repo.Repository)

renderFn := func(data []byte) (escaped *charset.EscapeStatus, output template.HTML, err error) {
renderFn := func(data []byte, filename string) (escaped *charset.EscapeStatus, output template.HTML, err error) {
buf := &strings.Builder{}
markupRd, markupWr := io.Pipe()
defer markupWr.Close()
Expand All@@ -265,13 +265,21 @@ func renderViewPage(ctx *context.Context) (*git.Repository, *git.TreeEntry) {
close(done)
}()

err = markdown.Render(rctx, bytes.NewReader(data), markupWr)
// Detect markup type from filename and use the appropriate renderer
// (.md -> markdown, .org -> orgmode)
markupType := markup.DetectMarkupTypeByFileName(filename)
if markupType == "" {
// Default to markdown if detection fails
markupType = markdown.MarkupName
}
fileRctx := rctx.WithMarkupType(markupType).WithRelativePath(filename)
err = markup.Render(fileRctx, bytes.NewReader(data), markupWr)
_ = markupWr.CloseWithError(err)
<-done
return escaped, output, err
}

ctx.Data["EscapeStatus"], ctx.Data["WikiContentHTML"], err = renderFn(data)
ctx.Data["EscapeStatus"], ctx.Data["WikiContentHTML"], err = renderFn(data, pageFilename)
if err != nil {
ctx.ServerError("Render", err)
return nil, nil
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp