Skip to content

Commit 0fede0e

Browse files
committed
docs(bbcode): Update bbcode files
1 parent 07beece commit 0fede0e

File tree

2 files changed

+256
-0
lines changed

2 files changed

+256
-0
lines changed

Docs/XMLDIffWithVSCode.egosoft

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
[size=140][u]Using XMLDIff with Visual Studio Code[/u][/size]
2+
3+
[size=130][u]Introduction[/u][/size]
4+
5+
This document describes how to use XMLDiff with Visual Studio Code.
6+
7+
[size=130][u]Prerequisites[/u][/size]
8+
[list]
9+
[*] Visual Studio Code
10+
[*] XMLDiff.exe and [url=https://github.com/chemodun/X4-XMLDiffAndPatch/raw/main///forVSCode/RunXMLDiff.bat]RunXMLDiff.bat[/url] from this repository
11+
[*] VSCode extension [url=https://marketplace.visualstudio.com/items?itemName=emeraldwalk.RunOnSave]Run on Save[/url] by [url=https://marketplace.visualstudio.com/publishers/emeraldwalk]emeraldwalk[/url]
12+
[/list]
13+
[size=130][u]Steps[/u][/size]
14+
[list=1]
15+
[*] Prepare a folders structure like the following:
16+
[/list]
17+
[code=plaintext]
18+
RootExtensionFolder
19+
│ XMLDiffAndPatch
20+
│ │ XMLDiff.exe
21+
│ RunXMLDiff.bat
22+
│ aiscripts
23+
│ aiscripts.modified
24+
│ aiscripts.original
25+
│ md
26+
│ md.modified
27+
│ md.original
28+
[/code]
29+
[list=1]
30+
[*] You can skip creation [b]*.original[/b] folders, if you will use the [b]extracted[/b] files folder.
31+
[*] Copy the [url=https://github.com/chemodun/X4-XMLDiffAndPatch/raw/main///forVSCode/RunXMLDiff.bat]RunXMLDiff.bat[/url] file to the root of your project.
32+
[*] Copy the [b]XMLDiff.exe[/b] file to the [b]XMLDiffAndPatch[/b] folder in the root of your project.
33+
[*] Install the VSCode extension [url=https://marketplace.visualstudio.com/items?itemName=emeraldwalk.RunOnSave]Run on Save[/url] by [url=https://marketplace.visualstudio.com/publishers/emeraldwalk]emeraldwalk[/url]
34+
[*] Open the settings of the extension by pressing [b]Ctrl + ,[/b] and search for [b]runOnSave.commands[/b]
35+
[*] Add the following configuration to the settings:
36+
[/list] 7.1 In case of not to use the "Extracted" files folder, i.e. with [b]*.original[/b] folders:
37+
38+
[code=json]
39+
"commands": [
40+
{
41+
"match": "\\.modified\\\\.+?\\.xml$",
42+
"cmd": "${workspaceFolder}\\RunXMLDiff.bat ${file} ${workspaceFolder}\\XMLDiffAndPatch\\XMLDiff.exe
43+
}
44+
]
45+
[/code]
46+
47+
7.2. With the [b]extracted[/b] folder, which is outside the project folder:
48+
49+
[code=json]
50+
"commands": [
51+
{
52+
"match": "\\.modified\\\\.+?\\.xml$",
53+
"cmd": "${workspaceFolder}\\RunXMLDiff.bat ${file} ${workspaceFolder}\\XMLDiffAndPatch\\XMLDiff.exe" ${workspaceFolder}\\..\\extracted"
54+
}
55+
]
56+
[/code]
57+
58+
Take in account that with the [b]extracted[/b] folder you still can use the [b]*.original[/b] folders for original files. It will be used first, if they exist, otherwise the script will use the [b]extracted[/b] folder.
59+
[list=1]
60+
[*] Save the settings and close the settings tab.
61+
[/list]
62+
Now you can modify the [b]*.modified[/b] files and the [b]RunXMLDiff.bat[/b] will be executed automatically on save.
63+
64+
You can check an output in the [b]OUTPUT[/b] tab in the VSCode, selecting the [b]Run on Save[/b] item in the dropdown list.
65+
66+
[size=130][u]Description of the RunXMLDiff.bat[/u][/size]
67+
68+
[b]RunXMLDiff.bat[/b] is a batch script that compares a modified XML file with its original version using the [b]XMLDiff.exe[/b] utility. The script takes the paths to the modified file, the XMLDiff utility, and optionally the path to the original files as input. It then constructs the appropriate paths, checks for the existence of necessary files and directories, and runs the XMLDiff utility to generate a diff file.
69+
70+
[size=125][u]Usage[/u][/size]
71+
72+
[code=batch]
73+
RunXMLDiff.bat <ModifiedFilePath> <XMLDiffPath> [OriginalFilesPath]
74+
[/code]
75+
76+
[size=120][u]Parameters[/u][/size]
77+
[list]
78+
[*] [b]<ModifiedFilePath>[/b]: The full path to the modified XML file. This parameter is mandatory.
79+
[*] [b]<XMLDiffPath>[/b]: The full path to the [b]XMLDiff.exe[/b] utility. This parameter is mandatory.
80+
[*] [b][OriginalFilesPath][/b]: The full path to the directory containing the original XML files. This parameter is optional.
81+
[/list]
82+
[size=120][u]Example[/u][/size]
83+
84+
[code=batch]
85+
RunXMLDiff.bat "C:\path\to\md.modified\file.xml" "C:\path\to\XMLDiff.exe" "C:\path\to\original\files"
86+
[/code]
87+
88+
[size=120][u]How It Works[/u][/size]
89+
[list=1]
90+
[*] [b]Extract Type and Filename[/b]: The script extracts the type (e.g., [b]aiscript[/b] or [b]md[/b]) and filename from the modified file path.
91+
[*] [b]Determine Target File Path[/b]: The script constructs the target file path by removing [b].modified[/b] from the modified file path.
92+
[*] [b]Determine Original File Path[/b]:
93+
[/list][list][list]
94+
[*] If the [b]OriginalFilesPath[/b] is provided, the original file path is constructed as [b]OriginalFilesPath\type\filename[/b].
95+
[*] If the [b]OriginalFilesPath[/b] is not provided, the original file path is constructed by replacing [b].modified[/b] with [b].original[/b] in the modified file path.
96+
[/list]
97+
[/list]4. [b]Check Existence[/b]:
98+
[list][list]
99+
[*] The script checks for the existence of [b]XMLDiff.exe[/b], the modified file, the original file, and the target file directory.
100+
[/list]
101+
[/list]5. [b]Run XMLDiff[/b]: If all checks pass, the script runs [b]XMLDiff.exe[/b] with the appropriate parameters to generate the diff file.
102+
103+
[size=125][u]Error Handling[/u][/size]
104+
105+
The script will output error messages and exit with a non-zero status code if any of the following conditions are met:
106+
[list]
107+
[*] [b]XMLDiff.exe[/b] is not found at the specified path.
108+
[*] The modified file is not found at the specified path.
109+
[*] The original file is not found at the constructed path.
110+
[*] The target file directory does not exist.
111+
[/list]
112+
[size=125][u]Output[/u][/size]
113+
114+
If the script runs successfully, it will output a message indicating that the XMLDiff operation completed successfully and provide the path to the generated diff file.
115+
116+
[size=130][u]Notes[/u][/size]
117+
[list]
118+
[*] Ensure that the [b]XMLDiff.exe[/b] utility is accessible and has the necessary permissions to execute.
119+
[*] The script assumes that the modified file path follows the convention where the last folder in the path is of the form [b]type.modified[/b].
120+
[*] If you have some beautification plugins for XML use the alternative save (Ctrl + K S, i.e. "Save without Formatting), which will not involve them, to get the diff as small as possible.
121+
[/list]
122+
[size=130][u]Demo[/u][/size]
123+
124+
[spoiler][img]https://www.youtube.com/watch?v=Jm5Yfu7PrmI[/img][/spoiler]
125+
126+
[size=130][u]License[/u][/size]
127+
128+
This script is provided "as-is" without any warranty. Use it at your own risk.

Docs/XMLDIffWithVSCode.nexus

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
[size=4][u]Using XMLDIff with Visual Studio Code[/u][/size]
2+
3+
[size=3][u][b]Introduction[/b][/u][/size]
4+
5+
This document describes how to use XMLDiff with Visual Studio Code.
6+
7+
[size=3][u][b]Prerequisites[/b][/u][/size]
8+
[list]
9+
[*] Visual Studio Code
10+
[*] XMLDiff.exe and [url=https://github.com/chemodun/X4-XMLDiffAndPatch/raw/main///forVSCode/RunXMLDiff.bat]RunXMLDiff.bat[/url] from this repository
11+
[*] VSCode extension [url=https://marketplace.visualstudio.com/items?itemName=emeraldwalk.RunOnSave]Run on Save[/url] by [url=https://marketplace.visualstudio.com/publishers/emeraldwalk]emeraldwalk[/url]
12+
[/list]
13+
[size=3][u][b]Steps[/b][/u][/size]
14+
[olist]
15+
[*] Prepare a folders structure like the following:
16+
[/olist]
17+
[code]
18+
RootExtensionFolder
19+
│ XMLDiffAndPatch
20+
│ │ XMLDiff.exe
21+
│ RunXMLDiff.bat
22+
│ aiscripts
23+
│ aiscripts.modified
24+
│ aiscripts.original
25+
│ md
26+
│ md.modified
27+
│ md.original
28+
[/code]
29+
[olist]
30+
[*] You can skip creation [b]*.original[/b] folders, if you will use the [b]extracted[/b] files folder.
31+
[*] Copy the [url=https://github.com/chemodun/X4-XMLDiffAndPatch/raw/main///forVSCode/RunXMLDiff.bat]RunXMLDiff.bat[/url] file to the root of your project.
32+
[*] Copy the [b]XMLDiff.exe[/b] file to the [b]XMLDiffAndPatch[/b] folder in the root of your project.
33+
[*] Install the VSCode extension [url=https://marketplace.visualstudio.com/items?itemName=emeraldwalk.RunOnSave]Run on Save[/url] by [url=https://marketplace.visualstudio.com/publishers/emeraldwalk]emeraldwalk[/url]
34+
[*] Open the settings of the extension by pressing [b]Ctrl + ,[/b] and search for [b]runOnSave.commands[/b]
35+
[*] Add the following configuration to the settings:
36+
[/olist] 7.1 In case of not to use the "Extracted" files folder, i.e. with [b]*.original[/b] folders:
37+
38+
[code]
39+
"commands": [
40+
{
41+
"match": "\\.modified\\\\.+?\\.xml$",
42+
"cmd": "${workspaceFolder}\\RunXMLDiff.bat ${file} ${workspaceFolder}\\XMLDiffAndPatch\\XMLDiff.exe
43+
}
44+
]
45+
[/code]
46+
47+
7.2. With the [b]extracted[/b] folder, which is outside the project folder:
48+
49+
[code]
50+
"commands": [
51+
{
52+
"match": "\\.modified\\\\.+?\\.xml$",
53+
"cmd": "${workspaceFolder}\\RunXMLDiff.bat ${file} ${workspaceFolder}\\XMLDiffAndPatch\\XMLDiff.exe" ${workspaceFolder}\\..\\extracted"
54+
}
55+
]
56+
[/code]
57+
58+
Take in account that with the [b]extracted[/b] folder you still can use the [b]*.original[/b] folders for original files. It will be used first, if they exist, otherwise the script will use the [b]extracted[/b] folder.
59+
[olist]
60+
[*] Save the settings and close the settings tab.
61+
[/olist]
62+
Now you can modify the [b]*.modified[/b] files and the [b]RunXMLDiff.bat[/b] will be executed automatically on save.
63+
64+
You can check an output in the [b]OUTPUT[/b] tab in the VSCode, selecting the [b]Run on Save[/b] item in the dropdown list.
65+
66+
[size=3][u][b]Description of the RunXMLDiff.bat[/b][/u][/size]
67+
68+
[b]RunXMLDiff.bat[/b] is a batch script that compares a modified XML file with its original version using the [b]XMLDiff.exe[/b] utility. The script takes the paths to the modified file, the XMLDiff utility, and optionally the path to the original files as input. It then constructs the appropriate paths, checks for the existence of necessary files and directories, and runs the XMLDiff utility to generate a diff file.
69+
70+
[size=3][u][i]Usage[/i][/u][/size]
71+
72+
[code]
73+
RunXMLDiff.bat <ModifiedFilePath> <XMLDiffPath> [OriginalFilesPath]
74+
[/code]
75+
76+
[size=3][u]Parameters[/u][/size]
77+
[list]
78+
[*] [b]<ModifiedFilePath>[/b]: The full path to the modified XML file. This parameter is mandatory.
79+
[*] [b]<XMLDiffPath>[/b]: The full path to the [b]XMLDiff.exe[/b] utility. This parameter is mandatory.
80+
[*] [b][OriginalFilesPath][/b]: The full path to the directory containing the original XML files. This parameter is optional.
81+
[/list]
82+
[size=3][u]Example[/u][/size]
83+
84+
[code]
85+
RunXMLDiff.bat "C:\path\to\md.modified\file.xml" "C:\path\to\XMLDiff.exe" "C:\path\to\original\files"
86+
[/code]
87+
88+
[size=3][u]How It Works[/u][/size]
89+
[olist]
90+
[*] [b]Extract Type and Filename[/b]: The script extracts the type (e.g., [b]aiscript[/b] or [b]md[/b]) and filename from the modified file path.
91+
[*] [b]Determine Target File Path[/b]: The script constructs the target file path by removing [b].modified[/b] from the modified file path.
92+
[*] [b]Determine Original File Path[/b]:
93+
[/olist][list][list]
94+
[*] If the [b]OriginalFilesPath[/b] is provided, the original file path is constructed as [b]OriginalFilesPath\type\filename[/b].
95+
[*] If the [b]OriginalFilesPath[/b] is not provided, the original file path is constructed by replacing [b].modified[/b] with [b].original[/b] in the modified file path.
96+
[/list]
97+
[/list]4. [b]Check Existence[/b]:
98+
[list][list]
99+
[*] The script checks for the existence of [b]XMLDiff.exe[/b], the modified file, the original file, and the target file directory.
100+
[/list]
101+
[/list]5. [b]Run XMLDiff[/b]: If all checks pass, the script runs [b]XMLDiff.exe[/b] with the appropriate parameters to generate the diff file.
102+
103+
[size=3][u][i]Error Handling[/i][/u][/size]
104+
105+
The script will output error messages and exit with a non-zero status code if any of the following conditions are met:
106+
[list]
107+
[*] [b]XMLDiff.exe[/b] is not found at the specified path.
108+
[*] The modified file is not found at the specified path.
109+
[*] The original file is not found at the constructed path.
110+
[*] The target file directory does not exist.
111+
[/list]
112+
[size=3][u][i]Output[/i][/u][/size]
113+
114+
If the script runs successfully, it will output a message indicating that the XMLDiff operation completed successfully and provide the path to the generated diff file.
115+
116+
[size=3][u][b]Notes[/b][/u][/size]
117+
[list]
118+
[*] Ensure that the [b]XMLDiff.exe[/b] utility is accessible and has the necessary permissions to execute.
119+
[*] The script assumes that the modified file path follows the convention where the last folder in the path is of the form [b]type.modified[/b].
120+
[*] If you have some beautification plugins for XML use the alternative save (Ctrl + K S, i.e. "Save without Formatting), which will not involve them, to get the diff as small as possible.
121+
[/list]
122+
[size=3][u][b]Demo[/b][/u][/size]
123+
124+
[img]https://www.youtube.com/watch?v=Jm5Yfu7PrmI[/img]
125+
126+
[size=3][u][b]License[/b][/u][/size]
127+
128+
This script is provided "as-is" without any warranty. Use it at your own risk.

0 commit comments

Comments
 (0)