I would like to quote from line 205 to 214 of a particular source code.
The Chicago Manual of Style has an entire section on citing "Unpublished and Informally Published Material."
Section 14.243 on citing web sites and blogs would seem to pertain; the guidelines for citing web site content are particularly appropriate. I've noted what modifications that would pertain to citing source code:
For original content from online sources other than the types of formally published documents discussed elsewhere in this chapter, include as much of the following as can be determined:
- the title or a description of the page [the filename]
- the author of the content
- the owner or sponsor of the site
- a URL [of the source code repository]
- a date of revision or modification [the commit hash for Git, the version for SVN]
So a sample source code citation might be
- glm/core/func_trigonometric.inl::radians, lines 36-45, Christophe Riccio, g-truc/glm, https://github.com/g-truc/glm/blob/0.9.5/glm/detail/func_trigonometric.inl, ccb25c84c7c53ccd78e1fb2951d335638bd3e417
This refers to the
radians function that appears in lines 36-45 of the source file cited, in the version indexed by the SHA-1 hash in the citation.