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

Conversation

@LinlyBoi
Copy link

@LinlyBoiLinlyBoi commentedNov 24, 2025
edited
Loading

Resolves#12832
Gitea supports rendering .org files but Wiki does not support pushing .org files and simply ignores them see the issue mentioned for more details.
Editing: Org file on wiki that was pushed
image
After saving:
image

The major changes were made to the logic that detects the files pushed to the wiki repo to check for .org files as well as .md files.

If two files with the same name but different extension exist (home.org and home.md for example) .md will take precedence.

Rendering .org worked initially but there was an error hard coded to throw a warning when the detected markup is not markdown and now it uses the detect markup function for the file extension to add support for both .md and .org

This PR currently supports pushing .org files through the git repo for the wiki.

Aly Sewelam added9 commitsNovember 24, 2025 12:31
Instead of hard coding it to be markdown only and allow for org files tobe detected and rendered properly
Resort to raw file if neither is found too.
Used Git filename to properly handle .org files
This handles .org files markup detection
markdown files still take priority over org files if both are present
@GiteaBotGiteaBot added the lgtm/need 2This PR needs two approvals by maintainers to be considered for merging. labelNov 24, 2025
@github-actionsgithub-actionsbot added the modifies/goPull requests that update Go code labelNov 24, 2025
Modernise string suffix check with CutSuffixAdded nilcheck for entry after the org version check attempt
@LinlyBoiLinlyBoi marked this pull request as ready for reviewNovember 24, 2025 12:01
@lunny
Copy link
Member

I think we should introduce a configuration option for the Wiki to choose between markdown and org. This way, we won’t need to handle both formats everywhere, which is not sustainable in the long term.

Additionally, we should add tests to ensure that the new file type works correctly.

@LinlyBoi
Copy link
Author

Would the configuration be per-repo or instance wide? I think even an option to include both formats is viable since both formats can coexist without issue. I will try to add that but any pointers would be great!

@lunny
Copy link
Member

lunny commentedNov 25, 2025
edited
Loading

Would the configuration be per-repo or instance wide? I think even an option to include both formats is viable since both formats can coexist without issue. I will try to add that but any pointers would be great!

Per-repository, the configuration name should bethe default format which will allow both formats. If this option doesn’t exist, any page created through the UI will always default to Markdown.

@github-actionsgithub-actionsbot added modifies/translation modifies/apiThis PR adds API routes or modifies them modifies/templatesThis PR modifies the template files labelsNov 27, 2025
OriginalURLstring`xorm:"VARCHAR(2048)"`
DefaultBranchstring
DefaultWikiBranchstring
DefaultWikiFormatstring
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Please useRepoUnit to store the per repository configuration.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Alright I'll make the changes needed still getting familiar with the codebase apologies.

DisableMigrations:false,
DisableStars:false,
DefaultBranch:"main",
DefaultWikiFormat:"markdown",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't think we need a global configuration?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It could be useful to have it for cases where you want every repo globally to support both or either upon creation while still leaving the repo owners the freedom to change it.

@wxiaoguang
Copy link
Contributor

TBH, I think it needs a complete design instead of adding more patches.

Some edge cases:

  • Should it support editing "md" file if "org" is used? How to?
  • If both "md" and "org" exist, how to manage? (eg: delete)
  • The new design and changed code should be covered by tests.

And TBH, actually, the legacy wiki file design is quite problematic, including the "escaping" mechanism, they don't work well.

If let me re-design the wiki, I'd like to make the path name / wiki title / file name more flexible, and remove all these legacy tricks (avoid unnecessary URL encoding, avoid space and dash hacking, etc).

@wxiaoguangwxiaoguang marked this pull request as draftNovember 28, 2025 12:16
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@lunnylunnylunny left review comments

Assignees

No one assigned

Labels

lgtm/need 2This PR needs two approvals by maintainers to be considered for merging.modifies/apiThis PR adds API routes or modifies themmodifies/goPull requests that update Go codemodifies/templatesThis PR modifies the template filesmodifies/translation

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Feature request: org-mode support in wiki

4 participants

@LinlyBoi@lunny@wxiaoguang@GiteaBot

[8]ページ先頭

©2009-2025 Movatter.jp