Skip to content

Instantly share code, notes, and snippets.

@yloiseau
Created September 10, 2014 10:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yloiseau/369b2d578c7fc7481eda to your computer and use it in GitHub Desktop.
Save yloiseau/369b2d578c7fc7481eda to your computer and use it in GitHub Desktop.
Adding HTTP to LaTeX listings package
\lstdefinelanguage{http}{%
morekeywords=[1]{HTTP,%
GET,POST,PUT,HEAD,DELETE,PATCH,OPTIONS,CONNECT,TRACE,%
OK,Precondition,Failed,Not,Modified,Acceptable,%
Created,Found,Accepted,No,Content,Gone,Multiple,Choices,See,Other,Method,Allowed,%
Unsupported,Media,Type,Required%
},%
morekeywords=[2]{%
Accept,Accept-Encoding,Accept-Language,Alternates,%
Content-Type,Content-Language,Content-Encoding,Content-Location,Content-Length,%
If-Match,If-None-Match,If-Modified-Since,If-Unmodified-Since,%
ETag,Last-Modified,Negotiate,TCN,Vary,%
Cache-control,%
Allow,%
Date,%
Host,%
Location,%
Server,%
User-Agent,%
},%
alsodigit=-,%
morestring=[b]",%
morecomment=[l]\$,%
morecomment=[s]{[}{]},%
}[keywords,comments,strings]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment