fixed Lua Runtime. Plugins now have priority for hooks and POST for routes if requested. also changed the CSS for main.css to color #1e1e1e for darkmode body
This commit is contained in:
184
.vscode/globals.lua
vendored
Normal file
184
.vscode/globals.lua
vendored
Normal file
@@ -0,0 +1,184 @@
|
||||
-- GLOBAL FUNCTION STUBS FOR VS CODE INTELLISENSE
|
||||
|
||||
-- Routing / Hooking
|
||||
---@param path string
|
||||
---@param callback function
|
||||
---@param priority number? optional
|
||||
function add_route(path, callback, priority) end
|
||||
|
||||
---@param path string
|
||||
---@param callback function
|
||||
---@param priority number? optional
|
||||
function add_get_route(path, callback, priority) end
|
||||
|
||||
---@param path string
|
||||
---@param callback function
|
||||
---@param priority number? optional
|
||||
function add_post_route(path, callback, priority) end
|
||||
|
||||
---@param hook_name string
|
||||
---@param callback function
|
||||
---@param priority number? optional
|
||||
function register_hook(hook_name, callback, priority) end
|
||||
|
||||
-- Logging
|
||||
---@param msg string
|
||||
function log(msg) end
|
||||
|
||||
-- File Operations
|
||||
---@return string[]
|
||||
function list_html_files() end
|
||||
|
||||
---@return string[]
|
||||
function list_markdown_files() end
|
||||
|
||||
---@param filename string
|
||||
---@param content string
|
||||
---@return boolean
|
||||
function write_markdown(filename, content) end
|
||||
|
||||
---@param path string
|
||||
---@return boolean
|
||||
function file_exists(path) end
|
||||
|
||||
---@param path string
|
||||
---@return integer
|
||||
function file_size(path) end
|
||||
|
||||
---@param path string
|
||||
---@return string[]
|
||||
function list_directory(path) end
|
||||
|
||||
-- HTML Utilities
|
||||
---@param html string
|
||||
---@param tag string
|
||||
---@param class_name string
|
||||
---@return string
|
||||
function html_add_class(html, tag, class_name) end
|
||||
|
||||
---@param html string
|
||||
---@param tag string
|
||||
---@param attr_name string
|
||||
---@param attr_value string
|
||||
---@return string
|
||||
function html_add_attribute(html, tag, attr_name, attr_value) end
|
||||
|
||||
---@param html string
|
||||
---@param marker string
|
||||
---@param content string
|
||||
---@return string
|
||||
function html_insert_before(html, marker, content) end
|
||||
|
||||
---@param html string
|
||||
---@param marker string
|
||||
---@param content string
|
||||
---@return string
|
||||
function html_insert_after(html, marker, content) end
|
||||
|
||||
---@param html string
|
||||
---@param tag string
|
||||
---@param wrapper_tag string
|
||||
---@param attrs string
|
||||
---@return string
|
||||
function html_wrap_content(html, tag, wrapper_tag, attrs) end
|
||||
|
||||
---@param html string
|
||||
---@param tag string
|
||||
---@param keep_content boolean
|
||||
---@return string
|
||||
function html_remove_tag(html, tag, keep_content) end
|
||||
|
||||
-- Markdown Utilities
|
||||
---@param markdown string
|
||||
---@param level integer
|
||||
---@param text string
|
||||
---@return string
|
||||
function md_add_header(markdown, level, text) end
|
||||
|
||||
---@param markdown string
|
||||
---@param header string
|
||||
---@param new_content string
|
||||
---@return string
|
||||
function md_replace_section(markdown, header, new_content) end
|
||||
|
||||
---@param markdown string
|
||||
---@param content string
|
||||
---@return string
|
||||
function md_append_content(markdown, content) end
|
||||
|
||||
---@param markdown string
|
||||
---@param content string
|
||||
---@return string
|
||||
function md_prepend_content(markdown, content) end
|
||||
|
||||
---@param markdown string
|
||||
---@param position integer
|
||||
---@param content string
|
||||
---@return string
|
||||
function md_insert_at_position(markdown, position, content) end
|
||||
|
||||
---@param markdown string
|
||||
---@param header string
|
||||
---@return string?
|
||||
function md_find_section(markdown, header) end
|
||||
|
||||
---@param markdown string
|
||||
---@param header string
|
||||
---@return string
|
||||
function md_remove_section(markdown, header) end
|
||||
|
||||
---@param markdown string
|
||||
---@param item string
|
||||
---@param ordered boolean
|
||||
---@return string
|
||||
function md_add_list_item(markdown, item, ordered) end
|
||||
|
||||
---@param markdown string
|
||||
---@param language string
|
||||
---@return string
|
||||
function md_wrap_code_block(markdown, language) end
|
||||
|
||||
-- JSON Utilities
|
||||
---@param lua_table any
|
||||
---@return string
|
||||
function table_to_json(lua_table) end
|
||||
|
||||
---@param json_str string
|
||||
---@return table
|
||||
function json_to_table(json_str) end
|
||||
|
||||
---@param json_str string
|
||||
---@return table
|
||||
function json_parse(json_str) end
|
||||
|
||||
---@param data any
|
||||
---@return string
|
||||
function json_stringify(data) end
|
||||
|
||||
-- String Utilities
|
||||
---@param text string
|
||||
---@param delimiter string
|
||||
---@return string[]
|
||||
function string_split(text, delimiter) end
|
||||
|
||||
---@param items string[]
|
||||
---@param delimiter string
|
||||
---@return string
|
||||
function string_join(items, delimiter) end
|
||||
|
||||
---@param text string
|
||||
---@param old string
|
||||
---@param new string
|
||||
---@return string
|
||||
function string_replace(text, old, new) end
|
||||
|
||||
---@param text string
|
||||
---@param pattern string
|
||||
---@return string?
|
||||
function string_match(text, pattern) end
|
||||
|
||||
---@param text string
|
||||
---@param pattern string
|
||||
---@return string[]
|
||||
function string_match_all(text, pattern) end
|
||||
|
||||
89
.vscode/settings.json
vendored
89
.vscode/settings.json
vendored
@@ -1,27 +1,66 @@
|
||||
{
|
||||
"Lua.diagnostics.globals": [
|
||||
"read_file",
|
||||
"write_file",
|
||||
"read_html",
|
||||
"write_html",
|
||||
"list_html_files",
|
||||
"read_markdown",
|
||||
"write_markdown",
|
||||
"list_markdown_files",
|
||||
"html_find_tag",
|
||||
"html_replace_tag",
|
||||
"html_insert_before",
|
||||
"html_insert_after",
|
||||
"html_wrap_content",
|
||||
"md_add_header",
|
||||
"md_replace_section",
|
||||
"md_append_content",
|
||||
"table_to_json",
|
||||
"json_to_table",
|
||||
"add_route",
|
||||
"register_hook",
|
||||
"log",
|
||||
"log_warn",
|
||||
"log_error"
|
||||
]
|
||||
// Lua Language Server settings
|
||||
"Lua.runtime.version": "Lua 5.4",
|
||||
"Lua.workspace.checkThirdParty": false,
|
||||
"Lua.workspace.library": [
|
||||
"./.vscode"
|
||||
],
|
||||
"Lua.hint.enable": true,
|
||||
"Lua.completion.callSnippet": "Both",
|
||||
"Lua.completion.autoRequire": false,
|
||||
|
||||
// Diagnostics: treat these globals as known
|
||||
"Lua.diagnostics.globals": [
|
||||
"add_route",
|
||||
"add_get_route",
|
||||
"add_post_route",
|
||||
"register_hook",
|
||||
"list_html_files",
|
||||
"list_markdown_files",
|
||||
"write_markdown",
|
||||
"html_add_class",
|
||||
"html_add_attribute",
|
||||
"html_insert_before",
|
||||
"html_insert_after",
|
||||
"html_wrap_content",
|
||||
"html_remove_tag",
|
||||
"md_add_header",
|
||||
"md_replace_section",
|
||||
"md_append_content",
|
||||
"md_prepend_content",
|
||||
"md_insert_at_position",
|
||||
"md_find_section",
|
||||
"md_remove_section",
|
||||
"md_add_list_item",
|
||||
"md_wrap_code_block",
|
||||
"table_to_json",
|
||||
"json_to_table",
|
||||
"json_parse",
|
||||
"json_stringify",
|
||||
"string_split",
|
||||
"string_join",
|
||||
"string_replace",
|
||||
"string_match",
|
||||
"string_match_all",
|
||||
"file_exists",
|
||||
"file_size",
|
||||
"list_directory",
|
||||
"log"
|
||||
],
|
||||
|
||||
// Formatting
|
||||
"Lua.format.enable": true,
|
||||
"Lua.format.defaultConfig": {
|
||||
"indent_style": "space",
|
||||
"indent_size": "2"
|
||||
},
|
||||
|
||||
// Disable warnings about lowercase globals
|
||||
"Lua.diagnostics.disable": [
|
||||
"lowercase-global"
|
||||
],
|
||||
|
||||
// Optional
|
||||
"Lua.telemetry.enable": false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user