\starttext

\setuppapersize[S6][S6]
\setuplayout[width=middle,height=middle,margin=1.5cm,footer=0pt,header=1cm]

\setupcolors[state=start] \setuptyping[option=color]

\definelinenote[extralinenote][rule=off,frame=on,framecolor=darkgreen]
\setuplinenote [linenote] [rule=off,frame=on,framecolor=darkred,n=2]

\showframe

\title{Bidi}

\subject{Issues:}

\startitemize
\item Line-numeral ranges need to be configurable: 1--4 and 4--1. It should
not be harwired, since eg, Persian, may prefer to keep an LR-style range.
But the default option for r2l line-numeral ranges -- e.g. 1--4 -- is a must.  {\bf high}
\item Default line-numeral positioning is incorrect; eg p.~5.  {\bf high}
% \item
% \item
% \item
% \item
% \item
% \item
% \item
\stopitemize
\page

\startbuffer[test]
\setuplinenumbering[start=1,step=5,method=first]
\startlinenumbering
test \linenote {A simple linenote does not have a line range}
test test test test test test test
\startlinenote [one] {A linenote environment has a line range}
\dorecurse{40}{test }.
\stoplinenote [one]
test test test test test test
\startextralinenote[extraone]{This works!}
\dorecurse{40}{test }.
\stopextralinenote[extraone]
\startlinenote [two] {A linenote environment has a line range}
\dorecurse{40}{test }.
\stoplinenote [two]
test test test test test test
\startextralinenote[extratwo]{This works!}
\dorecurse{40}{test }.
\stopextralinenote[extratwo]
\par
\stoplinenumbering
\stopbuffer

{{\lefttoright \typebuffer[test]} \page \getbuffer[test] \page}

\righttoleft

\startbuffer[test]
\setuplinenumbering[start=1,step=5,method=next]
\startlinenumbering test
\linenote {A simple linenote does not have a line range}
test test test test test test test
\startlinenote [one] {A linenote environment has a line range}
\dorecurse{40}{test }.
\stoplinenote [one]
test test test test test test
\startextralinenote[extraone]{This works!}
\dorecurse{40}{test }.
\stopextralinenote[extraone]
\startlinenote [two] {A linenote environment has a line range}
\dorecurse{40}{test }.
\stoplinenote [two]
test test test test test test
\startextralinenote[extratwo]{This works!}
\dorecurse{40}{test }.
\stopextralinenote[extratwo]
 \par
\stoplinenumbering
\stopbuffer

{{\lefttoright \typebuffer[test]} \page \getbuffer[test] \page}

\lefttoright

\startbuffer[test]
% \lefttoright
\startlinenumbering[100] test
\linenote {A simple linenote does not have a line range}
test test test test test test test
\startlinenote [one] {A linenote environment has a line range}
\dorecurse{40}{test }.
	\startlinenote [two]
	{Here is a nested linenote environment}
	\dorecurse{40}{test }.
	\stoplinenote [two]
	\dorecurse{14}{test }.
	\startextralinenote [extra]
	{Here is an extra nested linenote environment}
	\dorecurse{40}{test }.
	\stopextralinenote [extra]
	\dorecurse{14}{test }.
\dorecurse{40}{test }.
\stoplinenote [one]
\par
\stoplinenumbering
\stopbuffer

{{\lefttoright \typebuffer[test]} \page \getbuffer[test] \page}

\righttoleft

\startbuffer[test]
\startlinenumbering[100] test
\linenote {A simple linenote does not have a line range}
test test test test test test test
\startlinenote [one] {A linenote environment has a line range}
\dorecurse{40}{test }.
	\startlinenote [two]
	{Here is a nested linenote environment}
	\dorecurse{40}{test }.
	\stoplinenote [two]
	\dorecurse{14}{test }.
	\startextralinenote [extra]
	{Here is an extra nested linenote environment}
	\dorecurse{40}{test }.
	\stopextralinenote [extra]
	\dorecurse{14}{test }.
\dorecurse{40}{test }.
\stoplinenote [one]
\par
\stoplinenumbering
\stopbuffer

{{\lefttoright \typebuffer[test]} \page \getbuffer[test] \page}

\lefttoright

\startbuffer[test]
% \lefttoright
\startlinenumbering test test test \someline[simple] test test test test
\linenote {A simple linenote. See \inline{line}[simple]}
\startline[fullrange]
\startlinenote [one] {See also \inline[extrarange].}
\startline[range]
test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test
\stopline[range]
test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test
\stoplinenote [one]
\stopline[fullrange]
test test test test test test
\startextralinenote[extraone]{This works!  See also \inline[range].}
test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test
\startline[extrarange]
test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test
\stopline[extrarange]
\stopextralinenote[extraone]
\par
\stoplinenumbering
\stopbuffer

{{\lefttoright \typebuffer[test]} \page \getbuffer[test] \page}

\stoptext
