Don't do it!

If you are writing a book with code samples and stuff, we highly recommend using Dropbox, GitHub or Bitbucket + Markua or Leanpub Flavoured Markdown mode, not Google Docs.

Google Docs mode on Leanpub is for business books and novels, not programming books.  It basically supports chapters, sections, paragraphs, bulleted and numbered lists, images, links, tables -- the basics, nothing fancy.

At some point we could add a convention around "monospaced text should be treated as a code sample", but there would be no way to specify the code language.  So, our formatter (Pygments) would just be guessing.  And even if that worked, there would be some other limitation which we would not be able to solve with a convention -- like specifying subsets of files, using external code samples, etc.

So, seriously, just switch to Dropbox, GitHub or Bitbucket + Markua or Leanpub-Flavoured Markdown :)

Did this answer your question?