\input ucwmac.tex
\ucwmodule{ofs}
\ucwmodule{ref}
\ucwmodule{pdfmeta}

% \clickablefalse

\pdfmetainfo{Author}{A. U. Thor}
\pdfmetainfo{Title}{TeX Caput Regni}

\newcount\chapcount
\chapcount=0
\optdef\chapter#1{
	\vfill\eject
	\advance\chapcount by 1
	\addid{chap}{\the\chapcount}
	\pdfmetaoutline{\the\chapcount}{\currentid}{#1}
	\leftline{\the\chapcount. #1}
	\medskip
}

\def\chapref{\ref{chap}}

\pageid{pri}

\chapter[pri]{Caput prima}

\chapter[sec]{Caput secunda}

\url{http://pruvodce.ucw.cz/errata.html}

\chapter[ter]{Caput tertia}

See also chapter~\chapref{pri} at page \ref{page}{pri}.

Hard link to \linkpage{1}{page~1}.

\bye
