Browse Source

add theme style

ruki 5 years ago
parent
commit
fca2f66781

+ 5 - 0
_sidebar.md

@@ -42,3 +42,8 @@
   - [Builtin Modules](manual/builtin_modules.md)
   - [Extension Modules](manual/extension_modules.md)
 
+- Theme Style
+
+  - [Switch Theme](theme/switch_theme.md)
+  - [Builtin Theme](theme/builtin_themes.md)
+

BIN
assets/img/theme/default.png


BIN
assets/img/theme/emoji.png


BIN
assets/img/theme/ninja.png


+ 61 - 0
theme/builtin_themes.md

@@ -0,0 +1,61 @@
+## Default theme
+
+This is the default display theme after we install xmake. Theme name: default, which will provide color output by default, suitable for some dark background terminals.
+
+<img src="/assets/img/theme/default.png" width="60%" />
+
+We can also switch back to the default theme with the following command:
+
+```bash
+$ xmake g --theme=default
+```
+
+## Ninja Theme
+
+This is the theme provided by the version after v2.3.4. The construction progress style is similar to ninja. It uses a single-line progress bar, and the progress is no longer rolled back.
+
+The configuration of the default theme is the same except that the progress is displayed differently.
+
+```bash
+$ xmake g --theme=ninja
+```
+
+<img src="/assets/img/theme/ninja.png" width="60%" />
+
+## Emoji Theme
+
+This theme part output uses emoji characters instead of the previous color output.
+
+```bash
+$ xmake g --theme=emoji
+```
+
+<img src="/assets/img/theme/emoji.png" width="60%" />
+
+## Dark Theme
+
+This theme is mainly for some terminal backgrounds with a light color system (such as light yellow, etc.), which causes some warning outputs (the default is also yellow) to be invisible, so the theme color is changed to a dark system to improve visibility.
+
+```bash
+$ xmake g --theme=dark
+```
+
+## Plain Theme
+
+In fact, this theme is to completely disable color and emoji output, mainly to deal with the problem of garbled display caused by some terminals that do not support colors code, and it is also the most simple theme style.
+
+!> Some win terminals may not support colors, you can set this theme to solve the problem of garbled display
+
+```bash
+$ xmake g --theme=plain
+```
+
+## Powershell theme
+
+The background of the powershell terminal under win is blue, and its palette configuration seems to be changed. The magenta color is actually displayed as the background blue, which is very strange, resulting in the local output of xmake's default output will be invisible Overlapped)
+
+Therefore, this theme is to better adapt the display output under the powershell terminal.
+
+```bash
+$ xmake g --theme=powershell
+```

+ 25 - 0
theme/switch_theme.md

@@ -0,0 +1,25 @@
+
+
+If users don't like xmake's default display color and style, we can use the following global configuration commands to switch to other configuration topics provided by xmake, for example:
+
+```bash
+$ xmake g --theme=dark
+```
+
+The default theme is named default. Here, we switch to the dark style theme to adapt to some scenes with a very light background and provide darker color output to avoid being unclear.
+
+If we want to switch back to the default theme, we can directly type:
+
+```bash
+$ xmake g -c
+```
+
+or
+
+```bash
+$ xmake g --theme=default
+```
+
+In addition, xmake also provides a lot of interesting and practical built-in themes, everyone can try, the following will explain in detail.
+
+!> If you have a better theme, you are welcome to mention pr contribution, thank you very much!

+ 4 - 0
zh-cn/_sidebar.md

@@ -42,3 +42,7 @@
   - [内置模块](zh-cn/manual/builtin_modules.md)
   - [扩展模块](zh-cn/manual/extension_modules.md)
 
+- 主题风格
+
+  - [切换主题](zh-cn/theme/switch_theme.md)
+  - [内置主题](zh-cn/theme/builtin_themes.md)

+ 61 - 0
zh-cn/theme/builtin_themes.md

@@ -0,0 +1,61 @@
+## 默认主题
+
+这个也就是咱们安装xmake后默认的显示主题,主题名:default,它默认会提供色彩输出,适合一些深色背景的终端。
+
+<img src="/assets/img/theme/default.png" width="60%" />
+
+我们也可以通过下面的命令切回默认主题:
+
+```bash
+$ xmake g --theme=default
+```
+
+## Ninja主题
+
+这个是v2.3.4之后版本提供的主题,构建进度风格类似ninja,采用单行进度条,不再回滚进度,用户可以根据自己的喜好设置。
+
+除了进度展示不同外,其他都跟默认主题的配置相同。
+
+```bash
+$ xmake g --theme=ninja
+```
+
+<img src="/assets/img/theme/ninja.png" width="60%" />
+
+## Emoji主题
+
+这个主题部分输出通过emoji字符代替之前的色彩输出。
+
+```bash
+$ xmake g --theme=emoji
+```
+
+<img src="/assets/img/theme/emoji.png" width="60%" />
+
+## Dark主题
+
+这个主题主要是对一些终端背景是浅色系(比如淡黄色等),导致一些警告输出(默认也是黄色)重合不可见,所以把主题配色变成深色系,提高可见性。
+
+```bash
+$ xmake g --theme=dark
+```
+
+## Plain主题
+
+这个主题,其实就是完全禁用色彩、emoji输出,主要是应对一些不支持colors code的终端导致显示乱码的问题,也是最朴素的主题风格。
+
+!> 一些win终端可能不支持colors,就可以设置这个主题来解决乱码显示问题
+
+```bash
+$ xmake g --theme=plain
+```
+
+## Powershell主题
+
+win下powershell终端背景是蓝色的,而它的调色板配置似乎被改过的,其中magenta色居然显示成背景蓝色,很诡异,导致xmake的默认输出会有局部文本不可见(跟背景色重叠了)
+
+所以,这个主题就是为了更好的适配powershell终端下的显示输出。
+
+```bash
+$ xmake g --theme=powershell
+```

+ 25 - 0
zh-cn/theme/switch_theme.md

@@ -0,0 +1,25 @@
+
+
+如果用户不喜欢xmake默认的显示配色和风格,我们可以通过下面的全局配置命令,来切换到xmake提供的其他一些配置主题上去,例如:
+
+```bash
+$ xmake g --theme=dark
+```
+
+默认的主题名为default,这里我们通过切换到dark风格主题,来适配一些终端背景很浅的场景,提供更加深色的色彩输出,避免看不清。
+
+如果我们要切回默认主题,可以直接敲:
+
+```bash
+$ xmake g -c
+```
+
+或者
+
+```bash
+$ xmake g --theme=default
+```
+
+另外,xmake还提供了不少有趣实用的内置主题,大伙可以试试,下文会详细讲解。
+
+!> 如果大家有更好的主题,也欢迎提pr贡献进来,非常感谢!