pub fn register(
lua: &Lua,
project_root: &Path,
sandbox: bool,
tracker: SharedTracker,
global_password: Option<String>,
) -> Result<()>Expand description
Register all Lua functions as a require-able module
This function registers the rs-web module so it can be used with:
local rs = require("rs-web")The module provides:
- File operations: rs.read_file, rs.write_file, rs.load_json, etc.
- Search: rs.glob, rs.scan
- Collections: rs.filter, rs.sort, rs.map
- Text: rs.slugify, rs.word_count, rs.reading_time
- Environment: rs.env, rs.print, rs.is_gitignored
- Git: rs.git_info
- Content: rs.render_markdown, rs.rss_date, rs.html_to_text, etc.
- Images: rs.image_dimensions, rs.image_resize, rs.image_convert, rs.image_optimize
- Assets: rs.build_css
- Coroutines: rs.coro.task, rs.coro.await, rs.coro.yield, etc.
- Parallel (rayon): rs.parallel.load_json, rs.parallel.read_files, etc.
- Async I/O (tokio): rs.async.fetch, rs.async.read_file, rs.async.write_file, etc.
- Encryption: rs.crypt.encrypt, rs.crypt.decrypt, rs.crypt.encrypt_html