Open Source Collaboration With Hedgedoc

In this article, I take a look at Hedgedoc which is an excellent open source collaboration tool.

Open Source Collaboration With Hedgedoc

Video:

What is Hedgedoc?

Hedgedoc is a collaboration tool that let's multiple people work on the same document across the internet. It offers the ability to format text via markdown or via the formatting menu.

Installation

Installation of Hedgedoc can be done manually or via Docker. You can review the full installation instructions here.

For the purposes of my testing and demo, I went the route of docker. The Hedgedoc documentation includes a sample docker-compose.yml file. Below is the version I used with very minor tweaks for that.

⚠️
This is NOT how installation should be done in a Production environment. This is just what I did for my purposes of testing the app.
 
version: '3'
services:
  database:
    image: postgres:13.4-alpine
    environment:
      - POSTGRES_USER=hedgedoc
      - POSTGRES_PASSWORD=password
      - POSTGRES_DB=hedgedoc
    volumes:
      - database:/var/lib/postgresql/data
    restart: always
  app:
    # Make sure to use the latest release from https://hedgedoc.org/latest-release
    image: quay.io/hedgedoc/hedgedoc:1.9.4
    environment:
      - CMD_DB_URL=postgres://hedgedoc:password@database:5432/hedgedoc
      #By default this is 'localhost' to get this to work properly on LAN, I had to enter the private IP of the host
      - CMD_DOMAIN=192.168.10.41
      - CMD_URL_ADDPORT=true
      - CMD_HSTS_ENABLE=true
      # Added while trying to fix the issue I was having with style sheets not displaying properly.
      - UPLOADS_MODE=0755
    volumes:
      - uploads:/hedgedoc/public/uploads
    ports:
      - "3000:3000"
    restart: always
    depends_on:
      - database
volumes:
  database:
  uploads:
Not a Production Setup!!!

I put the docker-compose.yml file in ~/yt_apps/hedgedoc then ran the following commands:

cd /~/yt_apps/hedgedoc
docker-compose up
Bash Script

After the app fully started up, on the host machine I could navigate to 127.0.0.1:3000 to access Hedgedoc. To access it from another PC, I needed to navigate to the private IP address of that pc, Ex. 192.168.x.x:3000. Once there, I was greeted with the Hedgedoc homepage:

Hedgedoc Homepage
Hedgedoc Homepage

There are many authentication options including Twitter, Email, and Github. Here's a full list from the documentation as of July 2022:

All Login Methods shown in Hedgedoc Documentation
All Login Methods shown in Hedgedoc Documentation

I only kept email for my example and was able to setup a local account. From there, I was able to start creating notes.

Features Tour

Clicking on any of the options below will take you to a special document that walks through all the features Hedgedoc has:

Options that take you to the Features Doc
Options that take you to the Features Doc

Once in a file, the menu below appears on the top left:

Options Menu on the Left.
Options Menu on the Left.

The moon will switch between light and dark mode. To the left, the eye, side by side icon, and pencil icon opens up view mode, side by side mode, and edit mode respectively. Side by side shows a preview of the page in one pane and allows edits to be done in the other.

A menu on the right, shows the following:

Options Menu on the Right.
Options Menu on the Right.

Which allows a new file to be created or a view only publish link to be created. The Menu option allows for the file to be downloaded, as well as a few import options, and revisions.

After clicking into edit mode, across the top of the editing window, various formatting options will appear. All of these options can be performed via the menu or by the standard markdown keys astericks for italics, etc.

This is where the features started to surprise me. Near the bottom tucked away, this menu appears:

bottom options bar
bottom options bar

Clicking "Spaces" will change it to "Tab Size." The Spaces option is best for code like Python where indentation really matters. The most surprising however, is if SUBLIME is clicked, two more options appear:

Sublime, Emacs, or Vim
Sublime, Emacs, or Vim

To me, it's pretty crazy Hedgedoc has both a Vim and Emacs mode, and the Vim mode works as you'd expect, you can enter and exit Insert Mode just like you would in normal Vim.

The actual document itself allows for pasting or uploading images, Youtube video embeds, and even creating UML Diagrams. Other features like yaml meta data, Latex  and PDF embeds are also included.

The last feature I want to mention though, was a big surprise. Hedgedoc offers a Slides mode, meaning if you setup your document correctly, you can present it as a slide show. While the formatting is limited, Slides mode does have options like transisitions, colored backgrounds and even video backgrounds. Pressing the 'S' key brings up the speaker view, which gives the speaker a view where they can see the current slide, their notes, the next slide and the time plus a timer.

Speaker view of Slide mode
Speaker view of Slide mode

I am curious how much Slide mode is used, because it's very fully featured. A lot of hard work went into making this mode great.

Closing Thoughts

Hedgedoc is an excellent collaboration tool. The sheer amount of flexibilty allowed in this app is amazing. This would be an excellent option for someone that want to collaborate with others but wants an open source option.  It looks like a lot of thought has been put into this app to make sure that basically any form of notes that need to be shared among a group of people can be shared in Hedgedoc.