chown venv dir in install script

set default ace editor options
lower font size on editor
This commit is contained in:
Matthew Scragg 2014-09-08 12:49:37 -05:00
parent f2f1e3f51e
commit 6459d6b842
5 changed files with 19 additions and 16 deletions

View file

@ -2,6 +2,7 @@
# Provision script created for Ubuntu 14.04
APP_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
APP_USER="$( stat -c '%U' ${APP_DIR} )"
echo "Provisioning..."
@ -9,7 +10,7 @@ add-apt-repository -y ppa:chris-lea/node.js
apt-get update
apt-get install -y python build-essential git libpcre3-dev python-software-properties \
python-pip python-virtualenv python-dev pkg-config curl libxml2-dev libxslt1-dev zlib1g-dev \
libffi-dev nodejs screen node-cleancss libyaml-dev
libffi-dev nodejs screen libyaml-dev
# Default cache is memoization
@ -40,7 +41,9 @@ virtualenv .venv
source .venv/bin/activate
pip install -r requirements.txt
chown -R ${APP_USER}.${APP_USER} .venv
echo "Installing start scripts"
cat << EOF > /usr/local/bin/realms-wiki
#!/bin/bash
${APP_DIR}/.venv/bin/python ${APP_DIR}/manage.py "\$@"

View file

@ -178,7 +178,10 @@ class Wiki():
meta_end = re.search("\n(\.{3}|\-{3})", content)
if not meta_end:
return None
try:
return yaml.safe_load(content[0:meta_end.start()])
except Exception as e:
return {'error': e.message}
def compare(self, name, old_sha, new_sha):
old = self.get_page(name, sha=old_sha)

View file

@ -87,7 +87,7 @@ body {
right: 0;
bottom: 0;
font-family: Inconsolata, monospace;
font-size: 1.2em;
font-size: 1.1em;
line-height: 1.3em;
}

View file

@ -267,6 +267,9 @@ $(function () {
function initAce() {
editor = ace.edit("editor");
editor.focus();
editor.setOptions({
enableBasicAutocompletion: true
});
}
function initUi() {
@ -274,9 +277,13 @@ $(function () {
fetchTheme(profile.theme, function () {
$theme.find('li > a[data-value="' + profile.theme + '"]').addClass('selected');
editor.setBehavioursEnabled(true);
editor.getSession().setUseWrapMode(true);
editor.setShowPrintMargin(false);
editor.getSession().setTabSize(2);
editor.getSession().setUseSoftTabs(true);
editor.renderer.setShowInvisibles(true);
editor.renderer.setShowGutter(false);
editor.getSession().setMode('ace/mode/markdown');
editor.getSession().setValue(profile.currentMd || editor.getSession().getValue());

View file

@ -3,7 +3,6 @@ Handlebars.registerHelper('well', function(options) {
return '<div class="well">' + options.fn(this) + '</div>';
});
Handlebars.registerPartial('item', '<table class="table table-bordered"><tr><td>{{ name }}<td><td></tr></table>')
/* © 2013 j201
* https://github.com/j201/meta-marked */
@ -82,7 +81,7 @@ var MDR = {
return id;
});
}
//html = this.hook(html);
this.hook();
return html;
},
@ -98,15 +97,6 @@ var MDR = {
}
},
hook: function(html) {
if (!this.doc.meta) {
return html;
}
try {
var template = Handlebars.compile(html);
return template(this.doc.meta);
} catch(e) {
return html;
}
hook: function() {
}
};