\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{hwlst}[2024/01/01 hwlst]

\RequirePackage{listings, xcolor, accsupp}
\newcommand{\noncopynumber}[1]{% keep line numbers from being copied in code listings
    \BeginAccSupp{method=escape,ActualText={}}
    #1
    \EndAccSupp{}
}
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{codeyellow}{rgb}{0.51, 0.37, 0.012}
\lstdefinelanguage{js} {
  keywords={typeof, new, true, false, catch, function, return, null, catch, switch, var, if, in, while, do, else, case, break},
  ndkeywords={class, export, boolean, throw, implements, import, this},
  sensitive=false,
  comment=[l]{//},
  morecomment=[s]{/*}{*/},
  morestring=[b]',
  morestring=[b]"
}

\lstset {
  aboveskip=\baselineskip,
  commentstyle=\color{codegreen},
  keywordstyle=\bfseries\color{codeyellow},
  numberstyle=\ttfamily\tiny\color{codegray}\noncopynumber,
  stringstyle=\color{codepurple},
  basicstyle=\ttfamily\footnotesize\color{black},% colour black since I want listings to stay the same colour in solutions
  breakatwhitespace=false,
  breaklines=true,
  captionpos=b,
  keepspaces=true,
  numbers=left,
  xleftmargin=2em,
  numbersep=5pt,
  showspaces=false,
  showstringspaces=false,
  showtabs=false,
  tabsize=2,
  frame=tb
}
