Giter VIP home page Giter VIP logo

ramile's Introduction

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, 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:

cd tests
pytest

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.