mirror of
https://github.com/tiyn/amphora-wiki.git
synced 2025-04-19 15:27:46 +02:00
Docker: use utf-8 encoding for working docker-image
This commit is contained in:
parent
26ecbf1007
commit
91d2e940b0
@ -13,6 +13,7 @@ I however just want to put my markdown files in a directory and get a working wi
|
|||||||
- [ ] Option to get plain text file
|
- [ ] Option to get plain text file
|
||||||
- [ ] Optimize CSS for code
|
- [ ] Optimize CSS for code
|
||||||
- [x] Start page
|
- [x] Start page
|
||||||
|
- [ ] Overview of pages and namespaces
|
||||||
- [x] Search page
|
- [x] Search page
|
||||||
- [x] Full-text search
|
- [x] Full-text search
|
||||||
- [x] Show first few lines of each match (preview)
|
- [x] Show first few lines of each match (preview)
|
||||||
@ -27,7 +28,7 @@ I however just want to put my markdown files in a directory and get a working wi
|
|||||||
- [x] CSS dark-theme
|
- [x] CSS dark-theme
|
||||||
- [x] CSS light-theme
|
- [x] CSS light-theme
|
||||||
- [x] Config file
|
- [x] Config file
|
||||||
- [ ] Docker installation
|
- [x] Docker installation
|
||||||
- [ ] Enable variables/environment variables
|
- [ ] Enable variables/environment variables
|
||||||
- [ ] Logo
|
- [ ] Logo
|
||||||
|
|
||||||
|
@ -17,8 +17,8 @@ def gen_stand_string(path_ex):
|
|||||||
filename = os.path.join(ENTRY_DIR, path_ex)
|
filename = os.path.join(ENTRY_DIR, path_ex)
|
||||||
result = ''
|
result = ''
|
||||||
if path.exists(filename):
|
if path.exists(filename):
|
||||||
title = open(filename).readline().rstrip('\n')
|
title = open(filename,encoding='utf-8').readline().rstrip('\n')
|
||||||
text = open(filename).readlines()[1:]
|
text = open(filename,encoding='utf-8').readlines()[1:]
|
||||||
filename_no_end = filename.split('.', 1)[0]
|
filename_no_end = filename.split('.', 1)[0]
|
||||||
result += '<h1>' + title + '</h1>\n'
|
result += '<h1>' + title + '</h1>\n'
|
||||||
if filename.endswith('.md'):
|
if filename.endswith('.md'):
|
||||||
@ -35,7 +35,7 @@ def gen_md_content(path_ex, depth):
|
|||||||
for i in range(depth):
|
for i in range(depth):
|
||||||
header += '#'
|
header += '#'
|
||||||
header += ' '
|
header += ' '
|
||||||
markdown_lines = open(path_ex, 'r').readlines()[1:]
|
markdown_lines = open(path_ex, 'r',encoding='utf-8').readlines()[1:]
|
||||||
markdown_text = ''
|
markdown_text = ''
|
||||||
for line in markdown_lines:
|
for line in markdown_lines:
|
||||||
markdown_text += line.replace('# ', header)
|
markdown_text += line.replace('# ', header)
|
||||||
@ -61,7 +61,7 @@ def gen_query_res_string(query_str):
|
|||||||
|
|
||||||
|
|
||||||
def create_preview(path):
|
def create_preview(path):
|
||||||
file = open(path, 'r')
|
file = open(path, 'r',encoding='utf-8')
|
||||||
first_lines = file.readlines()
|
first_lines = file.readlines()
|
||||||
preview = ''
|
preview = ''
|
||||||
preview_length = 3
|
preview_length = 3
|
||||||
|
@ -28,7 +28,7 @@ def createSearchableData(root):
|
|||||||
for r, d, f in os.walk(root):
|
for r, d, f in os.walk(root):
|
||||||
for file in f:
|
for file in f:
|
||||||
path = os.path.join(r, file)
|
path = os.path.join(r, file)
|
||||||
fp = open(path)
|
fp = open(path,encoding='utf-8')
|
||||||
title = fp.readline()
|
title = fp.readline()
|
||||||
text = title + fp.read()
|
text = title + fp.read()
|
||||||
writer.add_document(title=title, path=path, content=text)
|
writer.add_document(title=title, path=path, content=text)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user