Instance about in markdown format

main
Bob Mottram 2021-03-01 11:40:49 +00:00
parent 768f2d4fe9
commit 3b227aa520
3 changed files with 9 additions and 8 deletions

View File

@ -3315,7 +3315,7 @@ class PubServer(BaseHTTPRequestHandler):
return return
linksFilename = baseDir + '/accounts/links.txt' linksFilename = baseDir + '/accounts/links.txt'
aboutFilename = baseDir + '/accounts/about.txt' aboutFilename = baseDir + '/accounts/about.md'
TOSFilename = baseDir + '/accounts/tos.md' TOSFilename = baseDir + '/accounts/tos.md'
# extract all of the text fields into a dict # extract all of the text fields into a dict

View File

@ -18,9 +18,9 @@ def htmlAbout(cssCache: {}, baseDir: str, httpPrefix: str,
"""Show the about screen """Show the about screen
""" """
adminNickname = getConfigParam(baseDir, 'admin') adminNickname = getConfigParam(baseDir, 'admin')
if not os.path.isfile(baseDir + '/accounts/about.txt'): if not os.path.isfile(baseDir + '/accounts/about.md'):
copyfile(baseDir + '/default_about.txt', copyfile(baseDir + '/default_about.md',
baseDir + '/accounts/about.txt') baseDir + '/accounts/about.md')
if os.path.isfile(baseDir + '/accounts/login-background-custom.jpg'): if os.path.isfile(baseDir + '/accounts/login-background-custom.jpg'):
if not os.path.isfile(baseDir + '/accounts/login-background.jpg'): if not os.path.isfile(baseDir + '/accounts/login-background.jpg'):
@ -28,8 +28,8 @@ def htmlAbout(cssCache: {}, baseDir: str, httpPrefix: str,
baseDir + '/accounts/login-background.jpg') baseDir + '/accounts/login-background.jpg')
aboutText = 'Information about this instance goes here.' aboutText = 'Information about this instance goes here.'
if os.path.isfile(baseDir + '/accounts/about.txt'): if os.path.isfile(baseDir + '/accounts/about.md'):
with open(baseDir + '/accounts/about.txt', 'r') as aboutFile: with open(baseDir + '/accounts/about.md', 'r') as aboutFile:
aboutText = aboutFile.read() aboutText = aboutFile.read()
aboutForm = '' aboutForm = ''

View File

@ -17,6 +17,7 @@ from webapp_utils import headerButtonsFrontScreen
from webapp_utils import htmlHeaderWithExternalStyle from webapp_utils import htmlHeaderWithExternalStyle
from webapp_utils import htmlFooter from webapp_utils import htmlFooter
from webapp_utils import getBannerFile from webapp_utils import getBannerFile
from webapp_utils import markdownToHtml
def _linksExist(baseDir: str) -> bool: def _linksExist(baseDir: str) -> bool:
@ -411,11 +412,11 @@ def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str,
adminNickname = getConfigParam(baseDir, 'admin') adminNickname = getConfigParam(baseDir, 'admin')
if adminNickname: if adminNickname:
if nickname == adminNickname: if nickname == adminNickname:
aboutFilename = baseDir + '/accounts/about.txt' aboutFilename = baseDir + '/accounts/about.md'
aboutStr = '' aboutStr = ''
if os.path.isfile(aboutFilename): if os.path.isfile(aboutFilename):
with open(aboutFilename, 'r') as fp: with open(aboutFilename, 'r') as fp:
aboutStr = fp.read() aboutStr = markdownToHtml(fp.read())
editLinksForm += \ editLinksForm += \
'<div class="container">' '<div class="container">'