Metadata-Version: 2.1
Name: terminal-styler
Version: 0.0.1
Summary: CLI tool for adding foreground and background colours, as well as styles such as bold, underline, and more to your terminal output.
Project-URL: Homepage, https://github.com/SamJohn04/terminal-styler
Project-URL: Bug Tracker, https://github.com/SamJohn04/terminal-styler/issues
Author-email: Samuel John <samuel.john.codes@gmail.com>
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
Description-Content-Type: text/markdown

# Terminal Styler

CLI tool for adding foreground and background colours, as well as styles such as bold, underline, and more to your terminal output.

## Prerequisites

- Python
- Support for ANSI codes in your terminal

## Execution

To run the program, execute the following command from the root directory of the project:

> ```python3 main.py <input-file> [<output-file>]```

If no output file is specified, the output file will be 

> ```styled-<input-file>```.

## Input File

The input file should be a file containing the text you wish to style. The text can be styled using the following syntax:

> ```<console[.<styles>]>text</console>```

Each style is separated by a period.

> Eg: ```<console.bold.underline.color-green>text</console>```

The following styles are supported:
- bold
- underline
- reverse-text
- color-\<color\>
- bg-\<color\>

The following colours are supported:
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- white
- grey

Each color has a dark alternative, except black and grey, represented as dark-\<color\>.
> Eg: ```<console.color-dark-red>text</console>```

You may also nest console tags within each other.
> Eg: ```<console.bold>text<console.underline>text</console></console>```

RBG colors can be specified in place of the default colors, using the syntax [#hexcode].
> Eg: ```<console.bg-[#ff0000]>text</console>```

**Note:** If you wish to use ```<console``` or ```</console>``` in your text without it being transpiled, you must prefix 'console' with a bang ```!```
> Eg: ```<!console>text</!console>``` will be transpiled to ```<console>text</console>```

One exclaimation mark will be removed from after each ```<```, if present.

## Output File

The output file will be a copy of the input file, with the text styled according to the input file. If no output file is specified, the output file will be named styled-*input-file*.

The output file will be of the same type as the input file.

**Note:** If the output file already exists, it will be overwritten.

**Note:** The application will not check if the input file is a valid file, or if the output file is a valid file name.

## Examples

### Input

```test.py```
```
print("<console.color-dark-red.bg-green.bold>Hello <console.underline>World!</console></console>")
print("<console.color-[#B8B8B8]>How are you?</console>!")
print("I <console.color-green>am</console> <console.reverse-text.bold>good</console>")
```

### Output

```styled-test.py```
```
print("[0m[31m[102m[1mHello [0m[31m[102m[1m[4mWorld![0m[31m[102m[1m[0m")
print("[0m[38;2;184;184;184mHow are you?[0m!")
print("I [0m[92mam[0m [0m[7m[1mgood[0m")
```

### Input

```Test.java```
```
package test;

public class Test {
    public static void main(String[] args) {
        System.out.println("Hello <console.bold>World!</console>");
    }
}
```

### Output

```Test.java```
```
package test;

public class Test {
    public static void main(String[] args) {
        System.out.println("Hello [0m[1mWorld![0m");
    }
}
```
