Skip to content

Commit 6952bfc

Browse files
committed
refactor: reformatted codebase
1 parent bb3e248 commit 6952bfc

21 files changed

+161
-124
lines changed

.eslintrc.cjs

+26-26
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
/* eslint-env node */
22

33
module.exports = {
4-
root: true,
5-
env: { browser: true, es2020: true },
6-
extends: [
7-
'eslint:recommended',
8-
'plugin:@typescript-eslint/recommended',
9-
'plugin:@typescript-eslint/recommended-requiring-type-checking',
10-
'plugin:react-hooks/recommended',
11-
],
12-
parser: '@typescript-eslint/parser',
13-
parserOptions: {
14-
ecmaVersion: 'latest',
15-
sourceType: 'module',
16-
project: true,
17-
tsconfigRootDir: __dirname,
18-
},
19-
plugins: ['react-refresh'],
20-
rules: {
21-
'react-refresh/only-export-components': [
22-
'warn',
23-
{ allowConstantExport: true },
4+
root: true,
5+
env: {browser: true, es2020: true},
6+
extends: [
7+
'eslint:recommended',
8+
'plugin:@typescript-eslint/recommended',
9+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
10+
'plugin:react-hooks/recommended',
2411
],
25-
'@typescript-eslint/no-non-null-assertion': 'off',
26-
semi: 2,
27-
quotes: [1, "single"],
28-
'no-console': 2,
29-
},
30-
}
12+
parser: '@typescript-eslint/parser',
13+
parserOptions: {
14+
ecmaVersion: 'latest',
15+
sourceType: 'module',
16+
project: true,
17+
tsconfigRootDir: __dirname,
18+
},
19+
plugins: ['react-refresh'],
20+
rules: {
21+
'react-refresh/only-export-components': [
22+
'warn',
23+
{allowConstantExport: true},
24+
],
25+
'@typescript-eslint/no-non-null-assertion': 'off',
26+
semi: 2,
27+
quotes: [1, 'single'],
28+
'no-console': 2,
29+
},
30+
};

README.md

+29-12
Original file line numberDiff line numberDiff line change
@@ -15,37 +15,50 @@ Go to the official page by clicking [this link](https://thewilley.github.io/Text
1515

1616
## Introduction
1717

18-
Text2Book is a web application that allows users to convert text into Minecraft books by generating commands for command blocks or text sections which can be manually copied over. This tool is designed to simplify the process of creating in-game books with custom content for Minecraft players and mapmakers. Instead of manually entering lengthy commands or taking a wild guess how much text to copy over on each page, Text2Book automates the process, making it quicker and more user-friendly.
18+
Text2Book is a web application that allows users to convert text into Minecraft books by generating commands for command
19+
blocks or text sections which can be manually copied over. This tool is designed to simplify the process of creating
20+
in-game books with custom content for Minecraft players and mapmakers. Instead of manually entering lengthy commands or
21+
taking a wild guess how much text to copy over on each page, Text2Book automates the process, making it quicker and more
22+
user-friendly.
1923

2024
## Features
25+
2126
- **Text Input**: Enter the desired text content directly into the application.
2227
- **Command Generation**: Generate the necessary commands to create the Minecraft books with the desired content.
23-
- **Text Generation**: Generate text sections which can be copied over to your Minecraft book.
28+
- **Text Generation**: Generate text sections which can be copied over to your Minecraft book.
2429
- **Copy to Clipboard**: Easily copy the generated commands to your clipboard for quick in-game implementation.
2530

2631
## How to Use
2732

2833
There are two generation modes you can choose from: **Commands** or **Text**.
2934

30-
3135
### Text Generation:
36+
3237
1. **Input Text**: Enter the content you wish to appear in your Minecraft book in the designated text box.
3338

34-
2. **Generate Text**: Click the "Generate Text" button after entering your desired content. The application will process your input and generate the necessary sections of text for your Minecraft book.
39+
2. **Generate Text**: Click the "Generate Text" button after entering your desired content. The application will process
40+
your input and generate the necessary sections of text for your Minecraft book.
3541

36-
3. **Copy Text**: Once the text sections are generated, they will be displayed on the screen. Click the "Copy" button next to each section to copy them to your clipboard.
42+
3. **Copy Text**: Once the text sections are generated, they will be displayed on the screen. Click the "Copy" button
43+
next to each section to copy them to your clipboard.
3744

38-
4. **Implement in Minecraft**: Open Minecraft and access the book interface. Paste the copied text sections into each page of the book manually.
45+
4. **Implement in Minecraft**: Open Minecraft and access the book interface. Paste the copied text sections into each
46+
page of the book manually.
3947

4048
### Command Generation
4149

42-
1. **Input Text**: On the main page, you will find a text input box where you can enter the content you want to appear in your Minecraft book.
50+
1. **Input Text**: On the main page, you will find a text input box where you can enter the content you want to appear
51+
in your Minecraft book.
4352

44-
2. **Generate Commands**: After entering desired content, click the "Generate" button. The application will process your input and generate the necessary commands to create the Minecraft book with the given content.
53+
2. **Generate Commands**: After entering desired content, click the "Generate" button. The application will process your
54+
input and generate the necessary commands to create the Minecraft book with the given content.
4555

46-
4. **Copy Commands**: Once the commands are generated, you will see them on the screen. Click the "Copy" button next to the commands to copy them to your clipboard.
56+
4. **Copy Commands**: Once the commands are generated, you will see them on the screen. Click the "Copy" button next to
57+
the commands to copy them to your clipboard.
4758

48-
5. **Implement in Minecraft**: Open your Minecraft world and access a command block. Paste the copied commands into the command block to create the Minecraft book. Activate the command block, and the book will be available in-game for players to read.
59+
5. **Implement in Minecraft**: Open your Minecraft world and access a command block. Paste the copied commands into the
60+
command block to create the Minecraft book. Activate the command block, and the book will be available in-game for
61+
players to read.
4962

5063
## Installation
5164

@@ -63,8 +76,12 @@ To run the application without any installation, go to [this link](https://thewi
6376

6477
## License
6578

66-
Text2Book is licensed under the [MIT License](LICENSE), which allows you to use, modify, and distribute the code for personal and commercial purposes. However, it comes with no warranties or guarantees. If you use Text2Book, please provide attribution to the original repository and authors.
79+
Text2Book is licensed under the [MIT License](LICENSE), which allows you to use, modify, and distribute the code for
80+
personal and commercial purposes. However, it comes with no warranties or guarantees. If you use Text2Book, please
81+
provide attribution to the original repository and authors.
6782

6883
---
6984

70-
I hope you find Text2Book useful for creating custom Minecraft books! Enjoy your Minecraft adventures with personalized in-game books! If you have any questions or encounter any issues, feel free to reach out to me through the repository's issue tracker. Happy gaming!
85+
I hope you find Text2Book useful for creating custom Minecraft books! Enjoy your Minecraft adventures with personalized
86+
in-game books! If you have any questions or encounter any issues, feel free to reach out to me through the repository's
87+
issue tracker. Happy gaming!

index.html

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/favicon-32x32.png" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
3+
<head>
4+
<meta charset="UTF-8"/>
5+
<link rel="icon" type="image/svg+xml" href="/favicon-32x32.png"/>
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
77
<title>Text2Book</title>
8-
</head>
9-
<body>
10-
<div id="root"></div>
11-
<script type="module" src="/src/main.tsx"></script>
12-
</body>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
1313
</html>

postcss.config.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default {
2-
plugins: {
3-
tailwindcss: {},
4-
autoprefixer: {},
5-
},
6-
}
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
};

src/assets/loader.svg

+14-13
Loading

src/assets/react.svg

+5-1
Loading

src/components/FileUpload.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function FileUpload(props: { callback: (text: string) => void, useFileUpload: bo
1010
id="file-upload"
1111
type="file"
1212
onChange={handleFileChange}
13-
accept='.txt'
13+
accept=".txt"
1414
className="opacity-0 absolute z-0 w-full h-full"
1515
required={props.useFileUpload}
1616
/>

src/components/Footer.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ function Footer() {
22
return (
33
<footer className="fixed bottom-0 p-2 left-0 w-full bg-white">
44
<div className="text-center w-full font-bold">
5-
Made with ❤️ by <a className="text-blue-700 hover:underline" href="https://github.com/TheWilley/text2book" target="_blank"> TheWilley </a>
5+
Made with ❤️ by <a className="text-blue-700 hover:underline"
6+
href="https://github.com/TheWilley/text2book" target="_blank"> TheWilley </a>
67
</div>
78
</footer>
89
);

src/components/Form.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function Form(props: { showResults: ShowResults }) {
109109
Text
110110
</label>
111111
<div>
112-
<div className={classNames({'hidden': inputFormat === 'text' })}>
112+
<div className={classNames({'hidden': inputFormat === 'text'})}>
113113
<FileUpload callback={(text) => setText(text)} useFileUpload={inputFormat === 'file'}/>
114114
</div>
115115
<div className={classNames({'hidden': inputFormat === 'file'})}>
@@ -128,7 +128,7 @@ function Form(props: { showResults: ShowResults }) {
128128
type="submit"
129129
className="w-full h-10 bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline"
130130
>
131-
<ButtonTitle />
131+
<ButtonTitle/>
132132
</button>
133133
</form>
134134
</>

0 commit comments

Comments
 (0)