mirror of https://gitlab.com/bashrc2/epicyon
Formatting of welcome text
parent
28deeff775
commit
47788d5a43
|
@ -0,0 +1,5 @@
|
||||||
|
# Welcome
|
||||||
|
|
||||||
|
Epicyon is an ActivityPub server designed for self-hosting of a few people on low power systems such as single board computers or old laptops. It's intended to be as easy as possible to install and maintain.
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Welcome to Epicyon
|
|
@ -21,6 +21,26 @@ from content import addHtmlTags
|
||||||
from content import replaceEmojiFromTags
|
from content import replaceEmojiFromTags
|
||||||
|
|
||||||
|
|
||||||
|
def markdownToHtml(markdown: str) -> str:
|
||||||
|
"""Converts markdown formatted text to html
|
||||||
|
"""
|
||||||
|
linesList = markdown.split('\n')
|
||||||
|
htmlStr = ''
|
||||||
|
for line in linesList:
|
||||||
|
if line.startswith('#####'):
|
||||||
|
line = line.replace('#####', '<h5>').strip() + '</h5>'
|
||||||
|
elif line.startswith('####'):
|
||||||
|
line = line.replace('####', '<h4>').strip() + '</h4>'
|
||||||
|
elif line.startswith('###'):
|
||||||
|
line = line.replace('###', '<h3>').strip() + '</h3>'
|
||||||
|
elif line.startswith('##'):
|
||||||
|
line = line.replace('##', '<h2>').strip() + '</h2>'
|
||||||
|
elif line.startswith('#'):
|
||||||
|
line = line.replace('#', '<h1>').strip() + '</h1>'
|
||||||
|
htmlStr += line
|
||||||
|
return htmlStr
|
||||||
|
|
||||||
|
|
||||||
def getBrokenLinkSubstitute() -> str:
|
def getBrokenLinkSubstitute() -> str:
|
||||||
"""Returns html used to show a default image if the link to
|
"""Returns html used to show a default image if the link to
|
||||||
an image is broken
|
an image is broken
|
||||||
|
|
|
@ -11,6 +11,7 @@ from shutil import copyfile
|
||||||
from utils import getConfigParam
|
from utils import getConfigParam
|
||||||
from webapp_utils import htmlHeaderWithExternalStyle
|
from webapp_utils import htmlHeaderWithExternalStyle
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
|
from webapp_utils import markdownToHtml
|
||||||
|
|
||||||
|
|
||||||
def welcomeScreenShown(baseDir: str, nickname: str, domain: str):
|
def welcomeScreenShown(baseDir: str, nickname: str, domain: str):
|
||||||
|
@ -41,8 +42,7 @@ def htmlWelcomeScreen(baseDir: str, nickname: str, domain: str,
|
||||||
copyfile(defaultFilename, welcomeFilename)
|
copyfile(defaultFilename, welcomeFilename)
|
||||||
if os.path.isfile(welcomeFilename):
|
if os.path.isfile(welcomeFilename):
|
||||||
with open(baseDir + '/accounts/welcome.txt', 'r') as welcomeFile:
|
with open(baseDir + '/accounts/welcome.txt', 'r') as welcomeFile:
|
||||||
welcomeText = welcomeFile.read()
|
welcomeText = markdownToHtml(welcomeFile.read())
|
||||||
welcomeText = welcomeText.replace('\n', '<br>')
|
|
||||||
|
|
||||||
welcomeForm = ''
|
welcomeForm = ''
|
||||||
cssFilename = baseDir + '/epicyon-welcome.css'
|
cssFilename = baseDir + '/epicyon-welcome.css'
|
||||||
|
|
Loading…
Reference in New Issue