From 0c18ad85755f06002ce2088125daf217402f011f Mon Sep 17 00:00:00 2001 From: gsabin Date: Thu, 27 Feb 2025 11:14:21 +0100 Subject: start of the prototype detecting and removing curly braces --- _extensions/protoExtension/_extension.yml | 7 +++++++ _extensions/protoExtension/proto.lua | 14 ++++++++++++++ _proto.qmd | 32 ++++++++++++++++++++++++++++++- 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 _extensions/protoExtension/_extension.yml create mode 100644 _extensions/protoExtension/proto.lua diff --git a/_extensions/protoExtension/_extension.yml b/_extensions/protoExtension/_extension.yml new file mode 100644 index 0000000..f00b3c5 --- /dev/null +++ b/_extensions/protoExtension/_extension.yml @@ -0,0 +1,7 @@ +name: protoExtension +title: Prototype for html +version: 1.0.0 +quarto-required: ">=1.3.0" +contributes: + filters: + - proto.lua diff --git a/_extensions/protoExtension/proto.lua b/_extensions/protoExtension/proto.lua new file mode 100644 index 0000000..cb29c31 --- /dev/null +++ b/_extensions/protoExtension/proto.lua @@ -0,0 +1,14 @@ +-- Function to replace variations of Leandre with Léandre. +function Str(el) + i , j = string.find(el.text,"{") + if i ~= nil then a = string.find(el.text,"}") + print(i) + print(string.sub(el.text,i,a)) + b = string.sub(el.text,0,i-1) + c = string.sub(el.text,a+1,-1) + el.text = b .. c + + end + + return el +end diff --git a/_proto.qmd b/_proto.qmd index d3ed7e5..0af54c4 100644 --- a/_proto.qmd +++ b/_proto.qmd @@ -1 +1,31 @@ -My name is [Sabin Ghimire]{:name}. \ No newline at end of file +--- +title: "Test Document" +format: html +filters: + - protoExtension +--- + +Here is Leandre writing some text. +My name is [Sabin Ghimire]{:name} and you can call me at [1-800-555-0199]{:telephone}. +My favorite animal is the [Lioner]{ov:preferredAnimal}. + + +# tomorrow's meeting list +## {.schema:Event} Meeting Details + +- Date: [2/27]{schema:startDate} +- Location: [Library]{schema:location} +- Attendees: + - Leandra + - jonas + - [Sabin](https://example.com/tim){schema:attendee}My name is [Sabin Ghimire]{:name} and you can call me at [1-800-555-0199]{:telephone}. + +# tomorrow's meeting list +## {.schema:Event} Meeting Details + +- Date: [11/10]{schema:startDate} +- Location: [Library]{schema:location} +- Attendees: + - Alice + - Bob + - [Tim](https://example.com/tim){schema:attendee} \ No newline at end of file -- cgit v1.2.3