\ProvidesFile{ctan.bbx}[2022/10/18 v0.01]

\RequireBibliographyStyle{authortitle}

\DeclareDatamodelFields[type=field,datatype=literal]{mirror}
\DeclareDatamodelFields[type=field,datatype=literal]{license}
\DeclareDatamodelFields[type=field,datatype=literal]{label}

\DeclareFieldFormat{mirror}{\textsc{Mirror}: \url{#1}}
\DeclareFieldFormat{license}{\textsc{License}: #1}
\DeclareFieldFormat{label}{#1}

\newbibmacro*{mirror}{%
  \iffieldundef{mirror}%
    {}
    {\printfield{mirror}}}

\newbibmacro*{license}{%
  \iffieldundef{license}%
    {}
    {\printfield{license}}}

\DeclareBibliographyDriver{manual}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor}%
  \setunit{\printdelim{nametitledelim}}\newblock
  \usebibmacro{title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{byeditor}%
  \newunit\newblock
  \printfield{edition}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \printfield{type}%
  \newunit
  \usebibmacro{publisher+location+date}%
  \newunit
  \printfield{version}%
  \newunit
  \usebibmacro{license}%
  \newunit
  \printfield{annotation}%
  \newunit\newblock
  \printlist{organization}%
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit
  \printfield{pagetotal}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{isbn}}
    {}%
  \setunit{\bibpagerefpunct}\newblock
  \newline
  \usebibmacro{url}%
  \newline
  \usebibmacro{mirror}%
%  \usebibmacro{pageref}%
%  \usebibmacro{finentry}
%%%%  the \label is only for the documenation ctan.pdf!
  \phantomsection\label{\thefield{entrykey}}%
%%%
}

\endinput
