Embed gists, then reuse portions of them preserving their original line numbers (also, only retrieves each gist once... reusing it for additional references in your page).