If you have DokuWiki release "Greebo" and use advanced syntax higlhight options (see
https://www.dokuwiki.org/syntax_highlighting) you should be able to have line numbering on the standard syntax. Using the file tag should make the code block downloadable.