/* eslint-disable @typescript-eslint/no-unused-vars */
import React from 'react';
import ListItemCode from '../components/ListItemCode';
import Page from '../Page';
import useToolkit from '../toolkit/useToolkit';
import olUpperRomanConfig from './cards/olUpperRomanConfig';
import ulSquareConfig from './cards/ulSquareConfig';
import customListKatanaConfig from './cards/customListThaiConfig';
import customListRussianConfig from './cards/customListRussianConfig';
import rtlListArabicConfig from './cards/rtlListArabicConfig';
import rtlListDiscConfig from './cards/rtlListDiscConfig';
import InternalRendererAdmonition from '../components/InternalRendererAdmonition';
function RefCounterStyle() {
const { RefLibrary } = useToolkit();
return (
);
}
export default function PageContentLists() {
const {
Acronym,
Admonition,
Bold,
Header,
Paragraph,
Chapter,
SourceDisplay,
RefLibrary,
RefRNSymbol,
RefHtmlElement,
RefCssProperty,
RefESSymbol,
RefRenderHtmlProp,
RefRenderHTMLExport,
RefTRE,
RefHtmlAttr,
RefDoc,
RenderHtmlCard,
Section,
InlineCode,
Hyperlink,
List,
ListItem,
SvgFigure
} = useToolkit();
return (
Lists marker rendering logic has been extracted to{' '}
{' '}
and libraries for convinience! Fell free to use
these outside of a {' '}
component.
List elements support CSS
property, which defines how the marker pseudo-element of a list item
should be rendered. In CSS terminology, a marker is a pseudo-element
situated before elements with a {' '}
property set to list-item. See{' '}
CSS Lists and Counters Module Level 3
{' '}
for a standard reference and{' '}
for a
list of types supported by this library.
Ordered lists elements support by default
6 list style types:
1, 2, 3 ... (the default)
a, b, c ...
A, B, C ...
α, β, γ ...
i, ii, iii ...
I, II, III ...
You can actually very easily plug-in one of the dozens presets from{' '}
, including Persian, Arabic, Hebrew, Thai,
Katana... see the below chapter.
Unordered lists elements support by
default 5 list style types:
"•" (the default)
"■"
"○"
"▼"
"▶"
Those markers are not rendered with UTF-8 characters, which might have
a significant variety of shapes and sizes depending on fonts. Instead,
geometric shapes are rendered.
The prop allows
you to create as many list type styles as you wish. Combined with
the power of , you can plug-in one of the dozens
of presets with a one-liner! See below example with the{' '}
Thai preset:
allows you to create any counter style,
translating strictly the {' '}
at-rule API defined in{' '}
CSS Counter Styles Level 3
{' '}
in a JavaScript API. In the below example, we are going to create an
alphabetic counter style for the Russian alphabet:
{/* TODO: add a section about custom "unitary" counter styles. */}
Thanks to prop, you can
enable experimental RTL support for lists (see{' '}
and{' '}
).
For RTL mode to take effect, you need to have a{' '}
attribute set for the list tag or one of
its parents, or the style set for
the list tag or one of its parents.
);
}