-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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
Modernise string suffix check with CutSuffix Added nilcheck for entry after the org version check attempt
|
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. |
|
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 |
- listing of wiki pages now depends on option and defaults to markdown only
Updated all calls of function to include the new signature The new signature calls for the repo setting for wiki formats
| OriginalURL string `xorm:"VARCHAR(2048)"` | ||
| DefaultBranch string | ||
| DefaultWikiBranch string | ||
| DefaultWikiFormat string |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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?
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
After saving:
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.