Skip to content

Commit

Permalink
FIX: MAKE DARK STYLE COMPATIBLE WITH MARKDOWN CONTENT
Browse files Browse the repository at this point in the history
make dark style compatible with markdown content.
fix flasky shell command for init, addusr, delusr.
  • Loading branch information
nsosnsos committed May 2, 2023
1 parent 41b05f3 commit e0076f5
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 7 deletions.
26 changes: 23 additions & 3 deletions flasky.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ HOME_PATH=$(eval echo ~${SUDO_USER})
SCRIPT_FILE=$(basename $(readlink -f "${0}"))
SCRIPT_PATH=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)

if [ ${#} -eq 0 ]; then
if [[ ${#} -eq 0 ]]; then
OPTION='run'
else
OPTION=${1}
Expand Down Expand Up @@ -34,11 +34,31 @@ if [[ ${#} -eq 0 || ${OPTION} == 'debug' ]]; then
elif [ ${OPTION} == 'clean' ]; then
clean
elif [ ${OPTION} == 'init' ]; then
if [[ ${#} -ne 5 ]]; then
echo "${SCRIPT_FILE} init --mail_address EMAIL_ADDRESS --mail_password EMAIL_PASSWORD"
exit -1
fi
sudo apt install libgl1 -y
cd ${SCRIPT_PATH}
source ${PYTHON_ENV}
pip3 install -r ${SCRIPT_PATH}/requirements.txt
flask init
flask init --mail_address ${3} --mail_password ${5}
elif [ ${OPTION} == 'addusr' ]; then
if [[ ${#} -ne 5 ]]; then
echo "${SCRIPT_FILE} addusr --username USERNAME --password PASSWORD"
exit -1
fi
cd ${SCRIPT_PATH}
source ${PYTHON_ENV}
flask addusr --username ${3} --password ${5}
elif [ ${OPTION} == 'delusr' ]; then
if [[ ${#} -ne 3 ]]; then
echo "${SCRIPT_FILE} delusr --username"
exit -1
fi
cd ${SCRIPT_PATH}
source ${PYTHON_ENV}
flask delusr --username ${3}
elif [ ${OPTION} == 'test' ]; then
cd ${SCRIPT_PATH}
source ${PYTHON_ENV}
Expand Down Expand Up @@ -67,6 +87,6 @@ elif [ ${OPTION} == 'restore' ]; then
source ${PYTHON_ENV}
flask restore
else
echo "Usage: ${SCRIPT_FILE} [run|clean|test|init|deploy]"
echo "Usage: ${SCRIPT_FILE} [init|debug|run|deploy|test|clean|addusr|delusr|backup|restore]"
fi

9 changes: 8 additions & 1 deletion hallelujah/static/css/markdown_patch.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
/* markdown code block */
.markdown-body {
background-color: transparent;
box-sizing: border-box;
padding: 15px;
}
.markdown-body table tr {
background-color: transparent;
}
.markdown-body table tr:nth-child(2n) {
background-color: transparent;
opacity: 0.7;
}
.markdown-body pre {
margin-top, margin-bottom: 5px;
padding: 0;
Expand All @@ -24,7 +32,6 @@
display: table;
}
.markdown-body code.hljs table.hljs-ln tr {
background-color: #f6f8fa;
border: 0;
}
.markdown-body code.hljs table.hljs-ln td.hljs-ln-line {
Expand Down
4 changes: 2 additions & 2 deletions hallelujah/templates/_highlight.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% extends '_base.html' %}

{% block styles %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/markdown_patch.css', _external=True) }}">
{{ super() }}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/styles/googlecode.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/github-markdown.min.css">
{{ super() }}
<link rel="stylesheet" href="{{ url_for('static', filename='css/markdown_patch.css', _external=True) }}">
{% endblock styles %}

{% block scripts %}
Expand Down
2 changes: 1 addition & 1 deletion hallelujah/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def send_async_email(app, message):
try:
mail.send(message)
except Exception as e:
app.config.logger.error('send_async_email: {}'.format(str(e)))
app.logger.error('send_async_email: {}'.format(str(e)))


def send_email(to, subject, msg):
Expand Down

0 comments on commit e0076f5

Please sign in to comment.