Skip to content

Instantly share code, notes, and snippets.

@patux
Forked from pletiplot/markdown2dokuwiki.sed
Created March 30, 2013 19:38
Show Gist options
  • Save patux/5278057 to your computer and use it in GitHub Desktop.
Save patux/5278057 to your computer and use it in GitHub Desktop.
#! /bin/sed -f
## Markdown2Dokuwiki - reformat Markdown to Dokuwiki
## Copyright (C) 2012 Matous J. Fialka, <http://mjf.cz/>
## Released under the terms of The MIT License
## TODO: many things yet...
# reformatovani nadpisu
s/^#####/==/
s/^####/===/
s/^###/====/
s/^##/=====/
s/^#/======/
# doplneni prave casti nadpisu
/^=/ {
s/^\(=\+\)\(.*\)/\1\2 \1/
}
# reformatovani cislovanych seznamu
s/^[ \t]*[0-9]\.[ \t]\+\(.*\)/ - \1/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment