Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
112 changed files
with
1,802 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
syntax: glob | ||
|
||
|
||
.idea* | ||
*.pyc | ||
|
||
*.pyo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '1.1.0-dev' | ||
__version__ = '1.0.2' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__author__ = 'dimka' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__author__ = 'dimka' |
39 changes: 39 additions & 0 deletions
39
markitup_field/management/commands/dice_markup_build_css.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
from django.core.management.base import BaseCommand, CommandError | ||
|
||
import os | ||
|
||
from scss import Scss | ||
css = Scss() | ||
|
||
class Command(BaseCommand): | ||
# args = '<arg_x arg_y ...>' | ||
help = "Builds 'style.css' of markups in one css-file using pySCSS" | ||
|
||
def handle(self, *args, **options): | ||
my_path = os.path.dirname(__file__) | ||
sets_path = os.path.join(my_path, '../../static/markitup/sets/') | ||
sets_path = os.path.abspath(sets_path) | ||
|
||
style_scss = '' | ||
# sets list | ||
sets = [set_dir for set_dir in os.listdir(sets_path) if os.path.isdir(os.path.join(sets_path, set_dir))] | ||
for set_dir in sets: | ||
set_path = os.path.join(sets_path, set_dir, 'style.css') | ||
|
||
set_css = open(set_path, 'r').read() | ||
set_css = set_css.replace('url(images/', 'url({}/images/'.format(set_dir)) | ||
|
||
set_scss = '.{set_dir} {{\n{set_css}\n}}\n'.format(set_dir=set_dir, set_css=set_css) | ||
|
||
style_scss += set_scss | ||
|
||
style_css = css.compile(style_scss) | ||
|
||
with open(os.path.join(sets_path, 'style.css'), 'w') as style_css_file: | ||
style_css_file.write(style_css) | ||
|
||
# style_css_file = open(os.path.join(sets_path, 'style.css'), 'w') | ||
# style_css_file.write(style_css) | ||
# style_css_file.close() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
from django.conf import settings | ||
|
||
from markitup_field.markup import MARKUP_FILTERS | ||
|
||
|
||
MARKUP_FILTERS.update(getattr(settings, 'MARKUP_FILTERS', {})) | ||
MARKUP_CHOICES = getattr(settings, 'MARKUP_CHOICES', None) | ||
|
||
if not MARKUP_CHOICES: | ||
MARKUP_CHOICES = ( | ||
('text', 'Text'), | ||
('html', 'HTML'), | ||
('markdown', 'Markdown'), | ||
('textile', 'Textile'), | ||
('restructuredtext', 'ReStructured Text'), | ||
) | ||
|
||
MARKUP_CHOICES = [markup for markup in MARKUP_CHOICES if markup[0] in MARKUP_FILTERS.keys()] | ||
|
||
MARKUP_DEFAULT_FORMAT = getattr(settings, 'MARKUP_DEFAULT_FORMAT', 'default') | ||
|
||
MARKUP_AUTO_PREVIEW = getattr(settings, 'MARKUP_AUTO_PREVIEW', False) | ||
|
||
MARKUP_SKIN = getattr(settings, 'MARKUP_SKIN', 'markitup/skins/simple') | ||
|
||
JQUERY_URL = getattr(settings, 'JQUERY_URL', 'http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js') | ||
|
Oops, something went wrong.