目标:一篇文吃透 Lua 语法 与 xLua 互操作语法。不聊工程目录,只聊概念 + 语法 + 可直接运行的片段。
0. 速览:Lua 的“七件套”
基础类型:nil / boolean / number / string / table / function / thread(协程)(还有 userdata,在 xLua 中常见于 C# 对象)
三类运算:算术 + - * / % // ^、比较 == ~= < > <= >=、逻辑 and or not
两个“黑魔法”:表(table)与元表(metatable)表是一切组合数据的容器;元表让你给表(或 userdata)定制运算与访问规则。
1. 变量、作用域与表达式123456789101112131415161718192021222324252627--#region 变量与作用域local x = 10 -- local:局部变量(推荐默认都用 local)y = 20 -- 无 local:全局变量 ...
面向新手的 Hexo 操作说明。只保留最有用的命令与范例,能直接复制粘贴跑起来。
1) 新建文章12345678# 新建一篇普通文章(建议文件名用英文,便于链接与版本管理)hexo new "hello-hexo-quickstart"# 也可指定类型:post(默认)/ draft / pagehexo new post "my-first-post"hexo new draft "post-draft" # 草稿(不会被发布)hexo publish draft "post-draft" # 草稿转正式文章hexo new page "about" # 生成独立页面:/about/
2) 本地预览12345# 启动本地服务(默认 http://localhost:4000)hexo s# 可选:自动打开浏览器、指定端口hexo s -o -p 4001
退出预览:在终端按 Ctrl + C。
3) 写作:Front-ma ...

