Dynamic functions and filters in MyST

The MyST forms of the specimens on Dynamic functions and filters, each rendered live by this page’s own Markdown parser. The needs below have ids and a tag of their own, because a need id is unique in the project; the views select the needs of that page, as a view selects needs from the whole project.

Dynamic functions in fields

Dynamic functions in fields

```{req} Store the settings
:id: EX_REQ_MYST_DYNAMIC_1
:status: open
:tags: ex-dynamic-myst
:owner: settings team

The settings survive a restart.
```

```{spec} Write the settings file
:id: EX_SPEC_MYST_DYNAMIC_1
:owner: [[copy("owner", "EX_REQ_MYST_DYNAMIC_1")]]
:tags: ex-dynamic-myst
:links: EX_REQ_MYST_DYNAMIC_1

The owner is that of [[copy("id")]], which is not computed here.
```

```{impl} Settings writer
:id: EX_IMPL_MYST_DYNAMIC_1
:status: done
:tags: ex-dynamic-myst
:links: [[links_from_filter("'ex-dynamic-myst' in tags and type == 'spec'")]]

Writes the settings file.
```
Requirement: Store the settings EX_REQ_MYST_DYNAMIC_1
status: open
tags: ex-dynamic-myst
owner: settings team
links incoming: EX_SPEC_MYST_DYNAMIC_1

The settings survive a restart.

Specification: Write the settings file EX_SPEC_MYST_DYNAMIC_1
tags: ex-dynamic-myst
owner: settings team
links outgoing: EX_REQ_MYST_DYNAMIC_1
links incoming: EX_IMPL_MYST_DYNAMIC_1

The owner is that of [[copy(“id”)]], which is not computed here.

Implementation: Settings writer EX_IMPL_MYST_DYNAMIC_1
status: done
tags: ex-dynamic-myst
links outgoing: EX_SPEC_MYST_DYNAMIC_1

Writes the settings file.

Filter strings

A filter on fields

```{needlist}
:filter: owner == "settings team" and "ex-dynamic" in tags
:sort_by: id
```

A filter on links

```{needtable}
:filter: len(links) > 0 and "ex-dynamic" in tags
:columns: id, title, links
:style: table
```

ID

Title

Links

EX_IMPL_DYNAMIC_1

Settings writer

EX_SPEC_DYNAMIC_1

Write the settings file

Cypher queries

A Cypher query

```{needlist}
:cypher: MATCH (n:spec)-[:links]->(r:req) WHERE 'ex-dynamic' IN r.tags RETURN n
:filter: type == "spec" and "EX_REQ_DYNAMIC_1" in links
```