Skip to content

Commit

Permalink
优化代码注释,优化注释规则逻辑。优化代码模块,新增对go、c和c++文件默认注释规则
Browse files Browse the repository at this point in the history
  • Loading branch information
alanchenchen committed Nov 10, 2018
1 parent 2ede878 commit 42aecdf
Show file tree
Hide file tree
Showing 14 changed files with 1,738 additions and 573 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> An application to count code in electron-vue
> version: 1.0.0
> version: 1.0.1
> Author: Alan Chen
Expand All @@ -24,15 +24,15 @@
2. 过滤功能只对文件夹生效,在弹窗中按enter添加,注意添加后缀名必须带上点
3. 注释规则文件名不需要带点,规则分为多行注释和单行注释,非必填,一个后缀名文件可以添加多个规则,但不可重复。
4. 软件默认过滤`node_modules``.git`两个文件夹。
5. 软件默认提供js、html、css、jsx、java和vue等文件的注释规则
6. 读取代码的原理其实是将目标文件的buffer转换成utf-8的string,所以只支持uft-8编码的文件,默认不支持图片和office所有文件!也不要读取非utf-8的文件,否则统计结果不可信。大多数code的编码格式是utf-8。
5. 软件默认提供js、go、html、css、jsx、java、vue、c和c++等文件的注释规则
6. 读取代码的原理其实是将目标文件的buffer转换成utf-8的string,所以只支持uft-8编码的文件,默认不支持图片和office所有文件!也不要读取非utf-8的文件,否则统计结果不可信。大多数code的编码格式是utf-8。例如:读取LICENSE文件会报错,软件异常

### Download

* [安装包版本](https://pan.baidu.com/s/1s-7ys5bYiYvApsj6g_i0uA) 密码: t4gy
* [绿色版本](https://pan.baidu.com/s/1HZtqWzXlxCkJzUCEju1g7w) 密码: 3yhj
* [安装包版本](https://pan.baidu.com/s/1IsWndIKNg71tfTIZ0-kyiw) 密码: sb5g
* [绿色版本](https://pan.baidu.com/s/1ksohHS9X5cfThe4HMB8cBA) 密码: d8ir

### Dictionary Tree
### Directory Tree
``` bash
├─.electron-vue electron-vue的webpack配置文件
├─build
Expand All @@ -55,12 +55,13 @@
```

### 踩坑记录
1. electron本身下载必须翻墙!使用cnpm等着包出错吧~
1. electron本身下载必须翻墙!使用cnpm等着包出错吧~建议全程使用yarn
2. electron-builder 嗯...不用说了,翻墙吧
3. 为了阻止程序多开,也是找了好久才找到makeSingleInstance这个api...
4. 无边框窗口也是坑,默认的title右键菜单隐藏不了...嗯,就这样了
5. 窗口的title只能从index.html里改变title标签...文档哪里说了?
6. 感慨一下,还是原生node用的舒服,不用管什么electron重新编译一把...就这么多吧
6. 主进程中window的icon必须是路径!不能是图片base64数据!所以在electron-vue中一定要把icon放在static目录
7. 感慨一下,还是原生node用的舒服,不用管什么electron重新编译一把...就这么多吧

### Build Setup

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codecounter",
"version": "1.0.0",
"version": "1.0.1",
"author": "alanchenchen <739709491@qq.com>",
"description": "An application to count code in electron-vue",
"license": "MIT",
Expand Down
78 changes: 39 additions & 39 deletions src/renderer/common/CItem.vue → src/renderer/component/CItem.vue
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
<template>
<FormItem>
<div slot="label">
{{itemData.title}}
<Tooltip :content="itemData.tooltip">
<Icon type="help-circled" size="16" color="#2d8cf0" class="cursor" />
</Tooltip>
</div>
<i-switch v-model="itemData.enabled">
<Icon type="android-done" slot="open"></Icon>
<Icon type="android-close" slot="close"></Icon>
</i-switch>
<Button
v-show="itemData.enabled"
size="small"
class="exclude_btn"
type="dashed"
@click="itemData.isModal = true">添加{{itemData.title}}</Button>
</FormItem>
</template>

<script>
export default {
props: {
itemData: {
type: Object,
required: true
}
}
}
</script>

<style lang="css" scoped>
.exclude_btn {
margin-left: 40px;
}
.cursor {
cursor: pointer;
}
<template>
<FormItem>
<div slot="label">
<Tooltip :content="itemData.tooltip" placement="bottom-start">
{{itemData.title}}
<Icon type="help-circled" size="16" color="#2d8cf0" class="cursor" />
</Tooltip>
</div>
<i-switch v-model="itemData.enabled">
<Icon type="android-done" slot="open"></Icon>
<Icon type="android-close" slot="close"></Icon>
</i-switch>
<Button
v-show="itemData.enabled"
size="small"
class="exclude_btn"
type="dashed"
@click="itemData.isModal = true">添加{{itemData.title}}</Button>
</FormItem>
</template>

<script>
export default {
props: {
itemData: {
type: Object,
required: true
}
}
}
</script>

<style lang="css" scoped>
.exclude_btn {
margin-left: 40px;
}
.cursor {
cursor: pointer;
}
</style>
140 changes: 70 additions & 70 deletions src/renderer/common/CModal.vue → src/renderer/component/CModal.vue
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
<template>
<Modal v-model="modal.isModal" :styles="{marginTop: '-20px'}">
<p slot="header" style="color:#2d8cf0;text-align:center">
<Icon type="information-circled" />
<span>{{modal.title}} 配置</span>
</p>
<p slot="footer" style="color:#2d8cf0;text-align:center">
<Button long @click="modal.isModal=false">确 定</Button>
</p>
<div>
<div class="inline">
<p>{{modal.input.label}}</p>
<Input
v-model.trim="ipnutVal"
placeholder="按enter键添加"
style="width: 160px"
clearable
@on-enter="add" />
</div>
<div class="tagContent">
<Tag
v-for="(item, i) of modal.list"
:key="i"
:name="item"
color="blue"
closable
type="border"
@on-close="del">{{item}}</Tag>
</div>
</div>
</Modal>
</template>

<script>
export default {
props: {
modal: {
type: Object,
required: true
}
},
data() {
return {
ipnutVal: '',
formData: {}
}
},
methods: {
add() {
this.$emit('addTag', this.ipnutVal)
this.ipnutVal = ''
},
del(e, name) {
this.$emit('delTag', name)
}
}
}
</script>

<style lang="css" scoped>
.tagContent {
height: 100px;
overflow: auto;
}
.inline {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
<template>
<Modal v-model="modal.isModal" :styles="{marginTop: '-20px'}">
<p slot="header" style="color:#2d8cf0;text-align:center">
<Icon type="information-circled" />
<span>{{modal.title}} 配置</span>
</p>
<p slot="footer" style="color:#2d8cf0;text-align:center">
<Button long @click="modal.isModal=false">确 定</Button>
</p>
<div>
<div class="inline">
<p>{{modal.input.label}}</p>
<Input
v-model.trim="ipnutVal"
placeholder="按enter键添加"
style="width: 160px"
clearable
@on-enter="add" />
</div>
<div class="tagContent">
<Tag
v-for="(item, i) of modal.list"
:key="i"
:name="item"
color="blue"
closable
type="border"
@on-close="del">{{item}}</Tag>
</div>
</div>
</Modal>
</template>

<script>
export default {
props: {
modal: {
type: Object,
required: true
}
},
data() {
return {
ipnutVal: '',
formData: {}
}
},
methods: {
add() {
this.$emit('addTag', this.ipnutVal)
this.ipnutVal = ''
},
del(e, name) {
this.$emit('delTag', name)
}
}
}
</script>

<style lang="css" scoped>
.tagContent {
height: 100px;
overflow: auto;
}
.inline {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
</style>
Loading

0 comments on commit 42aecdf

Please sign in to comment.