{"id":22477751,"url":"https://github.com/the-balthazar/brewwikigen","last_synced_at":"2026-02-07T12:32:20.248Z","repository":{"id":92262779,"uuid":"397147565","full_name":"The-Balthazar/BrewWikiGen","owner":"The-Balthazar","description":"A wiki generator for Forged alliance unit mods.","archived":false,"fork":false,"pushed_at":"2024-08-01T04:43:12.000Z","size":1262,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-30T20:11:32.688Z","etag":null,"topics":["documentation-generator","forged-alliance","generator","lua","markdown","supcom","supreme-commander","wiki"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/The-Balthazar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-17T07:12:57.000Z","updated_at":"2024-08-01T04:43:15.000Z","dependencies_parsed_at":"2024-07-22T21:39:37.723Z","dependency_job_id":"549ec9df-28bd-47bb-9cf2-fb40c1d5f84b","html_url":"https://github.com/The-Balthazar/BrewWikiGen","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/The-Balthazar/BrewWikiGen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Balthazar%2FBrewWikiGen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Balthazar%2FBrewWikiGen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Balthazar%2FBrewWikiGen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Balthazar%2FBrewWikiGen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/The-Balthazar","download_url":"https://codeload.github.com/The-Balthazar/BrewWikiGen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Balthazar%2FBrewWikiGen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29194019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T07:37:03.739Z","status":"ssl_error","status_checked_at":"2026-02-07T07:37:03.029Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["documentation-generator","forged-alliance","generator","lua","markdown","supcom","supreme-commander","wiki"],"created_at":"2024-12-06T14:12:08.659Z","updated_at":"2026-02-07T12:32:20.234Z","avatar_url":"https://github.com/The-Balthazar.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"![BrewWikiGen logo](BrewWikiGen.png)\n\n***BrewWikiGen***, by Sean 'Balthazar' Wheeldon; automatic Github markdown style\nwiki page generation for *Supreme Commander: Forged Alliance* unit mods.\n\n## Installation:\nThe script requires Lua 5.4 or greater to run. The uncompiled official download\nfor that is [available here](https://www.lua.org/download.html), however, I downloaded\npre-compiled binaries [from here](http://luabinaries.sourceforge.net/download.html).\n`lua-5.4.2_Win64_bin.zip` to be specific.\n\nFor convenience, I execute from within [Atom](https://atom.io/) using the\n[LuaRunner](https://github.com/shenfll/luarunner) plugin, downloadable from within\nthe Atom package manager. Ctrl-Shift-x opens the LuaRunner pane, point it at\nlua54.exe, open and [appropriately edit `Run.lua`](#Configuring) for your personal\nenvironment, and run. Alternatively running a `.bat` file containing:\n```bat\n\"C:\\Program Files (x86)\\Lua\\5.4.2\\lua54.exe\" C:\\BrewWikiGen\\Run.lua\npause\n```\nEdited as appropriate for your setup will also suffice for easy running. The `pause`\nis optional, and is mostly so you can read the log output. You will still need to\nedit `Run.lua`.\n\n## Configuring:\nThe following are all the values read from `Run.lua`. Some will need updating for\nyour setup:\n\n* `OutputDirectory` should point to a clone of your mods wiki repository. If you\ndon't have one, it at very least needs to be a valid folder. Use forward slashes\n`/`, and include a trailing slash at the end.\n\n* `WikiGeneratorDirectory` should point to the folder `Main.lua` is in, like: `\"C:/BrewWikiGen/\"`.\n\n* `EnvironmentData` contains the following environmental values:\n\n  * `location` optionally is a path for it to search for environmental blueprints.\n    If it finds none it will use a shell link in there instead. Note this isn't recursive.\n\n  * `GenerateWikiPages`, if `true`, has the generator treat the environment as 'mod 0'.\n    Otherwise it will just be used for added context for mod pages.\n\n  * `RebuildBlueprints`, if not `false`, and blueprint rebuild is enabled, it will\n    rebuild environment blueprints.\n\n  * `RunSanityChecks`, if `true`, and blueprint sanity checks are enabled, it will\n    give logs about potential errors in environment blueprints.\n\n  * `Factions`, optionally, is a an array of custom factions formatted as sub-arrays\n    containing the faction category then the faction name. For example:\n    ```lua\n    Factions = {\n        {'NOMADS', 'Nomads'},\n        {'ARM', 'Arm'},\n        {'CORE', 'Core'},\n    },\n    ```\n    The order is used for navigation sections and doesn't need to match the faction\n    index in game. They are appended to the vanilla factions followed by 'Other',\n    which is used for anything else and anything with multiple faction categories.\n\n  * `Lua`, optional, defines the location that *contains* the lua folder to try\n    to load `lua/ui/help/unitdescription.lua` and `lua/ui/help/tooltips.lua` from.\n    They are expected to be valid Lua, and are sandboxed with no access to functions.\n    If undefined, the generator comes with a default set of order tooltips.\n\n  * `PreModBlueprints`, and `PostModBlueprints`, optional arrays of functions to\n    have run from the environments' `lua/system/Blueprints.lua` file before and\n    after mod hook `lua/system/Blueprints.lua` `WikiBlueprints` functions. If\n    `PreModBlueprints` isn't populated it will try to run a `WikiBlueprints`\n    function from that file at that time instead.\n\n  * `LOC`, optional, defines the location that *contains* the loc folder to try\n    to load `loc/`Language`/strings_db.lua` from. It is expected to be valid Lua\n    and is sandboxed with no access to functions.\n\n  * `name`, `author`, `version`, and `icon` are for environment pseudo mod info.\n\n  * `ExtraData` can point to an optional extra document of hand written content\n    for specific sections of specific unit pages. It expects said document to be\n    formatted as a `UnitData` table, keyed with unit IDs (upper case, or however\n    the bp files are named if they are anything other than entirely lower case),\n    with table values containing keys that match the syntax `[Section]Prefix` or\n    `[Section]Suffix`, where `[Section]` matches the English names of sections,\n    like `Weapons` or `Adjacency`, or `LeadSuffix`, with string values, or keyed\n    with `Trivia` with the value either being a string or an array of strings; a\n    string included as-is, and an array being formatted as a bulleted list, or keyed\n    with `Videos` with an array of tables that match the format\n    `{YouTube = '[Video ID]', '[Display name]'}`, where `[Video ID]` is the 11-ish\n    character YouTube video ID, and `[Display name]` is the link caption to display.\n    You can also force a section to appear and/or overwrite the main contents of it\n    with a `[Section]` key, and either a `true` value to force it to appear, or\n    a string value to force it to appear and overwrite the main body of the section.\n    Prefix and suffix additions are still respected.\n    Which is a very wordy way to say to look like this example:\n    ```lua\n    UnitData = {\n        SSL0403 = {\n            LeadSuffix = \"Paragraph to appear after the generated lead paragraph.\",\n            AdjacencyPrefix = \"Paragraph to appear before the Adjacency section.\",\n            Videos = {\n                {YouTube = 'IInITjdtaPM', 'Time-lapse'},\n            },\n            Trivia = {\n                'This would appear as a bullet point in the trivia section.',\n                'As would this.',\n            },\n            Balance = \"This unit is mad OP because it's the only way I can get an er\",\n        },\n    }\n    ```\n    If you don't have such a document, you can remove the `ExtraData` field or\n    set it to `false`.\n\n  * `LoadExtraBlueprints`, optional, hash of extra blueprint types to actually load.\n    `Unit` and `Projectile` are loaded by default, this allows loading of `Beam`,\n    `Mesh`, `Prop`, `Emitter`, and `TrailEmitter` blueprints.\n\n  * `base64`, optional, a table of flags for encoding image data as base 64. The\n    only accepted flag is currently `UnitIcons`, because after testing, GitHub\n    wiki markdown strips base64 `src` fields of images, so it's not actually useful\n    for its intended purpose of limiting how quickly unauthenticated users hit the\n    rate and rest limits for GitHub API calls, so was never developed further.\n\n* `WikiOptions` contains the following bool-ish options:\n\n  * `Language` should be the two letter language code for which LOC files should\n    be loaded. They are not ISO_639-1. Non-`'US'` is only partially supported.\n\n  * `GenerateHomePage`, `GenerateSidebar`, `GenerateModPages`, `GenerateUnitPages`,\n    `GenerateProjectilesPage` and `GenerateCategoryPages`; `true` or `false`:\n    Generate those parts or not.\n\n  * `IncludeStrategicIcon`; `true` or `false`: If true it will include the strategic\n    icon in the infobox and automatically copy required icons into the output from\n    the generator directory. The packaged icons are from the *BrewLAN* large icon\n    mod. If you want something else, like the vanilla icons, that's on you.\n\n  * `AbilityDescriptions`; `true` or `false`: If false it lists the abilities of\n    the units verbatim in the abilities section. If true it will try to map them\n    to tooltips in the `abilityDesc` table in `/Environment/Game.lua`.\n\n  * `BalanceNote` appears at the bottom of Balance sections if they exist. It can\n    be set to false or removed. The section will only appear on pages for blueprints\n    that have `bp.WikiBalance` be truthy. The auto generated content of balance\n    requires `bp.WikiBalance.Affects`; expected to contain an array of blueprint\n    sections affected by the script, and optionally `bp.WikiBalance.ReferenceIDs`;\n    expected to be an array containing 1 or 2 unit ID's, with it assuming the result\n    is an average if both are defined.\n\n    The section would be devoid of generated content if `BalanceNote` evaluates\n    false and `bp.WikiBalance` evaluates true, but has none of the expected content.\n    This would allow you to fill it with your own content as detailed in `ExtraData`.\n\n  * `ConstructionNote` appears at the top of Construction sections in unit pages.\n    It can be set to false or removed.\n\n  * `BuildListSaysModUnits` if true the build list refers to what can be built as\n    \"mod unit(s)\" instead of \"unit(s)\".\n\n  * `LocalRepuUnitPageBlueprintLink` and `OnlineRepoUnitPageBlueprintLink`, if they\n    exist, it create unit page links to the original `.bp` files on the repo, using\n    the the pair as a regex search and replace on the source location it found the\n    reference `.bp` files at.\n\n* `CleanupOptions` (Depreciated) handles options for 'cleanup', which uses regex\n  expressions to remove specific values from blueprint values. Contains the\n  following bool options:\n\n  * `CleanUnitBpFiles`; `true` or `false`: Enables or disables all `.bp` file\n    modifying scripts. Note it only applies to loaded `.bp` files that would be\n    given a wiki page.\n\n  * `CleanUnitBpGeneral`, `CleanUnitBpDisplay`, `CleanUnitBpInterface`,\n    and `CleanUnitBpUseOOBTestZoom`; `true` or `false`: Removes obsolete vales.\n    Specifically:\n    * From `General`: `Category`, `Classification`, `TechLevel`, and `UnitWeight`.\n    * From `Display`: `PlaceholderMeshName`, and `SpawnRandomRotation`.\n    * The whole of `Interface`.\n    * The value `UseOOBTestZoom`.\n\n  * `CleanUnitBpThreat`; `true` or `false`: Updates the threat values based on\n    an extensive formula.\n\n* `RebuildBlueprintOptions` handles options for 'rebuild', which rebuilds blueprints\n  by re-serializing loaded unit blueprints files. Beautifying them you might say. It\n  contains the following bool options:\n\n  * `RebuildBpFiles`; either `nil`/`false` or a hash of blueprint types to rebuild,\n    for example:\n    ```lua\n    {\n        Unit = true,\n        Beam = false,\n        Mesh = false,\n        Prop = false,\n        Emitter = false,\n        Projectile = false,\n        TrailEmitter = false,\n    }\n    ```\n    would have it rebuild just unit blueprints. `false` values can be removed/excluded.\n    Said blueprint types need to be actually loaded. See `LoadExtraBlueprints`.\n  * `RemoveUnusedValues`, if `true`, removes the unit blueprint values:\n    * `bp.General.Category`\n    * `bp.General.Classification`\n    * `bp.General.TechLevel`\n    * `bp.General.UnitWeight`\n    * `bp.Display.PlaceholderMeshName`\n    * `bp.Display.SpawnRandomRotation`\n    * `bp.UseOOBTestZoom`\n    * `bp.Interface`\n\n  * `CleanupBuildOnLayerCaps` if `true` does the following to `bp.Physics.BuildOnLayerCaps`:\n    * If the unit has a motion type that isn't `RULEUMT_None`, it removes the table;\n      they don't use it, and you shouldn't trust anything it says.\n    * If the unit has a motion type of `RULEUMT_None` and has `LAYER_Land` as the\n      only true value it removes the table; that's the default.\n    * Otherwise it removes any false values. This will leave an empty table if there\n      are no true values. This is functionally different from having no table.\n\n  * `CleanupGeneralBackgroundIcon` if `true` and the unit has a `bp.General` table,\n    changes the `bp.General.Icon` value to correctly match what layers the unit can\n    exist on, or to indicate what it can build if it's a factory structure.\n\n  * `CleanupWreckageLayers` if `true`, it will remove false values from wreckage layers.\n  * `CleanupCommandCaps` if `true`, it will remove false values from command caps,\n    if there were no true values, it removes the table.\n  * `CleanupIntelOverlayCategories` if `true`, it will give the `OVERLAYRADAR`, `-SONAR`\n    and `-OMNI` categories to anything with ranges in those things greater than 0,\n    and take it from anything else. It will do the same for the `OVERLAYCOUNTERINTEL`\n    category to anything that doesn't have a non-0 field radius for radar stealth,\n    sonar stealth, or cloak, or a non-0 max jammer radius and more than 0 jammer blips.\n  * `RemoveMilitaryOverlayCategories` if `true`, it will remove the `OVERLAY` categories\n    for `AIR`, `NAVY`, `DEFENSE`, `DIRECTFIRE`, and `INDIRECTFIRE`. They are not\n    referenced in `rangeoverlayparams.lua`.\n  * `RemoveProductCategories` if `true`, removes categories starting with `PRODUCT`;\n    in the core game they are only useful for *easily* restricting units added by\n    patches and FA, which is a questionable use at best (and still attainable\n    without the categories by checking `bp.Source` and the first letter of the ID),\n    and in mods *generally* only indicates where the unit bp was originally copied\n    from, or if updated to actually indicate the mod just occupies memory.\n\n    *Steps down off soap box*\n  * `RecalculateThreat` if `true`, recalculates the units threat, based on\n    `Utilities/Threat.lua`.\n\n* `ModDirectories` should point to your local copies of the mod(s) you wish to\nload in the order you wish them to appear. It assumes, but doesn't require, multiple\nmods. It requires a valid `mod_info.lua` file directly in each. If a mod contains\nno units, then no page will be generated for it.\n\n* `BlueprintExclusions` is an array of regex matches for what to exclude from\nblueprint searches. They are matched against the whole path of any `.bp` file.\nLowercase.\n\n* `BlueprintIdExclusions` is an array of exact blueprint IDs to exclude. Case insensitive.\n\n* `FooterCategories` is a list of unit categories that the generator should create\ncategory pages for, and link to at the bottom of the relevant units. They appear\non unit pages in the order written, so I tried to order them in a natural language\norder, or as close to as possible. If you have no units in a given category, no\npage will be generated. Add or remove as seems appropriate for your mods needs.\n\n* `Logging` contains several options for verbose logging of additional information\nwhich can be interesting or helpful in the case of any issues.\n\n* `Sanity` contains options for flagging anything in blueprints and their meshes\nthat I consider anomalous or unnecessary. Exercise discretion when taking its advice.\n\n## Usage notes:\nIf you have pre-existing pages for `Home.md`, `_Sidebar.md` or mods in your wiki\nyou can specify where and if the generator outputs in those pages specifically.\nThis can be done through specific xml tags read by the generator.\n\nBehaviours on these pages are; if matching opening and closing tags exist (`\u003ctag\u003e`\nand `\u003c/tag\u003e`) it will replace the contents with the new generation, if an empty\ntag exists (`\u003ctag /\u003e` with the space) it will specifically not write that section,\notherwise it appends the content to the end surrounded by matching opening and\nclosing tags.\n\nIf you want it to not output on an entire class of page, that can be done via the\nrelevant `WikiOptions` flags. Yes this makes `\u003cbrewwikihome /\u003e` and `\u003cbrewwikisidebar /\u003e`\nredundant, but it's the same code for all of them, so it's free.\n\nTags are:\n* `\u003cbrewwikihome\u003e` for the mod navigation for `Home.md`.\n* `\u003cbrewwikisidebar\u003e` for the mod drop downs for `_Sidebar.md`.\n* `\u003cbrewwikimodinfobox\u003e` for the infobox on mod pages.\n* `\u003cbrewwikileadtext\u003e` for the lead text on mod pages.\n* `\u003cbrewwikimodunits\u003e` for the unit navigation images on mod pages.\n\n### Blueprints.lua:\nIf you have important content in `/hook/lua/system/Blueprints.lua`, you can have\nthe generator run it by adding a `WikiBlueprints` function to that file called in\nthe same way as `ModBlueprints`, except by the generator instead of the game.\n\nThis is easier to achieve if your `Blueprints.lua` is formatted such that your\n`ModBlueprints` hook is populated with function calls rather than with code ran\ndirectly within that hook. However, as outlined below, it needs to be valid Lua 5.4.\n\n### Lua validation:\nSince this generator runs mod files directly for data, any referenced `.lua` file\nmust be valid for Lua 5.4. This notably means **not** using `#` instead of `--`,\nnot using `!=` instead of `~=`, and probably several other things.\n\nCode in required files that validates as Lua, but wouldn't run, ie: because it\nruns a loop without defining an iterator like `pairs` or `ipairs`, or wouldn't\nwant to be ran for the wiki generation can be selectively ran by changing the\ncode to check `_VERSION == \"Lua 5.0.1\"` first so that it only runs in-game.\n\nI don't anticipate this being a huge issue, since these are generally data files\nand any code in them shouldn't need to be performed more than once.\n\nFiles this affects are as follows:\n\n*    `/mod_info.lua`\n*    `/hook/lua/ui/help/tooltips.lua`\n*    `/hook/lua/ui/help/unitdescription.lua`\n*    `/hook/lua/system/blueprints.lua`\n*    `/hook/loc/US/strings_db.lua`\n\n### Included files:\nIt will skip any mod that doesn't have a valid `mod_info.lua`, and, while blueprint\nfiles are sanitised, it will halt if it reaches a `.bp` file that still doesn't\nvalidate as Lua after sanitisation. For the other files it will continue with a\nwarning, but may have missing data on the pages.\n\nOnly blueprint files that end in `_unit.bp` will be included, and only non-Merge\nblueprints in those that contain defined `Display`, `Categories`, `Defense`,\n`Physics`, and `General` tables will be considered 'valid' and included.\n\n### Images\nThe Github wiki image loading is case sensitive.\n\nFor mod icons if the mod in question has a `mod_info.lua` `icon` field it expects\na `icons/mods/[mod-name].png` file and a `images/mods/[mod-name].png` file, where\nmod-name matches the mods written name in lowercase with spaces replaced with\nhyphens and non-web-safe characters removed. It ignores the actual value of `icon`,\nbecause `icon` has a high chance of pointing to something not-web-safe, and could\ncause clashes. I recommend that the icon be 64x64px and the image be 512x512px.\n\nIt expects to find unit icons at `icons/units/[ID]_icon.png`, it expects ID to\nmatch the case of the original `.bp` file, unless it's entirely lowercase, in\nwhich case uppercase. If it doesn't find the icon it will use a default fall-back.\n\nIf you have files at `images/units/[ID].jpg` in the output directory it will insert\nthem in the matching unit infoboxes, and if you have files at `images/units/[ID]-n.jpg`\nwhere `n` is a number from `1` onwards, it will create a gallery section for them\non said pages.\n\nIf you have mixed case unit icon files that don't match, this script can be used\nto rename them to `[uppercase ID]_icon.png`:\n```lua\nlocal folderdir = string.match(debug.getinfo(1, 'S').short_src, '.*\\\\')\nprint(folderdir)\n\nlocal folder = io.popen(string.format('dir \"%s\" /b', folderdir))\n\nfor name in folder:lines() do\n  if string.lower(string.sub(name, -8)) == 'icon.png' then\n      local newname = string.upper(string.match(name, '(.+)_[iI][cC][oO][nN]'))..'_icon.png'\n      local file = io.open(folderdir..name, 'rb'):read('all')\n\n      io.open(folderdir..'test\\\\'..newname, 'wb'):write(file):close()\n  end\nend\n\nprint(\"end\")\n```\nTo use it save it as `.lua` in the images folder, create a `/test/` subfolder and\nrun it. It creates renamed copies in the test folder.\n\nIf your unit blueprints themselves are mixed case then god help you.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-balthazar%2Fbrewwikigen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthe-balthazar%2Fbrewwikigen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-balthazar%2Fbrewwikigen/lists"}