GitHub wiki - extract and paste text from repo's files (for documentation purposes)

Hello

I have a repository, and I use the GitHub wiki as the main source of its documentation.

In my repo, each function has its own file. I have individual wiki pages to explain how to use each of these functions.

Is there a way that I can extract comments from the function’s file, and insert that onto the wiki page for that function?

For example, I have a function called remove (file here). It has an associated wiki page. But as you can see, this wiki page just tells the visitor to look at the comments in the file remove.luaHow could I instead have the wiki page automatically add the text in that big comment (in remove.lua)? 

I can easily come up with a regexp to get the right text. But then how would I be able to add that text to the wiki page? 

Ideally, I’d like my files to have block comments with markdown formatting of the documentation. Then, I could have the wiki automatically pull from that documentation if I ever update the file.

I’m aware of a few alternatives. I have no idea how GitHub Pages works. Obviously, if I can accomplish this without learning how to use Pages, then that’d be great. And I’m avoiding Ldoc for the time being (my repo uses Lua).

No, such functionality is not provided by GitHub wiki. You could try using pages or your own hosted website for that.