Skip to content

Commit

Permalink
add version modify
Browse files Browse the repository at this point in the history
  • Loading branch information
madneal committed Feb 14, 2018
1 parent 0349922 commit 087a96c
Show file tree
Hide file tree
Showing 14 changed files with 495 additions and 2 deletions.
21 changes: 20 additions & 1 deletion build.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os
import shutil
import zipfile
import json

zip_dir = 'export-to-markdown'
zip_filename = zip_dir + '.zip'

Expand All @@ -23,10 +25,27 @@ def zip():
print(root + ':' + file)
zipf.write(os.path.join(root, file))

def modify_version():
with open(zip_dir + '/manifest.json', 'r') as f:
manifest = json.load(f)
version = manifest['version']
version = version.replace('.', '')
version = int(version)
version = version + 1
version = str(version)
version = '.'.join(version)
if len(version) < 4:
version = '0.' + version
manifest['version'] = version
with open(zip_dir + '/manifest.json', 'w') as f:
json.dump(manifest, f)

if __name__ == '__main__':
if os.path.isdir(zip_dir):
shutil.rmtree(zip_dir)
os.remove(zip_filename)
if os.path.exists(zip_filename):
os.remove(zip_filename)
create_dir()
move_files()
modify_version()
zip()
Binary file added export-to-markdown.zip
Binary file not shown.
Binary file added export-to-markdown/icons/medium-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added export-to-markdown/icons/medium-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added export-to-markdown/icons/medium-64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added export-to-markdown/icons/medium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added export-to-markdown/icons/trash-can.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions export-to-markdown/load.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions export-to-markdown/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name": "Export to Markdown", "short_name": "ExportToMarkdown", "description": "This is utilized to export the story in Medium to a markdown format file.", "version": "0.1.7", "icons": {"16": "icons/medium-16.png", "48": "icons/medium-48.png", "64": "icons/medium-64.png", "128": "icons/medium.png"}, "permissions": ["tabs", "https://*/*"], "browser_action": {"default_title": "Export to Markdown", "default_icon": "icons/medium.png", "default_popup": "popup.html"}, "manifest_version": 2, "homepage_url": "https://github.com/neal1991/export-medium"}
128 changes: 128 additions & 0 deletions export-to-markdown/popup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
textarea {
width: 800px;
height: 600px;
}

.history-list {
font-size: 18px
}

body {
width: 800px;
height: 600px;
}

.buttons li {
list-style: none;
display: inline;
margin-right: 5px;
font-weight: bold;
}

h1,
button {
display: inline;
color: gray;
border-radius: 5px;
font-weight: bold;
filter: alpha(opacity=50)
}

#shadow {
position: fixed;
top: 0;
left: 0;
z-index: 0;
width: 100%;
background-color: #000;
opacity: .2;
filter: alpha(opacity=20);
}

ul img {
width: 1.5rem;
height: 1.5rem;
position: relative;
top: .4rem;
}

.load {
width: 50px;
height: 50px;
position: fixed;
left: 50%;
top: 50%;
-webkit-animation: spin1 2s infinite linear;
-moz-animation: spin1 2s infinite linear;
-o-animation: spin1 2s infinite linear;
-ms-animation: spin1 2s infinite linear;
animation: spin1 2s infinite linear;
display: block;
visibility: hidden;
}

@-webkit-keyframes spin1 {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}

@-moz-keyframes spin1 {
0% {
-moz-transform: rotate(0deg);
}
100% {
-moz-transform: rotate(360deg);
}
}

@-o-keyframes spin1 {
0% {
-o-transform: rotate(0deg);
}
100% {
-o-transform: rotate(360deg);
}
}

@-ms-keyframes spin1 {
0% {
-ms-transform: rotate(0deg);
}
100% {
-ms-transform: rotate(360deg);
}
}
</style>
</head>

<body>

<div class="main">
<ul class="buttons">
<li><button class="copy">copy to clipboard</button></li>
<li><button class="history">history</button></li>
</ul>

<span><img src="load.svg" class="load"></span>
<div class="left-area">
<textarea id="source"></textarea>
</div>
<div class="right-area"></div>
</div>
<script src="scripts/snarkdown.js"></script>
<script src="scripts/turndown.min.js"></script>
<script src="scripts/widget.js"></script>
</body>

</html>
2 changes: 2 additions & 0 deletions export-to-markdown/scripts/snarkdown.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 087a96c

Please sign in to comment.