# Ramile
_Ramile a handy tool used to automatically extract 3000 lines of source codes from given project/folder, as a requirement of China Software Copyright application process. The goal of Ramile is to save 0.5~1 hour of your time spent on preparing the 60 pages of source code for each Software Copyright submission._
Currently Ramile has below features:
- Automatically extracting the source code and generating a docx file containing 3000 lines. (You have to manually remove the last few pages of the docx to make it exactly 60 pages, though)
- Supporting most of the commmon front-end projects: android/ios/web/Wechat mini program, etc
- Configurable. Just place a `.ramileconfig.json` under the project root folder. (See "Config" section for details)
Tested under python 3.6.1.
## Installation
Right now we can only run Ramile from source code. In the future it may be uploaded to pypi.
To run Ramile source code, clone the repository and install dependencies: `pip install -r requirements.txt`. Or if in China, mirros could be used `pip install -i https://pypi.mirrors.ustc.edu.cn/simple/ -r requirements.txt`
## Basic Usage
Running from source code:
```
python ramile-cli.py extract <path to your project root>
```
When the extraction is completed, a file named `extracted_code.docx` will be generated under your project root directory, with 3000 lines of code. You just have to open it and remove unnecessary pages to make the document exact 60 pages.
If you want to strictly meet the [regulation](./著作权法.md#第十条-软件的鉴别材料包括程序和文档的鉴别材料), you can extract all the lines by append `Inf` to the command line:
```
python ramile-cli.py extract <path to your project root> Inf
```
And then you just have to open it and keep the first 30 pages and the last 30 pages, and remove all the intermediate pages.
## Config
Ramile automatically loads the config file `.ramileconfig.json` from the project root, if it exits. The file should be in json format. Possible config items as below:
| Key | Description | Default | Example |
| :--------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------ | :--------------- |
| ignore | Sets the directories/files to be ignored by Ramile. "ignore" paths should be sub directories/files under source_root. Any directories/files starting with any one of the "ignore" items will be ignored. Wildcars are not supported. | [] | ['Pods', 'libs'] |
| source_root | Overwrites the root directory of source codes to avoid Ramile process from the project root. | '' | 'app' |
| filters | Sets the exclusive filters (which means, all other extensions will NOT be processed) for file extensions. By default all files will be processed. | [] | ['.js', '.vue'] |
| lines_to_extract | Sets the total lines to extract | 3000 | 3000 |
## Supported Languages
| Language | Extensions |
| :---------- | :-------------------- |
| JavaScript | .js, .jsx, .vue, .wpy |
| Java | .java |
| PHP | .php |
| HTML | .html, .htm |
| CSS | .css, .less, .sass |
| Swift | .swift |
| Objective-C | .m |
## Test:
```shell
cd tests
pytest
```
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
拉米利 Ramile 一个方便的工具,用于从给定的项目/文件夹中自动提取 3000 行源代码,作为中国软件版权申请过程的要求。 Ramile 的目标是为每个软件版权提交节省 0.5~1 小时准备 60 页源代码的时间。 目前 Ramile 具有以下功能: 自动提取源代码并生成包含3000行的docx文件。 (不过,您必须手动删除 docx 的最后几页以使其恰好为 60 页) 支持大部分常见前端项目:android/ios/web/微信小程序等 可配置的。 只需将.ramileconfig.json放在项目根文件夹下。 (详见“配置”部分) 在 python 3.6.1 下测试。 安装 现在我们只能从源代码运行 Ramile。 将来它可能会上传到pypi。 要运行 Ramile 源代码,请克隆存储库并安装依赖项: pip install -r requirements.txt 。 或
资源详情
资源评论
资源推荐
收起资源包目录
ramile-master.zip (31个子文件)
ramile-master
.gitignore 1KB
README.md 4KB
tests
test_js.py 809B
__init__.py 0B
requirements.txt 6B
data
js-react-native-app
react-native-app.js 788B
.vscode
settings.json 181B
template.ramileconfig.json 80B
LICENSE 1KB
著作权法.md 8KB
requirements.txt 16B
ramile-cli.py 659B
ramile
project_info.py 2KB
file_info.py 884B
processors
oc_processor.py 533B
java_processor.py 538B
html_comment_block_filter.py 682B
swift_processor.py 540B
html_processor.py 679B
c_style_comment_block_filter.py 680B
__init__.py 4KB
php_processor.py 669B
css_processor.py 633B
blank_line_filter.py 440B
comment_block_filter.py 344B
js_processor.py 558B
double_slash_comment_filter.py 330B
__init__.py 190B
project.py 3KB
data
template.docx 18KB
project_processor.py 2KB
共 31 条
- 1
真好玩主人
- 粉丝: 20
- 资源: 4632
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0