pub fn register(
lua: &Lua,
project_root: &Path,
sandbox: bool,
tracker: SharedTracker,
global_password: Option<String>,
asset_manifest: AssetManifest,
) -> 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.rss_date, rs.html_to_text, etc.
- Markdown: rs.markdown.render, rs.markdown.plugins
- Images: rs.image_dimensions, rs.image_resize, rs.image_convert, rs.image_optimize
- JS: rs.js.concat, rs.js.bundle
- CSS: rs.css.concat, rs.css.bundle
- Fonts: rs.fonts.download_google_font
- Assets: rs.assets.hash, rs.assets.write_hashed, rs.assets.get_path
- PWA: rs.pwa.manifest, rs.pwa.service_worker
- SEO: rs.seo.sitemap, rs.seo.robots
- 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