登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
我知道了
查看详情
登录
注册
开源中国、Gitee、模力方舟招人啦~ 快来看看有没有适合你的岗位
代码拉取完成,页面将自动刷新
开源项目
>
程序开发
>
常用工具包
&&
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
2
Star
25
Fork
2
swiftycode
/
CLItheme
代码
Issues
2
Pull Requests
0
Wiki
统计
流水线
服务
Gitee Pages
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
我知道了,不再自动展开
发行版
最新版
v2.0-beta3
2e87eb9
2025-01-02 15:20
对比
v2.0-beta3
swiftycode
# `v2.0-beta3`更新内容 - `clitheme-exec`区分stdout和stderr输出的功能暂未实现,`subststdoutonly`选项和`subststderronly`选项在此版本中不可用 - 如果能在该功能上提出建议或实现方案,请通过Issues或Pull Requests发表 ## 新功能 - **选项定义中可以使用内容变量** ```plaintext setvar:options substvar substesc set_options substvar set_options {{options}} [substitute_regex] <...> # ... [/substitute_regex] {{options}} endmatchhere ``` - **CLI界面:读取文件时显示提示,并且检测到读取`stdin`时显示提示信息** ```plaintext $ clitheme apply-theme /dev/stdin ==> Reading file (1/1) Reading from standard input Input file content here; press CTRL-D when finished ``` - **CLI界面:`get-current-theme-info`支持仅显示主题名称和源文件路径,得到更简洁的输出** ```plaintext $ clitheme get-current-theme-info --name Currently installed theme(s): [1]: Example theme [2]: 颜文字样例主题 $ clitheme get-current-theme-info --file-path Currently installed theme(s): /home/user/Documents/example-theme.clithemedef.txt /home/user/Documents/textemojis.clithemedef.txt $ clitheme get-current-theme-info --name --file-path Currently installed theme(s): [1]: Example theme /home/user/Documents/example-theme.clithemedef.txt [2]: 颜文字样例主题 /home/user/Documents/textemojis.clithemedef.txt ``` - **重命名`clitheme-exec`中的以下命令行选项:** > `--debug-showchars` -> `--showchars` > `--debug-nosubst` -> `--nosubst` > `--debug-foreground` -> `--foreground-stat` - **如果在首次没有设定`substvar`选项时尝试调用定义的内容变量时,添加提示** - **`frontend`模块:添加仅为当前文件修改默认全局设置的函数,对不同文件的调用保留单独的设置** ```plaintext frontend.set_domain("com.example") # 对应domain_name frontend.set_appname("example-app") # 对应app_name frontend.set_subsections("example-subsection subsection-2") # 对应subsections frontend.set_debugmode(False) # 对应debug_mode frontend.set_lang("") # 对应lang(留空以使用系统语言) frontend.set_disablelang(False) # 对应disable_lang ``` - **`frontend`模块添加`set_local_themedefs`函数,支持同时指定多个定义文件** - **主题定义文件:添加`!require_version`定义,要求`clitheme`最低版本** ```plaintext !require_version 2.0 ``` - **在`locale:<locale>`语法中支持使用内容变量** ```plaintext setvar:var en_US [substitute_regex] Some regex locale:{{var}} Some content [/substitute_regex] ``` - **支持使用更简短的`[subst_regex]`和`[subst_string]`语法** ```plaintext [subst_string] Some string locale:default Some replacement string [/subst_string] [subst_regex] Some regex locale:default Some replacement regex [/subst_regex] ``` - **`clitheme get-current-theme-info`指令中支持指定`--name`和`--file-path`选项** - **在`clitheme apply-theme`和`clitheme update-theme`指令中支持使用`--yes`选项跳过确认提示** ## 其他更改和问题修复 - **`clitheme-exec`中的`--debug-newlines`要求与`--debug`同时使用/指定** - **调整字符串定义路径名称限制:添加更多非法字符和名称** - **更改`foregroundonly`处理逻辑:该选项现可以为单个替换规则设定** - 如果在命令限制规则中设置,取消设定当前规则/切换到另一个规则后将重置为之前的全局设定 - **修复输出内频繁在非换行处出现读取分段的问题** - **`clitheme-exec`:输出中带有对应用户输入的Backspace符号不会进行输出替换处理** - **更改“生成数据”提示为“正在处理文件”** ```plaintext ==> Processing files... ``` - **修复`get-current-theme-info`和`update-theme`指令输出和数据处理可能会出现错误文件顺序的问题** - **`clitheme-exec`:正常处理带有管道输送的stdin** ```plaintext $ cat file.py|clitheme-exec python3 ``` - **`{header_section}`新增对`name`信息的要求(必须定义)** - **`clitheme-exec`:修复程序输出闲置时出现明显CPU占用的问题** - **`clitheme-exec`:数据库请求会缓存在内存中,显著提升性能** - **修复在多行段落中启用`substesc`选项时,内容变量中的`{{ESC}}`可能不会被处理的问题** - **重要更改:`endmatchhere`选项现在仅适用于当前文件中的其他替换规则,不影响其他文件** # `v2.0-beta3` update changelog - Distinguishing stdout and stderr outputs in `clitheme-exec` is not yet implemented. Therefore, `subststdoutonly` and `subststderronly` options are not available in this version. - If suggestions or implementations can be provided, please post them through Issues or Pull Requests ## New features - **Support using content variables in option definitions** ```plaintext setvar:options substvar substesc set_options substvar set_options {{options}} [substitute_regex] <...> # ... [/substitute_regex] {{options}} endmatchhere ``` - **Show prompt when reading files and message when reading from standard input in CLI interface** ```plaintext $ clitheme apply-theme /dev/stdin ==> Reading file (1/1) Reading from standard input Input file content here; press CTRL-D when finished ``` - **CLI interface: `get-current-theme-info` supports only displaying theme name and source file path for a more concise output** ```plaintext $ clitheme get-current-theme-info --name Currently installed theme(s): [1]: Example theme [2]: 颜文字样例主题 $ clitheme get-current-theme-info --file-path Currently installed theme(s): /home/user/Documents/example-theme.clithemedef.txt /home/user/Documents/textemojis.clithemedef.txt $ clitheme get-current-theme-info --name --file-path Currently installed theme(s): [1]: Example theme /home/user/Documents/example-theme.clithemedef.txt [2]: 颜文字样例主题 /home/user/Documents/textemojis.clithemedef.txt ``` - **Rename the following options in `clitheme-exec`** > `--debug-showchars` -> `--showchars` > `--debug-nosubst` -> `--nosubst` > `--debug-foreground` -> `--foreground-stat` - **A warning is now displayed when trying to reference a content variable without enabling the `substvar` option** - **Add new functions for modifying global default settings only for current file in `frontend` module, keeping separate settings for different files** ```plaintext frontend.set_domain("com.example") # 对应domain_name frontend.set_appname("example-app") # 对应app_name frontend.set_subsections("example-subsection subsection-2") # 对应subsections frontend.set_debugmode(False) # 对应debug_mode frontend.set_lang("") # 对应lang(留空以使用系统语言) frontend.set_disablelang(False) # 对应disable_lang ``` - **Add `set_local_themedefs` function in `frontend` module, supporting specifying multiple files at once** - **Add `!require_version` definition in theme definition file, requiring minimum `clitheme` version** ```plaintext !require_version 2.0 ``` - **Support specifying content variables in `locale:<locale>` syntax** ```plaintext setvar:var en_US [substitute_regex] Some regex locale:{{var}} Some content [/substitute_regex] ``` - **Support using more concise `[subst_regex]` and `[subst_string]` syntax** ```plaintext [subst_string] Some string locale:default Some replacement string [/subst_string] [subst_regex] Some regex locale:default Some replacement regex [/subst_regex] ``` - **Support `--name` and `--file-path` options in `clitheme get-current-theme-info` command** - **Support using `--yes` option to skip confirmation prompt in `clitheme apply-theme` and `clitheme update-theme` commands** ## Other changes and bug fixes - **clitheme-exec: Specifying `--debug-newlines` option requires `--debug` option to be specified at the same time** - **Add more restricted characters to string entry pathnames** - **Change how the `foregroundonly` option work: it now applies to individual substitution rules** - If specified in a command filter rule (specified after `[/filter_commands]`), it will reset to previous global setting after exiting current rule - **Fix an issue where read segments repeatedly occur at non-newline positions** - **`clitheme-exec`: Ignore backspace characters with identical user input from output substitution processing** - **Rename "Generating data" prompt to "Processing files"** ```plaintext ==> Processing files... ``` - **Fix an issue where outputs of `clitheme get-current-theme-info` and `clitheme update-theme` command have incorrect file ordering** - **`clitheme-exec`: Properly handle piped standard input** ```plaintext $ cat file.py|clitheme-exec python3 ``` - **`{header_section}` now requires defining `name` entry** - **`clitheme-exec`: Fix high idle CPU usage** - **`clitheme-exec`: Database fetches are now cached in memory, significantly improving performance** - **Fix an issue when in multi-line block content and `substesc` option is enabled, `{{ESC}}` in content variables might not be processed** - **Important change: `endmatchhere` option only applies to substitution rules in the current file; other files are not affected**
最后提交信息为:
!4
v2.0-beta3版本发布
预览版本
v2.0-beta2
c2ae130
2024-07-20 22:38
对比
v2.0-beta2
swiftycode
# Beta版本已知问题 - 因为目前无法实现stdout和stderr保留原输出顺序同时显示: - 定义文件中`subststdoutonly`和`subststderronly`选项目前不可用 - 使用`clitheme-exec --debug`时,输出标记会永远显示输出为stdout(`o>`) - 命令行输出替换功能暂不支持Windows系统 - 该功能会推迟到`v2.1`版本 最新的代码更改和开发版本:https://gitee.com/swiftycode/clitheme/tree/v1.2_dev 文档手册:https://gitee.com/swiftycode/clitheme-wiki-repo/ # Known issues (Beta version) - Because redirecting stdout and stderr to separate streams cannot guarantee original output order as of now: - The `subststdoutonly` and `subststderronly` options in theme definition file is currently unavailable - The output marker will always show that output is stdout (`o>`) when using `clitheme-exec --debug` - Command line output substitution feature does not currently support Windows systems - This feature will be delayed for version `v2.1` Latest code changes and development version: https://gitee.com/swiftycode/clitheme/tree/v1.2_dev Documentation: https://gitee.com/swiftycode/clitheme-wiki-repo/ # `v2.0-beta2`更新内容 ## 新功能 - `{manpage_section}`中支持同时指定多个`[file_content]`语句及文件名: ```plaintext {manpage_section} [file_content] man1 example.1 [file_content] man1 zh_CN example.1 [file_content] man1 zh_CN.UTF-8 example.1 <文件内容> [/file_content] {/manpage_section} ``` - 在`{manpage_section}`中新增`[include_file]`语法,允许同时指定多个目标文件路径: ```plaintext {manpage_section} [include_file] files pages example.1 as man1 example.1 as man1 zh_CN example.1 as man1 zh_CN.UTF-8 example.1 [/include_file] {/manpage_section} ``` - 定义文件中`{substrules_section}`中的`filter_command`和`[filter_commands]`新增`foregroundonly`选项;仅在当前进程前台运行时应用替换规则 - 适用于shell等命令处理器程序;它们在执行进程时会转移前台进程 - `clitheme-exec`:新增`--debug-foreground`选项;会通过提示信息显示当前进程前台状态的更改,使用`! Foreground: False`和`! Foreground: True`显示 - 定义文件中`{substrules_section}`的`[/substitute_string]`和`[/substitute_regex]`后支持指定`substesc`和`substvar`选项,会应用在匹配内容上 - 定义文件中`{entries_section}`的`[/entry]`后支持指定`substvar`选项,会应用在路径名称上 ## 问题修复与改进 - CLI 提示信息中的名称如果有控制符号或其他不可见的字符,这些字符将会以明文输出 - 修复Python 3.8兼容性问题 - 修复了使用`clitheme-man`时按下CTRL-C会导致程序意外中断的问题 - 修复了在Windows命令提示符下,终端控制字符会意外地显示在屏幕上的问题 - 定义文件`{substrules_section}`:修复了当用户输入的命令与在带有`strictcmdmatch`命令匹配选项的命令限制规则中相等,有关的匹配规则不会被应用的问题 - 修复了`{entries_section}`中的“同时指定多个定义名称”功能无法正常使用的问题 - 全面修复`clitheme-exec`中的应用程序兼容性问题 - 定义文件:优化命令限制条件内容相同但匹配机制选项不同的情况处理 - 定义文件:修复了使用多行内容段落时可能会意外出现「选项不允许在这里指定」的错误提示 - 定义文件:修复并优化内容变量处理 - 定义文件:修复在`{manpage_section}`中输入未知语法词语不会提示错误的问题 # `v2.0-beta2` update changelog ## New features - Support specifying multiple `[file_content]` phrases and filenames in `{manpage_section}`: ```plaintext {manpage_section} [file_content] man1 example.1 [file_content] man1 zh_CN example.1 [file_content] man1 zh_CN.UTF-8 example.1 <File content> [/file_content] {/manpage_section} ``` - New `[include_file]` syntax in `{manpage_section}`, supporting specifying multiple target file paths at once: ```plaintext {manpage_section} [include_file] files pages example.1 as man1 example.1 as man1 en_US example.1 as man1 en_US.UTF-8 example.1 [/include_file] {/manpage_section} ``` - New `foregroundonly` option for `filter_command` and `[filter_commands]` in `{substrules_section}`; only apply substitution rules if process is in foreground state - Applicable for shell and other command interpeter applications that changes foreground state when executing processes - `clitheme-exec`: new `--debug-foreground` option; outputs message when foreground state changes (shown as `! Foreground: False` and `! Foreground: True`) - Support specifying `substesc` and `substvar` options on `[/substitute_string]` and `[/substitute_regex]` in `{substrules_section}`; affects match expression - Support specifying `substvar` on `[/entry]` in `{entries_section}`; affects path name ## Bug fixes and improvements - Non-printable characters in CLI output messages will be displayed in its plain-text representation - Fix compatibility issues with Python 3.8 - Fixes an issue where pressing CTRL-C in `clitheme-man` causes the program to unexpectedly terminate - Fixes an issue where terminal control characters are unexpectedly displayed on screen in Windows Command Prompt - Theme definition file `{substrules_section}`: Fixes and issue where substitution rules with `strictcmdmatch` option are not applied if executed command arguments are the same in command filter - Fixes an issue where "specifying multiple `[entry]` phrases" feature in `{entries_section}` does not work properly - Fix many compatibility issues with applications in `clitheme-exec` - Theme definition file: Optimize processing of command filter definitions with same commands and different match options - Theme definition file: Fix unexpected "Option not allowed here" error when using multi-line content blocks - Theme definition file: Fix and optimize content variable processing - Theme definition file: Fix missing "Unexpected phrase" error in `{manpage_section}` when encountering invalid file syntax
最后提交信息为:
Update version (v2.0-beta2)
预览版本
v2.0-beta1.r2
1af06fc
2024-06-13 14:31
对比
v2.0-beta1
swiftycode
版本`v2.0-beta1.r2`紧急修复了使用`clitheme-man`时可能不会调用自定义的manpage文档(而是系统中的manpage文档)的问题;请重新下载并安装以下的安装包。 Version `v2.0-beta1.r2` includes an emergency bug fix for the problem where `clitheme-man` might not invoke custom man pages (instead invoking system man pages); please re-download and reinstall the packages below. # Beta版本已知问题 - 因为目前无法实现stdout和stderr保留原输出顺序同时显示: - 定义文件中`subststdoutonly`和`subststderronly`选项目前不可用 - 使用`clitheme-exec --debug`时,输出标记会永远显示输出为stdout(`o>`) - 使用`clitheme-exec`执行某些命令时,可能会出现`No access to TTY`或`No job control`等错误信息 - 执行`fish`时,会出现`Inappropriate ioctl for device`的错误提示并且会异常退出 - 执行`vim`并且暂停程序时(使用`:suspend`或`^Z`),终端设置不会还原到正常状态 - 命令行输出替换功能暂不支持Windows系统 - 该功能可能会推迟到`v2.1`版本 代码仓库以及最新的代码更改:https://gitee.com/swiftycode/clitheme/tree/v1.2_dev 文档手册:https://gitee.com/swiftycode/clitheme-wiki-repo/tree/v1.2_dev # Known issues (Beta version) - Because redirecting stdout and stderr to separate streams cannot guarantee original output order as of now: - The `subststdoutonly` and `subststderronly` options in theme definition file is currently unavailable - The output marker will always show that output is stdout (`o>`) when using `clitheme-exec --debug` - When executing certain commands using `clitheme-exec`, error messages such as `No access to TTY` or `No job control` might appear - When executing `fish`, the error message `Inappropriate ioctl for device` will appear and will not run properly - When executing `vim` and suspending the program (using `:suspend` or `^Z`), terminal settings/attributes will not be restored to normal - Command line output substitution feature does not currently support Windows systems - This feature might be delayed for version `v2.1` Code repository and latest code changes: https://gitee.com/swiftycode/clitheme/tree/v1.2_dev Documentation: https://gitee.com/swiftycode/clitheme-wiki-repo/tree/v1.2_dev # `v2.0`更新内容 ## 新功能 ### 重磅新功能 - **新增命令行输出替换功能** - 通过定义替换规则自定义和修改任和命令行应用程序的输出 ```plaintext {header_section} name clang example theme [description] Example theme for clang for demo purposes [/description] {/header_section} {substrules_section} set_options substesc [filter_commands] clang clang++ gcc g++ [/filter_commands] [substitute_regex] (?P<prefix>^({{ESC}}.*?m)*(.+:\d+:\d+:) ({{ESC}}.*?m)*)warning: (?P<esc>({{ESC}}.*?m)*)incompatible pointer types assigning to '(?P<name1>.+)' from '(?P<name2>.+)' locale:default \g<prefix>提示: \g<esc>'\g<name1>'从不兼容的指针类型赋值为'\g<name2>',两者怎么都……都说不过去!^^; [/substitute_regex] [substitute_regex] (?P<prefix>^({{ESC}}.*?m)*(.+:\d+:\d+:) ({{ESC}}.*?m)*)error: (?P<esc>({{ESC}}.*?m)*)unknown type name '(?P<type>.+)' locale:default \g<prefix>错误!: \g<esc>未知的类型名'\g<type>',忘记定义了~ಥ_ಥ [/substitute_regex] {/substrules_section} ``` ```plaintext $ clang test.c test.c:1:1: error: unknown type name 'bool' bool *func(int *a) { ^ test.c:4:3: warning: incompatible pointer types assigning to 'char *' from 'int *' [-Wincompatible-pointer-types] b=a; ^~ 2 errors generated $ clitheme apply-theme clang-theme.clithemedef.txt $ clitheme-exec clang test.c test.c:1:1: 错误!: 未知的类型名'bool',忘记定义了~ಥ_ಥ bool *func(int *a) { ^ test.c:4:3: 提示: 'char *'从不兼容的指针类型赋值为'int *',两者怎么都……都说不过去!^^; [-Wincompatible-pointer-types] b=a; ^~ 2 errors generated. ``` - **支持替换/自定义manpage文档** ```plaintext {header_section} name Man page example theme description A man page example theme for demo purposes {/header_section} {manpage_section} include_file man-pages 1 ls-custom.txt as man1 ls.1 include_file man-pages 1 cat-custom.txt as man1 cat.1 {/manpage_section} ``` ```plaintext $ nano man-pages/1/ls-custom.txt <...> $ nano man-pages/1/cat-custom.txt <...> $ clitheme apply-theme manpage-theme.clithemedef.txt $ clitheme-man cat $ clitheme-man ls ``` - **对主题定义文件语法的优化和修改** - 原语法和文件依然可用 旧语法: ```plaintext begin_header name example theme version 1.0 description_block Some description right here Example theme end_block locales zh_CN en_US supported_apps_block App 1 App 2 App 3 end_block end_header begin_main in_domainapp com.example example-app entry entry-one locale default Some text end_entry in_subsection subsection-two entry entry-two locale_block default Some other text right here entry two end_block end_entry unset_domainapp end_main ``` 新语法: ```plaintext {header_section} name example theme version 1.0 [description] Some description right here Example theme [/description] locales zh_CN en_US [supported_apps] App 1 App 2 App 3 [/supported_apps] {/header_section} {entries_section} in_domainapp com.example example-app [entry] entry-one locale:default Some text [/entry] in_subsection subsection-two [entry] entry-two [locale] default Some other text right here entry two [/locale] [/entry] unset_domainapp {/entries_section} ``` ### 其他功能 - **主题定义文件:支持在多行内容段落中为每一行添加空格和缩进** ```plaintext {entries_section} set_options leadspaces:8 # 或者 set_options leadindents:1 [entry] example_entry # 也可以在段落中设置 [locale] default Some text here [/locale] leadspaces:8 leadindents:1 [/entry] {/entries_section} ``` - **主题定义文件:支持在多行输入中输入`\<结束语句>`以表达结束语句,避免和指令冲突** ```plaintext [entry] example-entry [locale] default Use: \[/locale] to end the block [/locale] [/entry] ``` - **主题定义文件:支持在内容中使用`{{ESC}}`表达终端ASCII Escape字符** ```plaintext {substrules_section} set_options substesc [substitute_regex] (?P<prefix>^({{ESC}}.*?m)*(.+:\d+:\d+:) ({{ESC}}.*?m)*)error: (?P<esc>({{ESC}}.*?m)*)unknown type name '(?P<type>.+)' locale:default \g<prefix>error: \g<esc>未知的类型名'\g<type>',是忘了定义了吗? [/substitute_regex] {/substrules_section} ``` - **主题定义文件:新增内容变量功能,免去重复输入相同的语句** ```plaintext {entries_section} setvar:name Betty setvar:entryheader example-feature set_options substvar # 内容: example-feature-2 setvar:anotherheader {{entryheader}}-2 # 路径: example-feature-example-entry [entry] {{entryheader}}-example-entry # 内容: My name is Betty locale:default My name is {{name}} [/entry] # 路径: example-feature-2-entry [entry] {{anotherheader}}-entry locale:default Something else [/entry] {/entries_section} ``` - **主题定义文件:支持同时定义多个定义名称** ```plaintext [entry] example-entry entry1 [entry] example-entry entry2 locale:default Some text here [/entry] # 等于以下定义 [entry] example-entry entry1 locale:default Some text here [/entry] [entry] example-entry entry2 locale:default Some text here [/entry] ``` ```plaintext [substitute_string] Some text [substitute_string] Also some text locale:default Some Text! (^_^)a [/substitute_string] # 等于以下定义 [substitute_string] Some text locale:default Some Text! (^_^)a [/substitute_string] [substitute_string] Also some text locale:default Some Text! (^_^)a [/substitute_string] ``` - **主题定义文件:新增选项设定机制** ```plaintext {entries_section} set_options leadspaces:8 # 或者 set_options leadindents:1 [entry] example_entry # 也可以在段落中设置 [locale] default Some text here [/locale] leadspaces:8 leadindents:1 [/entry] {/entries_section} ``` - **`clitheme`命令行工具:新增`update-theme`指令,重新从当前定义设定中记录的文件路径应用主题** ```plaintext $ clitheme update-theme <...> ``` - **`clitheme`命令行工具:提示信息支持中文输出** ## 改进和问题修复: - **构建后端改用`setuptools`,项目构建更加方便** - **主题定义文件:修复了单行输入内容没有正确保留多个连续空格的问题** - **修复了当`frontend.set_local_themedef`函数返回失败后,后续调用会永远返回成功的问题** - **主题定义文件:取消了设定`in_subsection`前需要设定`in_domainapp`的要求** - **进一步优化系统语言检测逻辑([根据GNU gettext](https://www.gnu.org/software/gettext/manual/gettext.html#Locale-Environment-Variables))** # `v2.0` update changelog ## New features ### Major features - **New command line output substitution feature** - Modify and customize the output of any command line application by defining substitution rules ```plaintext {header_section} name clang example theme [description] Example theme for clang for demo purposes [/description] {/header_section} {substrules_section} set_options substesc [filter_commands] clang clang++ gcc g++ [/filter_commands] [substitute_regex] (?P<prefix>^({{ESC}}.*?m)*(.+:\d+:\d+:) ({{ESC}}.*?m)*)warning: (?P<esc>({{ESC}}.*?m)*)incompatible pointer types assigning to '(?P<name1>.+)' from '(?P<name2>.+)' locale:default \g<prefix>note: \g<esc>incompatible pointer types '\g<name1>' and '\g<name2>', they're so……so incompatible!~ [/substitute_regex] [substitute_regex] (?P<prefix>^({{ESC}}.*?m)*(.+:\d+:\d+:) ({{ESC}}.*?m)*)error: (?P<esc>({{ESC}}.*?m)*)unknown type name '(?P<type>.+)' locale:default \g<prefix>Error! : \g<esc>unknown type name '\g<type>', you forgot to d……define it!~ಥ_ಥ [/substitute_regex] {/substrules_section} ``` ```plaintext $ clang test.c test.c:1:1: error: unknown type name 'bool' bool *func(int *a) { ^ test.c:4:3: warning: incompatible pointer types assigning to 'char *' from 'int *' [-Wincompatible-pointer-types] b=a; ^~ 2 errors generated $ clitheme apply-theme clang-theme.clithemedef.txt $ clitheme-exec clang test.c test.c:1:1: Error! : unknown type name 'bool', you forgot to d……define it!~ಥ_ಥ bool *func(int *a) { ^ test.c:4:3: note: incompatible pointer types 'char *' and 'int *', they're so……so incompatible!~ [-Wincompatible-pointer-types] b=a; ^~ 2 errors generated. ``` - **Support customizing Unix/Linux manual pages (man pages)** ```plaintext {header_section} name Man page example theme description A man page example theme for demo purposes {/header_section} {manpage_section} include_file man-pages 1 ls-custom.txt as man1 ls.1 include_file man-pages 1 cat-custom.txt as man1 cat.1 {/manpage_section} ``` ```plaintext $ nano man-pages/1/ls-custom.txt <...> $ nano man-pages/1/cat-custom.txt <...> $ clitheme apply-theme manpage-theme.clithemedef.txt $ clitheme-man cat $ clitheme-man ls ``` - **Redesigned theme definition file syntax** - Old files and the old syntax can still be used as before Old syntax: ```plaintext begin_header name example theme version 1.0 description_block Some description right here Example theme end_block locales zh_CN en_US supported_apps_block App 1 App 2 App 3 end_block end_header begin_main in_domainapp com.example example-app entry entry-one locale default Some text end_entry in_subsection subsection-two entry entry-two locale_block default Some other text right here entry two end_block end_entry unset_domainapp end_main ``` New syntax: ```plaintext {header_section} name example theme version 1.0 [description] Some description right here Example theme [/description] locales zh_CN en_US [supported_apps] App 1 App 2 App 3 [/supported_apps] {/header_section} {entries_section} in_domainapp com.example example-app [entry] entry-one locale:default Some text [/entry] in_subsection subsection-two [entry] entry-two [locale] default Some other text right here entry two [/locale] [/entry] unset_domainapp {/entries_section} ``` ### Other features - **Theme definition file: support adding tabs and indents at the start of each line in multi-line content block** ```plaintext {entries_section} set_options leadspaces:8 # or set_options leadindents:1 [entry] example_entry # Can be also set in the content block [locale] default Some text here [/locale] leadspaces:8 leadindents:1 [/entry] {/entries_section} ``` - **Theme definition file: Support using `\<end phrase>` in multi-line content block to express the end phrase, preventing conflict with the command** ```plaintext [entry] example-entry [locale] default Use: \[/locale] to end the block [/locale] [/entry] ``` - **Theme definition file: Support using `{{ESC}}` in content to express the ASCII Escape terminal control character** ```plaintext {substrules_section} set_options substesc [substitute_regex] (?P<prefix>^({{ESC}}.*?m)*(.+:\d+:\d+:) ({{ESC}}.*?m)*)error: (?P<esc>({{ESC}}.*?m)*)unknown type name '(?P<type>.+)' locale:default \g<prefix>Error! : \g<esc>unknown type name '\g<type>', you forgot to d……define it!~ಥ_ಥ [/substitute_regex] {/substrules_section} ``` - **Theme definition file: New content variable feature** ```plaintext {entries_section} setvar:name Betty setvar:entryheader example-feature set_options substvar # Content: example-feature-2 setvar:anotherheader {{entryheader}}-2 # Path: example-feature-example-entry [entry] {{entryheader}}-example-entry # Content: My name is Betty locale:default My name is {{name}} [/entry] # Path: example-feature-2-entry [entry] {{anotherheader}}-entry locale:default Something else [/entry] {/entries_section} ``` - **Theme definition file: Support defining multiple entry names at once** ```plaintext [entry] example-entry entry1 [entry] example-entry entry2 locale:default Some text here [/entry] # Is equivalent to the following: [entry] example-entry entry1 locale:default Some text here [/entry] [entry] example-entry entry2 locale:default Some text here [/entry] ``` ```plaintext [substitute_string] Some text [substitute_string] Also some text locale:default Some Text! (^_^)a [/substitute_string] # Is equivalent to the following: [substitute_string] Some text locale:default Some Text! (^_^)a [/substitute_string] [substitute_string] Also some text locale:default Some Text! (^_^)a [/substitute_string] ``` - **Theme definition file: New options system** ```plaintext {entries_section} set_options leadspaces:8 # or set_options leadindents:1 [entry] example_entry # Can also be set in the content block [locale] default Some text here [/locale] leadspaces:8 leadindents:1 [/entry] {/entries_section} ``` - **`clitheme` command line utility: New `update-theme` command, re-apply theme definition files recorded in the current theme setting** ```plaintext $ clitheme update-theme <...> ``` - **`clitheme` command line utility: Add Chinese support for output messages** ## Improvements and bug fixes: - **Build backend changed to `setuptools`** - **Theme definition file: Fixed and issue where multiple continuous spaces are not preserved correctly in single-line content** - **Fixed and issue where when `frontend.set_local_themedef` function fails, subsequent invokes will always succeed** - **Theme definition file: Removed requirement that `in_domainapp` must be set before using `in_subsection`** - **Further optimizations to system locale detection ([based on GNU gettext](https://www.gnu.org/software/gettext/manual/gettext.html#Locale-Environment-Variables))**
最后提交信息为:
Update version (v2.0-beta1.r2)
v1.1-r2
5575b9e
2024-04-06 23:34
对比
v1.1-r2
swiftycode
## 问题修复: - **修复了设置`frontend.set_local_themedef`的`overlay=True`选项后该功能无法工作的问题** - **修复了`frontend`功能中子路径信息处理错误的问题** ## Bug fixes: - **Fixes an issue where setting `overlay=True` in `frontend.set_local_themedef` causes the function to not work properly** - **Fixes an issue where the subsections in `frontend` functions are incorrectly parsed**
最后提交信息为:
!2
v1.1-r2版本发布
v1.1-r1
20c1aec
2024-01-22 20:36
对比
v1.1
swiftycode
## 新功能: - **主题定义文件header中添加`description`,允许说明详细信息** ```plaintext begin_header # ... description Some description end_header ``` - **定义文件中允许多行输入** - **`locale-block`中支持定义多个语言,省去重复定义字符串** ```plaintext # header description_block Some description Some other description end_block # main entry com.example example-app example-entry # 同时定义en_US,C,和en语言 locale_block en_US C en Some text Some text here Also some text end_block end_entry ``` - **定义文件支持在项目内部署** - 先尝调用全局主题数据,再尝试使用本地部署的数据 - 可以通过这种方式为你的项目添加多语言支持 - **命令行界面的输出支持通过主题定义文件修改** - **frontend模块:新增`format_entry_or_fallback`功能** - **添加对Windows的支持** - 目前不支持读取Windows下的系统语言 - **cli:支持在`apply-theme`和`generate-data-hierarchy`指令上同时指定多个定义文件** ## 改进和错误修复: - **frontend模块:优化系统语言检测** - **cli:重命名`generate-data-hierarchy`命令为`generate-data`** - 原命令依然可用 - **修复命令行界面提示中的一些语法和拼写错误** 新版本请多多指教(。ì _ í。) ## New features: - **New `description` header definition for theme definition files** ```plaintext begin_header # ... description Some description end_header ``` - **Add support for multi-line/block input in theme definition files** - **Using `locale-block` allows you to define multiple language at the same time, eliminating the need for repeated definitions** ```plaintext # header description_block Some description Some other description end_block # main entry com.example example-app example-entry # Defining en_US, C, and en locale at the same time locale_block en_US C en Some text here Also some text end_block end_entry ``` - **Support local deployment of theme definition files** - Locally-deployed files will be used if entry not found in global theme data - This feature can be used to add multi-language/localization support - **The CLI interface can be modified using theme definition files** - **frontend module: Add `format_entry_or_fallback` function** - **Add support for Windows** - Current system locale cannot be read under Windows - **CLI interface: Support specifying multiple files on `apply-theme` and `generate-data-hierarchy` commands** ## Improvements and bug fixes: - **frontend module: Optimize language detection process** - **CLI interface: Rename `generate-data-hierarchy` command to `generate-data`** - The original command can still be used - **Fix some grammar and spelling errors in output messages**
最后提交信息为:
Merge version 1.1 into main branch
v1.0-r2
b05ee5e
2023-12-17 19:50
对比
v1.0-r2
swiftycode
该版本添加了对软件包构建的优化和改进,并且修复了一些问题。 - 正常的版本命名将使用`-`,仅Arch Linux软件包使用`_` - 支持通过debian软件包安装(包含构建文件和信息) - 添加manpage文档(`clitheme.1`) - 添加/修复`generate-data-hierarchy`功能 - 不再提供Arch Linux软件包(因为Python版本会不匹配) - 优化PKGBUILD的构建过程(不需要再新建归档文件,直接运行`makepkg`即可)
最后提交信息为:
Change license identifier to GPL3
v1.0_r1
00736ce
2023-12-13 11:48
对比
v1.0_r1
swiftycode
我很高兴的宣布,本项目的第一个版本正式发布! 关于项目的更多信息,请参考README文件以及项目的Wiki页面。 欢迎各位通过Issues和Pull Requests提出建议和问题反馈。
最后提交信息为:
Update version information to 1.0_r1
下载
请输入验证码,防止盗链导致资源被占用
取消
下载
Python
1
https://gitee.com/swiftycode/clitheme.git
git@gitee.com:swiftycode/clitheme.git
swiftycode
clitheme
CLItheme
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册