From 3f532e7b0146336d783e697d8a8209bf45efc983 Mon Sep 17 00:00:00 2001 From: shukawam Date: Wed, 18 Jun 2025 15:02:22 +0900 Subject: [PATCH] docs: improve markdown syntax --- .../lua-cheatsheet/README.md | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/session1/plugin-development-intro/lua-cheatsheet/README.md b/session1/plugin-development-intro/lua-cheatsheet/README.md index 8f4d8e1..5f0122b 100644 --- a/session1/plugin-development-intro/lua-cheatsheet/README.md +++ b/session1/plugin-development-intro/lua-cheatsheet/README.md @@ -71,10 +71,18 @@ elseif condition then else print("no") end -Variables +``` + +## Variables + +```lua local x = 2 two, four = 2, 4 -Functions +``` + +## Functions + +```lua function myFunction() return 1 end @@ -100,7 +108,11 @@ function doAction(action, ...) end doAction('write', "Shirley", "Abed") -Lookups +``` + +## Lookups + +```lua mytable = { x = 2, y = function() .. end } -- The same: @@ -116,7 +128,11 @@ mytable:y(a, b) function X:y(z) .. end function X.y(self, z) .. end -Metatables +``` + +## Metatables + +```lua mt = {} -- A metatable is simply a table with functions in it.