Skip to content

Conversation

@LinlyBoi
Copy link

@LinlyBoi LinlyBoi commented Nov 24, 2025

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 added 9 commits November 24, 2025 12:31
Instead of hard coding it to be markdown only and allow for org files to
be 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
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 24, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Nov 24, 2025
Modernise string suffix check with CutSuffix
Added nilcheck for entry after the org version check attempt
@LinlyBoi LinlyBoi marked this pull request as ready for review November 24, 2025 12:01
@lunny
Copy link
Member

lunny commented Nov 24, 2025

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 commented Nov 25, 2025

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 be the 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-actions github-actions bot added modifies/translation modifies/api This PR adds API routes or modifies them modifies/templates This PR modifies the template files labels Nov 27, 2025
OriginalURL string `xorm:"VARCHAR(2048)"`
DefaultBranch string
DefaultWikiBranch string
DefaultWikiFormat string
Copy link
Member

Choose a reason for hiding this comment

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

Please use RepoUnit to store the per repository configuration.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/translation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: org-mode support in wiki

3 participants