Skip to content

Commit 902deb5

Browse files
committed
feat: move file encoding out of editing text
1 parent 5b45e4a commit 902deb5

3 files changed

Lines changed: 41 additions & 37 deletions

File tree

docs/03-editing-text.md

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -72,42 +72,6 @@ Move your cursor out of the tag and then back into the tag.
7272

7373
---
7474

75-
## File Encoding
76-
**File encoding** is the method used to represent text in a file by converting characters into bytes. We need it to ensure that text is displayed correctly across different platforms and to handle special characters or symbols. Phoenix Code Editor supports multiple file encoding formats.
77-
78-
*`UTF-8`* is the default encoding format in Phoenix.
79-
80-
### Set Encoding of a file
81-
1. Click on the `utf8` button on the status bar. (UTF-8 represents the default encoding format).
82-
2. A list of available encoding formats will appear. Select your desired format, or start typing to filter and find matching options in the drop-down menu.
83-
84-
![File Encoding Image](images/editingText/file-encoding.png "Click on utf8 button on status bar and select the encoding format")
85-
86-
---
87-
88-
## File Type Associations
89-
**File Type Associations** *(Associating a file type with a language)* allows Phoenix Code Editor to provide language-specific features, such as syntax highlighting, code completion, and error checking, based on the file extension. This ensures that your files are treated according to their intended programming or markup language.
90-
91-
*When you create a new file, if the file extension is recognized, it is associated with the default language. If the extension is unknown, a generic text file is opened.*
92-
93-
### Associate a new file type with a language
94-
To associate a new file type with a specific language in Phoenix Code Editor, use the Language dropdown button in the status bar. For example, if you want files with `.myjs` extension to be treated as JavaScript files, follow these steps:
95-
1. Create a new file with the desired extension. For our example, we create (newfile.myjs). By default, it will be associated with a Text file.
96-
2. Click on `Text` button on the status bar.
97-
3. A list of all the supported languages will appear. Select the language you want to associate with the file type. For our example, we select `JavaScript`.
98-
99-
![File Association Image](images/editingText/file-association.png "Click on Text button on status bar and select the language")
100-
101-
4. At the top of the popup box, you’ll find an option labeled `Set as default for .myjs files`. Click on it.
102-
103-
Now, files with `.myjs` extension will be treated as JavaScript files.
104-
105-
<VideoPlayer
106-
src="https://docs-images.phcode.dev/videos/editing-text/file_association.mp4"
107-
/>
108-
109-
---
110-
11175
## Insert and Overwrite Mode
11276
Users can toggle between **Insert Mode** and **Overwrite Mode** for different text input behaviors.
11377

docs/04-language-and-encoding.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: Language and Encoding
3+
---
4+
5+
import React from 'react';
6+
import VideoPlayer from '@site/src/components/Video/player';
7+
8+
This section covers how **Phoenix Code** decides which language to treat a file as, and which character encoding to read and write it with. Both settings are controlled from buttons in the editor's status bar.
9+
10+
## File Encoding
11+
**File encoding** is the method used to represent text in a file by converting characters into bytes. We need it to ensure that text is displayed correctly across different platforms and to handle special characters or symbols. Phoenix Code Editor supports multiple file encoding formats.
12+
13+
*`UTF-8`* is the default encoding format in Phoenix.
14+
15+
### Set Encoding of a file
16+
1. Click on the `utf8` button on the status bar. (UTF-8 represents the default encoding format).
17+
2. A list of available encoding formats will appear. Select your desired format, or start typing to filter and find matching options in the drop-down menu.
18+
19+
![File Encoding Image](images/editingText/file-encoding.png "Click on utf8 button on status bar and select the encoding format")
20+
21+
## File Type Associations
22+
**File Type Associations** *(Associating a file type with a language)* allows Phoenix Code Editor to provide language-specific features, such as syntax highlighting, code completion, and error checking, based on the file extension. This ensures that your files are treated according to their intended programming or markup language.
23+
24+
*When you create a new file, if the file extension is recognized, it is associated with the default language. If the extension is unknown, a generic text file is opened.*
25+
26+
### Associate a new file type with a language
27+
To associate a new file type with a specific language in Phoenix Code Editor, use the Language dropdown button in the status bar. For example, if you want files with `.myjs` extension to be treated as JavaScript files, follow these steps:
28+
1. Create a new file with the desired extension. For our example, we create (newfile.myjs). By default, it will be associated with a Text file.
29+
2. Click on `Text` button on the status bar.
30+
3. A list of all the supported languages will appear. Select the language you want to associate with the file type. For our example, we select `JavaScript`.
31+
32+
![File Association Image](images/editingText/file-association.png "Click on Text button on status bar and select the language")
33+
34+
4. At the top of the popup box, you'll find an option labeled `Set as default for .myjs files`. Click on it.
35+
36+
Now, files with `.myjs` extension will be treated as JavaScript files.
37+
38+
<VideoPlayer
39+
src="https://docs-images.phcode.dev/videos/editing-text/file_association.mp4"
40+
/>

docs/08-Features/11-syntax-highlighting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ If you create a new file and the file type is not recognized, it will be treated
4646

4747
The file will now be treated as the selected language type, and syntax highlighting will be applied accordingly.
4848

49-
To learn more about **File Type Associations**. [Click Here](../03-editing-text.md#file-type-associations)
49+
To learn more about **File Type Associations**. [Click Here](../04-language-and-encoding.md#file-type-associations)
5050

5151

5252
### Change Syntax Highlighting for a Particular File Type

0 commit comments

Comments
 (0)