Markdown File Viewing in Nextcloud 9 ?

I’m very new to Nextcloud, having started just a few days ago. I encountered an issue with viewing and using Markdown (.md) files. I want a preview mode rather than opening them directly in edit mode. Here are my findings after spending an entire day searching for answers and solutions.

It appears that older versions of the Text app had this preview feature, and earlier versions of Nextcloud offered settings for it as well. Some apps can provide this functionality, but they’re not available for newer servers.

So, here’s my temporary fix. I hope it helps others facing the same challenge—or that someone can offer a more straightforward solution, as it was quite an ordeal just to enable preview mode for Markdown files.


Fixing Markdown File Navigation in Nextcloud

Environment

  • Nextcloud Hub 9 (NC27)
  • Text app 4.1.0 (default installed)
  • Notes app 4.11.0 (solution)

The Problem
By default, Nextcloud’s Text app forces markdown files to open in edit mode, breaking normal web browsing functionality.

I tried - 
* 	looked for default file handling behaviors and did not find it 
    * 	looked for text app settings but could not find any
    * 	looked for replacement markdown viewer apps - none compatible showing in store
    *      manually changing config files but could not get the desired result

The Solution
- not optimal, hoping temporary until apps get updates -

Use the Notes app instead of the Text app for markdown file viewing:

  1. Install Notes app 4.11.0
  2. Configure two settings:
    Notes path: [selected folder my md files are in]
    Display mode: Preview

The Result
Files now open in preview mode with normal browser functionality:

  • Files open in clean preview mode
  • All browser functions work normally:
    • Back/forward navigation
    • Multiple tabs
    • Browser history
    • Search
    • Bookmarks
  • Can still edit when needed
  • Functions like normal web pages

Limitation

  • Must keep markdown files in the designated Notes path folder
  • Single top-level folder for all markdown files

Keyboard Shortcuts

  • CTRL + /: Switch between editor and viewer
  • Other standard markdown shortcuts available in edit mode

Actually, the view of Markdown files should not differ between the editor and viewer mode (if it existed at all). Nextcloud directly displays the Markdown file as Markdown.

However, as an alternative, you can share the folder with the Markdown files or a single Markdown file with a share (read only). Maybe this will help you with your problem.

It’s the forced editing mode that I am trying to have control over. I do not want certain folders to be auto open in “edit” mode. It really slows down viewing process.

Then they are read only with no edit option? I want the option to edit, just not to open with edit as default.

The Nextcloud Text app is based on a different Markdown editor than the ‘old’ one that is still built into Nextcloud Notes and available as an option there, and it doesn’t distinguish between ‘edit mode’ and ‘viewer mode’, but has other advantages like WYSIWG editing and collaborative editing that the ‘old’ one in Notes doesn’t have.

You could submit a feature request here, but personally I doubt that the developers would actually want to integrate something like this, as it would be a fundamentally different UX/design philosophy. Also, I don’t know if it would be feasible without a major redesign of the products it’s based on.

The Nextcloud Text app is based on https://tiptap.dev/, which is itself based on https://prosemirror.net/.