From eddef0d889ca3e4acee819fe8eb4741679b50e7e Mon Sep 17 00:00:00 2001 From: Nexela Date: Mon, 2 Mar 2020 22:19:51 -0500 Subject: [PATCH] More package cleanup --- .circleci/makedocs.sh | 2 +- .gitignore | 19 ++++----- .publish/prepackage.sh | 2 +- .vscode/settings.json | 5 ++- doc/config.ld | 8 ++-- doc/package.ld | 97 ------------------------------------------ 6 files changed, 16 insertions(+), 117 deletions(-) delete mode 100644 doc/package.ld diff --git a/.circleci/makedocs.sh b/.circleci/makedocs.sh index be1bcdd5..508eaba1 100755 --- a/.circleci/makedocs.sh +++ b/.circleci/makedocs.sh @@ -3,4 +3,4 @@ rm -rf 'stdlib-docs' mkdir -p 'stdlib-docs' cp doc/spectre.min.css 'stdlib-docs/spectre.min.css' cp doc/spectre-icons.min.css 'stdlib-docs/spectre-icons.min.css' -ldoc -ic doc/package.ld -l doc -s doc stdlib +ldoc -ic doc/config.ld -l doc -s doc stdlib diff --git a/.gitignore b/.gitignore index c49596fa..dfcc6cd2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1,16 @@ #lua files in root -#/control.lua -#/data.lua -#/data-updates.lua -#/data-final-fixes.lua -/*.lua +*.lua -# Exclude the build directory -.build/ +# Exclude the api docs directory +stdlib-docs/ +.temp/ .trash/ -.test/ -stdlib-docs/ +.history/ # Exclude the output directory .output/ +.build/ # vim swapfiles .*.swp @@ -23,10 +20,10 @@ stdlib-docs/ /stdlib/tags # Ignore temp.lua files +*.ign.lua +*.tmp.lua *.tmp -temp*.lua *.stackdump -*.bak.* # Compiled Lua sources luac.out diff --git a/.publish/prepackage.sh b/.publish/prepackage.sh index 6e0ee57d..fa2dae5d 100755 --- a/.publish/prepackage.sh +++ b/.publish/prepackage.sh @@ -5,7 +5,7 @@ rm -rf 'stdlib-docs' mkdir -p 'stdlib-docs' cp doc/spectre.min.css 'stdlib-docs/spectre.min.css' cp doc/spectre-icons.min.css 'stdlib-docs/spectre-icons.min.css' -ldoc -ic doc/package.ld -l doc -s doc stdlib +ldoc -ic doc/config.ld -l doc -s doc stdlib echo '' luacheck ./stdlib diff --git a/.vscode/settings.json b/.vscode/settings.json index e5f0a4a6..d827d3ff 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,9 +2,10 @@ "files.exclude": { "**/.build": true, "**/.trash": true, + "**/.history": true, }, "search.exclude": { - "**/.test": true, - "**/api-docs": true, + "**/.temp": true, + "**/stdlib-docs": true, } } diff --git a/doc/config.ld b/doc/config.ld index e83fbc29..3f52e103 100644 --- a/doc/config.ld +++ b/doc/config.ld @@ -6,8 +6,6 @@ full_description = [[ The Factorio Standard Library aims to extend the Factorio Lua API with well-tested, documented, and easy-to-use functions to make modding easier. ]] -local BUILD_DIR = "../.build/" - no_lua_ref = true convert_opt = true sort = false @@ -18,9 +16,9 @@ merge = false backtick_references = false format = "discount" template_escape = ">" -dir = BUILD_DIR .. "doc" -examples = {"../doc/examples"} -topics = {"../readme.md", "../changelog.txt", "../LICENSE", "../doc/contributing.md", "../doc/style-guide.md"} +dir = "stdlib-docs" +examples = {"./doc/examples"} +topics = {"./readme.md", "./changelog.txt", "./LICENSE", "./doc/contributing.md", "./doc/style-guide.md"} new_type("event", "Events", false, "Event Parameters") diff --git a/doc/package.ld b/doc/package.ld deleted file mode 100644 index 3f52e103..00000000 --- a/doc/package.ld +++ /dev/null @@ -1,97 +0,0 @@ ---luacheck: ignore 11. (ignore global variable related stuff) -project = "Factorio Stdlib" -title = "Factorio Stdlib" -description = "Factorio Standard Library" -full_description = [[ - The Factorio Standard Library aims to extend the Factorio Lua API with well-tested, documented, and easy-to-use functions to make modding easier. -]] - -no_lua_ref = true -convert_opt = true -sort = false -no_space_before_args = true -no_return_or_parms = false -not_luadoc = true -merge = false -backtick_references = false -format = "discount" -template_escape = ">" -dir = "stdlib-docs" -examples = {"./doc/examples"} -topics = {"./readme.md", "./changelog.txt", "./LICENSE", "./doc/contributing.md", "./doc/style-guide.md"} - -new_type("event", "Events", false, "Event Parameters") - -local api_url = "http://lua-api.factorio.com/latest/%s.html%s" - -custom_see_handler("^Lua([%w_]*)%.?([%.?[%w_]*]*)$", - function(name, section) - local link_txt = "Lua" .. name .. (#section > 0 and "." .. section or "") - local link_url = api_url:format("Lua" .. name, #section > 0 and "#" .. link_txt or "") - return link_txt, link_url - end -) - -custom_see_handler("^Concepts%.([%.?[%w_]*]*)$", - function(section) - local link_txt = "Concepts." .. section - local link_url = api_url:format("Concepts", #section > 0 and "#" .. section or "") - return link_txt, link_url - end -) - -custom_see_handler("^defines%.?([%.?[%w_]*]*)$", - function(section) - local link_txt = "defines." .. section - local link_url - if section == "color" or section == "time" then - link_url = "../modules/"..link_txt..".html" - else - link_url = api_url:format("defines", #section > 0 and "#" .. link_txt or "") - end - return link_txt, link_url - end -) - -custom_see_handler("^Common%.([%.?[%w_]*]*)$", - function(section) - local link_txt = "Common." .. section - local link_url = api_url:format("Common", #section > 0 and "#" .. link_txt or "") - return link_txt, link_url - end -) - -local wikipat = "https://en.wikipedia.org/wiki/%s" -custom_see_handler("^wiki (.+)", - function(name) - local url = wikipat:format(name) - return name, url - end -) - --- https://forums.factorio.com/viewtopic.php?t=32039#p202158 -custom_see_handler("^(http[s]?%:%/%/.-) (.+)$", - function(url, name) - return name, url - end -) - -local lua_url = "https://www.lua.org/pil/%s.html%s" - -custom_see_handler("^boolean$", function() return "boolean", api_url:format("Builtin-Types", "#boolean") end) -custom_see_handler("^int$", function() return "int", api_url:format("Builtin-Types", "#int") end) -custom_see_handler("^uint$", function() return "uint", api_url:format("Builtin-Types", "#uint") end) -custom_see_handler("^uint8$", function() return "uint8", api_url:format("Builtin-Types", "#uint8") end) -custom_see_handler("^uint64$", function() return "uint64", api_url:format("Builtin-Types", "#uint64") end) -custom_see_handler("^string$", function() return "string", api_url:format("Builtin-Types", "#string") end) -custom_see_handler("^float$", function() return "float", api_url:format("Builtin-Types", "#float") end) -custom_see_handler("^double$", function() return "double", api_url:format("Builtin-Types", "#double") end) -custom_see_handler("^nil$", function() return "nil", lua_url:format("2.1", "") end) -custom_see_handler("^number$", function() return "number", lua_url:format("2.3", "") end) -custom_see_handler("^table$", function() return "table", lua_url:format("2.5", "") end) -custom_see_handler("^function$", function() return "function", lua_url:format("2.6", "") end) -custom_see_handler("^userdata$", function() return "userdata", lua_url:format("2.7", "") end) -custom_see_handler("^thread$", function() return "thread", lua_url:format("9", "#CoroutineSec") end) -custom_see_handler("^array$", function() return "array", lua_url:format("11.1", "") end) -custom_see_handler("^sort$", function() return "sort", lua_url:format("19.3", "") end) -custom_see_handler("^pattern$", function() return "pattern", lua_url:format("20.2", "") end)