Skip to content

Instantly share code, notes, and snippets.

@nosun
Forked from pletiplot/markdown2dokuwiki.sed
Last active August 29, 2015 14:10
Show Gist options
  • Save nosun/9accb3679d9e8d3d4a91 to your computer and use it in GitHub Desktop.
Save nosun/9accb3679d9e8d3d4a91 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