Skip to content

Instantly share code, notes, and snippets.

@thinca
Forked from Shougo/gist:261441
Created December 22, 2009 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thinca/261452 to your computer and use it in GitHub Desktop.
Save thinca/261452 to your computer and use it in GitHub Desktop.
function! s:ParseMarkdown()
return map(split(join(getline(1, '$'), "\n"), '\v(^|\n)\ze#+'), 'split(v:val, "\n")')
endfunction
" Usage
let s:pages = s:ParseMarkdown()
let s:max_page_number = len(s:pages) - 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment