Skip to content

Commit

Permalink
docs: update README.md
Browse files Browse the repository at this point in the history
- add description about new features in project
- add conclusion
- add link to commit with fail GitHub Actions
  • Loading branch information
HlibPavlyk authored May 15, 2024
1 parent 007c3dc commit 02ff9ad
Showing 1 changed file with 102 additions and 18 deletions.
120 changes: 102 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
# Markdown Parser

This console application allows you to parse markdown into html. The result can be displayed in the console or saved to a file.
Markdown Parser is a console application that enables you to parse Markdown into HTML and Escape ANSI. The resulting output can be either displayed in the console or saved to a file.

This application suports both Windows and Linux operating systems.
This application supports both Windows and Linux operating systems.

## How to set up it locally?
## Features:

### Windows
- **Parse Markdown to HTML:** Convert Markdown-formatted text into HTML.
- **Flexible Output Formats:** Choose between different output formats such as HTML and escaped ANSI.

### Supported Operating Systems:

In this instruction is used Windows CMD
- **Windows:** The application can be run on Windows operating systems using the Windows Command Prompt.
- **Linux:** Similarly, it can be executed on Linux systems using the terminal.

Firstly, clone this repo using web URL:
## How to set it up locally?

### Windows

This instruction utilizes Windows CMD.

#### Cloning the Repository

Firstly, clone this repository using either the web URL:

```cmd
git clone https://github.com/HlibPavlyk/MarkdownParser.git
Expand All @@ -22,21 +34,27 @@ or via SSH certificate:
git clone git@github.com:HlibPavlyk/MarkdownParser.git
```

Then move to that repo:
#### Moving to the Repository

Then navigate to the cloned repository:

```cmd
cd MarkdownParser
```

Run application:
#### Running the Application

Run the application using the following command:

```cmd
MarkdownParser-win.exe -i <path> -o <path>
MarkdownParser-win.exe --input <path> --output <path> --format <type>
```

### Linux

Firstly, clone this repo using web URL:
#### Cloning the Repository

Firstly, clone this repository using either the web URL:

```bash
git clone https://github.com/HlibPavlyk/MarkdownParser.git
Expand All @@ -48,24 +66,57 @@ or via SSH certificate:
git clone git@github.com:HlibPavlyk/MarkdownParser.git
```

Then move to that repo:
#### Moving to the Repository

Then navigate to the cloned repository:

```bash
cd MarkdownParser/
```

Change accessebility mode:
#### Changing Accessibility Mode

Change the accessibility mode for the application:

```bash
chmod +x MarkdownParser-linux
```

Run application:
#### Running the Application

Run the application using the following command:

```bash
./MarkdownParser-linux -i <path> -o <path>
./MarkdownParser-linux --input <path> --output <path> --format <type>
```

## Running Tests

The application includes a comprehensive suite of unit tests to ensure its functionality and reliability. Currently, there are 62 unit tests implemented within the program.

To run tests in this project, you need to have the .NET SDK installed. If you don't have it yet, you can download it from the [official .NET website](https://dotnet.microsoft.com/download) or via console in linux.

After installing the .NET SDK, you can follow these steps to run the tests:

1. **Open the terminal**:

Open the command prompt (on Windows) or terminal (on macOS or Linux).

2. **Navigate to the project directory**:

Use the `cd` command to navigate to the `MarkdowmParser` directory, as we did in the previous paragraph.

3. **Run the `dotnet test` command**:

Once you're in the root directory of your project, enter the following command to run the tests:

```bash
dotnet test
```

This will execute all tests in your project and display the results in your terminal.

If you are using Linux, ensure that you have appropriate permissions to execute the `dotnet` command and that your project is compatible with the Linux environment.

## Explore all commands

Expand All @@ -79,14 +130,18 @@ Copyright (C) 2024 MarkdownParser
-o, --output Output file .html path.
-f, --format Output format (escape/html)
--help Display this help screen.
--version Display version information.
```

## Example

Lets parse text file with Markdown markup test.txt and save result to test.html using Windows version:
Lets parse text file with Markdown markup test.txt and test 2 different scenarios using Windows version:
- save result to test_html.html using HTML;
- save result to test_escape.html using Escape ANSI;

### text.txt

Expand All @@ -106,13 +161,13 @@ Lets parse text file with Markdown markup test.txt and save result to test.html
жили, полювали, ніхто в образі не був... Подумали і написали `Від колег`.
```

### Parse it:
### First scenario:

```cmd
MarkdownParser-win.exe -i test.txt -o test.html
MarkdownParser-win.exe -i test.txt -o test_html.html
```

### test.html :
### test_html.html:

```html
<p>Вовки загнали собаку, <tt>_</tt> оточили, <b>хочуть зжерти</b>. Собака просить не вбивати її, натомість обіцяє допомагати заганяти овець та іншу худобу.</p>
Expand All @@ -124,6 +179,35 @@ MarkdownParser-win.exe -i test.txt -o test.html
жили, полювали, ніхто в образі не був... Подумали і написали <tt>Від колег</tt>.</p>
```

### Second scenario:

```cmd
MarkdownParser-win.exe -i test.txt -o test_escape.html -f escape
```

### test_escape.html:

```html
Вовки загнали собаку, _ оточили, хочуть зжерти. Собака просить не вбивати її, натомість обіцяє допомагати заганяти овець та іншу худобу.

Вовки ** подумали і залишили собаку в зграї. Два роки вона їм допомагала, всьому вчила, показувала місця, полювала разом з ними...
Настала особливо голодна_зима, полювання*нев_далі, вовки голодні, зневірені. Що робити? Вирішили все-таки зжерти собаку. Зжерли. Кісточки поховали.

Поставили надгробок. `Думають`, як підписати, від кого? **Від друзів?** Так начебто які ж вони друзі, раз зжерли... _Від_ворогів?_ Так 2 роки разом пліч-о-пліч
жили, полювали, ніхто в образі не був... Подумали і написали Від колег.
```

## Revert Commit

[Link](https://github.com/HlibPavlyk/MarkdownParser/commit/6e47e0ac087f7d7d18733909c18696cd5cfe9777)

## Commit with failed GitHub Action

[Link](https://github.com/HlibPavlyk/MarkdownParser/commit/3ac2a340deb3d1a4ecc0e1a1695e44904ef71048)

## Conclusion

Even when working solo, unit tests can be immensely valuable. They act as a safety net, catching potential issues early on and ensuring the reliability of your codebase. In my experience, having a suite of unit tests provides peace of mind and confidence in the correctness of my code, allowing me to focus on implementing new features or making changes without fear of inadvertently introducing bugs. Additionally, unit tests serve as documentation for the expected behavior of your code, making it easier to understand and maintain over time. So, even if you're working alone, investing time in writing unit tests can ultimately save you time and effort by preventing future headaches and debugging sessions.



0 comments on commit 02ff9ad

Please sign in to comment.