Projects cashmere onedev-org Files
src/main Loading last commit info...
.gitignore
README.org
flake.lock
flake.nix
pom.xml
README.org

OneDev plugin that adds org-mode file rendering via pandoc.

What it does

  • Renders .org files in the repository browser using pandoc for HTML conversion
  • Attempts to display README.org in folder views when no README.md is present
  • Inherits OneDev's existing markup CSS (markdown-rendered class)

Architecture

OrgModule (Guice entry point)
  ├── BlobRenderer → OrgBlobRenderer
  │     └── OrgBlobViewPanel (Wicket panel, reads blob, calls pandoc)
  ├── OrgRenderService → DefaultOrgRenderService
  │     └── Shells out to pandoc --from=org --to=html5
  └── WebApplicationConfigurator → OrgReadmeSupport
        └── IComponentInstantiationListener on FolderViewPanel
              └── Behavior that replaces readme placeholder with OrgReadmePanel

Building

nix build

The output goes to result/share/onedev-plugins/*.jar.

For development:

nix develop
mvn package -Dmaven.test.skip=true

Integration with ~/nix

The ~/nix/flake.nix consumes this flake as an input. The server-onedev-org NixOS module:

  1. Adds the plugin JAR to OneDev's lib/ directory via extraPlugins
  2. Adds pandoc to the systemd service PATH via extraPath

Caveats

  • Folder README.org display uses reflection to hook into FolderViewPanel internals. This may break across OneDev major version upgrades. Individual .org file rendering (BlobRenderer) uses a stable extension point and is not affected.
  • Pandoc must be on the OneDev service's PATH. The NixOS module handles this.
  • Files larger than 2 MiB fall back to raw <pre> display.
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover