diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 648440e..0edfac3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,11 +8,13 @@ jobs: - name: Install lua run: | sudo apt-get update -qq && - sudo apt-get install -qq --no-install-recommends lua5.3 lua-busted lua-check + sudo apt-get install -qq --no-install-recommends lua5.3 lua-busted lua-check luarocks - name: Check lua files run: bin/check-lua-scripts.sh - name: Run tests env: LUA_PATH: "lua/?.lua;;" run: bin/run-tests.sh + - name: Validate rockspec + run: luarocks make osm2pgsql-themepark-scm-1.rockspec --local diff --git a/lua/themepark.lua b/lua/themepark.lua index 2465090..bcee289 100644 --- a/lua/themepark.lua +++ b/lua/themepark.lua @@ -26,27 +26,10 @@ -- -- --------------------------------------------------------------------------- -local function script_dir_impl(num) - local src = debug.getinfo(num, "S").source - return src:match("^@(.*/)") -- return directory -end - --- Return the directory of the script calling this function directly or --- indirectly. Goes 'num' levels up the call stack, and returns the directory --- of the script running the function found in that way. Returns the current --- directory ('./') if that fails. -local function script_dir(num) - local success, value = pcall(script_dir_impl, num) - if success and value then - return value - end - return './' -end - local themepark = { _columns = {}, + _custom_theme_dirs = {}, debug = false, - dir = script_dir(1), layers = {}, options = { schema = 'public', @@ -72,7 +55,6 @@ local themepark = { gen = {} }, tables = {}, - theme_search_path = {}, themes = {}, } @@ -80,20 +62,17 @@ if os.getenv('THEMEPARK_DEBUG') then themepark.debug = true end +-- Populate custom theme dirs from THEMEPARK_PATH env variable if set. +-- Built-in themes are found via require(); this path is only for user-defined themes. (function() - -- Use search path from THEMEPARK_PATH env variable if available - local search_path_from_env = os.getenv('THEMEPARK_PATH') - if search_path_from_env then - themepark.theme_search_path = osm2pgsql.split_string(search_path_from_env, ':') - end - - -- Theme search path always contains the 'themes' directory in the - -- themepark repo. - local themes_dir = themepark.dir:gsub('/lua/$', '/themes') - table.insert(themepark.theme_search_path, themes_dir) - - if themepark.debug then - print("Themepark: Theme search path: " .. table.concat(themepark.theme_search_path, ':')) + local path_from_env = os.getenv('THEMEPARK_PATH') + if path_from_env then + for _, dir in ipairs(osm2pgsql.split_string(path_from_env, ':')) do + table.insert(themepark._custom_theme_dirs, dir) + end + if themepark.debug then + print("Themepark: Custom theme dirs from THEMEPARK_PATH: " .. path_from_env) + end end end)() @@ -156,45 +135,58 @@ end -- --------------------------------------------------------------------------- -- add_theme_dir(DIR) -- --- Prepend DIR to search path for themes. If DIR is a relative path, --- interpret it relative to the file the function was called from. +-- Prepend DIR to the custom theme search path for user-defined themes. +-- If DIR is a relative path, interpret it relative to the calling script. -- --------------------------------------------------------------------------- function themepark:add_theme_dir(dir) if string.find(dir, '/') ~= 1 then - dir = script_dir(5) .. dir + -- Resolve relative path against the caller's script directory + local src = debug.getinfo(2, "S").source + local caller_dir = src:match("^@(.*/)") or './' + dir = caller_dir .. dir end - table.insert(self.theme_search_path, 1, dir) + table.insert(self._custom_theme_dirs, 1, dir) if self.debug then - print("Themepark: Added theme directory at '" .. dir .. "'.") - print("Themepark: Theme search path: " .. table.concat(themepark.theme_search_path, ':')) + print("Themepark: Added custom theme directory at '" .. dir .. "'.") end end -- --------------------------------------------------------------------------- -- init_theme(THEME) -- --- Initialize THEME. Uses the theme search path. Returns the theme. +-- Initialize THEME. Returns the theme table. +-- Built-in themes are loaded via require(); custom themes via file-system scan. -- -- If the theme has already been initialized by an earlier call to this -- function, the existing theme is returned. -- --------------------------------------------------------------------------- -function themepark:init_theme(theme) - if self.themes[theme] then - return self.themes[theme] +function themepark:init_theme(theme_name) + if self.themes[theme_name] then + return self.themes[theme_name] end - if not theme then + if not theme_name then error('Missing theme argument to init_theme()') end if self.debug then - print("Themepark: Loading theme '" .. theme .. "' ...") + print("Themepark: Loading theme '" .. theme_name .. "' ...") + end + + -- 1. Try require() — works for built-in and LuaRocks-installed themes + local ok, result = pcall(require, 'themepark/themes/' .. theme_name) + if ok then + self.themes[theme_name] = result(self) + if self.debug then + print("Themepark: Loading theme '" .. theme_name .. "' done (via require).") + end + return self.themes[theme_name] end - for _, dir in ipairs(self.theme_search_path) do - local theme_dir = dir .. '/' .. theme - local theme_file = theme_dir .. '/init.lua' + -- 2. File-system fallback for custom themes via add_theme_dir() / THEMEPARK_PATH + for _, dir in ipairs(self._custom_theme_dirs) do + local theme_file = dir .. '/' .. theme_name .. '/init.lua' if self.debug then print("Themepark: Trying to load from '" .. theme_file .. "' ...") end @@ -208,21 +200,15 @@ function themepark:init_theme(theme) error('Loading ' .. theme_file .. ' failed: ' .. msg) end - self.themes[theme] = func(self) - self.themes[theme].dir = theme_dir - break + self.themes[theme_name] = func(self) + if self.debug then + print("Themepark: Loading theme '" .. theme_name .. "' done (via filesystem).") + end + return self.themes[theme_name] end end - if not self.themes[theme] then - error("Themepark: Theme '" .. theme .. "' not found") - end - - if self.debug then - print("Themepark: Loading theme '" .. theme .. "' done.") - end - - return self.themes[theme] + error("Themepark: Theme '" .. theme_name .. "' not found") end -- --------------------------------------------------------------------------- @@ -250,32 +236,47 @@ function themepark:add_topic(topic, options) print("Themepark: Adding topic '" .. topic .. "' from theme '" .. theme_name .. "' ...") end - local filename = theme.dir .. '/topics/' .. topic .. '.lua' - - local file, errmsg = io.open(filename, 'r') - if not file then - error("No topic '" .. topic .. "' in theme '" .. theme_name .. "'") + -- 1. Try require() — works for built-in and LuaRocks-installed topics + local module = 'themepark/themes/' .. theme_name .. '/topics/' .. topic + local ok, topic_func = pcall(require, module) + if ok then + local status, result = pcall(topic_func, self, theme, options or {}) + if not status then + print("Themepark: Adding topic '" .. topic .. "' from theme '" .. theme_name .. "' failed:") + error(result, 2) + end + if self.debug then + print("Themepark: Adding topic '" .. topic .. "' from theme '" .. theme_name .. "' done.") + end + return result end - local script = file:read('*a') - file:close() - - local func, msg = load(script, filename, 't') - if not func then - error('Load failed: ' .. msg) - end + -- 2. File-system fallback for custom themes + for _, dir in ipairs(self._custom_theme_dirs) do + local filename = dir .. '/' .. theme_name .. '/topics/' .. topic .. '.lua' + local file = io.open(filename, 'r') + if file then + local script = file:read('*a') + file:close() - local status, result = pcall(func, self, theme, options or {}) - if not status then - print("Themepark: Adding topic '" .. topic .. "' from theme '" .. theme_name .. "' failed:") - error(result, 2) - end + local func, msg = load(script, filename, 't') + if not func then + error('Load failed: ' .. msg) + end - if self.debug then - print("Themepark: Adding topic '" .. topic .. "' from theme '" .. theme_name .. "' done.") + local status, result = pcall(func, self, theme, options or {}) + if not status then + print("Themepark: Adding topic '" .. topic .. "' from theme '" .. theme_name .. "' failed:") + error(result, 2) + end + if self.debug then + print("Themepark: Adding topic '" .. topic .. "' from theme '" .. theme_name .. "' done.") + end + return result + end end - return result + error("No topic '" .. topic .. "' in theme '" .. theme_name .. "'") end -- --------------------------------------------------------------------------- @@ -471,7 +472,7 @@ end -- --------------------------------------------------------------------------- function themepark:plugin(name) self:init_layer_groups() - local ts = require('themepark/plugins/' .. name, self) + local ts = require('themepark/plugins/' .. name) ts.themepark = self return ts end diff --git a/lua/themepark/plugins/t-rex.lua b/lua/themepark/plugins/t-rex.lua index fc6cfe1..daa0911 100644 --- a/lua/themepark/plugins/t-rex.lua +++ b/lua/themepark/plugins/t-rex.lua @@ -29,7 +29,14 @@ local plugin = {} local utils = require 'themepark/utils' -local toml = require 'toml' + +local function load_toml() + local ok, lib = pcall(require, 'toml') + if not ok then + error("The t-rex plugin requires the 'lua-toml' package.\nInstall it with: luarocks install lua-toml", 2) + end + return lib +end local min_max_zoom_columns = function(columns) local column_names = {} @@ -214,6 +221,7 @@ function plugin:write_config(filename, options) config.tileset[0].extent = plugin.themepark.options.extent end + local toml = load_toml() utils.write_to_file(filename, toml.encode(config) .. "\n") end diff --git a/lua/themepark/plugins/taginfo.lua b/lua/themepark/plugins/taginfo.lua index a2b0eb4..ef78e25 100644 --- a/lua/themepark/plugins/taginfo.lua +++ b/lua/themepark/plugins/taginfo.lua @@ -29,7 +29,14 @@ local plugin = {} local utils = require 'themepark/utils' -local json = require 'json' + +local function load_json() + local ok, lib = pcall(require, 'json') + if not ok then + error("The taginfo plugin requires the 'lua-json' package.\nInstall it with: luarocks install lua-json", 2) + end + return lib +end local function convert_on_to_types(on) if not on then @@ -90,10 +97,6 @@ function plugin:append_layer_config(layer, tags) end end -local comp_all = function(a, b) - return json.encode(a) < json.encode(b) -end - local comp_key_value = function(a, b) if a.key == b.key then return (a.value or '') < (b.value or '') @@ -102,6 +105,8 @@ local comp_key_value = function(a, b) end function plugin:write_config(filename, options) + local json = load_json() + if not options then options = {} end @@ -116,6 +121,10 @@ function plugin:write_config(filename, options) self:append_layer_config(layer, tags) end + local comp_all = function(a, b) + return json.encode(a) < json.encode(b) + end + table.sort(tags, comp_all) config.tags = {} diff --git a/lua/themepark/plugins/tilekiln.lua b/lua/themepark/plugins/tilekiln.lua index 9892f32..d827a40 100644 --- a/lua/themepark/plugins/tilekiln.lua +++ b/lua/themepark/plugins/tilekiln.lua @@ -29,7 +29,14 @@ local plugin = {} local utils = require 'themepark/utils' -local lyaml = require 'lyaml' + +local function load_lyaml() + local ok, lib = pcall(require, 'lyaml') + if not ok then + error("The tilekiln plugin requires the 'lyaml' package.\nInstall it with: luarocks install lyaml", 2) + end + return lib +end function plugin:build_sublayer_config(main_layer, sub_layer) local config = { @@ -125,6 +132,7 @@ function plugin:write_config(directory, options) end end + local lyaml = load_lyaml() utils.write_to_file(self.directory .. '/config.yaml', lyaml.dump({ config })) end diff --git a/themes/basic/README.md b/lua/themepark/themes/basic/README.md similarity index 100% rename from themes/basic/README.md rename to lua/themepark/themes/basic/README.md diff --git a/themes/basic/init.lua b/lua/themepark/themes/basic/init.lua similarity index 98% rename from themes/basic/init.lua rename to lua/themepark/themes/basic/init.lua index 70511b2..14b400c 100644 --- a/themes/basic/init.lua +++ b/lua/themepark/themes/basic/init.lua @@ -4,6 +4,7 @@ -- -- --------------------------------------------------------------------------- +return function(themepark) local theme = {} local function init_polygon_lookup() @@ -120,6 +121,7 @@ function theme.has_area_tags(tags) end end -return theme + return theme +end -- --------------------------------------------------------------------------- diff --git a/themes/basic/topics/generic-boundaries.lua b/lua/themepark/themes/basic/topics/generic-boundaries.lua similarity index 95% rename from themes/basic/topics/generic-boundaries.lua rename to lua/themepark/themes/basic/topics/generic-boundaries.lua index e402be2..3880092 100644 --- a/themes/basic/topics/generic-boundaries.lua +++ b/lua/themepark/themes/basic/topics/generic-boundaries.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'boundaries', @@ -30,4 +30,6 @@ themepark:add_proc('relation', function(object) end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/basic/topics/generic-lines.lua b/lua/themepark/themes/basic/topics/generic-lines.lua similarity index 95% rename from themes/basic/topics/generic-lines.lua rename to lua/themepark/themes/basic/topics/generic-lines.lua index dd57fdf..668adfe 100644 --- a/themes/basic/topics/generic-lines.lua +++ b/lua/themepark/themes/basic/topics/generic-lines.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'lines', @@ -30,4 +30,6 @@ themepark:add_proc('way', function(object) end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/basic/topics/generic-points.lua b/lua/themepark/themes/basic/topics/generic-points.lua similarity index 94% rename from themes/basic/topics/generic-points.lua rename to lua/themepark/themes/basic/topics/generic-points.lua index cdd3b0f..8e4d8a2 100644 --- a/themes/basic/topics/generic-points.lua +++ b/lua/themepark/themes/basic/topics/generic-points.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'points', @@ -28,4 +28,6 @@ themepark:add_proc('node', function(object) }) end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/basic/topics/generic-polygons.lua b/lua/themepark/themes/basic/topics/generic-polygons.lua similarity index 96% rename from themes/basic/topics/generic-polygons.lua rename to lua/themepark/themes/basic/topics/generic-polygons.lua index ee75074..ec3a8eb 100644 --- a/themes/basic/topics/generic-polygons.lua +++ b/lua/themepark/themes/basic/topics/generic-polygons.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'polygons', @@ -39,4 +39,6 @@ themepark:add_proc('relation', function(object) end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/basic/topics/generic-routes.lua b/lua/themepark/themes/basic/topics/generic-routes.lua similarity index 95% rename from themes/basic/topics/generic-routes.lua rename to lua/themepark/themes/basic/topics/generic-routes.lua index fa53dab..329039e 100644 --- a/themes/basic/topics/generic-routes.lua +++ b/lua/themepark/themes/basic/topics/generic-routes.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'routes', @@ -30,4 +30,6 @@ themepark:add_proc('relation', function(object) end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/basic/topics/nwr.lua b/lua/themepark/themes/basic/topics/nwr.lua similarity index 97% rename from themes/basic/topics/nwr.lua rename to lua/themepark/themes/basic/topics/nwr.lua index d9860bd..58ad450 100644 --- a/themes/basic/topics/nwr.lua +++ b/lua/themepark/themes/basic/topics/nwr.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'nodes', @@ -70,4 +70,6 @@ themepark:add_proc('relation', function(object) }) end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/core/README.md b/lua/themepark/themes/core/README.md similarity index 100% rename from themes/core/README.md rename to lua/themepark/themes/core/README.md diff --git a/themes/core/init.lua b/lua/themepark/themes/core/init.lua similarity index 79% rename from themes/core/init.lua rename to lua/themepark/themes/core/init.lua index 994865d..3566f24 100644 --- a/themes/core/init.lua +++ b/lua/themepark/themes/core/init.lua @@ -4,8 +4,10 @@ -- -- --------------------------------------------------------------------------- -local theme = {} +return function(themepark) + local theme = {} -return theme + return theme +end -- --------------------------------------------------------------------------- diff --git a/themes/core/topics/clean-tags.lua b/lua/themepark/themes/core/topics/clean-tags.lua similarity index 98% rename from themes/core/topics/clean-tags.lua rename to lua/themepark/themes/core/topics/clean-tags.lua index 2462b56..d6df809 100644 --- a/themes/core/topics/clean-tags.lua +++ b/lua/themepark/themes/core/topics/clean-tags.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) -- These tag keys are generally regarded as useless for most rendering. Most -- of them are from imports or intended as internal information for mappers. @@ -162,4 +162,6 @@ themepark:add_proc('node', process) themepark:add_proc('way', process) themepark:add_proc('relation', process) +end + -- --------------------------------------------------------------------------- diff --git a/themes/core/topics/elevation.lua b/lua/themepark/themes/core/topics/elevation.lua similarity index 96% rename from themes/core/topics/elevation.lua rename to lua/themepark/themes/core/topics/elevation.lua index 1de8e6b..1b31c86 100644 --- a/themes/core/topics/elevation.lua +++ b/lua/themepark/themes/core/topics/elevation.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) local feet_per_meter = 3.2808399 @@ -45,4 +45,6 @@ themepark:add_proc('node', process) themepark:add_proc('way', process) themepark:add_proc('relation', process) +end + -- --------------------------------------------------------------------------- diff --git a/themes/core/topics/layer.lua b/lua/themepark/themes/core/topics/layer.lua similarity index 94% rename from themes/core/topics/layer.lua rename to lua/themepark/themes/core/topics/layer.lua index 12e8a94..0238167 100644 --- a/themes/core/topics/layer.lua +++ b/lua/themepark/themes/core/topics/layer.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) local function process(object, data) if not data.core then @@ -31,4 +31,6 @@ themepark:add_proc('node', process) themepark:add_proc('way', process) themepark:add_proc('relation', process) +end + -- --------------------------------------------------------------------------- diff --git a/themes/core/topics/name-all.lua b/lua/themepark/themes/core/topics/name-all.lua similarity index 97% rename from themes/core/topics/name-all.lua rename to lua/themepark/themes/core/topics/name-all.lua index 0c33b54..4f8d8e2 100644 --- a/themes/core/topics/name-all.lua +++ b/lua/themepark/themes/core/topics/name-all.lua @@ -15,7 +15,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) local name_column = cfg.column or 'name' @@ -56,4 +56,6 @@ function theme.add_name(attrs, object) return false end +end + -- --------------------------------------------------------------------------- diff --git a/themes/core/topics/name-list.lua b/lua/themepark/themes/core/topics/name-list.lua similarity index 96% rename from themes/core/topics/name-list.lua rename to lua/themepark/themes/core/topics/name-list.lua index 4680cc6..f1a9321 100644 --- a/themes/core/topics/name-list.lua +++ b/lua/themepark/themes/core/topics/name-list.lua @@ -12,7 +12,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) local name_keys = cfg.keys or {"name"} local name_columns = {} @@ -43,4 +43,6 @@ function theme.add_name(attrs, object) return has_name end +end + -- --------------------------------------------------------------------------- diff --git a/themes/core/topics/name-single.lua b/lua/themepark/themes/core/topics/name-single.lua similarity index 94% rename from themes/core/topics/name-single.lua rename to lua/themepark/themes/core/topics/name-single.lua index 58451db..af58926 100644 --- a/themes/core/topics/name-single.lua +++ b/lua/themepark/themes/core/topics/name-single.lua @@ -9,7 +9,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) local name_tag = cfg.key or 'name' local name_column = cfg.column or 'name' @@ -27,4 +27,6 @@ function theme.add_name(attrs, object) return false end +end + -- --------------------------------------------------------------------------- diff --git a/themes/core/topics/name-with-fallback.lua b/lua/themepark/themes/core/topics/name-with-fallback.lua similarity index 95% rename from themes/core/topics/name-with-fallback.lua rename to lua/themepark/themes/core/topics/name-with-fallback.lua index bc3b80c..20c1022 100644 --- a/themes/core/topics/name-with-fallback.lua +++ b/lua/themepark/themes/core/topics/name-with-fallback.lua @@ -8,7 +8,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) local name_keys = cfg.keys or { name = { 'name' } } local name_columns = {} @@ -46,4 +46,6 @@ function theme.add_name(attrs, object) return has_name end +end + -- --------------------------------------------------------------------------- diff --git a/themes/experimental/README.md b/lua/themepark/themes/experimental/README.md similarity index 100% rename from themes/experimental/README.md rename to lua/themepark/themes/experimental/README.md diff --git a/themes/experimental/init.lua b/lua/themepark/themes/experimental/init.lua similarity index 79% rename from themes/experimental/init.lua rename to lua/themepark/themes/experimental/init.lua index 46a70d8..ed40b00 100644 --- a/themes/experimental/init.lua +++ b/lua/themepark/themes/experimental/init.lua @@ -4,8 +4,10 @@ -- -- --------------------------------------------------------------------------- -local theme = {} +return function(themepark) + local theme = {} -return theme + return theme +end -- --------------------------------------------------------------------------- diff --git a/themes/experimental/topics/builtup.lua b/lua/themepark/themes/experimental/topics/builtup.lua similarity index 98% rename from themes/experimental/topics/builtup.lua rename to lua/themepark/themes/experimental/topics/builtup.lua index e77e48b..3953135 100644 --- a/themes/experimental/topics/builtup.lua +++ b/lua/themepark/themes/experimental/topics/builtup.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'builtup_src', @@ -109,4 +109,6 @@ themepark:add_proc('gen', function(data) }) end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/experimental/topics/highways.lua b/lua/themepark/themes/experimental/topics/highways.lua similarity index 98% rename from themes/experimental/topics/highways.lua rename to lua/themepark/themes/experimental/topics/highways.lua index 2fa09d2..568a686 100644 --- a/themes/experimental/topics/highways.lua +++ b/lua/themepark/themes/experimental/topics/highways.lua @@ -7,7 +7,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table({ name = 'highways', @@ -66,4 +66,6 @@ themepark:add_proc('way', function(object, data) end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/experimental/topics/information.lua b/lua/themepark/themes/experimental/topics/information.lua similarity index 95% rename from themes/experimental/topics/information.lua rename to lua/themepark/themes/experimental/topics/information.lua index b381e12..9d3d49e 100644 --- a/themes/experimental/topics/information.lua +++ b/lua/themepark/themes/experimental/topics/information.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'information', @@ -36,4 +36,6 @@ themepark:add_proc('node', function(object, data) end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/experimental/topics/places.lua b/lua/themepark/themes/experimental/topics/places.lua similarity index 98% rename from themes/experimental/topics/places.lua rename to lua/themepark/themes/experimental/topics/places.lua index 4a81ce2..62cbe73 100644 --- a/themes/experimental/topics/places.lua +++ b/lua/themepark/themes/experimental/topics/places.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'place_labels', @@ -119,4 +119,6 @@ UPDATE place_labels p SET importance = coalesce( end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/experimental/topics/power.lua b/lua/themepark/themes/experimental/topics/power.lua similarity index 98% rename from themes/experimental/topics/power.lua rename to lua/themepark/themes/experimental/topics/power.lua index 2e7130e..178910f 100644 --- a/themes/experimental/topics/power.lua +++ b/lua/themepark/themes/experimental/topics/power.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'generators', @@ -90,4 +90,4 @@ themepark:add_proc('area', function(object, data) themepark:insert('powerplants', a, object.tags) end end) - +end diff --git a/themes/experimental/topics/rivers.lua b/lua/themepark/themes/experimental/topics/rivers.lua similarity index 95% rename from themes/experimental/topics/rivers.lua rename to lua/themepark/themes/experimental/topics/rivers.lua index 680a570..0ff7024 100644 --- a/themes/experimental/topics/rivers.lua +++ b/lua/themepark/themes/experimental/topics/rivers.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'rivers', @@ -41,4 +41,6 @@ themepark:add_proc('relation', function(object, data) themepark:insert('rivers', a, t) end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/experimental/topics/viewpoints.lua b/lua/themepark/themes/experimental/topics/viewpoints.lua similarity index 98% rename from themes/experimental/topics/viewpoints.lua rename to lua/themepark/themes/experimental/topics/viewpoints.lua index 18d1f95..a548c03 100644 --- a/themes/experimental/topics/viewpoints.lua +++ b/lua/themepark/themes/experimental/topics/viewpoints.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'viewpoints', @@ -82,4 +82,6 @@ themepark:add_proc('node', function(object, data) end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/external/init.lua b/lua/themepark/themes/external/init.lua similarity index 79% rename from themes/external/init.lua rename to lua/themepark/themes/external/init.lua index 93d4b75..59f63e8 100644 --- a/themes/external/init.lua +++ b/lua/themepark/themes/external/init.lua @@ -4,8 +4,10 @@ -- -- --------------------------------------------------------------------------- -local theme = {} +return function(themepark) + local theme = {} -return theme + return theme +end -- --------------------------------------------------------------------------- diff --git a/themes/external/topics/coastlines.lua b/lua/themepark/themes/external/topics/coastlines.lua similarity index 92% rename from themes/external/topics/coastlines.lua rename to lua/themepark/themes/external/topics/coastlines.lua index d595596..8766a4b 100644 --- a/themes/external/topics/coastlines.lua +++ b/lua/themepark/themes/external/topics/coastlines.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) local name = cfg.name or 'coastlines' @@ -19,4 +19,6 @@ themepark:add_table{ tags = tags, } +end + -- --------------------------------------------------------------------------- diff --git a/themes/external/topics/continents.lua b/lua/themepark/themes/external/topics/continents.lua similarity index 94% rename from themes/external/topics/continents.lua rename to lua/themepark/themes/external/topics/continents.lua index ce4ffed..81eb2c2 100644 --- a/themes/external/topics/continents.lua +++ b/lua/themepark/themes/external/topics/continents.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) local name = cfg.name or 'continents' @@ -35,4 +35,6 @@ themepark:add_table{ } } +end + -- --------------------------------------------------------------------------- diff --git a/themes/external/topics/oceans.lua b/lua/themepark/themes/external/topics/oceans.lua similarity index 94% rename from themes/external/topics/oceans.lua rename to lua/themepark/themes/external/topics/oceans.lua index 6eef6b1..290f187 100644 --- a/themes/external/topics/oceans.lua +++ b/lua/themepark/themes/external/topics/oceans.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) local name = cfg.name or 'oceans' @@ -35,4 +35,6 @@ themepark:add_table{ } } +end + -- --------------------------------------------------------------------------- diff --git a/themes/osmcarto/README.md b/lua/themepark/themes/osmcarto/README.md similarity index 100% rename from themes/osmcarto/README.md rename to lua/themepark/themes/osmcarto/README.md diff --git a/themes/osmcarto/init.lua b/lua/themepark/themes/osmcarto/init.lua similarity index 79% rename from themes/osmcarto/init.lua rename to lua/themepark/themes/osmcarto/init.lua index 6b70322..1df5874 100644 --- a/themes/osmcarto/init.lua +++ b/lua/themepark/themes/osmcarto/init.lua @@ -4,8 +4,10 @@ -- -- --------------------------------------------------------------------------- -local theme = {} +return function(themepark) + local theme = {} -return theme + return theme +end -- --------------------------------------------------------------------------- diff --git a/themes/osmcarto/topics/osmcarto.lua b/lua/themepark/themes/osmcarto/topics/osmcarto.lua similarity index 99% rename from themes/osmcarto/topics/osmcarto.lua rename to lua/themepark/themes/osmcarto/topics/osmcarto.lua index 832cbe5..2f17c20 100644 --- a/themes/osmcarto/topics/osmcarto.lua +++ b/lua/themepark/themes/osmcarto/topics/osmcarto.lua @@ -23,7 +23,7 @@ local SCHEMA = 'public' -- --------------------------------------------------------------------------- -- Needed for use with the Themepark framework -local themepark = ... +return function(themepark, theme, cfg) -- --------------------------------------------------------------------------- @@ -687,3 +687,4 @@ else osm2pgsql.process_way = process_way osm2pgsql.process_relation = process_relation end +end diff --git a/themes/shortbread_v1/README.md b/lua/themepark/themes/shortbread_v1/README.md similarity index 100% rename from themes/shortbread_v1/README.md rename to lua/themepark/themes/shortbread_v1/README.md diff --git a/themes/shortbread_v1/init.lua b/lua/themepark/themes/shortbread_v1/init.lua similarity index 79% rename from themes/shortbread_v1/init.lua rename to lua/themepark/themes/shortbread_v1/init.lua index ad4fa15..d0cdf34 100644 --- a/themes/shortbread_v1/init.lua +++ b/lua/themepark/themes/shortbread_v1/init.lua @@ -4,8 +4,10 @@ -- -- --------------------------------------------------------------------------- -local theme = {} +return function(themepark) + local theme = {} -return theme + return theme +end -- --------------------------------------------------------------------------- diff --git a/themes/shortbread_v1/topics/addresses.lua b/lua/themepark/themes/shortbread_v1/topics/addresses.lua similarity index 98% rename from themes/shortbread_v1/topics/addresses.lua rename to lua/themepark/themes/shortbread_v1/topics/addresses.lua index 93eb9fb..bba88b1 100644 --- a/themes/shortbread_v1/topics/addresses.lua +++ b/lua/themepark/themes/shortbread_v1/topics/addresses.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'addresses', @@ -80,4 +80,6 @@ themepark:add_proc('relation', function(object, data) end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/shortbread_v1/topics/aerialways.lua b/lua/themepark/themes/shortbread_v1/topics/aerialways.lua similarity index 96% rename from themes/shortbread_v1/topics/aerialways.lua rename to lua/themepark/themes/shortbread_v1/topics/aerialways.lua index 76d737c..b19df96 100644 --- a/themes/shortbread_v1/topics/aerialways.lua +++ b/lua/themepark/themes/shortbread_v1/topics/aerialways.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) local aerialway_values = { 'cable_car', 'gondola', 'goods', 'chair_lift', 'drag_lift', 't-bar', 'j-bar', 'platter', 'rope_tow' } @@ -49,4 +49,6 @@ themepark:add_proc('way', function(object, data) end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/shortbread_v1/topics/boundaries.lua b/lua/themepark/themes/shortbread_v1/topics/boundaries.lua similarity index 98% rename from themes/shortbread_v1/topics/boundaries.lua rename to lua/themepark/themes/shortbread_v1/topics/boundaries.lua index 46bff10..6d99a3c 100644 --- a/themes/shortbread_v1/topics/boundaries.lua +++ b/lua/themepark/themes/shortbread_v1/topics/boundaries.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'boundaries', @@ -124,4 +124,6 @@ themepark:add_proc('relation', function(object, data) end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/shortbread_v1/topics/boundary_labels.lua b/lua/themepark/themes/shortbread_v1/topics/boundary_labels.lua similarity index 98% rename from themes/shortbread_v1/topics/boundary_labels.lua rename to lua/themepark/themes/shortbread_v1/topics/boundary_labels.lua index 691b87e..1a480dd 100644 --- a/themes/shortbread_v1/topics/boundary_labels.lua +++ b/lua/themepark/themes/shortbread_v1/topics/boundary_labels.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'boundary_labels', @@ -79,4 +79,6 @@ themepark:add_proc('relation', function(object, data) end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/shortbread_v1/topics/bridges.lua b/lua/themepark/themes/shortbread_v1/topics/bridges.lua similarity index 96% rename from themes/shortbread_v1/topics/bridges.lua rename to lua/themepark/themes/shortbread_v1/topics/bridges.lua index 08f412f..17723da 100644 --- a/themes/shortbread_v1/topics/bridges.lua +++ b/lua/themepark/themes/shortbread_v1/topics/bridges.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'bridges', @@ -41,4 +41,6 @@ themepark:add_proc('area', function(object, data) end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/shortbread_v1/topics/buildings.lua b/lua/themepark/themes/shortbread_v1/topics/buildings.lua similarity index 95% rename from themes/shortbread_v1/topics/buildings.lua rename to lua/themepark/themes/shortbread_v1/topics/buildings.lua index 01f4624..178901c 100644 --- a/themes/shortbread_v1/topics/buildings.lua +++ b/lua/themepark/themes/shortbread_v1/topics/buildings.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'buildings', @@ -35,4 +35,6 @@ themepark:add_proc('area', function(object, data) end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/shortbread_v1/topics/dams.lua b/lua/themepark/themes/shortbread_v1/topics/dams.lua similarity index 97% rename from themes/shortbread_v1/topics/dams.lua rename to lua/themepark/themes/shortbread_v1/topics/dams.lua index b06c2fe..235d3b3 100644 --- a/themes/shortbread_v1/topics/dams.lua +++ b/lua/themepark/themes/shortbread_v1/topics/dams.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'dam_lines', @@ -68,4 +68,6 @@ themepark:add_proc('area', function(object, data) end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/shortbread_v1/topics/ferries.lua b/lua/themepark/themes/shortbread_v1/topics/ferries.lua similarity index 96% rename from themes/shortbread_v1/topics/ferries.lua rename to lua/themepark/themes/shortbread_v1/topics/ferries.lua index bc716c8..bcecea4 100644 --- a/themes/shortbread_v1/topics/ferries.lua +++ b/lua/themepark/themes/shortbread_v1/topics/ferries.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'ferries', @@ -46,4 +46,6 @@ themepark:add_proc('way', function(object, data) end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/shortbread_v1/topics/land.lua b/lua/themepark/themes/shortbread_v1/topics/land.lua similarity index 98% rename from themes/shortbread_v1/topics/land.lua rename to lua/themepark/themes/shortbread_v1/topics/land.lua index 367fba3..2c95a89 100644 --- a/themes/shortbread_v1/topics/land.lua +++ b/lua/themepark/themes/shortbread_v1/topics/land.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) -- --------------------------------------------------------------------------- @@ -132,4 +132,6 @@ themepark:add_proc('area', function(object, data) end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/shortbread_v1/topics/piers.lua b/lua/themepark/themes/shortbread_v1/topics/piers.lua similarity index 97% rename from themes/shortbread_v1/topics/piers.lua rename to lua/themepark/themes/shortbread_v1/topics/piers.lua index 1954f4f..2b381c5 100644 --- a/themes/shortbread_v1/topics/piers.lua +++ b/lua/themepark/themes/shortbread_v1/topics/piers.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) local man_made_values = { 'pier', 'breakwater', 'groyne' } @@ -70,4 +70,6 @@ themepark:add_proc('area', function(object, data) end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/shortbread_v1/topics/places.lua b/lua/themepark/themes/shortbread_v1/topics/places.lua similarity index 98% rename from themes/shortbread_v1/topics/places.lua rename to lua/themepark/themes/shortbread_v1/topics/places.lua index 56c5f18..dcec30a 100644 --- a/themes/shortbread_v1/topics/places.lua +++ b/lua/themepark/themes/shortbread_v1/topics/places.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) -- --------------------------------------------------------------------------- @@ -88,4 +88,6 @@ themepark:add_proc('node', function(object, data) themepark:insert('place_labels', a, t) end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/shortbread_v1/topics/pois.lua b/lua/themepark/themes/shortbread_v1/topics/pois.lua similarity index 99% rename from themes/shortbread_v1/topics/pois.lua rename to lua/themepark/themes/shortbread_v1/topics/pois.lua index 7bfb81f..6305cc5 100644 --- a/themes/shortbread_v1/topics/pois.lua +++ b/lua/themepark/themes/shortbread_v1/topics/pois.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'pois', @@ -189,4 +189,6 @@ themepark:add_proc('area', function(object, data) end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/shortbread_v1/topics/public_transport.lua b/lua/themepark/themes/shortbread_v1/topics/public_transport.lua similarity index 98% rename from themes/shortbread_v1/topics/public_transport.lua rename to lua/themepark/themes/shortbread_v1/topics/public_transport.lua index bb38b11..7309e9d 100644 --- a/themes/shortbread_v1/topics/public_transport.lua +++ b/lua/themepark/themes/shortbread_v1/topics/public_transport.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'public_transport', @@ -99,4 +99,6 @@ themepark:add_proc('area', function(object, data) end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/shortbread_v1/topics/sites.lua b/lua/themepark/themes/shortbread_v1/topics/sites.lua similarity index 97% rename from themes/shortbread_v1/topics/sites.lua rename to lua/themepark/themes/shortbread_v1/topics/sites.lua index c3f816c..493ce18 100644 --- a/themes/shortbread_v1/topics/sites.lua +++ b/lua/themepark/themes/shortbread_v1/topics/sites.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) -- --------------------------------------------------------------------------- @@ -61,4 +61,6 @@ themepark:add_proc('area', function(object, data) themepark:insert('sites', a, t) end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/shortbread_v1/topics/streets.lua b/lua/themepark/themes/shortbread_v1/topics/streets.lua similarity index 98% rename from themes/shortbread_v1/topics/streets.lua rename to lua/themepark/themes/shortbread_v1/topics/streets.lua index 53af5e2..e7dd09d 100644 --- a/themes/shortbread_v1/topics/streets.lua +++ b/lua/themepark/themes/shortbread_v1/topics/streets.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'streets', @@ -236,8 +236,8 @@ local set_ref_attributes = function(a, t) local rows = 0 local cols = 0 - for word in string.gmatch(t.ref, "([^;]+);?") do - word = word:gsub('^[%s]+', '', 1):gsub('[%s]+$', '', 1) + for w in string.gmatch(t.ref, "([^;]+);?") do + local word = w:gsub('^[%s]+', '', 1):gsub('[%s]+$', '', 1) rows = rows + 1 cols = math.max(cols, string.len(word)) table.insert(refs, word) @@ -394,4 +394,6 @@ themepark:add_proc('way', function(object, data) end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/shortbread_v1/topics/water.lua b/lua/themepark/themes/shortbread_v1/topics/water.lua similarity index 99% rename from themes/shortbread_v1/topics/water.lua rename to lua/themepark/themes/shortbread_v1/topics/water.lua index 967f8cd..f9f4e72 100644 --- a/themes/shortbread_v1/topics/water.lua +++ b/lua/themepark/themes/shortbread_v1/topics/water.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) -- --------------------------------------------------------------------------- @@ -170,4 +170,6 @@ themepark:add_proc('area', function(object, data) end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/shortbread_v1_gen/README.md b/lua/themepark/themes/shortbread_v1_gen/README.md similarity index 100% rename from themes/shortbread_v1_gen/README.md rename to lua/themepark/themes/shortbread_v1_gen/README.md diff --git a/themes/shortbread_v1_gen/init.lua b/lua/themepark/themes/shortbread_v1_gen/init.lua similarity index 55% rename from themes/shortbread_v1_gen/init.lua rename to lua/themepark/themes/shortbread_v1_gen/init.lua index 0b31377..604025d 100644 --- a/themes/shortbread_v1_gen/init.lua +++ b/lua/themepark/themes/shortbread_v1_gen/init.lua @@ -4,11 +4,13 @@ -- -- --------------------------------------------------------------------------- -local theme = {} +return function(themepark) + local theme = {} -theme.full_gen = (osm2pgsql.mode == 'create') or (os.getenv('OSM2PGSQL_GEN') == 'full') -print("DEBUG: Doing full generalization: ", theme.full_gen) + theme.full_gen = (osm2pgsql.mode == 'create') or (os.getenv('OSM2PGSQL_GEN') == 'full') + print("DEBUG: Doing full generalization: ", theme.full_gen) -return theme + return theme +end -- --------------------------------------------------------------------------- diff --git a/themes/shortbread_v1_gen/topics/boundaries.lua b/lua/themepark/themes/shortbread_v1_gen/topics/boundaries.lua similarity index 99% rename from themes/shortbread_v1_gen/topics/boundaries.lua rename to lua/themepark/themes/shortbread_v1_gen/topics/boundaries.lua index e21abfb..7078a4f 100644 --- a/themes/shortbread_v1_gen/topics/boundaries.lua +++ b/lua/themepark/themes/shortbread_v1_gen/topics/boundaries.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) -- --------------------------------------------------------------------------- @@ -280,4 +280,6 @@ SELECT way_ids, relation_ids, admin_level, maritime, disputed, (ST_Dump(geom)).g }) end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/shortbread_v1_gen/topics/land.lua b/lua/themepark/themes/shortbread_v1_gen/topics/land.lua similarity index 99% rename from themes/shortbread_v1_gen/topics/land.lua rename to lua/themepark/themes/shortbread_v1_gen/topics/land.lua index 04778e9..d6d66a5 100644 --- a/themes/shortbread_v1_gen/topics/land.lua +++ b/lua/themepark/themes/shortbread_v1_gen/topics/land.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) -- --------------------------------------------------------------------------- @@ -186,4 +186,6 @@ themepark:add_proc('gen', function(data) end end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/shortbread_v1_gen/topics/streets.lua b/lua/themepark/themes/shortbread_v1_gen/topics/streets.lua similarity index 99% rename from themes/shortbread_v1_gen/topics/streets.lua rename to lua/themepark/themes/shortbread_v1_gen/topics/streets.lua index 2ffe098..2c5cf56 100644 --- a/themes/shortbread_v1_gen/topics/streets.lua +++ b/lua/themepark/themes/shortbread_v1_gen/topics/streets.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) themepark:add_table{ name = 'streets', @@ -273,8 +273,8 @@ local set_ref_attributes = function(a, t) local rows = 0 local cols = 0 - for word in string.gmatch(t.ref, "([^;]+);?") do - word = word:gsub('^[%s]+', '', 1):gsub('[%s]+$', '', 1) + for w in string.gmatch(t.ref, "([^;]+);?") do + local word = w:gsub('^[%s]+', '', 1):gsub('[%s]+$', '', 1) rows = rows + 1 cols = math.max(cols, string.len(word)) table.insert(refs, word) @@ -508,4 +508,6 @@ INSERT INTO {schema}.{prefix}streets_low_new (way_id, kind, ref, rail, minzoom, }) end) +end + -- --------------------------------------------------------------------------- diff --git a/themes/shortbread_v1_gen/topics/water.lua b/lua/themepark/themes/shortbread_v1_gen/topics/water.lua similarity index 99% rename from themes/shortbread_v1_gen/topics/water.lua rename to lua/themepark/themes/shortbread_v1_gen/topics/water.lua index e35a9ab..f00b728 100644 --- a/themes/shortbread_v1_gen/topics/water.lua +++ b/lua/themepark/themes/shortbread_v1_gen/topics/water.lua @@ -5,7 +5,7 @@ -- -- --------------------------------------------------------------------------- -local themepark, theme, cfg = ... +return function(themepark, theme, cfg) -- --------------------------------------------------------------------------- @@ -291,4 +291,6 @@ INSERT INTO {schema}.{prefix}water_lines_gen_new (]] .. name_list .. [[, kind, t }) end) +end + -- --------------------------------------------------------------------------- diff --git a/openspec/changes/archive/2026-05-02-luarocks-packaging/.openspec.yaml b/openspec/changes/archive/2026-05-02-luarocks-packaging/.openspec.yaml new file mode 100644 index 0000000..abe1eec --- /dev/null +++ b/openspec/changes/archive/2026-05-02-luarocks-packaging/.openspec.yaml @@ -0,0 +1,14 @@ +change: luarocks-packaging +artifacts: + - id: proposal + file: proposal.md + status: done + - id: design + file: design.md + status: done + dependencies: [proposal] + - id: tasks + file: tasks.md + status: done + dependencies: [proposal, design] +applyRequires: [tasks] diff --git a/openspec/changes/archive/2026-05-02-luarocks-packaging/design.md b/openspec/changes/archive/2026-05-02-luarocks-packaging/design.md new file mode 100644 index 0000000..fc15c4c --- /dev/null +++ b/openspec/changes/archive/2026-05-02-luarocks-packaging/design.md @@ -0,0 +1,246 @@ +# Design: LuaRocks Packaging + +## Directory Restructure + +Themes move from the top-level `themes/` directory into the Lua module tree so LuaRocks installs them alongside the core library. + +``` +BEFORE AFTER +────────────────────────────────────── ────────────────────────────────────── +lua/ + themepark.lua lua/ + themepark/ themepark.lua + lexer.lua themepark/ + parser.lua lexer.lua + utils.lua parser.lua + plugins/ utils.lua + bbox.lua plugins/ + t-rex.lua bbox.lua + taginfo.lua t-rex.lua + tilekiln.lua taginfo.lua +themes/ tilekiln.lua + basic/ ──────────────────────▶ themes/ + core/ basic/ + experimental/ core/ + osmcarto/ experimental/ + shortbread_v1/ osmcarto/ + shortbread_v1_gen/ shortbread_v1/ + explore/ ← stays (non-Lua files) shortbread_v1_gen/ + external/ ← stays (non-Lua files) themes/ + explore/ (not packaged) + external/ (not packaged) +config/ ← unchanged (examples) config/ (unchanged) +``` + +After the move, `LUA_PATH=lua/?.lua;;` (the existing dev setting) continues to resolve all modules correctly in development. After a LuaRocks install, the standard LuaRocks path handles it. + +## Theme and Topic File Convention + +Themes and topics currently use the vararg script pattern (loaded via `load()`): + +```lua +-- current topic file +local themepark, theme, cfg = ... +themepark:add_table{ ... } +``` + +All theme `init.lua` and `topics/*.lua` files are converted to return a function: + +```lua +-- new topic file +return function(themepark, theme, cfg) + themepark:add_table{ ... } +end +``` + +`init.lua` files return a function that receives `themepark` and returns the theme table: + +```lua +-- new init.lua +return function(themepark) + local theme = {} + return theme +end +``` + +This is the minimal change needed — the body of each file is identical, just wrapped. + +## Loader Changes in `themepark.lua` + +### Removed + +- `script_dir_impl()` and `script_dir()` — no longer needed +- `themepark.dir` field +- `themepark.theme_search_path` table and all path-scanning logic +- `themepark:add_theme_dir()` — replaced (see hybrid fallback below) +- `theme.dir` assignment in `init_theme()` + +### `init_theme()` — new logic + +```lua +function themepark:init_theme(theme_name) + if self.themes[theme_name] then + return self.themes[theme_name] + end + + -- 1. Try require() — works for built-in and LuaRocks-installed themes + local ok, result = pcall(require, 'themepark/themes/' .. theme_name) + if ok then + self.themes[theme_name] = result(self) + return self.themes[theme_name] + end + + -- 2. File-system fallback — for custom themes via add_theme_dir() / THEMEPARK_PATH + for _, dir in ipairs(self._custom_theme_dirs) do + local theme_file = dir .. '/' .. theme_name .. '/init.lua' + local file = io.open(theme_file) + if file then + local script = file:read('*a') + file:close() + local func = load(script, theme_file, 't') + self.themes[theme_name] = func(self) + return self.themes[theme_name] + end + end + + error("Themepark: Theme '" .. theme_name .. "' not found") +end +``` + +### `add_topic()` — new logic + +```lua +function themepark:add_topic(topic, options) + local theme_name, topic_name = ... -- same parsing as before + + local theme = self:init_theme(theme_name) + + -- 1. Try require() + local module = 'themepark/themes/' .. theme_name .. '/topics/' .. topic_name + local ok, topic_func = pcall(require, module) + if ok then + topic_func(self, theme, options or {}) + return + end + + -- 2. File-system fallback for custom themes + for _, dir in ipairs(self._custom_theme_dirs) do + local filename = dir .. '/' .. theme_name .. '/topics/' .. topic_name .. '.lua' + local file = io.open(filename, 'r') + if file then + local script = file:read('*a') + file:close() + local func = load(script, filename, 't') + local status, result = pcall(func, self, theme, options or {}) + if not status then error(result, 2) end + return result + end + end + + error("No topic '" .. topic_name .. "' in theme '" .. theme_name .. "'") +end +``` + +### `add_theme_dir()` — preserved for custom themes + +```lua +function themepark:add_theme_dir(dir) + -- resolve relative paths the same way as before + if string.find(dir, '/') ~= 1 then + dir = script_dir(5) .. dir -- keep helper for this one use case + end + table.insert(self._custom_theme_dirs, 1, dir) +end +``` + +### `THEMEPARK_PATH` — preserved + +The environment variable still adds entries to `_custom_theme_dirs` at startup. Built-in themes are found via `require()` first, so the env variable only matters for user-defined custom themes. + +## Plugin Lazy-Loading + +The three plugins with external dependencies switch from top-level `require` to `pcall`-guarded lazy loading. Pattern applied to all three: + +```lua +-- t-rex.lua +local function load_toml() + local ok, lib = pcall(require, 'toml') + if not ok then + error("The t-rex plugin requires the 'lua-toml' package: luarocks install lua-toml") + end + return lib +end + +-- called at the point of use: +local toml = load_toml() +utils.write_to_file(filename, toml.encode(config) .. "\n") +``` + +| Plugin | Module | LuaRocks install command | +|---|---|---| +| `t-rex` | `toml` | `luarocks install lua-toml` | +| `tilekiln` | `lyaml` | `luarocks install lyaml` | +| `taginfo` | `json` | `luarocks install lua-json` | + +`bbox.lua` has no external dependencies (uses its own `dump_toml()` implementation). + +## Rockspec + +```lua +-- osm2pgsql-themepark-scm-1.rockspec +package = "osm2pgsql-themepark" +version = "scm-1" + +source = { + url = "git+https://github.com/osm2pgsql-dev/osm2pgsql-themepark.git" +} + +description = { + summary = "A framework for pluggable osm2pgsql config files", + homepage = "https://osm2pgsql.org/themepark/", + license = "Apache-2.0" +} + +dependencies = { + "lua >= 5.1" +} + +build = { + type = "builtin", + modules = { + -- core + ["themepark"] = "lua/themepark.lua", + ["themepark.lexer"] = "lua/themepark/lexer.lua", + ["themepark.parser"] = "lua/themepark/parser.lua", + ["themepark.utils"] = "lua/themepark/utils.lua", + -- plugins + ["themepark.plugins.bbox"] = "lua/themepark/plugins/bbox.lua", + ["themepark.plugins.t-rex"] = "lua/themepark/plugins/t-rex.lua", + ["themepark.plugins.taginfo"] = "lua/themepark/plugins/taginfo.lua", + ["themepark.plugins.tilekiln"]= "lua/themepark/plugins/tilekiln.lua", + -- themes + ["themepark.themes.basic"] = "lua/themepark/themes/basic/init.lua", + ["themepark.themes.core"] = "lua/themepark/themes/core/init.lua", + ["themepark.themes.experimental"] = "lua/themepark/themes/experimental/init.lua", + ["themepark.themes.osmcarto"] = "lua/themepark/themes/osmcarto/init.lua", + ["themepark.themes.shortbread_v1"] = "lua/themepark/themes/shortbread_v1/init.lua", + ["themepark.themes.shortbread_v1_gen"] = "lua/themepark/themes/shortbread_v1_gen/init.lua", + -- ... all topics listed individually (see tasks.md) + } +} +``` + +All topic files are listed individually in the `modules` table — there is no glob support in rockspecs. + +## CI Updates + +- `LUA_PATH` in CI stays `lua/?.lua;;` — continues to work for local dev and tests +- The `require('themepark/themes/...')` calls resolve via the same path +- No changes to `bin/run-tests.sh` + +## What Does Not Change + +- The public API: `require('themepark')`, `themepark:add_topic()`, `themepark:add_theme_dir()`, `themepark:plugin()` +- The `config/` example files +- The `themes/explore/` and `themes/external/` directories +- Test files (they only test `utils`, `lexer`, `parser` which are unchanged) diff --git a/openspec/changes/archive/2026-05-02-luarocks-packaging/proposal.md b/openspec/changes/archive/2026-05-02-luarocks-packaging/proposal.md new file mode 100644 index 0000000..b9c2112 --- /dev/null +++ b/openspec/changes/archive/2026-05-02-luarocks-packaging/proposal.md @@ -0,0 +1,43 @@ +# Proposal: LuaRocks Packaging + +## Summary + +Reorganize osm2pgsql-themepark so it can be installed via LuaRocks (`luarocks install osm2pgsql-themepark`) and used without manually cloning the repository or managing `LUA_PATH`. + +## Problem + +Currently users must: +1. Clone or download the repository +2. Manually set `LUA_PATH=lua/?.lua;;` before running osm2pgsql +3. Know to look for themes in the `themes/` sibling directory + +There is no published LuaRocks package, no rockspec, and the theme discovery mechanism relies on a file-system path hack (`themepark.dir:gsub('/lua/$', '/themes')`) that breaks completely when the library is installed anywhere other than the exact cloned layout. + +## Solution + +1. Move the built-in themes into the Lua module tree (`lua/themepark/themes/`) so LuaRocks installs them alongside the core library. +2. Switch theme and topic loading from `io.open`/`load()` to standard `require()`, making themes proper Lua modules. +3. Keep a file-system fallback for custom user themes (via `add_theme_dir()` / `THEMEPARK_PATH`) for backward compatibility. +4. Add lazy-loading with helpful error messages to the three plugins that depend on optional external libraries. +5. Create an `osm2pgsql-themepark-scm-1.rockspec`. + +## Goals + +- `luarocks install osm2pgsql-themepark` installs the full framework and all built-in themes +- `require('themepark')` works from any install path without manual `LUA_PATH` setup +- `themepark:add_topic('shortbread_v1/streets')` API is unchanged +- Custom themes via `add_theme_dir()` and `THEMEPARK_PATH` continue to work +- Plugins fail with a clear "install X via luarocks" message when optional deps are missing + +## Non-Goals + +- Packaging `themes/explore/` and `themes/external/` (contain non-Lua binary/shell files; deferred to separate packages) +- Changing the user-facing config file API +- Publishing to the LuaRocks server (that is a follow-on step) + +## Success Criteria + +- `luarocks make osm2pgsql-themepark-scm-1.rockspec` succeeds +- `require('themepark')` works after a luarocks install +- All existing tests pass +- CI passes diff --git a/openspec/changes/archive/2026-05-02-luarocks-packaging/tasks.md b/openspec/changes/archive/2026-05-02-luarocks-packaging/tasks.md new file mode 100644 index 0000000..9a3b145 --- /dev/null +++ b/openspec/changes/archive/2026-05-02-luarocks-packaging/tasks.md @@ -0,0 +1,100 @@ +# Tasks: LuaRocks Packaging + +- [x] Move theme directories into the Lua tree +- [x] Wrap theme init.lua files +- [x] Wrap topic files +- [x] Refactor lua/themepark.lua loader +- [x] Add lazy-loading to plugins +- [x] Create osm2pgsql-themepark-scm-1.rockspec +- [x] Verify with luarocks make +- [x] Run existing tests +- [x] Update CI + +## Details + +### Task: Move theme directories into the Lua tree + +Move the 6 built-in theme directories from `themes/` into `lua/themepark/themes/`. Leave `themes/explore/` and `themes/external/` in place. Use `git mv` to preserve history. + +``` +themes/basic/ → lua/themepark/themes/basic/ +themes/core/ → lua/themepark/themes/core/ +themes/experimental/ → lua/themepark/themes/experimental/ +themes/osmcarto/ → lua/themepark/themes/osmcarto/ +themes/shortbread_v1/ → lua/themepark/themes/shortbread_v1/ +themes/shortbread_v1_gen/ → lua/themepark/themes/shortbread_v1_gen/ +``` + +### Task: Wrap theme init.lua files + +Each `init.lua` must return a function that receives `themepark` and returns the theme table. Wrap all 6: + +- `lua/themepark/themes/basic/init.lua` +- `lua/themepark/themes/core/init.lua` +- `lua/themepark/themes/experimental/init.lua` +- `lua/themepark/themes/osmcarto/init.lua` +- `lua/themepark/themes/shortbread_v1/init.lua` +- `lua/themepark/themes/shortbread_v1_gen/init.lua` + +Pattern: +```lua +return function(themepark) + -- existing content unchanged +end +``` + +### Task: Wrap topic files + +Replace `local themepark, theme, cfg = ...` and wrap all 41 topic files in `return function(themepark, theme, cfg) ... end`. + +basic (6): generic-boundaries, generic-lines, generic-points, generic-polygons, generic-routes, nwr +core (7): clean-tags, elevation, layer, name-all, name-list, name-single, name-with-fallback +experimental (7): builtup, highways, information, places, power, rivers, viewpoints +osmcarto (1): osmcarto +shortbread_v1 (16): addresses, aerialways, boundaries, boundary_labels, bridges, buildings, dams, ferries, land, piers, places, pois, public_transport, sites, streets, water +shortbread_v1_gen (4): boundaries, land, streets, water + +### Task: Refactor lua/themepark.lua loader + +1. Remove `script_dir_impl()`, `script_dir()`, `themepark.dir`, `themepark.theme_search_path` +2. Add `themepark._custom_theme_dirs = {}` field +3. Rewrite `init_theme()`: try `require('themepark/themes/' .. name)` first, fall back to `_custom_theme_dirs` file-system scan +4. Rewrite `add_topic()`: try `require('themepark/themes/' .. theme .. '/topics/' .. topic)` first, fall back to `_custom_theme_dirs` scan +5. Rewrite `add_theme_dir()`: push to `_custom_theme_dirs`, keep relative-path resolution using a local `script_dir` helper scoped only to this function +6. Rewrite `THEMEPARK_PATH` startup block: split on `:` and push entries to `_custom_theme_dirs` +7. Remove `theme.dir` assignment from `init_theme()` + +### Task: Add lazy-loading to plugins + +**t-rex.lua**: Replace `local toml = require 'toml'` with a `load_toml()` helper using `pcall`. Error message: `"The t-rex plugin requires the 'lua-toml' package.\nInstall it with: luarocks install lua-toml"` + +**tilekiln.lua**: Replace `local lyaml = require 'lyaml'` similarly. Error message: `"The tilekiln plugin requires the 'lyaml' package.\nInstall it with: luarocks install lyaml"` + +**taginfo.lua**: Replace `local json = require 'json'` similarly. Error message: `"The taginfo plugin requires the 'lua-json' package.\nInstall it with: luarocks install lua-json"` + +Call the loader function at the point of first use inside `write_config()`. + +### Task: Create osm2pgsql-themepark-scm-1.rockspec + +Create at the repository root with `build.type = "builtin"`. The `modules` table enumerates all Lua files individually (rockspecs have no glob support). Module naming: replace path separators with `.`, drop `lua/` prefix and `.lua` suffix. + +Core: themepark, themepark.lexer, themepark.parser, themepark.utils +Plugins: themepark.plugins.bbox, themepark.plugins.t-rex, themepark.plugins.taginfo, themepark.plugins.tilekiln +Theme inits: themepark.themes.basic, themepark.themes.core, themepark.themes.experimental, themepark.themes.osmcarto, themepark.themes.shortbread_v1, themepark.themes.shortbread_v1_gen +Topics: one entry per topic file, e.g. themepark.themes.basic.topics.generic-boundaries + +### Task: Verify with luarocks make + +Run `luarocks make osm2pgsql-themepark-scm-1.rockspec` and confirm it succeeds. Fix any missing module entries in the rockspec. + +### Task: Run existing tests + +Run `bin/run-tests.sh` with `LUA_PATH=lua/?.lua;;` and confirm all tests pass. + +### Task: Update CI + +Add a `luarocks make` validation step to `.github/workflows/ci.yml`: +```yaml +- name: Validate rockspec + run: luarocks make osm2pgsql-themepark-scm-1.rockspec +``` diff --git a/osm2pgsql-themepark-scm-1.rockspec b/osm2pgsql-themepark-scm-1.rockspec new file mode 100644 index 0000000..973fa74 --- /dev/null +++ b/osm2pgsql-themepark-scm-1.rockspec @@ -0,0 +1,84 @@ +package = "osm2pgsql-themepark" +version = "scm-1" + +source = { + url = "git+https://github.com/osm2pgsql-dev/osm2pgsql-themepark.git" +} + +description = { + summary = "A framework for pluggable osm2pgsql config files", + homepage = "https://osm2pgsql.org/themepark/", + license = "Apache-2.0" +} + +dependencies = { + "lua >= 5.1" +} + +build = { + type = "builtin", + modules = { + -- core + ["themepark"] = "lua/themepark.lua", + ["themepark.lexer"] = "lua/themepark/lexer.lua", + ["themepark.parser"] = "lua/themepark/parser.lua", + ["themepark.utils"] = "lua/themepark/utils.lua", + -- plugins (optional deps: lua-toml, lyaml, lua-json) + ["themepark.plugins.bbox"] = "lua/themepark/plugins/bbox.lua", + ["themepark.plugins.t-rex"] = "lua/themepark/plugins/t-rex.lua", + ["themepark.plugins.taginfo"] = "lua/themepark/plugins/taginfo.lua", + ["themepark.plugins.tilekiln"]= "lua/themepark/plugins/tilekiln.lua", + -- themes + ["themepark.themes.basic"] = "lua/themepark/themes/basic/init.lua", + ["themepark.themes.basic.topics.generic-boundaries"] = "lua/themepark/themes/basic/topics/generic-boundaries.lua", + ["themepark.themes.basic.topics.generic-lines"] = "lua/themepark/themes/basic/topics/generic-lines.lua", + ["themepark.themes.basic.topics.generic-points"] = "lua/themepark/themes/basic/topics/generic-points.lua", + ["themepark.themes.basic.topics.generic-polygons"] = "lua/themepark/themes/basic/topics/generic-polygons.lua", + ["themepark.themes.basic.topics.generic-routes"] = "lua/themepark/themes/basic/topics/generic-routes.lua", + ["themepark.themes.basic.topics.nwr"] = "lua/themepark/themes/basic/topics/nwr.lua", + ["themepark.themes.core"] = "lua/themepark/themes/core/init.lua", + ["themepark.themes.core.topics.clean-tags"] = "lua/themepark/themes/core/topics/clean-tags.lua", + ["themepark.themes.core.topics.elevation"] = "lua/themepark/themes/core/topics/elevation.lua", + ["themepark.themes.core.topics.layer"] = "lua/themepark/themes/core/topics/layer.lua", + ["themepark.themes.core.topics.name-all"] = "lua/themepark/themes/core/topics/name-all.lua", + ["themepark.themes.core.topics.name-list"] = "lua/themepark/themes/core/topics/name-list.lua", + ["themepark.themes.core.topics.name-single"] = "lua/themepark/themes/core/topics/name-single.lua", + ["themepark.themes.core.topics.name-with-fallback"] = "lua/themepark/themes/core/topics/name-with-fallback.lua", + ["themepark.themes.experimental"] = "lua/themepark/themes/experimental/init.lua", + ["themepark.themes.experimental.topics.builtup"] = "lua/themepark/themes/experimental/topics/builtup.lua", + ["themepark.themes.experimental.topics.highways"] = "lua/themepark/themes/experimental/topics/highways.lua", + ["themepark.themes.experimental.topics.information"] = "lua/themepark/themes/experimental/topics/information.lua", + ["themepark.themes.experimental.topics.places"] = "lua/themepark/themes/experimental/topics/places.lua", + ["themepark.themes.experimental.topics.power"] = "lua/themepark/themes/experimental/topics/power.lua", + ["themepark.themes.experimental.topics.rivers"] = "lua/themepark/themes/experimental/topics/rivers.lua", + ["themepark.themes.experimental.topics.viewpoints"] = "lua/themepark/themes/experimental/topics/viewpoints.lua", + ["themepark.themes.external"] = "lua/themepark/themes/external/init.lua", + ["themepark.themes.external.topics.coastlines"] = "lua/themepark/themes/external/topics/coastlines.lua", + ["themepark.themes.external.topics.continents"] = "lua/themepark/themes/external/topics/continents.lua", + ["themepark.themes.external.topics.oceans"] = "lua/themepark/themes/external/topics/oceans.lua", + ["themepark.themes.osmcarto"] = "lua/themepark/themes/osmcarto/init.lua", + ["themepark.themes.osmcarto.topics.osmcarto"] = "lua/themepark/themes/osmcarto/topics/osmcarto.lua", + ["themepark.themes.shortbread_v1"] = "lua/themepark/themes/shortbread_v1/init.lua", + ["themepark.themes.shortbread_v1.topics.addresses"] = "lua/themepark/themes/shortbread_v1/topics/addresses.lua", + ["themepark.themes.shortbread_v1.topics.aerialways"] = "lua/themepark/themes/shortbread_v1/topics/aerialways.lua", + ["themepark.themes.shortbread_v1.topics.boundaries"] = "lua/themepark/themes/shortbread_v1/topics/boundaries.lua", + ["themepark.themes.shortbread_v1.topics.boundary_labels"] = "lua/themepark/themes/shortbread_v1/topics/boundary_labels.lua", + ["themepark.themes.shortbread_v1.topics.bridges"] = "lua/themepark/themes/shortbread_v1/topics/bridges.lua", + ["themepark.themes.shortbread_v1.topics.buildings"] = "lua/themepark/themes/shortbread_v1/topics/buildings.lua", + ["themepark.themes.shortbread_v1.topics.dams"] = "lua/themepark/themes/shortbread_v1/topics/dams.lua", + ["themepark.themes.shortbread_v1.topics.ferries"] = "lua/themepark/themes/shortbread_v1/topics/ferries.lua", + ["themepark.themes.shortbread_v1.topics.land"] = "lua/themepark/themes/shortbread_v1/topics/land.lua", + ["themepark.themes.shortbread_v1.topics.piers"] = "lua/themepark/themes/shortbread_v1/topics/piers.lua", + ["themepark.themes.shortbread_v1.topics.places"] = "lua/themepark/themes/shortbread_v1/topics/places.lua", + ["themepark.themes.shortbread_v1.topics.pois"] = "lua/themepark/themes/shortbread_v1/topics/pois.lua", + ["themepark.themes.shortbread_v1.topics.public_transport"] = "lua/themepark/themes/shortbread_v1/topics/public_transport.lua", + ["themepark.themes.shortbread_v1.topics.sites"] = "lua/themepark/themes/shortbread_v1/topics/sites.lua", + ["themepark.themes.shortbread_v1.topics.streets"] = "lua/themepark/themes/shortbread_v1/topics/streets.lua", + ["themepark.themes.shortbread_v1.topics.water"] = "lua/themepark/themes/shortbread_v1/topics/water.lua", + ["themepark.themes.shortbread_v1_gen"] = "lua/themepark/themes/shortbread_v1_gen/init.lua", + ["themepark.themes.shortbread_v1_gen.topics.boundaries"] = "lua/themepark/themes/shortbread_v1_gen/topics/boundaries.lua", + ["themepark.themes.shortbread_v1_gen.topics.land"] = "lua/themepark/themes/shortbread_v1_gen/topics/land.lua", + ["themepark.themes.shortbread_v1_gen.topics.streets"] = "lua/themepark/themes/shortbread_v1_gen/topics/streets.lua", + ["themepark.themes.shortbread_v1_gen.topics.water"] = "lua/themepark/themes/shortbread_v1_gen/topics/water.lua", + } +}