You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
User Story
Currently lists can be generated from arbitrary HTML tags with an id identifier, for example, anchor tags:
<a id="some id", class="listOf_class", title="Some Title"></a>
Book section to be listed...
As a vuepress author I would like to generate a list of Tasks from vuepress Custom Containers, e.g. a :::details container but I do not want to prepend every such task with an HTML anchor tag:
:::details Task: This could be the list item title
1. Do this
2. Do that
:::
I would like to be able to generate a list of tasks using a Regular Expression which
matches a particular pattern
may optionally contain a RegExp Capture Group in braces ^(group)$ to extract the list item title.
For example, I would like to be able to configure glossarify-md like this:
Internally when glossarify-md finds an mdAst text node which matches the given pattern it should generate and prepend the required HTML target element itself by the following algorithm:
Anchorizer Algorithm:
Obtain the listOf config that matched against an mdAst text node's value
Obtain as target <element class="..."> the class of the listOf config that matched
Obtain as target <element title=" " >
a) the value extracted by pattern capture group $1 when matched against the mdAst text node value
b) the mdAst text node value, if there's no capture group
Obtain as target <element id="..."> a length-limited slug of the title extracted in 3. with a unifying number appended
Appending a unifying number is required since there could be another listOf pattern matching the same text node and extracting the identical title which would result in an identical id. Yet the spec of the id-Attribute requires a unique value for the attribute.
The text was updated successfully, but these errors were encountered:
about-code
changed the title
Feat: Generate lists from RegExp Patterns matching against text nodes
Feat: Generate lists from RegExp Patterns
Jun 1, 2021
User Story
Currently lists can be generated from arbitrary HTML tags with an
id
identifier, for example, anchor tags:<a id="some id", class="listOf_class", title="Some Title"></a> Book section to be listed...
As a vuepress author I would like to generate a list of Tasks from vuepress Custom Containers, e.g. a
:::details
container but I do not want to prepend every such task with an HTML anchor tag:I would like to be able to generate a list of tasks using a Regular Expression which
^(group)$
to extract the list item title.For example, I would like to be able to configure glossarify-md like this:
Internally when glossarify-md finds an mdAst text node which matches the given pattern it should generate and prepend the required HTML target element itself by the following algorithm:
Anchorizer Algorithm:
listOf
config that matched against an mdAst text node's value<element class="...">
theclass
of thelistOf
config that matched<element title=" " >
$1
when matched against the mdAst text node value<element id="...">
a length-limited slug of the title extracted in 3. with a unifying number appendedAppending a unifying number is required since there could be another
listOf
pattern matching the same text node and extracting the identical title which would result in an identicalid
. Yet the spec of theid
-Attribute requires a unique value for the attribute.The text was updated successfully, but these errors were encountered: