aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgsabin <sabinghimire071@gmail.com>2025-02-12 23:08:09 +0100
committergsabin <sabinghimire071@gmail.com>2025-02-17 12:21:46 +0100
commit019d91ddfbe63c746f0d51f92f0cece0dcd50b85 (patch)
tree92d4f5393ae1d0fcb293108e064d0e3c6b2638ce
parent4624d5734fa1b1587e9847c5781e4d0ecee679b1 (diff)
Added Quarto and lua filter examples to get idea how it works
-rw-r--r--_extensions/Example/example.md0
-rw-r--r--_extensions/Example/quartoExample.qmd12
-rw-r--r--_extensions/Example/quartoFilterDraft.lua0
-rw-r--r--_extensions/Example/semantic.lua30
4 files changed, 42 insertions, 0 deletions
diff --git a/_extensions/Example/example.md b/_extensions/Example/example.md
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/_extensions/Example/example.md
diff --git a/_extensions/Example/quartoExample.qmd b/_extensions/Example/quartoExample.qmd
new file mode 100644
index 0000000..577985c
--- /dev/null
+++ b/_extensions/Example/quartoExample.qmd
@@ -0,0 +1,12 @@
+---
+title: "My Semantic Document"
+format: html
+filters:
+ - quartoFilterDraft.lua
+---
+
+# My Semantic Document
+
+This is a sample document with **bold** text and *italic* text.
+
+[@citation1]: This is a citation with a purpose of opposition. \ No newline at end of file
diff --git a/_extensions/Example/quartoFilterDraft.lua b/_extensions/Example/quartoFilterDraft.lua
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/_extensions/Example/quartoFilterDraft.lua
diff --git a/_extensions/Example/semantic.lua b/_extensions/Example/semantic.lua
new file mode 100644
index 0000000..fdf9c15
--- /dev/null
+++ b/_extensions/Example/semantic.lua
@@ -0,0 +1,30 @@
+-- Lua script to handle Markdown-style bold and italic annotations
+
+-- Sample Markdown content (string format)
+local markdown_content = [[
+# Text Formatting Example
+
+This is a sample Markdown document.
+
+Here is some **bold text** and some *italic text*.
+
+You can also combine **bold and *italic* text**.
+]]
+
+-- Function to process bold and italic annotations (e.g., **bold** or *italic*)
+function process_annotations(content)
+ -- Replace bold (e.g., **bold**) with <strong>HTML tag
+ content = content:gsub("%*%*(.-)%*%*", "<strong>%1</strong>")
+
+ -- Replace italic (e.g., *italic*) with <em>HTML tag
+ content = content:gsub("%*(.-)%*", "<em>%1</em>")
+
+ return content
+end
+
+-- Process the Markdown content to add HTML semantic annotations
+local processed_content = process_annotations(markdown_content)
+
+-- Output the processed content with HTML formatting
+print("Processed Markdown Content:")
+print(processed_content)