[{"data":1,"prerenderedAt":2096},["Reactive",2],{"navigation":3,"aAII9Cz3yR":204,"tags-Xamarin":397},[4,192,200],{"title":5,"_path":6,"children":7,"icon":191},"Blog","/posts",[8,11,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59,62,65,68,71,74,77,80,83,86,89,92,95,98,101,104,107,110,113,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,176,179,182,185,188],{"title":9,"_path":10},"Testing your API with REST Client","/posts/testing-your-api-with-rest-client",{"title":12,"_path":13},"HTML templating in Xamarin","/posts/html-templating-in-xamarin",{"title":15,"_path":16},"Goodbye Azure Portal, Welcome Azure CLI","/posts/welcome-azure-cli",{"title":18,"_path":19},"Coming across Gitpod","/posts/gitpod",{"title":21,"_path":22},"Handle token retrieval while querying an API","/posts/delegating-handler",{"title":24,"_path":25},"Clean up your local git branches.","/posts/cleaning-git-branches",{"title":27,"_path":28},"Automate configuration of Teams Tab SSO with PowerShell.","/posts/teams-sso-powershell",{"title":30,"_path":31},"How to do a technology watch? - Part 1","/posts/technology-watch-part1",{"title":33,"_path":34},"How to do a technology watch? - Part 2","/posts/technology-watch-part2",{"title":36,"_path":37},"You almost no longer need Key Vault references for Azure Functions.","/posts/azure-functions-custom-configuration",{"title":39,"_path":40},"How to do a technology watch? - Part 3","/posts/technology-watch-part3",{"title":42,"_path":43},"Forget DevOps, the future is already here!","/posts/devops-future",{"title":45,"_path":46},"Week 9, 2021 - Tips I learned this week","/posts/w09-2021-tips-learned-this-week",{"title":48,"_path":49},"Week 12, 2021 - Tips I learned this week","/posts/w12-2021-tips-learned-this-week",{"title":51,"_path":52},"Week 14, 2021 - Tips I learned this week","/posts/w14-2021-tips-learned-this-week",{"title":54,"_path":55},"Once upon a time in .NET","/posts/once-upon-a-time-in-dotnet",{"title":57,"_path":58},"Install your applications with winget","/posts/winget-import",{"title":60,"_path":61},"Customize your applications when installing them with winget","/posts/winget-override",{"title":63,"_path":64},"Week 22, 2021 - Tips I learned this week","/posts/w22-2021-tips-learned-this-week",{"title":66,"_path":67},"How to connect to an Azure SQL Database from C# using Azure AD","/posts/sqlclient-active-directory-authent",{"title":69,"_path":70},"Producing packages for Windows Package Manager","/posts/wingetcreate",{"title":72,"_path":73},"4 tips about GitHub Actions environment variables and contexts","/posts/github-actions-var-and-context",{"title":75,"_path":76},"AzureWebJobsStorage, the secret you don't need in your Function App.","/posts/azure-functions-without-azurewebjobsstorage",{"title":78,"_path":79},"ASP.NET Core - Lost in configuration","/posts/lost-in-configuration",{"title":81,"_path":82},"Week 39, 2021 - Tips I learned this week","/posts/w39-2021-tips-learned-this-week",{"title":84,"_path":85},"Week 41, 2021 - Tips I learned this week","/posts/w41-2021-tips-learned-this-week",{"title":87,"_path":88},"Migrating and open-sourcing my blog","/posts/migrating-blog",{"title":90,"_path":91},"Week 45, 2021 - Tips I learned this week","/posts/w45-2021-tips-learned-this-week",{"title":93,"_path":94},"Organize your GitHub stars with Astral","/posts/astral",{"title":96,"_path":97},"Pulumi with an Azure Blob Storage backend","/posts/pulumi-azure-backend",{"title":99,"_path":100},"IaC Hot Reload with Pulumi Watch","/posts/pulumi-watch",{"title":102,"_path":103},"Week 2, 2022 - Tips I learned this week","/posts/w02-2022-tips-learned-this-week",{"title":105,"_path":106},"Week 3, 2022 - Tips I learned this week","/posts/w03-2022-tips-learned-this-week",{"title":108,"_path":109},"Week 5, 2022 - Tips I learned this week","/posts/w05-2022-tips-learned-this-week",{"title":111,"_path":112},"How to provision an Azure SQL Database with Active Directory authentication","/posts/sqldatabase-active-directory-authent",{"title":114,"_path":115},"Why will I choose Pulumi over Terraform for my next project?","/posts/pulumi-vs-terraform",{"title":117,"_path":118},"Week 19, 2022 - Tips I learned this week","/posts/w19-2022-tips-learned-this-week",{"title":120,"_path":121},"Week 20, 2022 - Tips I learned this week","/posts/w20-2022-tips-learned-this-week",{"title":123,"_path":124},"Keeping secrets secure when using API Clients","/posts/http-clients-secrets",{"title":126,"_path":127},"What made me want to be a developer?","/posts/be-a-developer",{"title":129,"_path":130},"What can we do when stuck with a programming problem?","/posts/get-unstuck",{"title":132,"_path":133},"How did I automate the setup of my developer Windows laptop?","/posts/automate-developer-machine",{"title":135,"_path":136},"Discussion about API clients","/posts/http-clients",{"title":138,"_path":139},"Week 46, 2022 - Tips I learned this week","/posts/w46-2022-tips-learned-this-week",{"title":141,"_path":142},"When Pulumi met Nuke: a .NET love story","/posts/when-pulumi-met-nuke",{"title":144,"_path":145},"A year of learning and sharing - Dev Retro 2022","/posts/2022-retro",{"title":147,"_path":148},"Perform Dynamic Execution of an npm Package","/posts/pnpm-dlx",{"title":150,"_path":151},"Manage multiple Node.js versions","/posts/pnpm-env",{"title":153,"_path":154},"Introducing the Vue.js CI/CD series","/posts/vuecicd-introduction",{"title":156,"_path":157},"Execute commands using your project dependencies","/posts/pnpm-exec",{"title":159,"_path":160},"Vue.js CI/CD: Continuous Integration","/posts/vuecicd-ci",{"title":162,"_path":163},"Who is using pnpm?","/posts/pnpm-who-is-using",{"title":165,"_path":166},"Create an Azure-Ready GitHub Repository using Pulumi","/posts/azure-ready-github-repository",{"title":168,"_path":169},"Deploying to Azure from Azure DevOps without secrets","/posts/ado-workload-identity-federation",{"title":171,"_path":172},"Effortlessly Configure GitHub Repositories for Azure Deployment via OIDC","/posts/scripting-azure-ready-github-repository",{"title":174,"_path":175},"Playing with the .NET 8 Web API template","/posts/playing-with-dotnet8",{"title":177,"_path":178},"Another year of sharing and learning - Dev Retro 2023","/posts/2023-retro",{"title":180,"_path":181},"Week 4, 2024 - Tips I learned this week","/posts/w04-2024-tips-learned-this-week",{"title":183,"_path":184},"Using dependency injection with Azure .NET SDK","/posts/azure-sdk-di",{"title":186,"_path":187},"Having Fun With IT Event Calendars","/posts/it-event-calendars",{"title":189,"_path":190},"Call your Azure AD B2C protected API with authenticated HTTP requests from your JetBrains IDE","/posts/http-clients-oauth2","i-heroicons-newspaper",{"title":193,"_path":194,"children":195,"icon":199},"Goodies","/goodies",[196],{"title":197,"_path":198},"My Git Cheat Sheet","/goodies/gitcheatsheet","i-heroicons-gift-solid",{"title":201,"_path":202,"icon":203},"About","/about","i-heroicons-user-circle-solid",[205,207,209,211,214,217,220,223,226,229,231,234,237,240,242,244,247,250,253,255,258,261,264,267,270,273,276,279,282,285,287,289,292,294,297,300,303,305,308,310,313,316,319,322,325,327,329,332,335,338,341,344,347,350,353,356,359,361,363,366,369,372,375,377,380,383,385,388,391,394],[206,206],"tooling",[208,208],"vscode",[210,210],"rest",[212,213],"http","HTTP",[215,216],"razor","Razor",[218,219],"xamarin","Xamarin",[221,222],"templating","Templating",[224,225],"azure-cli","Azure CLI",[227,228],"azure","Azure",[230,230],"shell",[232,233],"github","GitHub",[235,236],"asp-net-core","ASP.NET Core",[238,239],"net",".NET",[241,241],"git",[243,243],"nushell",[245,246],"microsoft-teams","Microsoft Teams",[248,249],"powershell","PowerShell",[251,252],"azure-active-directory","Azure Active Directory",[254,254],"learning",[256,257],"azure-functions","Azure Functions",[259,260],"azure-key-vault","Azure Key Vault",[262,263],"configuration","Configuration",[265,266],"devops","DevOps",[268,269],"it","IT",[271,272],"tips-learned-this-week","tips learned this week",[274,275],"windows-terminal","Windows Terminal",[277,278],"azure-pipelines","Azure Pipelines",[280,281],"application-insights","Application Insights",[283,284],"azure-iot","Azure IoT",[286,286],"records",[288,288],"refit",[290,291],"development-box-setup","development box setup",[293,293],"winget",[295,296],"package-manager","package manager",[298,299],"azure-sql-database","Azure SQL Database",[301,302],"azure-sdk","Azure SDK",[304,304],"wingetcreate",[306,307],"github-actions","GitHub Actions",[309,309],"jq",[311,312],"pulumi","Pulumi",[314,315],"iac","IaC",[317,318],"azure-storage","Azure Storage",[320,321],"azure-signalr","Azure SignalR",[323,324],"visio","Visio",[326,326],"csharp",[328,328],"jest",[330,331],"statiq","Statiq",[333,334],"open-source","open source",[336,337],"visual-studio","Visual Studio",[339,340],"vue-js","Vue.js",[342,343],"azure-devops","Azure DevOps",[345,346],"vite","Vite",[348,349],"code-analysis","Code analysis",[351,352],"diagram","Diagram",[354,355],"terraform","Terraform",[357,358],"typescript","TypeScript",[360,360],"thoughts",[362,362],"pnpm",[364,365],"nuke","Nuke",[367,368],"pipelines","Pipelines",[370,371],"cicd","CI/CD",[373,374],"openid-connect","OpenID Connect",[376,376],"security",[378,379],"github-cli","GitHub CLI",[381,382],"microsoft-entra-id","Microsoft Entra ID",[384,384],"advent",[386,387],"finops","FinOps",[389,390],"anglesharp","AngleSharp",[392,393],"oauth2","OAuth2",[395,396],"azure-ad-b2c","Azure AD B2C",[398],{"_path":13,"_dir":399,"_draft":400,"_partial":400,"_locale":401,"title":12,"description":402,"lead":403,"date":404,"image":405,"badge":407,"tags":409,"body":410,"_type":2091,"_id":2092,"_source":2093,"_file":2094,"_extension":2095},"posts",false,"","There are often situations where you need to do some HTML templating and having a powerful HTML templating engine like Razor can be really helpful.\nWhat is nice is that you don't need to be in an ASP.NET context to use Razor templates, in fact, you can even use them in a Xamarin Application.","Razor templates, Handlebars.Net ...","2019-03-10T00:00:00.000Z",{"src":406},"/images/phone_2.jpg",{"label":408},"Development",[216,219,222],{"type":411,"children":412,"toc":2087},"root",[413,420,427,473,485,514,523,528,533,891,896,1187,1192,1374,1380,1403,1914,1919,2039,2067,2072,2076,2081],{"type":414,"tag":415,"props":416,"children":417},"element","p",{},[418],{"type":419,"value":402},"text",{"type":414,"tag":421,"props":422,"children":424},"h2",{"id":423},"razor-templates",[425],{"type":419,"value":426},"Razor templates",{"type":414,"tag":415,"props":428,"children":429},{},[430,432,441,443,450,452,458,460,465,467,471],{"type":419,"value":431},"There is already a complete article about Razor HTML templates in Xamarin in the ",{"type":414,"tag":433,"props":434,"children":438},"a",{"href":435,"rel":436},"https://docs.microsoft.com/en-us/xamarin/cross-platform/platform/razor-html-templates/",[437],"nofollow",[439],{"type":419,"value":440},"Microsoft documentation",{"type":419,"value":442}," so if you want an in-depth explanation I suggest you read it. In this article, it is explained how to add a Razor template file (",{"type":414,"tag":444,"props":445,"children":447},"code",{"className":446},[],[448],{"type":419,"value":449},".cshtml",{"type":419,"value":451}," file) to a Xamarin project by using the ",{"type":414,"tag":453,"props":454,"children":455},"em",{},[456],{"type":419,"value":457},"Text Templating",{"type":419,"value":459}," section of the ",{"type":414,"tag":453,"props":461,"children":462},{},[463],{"type":419,"value":464},"New file",{"type":419,"value":466}," dialog.\nHowever, if you try to add a new item in a Xamarin project you won't see a ",{"type":414,"tag":453,"props":468,"children":469},{},[470],{"type":419,"value":457},{"type":419,"value":472}," section.",{"type":414,"tag":415,"props":474,"children":475},{},[476],{"type":414,"tag":477,"props":478,"children":484},"img",{"alt":479,"className":480,"src":483},"Add new item in Xamarin Project in Visual Studio",[481,482],"rounded-lg","mx-auto","/posts/images/htmltemplating_vs_1.png",[],{"type":414,"tag":415,"props":486,"children":487},{},[488,490,497,499,504,506,512],{"type":419,"value":489},"That's because, at the time of writing this article, it only exists in Visual Studio for Mac (probably because it comes from Xamarin Studio). So how to add a Razor template file in Visual Studio (Windows)?\nThere is a little tip to do that (I found it in an old post on ",{"type":414,"tag":433,"props":491,"children":494},{"href":492,"rel":493},"https://stackoverflow.com/questions/39048900/is-there-a-preprocessed-razor-template-for-visual-studio-2015",[437],[495],{"type":419,"value":496},"StackOverflow",{"type":419,"value":498},"): you have to manually add a ",{"type":414,"tag":444,"props":500,"children":502},{"className":501},[],[503],{"type":419,"value":449},{"type":419,"value":505}," file to your project and set the custom tool to ",{"type":414,"tag":444,"props":507,"children":509},{"className":508},[],[510],{"type":419,"value":511},"RazorTemplatePreprocessor",{"type":419,"value":513}," in the properties of the file (this will generate the code-behind file).",{"type":414,"tag":415,"props":515,"children":516},{},[517],{"type":414,"tag":477,"props":518,"children":522},{"alt":519,"className":520,"src":521},"File properties of a cshtml file in Visual Studio",[481,482],"/posts/images/htmltemplating_vs_2.png",[],{"type":414,"tag":415,"props":524,"children":525},{},[526],{"type":419,"value":527},"Then you can generate an HTML string from your Razor template and your data in your Xamarin project.",{"type":414,"tag":415,"props":529,"children":530},{},[531],{"type":419,"value":532},"Code to generate the HTML string:",{"type":414,"tag":534,"props":535,"children":538},"pre",{"className":536,"code":537,"language":326,"meta":401,"style":401},"language-csharp shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","var people = new Character[]\n{\n    new Character() { FirstName = \"Ellana\", LastName = \"Caldin\", Job = \"Marchombre\"},\n    new Character() { FirstName = \"Edwin\", LastName = \"Til'Illan\", Job = \"General\"}\n};\nvar template = new RazorTemplate() { Model =  people};\nvar page = template.GenerateString();\n",[539],{"type":414,"tag":444,"props":540,"children":541},{"__ignoreMap":401},[542,580,589,697,793,802,854],{"type":414,"tag":543,"props":544,"children":547},"span",{"class":545,"line":546},"line",1,[548,554,559,565,570,575],{"type":414,"tag":543,"props":549,"children":551},{"style":550},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[552],{"type":419,"value":553},"var",{"type":414,"tag":543,"props":555,"children":556},{"style":550},[557],{"type":419,"value":558}," people",{"type":414,"tag":543,"props":560,"children":562},{"style":561},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[563],{"type":419,"value":564}," =",{"type":414,"tag":543,"props":566,"children":567},{"style":561},[568],{"type":419,"value":569}," new",{"type":414,"tag":543,"props":571,"children":572},{"style":550},[573],{"type":419,"value":574}," Character",{"type":414,"tag":543,"props":576,"children":577},{"style":561},[578],{"type":419,"value":579},"[]\n",{"type":414,"tag":543,"props":581,"children":583},{"class":545,"line":582},2,[584],{"type":414,"tag":543,"props":585,"children":586},{"style":561},[587],{"type":419,"value":588},"{\n",{"type":414,"tag":543,"props":590,"children":592},{"class":545,"line":591},3,[593,598,602,607,612,618,623,628,634,639,644,649,653,657,662,666,670,675,679,683,688,692],{"type":414,"tag":543,"props":594,"children":595},{"style":561},[596],{"type":419,"value":597},"    new",{"type":414,"tag":543,"props":599,"children":600},{"style":550},[601],{"type":419,"value":574},{"type":414,"tag":543,"props":603,"children":604},{"style":561},[605],{"type":419,"value":606},"()",{"type":414,"tag":543,"props":608,"children":609},{"style":561},[610],{"type":419,"value":611}," {",{"type":414,"tag":543,"props":613,"children":615},{"style":614},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[616],{"type":419,"value":617}," FirstName ",{"type":414,"tag":543,"props":619,"children":620},{"style":561},[621],{"type":419,"value":622},"=",{"type":414,"tag":543,"props":624,"children":625},{"style":561},[626],{"type":419,"value":627}," \"",{"type":414,"tag":543,"props":629,"children":631},{"style":630},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[632],{"type":419,"value":633},"Ellana",{"type":414,"tag":543,"props":635,"children":636},{"style":561},[637],{"type":419,"value":638},"\"",{"type":414,"tag":543,"props":640,"children":641},{"style":561},[642],{"type":419,"value":643},",",{"type":414,"tag":543,"props":645,"children":646},{"style":614},[647],{"type":419,"value":648}," LastName ",{"type":414,"tag":543,"props":650,"children":651},{"style":561},[652],{"type":419,"value":622},{"type":414,"tag":543,"props":654,"children":655},{"style":561},[656],{"type":419,"value":627},{"type":414,"tag":543,"props":658,"children":659},{"style":630},[660],{"type":419,"value":661},"Caldin",{"type":414,"tag":543,"props":663,"children":664},{"style":561},[665],{"type":419,"value":638},{"type":414,"tag":543,"props":667,"children":668},{"style":561},[669],{"type":419,"value":643},{"type":414,"tag":543,"props":671,"children":672},{"style":614},[673],{"type":419,"value":674}," Job ",{"type":414,"tag":543,"props":676,"children":677},{"style":561},[678],{"type":419,"value":622},{"type":414,"tag":543,"props":680,"children":681},{"style":561},[682],{"type":419,"value":627},{"type":414,"tag":543,"props":684,"children":685},{"style":630},[686],{"type":419,"value":687},"Marchombre",{"type":414,"tag":543,"props":689,"children":690},{"style":561},[691],{"type":419,"value":638},{"type":414,"tag":543,"props":693,"children":694},{"style":561},[695],{"type":419,"value":696},"},\n",{"type":414,"tag":543,"props":698,"children":700},{"class":545,"line":699},4,[701,705,709,713,717,721,725,729,734,738,742,746,750,754,759,763,767,771,775,779,784,788],{"type":414,"tag":543,"props":702,"children":703},{"style":561},[704],{"type":419,"value":597},{"type":414,"tag":543,"props":706,"children":707},{"style":550},[708],{"type":419,"value":574},{"type":414,"tag":543,"props":710,"children":711},{"style":561},[712],{"type":419,"value":606},{"type":414,"tag":543,"props":714,"children":715},{"style":561},[716],{"type":419,"value":611},{"type":414,"tag":543,"props":718,"children":719},{"style":614},[720],{"type":419,"value":617},{"type":414,"tag":543,"props":722,"children":723},{"style":561},[724],{"type":419,"value":622},{"type":414,"tag":543,"props":726,"children":727},{"style":561},[728],{"type":419,"value":627},{"type":414,"tag":543,"props":730,"children":731},{"style":630},[732],{"type":419,"value":733},"Edwin",{"type":414,"tag":543,"props":735,"children":736},{"style":561},[737],{"type":419,"value":638},{"type":414,"tag":543,"props":739,"children":740},{"style":561},[741],{"type":419,"value":643},{"type":414,"tag":543,"props":743,"children":744},{"style":614},[745],{"type":419,"value":648},{"type":414,"tag":543,"props":747,"children":748},{"style":561},[749],{"type":419,"value":622},{"type":414,"tag":543,"props":751,"children":752},{"style":561},[753],{"type":419,"value":627},{"type":414,"tag":543,"props":755,"children":756},{"style":630},[757],{"type":419,"value":758},"Til'Illan",{"type":414,"tag":543,"props":760,"children":761},{"style":561},[762],{"type":419,"value":638},{"type":414,"tag":543,"props":764,"children":765},{"style":561},[766],{"type":419,"value":643},{"type":414,"tag":543,"props":768,"children":769},{"style":614},[770],{"type":419,"value":674},{"type":414,"tag":543,"props":772,"children":773},{"style":561},[774],{"type":419,"value":622},{"type":414,"tag":543,"props":776,"children":777},{"style":561},[778],{"type":419,"value":627},{"type":414,"tag":543,"props":780,"children":781},{"style":630},[782],{"type":419,"value":783},"General",{"type":414,"tag":543,"props":785,"children":786},{"style":561},[787],{"type":419,"value":638},{"type":414,"tag":543,"props":789,"children":790},{"style":561},[791],{"type":419,"value":792},"}\n",{"type":414,"tag":543,"props":794,"children":796},{"class":545,"line":795},5,[797],{"type":414,"tag":543,"props":798,"children":799},{"style":561},[800],{"type":419,"value":801},"};\n",{"type":414,"tag":543,"props":803,"children":805},{"class":545,"line":804},6,[806,810,815,819,823,828,832,836,841,845,850],{"type":414,"tag":543,"props":807,"children":808},{"style":550},[809],{"type":419,"value":553},{"type":414,"tag":543,"props":811,"children":812},{"style":550},[813],{"type":419,"value":814}," template",{"type":414,"tag":543,"props":816,"children":817},{"style":561},[818],{"type":419,"value":564},{"type":414,"tag":543,"props":820,"children":821},{"style":561},[822],{"type":419,"value":569},{"type":414,"tag":543,"props":824,"children":825},{"style":550},[826],{"type":419,"value":827}," RazorTemplate",{"type":414,"tag":543,"props":829,"children":830},{"style":561},[831],{"type":419,"value":606},{"type":414,"tag":543,"props":833,"children":834},{"style":561},[835],{"type":419,"value":611},{"type":414,"tag":543,"props":837,"children":838},{"style":614},[839],{"type":419,"value":840}," Model ",{"type":414,"tag":543,"props":842,"children":843},{"style":561},[844],{"type":419,"value":622},{"type":414,"tag":543,"props":846,"children":847},{"style":614},[848],{"type":419,"value":849},"  people",{"type":414,"tag":543,"props":851,"children":852},{"style":561},[853],{"type":419,"value":801},{"type":414,"tag":543,"props":855,"children":857},{"class":545,"line":856},7,[858,862,867,871,875,880,886],{"type":414,"tag":543,"props":859,"children":860},{"style":550},[861],{"type":419,"value":553},{"type":414,"tag":543,"props":863,"children":864},{"style":550},[865],{"type":419,"value":866}," page",{"type":414,"tag":543,"props":868,"children":869},{"style":561},[870],{"type":419,"value":564},{"type":414,"tag":543,"props":872,"children":873},{"style":614},[874],{"type":419,"value":814},{"type":414,"tag":543,"props":876,"children":877},{"style":561},[878],{"type":419,"value":879},".",{"type":414,"tag":543,"props":881,"children":883},{"style":882},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[884],{"type":419,"value":885},"GenerateString",{"type":414,"tag":543,"props":887,"children":888},{"style":561},[889],{"type":419,"value":890},"();\n",{"type":414,"tag":415,"props":892,"children":893},{},[894],{"type":419,"value":895},"Razor template:",{"type":414,"tag":534,"props":897,"children":900},{"className":898,"code":899,"language":215,"meta":401,"style":401},"language-razor shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","@model IEnumerable\u003CPdfGeneration.Models.Character>\n\u003Chtml>\n\u003Cbody>\n    \u003Cul class=\"people\">\n    @foreach (var person in @Model)\n    {\n        \u003Cli>@person.FirstName @person.LastName - @person.Job\u003C/li>\n    }\n    \u003C/ul>\n\u003C/body>\n\u003C/html>\n",[901],{"type":414,"tag":444,"props":902,"children":903},{"__ignoreMap":401},[904,951,968,984,1024,1062,1070,1129,1138,1155,1171],{"type":414,"tag":543,"props":905,"children":906},{"class":545,"line":546},[907,913,918,923,928,932,937,941,946],{"type":414,"tag":543,"props":908,"children":910},{"style":909},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF;--shiki-light-font-style:italic;--shiki-default-font-style:italic;--shiki-dark-font-style:italic",[911],{"type":419,"value":912},"@model",{"type":414,"tag":543,"props":914,"children":915},{"style":550},[916],{"type":419,"value":917}," IEnumerable",{"type":414,"tag":543,"props":919,"children":920},{"style":561},[921],{"type":419,"value":922},"\u003C",{"type":414,"tag":543,"props":924,"children":925},{"style":550},[926],{"type":419,"value":927},"PdfGeneration",{"type":414,"tag":543,"props":929,"children":930},{"style":561},[931],{"type":419,"value":879},{"type":414,"tag":543,"props":933,"children":934},{"style":550},[935],{"type":419,"value":936},"Models",{"type":414,"tag":543,"props":938,"children":939},{"style":561},[940],{"type":419,"value":879},{"type":414,"tag":543,"props":942,"children":943},{"style":550},[944],{"type":419,"value":945},"Character",{"type":414,"tag":543,"props":947,"children":948},{"style":561},[949],{"type":419,"value":950},">\n",{"type":414,"tag":543,"props":952,"children":953},{"class":545,"line":582},[954,958,964],{"type":414,"tag":543,"props":955,"children":956},{"style":561},[957],{"type":419,"value":922},{"type":414,"tag":543,"props":959,"children":961},{"style":960},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[962],{"type":419,"value":963},"html",{"type":414,"tag":543,"props":965,"children":966},{"style":561},[967],{"type":419,"value":950},{"type":414,"tag":543,"props":969,"children":970},{"class":545,"line":591},[971,975,980],{"type":414,"tag":543,"props":972,"children":973},{"style":561},[974],{"type":419,"value":922},{"type":414,"tag":543,"props":976,"children":977},{"style":960},[978],{"type":419,"value":979},"body",{"type":414,"tag":543,"props":981,"children":982},{"style":561},[983],{"type":419,"value":950},{"type":414,"tag":543,"props":985,"children":986},{"class":545,"line":699},[987,992,997,1003,1007,1011,1016,1020],{"type":414,"tag":543,"props":988,"children":989},{"style":561},[990],{"type":419,"value":991},"    \u003C",{"type":414,"tag":543,"props":993,"children":994},{"style":960},[995],{"type":419,"value":996},"ul",{"type":414,"tag":543,"props":998,"children":1000},{"style":999},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[1001],{"type":419,"value":1002}," class",{"type":414,"tag":543,"props":1004,"children":1005},{"style":561},[1006],{"type":419,"value":622},{"type":414,"tag":543,"props":1008,"children":1009},{"style":561},[1010],{"type":419,"value":638},{"type":414,"tag":543,"props":1012,"children":1013},{"style":630},[1014],{"type":419,"value":1015},"people",{"type":414,"tag":543,"props":1017,"children":1018},{"style":561},[1019],{"type":419,"value":638},{"type":414,"tag":543,"props":1021,"children":1022},{"style":561},[1023],{"type":419,"value":950},{"type":414,"tag":543,"props":1025,"children":1026},{"class":545,"line":795},[1027,1032,1037,1042,1047,1052,1057],{"type":414,"tag":543,"props":1028,"children":1029},{"style":909},[1030],{"type":419,"value":1031},"    @foreach",{"type":414,"tag":543,"props":1033,"children":1034},{"style":561},[1035],{"type":419,"value":1036}," (",{"type":414,"tag":543,"props":1038,"children":1040},{"style":1039},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[1041],{"type":419,"value":553},{"type":414,"tag":543,"props":1043,"children":1044},{"style":550},[1045],{"type":419,"value":1046}," person",{"type":414,"tag":543,"props":1048,"children":1049},{"style":909},[1050],{"type":419,"value":1051}," in",{"type":414,"tag":543,"props":1053,"children":1054},{"style":614},[1055],{"type":419,"value":1056}," @Model",{"type":414,"tag":543,"props":1058,"children":1059},{"style":561},[1060],{"type":419,"value":1061},")\n",{"type":414,"tag":543,"props":1063,"children":1064},{"class":545,"line":804},[1065],{"type":414,"tag":543,"props":1066,"children":1067},{"style":561},[1068],{"type":419,"value":1069},"    {\n",{"type":414,"tag":543,"props":1071,"children":1072},{"class":545,"line":856},[1073,1078,1083,1088,1093,1098,1102,1107,1111,1116,1121,1125],{"type":414,"tag":543,"props":1074,"children":1075},{"style":561},[1076],{"type":419,"value":1077},"        \u003C",{"type":414,"tag":543,"props":1079,"children":1080},{"style":960},[1081],{"type":419,"value":1082},"li",{"type":414,"tag":543,"props":1084,"children":1085},{"style":561},[1086],{"type":419,"value":1087},">",{"type":414,"tag":543,"props":1089,"children":1090},{"style":909},[1091],{"type":419,"value":1092},"@",{"type":414,"tag":543,"props":1094,"children":1095},{"style":614},[1096],{"type":419,"value":1097},"person.FirstName ",{"type":414,"tag":543,"props":1099,"children":1100},{"style":909},[1101],{"type":419,"value":1092},{"type":414,"tag":543,"props":1103,"children":1104},{"style":614},[1105],{"type":419,"value":1106},"person.LastName - ",{"type":414,"tag":543,"props":1108,"children":1109},{"style":909},[1110],{"type":419,"value":1092},{"type":414,"tag":543,"props":1112,"children":1113},{"style":614},[1114],{"type":419,"value":1115},"person.Job",{"type":414,"tag":543,"props":1117,"children":1118},{"style":561},[1119],{"type":419,"value":1120},"\u003C/",{"type":414,"tag":543,"props":1122,"children":1123},{"style":960},[1124],{"type":419,"value":1082},{"type":414,"tag":543,"props":1126,"children":1127},{"style":561},[1128],{"type":419,"value":950},{"type":414,"tag":543,"props":1130,"children":1132},{"class":545,"line":1131},8,[1133],{"type":414,"tag":543,"props":1134,"children":1135},{"style":561},[1136],{"type":419,"value":1137},"    }\n",{"type":414,"tag":543,"props":1139,"children":1141},{"class":545,"line":1140},9,[1142,1147,1151],{"type":414,"tag":543,"props":1143,"children":1144},{"style":561},[1145],{"type":419,"value":1146},"    \u003C/",{"type":414,"tag":543,"props":1148,"children":1149},{"style":960},[1150],{"type":419,"value":996},{"type":414,"tag":543,"props":1152,"children":1153},{"style":561},[1154],{"type":419,"value":950},{"type":414,"tag":543,"props":1156,"children":1158},{"class":545,"line":1157},10,[1159,1163,1167],{"type":414,"tag":543,"props":1160,"children":1161},{"style":561},[1162],{"type":419,"value":1120},{"type":414,"tag":543,"props":1164,"children":1165},{"style":960},[1166],{"type":419,"value":979},{"type":414,"tag":543,"props":1168,"children":1169},{"style":561},[1170],{"type":419,"value":950},{"type":414,"tag":543,"props":1172,"children":1174},{"class":545,"line":1173},11,[1175,1179,1183],{"type":414,"tag":543,"props":1176,"children":1177},{"style":561},[1178],{"type":419,"value":1120},{"type":414,"tag":543,"props":1180,"children":1181},{"style":960},[1182],{"type":419,"value":963},{"type":414,"tag":543,"props":1184,"children":1185},{"style":561},[1186],{"type":419,"value":950},{"type":414,"tag":415,"props":1188,"children":1189},{},[1190],{"type":419,"value":1191},"This code produces the following html:",{"type":414,"tag":534,"props":1193,"children":1196},{"className":1194,"code":1195,"language":963,"meta":401,"style":401},"language-html shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003Chtml>\n\u003Cbody>\n    \u003Cul class=\"people\">\n        \u003Cli>Ellana Caldin - Marchombre\u003C/li>\n        \u003Cli>Edwin Til&#39;Illan - General\u003C/li>\n    \u003C/ul>\n\u003C/body>\n\u003C/html>\n",[1197],{"type":414,"tag":444,"props":1198,"children":1199},{"__ignoreMap":401},[1200,1215,1230,1265,1297,1329,1344,1359],{"type":414,"tag":543,"props":1201,"children":1202},{"class":545,"line":546},[1203,1207,1211],{"type":414,"tag":543,"props":1204,"children":1205},{"style":561},[1206],{"type":419,"value":922},{"type":414,"tag":543,"props":1208,"children":1209},{"style":960},[1210],{"type":419,"value":963},{"type":414,"tag":543,"props":1212,"children":1213},{"style":561},[1214],{"type":419,"value":950},{"type":414,"tag":543,"props":1216,"children":1217},{"class":545,"line":582},[1218,1222,1226],{"type":414,"tag":543,"props":1219,"children":1220},{"style":561},[1221],{"type":419,"value":922},{"type":414,"tag":543,"props":1223,"children":1224},{"style":960},[1225],{"type":419,"value":979},{"type":414,"tag":543,"props":1227,"children":1228},{"style":561},[1229],{"type":419,"value":950},{"type":414,"tag":543,"props":1231,"children":1232},{"class":545,"line":591},[1233,1237,1241,1245,1249,1253,1257,1261],{"type":414,"tag":543,"props":1234,"children":1235},{"style":561},[1236],{"type":419,"value":991},{"type":414,"tag":543,"props":1238,"children":1239},{"style":960},[1240],{"type":419,"value":996},{"type":414,"tag":543,"props":1242,"children":1243},{"style":999},[1244],{"type":419,"value":1002},{"type":414,"tag":543,"props":1246,"children":1247},{"style":561},[1248],{"type":419,"value":622},{"type":414,"tag":543,"props":1250,"children":1251},{"style":561},[1252],{"type":419,"value":638},{"type":414,"tag":543,"props":1254,"children":1255},{"style":630},[1256],{"type":419,"value":1015},{"type":414,"tag":543,"props":1258,"children":1259},{"style":561},[1260],{"type":419,"value":638},{"type":414,"tag":543,"props":1262,"children":1263},{"style":561},[1264],{"type":419,"value":950},{"type":414,"tag":543,"props":1266,"children":1267},{"class":545,"line":699},[1268,1272,1276,1280,1285,1289,1293],{"type":414,"tag":543,"props":1269,"children":1270},{"style":561},[1271],{"type":419,"value":1077},{"type":414,"tag":543,"props":1273,"children":1274},{"style":960},[1275],{"type":419,"value":1082},{"type":414,"tag":543,"props":1277,"children":1278},{"style":561},[1279],{"type":419,"value":1087},{"type":414,"tag":543,"props":1281,"children":1282},{"style":614},[1283],{"type":419,"value":1284},"Ellana Caldin - Marchombre",{"type":414,"tag":543,"props":1286,"children":1287},{"style":561},[1288],{"type":419,"value":1120},{"type":414,"tag":543,"props":1290,"children":1291},{"style":960},[1292],{"type":419,"value":1082},{"type":414,"tag":543,"props":1294,"children":1295},{"style":561},[1296],{"type":419,"value":950},{"type":414,"tag":543,"props":1298,"children":1299},{"class":545,"line":795},[1300,1304,1308,1312,1317,1321,1325],{"type":414,"tag":543,"props":1301,"children":1302},{"style":561},[1303],{"type":419,"value":1077},{"type":414,"tag":543,"props":1305,"children":1306},{"style":960},[1307],{"type":419,"value":1082},{"type":414,"tag":543,"props":1309,"children":1310},{"style":561},[1311],{"type":419,"value":1087},{"type":414,"tag":543,"props":1313,"children":1314},{"style":614},[1315],{"type":419,"value":1316},"Edwin Til&#39;Illan - General",{"type":414,"tag":543,"props":1318,"children":1319},{"style":561},[1320],{"type":419,"value":1120},{"type":414,"tag":543,"props":1322,"children":1323},{"style":960},[1324],{"type":419,"value":1082},{"type":414,"tag":543,"props":1326,"children":1327},{"style":561},[1328],{"type":419,"value":950},{"type":414,"tag":543,"props":1330,"children":1331},{"class":545,"line":804},[1332,1336,1340],{"type":414,"tag":543,"props":1333,"children":1334},{"style":561},[1335],{"type":419,"value":1146},{"type":414,"tag":543,"props":1337,"children":1338},{"style":960},[1339],{"type":419,"value":996},{"type":414,"tag":543,"props":1341,"children":1342},{"style":561},[1343],{"type":419,"value":950},{"type":414,"tag":543,"props":1345,"children":1346},{"class":545,"line":856},[1347,1351,1355],{"type":414,"tag":543,"props":1348,"children":1349},{"style":561},[1350],{"type":419,"value":1120},{"type":414,"tag":543,"props":1352,"children":1353},{"style":960},[1354],{"type":419,"value":979},{"type":414,"tag":543,"props":1356,"children":1357},{"style":561},[1358],{"type":419,"value":950},{"type":414,"tag":543,"props":1360,"children":1361},{"class":545,"line":1131},[1362,1366,1370],{"type":414,"tag":543,"props":1363,"children":1364},{"style":561},[1365],{"type":419,"value":1120},{"type":414,"tag":543,"props":1367,"children":1368},{"style":960},[1369],{"type":419,"value":963},{"type":414,"tag":543,"props":1371,"children":1372},{"style":561},[1373],{"type":419,"value":950},{"type":414,"tag":421,"props":1375,"children":1377},{"id":1376},"handlebarsnet-an-alternative-to-razor-templates",[1378],{"type":419,"value":1379},"Handlebars.Net, an alternative to Razor templates",{"type":414,"tag":415,"props":1381,"children":1382},{},[1383,1385,1392,1394,1401],{"type":419,"value":1384},"You can also do HTML templating by using ",{"type":414,"tag":433,"props":1386,"children":1389},{"href":1387,"rel":1388},"https://github.com/rexm/Handlebars.Net",[437],[1390],{"type":419,"value":1391},"Handlebars.Net",{"type":419,"value":1393}," which is a .NET Handlebars engine. It allows to build semantic templates in a .NET application. It uses the same syntax than ",{"type":414,"tag":433,"props":1395,"children":1398},{"href":1396,"rel":1397},"http://handlebarsjs.com/",[437],[1399],{"type":419,"value":1400},"handlebars.js",{"type":419,"value":1402}," for the templates and try to mimic the JS API. Nothing better than a piece of code to illustrate that:",{"type":414,"tag":534,"props":1404,"children":1407},{"className":536,"code":1405,"filename":1406,"language":326,"meta":401,"style":401},"#r \"nuget: Handlebars.Net, 1.9.5\"\n\nusing HandlebarsDotNet;\nstring html = @\"\n\u003Cul class=\"\"people\"\">\n  {{#each people}}\n    \u003Cli>{{FirstName}} {{LastName}} - {{Job}}\u003C/li>\n  {{/each}}\n\u003C/ul>\";\n\nvar data = new \n{\n    people = new [] \n    {\n        new { FirstName = \"Ellana\", LastName = \"Caldin\", Job = \"Marchombre\"},\n        new { FirstName = \"Edwin\", LastName = \"Til'Illan\", Job = \"General\"}\n    }\n};\n\nvar template = Handlebars.Compile(html);\nstring result = template(data);\nConsole.WriteLine(result);\n","TestingHandlebars.csx",[1408],{"type":414,"tag":444,"props":1409,"children":1410},{"__ignoreMap":401},[1411,1424,1433,1451,1473,1498,1506,1514,1522,1538,1545,1570,1578,1604,1612,1697,1781,1789,1797,1805,1849,1883],{"type":414,"tag":543,"props":1412,"children":1413},{"class":545,"line":546},[1414,1419],{"type":414,"tag":543,"props":1415,"children":1416},{"style":561},[1417],{"type":419,"value":1418},"#r",{"type":414,"tag":543,"props":1420,"children":1421},{"style":630},[1422],{"type":419,"value":1423}," \"nuget: Handlebars.Net, 1.9.5\"\n",{"type":414,"tag":543,"props":1425,"children":1426},{"class":545,"line":582},[1427],{"type":414,"tag":543,"props":1428,"children":1430},{"emptyLinePlaceholder":1429},true,[1431],{"type":419,"value":1432},"\n",{"type":414,"tag":543,"props":1434,"children":1435},{"class":545,"line":591},[1436,1441,1446],{"type":414,"tag":543,"props":1437,"children":1438},{"style":1039},[1439],{"type":419,"value":1440},"using",{"type":414,"tag":543,"props":1442,"children":1443},{"style":614},[1444],{"type":419,"value":1445}," HandlebarsDotNet",{"type":414,"tag":543,"props":1447,"children":1448},{"style":561},[1449],{"type":419,"value":1450},";\n",{"type":414,"tag":543,"props":1452,"children":1453},{"class":545,"line":699},[1454,1459,1464,1468],{"type":414,"tag":543,"props":1455,"children":1456},{"style":561},[1457],{"type":419,"value":1458},"string",{"type":414,"tag":543,"props":1460,"children":1461},{"style":550},[1462],{"type":419,"value":1463}," html",{"type":414,"tag":543,"props":1465,"children":1466},{"style":561},[1467],{"type":419,"value":564},{"type":414,"tag":543,"props":1469,"children":1470},{"style":561},[1471],{"type":419,"value":1472}," @\"\n",{"type":414,"tag":543,"props":1474,"children":1475},{"class":545,"line":795},[1476,1481,1486,1490,1494],{"type":414,"tag":543,"props":1477,"children":1478},{"style":630},[1479],{"type":419,"value":1480},"\u003Cul class=",{"type":414,"tag":543,"props":1482,"children":1483},{"style":614},[1484],{"type":419,"value":1485},"\"\"",{"type":414,"tag":543,"props":1487,"children":1488},{"style":630},[1489],{"type":419,"value":1015},{"type":414,"tag":543,"props":1491,"children":1492},{"style":614},[1493],{"type":419,"value":1485},{"type":414,"tag":543,"props":1495,"children":1496},{"style":630},[1497],{"type":419,"value":950},{"type":414,"tag":543,"props":1499,"children":1500},{"class":545,"line":804},[1501],{"type":414,"tag":543,"props":1502,"children":1503},{"style":630},[1504],{"type":419,"value":1505},"  {{#each people}}\n",{"type":414,"tag":543,"props":1507,"children":1508},{"class":545,"line":856},[1509],{"type":414,"tag":543,"props":1510,"children":1511},{"style":630},[1512],{"type":419,"value":1513},"    \u003Cli>{{FirstName}} {{LastName}} - {{Job}}\u003C/li>\n",{"type":414,"tag":543,"props":1515,"children":1516},{"class":545,"line":1131},[1517],{"type":414,"tag":543,"props":1518,"children":1519},{"style":630},[1520],{"type":419,"value":1521},"  {{/each}}\n",{"type":414,"tag":543,"props":1523,"children":1524},{"class":545,"line":1140},[1525,1530,1534],{"type":414,"tag":543,"props":1526,"children":1527},{"style":630},[1528],{"type":419,"value":1529},"\u003C/ul>",{"type":414,"tag":543,"props":1531,"children":1532},{"style":561},[1533],{"type":419,"value":638},{"type":414,"tag":543,"props":1535,"children":1536},{"style":561},[1537],{"type":419,"value":1450},{"type":414,"tag":543,"props":1539,"children":1540},{"class":545,"line":1157},[1541],{"type":414,"tag":543,"props":1542,"children":1543},{"emptyLinePlaceholder":1429},[1544],{"type":419,"value":1432},{"type":414,"tag":543,"props":1546,"children":1547},{"class":545,"line":1173},[1548,1552,1557,1561,1565],{"type":414,"tag":543,"props":1549,"children":1550},{"style":550},[1551],{"type":419,"value":553},{"type":414,"tag":543,"props":1553,"children":1554},{"style":550},[1555],{"type":419,"value":1556}," data",{"type":414,"tag":543,"props":1558,"children":1559},{"style":561},[1560],{"type":419,"value":564},{"type":414,"tag":543,"props":1562,"children":1563},{"style":561},[1564],{"type":419,"value":569},{"type":414,"tag":543,"props":1566,"children":1567},{"style":614},[1568],{"type":419,"value":1569}," \n",{"type":414,"tag":543,"props":1571,"children":1573},{"class":545,"line":1572},12,[1574],{"type":414,"tag":543,"props":1575,"children":1576},{"style":561},[1577],{"type":419,"value":588},{"type":414,"tag":543,"props":1579,"children":1581},{"class":545,"line":1580},13,[1582,1587,1591,1595,1600],{"type":414,"tag":543,"props":1583,"children":1584},{"style":614},[1585],{"type":419,"value":1586},"    people ",{"type":414,"tag":543,"props":1588,"children":1589},{"style":561},[1590],{"type":419,"value":622},{"type":414,"tag":543,"props":1592,"children":1593},{"style":561},[1594],{"type":419,"value":569},{"type":414,"tag":543,"props":1596,"children":1597},{"style":561},[1598],{"type":419,"value":1599}," []",{"type":414,"tag":543,"props":1601,"children":1602},{"style":614},[1603],{"type":419,"value":1569},{"type":414,"tag":543,"props":1605,"children":1607},{"class":545,"line":1606},14,[1608],{"type":414,"tag":543,"props":1609,"children":1610},{"style":561},[1611],{"type":419,"value":1069},{"type":414,"tag":543,"props":1613,"children":1615},{"class":545,"line":1614},15,[1616,1621,1625,1629,1633,1637,1641,1645,1649,1653,1657,1661,1665,1669,1673,1677,1681,1685,1689,1693],{"type":414,"tag":543,"props":1617,"children":1618},{"style":561},[1619],{"type":419,"value":1620},"        new",{"type":414,"tag":543,"props":1622,"children":1623},{"style":561},[1624],{"type":419,"value":611},{"type":414,"tag":543,"props":1626,"children":1627},{"style":614},[1628],{"type":419,"value":617},{"type":414,"tag":543,"props":1630,"children":1631},{"style":561},[1632],{"type":419,"value":622},{"type":414,"tag":543,"props":1634,"children":1635},{"style":561},[1636],{"type":419,"value":627},{"type":414,"tag":543,"props":1638,"children":1639},{"style":630},[1640],{"type":419,"value":633},{"type":414,"tag":543,"props":1642,"children":1643},{"style":561},[1644],{"type":419,"value":638},{"type":414,"tag":543,"props":1646,"children":1647},{"style":561},[1648],{"type":419,"value":643},{"type":414,"tag":543,"props":1650,"children":1651},{"style":614},[1652],{"type":419,"value":648},{"type":414,"tag":543,"props":1654,"children":1655},{"style":561},[1656],{"type":419,"value":622},{"type":414,"tag":543,"props":1658,"children":1659},{"style":561},[1660],{"type":419,"value":627},{"type":414,"tag":543,"props":1662,"children":1663},{"style":630},[1664],{"type":419,"value":661},{"type":414,"tag":543,"props":1666,"children":1667},{"style":561},[1668],{"type":419,"value":638},{"type":414,"tag":543,"props":1670,"children":1671},{"style":561},[1672],{"type":419,"value":643},{"type":414,"tag":543,"props":1674,"children":1675},{"style":614},[1676],{"type":419,"value":674},{"type":414,"tag":543,"props":1678,"children":1679},{"style":561},[1680],{"type":419,"value":622},{"type":414,"tag":543,"props":1682,"children":1683},{"style":561},[1684],{"type":419,"value":627},{"type":414,"tag":543,"props":1686,"children":1687},{"style":630},[1688],{"type":419,"value":687},{"type":414,"tag":543,"props":1690,"children":1691},{"style":561},[1692],{"type":419,"value":638},{"type":414,"tag":543,"props":1694,"children":1695},{"style":561},[1696],{"type":419,"value":696},{"type":414,"tag":543,"props":1698,"children":1700},{"class":545,"line":1699},16,[1701,1705,1709,1713,1717,1721,1725,1729,1733,1737,1741,1745,1749,1753,1757,1761,1765,1769,1773,1777],{"type":414,"tag":543,"props":1702,"children":1703},{"style":561},[1704],{"type":419,"value":1620},{"type":414,"tag":543,"props":1706,"children":1707},{"style":561},[1708],{"type":419,"value":611},{"type":414,"tag":543,"props":1710,"children":1711},{"style":614},[1712],{"type":419,"value":617},{"type":414,"tag":543,"props":1714,"children":1715},{"style":561},[1716],{"type":419,"value":622},{"type":414,"tag":543,"props":1718,"children":1719},{"style":561},[1720],{"type":419,"value":627},{"type":414,"tag":543,"props":1722,"children":1723},{"style":630},[1724],{"type":419,"value":733},{"type":414,"tag":543,"props":1726,"children":1727},{"style":561},[1728],{"type":419,"value":638},{"type":414,"tag":543,"props":1730,"children":1731},{"style":561},[1732],{"type":419,"value":643},{"type":414,"tag":543,"props":1734,"children":1735},{"style":614},[1736],{"type":419,"value":648},{"type":414,"tag":543,"props":1738,"children":1739},{"style":561},[1740],{"type":419,"value":622},{"type":414,"tag":543,"props":1742,"children":1743},{"style":561},[1744],{"type":419,"value":627},{"type":414,"tag":543,"props":1746,"children":1747},{"style":630},[1748],{"type":419,"value":758},{"type":414,"tag":543,"props":1750,"children":1751},{"style":561},[1752],{"type":419,"value":638},{"type":414,"tag":543,"props":1754,"children":1755},{"style":561},[1756],{"type":419,"value":643},{"type":414,"tag":543,"props":1758,"children":1759},{"style":614},[1760],{"type":419,"value":674},{"type":414,"tag":543,"props":1762,"children":1763},{"style":561},[1764],{"type":419,"value":622},{"type":414,"tag":543,"props":1766,"children":1767},{"style":561},[1768],{"type":419,"value":627},{"type":414,"tag":543,"props":1770,"children":1771},{"style":630},[1772],{"type":419,"value":783},{"type":414,"tag":543,"props":1774,"children":1775},{"style":561},[1776],{"type":419,"value":638},{"type":414,"tag":543,"props":1778,"children":1779},{"style":561},[1780],{"type":419,"value":792},{"type":414,"tag":543,"props":1782,"children":1784},{"class":545,"line":1783},17,[1785],{"type":414,"tag":543,"props":1786,"children":1787},{"style":561},[1788],{"type":419,"value":1137},{"type":414,"tag":543,"props":1790,"children":1792},{"class":545,"line":1791},18,[1793],{"type":414,"tag":543,"props":1794,"children":1795},{"style":561},[1796],{"type":419,"value":801},{"type":414,"tag":543,"props":1798,"children":1800},{"class":545,"line":1799},19,[1801],{"type":414,"tag":543,"props":1802,"children":1803},{"emptyLinePlaceholder":1429},[1804],{"type":419,"value":1432},{"type":414,"tag":543,"props":1806,"children":1808},{"class":545,"line":1807},20,[1809,1813,1817,1821,1826,1830,1835,1840,1844],{"type":414,"tag":543,"props":1810,"children":1811},{"style":550},[1812],{"type":419,"value":553},{"type":414,"tag":543,"props":1814,"children":1815},{"style":550},[1816],{"type":419,"value":814},{"type":414,"tag":543,"props":1818,"children":1819},{"style":561},[1820],{"type":419,"value":564},{"type":414,"tag":543,"props":1822,"children":1823},{"style":614},[1824],{"type":419,"value":1825}," Handlebars",{"type":414,"tag":543,"props":1827,"children":1828},{"style":561},[1829],{"type":419,"value":879},{"type":414,"tag":543,"props":1831,"children":1832},{"style":882},[1833],{"type":419,"value":1834},"Compile",{"type":414,"tag":543,"props":1836,"children":1837},{"style":561},[1838],{"type":419,"value":1839},"(",{"type":414,"tag":543,"props":1841,"children":1842},{"style":614},[1843],{"type":419,"value":963},{"type":414,"tag":543,"props":1845,"children":1846},{"style":561},[1847],{"type":419,"value":1848},");\n",{"type":414,"tag":543,"props":1850,"children":1852},{"class":545,"line":1851},21,[1853,1857,1862,1866,1870,1874,1879],{"type":414,"tag":543,"props":1854,"children":1855},{"style":561},[1856],{"type":419,"value":1458},{"type":414,"tag":543,"props":1858,"children":1859},{"style":550},[1860],{"type":419,"value":1861}," result",{"type":414,"tag":543,"props":1863,"children":1864},{"style":561},[1865],{"type":419,"value":564},{"type":414,"tag":543,"props":1867,"children":1868},{"style":882},[1869],{"type":419,"value":814},{"type":414,"tag":543,"props":1871,"children":1872},{"style":561},[1873],{"type":419,"value":1839},{"type":414,"tag":543,"props":1875,"children":1876},{"style":614},[1877],{"type":419,"value":1878},"data",{"type":414,"tag":543,"props":1880,"children":1881},{"style":561},[1882],{"type":419,"value":1848},{"type":414,"tag":543,"props":1884,"children":1886},{"class":545,"line":1885},22,[1887,1892,1896,1901,1905,1910],{"type":414,"tag":543,"props":1888,"children":1889},{"style":614},[1890],{"type":419,"value":1891},"Console",{"type":414,"tag":543,"props":1893,"children":1894},{"style":561},[1895],{"type":419,"value":879},{"type":414,"tag":543,"props":1897,"children":1898},{"style":882},[1899],{"type":419,"value":1900},"WriteLine",{"type":414,"tag":543,"props":1902,"children":1903},{"style":561},[1904],{"type":419,"value":1839},{"type":414,"tag":543,"props":1906,"children":1907},{"style":614},[1908],{"type":419,"value":1909},"result",{"type":414,"tag":543,"props":1911,"children":1912},{"style":561},[1913],{"type":419,"value":1848},{"type":414,"tag":415,"props":1915,"children":1916},{},[1917],{"type":419,"value":1918},"This produces the following html:",{"type":414,"tag":534,"props":1920,"children":1922},{"className":1194,"code":1921,"language":963,"meta":401,"style":401},"\u003Cul class=\"people\">\n    \u003Cli>Ellana Caldin - Marchombre\u003C/li>\n    \u003Cli>Edwin Til'Illan - General\u003C/li>\n\u003C/ul>\n",[1923],{"type":414,"tag":444,"props":1924,"children":1925},{"__ignoreMap":401},[1926,1961,1992,2024],{"type":414,"tag":543,"props":1927,"children":1928},{"class":545,"line":546},[1929,1933,1937,1941,1945,1949,1953,1957],{"type":414,"tag":543,"props":1930,"children":1931},{"style":561},[1932],{"type":419,"value":922},{"type":414,"tag":543,"props":1934,"children":1935},{"style":960},[1936],{"type":419,"value":996},{"type":414,"tag":543,"props":1938,"children":1939},{"style":999},[1940],{"type":419,"value":1002},{"type":414,"tag":543,"props":1942,"children":1943},{"style":561},[1944],{"type":419,"value":622},{"type":414,"tag":543,"props":1946,"children":1947},{"style":561},[1948],{"type":419,"value":638},{"type":414,"tag":543,"props":1950,"children":1951},{"style":630},[1952],{"type":419,"value":1015},{"type":414,"tag":543,"props":1954,"children":1955},{"style":561},[1956],{"type":419,"value":638},{"type":414,"tag":543,"props":1958,"children":1959},{"style":561},[1960],{"type":419,"value":950},{"type":414,"tag":543,"props":1962,"children":1963},{"class":545,"line":582},[1964,1968,1972,1976,1980,1984,1988],{"type":414,"tag":543,"props":1965,"children":1966},{"style":561},[1967],{"type":419,"value":991},{"type":414,"tag":543,"props":1969,"children":1970},{"style":960},[1971],{"type":419,"value":1082},{"type":414,"tag":543,"props":1973,"children":1974},{"style":561},[1975],{"type":419,"value":1087},{"type":414,"tag":543,"props":1977,"children":1978},{"style":614},[1979],{"type":419,"value":1284},{"type":414,"tag":543,"props":1981,"children":1982},{"style":561},[1983],{"type":419,"value":1120},{"type":414,"tag":543,"props":1985,"children":1986},{"style":960},[1987],{"type":419,"value":1082},{"type":414,"tag":543,"props":1989,"children":1990},{"style":561},[1991],{"type":419,"value":950},{"type":414,"tag":543,"props":1993,"children":1994},{"class":545,"line":591},[1995,1999,2003,2007,2012,2016,2020],{"type":414,"tag":543,"props":1996,"children":1997},{"style":561},[1998],{"type":419,"value":991},{"type":414,"tag":543,"props":2000,"children":2001},{"style":960},[2002],{"type":419,"value":1082},{"type":414,"tag":543,"props":2004,"children":2005},{"style":561},[2006],{"type":419,"value":1087},{"type":414,"tag":543,"props":2008,"children":2009},{"style":614},[2010],{"type":419,"value":2011},"Edwin Til'Illan - General",{"type":414,"tag":543,"props":2013,"children":2014},{"style":561},[2015],{"type":419,"value":1120},{"type":414,"tag":543,"props":2017,"children":2018},{"style":960},[2019],{"type":419,"value":1082},{"type":414,"tag":543,"props":2021,"children":2022},{"style":561},[2023],{"type":419,"value":950},{"type":414,"tag":543,"props":2025,"children":2026},{"class":545,"line":699},[2027,2031,2035],{"type":414,"tag":543,"props":2028,"children":2029},{"style":561},[2030],{"type":419,"value":1120},{"type":414,"tag":543,"props":2032,"children":2033},{"style":960},[2034],{"type":419,"value":996},{"type":414,"tag":543,"props":2036,"children":2037},{"style":561},[2038],{"type":419,"value":950},{"type":414,"tag":415,"props":2040,"children":2041},{},[2042,2044,2049,2051,2058,2060,2066],{"type":419,"value":2043},"The code above ",{"type":414,"tag":444,"props":2045,"children":2047},{"className":2046},[],[2048],{"type":419,"value":1406},{"type":419,"value":2050}," is a C# script so if you have ",{"type":414,"tag":433,"props":2052,"children":2055},{"href":2053,"rel":2054},"https://github.com/filipw/dotnet-script",[437],[2056],{"type":419,"value":2057},"dotnet-script",{"type":419,"value":2059}," installed you can run it just by copy/pasting the following command in your terminal: ",{"type":414,"tag":444,"props":2061,"children":2063},{"className":2062},[],[2064],{"type":419,"value":2065},"dotnet script http://tinyurl.com/y5vvv2nm",{"type":419,"value":879},{"type":414,"tag":415,"props":2068,"children":2069},{},[2070],{"type":419,"value":2071},"Using Handlebars.Net is pretty simple and quite powerful. Moreover it runs fine on Xamarin too 👌.",{"type":414,"tag":2073,"props":2074,"children":2075},"hr",{},[],{"type":414,"tag":415,"props":2077,"children":2078},{},[2079],{"type":419,"value":2080},"So now you have 2 solutions to do HTML templating in Xamarin, choose the one you like the best.",{"type":414,"tag":2082,"props":2083,"children":2084},"style",{},[2085],{"type":419,"value":2086},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":401,"searchDepth":582,"depth":582,"links":2088},[2089,2090],{"id":423,"depth":582,"text":426},{"id":1376,"depth":582,"text":1379},"markdown","content:1.posts:2.html-templating-in-xamarin.md","content","1.posts/2.html-templating-in-xamarin.md","md",1716749600752]