From 06d80d238a500a67e8fd904e39d836ccb353a39e Mon Sep 17 00:00:00 2001
From: Leandre17 <leandre.godet@epitech.eu>
Date: Sun, 9 Feb 2025 11:04:24 +0100
Subject: [ADD] start of how to write an extention

---
 _extention.qmd | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 _extention.qmd

(limited to '_extention.qmd')

diff --git a/_extention.qmd b/_extention.qmd
new file mode 100644
index 0000000..4fbb66f
--- /dev/null
+++ b/_extention.qmd
@@ -0,0 +1,56 @@
+
+# Introduction
+
+In this file we will see how to create an filter extention for quarto using Lua.
+A filter extention is a flexible and powerful tool for introducing new global behaviors and/or new markdown rendering behaviors. For example, you could create filters to implement output folding, an image carousel, or just about anything you can imagine!
+
+# Creation
+
+To create a extention we need to have an "_extensions" folder and in this folder we need to create a folder for each extention.
+For each extention we need to have a file name "_extension.yml" to tell quarto the structure of this extention. Here is an exemple:
+```yaml
+title: Leandre Name Filter
+author: Léandre
+version: 1.0.0
+quarto-required: ">=1.3.0"
+contributes:
+  filters:
+    - leandre.lua
+```
+In this file we can see that it include a file in .lua and that where the logic of the extention will be coded.
+
+So in resume we have this file structure
+```bash
+_extensions/
+└── leandre-filter
+    ├── _extension.yml
+    └── leandre.lua
+```
+
+# Code Exemple
+
+For this exemple we will talk about the file leandre.lua
+```lua
+function Str(el)
+    if el.text:find("Leandre") then
+        el.text = el.text:gsub("Leandre", "Léandre")
+    end
+    return el
+end
+```
+What do this small code do is searching for the string "Leandre" and when it find it. It will replace it with the string "Léandre"
+
+# More resources
+
+In this link you can find more information about the diferent function that can be use in the extention.
+
+[https://quarto.org/docs/extensions/lua.html](https://quarto.org/docs/extensions/lua.html)
+ 
+ 
+[https://quarto.org/docs/extensions/lua-api.html](https://quarto.org/docs/extensions/lua-api.html)
+
+More about filter
+[https://quarto.org/docs/extensions/filters.html](https://quarto.org/docs/extensions/filters.html)
+
+And other type of extension
+[https://quarto.org/docs/extensions/creating.html#development](https://quarto.org/docs/extensions/creating.html#development)
\ No newline at end of file
-- 
cgit v1.2.3

