Skip to content

JiriKopr/axioms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Axioms

Code generator written in Go. Generates files and directory structure based on provided templates.

It replaces any [ variable ] in files, file names or directory names with provided text.

combine/_images

Usage

You need a directory to store all your templates. It can be anywhere in your file system, but for convenience there is a templates directory present in this repository.

In your templates destination, create new directory which will represent single template. Into this new directory put your files and directories which you want to generate.

Compile the program

go build -o axioms

List

./axioms list ./templates/test

This command will list all necesarry tags which need to be specified for generating.

Generate

./axioms generate ./templates/test ~/Desktop/target axiom_value tag=value

To generate files and directories, run this command specifing the template, target destination and tag values. You can supply value without specifying the key. This value will be used for all [ axiom ] tags.

If your template contains other tags, you have to specify their value by providing tag=value.

Multiword values can be passed by separating the words with _ ie. tag=shopping_list

Tags

Tags have format [ tag_name ]

Default tag is [ axiom ]

Allowed names for tags have format [a-zA-Z0-9]{1,}

Modifiers

You can use modifiers with your tags. They will transform passed value into provided case.

[ axiom | pascalcase ]

Available modifiers:

  • pascalcase -> pascalCase
  • snakecase -> snake_case
  • camelcase -> CamelCase
  • kebabcase -> kebab-case

Reminders

  • Default tag is [ axiom ]
  • You can use native autocompletion of your shell to select templates and target destinations
  • Tags can be placed into file and directory names
  • There are modifiers which transform provided value into desired case [ axiom | pascalcase ]

About

Code generator written in Go

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages