Introducing the mindmapdoc gem

require 'logger'
require 'mindmapdoc'

s = "
breakfast
  porridge
  coffee
lunch
  pizza
dinner
  cheese burgers
"
mmd = MindmapDoc.new(s, root: 'today')
puts mmd.to_doc

## Markdown document output

# Today

## Breakfast

### Porridge

### Coffee

## Lunch

### Pizza

## Dinner

### Cheese burgers
mmd.to_svg

SVG Output

G today today breakfast breakfast today->breakfast lunch lunch today->lunch dinner dinner today->dinner porridge porridge breakfast->porridge coffee coffee breakfast->coffee pizza pizza lunch->pizza cheese burgers cheese burgers dinner->cheese burgers

Importing a markdown document

s2 = "
# Today

## Breakfast

### Porridge

### Coffee

## Lunch

### Pizza

## Dinner

### Cheese burgers
"

mmd = MindmapDoc.new(s2)
mmd.root  #=> Today
mmd.to_s

## Tree Output

Breakfast
  Porridge
  Coffee
Lunch
  Pizza
Dinner
  Cheese burgers

Resources