Skip to content

Commit 2e1e1f1

Browse files
committed
Initial commit
0 parents  commit 2e1e1f1

File tree

567 files changed

+99118
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

567 files changed

+99118
-0
lines changed

.gitignore

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*,cover
47+
.hypothesis/
48+
49+
# Translations
50+
*.mo
51+
*.pot
52+
53+
# Django stuff:
54+
*.log
55+
local_settings.py
56+
57+
# Flask stuff:
58+
instance/
59+
.webassets-cache
60+
61+
# Scrapy stuff:
62+
.scrapy
63+
64+
# Sphinx documentation
65+
docs/_build/
66+
67+
# PyBuilder
68+
target/
69+
70+
# Jupyter Notebook
71+
.ipynb_checkpoints
72+
73+
# pyenv
74+
.python-version
75+
76+
# celery beat schedule file
77+
celerybeat-schedule
78+
79+
# dotenv
80+
.env
81+
82+
# virtualenv
83+
.venv
84+
venv/
85+
ENV/
86+
87+
# Spyder project settings
88+
.spyderproject
89+
90+
# Rope project settings
91+
.ropeproject
92+
93+
README.md.html

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2017 Y. SOMDA
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Chameledit
2+
3+
![Chameledit](chameledit/static/images/icon.png)
4+
5+
Chameledit a simple web editor that :sparkles:magically:sparkles:
6+
highlights your source code.
7+
8+
Chameledit is powered by
9+
[Guesslang programming language detector](https://github.com/yoeo/guesslang).
10+
11+
#### Preview
12+
13+
<a href="http://guesslang.readthedocs.io/en/latest/_static/videos/chameledit.webm">
14+
<img src="data/chameledit.png" alt="Pasta chameledit_" />
15+
</a>
16+
17+
## Installation
18+
19+
* Python 3.5+ is required
20+
21+
You can install Chameledit using the following command:
22+
23+
```bash
24+
python3 setup.py install
25+
```
26+
27+
## Usage
28+
29+
Launch Chameledit server
30+
31+
```bash
32+
chameledit-gunicorn
33+
```
34+
35+
Then go to `http://localhost:8000/`
36+
37+
## License and stuff...
38+
39+
* [Language detection powered by Guesslang](https://github.com/yoeo/guesslang)
40+
41+
* [Guesslang documentation](https://guesslang.readthedocs.io/en/latest/)
42+
43+
* Chameledit icon created with
44+
[AndroidAssetStudio](https://github.com/romannurik/AndroidAssetStudio)
45+
46+
* Chameledit — Copyright (c) 2017 Y. SOMDA, [MIT License](LICENSE)

bin/chameledit-gunicorn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
gunicorn -b 0.0.0.0:8000 -w 4 chameledit.chameledit:app

chameledit/__init__.py

Whitespace-only changes.

chameledit/__main__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from chameledit.chameledit import main
2+
3+
4+
if __name__ == "__main__":
5+
main()

chameledit/chameledit.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from flask import Flask, render_template, request, jsonify
2+
3+
from guesslang import Guess
4+
5+
6+
app = Flask(__name__)
7+
app.config.update(dict(DEBUG=True, SECRET_KEY='development key'))
8+
9+
guess = Guess()
10+
11+
12+
@app.route('/', methods=['GET', 'POST'])
13+
def index():
14+
return render_template('index.html')
15+
16+
17+
@app.route('/language-name', methods=['POST'])
18+
def language():
19+
source_code = request.form['code']
20+
print(source_code)
21+
return guess.language_name(source_code)
22+
23+
24+
def main():
25+
app.run()

chameledit/static/images/icon.png

8.46 KB
Loading
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.txt text
2+
*.js text
3+
*.html text
4+
*.md text
5+
*.json text
6+
*.yml text
7+
*.css text
8+
*.svg text
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/node_modules
2+
/demo
3+
/doc
4+
/test
5+
/test*.html
6+
/index.html
7+
/mode/*/*test.js
8+
/mode/*/*.html
9+
/mode/index.html
10+
.*
11+
bin

0 commit comments

Comments
 (0)