Code Monkey home page Code Monkey logo

factorio-changelog-script's Introduction

Changelog Script

This is a quick and dirty lua script for generating changelog for Factorio mods in various formats.

Usage

Get the script file and put it somewhere on your computer.

Run the script from the command line using lua (e.g.lua changelog-script.lua). If no parameters are given, it will look for a file named changelog.lua in the directory it was called from and it will output into the same directory.
The possible parameters are:

  • changelog-path: This is the path to read the changelog from. It has to be a Lua file in the format outlined bellow.
  • out-path: This is a path to a directory that the outputs will be stored in. If it doesn't exist, it will be created.

Note that due to Lua being weird, the directory is created using mkdir, so don't be surprised if it tells you something, it's probably correct.

After the command finishes, three files will be created in the output directory, each being the changelog in a different format.

  • changelog_forum.txt: The syntax forums.factorio.com uses
  • changelog.md: A markdown syntax that should work both on mods.factorio.com and GitHub
  • changelog.txt: The syntax the game uses - this is what should be left in the mod

Format

The changelog definition file should return a table containing tables representing the individual versions.

The format of the inner tables is this:

{
	name = "0.1.0", -- Mandatory
	date = "16. 12. 2017", -- Optional, can be anything
	
	"Change in the default category", -- Changes declared directly in this table will be put into the 'Other' category
	-- ...
	
	Category = { -- Categories are defined using their name, any name can be used, except name and date
		"Change in category",
	},
	-- ...
}

Changes can be declared as simple strings, or as a table in the following format:

{
	"Change description", -- Mandatory
	more = "https://link.to.nowhere.com", -- Optional
	by = "Name", -- Optional
}

more and by work in the same way, but have different meanings: more is a link with more information and by is the author of the change.
They can be either a string that will be used directly, or a table of such strings, which will then be put into a comma-separated list. The table can also define these strings on string keys. In this case the key will be used as the text and the value as the link target. If this is not possible more will use the value and by will use the key.

Notes

If the Other category is the only one and categories are not necessary for the target format, the changes will be put in a list with no mention of a category.

factorio-changelog-script's People

Contributors

therustyknife avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.