The syntax is this:

::: {.quote type="hebrew" ref="Jer 32.1–5"}

blabla

:::

 

This here:

 

::: quote

:::

 

is just a shorthand for

::: {.quote}

:::

 

See: https://pandoc.org/MANUAL.html#extension-fenced_code_attributes and https://pandoc.org/MANUAL.html#extension-fenced_divs

 

Anyway, here’s a minimal example how you can access the attributes :

 

```lua

function Div(el)

                if el.attributes.print == "yes" then return el end

                return {}

end

```

 

Run this on :

 

```md

asdf

 

::: {print="yes"}

this should show up

:::

 

::: {print="no"}

this should not show up

:::

 

asdf

```

 

Denis

 

 

 

 

Von: pandoc-discuss@googlegroups.com <pandoc-discuss@googlegroups.com> Im Auftrag von Lyndon Drake
Gesendet: Mittwoch, 15. Juni 2022 05:16
An: pandoc-discuss <pandoc-discuss@googlegroups.com>
Betreff: Best Markdown markup for LaTeX environment with arguments

 

Hi,

 

In my LaTeX preamble, I have a LaTeX environment which takes an argument, and I would like to map from my Markdown input document to that environment.

 

Specifically, I want to generate `csquotes` environments similar to these examples:

 

```

\begin{foreigndisplayquote}{hebrew}[Jer 32.1–5]

 הַדָּבָר אֲשֶׁר־הָיָה אֶל־יִרְמְיָהוּ מֵאֵת יְהוָה בִּשְׁנַת [בַּ][שָּׁנָה] הָעֲשִׂרִית לְצִדְקִיָּהוּ מֶלֶךְ יְהוּדָה הִיא הַשָּׁנָה שְׁמֹנֶה־עֶשְׂרֵה שָׁנָה לִנְבוּכַדְרֶאצַּר׃2‏ וְאָז חֵיל מֶלֶךְ בָּבֶל צָרִים עַל־יְרוּשָׁלִָם וְיִרְמְיָהוּ הַנָּבִיא הָיָה כָלוּא בַּחֲצַר הַמַּטָּרָה אֲשֶׁר בֵּית־מֶלֶךְ יְהוּדָה׃3‏ אֲשֶׁר כְּלָאוֹ צִדְקִיָּהוּ מֶלֶךְ־יְהוּדָה לֵאמֹר מַדּוּעַ אַתָּה נִבָּא לֵאמֹר כֹּה אָמַר יְהוָה הִנְנִי נֹתֵן אֶת־הָעִיר הַזֹּאת בְּיַד מֶלֶךְ־בָּבֶל וּלְכָדָהּ׃4‏ וְצִדְקִיָּהוּ מֶלֶךְ יְהוּדָה לֹא יִמָּלֵט מִיַּד הַכַּשְׂדִּים כִּי הִנָּתֹן יִנָּתֵן בְּיַד מֶלֶךְ־בָּבֶל וְדִבֶּר־פִּיו עִם־פִּיו וְעֵינָיו אֶת־עֵינָו [עֵינָיו] תִּרְאֶינָה׃5‏ וּבָבֶל יוֹלִךְ אֶת־צִדְקִיָּהוּ וְשָׁם יִהְיֶה עַד־פָּקְדִי אֹתוֹ נְאֻם־יְהוָה כִּי תִלָּחֲמוּ אֶת־הַכַּשְׂדִּים לֹא תַצְלִיחוּ׃ פ

\end{foreigndisplayquote}

\begin{displayquote}[Jer 32.1–5]

The word that came to Jeremiah from the LORD in the tenth year of King Zedekiah of Judah, which was the eighteenth year of Nebuchadrezzar. 2 At that time the army of the king of Babylon was besieging Jerusalem, and the prophet Jeremiah was confined in the court of the guard that was in the palace of the king of Judah...

\end{displayquote}
```

I had wondered about doing something similar to this:

 

```

::: quote {type="hebrew" ref="Jer 32.1–5"}

 הַדָּבָר אֲשֶׁר־הָיָה אֶל־יִרְמְיָהוּ מֵאֵת יְהוָה בִּשְׁנַת [בַּ][שָּׁנָה] הָעֲשִׂרִית לְצִדְקִיָּהוּ מֶלֶךְ יְהוּדָה הִיא הַשָּׁנָה שְׁמֹנֶה־עֶשְׂרֵה שָׁנָה לִנְבוּכַדְרֶאצַּר׃2‏ וְאָז חֵיל מֶלֶךְ בָּבֶל צָרִים עַל־יְרוּשָׁלִָם וְיִרְמְיָהוּ הַנָּבִיא הָיָה כָלוּא בַּחֲצַר הַמַּטָּרָה אֲשֶׁר בֵּית־מֶלֶךְ יְהוּדָה׃3‏ אֲשֶׁר כְּלָאוֹ צִדְקִיָּהוּ מֶלֶךְ־יְהוּדָה לֵאמֹר מַדּוּעַ אַתָּה נִבָּא לֵאמֹר כֹּה אָמַר יְהוָה הִנְנִי נֹתֵן אֶת־הָעִיר הַזֹּאת בְּיַד מֶלֶךְ־בָּבֶל וּלְכָדָהּ׃4‏ וְצִדְקִיָּהוּ מֶלֶךְ יְהוּדָה לֹא יִמָּלֵט מִיַּד הַכַּשְׂדִּים כִּי הִנָּתֹן יִנָּתֵן בְּיַד מֶלֶךְ־בָּבֶל וְדִבֶּר־פִּיו עִם־פִּיו וְעֵינָיו אֶת־עֵינָו [עֵינָיו] תִּרְאֶינָה׃5‏ וּבָבֶל יוֹלִךְ אֶת־צִדְקִיָּהוּ וְשָׁם יִהְיֶה עַד־פָּקְדִי אֹתוֹ נְאֻם־יְהוָה כִּי תִלָּחֲמוּ אֶת־הַכַּשְׂדִּים לֹא תַצְלִיחוּ׃ פ

:::

```

 

Then I could use BJP's lua filter to map the div to a class.

 

Does that seem like a plausible approach?

 

Within the lua Div(el) function, how can I get the attributes of the class, in my case `type` and `ref`?

 

Best regards,

Lyndon

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/6667603d-bd7c-4a1f-aa97-4198aabfddc8n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/4756d51d223d433a9ea76b6695902ffc%40unibe.ch.