From 4de36d29fdfedec2a4891828c5fae006013d48e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20F=C3=BCrth?= Date: Thu, 11 Apr 2024 18:06:03 +0200 Subject: [PATCH] updated micrograph.lua --- .gitignore | 1 + _extensions/micrograph/micrograph.lua | 435 +++++++++++++------------- example.qmd | 7 +- 3 files changed, 230 insertions(+), 213 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8db40be --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.luarc.json diff --git a/_extensions/micrograph/micrograph.lua b/_extensions/micrograph/micrograph.lua index ea68966..a27a6c5 100644 --- a/_extensions/micrograph/micrograph.lua +++ b/_extensions/micrograph/micrograph.lua @@ -1,210 +1,225 @@ -local micrograph = { - filter = function(content, params) - local src = params.src - - local html = [[ -
-
-

Red Channel

- -
- - - - - - - - -
-
-
-

Green Channel

- -
- - - - - - - - -
-
-
-

Blue Channel

- -
- - - - - - - - -
-
-
-

Original Image

- -
-
- - - ]] - - local javascript = [[ - - ]] - - return html .. javascript - end -} - -return micrograph +function micrograph(args, kwargs, meta) + cmt = meta['show_comments'] + local src = args[1] or '' + local imgWidth = args[2] or '255' -- Default size is 255x255 + local channelOne = args[3] or 'DAPI' + local channelTwo = args[4] or 'Phalloidin' + local channelThree = args[5] or 'Alexa647' + local html = [[ +
+
+
]] .. channelOne .. [[
+ +
+ + + + + + + + +
+
+
+
]] .. channelTwo .. [[
+ +
+ + + + + + + + +
+
+
+
]] .. channelThree .. [[
+ +
+ + + + + + + + +
+
+
+
Merge
+ +
+
+ + + + + ]] + return pandoc.RawBlock('html', html) +end diff --git a/example.qmd b/example.qmd index 1824d3d..80640e5 100644 --- a/example.qmd +++ b/example.qmd @@ -1,9 +1,10 @@ --- title: "Micrograph Example" +author: "John Doe" +format: revealjs --- -## Heading - -{{< micrograph MAX_240329_PC3_Rab_Anti_FlagTag_647_E300_I300_Phallodin_594_E100_I500_DAPI_E300_I300_1_MMStack_Pos0.ome.jpg >}} +## Microscope slide +{{< micrograph ./resources/MAX_240329_PC3_Rab_Anti_FlagTag_647_E300_I300_Phallodin_594_E100_I500_DAPI_E300_I300_1_MMStack_Pos0.ome.jpg 255 DAPI Phalloidin anti-FLAG >}}