How to reference an entire markdown cell or collection of content instead of just the first paragraph #1821
-
I have the following markdown cell:
I wish to reference this in some other part of my code so I add the following label:
But when I reference it somewhere else as follows:
Only the following shows up when I hover over the reference link: How can I solve this issue? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
When you write something like We see an exciting improvement! Injective Networks with `PReLU` do much better. This gives us the
following insight:
:::{card}
Injective Networks are **parameter deficient**.
Adding parameters gives them much more representation power.
::: what MyST sees is the following syntax tree: type: root
children:
- type: block
children:
- type: paragraph
children:
- type: text
value: 'We see an exciting improvement! Injective Networks with '
- type: inlineCode
value: PReLU
- type: text
value: |2-
do much better. This gives us the
following insight:
- type: card
children:
- type: paragraph
children:
- type: text
value: 'Injective Networks are '
- type: strong
children:
- type: text
value: parameter deficient
- type: text
value: .
- type: paragraph
children:
- type: text
value: Adding parameters gives them much more representation power.
When you then add an anchor, it binds to the adjacent block element: (see-this-anchor)=
We see an exciting improvement! Injective Networks with `PReLU` do much better. This gives us the
following insight:
:::{card}
Injective Networks are **parameter deficient**.
Adding parameters gives them much more representation power.
::: type: root
children:
- type: block
children:
- type: paragraph
children:
- type: text
value: 'We see an exciting improvement! Injective Networks with '
- type: inlineCode
value: PReLU
- type: text
value: |2-
do much better. This gives us the
following insight:
label: see-this-anchor
identifier: see-this-anchor
html_id: see-this-anchor
- type: card
children:
- type: paragraph
children:
- type: text
value: 'Injective Networks are '
- type: strong
children:
- type: text
value: parameter deficient
- type: text
value: .
- type: paragraph
children:
- type: text
value: Adding parameters gives them much more representation power.
This means that when you subsequently reference e.g. You can solve this by labelling a parent element that contains your Markdown. One useful construct is the (see-this-anchor)=
::::{div}
We see an exciting improvement! Injective Networks with `PReLU` do much better. This gives us the
following insight:
:::{card}
Injective Networks are **parameter deficient**.
Adding parameters gives them much more representation power.
:::
:::: You'll see that the hover preview for |
Beta Was this translation helpful? Give feedback.
-
In addition to @agoose77's answer, I think another option would be to use markdown blocks syntax and attach metadata to them. For example, this syntax:
Gets parsed to: type: root
children:
- type: block
children:
- type: paragraph
children:
- type: text
value: Hi there.
- type: paragraph
children:
- type: text
value: Everybody.
data: {}
identifier: hi
label: hi
html_id: hi
- type: block
children:
- type: paragraph
children:
- type: text
value: Some other content. note: I've migrated this to the Discussions Forum because it's a helpful question and answer, and doesn't relate to new features etc |
Beta Was this translation helpful? Give feedback.
When you write something like
what MyST sees is the following syntax tree: