From 89a303d8f5c6d8c766b07e58bef27c463cdd9b0d Mon Sep 17 00:00:00 2001 From: Yufan You Date: Tue, 20 Jul 2021 16:48:49 +0800 Subject: [PATCH] feat: add structure for zh_tw (#198) * feat: add zh_tw * fix: update links --- CONTRIBUTING.md | 2 +- config.toml | 15 +- content/_index.zh_tw.html | 292 ++++++++++++++++++ content/about/_index.zh_tw.html | 43 +++ content/community/_index.zh_tw.md | 30 ++ content/docs/_index.zh_tw.md | 8 + content/docs/faq/_index.zh_tw.md | 30 ++ content/docs/installation/_index.zh_tw.md | 6 + .../build-from-aur/_index.zh_tw.md | 14 + .../build-from-source/_index.zh_tw.md | 44 +++ .../install-from-binaries/_index.zh_tw.md | 42 +++ .../use-artifacts/_index.zh_tw.md | 14 + content/docs/preferences/_index.zh_tw.md | 10 + .../docs/preferences/actions/_index.zh_tw.md | 120 +++++++ .../docs/preferences/advanced/_index.zh_tw.md | 64 ++++ .../preferences/appearance/_index.zh_tw.md | 70 +++++ .../preferences/code-edit/_index.zh_tw.md | 47 +++ .../preferences/extensions/_index.zh_tw.md | 129 ++++++++ .../preferences/file-path/_index.zh_tw.md | 74 +++++ .../docs/preferences/general/_index.zh_tw.md | 20 ++ .../preferences/key-bindings/_index.zh_tw.md | 6 + .../docs/preferences/language/_index.zh_tw.md | 157 ++++++++++ content/docs/setup/_index.zh_tw.md | 71 +++++ content/docs/tips/_index.zh_tw.md | 81 +++++ content/download/_index.zh_tw.html | 86 ++++++ content/need-translation-list/_index.zh_tw.md | 3 + 26 files changed, 1472 insertions(+), 6 deletions(-) create mode 100644 content/_index.zh_tw.html create mode 100644 content/about/_index.zh_tw.html create mode 100644 content/community/_index.zh_tw.md create mode 100755 content/docs/_index.zh_tw.md create mode 100644 content/docs/faq/_index.zh_tw.md create mode 100644 content/docs/installation/_index.zh_tw.md create mode 100644 content/docs/installation/build-from-aur/_index.zh_tw.md create mode 100644 content/docs/installation/build-from-source/_index.zh_tw.md create mode 100644 content/docs/installation/install-from-binaries/_index.zh_tw.md create mode 100644 content/docs/installation/use-artifacts/_index.zh_tw.md create mode 100644 content/docs/preferences/_index.zh_tw.md create mode 100644 content/docs/preferences/actions/_index.zh_tw.md create mode 100644 content/docs/preferences/advanced/_index.zh_tw.md create mode 100644 content/docs/preferences/appearance/_index.zh_tw.md create mode 100644 content/docs/preferences/code-edit/_index.zh_tw.md create mode 100644 content/docs/preferences/extensions/_index.zh_tw.md create mode 100644 content/docs/preferences/file-path/_index.zh_tw.md create mode 100644 content/docs/preferences/general/_index.zh_tw.md create mode 100644 content/docs/preferences/key-bindings/_index.zh_tw.md create mode 100644 content/docs/preferences/language/_index.zh_tw.md create mode 100644 content/docs/setup/_index.zh_tw.md create mode 100644 content/docs/tips/_index.zh_tw.md create mode 100644 content/download/_index.zh_tw.html create mode 100644 content/need-translation-list/_index.zh_tw.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1eb6e1b29..9859c206e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -83,7 +83,7 @@ If you are using [VS Code](https://github.com/microsoft/vscode), you can use the ## Translations -For example, the Chinese (zh) version of a page is usually `_index.zh.md` while the English version is `_index.md`. +For example, the Simplified Chinese (zh) version of a page is usually `_index.zh.md` while the English version is `_index.md`. To add a new language, add it in [config.toml](config.toml) and add `_index.xx.md`s for it. diff --git a/config.toml b/config.toml index 79bb115be..9fcb03207 100644 --- a/config.toml +++ b/config.toml @@ -67,16 +67,21 @@ title = "CP Editor" description = "The IDE for competitive programming" languageName = "English" weight = 1 -[languages.zh] -title = "CP Editor" -description = "专为算法竞赛设计的 IDE" -languageName = "中文" -weight = 2 [languages.ru] title = "CP Editor" description = "редактор, созданный для спортивного программирования" languageName = "Русский" +weight = 2 +[languages.zh] +title = "CP Editor" +description = "专为算法竞赛设计的 IDE" +languageName = "简体中文" weight = 3 +[languages.zh_tw] +title = "CP Editor" +description = "專為演算法競賽設計的 IDE" +languageName = "正體中文" +weight = 4 [markup] [markup.goldmark] diff --git a/content/_index.zh_tw.html b/content/_index.zh_tw.html new file mode 100644 index 000000000..f1982d6c1 --- /dev/null +++ b/content/_index.zh_tw.html @@ -0,0 +1,292 @@ ++++ +title = "CP Editor" +linkTitle = "CP Editor" + ++++ + + + + + + + + +
+ + +
+ +
+ + + +
+
+
+

How it works for you

+

CP Editor eliminates all the repetitive and boring tasks during algorithmic contests. It automates all that's reasonably possible and allows you to purely focus on your code.

+
+
+
+
+ +

Fetch test cases

+

CP Editor can fetch testcases automatically from almost all competitive programming sites. Say bye to error-prone copy-pasting.

+
+
+
+
+ +

Code faster

+

Code faster with its amazing customizable code snippets. In just two seconds you can insert a whole DFS code into your editor.

+
+
+
+
+ +

Get verdicts

+

You can get verdicts for your sample testcases in one click by built-in checkers or checkers from testlib. You can also add your own checkers.

+
+
+
+
+
+ + + +
+
+
+ +
+
+
+
+
+

Run any code
At any time

+
We know that you want to test something without a temp file
+

You can run your code in one click without saving and the hot exit feature makes it easy to restore your code from the last session.

+ Get Started Now +
+
+
+
+ +
+
+
+
+
+
+
+
+

Dark themes?
We've got you covered

+
Our lives are colorful, why not our coding editor
+

We have added five different themes for you to choose from: Light, Drakula, Monkai, Solarized Light and Solarized Dark. If that does not satisfy you, ask us on our community pages and we will provide you more.

+ Get Started Now +
+
+
+
+ +
+
+
+
+
+
+
+
+

Errors and Warnings?
We lint them while you are coding

+
Save your precious contest time with code linting
+

Using Language Servers, we provide real-time linting for errors and warnings in your code, just like Intellisense in VSCode and Atom. You can see squiggles under the warnings and hover over them to get tooltips.

+ Get Started Now +
+
+
+
+ +
+
+
+
+
+
+
+
+

We can submit your
Solutions to Codeforces

+
All thanks to Competitive Programming Community
+

We have gathered the best tools in competitive programming and merged them into one editor. One such tool is called CF Tool. We have added it so you can submit and get verdicts in the editor.

+ Get Started Now +
+
+
+
+ +
+
+
+
+
+
+
+
+ + + +
+
+
+

Unique Screens that work perfectly

+

We have made a simple yet powerful UI that shouldn't confuse you when solving problems
Everything you need is always in front of your eyes

+
+ +
+
+ + + +
+
+
+

Feedback from Community

+

Our Community support us and keep us alive. We would love to hear your feedback too!
See what other Competitive Programmers have to say about our editor

+
+ +
+
+ + + +
+
+
+
+
+
+ +
+
+
+
+

Full support for
C/C++, Java and Python

+
Use the language you like
+

We officially support three languages in the editor. You can set your own compilation commands and pass runtime arguments to your code. It really gets exciting when you have the opportunity to use different languages in different tabs with one-click options.

+ Get Started Now +
+
+
+
+
+
+ + + +
+
+
+

Impressed by our features?

+

We are excited that you have chosen to try out this editor.
We hope that our Editor will fulfill all your needs in Competitive Programming.
CP Editor is, "by competitive programmers, to competitive programmers, for competitive programmers".

+ +
+
+
+ + + + + +
diff --git a/content/about/_index.zh_tw.html b/content/about/_index.zh_tw.html new file mode 100644 index 000000000..c25d3ebd1 --- /dev/null +++ b/content/about/_index.zh_tw.html @@ -0,0 +1,43 @@ +--- +title: About CP Editor +linkTitle: About +menu: + main: + weight: 10 + +--- + + +{{< blocks/cover title="About CP Editor" image_anchor="bottom" height="min" >}} + +

An IDE specially designed for competitive programming

+ +{{< /blocks/cover >}} + +{{% blocks/lead %}} +CP Editor is a Qt-based, lightweight and cross-platform IDE specially designed for competitive programming. + +It's free software distributed under GPL-3.0. The source code is available on GitHub. +{{% /blocks/lead %}} + +{{< blocks/lead >}} + +You can: + + + +{{< /blocks/lead >}} + +{{< blocks/lead >}} + +This website is built by Hugo with the Docsy theme. + +The home page is based on the Colorlib template. + +{{< /blocks/lead >}} diff --git a/content/community/_index.zh_tw.md b/content/community/_index.zh_tw.md new file mode 100644 index 000000000..0c2538a21 --- /dev/null +++ b/content/community/_index.zh_tw.md @@ -0,0 +1,30 @@ +--- +linkTitle: Community +title: Join the CP Editor community +description: CP Editor is an open source project that everyone can use, provide suggestions and contribute to. Here are a few ways to ask for help and share ideas with us. +menu: + main: + weight: 40 +--- + +
+ +
+ +### Ask for help / Share ideas + +- [ GitHub Discussions](https://github.com/cpeditor/cpeditor/discussions) + +### Say thanks + +- [ Say thanks to CP Editor!](https://github.com/cpeditor/cpeditor/discussions/755) + +### Make complaints + +- [ CP Editor sucks](https://github.com/cpeditor/cpeditor/discussions/760) + +### Chat with other users + +- [ Telegram Group](https://t.me/cpeditor) + +
diff --git a/content/docs/_index.zh_tw.md b/content/docs/_index.zh_tw.md new file mode 100755 index 000000000..f72f73291 --- /dev/null +++ b/content/docs/_index.zh_tw.md @@ -0,0 +1,8 @@ +--- +title: "Documentation" +linkTitle: "Documentation" +weight: 20 +menu: + main: + weight: 20 +--- diff --git a/content/docs/faq/_index.zh_tw.md b/content/docs/faq/_index.zh_tw.md new file mode 100644 index 000000000..db1188b11 --- /dev/null +++ b/content/docs/faq/_index.zh_tw.md @@ -0,0 +1,30 @@ +--- +title: "FAQ" +linkTitle: "FAQ" +weight: 70 +description: Frequently asked questions by CP Editor users +--- + +### How to fetch test cases from the websites? + +You have to install [Competitive Companion](https://github.com/jmerle/competitive-companion) on your browser, and use it on the website while CP Editor is running. [Here is a youtube video](https://youtu.be/IVx1rSqYz7c) demonstrating this setup. + +### How to submit to CF inside CP Editor? + +You have to either parse the problem from Competitive Companion, or set the problem URL in the right-click menu of the tabs. Then you'll see the submit button. + +### I am using it on Codeforces but the submit button is not clickable. + +It's because CP Editor can't run the `cf` command. Please make sure it's in the PATH or set the path to it in the Preferences. + +### When I click the Submit button, I get some message saying template is required? + +CF-Tool requires you to configure it before you use it. Please run `cf config` in the terminal to set the username & password and add a template. + +### How to enable error linting in the code editor? + +You need to install a [Language Server program](https://microsoft.github.io/language-server-protocol/implementors/servers/) and set the settings in Preferences -> Extensions -> Language Server. You can learn about more details [here](../setup/\_index.zh_tw.md#setup-language-server). + +### My code gets TLE on every first execution after compilation. + +It's probably because your anti-virus software is scanning your program. A possible solution is to [set the output directory of the executable files](../preferences/language/\_index.zh_tw.md#c-executable-file-path) (for example, you can set it to `D:/cpeditor-executables/${basename}`), and add that directory (`D:/cpeditor-executables` in the example) in the whitelist of your anti-virus software. diff --git a/content/docs/installation/_index.zh_tw.md b/content/docs/installation/_index.zh_tw.md new file mode 100644 index 000000000..c9805207f --- /dev/null +++ b/content/docs/installation/_index.zh_tw.md @@ -0,0 +1,6 @@ +--- +title: "Installation" +linkTitle: "Installation" +weight: 10 +description: Different ways to install CP Editor on your machine +--- diff --git a/content/docs/installation/build-from-aur/_index.zh_tw.md b/content/docs/installation/build-from-aur/_index.zh_tw.md new file mode 100644 index 000000000..d51043f67 --- /dev/null +++ b/content/docs/installation/build-from-aur/_index.zh_tw.md @@ -0,0 +1,14 @@ +--- +title: "Build from AUR" +linkTitle: "Build from AUR" +weight: 40 +description: This is recommended for Arch Linux users. You can use an AUR helper to check for updates and get the latest features. What's more, since the AppImage is built on Ubuntu, you can only use the fusion theme, but if it's built on Arch Linux with KDE you can use other themes like Breeze. +--- + +This method is only for Arch Linux (or other distros based on Arch Linux, including Manjaro) users. + +There are two AUR packages for CP Editor: [cpeditor](https://aur.archlinux.org/packages/cpeditor/) for the stable version and [cpeditor-git](https://aur.archlinux.org/packages/cpeditor-git/) for the alpha version. + +If you have `yay` installed, you can run `yay -S cpeditor` to install. If you don't have `yay` and don't know how to install from AUR, you can read [how to install yay](https://github.com/Jguer/yay#installation) or [the Arch Wiki](https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_and_upgrading_packages). + +After the installation, you'll be able to run CP Editor by `cpeditor` in your terminal or launch from the start menu like other apps. diff --git a/content/docs/installation/build-from-source/_index.zh_tw.md b/content/docs/installation/build-from-source/_index.zh_tw.md new file mode 100644 index 000000000..4af61e97c --- /dev/null +++ b/content/docs/installation/build-from-source/_index.zh_tw.md @@ -0,0 +1,44 @@ +--- +title: "Build from source" +linkTitle: "Build from source" +weight: 20 +description: In this way, you can get the latest unreleased features and get ready for contributing. It needs more steps but is the only choice if your OS is not officially supported. +--- + +1. Clone this repo and submodules: + + ```sh + git clone --recurse-submodules https://github.com/cpeditor/cpeditor.git + cd cpeditor + ``` + +2. Install [Qt](https://www.qt.io/download) (5.15 or higher), [CMake](https://cmake.org/download/) (3.12 or higher) and [Python3](https://www.python.org/downloads/). + - On some Linux distributions and macOS, you can install from your package manager. For example, `sudo pacman -S qt5` on Arch Linux, `brew install qt5` on macOS. + - You can also use [aqtinstall](https://github.com/miurahr/aqtinstall) to install Qt. + +3. If CMake can't find the Qt installation path, you should set the environment variable: `CMAKE_PREFIX_PATH=%QtPath%/%QtVersion%/%Compiler%/lib/cmake`. For example, on macOS, you can run something like `export CMAKE_PREFIX_PATH="/usr/local/Cellar/qt/5.15.1"`. + +4. Run the following commands: + + - Linux/macOS: + + ```sh + mkdir build + cd build + cmake .. -DCMAKE_BUILD_TYPE=Release + cmake --build . + ``` + + - Windows: + ```bat + mkdir build + cd build + cmake .. + cmake --build . --config Release + ``` + +On Linux, you will get `build/cpeditor`. + +On macOS, you will get `build/cpeditor.app`. + +On Windows, you will get `build\cpeditor.exe`, or `build\Release\cpeditor.exe`. If DLLs are missing, you can add `%QtPath%\%QtVersion%\%Compiler%\bin` (for example, `D:\Qt\5.15.1\msvc2019_64\bin`) to the PATH environmental variable. diff --git a/content/docs/installation/install-from-binaries/_index.zh_tw.md b/content/docs/installation/install-from-binaries/_index.zh_tw.md new file mode 100644 index 000000000..77bdf1116 --- /dev/null +++ b/content/docs/installation/install-from-binaries/_index.zh_tw.md @@ -0,0 +1,42 @@ +--- +title: "Install from binaries" +linkTitle: "Install from binaries" +weight: 10 +description: This is the easiest way to install CP Editor, and is recommended for most users. +--- + +Choose a version in the [Releases](https://github.com/cpeditor/cpeditor/releases), then download your binary. + +### Windows + +#### Setup Version + +> The setup version needs to be installed on your machine. The setting files will be stored in the config directory on your system, and it will be visible in the list of installed programs on your system. + +Download the `setup.exe` in the assets and install it. + +#### Portable Version + +> The portable version can be executed without installation. The setting files will be stored in the same directory as the executable file, and you won't see it in the list of installed programs on your system. + +Download the `portable.zip` in the assets and unzip it to any directory you like. + +### Most Linux Distros + +Download the `AppImage` in the assets, add execute permission to it (`chmod +x `), then run it. + +### Debian-based Linux Distros + +On Debian-based Linux distributions (Ubuntu, Linux Mint, etc.) you can download the `.deb` package in the assets and run the command in the terminal: + +```sh +sudo apt install +``` + +Then type your root password and agree with the installation. You can also use `Gdebi` or other graphical tools to install the `deb` package. Supported: Debian 10 Buster, Ubuntu 18.04 Bionic Beaver, Linux Mint 19 Tara, and newer versions of these distributions or the ones based on them. + +### macOS + +Download the `.dmg` file in the assets and install it. + +You may need to click "Yes" to access Filesystem several times. Apple may report that this application does not come from a recognized developer and prevent you from launching the app. Please add an exception to CP Editor from `System Preferences -> Security & Privacy -> General`, and allow CP Editor to `run anyways` diff --git a/content/docs/installation/use-artifacts/_index.zh_tw.md b/content/docs/installation/use-artifacts/_index.zh_tw.md new file mode 100644 index 000000000..743f1bfad --- /dev/null +++ b/content/docs/installation/use-artifacts/_index.zh_tw.md @@ -0,0 +1,14 @@ +--- +title: "Use Artifacts" +linkTitle: "Use Artifacts" +weight: 30 +description: In this way, you can get the latest unreleased features without building by yourself. But not all operating systems support this, and it's only available for updating, not for the first installation. +--- + +If you want to use the latest version (even later than the beta release), but don't want to build from source, you can download Artifacts from [GitHub Actions](https://github.com/cpeditor/cpeditor/actions). + +However, it's not recommended to use Artifacts, they are more unstable than beta releases, and could be a work in progress. You should read the commit logs and even the source codes before using Artifacts. + +To run it on Windows/macOS, you should install from [Releases](https://github.com/cpeditor/cpeditor/releases) first (usually any version is OK unless something like DLL missing happens). On Windows, replace `cpeditor.exe` in your install folder with the Artifact. On macOS, run `cp path/to/Artifact cpeditor.app/Contents/MacOs`, where `cpeditor.app` is the one already installed on your machine. + +To run it on Ubuntu 18.04, you need to install Qt. Other Linux distributions may not support binaries compiled on Ubuntu 18.04. diff --git a/content/docs/preferences/_index.zh_tw.md b/content/docs/preferences/_index.zh_tw.md new file mode 100644 index 000000000..78f3f1874 --- /dev/null +++ b/content/docs/preferences/_index.zh_tw.md @@ -0,0 +1,10 @@ +--- +title: "Preferences" +linkTitle: "Preferences" +weight: 40 +description: What do the preferences mean and how to set them +--- + +You can set the preferences by either clicking Options->Preferences or pressing Ctrl+P. + +You can hover over the settings to see the tooltips. Usually, the tooltips are clear enough, but if you want a more detailed explanation, you can read the documentation. diff --git a/content/docs/preferences/actions/_index.zh_tw.md b/content/docs/preferences/actions/_index.zh_tw.md new file mode 100644 index 000000000..b8987b9f1 --- /dev/null +++ b/content/docs/preferences/actions/_index.zh_tw.md @@ -0,0 +1,120 @@ +--- +title: "Actions" +weight: 40 +--- + +## Save + +### Save Files Faster + +Use [`QFile`](https://doc.qt.io/qt-5/qfile.html) instead of [`QSaveFile`](https://doc.qt.io/qt-5/qsavefile.html) to save files. + +This is slightly unsafer but notably faster. + +### Save File On Compilation + +Save your code when compiling it. + +### Save File On Execution + +Save your code when executing it. + +### Save Testcases on Save + +Save the test cases on the disk when saving the code. + +You can choose where to save the test cases in [File Path/Testcases](../file-path/\_index.zh_tw.md#testcases). + +## Auto Save + +### Auto Save Interval Type + +It is easier to describe if we explain a little bit about the internal implementation: There is a countdown timer. When we "reset" it, it will be "running" in the next *Auto Save Interval* milliseconds, and after *Auto Save Interval* milliseconds, the timer will "timeout" and the code is auto-saved. + +#### After the last modification + +The timer is reset whenever you modify the code. i.e. Your codes will be saved if you haven't modified it for *Auto Save Interval* milliseconds. + +This mode is suitable for a small *Auto Save Interval* so that your codes will be auto-saved every time you take a short break from typing. If the interval is too long, likely, your codes will never be auto-saved. + +#### After the first modification + +The timer is reset when you modify the code if the timer is not running. i.e. Your codes will be saved if you modified it *Auto Save Interval* milliseconds ago. + +This mode is suitable for a long *Auto Save Interval*, otherwise, it's likely that the save happens when you are typing, which could affect your typing experience. + +#### Without modification + +The timer is reset when it timeouts. i.e. Your codes will be saved every *Auto Save Interval* milliseconds, no matter you have modified it or not. + +This mode is suitable for saving test cases, etc. In the other modes, the test cases are not auto-saved if you don't modify the codes. + +## Detached Execution + +### Terminal Program + +### Terminal Arguments + +This setting is only available on Linux. + +The terminal program is the name/path of the terminal emulator you want to use. + +The arguments are used to execute a given command. i.e. ` ` can be used to execute `` in the terminal emulator. + +In most terminal emulators including `konsole`, `xterm` and `xfce-terminal`, the argument is `-e`. + +In `gnome-terminal`, it is `--`. + +You can read the manual of your terminal emulator to get the suitable arguments. + +## Save Session + +### Restore last session at startup + +Save the status of the editor, and restore most status from the last session when you start CP Editor. + +You can use the `--no-hot-exit` command-line option to temporarily disable this, in case that the last session is too big and the application hangs. + +### Auto-save the current session periodically + +Save the current session periodically instead of only when exiting the application. + +This is useful if you don't want to lose your codes after abnormal terminations, such as power outage, forced shutdown, killing CP Editor, etc. However, if the files and test cases are too large, the editor hangs each time the auto-save happens. + +## Bind file and problem + +### Restore the problem URL when opening a file + +If a problem URL was set for a file, when you open that file again, the problem URL will be restored. + +### Open the old file when parsing an old problem URL + +If a problem URL was set for a file, when parsing that problem from Competitive Companion again, the old file will be opened. + +## Test Cases + +### Run your codes on empty test cases + +Run your code on all non-hidden test cases even if the input is empty. + +### Check your answer on test cases with empty output + +Check your answer even if your output or the expected output is empty. + +### Auto Uncheck Accepted Testcases + +After the code is executed, the accepted test cases will be automatically unchecked. When test cases are unchecked, they are collapsed and won't be tested on when you execute your code. + +## Load External File Changes + +### Auto-load external file changes if there's no unsaved modification + +If the file on the disk and the code in CP Editor was the same, and then the file is changed outside of CP Editor, load the external change without confirmation. + +### Ask whether to load external file changes + +If the file is changed outside of CP Editor, ask whether to load the change or not. + +If this setting is disabled, external changes won't be loaded. + +[Auto-load external file changes if there's no unsaved modification](#auto-load-external-file-changes-if-theres-no-unsaved-modification) overrides this setting. i.e. if [Auto-load external file changes if there's no unsaved modification](#auto-load-external-file-changes-if-theres-no-unsaved-modification) is enabled, external file changes will be loaded without confirmation regardless of [Ask whether to load external file changes](#ask-whether-to-load-external-file-changes); if [Auto-load external file changes if there's no unsaved modification](#auto-load-external-file-changes-if-theres-no-unsaved-modification) is disabled, the user will be asked whether to load the changes only when [Ask whether to load external file changes](#ask-whether-to-load-external-file-changes) is enabled, otherwise the changes won't be loaded. diff --git a/content/docs/preferences/advanced/_index.zh_tw.md b/content/docs/preferences/advanced/_index.zh_tw.md new file mode 100644 index 000000000..7cf3f2abd --- /dev/null +++ b/content/docs/preferences/advanced/_index.zh_tw.md @@ -0,0 +1,64 @@ +--- +title: "Advanced" +weight: 80 +--- + +## Update + +### Check for updates on startup + +When CP Editor starts, checks whether there are new versions of CP Editor. + +If there are new versions, a pop-up window will ask you whether to update or not. + +### Use the beta version + +When checking for updates, check for beta versions. The beta versions usually have more features and improvements, but they are not as stable as the stable versions. + +## Limits + +### Default Time Limit + +The default time limit when executing programs. + +The program will be killed if it doesn't terminate within the time limit. + +### Output Length Limit + +The maximum number of characters in the output of the program. + +The program will be killed if either of its stdout or stderr is too long. + +### Output Display Length Limit + +The maximum number of characters to be displayed for the output of the program. + +If the output is too long, it will be elided. + +### Message Length Limit + +The maximum number of characters in each message in the top-right corner of the main window. + +The message will be elided if it's too long. + +### HTML Diff Viewer Length Limit + +The maximum number of characters in the HTML Diff Viewer. + +The Diff Viewer will fall back to plain text if either of the output or the expected output is too long. + +### Open File Length Limit + +The maximum number of characters in a source file to open. + +A source file won't be opened if it's too long. + +### Display Test Case Length Limit + +The maximum number of characters in a test case to be displayed. + +A test case will be elided and read-only if it's too long. + +## Network Proxy + +The proxy server used to check for updates. diff --git a/content/docs/preferences/appearance/_index.zh_tw.md b/content/docs/preferences/appearance/_index.zh_tw.md new file mode 100644 index 000000000..87d628c8b --- /dev/null +++ b/content/docs/preferences/appearance/_index.zh_tw.md @@ -0,0 +1,70 @@ +--- +title: "Appearance" +weight: 30 +--- + +## General + +### UI Language + +The natural language used in the UI. + +### UI Style + +The style used for the UI. The available options are different on different platforms. + +The "default" style is either the most appropriate style on your platform or the style specified by the `--style` command-line option. + +On Windows, there's an extra option "Auto Fusion". "Auto Fusion" is either dark or light depending on the system theme (i.e. whether the Windows application theme is dark or light). + +If there's anything wrong after you change the UI style, you can try restarting CP Editor. + +### Editor Theme + +The syntax highlighting theme for the code editor. + +### Opacity + +The opacity of the main window. + +### Test Case Maximum Height + +The maximum height of a test case before the scrollbar occurs. + +### Show Compile And Run Only + +Hide the compile only and run only buttons. + +It can be useful if you don't care about the time used on compilation. + +### Display EOLN in Diff + +Use "¶" to visualize the end-of-line in the diff viewer. It is useful if you want to see differences of the end-of-line (i.e. extra empty lines at the end). + +### Add extra margin at the bottom of the code editor + +Add an extra margin at the bottom of the code editor, so that you can scroll less. + +Due to technical reasons, it could slightly affect the operation history, i.e. you might be able undo the margin change by Ctrl+Z. + +## Font + +### Show only Monospaced Font + +When checked the font picker dialog shows only monospaced fonts. + +### Editor Font + +The font for the code editor. + +### Test Cases Font + +The font for the test cases. + +### Message Logger Font + +The font for the messages. + +### Custom Application Font + +Use a custom font for the UI (except for code editor, test cases, messages, etc.), instead of the system font. diff --git a/content/docs/preferences/code-edit/_index.zh_tw.md b/content/docs/preferences/code-edit/_index.zh_tw.md new file mode 100644 index 000000000..92ab0e439 --- /dev/null +++ b/content/docs/preferences/code-edit/_index.zh_tw.md @@ -0,0 +1,47 @@ +--- +title: "Code Edit" +weight: 10 +--- + +### Tab Width + +The width (number of characters) of an indent. It is used when displaying the tab characters. It is also used in [Auto Indent](#auto-indent) and [Replace tabs by spaces](#replace-tabs-by-spaces). + +### Cursor Width + +The width of the text cursor in pixels. + +### Auto Indent + +1. When you start a new line, the new line will have the same indent (i.e. white spaces at the beginning of the line) as the old line. +2. If the old line ends with `{`, an extra indent (a tab character or [Tab Width](#tab-width) spaces, depending on whether [Replace tabs by spaces](#replace-tabs-by-spaces) is enabled) will be inserted at the beginning of the new line. + +### Wrap Text + +If a line is too long to fit in a single line, the line will be separated into several lines. + +### Auto Complete Parentheses + +Automatically add the right parenthesis when you type the left one. For example, when you type `(`, `)` will be added. + +When the character next to the cursor is a right parenthesis and you type this parenthesis, instead of typing this parenthesis, the cursor will jump out of the parenthesis. + +You can choose the parentheses to auto-complete in the [Parentheses](../language/\_index.zh_tw.md#parentheses) settings. + +### Auto Remove Parentheses + +When you delete a left parenthesis, if a corresponding right parenthesis is next to it, the right parenthesis will also be deleted. + +You can choose the parentheses to auto-remove in the [Parentheses](../language/\_index.zh_tw.md#parentheses) settings. + +### Jump out of a parenthesis by pressing Tab + +When the cursor is next to a right parenthesis, you can use the Tab key to jump out of it. If [Auto Complete Parentheses](#auto-complete-parentheses) is enabled, this is an alternative of typing the right parenthesis. + +You can choose the parentheses to jump out by Tab in the [Parentheses](../language/\_index.zh_tw.md#parentheses) settings. + +### Replace tabs by spaces + +When you insert an indent, insert spaces instead of a tab character. The number of spaces is equal to the [Tab Width](#tab-width). + +Note that this won't replace the existing tab characters. In [Auto Indent](#auto-indent), the tab characters in the old line will remain in the new line (however, the new indent inserted after `{` will be spaces). diff --git a/content/docs/preferences/extensions/_index.zh_tw.md b/content/docs/preferences/extensions/_index.zh_tw.md new file mode 100644 index 000000000..7ee951999 --- /dev/null +++ b/content/docs/preferences/extensions/_index.zh_tw.md @@ -0,0 +1,129 @@ +--- +title: "Extensions" +weight: 50 +--- + +## Code Formatting + +### Clang Format + +Clang Format is used to format the C/C++ and Java codes. You can click Actions->Format Code or press the shortcut Ctrl+Shift+I to format the codes. If you have selected a part of the code, only the selection (and its necessary adjacent codes) will be formatted. + +**See also** [Setup Clang Format](../../setup/\_index.zh_tw.md#setup-clang-format). + +#### Program + +The path to the `clang-format` executable, or simply `clang-format` if it's in the `PATH` environment variable. + +#### Arguments + +The arguments passed to `clang-format`. It should NOT contain `-i` (the in-place modification option). + +#### Style + +The Clang Format style. The content here is the same as the content of a `.clang-format` file. + +You can read [Clang-Format Style Options documentation](https://clang.llvm.org/docs/ClangFormatStyleOptions.html) or search for other materials to learn how to write the styles. + +### YAPF + +YAPF is used to format the Python codes. You can click Actions->Format Code or press the shortcut Ctrl+Shift+I to format the codes. If you have selected a part of the code, only these lines will be formatted. + +**See also** [Setup YAPF](../../setup/\_index.zh_tw.md#setup-yapf). + +#### Program + +The program of YAPF. It could be one of: + +- `yapf`: You should be able to run `yapf` in the command line. The arguments can be empty. +- A Python interpreter, i.e. `python`, `python2`, etc. or the path to an interpreter. The arguments should be `-m yapf`. + +Note that [you need to use Python 2 to format Python 2, use Python 3 to format Python 3](https://github.com/google/yapf#python-versions). So you may need to choose the correct Python interpreter. + +#### Arguments + +The arguments passed to the YAPF program. This should be `-m yapf` if the program is a Python interpreter. It should NOT contain `-i` (the in-place modification option). + +#### Style + +The YAPF Format style. The content here is the same as the content of a `.style.yapf` file. You can check all possible configurations by running `yapf --style-help`, read the [documentation](https://github.com/google/yapf#formatting-style) or search for other materials to learn how to write the styles. + +## Language Server + +**See also** [Setup Language Server](../../setup/\_index.zh_tw.md#setup-language-server). + +### Use Linting with Language Server + +Use language server to lint errors, warnings, hints, etc. + +You can hover over the squiggles to see the tooltips for the explanation of the errors/warnings. + +### Delay in Linting + +Update linting if you haven't been typing for *delay* milliseconds. + +### Path to LSP executable + +The path to the language server program, or the name if it's in the `PATH` environment variable. + +### Arguments for Language Server + +Additional arguments for the language server program. See the documentation of the language server program you are using for more information. + +For example, if you are using `pyls` for Python, you probably want to use `python` as the language server program, and use `-m pyls` as the arguments. + +## Competitive Companion + +**See also** [Setup Competitive Companion](../../setup/\_index.zh_tw.md#setup-competitive-companion). + +### Open New Tabs + +Open a new tab when a problem is parsed. + +If this is disabled, when parsing a problem, the test cases in the current tab will be replaced by the new test cases. + +### Connection Port + +Usually, you don't have to modify this setting. The default port `10045` is supported by Competitive Companion, so if you are using the default port, you don't have to add custom ports in Competitive Companion. However, in case of port conflicts, etc., you can change the port and add custom ports in Competitive Companion. + +### Use the time limit from Competitive Companion + +Use the time limit parsed by Competitive Companion as the time limit of the corresponding tab. + +### Head Comments + +The head comments are added at the head of the code when parsing a problem. + +#### Content of the head comments + +The content of the head comments. You can use the following place holders: + +- `${time}`: The time when the problem was parsed. The time format can be set in [Time format for the head comments](#time-format-for-the-head-comments). +- `${json.X.Y}`: An attribute of the data provided by Competitive Companion. You can read more about the attributes in [the documentation of Competitive Companion](https://github.com/jmerle/competitive-companion#explanation). For example, `${json.name}` is the name of the problem. + +#### Time format for the head comments + +The format of the `${time}` place holder in the head comments. You can read the Qt documentation for available expressions: + +- [Date Format](https://doc.qt.io/qt-5/qdate.html#toString-3) +- [Time Format](https://doc.qt.io/qt-5/qtime.html#toString) + +## CF Tool + +You can use [CF Tool](https://github.com/xalanq/cf-tool/) to submit your solutions to [Codeforces](https://codeforces.com). + +To submit a solution, you have to either parse a problem by [Competitive Companion](#competitive-companion) from Codeforces or manually set the problem URL of a tab in the context menu of it. + +**See also** [Setup CF Tool](../../setup/\_index.zh_tw.md#setup-cf-tool). + +### Path + +The path to the `cf` executable file, or simply `cf` if it's in the `PATH` environment variable. + +### Show toast messages for submission verdicts + +Show a toast message when the verdict of a submission is determined. + +A toast message is a "system notification", which is visible outside of CP Editor. + +This is useful if you want to get the verdict of the previous problem when reading/solving the next problem. diff --git a/content/docs/preferences/file-path/_index.zh_tw.md b/content/docs/preferences/file-path/_index.zh_tw.md new file mode 100644 index 000000000..ca74d39e7 --- /dev/null +++ b/content/docs/preferences/file-path/_index.zh_tw.md @@ -0,0 +1,74 @@ +--- +title: "File Path" +weight: 60 +--- + +## Testcases + +### Input File Save Path + +### Answer File Save Path + +The path where the test cases are [saved](../actions/\_index.zh_tw.md#save-testcases-on-save). If it is a relative path, it is relative to the source file. + +You can use the following place holders: + +- `${filename}`: the complete filename +- `${basename}`: the base file name without the suffix +- `${0-index}`: the index of the test case started from 0 +- `${1-index}`: the index of the test case started from 1 + +For example, a test case is the 3-rd test case of the source file `/a/b/c.cpp`, the place holders are: + +- `${filename}`: `c.cpp` +- `${basename}`: `c` +- `${0-index}`: `2` +- `${1-index}`: `3` + +If the path is `testcases/${basename}-${1-index}.in`, the input of this test case will be saved in `/a/b/testcases/c-3.in`. + +### Testcases Matching Rules + +The rules used to match test cases when loading pairs of test cases. + +Each rule is a pair of [regular expression patterns](../general/\_index.zh_tw.md#regular-expression). The first regex matches the whole input file name, and the second pattern is a replacement pattern which is the name of the answer file. + +For example, you can use `(.+)\.in` and `\1.out` to match `test-1.in` and `test-1.out`, or use `(.+)\.in\.(\d+)` and `\1.ans.\2` to match `test.in.3` and `test.ans.3`. + +When loading pairs of test cases, each rule which matches an input file will be used to try to find the corresponding answer file to the input file. + +## Problem URL + +### Default File Path For Problem URLs + +The default path when choosing where to save an untitled tab with problem URL. + +Each rule is a pair of [regular expression patterns](../general/\_index.zh_tw.md#regular-expression). The first regex matches a part of the problem URL, and the second pattern is a replacement pattern which is the default save path. + +When saving a file with a problem URL, if the problem URL matches at least one regex in the rules, the default save path will be the replacement of the first matching regex. + +Here's an example of a rule: + +The problem URL regex: `codeforces.com/contest/([1-9]\d*)/problem/([A-Z][1-9]?)` + +The file path: `/home/username/Codeforces/\1/\2` + +## Default Paths + +The default path used when the user is asked for a file path. + +There are several actions, different actions can use different default paths. + +The user can set multiple default paths, each default path has a name. A default path can be used as a place holder in the default path of an action. When the user chooses a path for an action, several default paths can be set to this path. + +For example: + +- The default path for the action "Save File" is `${file}`, and "Save File" changes `file` and `testcase`. +- The default path for the action "Load Single Test Case" is `${testcase}`, and "Load Single Test Case" only changes `testcase`. +- At the beginning, `file` is `/a/b` and `testcase` is `/a/c`. + +1. You are asked to choose the path for "Load Single Test Case". The default path is `/a/c`, and you choose `/a/d` as the path. Now `file` is still `/a/b`, but `testcase` is changed to `/a/d`. +2. You are asked to choose the path for "Save File". The default path is `/a/b`, and you choose `/a/e` as the path. Now both `file` and `testcase` are `/a/e`. +3. You are asked to choose the path for "Load Single Test Case". The default path is `/a/e` because `testcase` was modified by choosing `/a/e` for "Save File". + +In the preferences window, the default paths changed by an action is a comma-separated list. diff --git a/content/docs/preferences/general/_index.zh_tw.md b/content/docs/preferences/general/_index.zh_tw.md new file mode 100644 index 000000000..131090670 --- /dev/null +++ b/content/docs/preferences/general/_index.zh_tw.md @@ -0,0 +1,20 @@ +--- +title: "General" +weight: 1000 +--- + +### Temporary Directory + +In CP Editor, each file has a temporary directory, it can be used to save the executable files, etc. + +You can treat it as a place to safely save something for each tab (i.e. each file) without affecting other files on your disk, and it will be automatically deleted when the tab is closed. + +On Linux, it's `/tmp/CP Editor-XXXXXX`. On Windows, it's `C:\Users\\AppData\Local\Temp\CP Editor-XXXXXX`. + +### Regular Expression + +The [regular expression](https://en.wikipedia.org/wiki/Regular_expression) is used to match patterns in a string and find and replace substrings. + +You can find many online regex courses, for example . + +In CP Editor, you can use `\1`, `\2`, etc. for the content of the first/second capture group in the replacement patterns. diff --git a/content/docs/preferences/key-bindings/_index.zh_tw.md b/content/docs/preferences/key-bindings/_index.zh_tw.md new file mode 100644 index 000000000..8c88d4e4c --- /dev/null +++ b/content/docs/preferences/key-bindings/_index.zh_tw.md @@ -0,0 +1,6 @@ +--- +title: "Key Bindings" +weight: 70 +--- + +You can set custom key bindings for many actions. You can change the key by clicking the edit and press the key you want. You can delete a custom key binding by clicking the button on the right. diff --git a/content/docs/preferences/language/_index.zh_tw.md b/content/docs/preferences/language/_index.zh_tw.md new file mode 100644 index 000000000..ba87e5f73 --- /dev/null +++ b/content/docs/preferences/language/_index.zh_tw.md @@ -0,0 +1,157 @@ +--- +title: "Language" +weight: 20 +--- + +## General + +### Default Language + +The default programming language. It's used when opening a new tab and some other places. + +## Commands + +### C++ Commands + +#### C++ Compile Command + +The compilation command for C++. For example: `g++ -Wall`. + +The command shouldn't contain the source file and the output file, CP Editor automatically adds them. + +For compilation flags, please refer to the manual of the compiler. For example, you may want to add `-std=c++14` in the compile command to use C++14. + +#### C++ Executable File Path + +The path of the executable file, i.e. the argument of the `-o` option of the compiler. + +If this path is relative, then it's relative to the source file (if it's an untitled tab, then relative to the [Temporary Directory](../general/\_index.zh_tw.md#temporary-directory)). + +You can use some place holders for this setting: + +- `${filename}`: The complete name of the source file. If it's an untitled tab (i.e. an unsaved file), the complete file name is `sol.cpp`. +- `${basename}`: `${filename}` without the suffix (i.e. without `.cpp`, etc.). +- `${tmpdir}` or `${tempdir}`: The path of the [Temporary Directory](../general/\_index.zh_tw.md#temporary-directory). + +For example, you can use `${tmpdir}/${basename}` if you don't want to keep the executable files, or `executables/${basename}` if you want to keep all executable files in the `executables` directory under the directory of the source file. + +#### C++ Run Arguments + +The arguments passed to the program when executing it. It's usually not needed in competitive programming. + +#### C++ Compiler Output Codec + +The text codec of the compiler output (warnings, errors, etc.), used to display the messages from the compiler in CP Editor. + +It could be useful if you are using locales for your compiler and the compiler messages are not English. + +### Java Commands + +#### Java Compile Command + +The compilation command for Java. For example: `javac`. + +The command shouldn't contain the source file and the class path, CP Editor automatically adds them. + +#### Java Class Path + +The path to save the class files. + +Please refer to [C++ Executable File Path](#c-executable-file-path) for the details. + +#### Java Class Name + +The name of the main class of your solution. + +You can use an arbitrary name for your source file. When compiling, CP Editor automatically saves your code to a file with the class name. + +#### Java Run Command + +The command to run your solution. For example `java`. + +This command shouldn't contain the class path or the class name, CP Editor automatically adds them. + +#### Java Run Arguments + +The arguments passed to the program when executing it. It's usually not needed in competitive programming. + +#### Java Compiler Output Codec + +Please refer to [C++ Compiler Output Codec](#c-compiler-output-codec). + +### Python Commands + +#### Python Run Command + +The command to run a python code. It's usually one of `python`/`python2`/`python3`. + +#### Python Run Arguments + +The arguments passed to the program when executing it. It's usually not needed in competitive programming. + +## Template + +The code template is a file. When opening a new tab, the content of the template will be the initial content in the code editor. + +### Template Path + +The path to the code template. + +### Template Cursor Position + +The initial position of the text cursor when opening the template. + +It contains three parts: + +1. [Regex](../general/\_index.zh_tw.md#regular-expression) +2. Offset type: start or end. +3. Offset characters: a number, could be negative. + +It works as below: + +1. Find the first match of the regex in the template. +2. If nothing matches the regex, the cursor will be at the end of the template. +3. Otherwise, depending on the offset type, the cursor will be at the start/end of the first match, and then moved to the right by the number of the offset characters. + +For example, if your template contains the following snippet: + +```cpp +int main() +{ + +} +``` + +Then you can use `int main` as the regex, `end` as the offset type, and `9` as the offset characters. After that, when opening a new tab, the cursor will be at the first line in the `main` function. + +## Snippets + +### Manage Snippets + +You can add/delete/rename snippets in "Language->XXX->XXX Snippet". You can use Ctrl+N for "Add", Ctrl+W for "Del" and F2 for "Rename". + +You can also import snippets from files or extract your snippets to files in the "More" menu on the snippet page. + +### Use Snippets + +You can insert a snippet into the code editor by either clicking "Actions->Use Snippets" or pressing Ctrl+T. + +When choosing a snippet, you can enter the first few characters of the snippet name, and it will be auto-completed. + +## Parentheses + +You can set the parentheses settings for each language and each parenthesis. + +Each setting has three states: enable, disable and default. If it's default, it uses the settings in the [Code Edit](../code-edit/\_index.zh_tw.md) page. Otherwise, it overwrites the settings in the [Code Edit](../code-edit/\_index.zh_tw.md) page. + +### Auto Complete + +See [Code Edit/Auto Complete Parentheses](../code-edit/\_index.zh_tw.md#auto-complete-parentheses). + +### Auto Remove + +See [Code Edit/Auto Remove Parentheses](../code-edit/\_index.zh_tw.md#auto-remove-parentheses). + +### Tab Jump Out + +See [Code Edit/Jump out of a parenthesis by pressing Tab](../code-edit/\_index.zh_tw.md#jump-out-of-a-parenthesis-by-pressing-tab). diff --git a/content/docs/setup/_index.zh_tw.md b/content/docs/setup/_index.zh_tw.md new file mode 100644 index 000000000..05dfff5b1 --- /dev/null +++ b/content/docs/setup/_index.zh_tw.md @@ -0,0 +1,71 @@ +--- +title: "Setup" +linkTitle: "Setup" +weight: 30 +description: Setup CP Editor to prepare for using it +--- + +## Change UI Language + +Now CP Editor is available in multiple languages, including English and Chinese. + +You can change the UI language in [Preferences->Appearance->General->UI Language](../preferences/appearance/\_index.zh_tw.md#ui-language). Note that you need to restart CP Editor to apply the change. + +## Set Compile and Run Commands + +You need to install `g++` / `python` / `java` depending on which language you are using. You need to add them to system PATH to have them found by CP Editor. + +Then you can set the Compile and Run Commands in the preferences. For example, you can set C++ Commands in [Preferences->Languages->C++->C++ Commands](../preferences/language/\_index.zh_tw.md#c-commands). + +## Setup CF Tool + +To submit Codeforces problems in CP Editor, you need to install [CF Tool](https://github.com/xalanq/cf-tool). + +You can add it to your system PATH to use it directly, or you can set the path to it in [Preferences->Extensions->CF Tool](../preferences/extensions/\_index.zh_tw.md#cf-tool). + +You need to configure the tool by running the command `cf config` in the command line before using it. + +## Setup Competitive Companion + +[Competitive Companion](https://github.com/jmerle/competitive-companion) is used to parse problems/contests from online judges. After you install it, you can parse sample test cases with a single click, instead of copying them manually. + +You can install it from the addon/extension markets: + +- [Chrome Extension](https://chrome.google.com/webstore/detail/competitive-companion/cjnmckjndlpiamhfimnnjmnckgghkjbl) +- [Firefox Addon](https://addons.mozilla.org/en-US/firefox/addon/competitive-companion/) + +## Setup Code Formatter + +### Setup Clang Format + +CP Editor uses [Clang Format](http://releases.llvm.org/download.html) to format your C/C++ and Java code. + +You need to add it to your system PATH, or set the path to it at [Preferences->Extensions->Clang Format](../preferences/extensions/\_index.zh_tw.md#clang-format). + +### Setup YAPF + +CP Editor uses [YAPF](https://github.com/google/yapf) to format your Python code. + +It should work after [installation](https://github.com/google/yapf#installation). If not, set the program and arguments in [Preferences->Extensions->Code Formatting->YAPF](../preferences/extensions/\_index.zh_tw.md#yapf). + +## Setup Language Server + +You can use [Language Server](https://microsoft.github.io/language-server-protocol/) to lint your codes and get errors, warnings, etc. + +You can install [any language server program](https://microsoft.github.io/language-server-protocol/implementors/servers/) and set suitable settings in [Preferences->Extensions->Language Server](../preferences/extensions/\_index.zh_tw.md#language-server). + +Though you can use any language server program you like, here are some suggestions if you are not sure which to use. + +### C++ Server + +If you have installed LLVM, you already have `clangd`, because it comes with the clang compiler. If you haven't, please install [LLVM](https://releases.llvm.org/download.html) prebuild binaries for Windows. On Linux and macOS you can install it from your package manager. You need to set the start command of `clangd` in Preferences -> Extensions -> Language Server -> C++ Server -> Path, where the command can be the path to the executable file or just `clangd` if it's in the PATH. + +### Java Server + +You need to have `java` installed and added to `PATH`. Download [Eclipse.JDT.ls](http://download.eclipse.org/jdtls/snapshots/jdt-language-server-latest.tar.gz), extract it to any location (in a new directory), We call the path to that directory `` (Something like `C://Users/Myname/Desktop/EclipseJDT.ls/`). In CP Editor, go to Preferences -> Extensions -> Language Server -> Java Server. Set "Path" to `java` and set "Arguments" to something like `-jar $INSTALL_PATH/plugins/org.eclipse.equinox.launcher_1.5.200.v20180922-1751.jar -configuration /config_(linux|win|mac)`. For example, on Windows, the arguments should be something like `-configuration C://Users/Myname/Desktop/Eclipse.JDT.ls/config_win`. + +The full name of the jar file above, `org.eclipse.equinox.launcher_1.5.200.v20180922-1751.jar`, may change incrementally as the project version of JDT changes. If java complains about "jar not found", then look for the latest version of the `org.eclipse.equinox.launcher_*` jar in `/plugins` and replace it in the command after `-jar`. + +### Python Server + +You need to have `python` and `pip` installed and added to `PATH`. Install `python-language-server` pip module by running `pip install 'python-language-server[all]'`. After the installation is done, open CP Editor settings, go to Preferences -> Extensions -> Language Server -> Python Server. Set "Path" to `python` and set "Arguments" to `-m pyls`. Save the changes and you will have linting for Python. diff --git a/content/docs/tips/_index.zh_tw.md b/content/docs/tips/_index.zh_tw.md new file mode 100644 index 000000000..5599a759d --- /dev/null +++ b/content/docs/tips/_index.zh_tw.md @@ -0,0 +1,81 @@ +--- +title: "Tips" +weight: 50 +description: Some tips that may help +--- + +## Use stderr to debug + +Currently, CP Editor doesn't have a built-in GUI debugger, but this doesn't mean it's hard to debug codes using CP Editor. + +Besides single-stepping, the most used debugging approach is to output some variables. Do you remember the times you tried hard to distinguish the debugged variables from the normal outputs? You don't have to do this in CP Editor. + +The key is: Use stderr to output debug information. In C++, this means to use `cerr` instead of `cout` to output. CP Editor will show the stderr of your program in the Messages section. + +## Run on only selected test cases + +In CP Editor, you don't have to always run on all test cases. + +To tell CP Editor not to run on a certain test case, just uncheck the checkbox of that test case. You can also use the "More" menu to manage the checks: you can Check All, Uncheck All, Uncheck Accepted (very useful when you passed most test cases and want to debug on the unaccepted ones) and Invert. + +If you want to run on a single test case, you can simply click the "Run" button of that test case. + +## Copy output to expected for problems with multiple correct answers + +Sometimes you are solving a problem that has more than one correct answer. The online judge has a checker, but you don't, and you don't have the time to write one. Leaving them in the "WA" verdict could be annoying, or even inconvenient because you have to manually check again after modifying your codes. + +CP Editor provides a solution: Copy Output to Expected. This could be done in either the right-click menu of the Expected section for a single test case or in the "More" menu for all selected test cases. With this function, you can easily copy the accepted outputs to expected, and they will be in the AC verdict as long as their outputs are not changed. + +## Load, edit and save test cases + +You can load test cases from files, edit test cases in bigger windows and save a test case in a file in the right-click menu of the test cases. + +## Testlib checkers are compiled at runtime + +Testlib checkers are compiled when changing the checker or changing the preferences, so you may have to wait for it after the execution is finished. + +## Drag and drop files + +You can drag files and drop them into the main editor or the input/expected part of test cases. + +## Shortcuts in the code editor + +Besides the shortcuts in the menu, you can use the [Read-only Key Bindings](https://doc.qt.io/qt-5/qtextedit.html#read-only-key-bindings) and the [Editing Key Bindings](https://doc.qt.io/qt-5/qtextedit.html#editing-key-bindings). There are also some hidden shortcuts: Tab (when there's a selection) and Shift+Tab for indent and unindent, Ctrl+Enter and Ctrl+Shift+Enter for inserting line after and before, Shift+Delete for deleting the current line. + +## Switching between tabs + +You can use Ctrl+Tab and Ctrl+Shift+Tab to switch to the next/previous tab. + +## The right-click menu of the tabs + +You can right-click on the tabs to get a useful context menu, including: + +- Manage tabs: Close Others, Close to the Right, etc. +- Duplicate tab. Very useful when you want to make experimental changes with the original code untouched or use different approaches to solve a problem without parsing it twice. +- Set compile command/time limit for a single tab. If you are solving a special problem. +- Reveal source/executable file. To easily find your code and the executable file. +- Manage the problem URL: Open Problem in Browser, Set Codeforces URL, etc. + +## Shortcuts in the preferences window + +You can use Ctlr+D, Ctrl+R and Ctrl+S for "Default", "Reset" and "Apply" respectively. + +You can use Ctlr+Tab and Ctlr+Shift+Tab to go through the preferences pages. + +## Change the view mode + +- Editor mode: You can focus on your codes. +- IO mode: You can investigate the outputs and errors. +- Split mode: You can see both the codes and the test cases. + +You can set a hotkey for switching view modes in [Preferences](../preferences/key-bindings/\_index.zh_tw.md). + +## Launch CP Editor in the command line + +CP Editor supports some command-line options, run `cpeditor --help` for more information. + +On Windows, it's better to use UNIX-like shells like git bash. + +In the command line, you can open a non-existing file as a tab by `cpeditor ` (and you can save to this path later), open all C++ files in a directory recursively by `cpeditor --cpp ` or temporarily disable [Restore last session at startup](../preferences/actions/\_index.zh_tw.md#restore-last-session-at-startup) by `cpeditor --no-hot-exit`. + +CP Editor normally closes when receiving SIGINT and SIGHUP, so if you start CP Editor in the command line, you can safely press Ctrl+C to quit. diff --git a/content/download/_index.zh_tw.html b/content/download/_index.zh_tw.html new file mode 100644 index 000000000..3784e9237 --- /dev/null +++ b/content/download/_index.zh_tw.html @@ -0,0 +1,86 @@ +--- +title: Download CP Editor +linkTitle: Download +menu: + main: + weight: 50 +--- + + + + + + + +
+
+
+ +

Get CP Editor on your machine and have a try!

+

+ You probably want to use + + the latest stable version on {{ userPlatform }} + . +

+
+
+
+ +
+
+
+

Choose your platform and the version you want to download

+ +
+
+

Loading...

+

No available asset found

+ +
+
+
+
diff --git a/content/need-translation-list/_index.zh_tw.md b/content/need-translation-list/_index.zh_tw.md new file mode 100644 index 000000000..19b0aca70 --- /dev/null +++ b/content/need-translation-list/_index.zh_tw.md @@ -0,0 +1,3 @@ +--- +title: "待翻译列表" +---