diff --git a/README.md b/README.md
index 77d4fd4..9ce6f59 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,10 @@
-## World Config mod for Minetest
+## World Data Manager library for Minetest
### Description:
A [Minetest][] library for managing data files in the world directory.
-It takes a little work to read from & write to data in the world directory. wconfig aims to make that easier by utilizing just two simple methods.
+It takes a little work to read from & write to data in the world directory. `wdata` aims to make that easier by utilizing just two simple methods.
### Licensing:
@@ -15,10 +15,10 @@ It takes a little work to read from & write to data in the world directory. wcon
There are two methods:
```
-- wconfig.read(fname)
+- wdata.read(fname)
- reads json data from file in world directory & converts to a table.
- fname: File basename without suffix (e.g. "my_config" or "my_mod/my_config").
-- wconfig.write(fname, data[, styled])
+- wdata.write(fname, data[, styled])
- converts table to json data & writes to file in world directory.
- fname: File basename without suffix (e.g. "my_config" or "my_mod/my_config").
- data: Table containing data to be exported.
@@ -35,8 +35,8 @@ Optional depends: none
### Links
- [Forum](https://forum.minetest.net/viewtopic.php?t=26804)
-- [Git repo](https://github.com/AntumMT/mod-wconfig)
-- [API](https://antummt.github.io/mod-wconfig/docs/api.html)
+- [Git repo](https://github.com/AntumMT/mod-wdata)
+- [API](https://antummt.github.io/mod-wdata/docs/api.html)
- [Changelog](changelog.txt)
- [TODO](TODO.txt)
diff --git a/api.lua b/api.lua
index 6c718d9..414f11f 100644
--- a/api.lua
+++ b/api.lua
@@ -1,5 +1,5 @@
---- wconfig API
+--- World Data Manager API
--
-- @module api.lua
@@ -29,16 +29,16 @@ end
--- Reads config file from world directory.
--
--- @function wconfig.read
+-- @function wdata.read
-- @tparam string fname Base filename with optional directory structure (e.g. "my_mod/my_config")
-- @treturn table Table with contents read from json file or `nil`.
-function wconfig.read(fname)
+function wdata.read(fname)
local fpath = world_path .. "/" .. fname .. ".json"
-- check if file exists
local fopen = io.open(fpath, "r")
if not fopen then
- wconfig.log("error", "file not found: " .. fpath)
+ wdata.log("error", "file not found: " .. fpath)
return
end
@@ -46,7 +46,7 @@ function wconfig.read(fname)
io.close(fopen)
if not table_data then
- wconfig.log("error", "cannot read json data from file: " .. fpath)
+ wdata.log("error", "cannot read json data from file: " .. fpath)
return
end
@@ -56,17 +56,17 @@ end
--- Writes to config file in world directory.
--
--- @function wconfig.write
+-- @function wdata.write
-- @tparam string fname Base filename with optional directory structure (e.g. "my_mod/my_config").
-- @tparam table data Table data to be written to config file.
-- @tparam[opt] bool styled Outputs in a human-readable format if this is set (default: `true`).
-- @treturn bool `true` if succeeded, `false` if not.
-function wconfig.write(fname, data, styled)
+function wdata.write(fname, data, styled)
styled = styled ~= false
local json_data = core.write_json(data, styled)
if not json_data then
- wconfig.log("error", "cannot convert data to json format")
+ wdata.log("error", "cannot convert data to json format")
return false
end
@@ -76,7 +76,7 @@ function wconfig.write(fname, data, styled)
local dirname = get_dir(fpath)
if dirname ~= world_path then
if not core.mkdir(dirname) then
- wconfig.log("error", "cannot create directory: " .. dirname)
+ wdata.log("error", "cannot create directory: " .. dirname)
return false
end
end
@@ -89,16 +89,16 @@ end
--
-- @section aliases
---- Alias of `wconfig.read`.
+--- Alias of `wdata.read`.
--
-- @falias minetest.read_world_config
if not core.read_world_config then
- core.read_world_config = wconfig.read
+ core.read_world_config = wdata.read
end
---- Alias of `wconfig.write`.
+--- Alias of `wdata.write`.
--
-- @falias minetest.write_world_config
if not core.write_world_config then
- core.write_world_config = wconfig.write
+ core.write_world_config = wdata.write
end
diff --git a/docs/api.html b/docs/api.html
index 6b876ac..fde8a7e 100644
--- a/docs/api.html
+++ b/docs/api.html
@@ -3,7 +3,7 @@
- World Config
+ World Data Manager
@@ -24,7 +24,7 @@