mirror of
https://github.com/tiyn/amphora-wiki.git
synced 2025-04-08 10:07:48 +02:00
Compare commits
5 Commits
0bc1a955a6
...
d5cf8d6d13
Author | SHA1 | Date | |
---|---|---|---|
d5cf8d6d13 | |||
ff35dbe3ae | |||
ff169d2795 | |||
6287111899 | |||
cdf6660cae |
@ -10,6 +10,8 @@ RUN pip3 install -r requirements.txt
|
||||
|
||||
VOLUME /wiki/templates/entry
|
||||
|
||||
VOLUME /wiki/static/graphics
|
||||
|
||||
EXPOSE 5000
|
||||
|
||||
ENTRYPOINT [ "python3" ]
|
||||
|
15
README.md
15
README.md
@ -15,7 +15,7 @@ I however just want to put my markdown files in a directory and get a working wi
|
||||
- [ ] Option to get plain text file
|
||||
- [ ] Optimize CSS for code
|
||||
- [x] Start page
|
||||
- [ ] Overview of pages and namespaces
|
||||
- [x] Overview of pages and namespaces
|
||||
- [x] Search page
|
||||
- [x] Full-text search
|
||||
- [x] Show first few lines of each match (preview)
|
||||
@ -60,12 +60,13 @@ The `config.py` can be found in the `src` folder.
|
||||
|
||||
Set the following volumes with the -v tag.
|
||||
|
||||
| Volume-Name | Container mount | Description |
|
||||
| ----------- | ------------------------- | ------------------------------------------------------------ |
|
||||
| config-file | /wiki/config.py | Config file |
|
||||
| entries | /wiki/templates/entry | Directory for wiki entries |
|
||||
| css | /wiki/static/css | (optional) Directory for css files |
|
||||
| html | /wiki/templates | (optional) Directory for templates (entry-volume not needed) |
|
||||
| Volume-Name | Container mount | Description |
|
||||
| ------------- | ----------------------- | ------------------------------------------------------------ |
|
||||
| `config-file` | `/wiki/config.py` | Config file |
|
||||
| `entries` | `/wiki/templates/entry` | Directory for wiki entries |
|
||||
| `graphics` | `/wiki/static/graphics` | Directory for images needed for entries |
|
||||
| `css` | `/wiki/static/css` | (optional) Directory for css files |
|
||||
| `html` | `/wiki/templates` | (optional) Directory for templates (entry-volume not needed) |
|
||||
|
||||
#### Ports
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
#!/bin/sh
|
||||
docker-compose down
|
||||
docker-compose up -d
|
||||
docker-compose up -d --build
|
||||
|
@ -96,10 +96,9 @@ def gen_arch_string(path_ex):
|
||||
if filename[0] != "." and filename.__contains__("."):
|
||||
filename = filename.split(".", 1)[0]
|
||||
content_string += "<li>"
|
||||
content_string += title + " ["
|
||||
content_string += "<a href=\"" + "/"+ entry_or_namespace +"/" + \
|
||||
path_ex.rstrip("/") + "/" + pathlib.PurePath(file).name + "\">" + "standalone" + "</a>"
|
||||
content_string += "] <br>"
|
||||
path_ex.rstrip("/") + "/" + pathlib.PurePath(file).name + "\">" + title + "</a>"
|
||||
content_string += "<br>"
|
||||
content_string += "</li>\n"
|
||||
content_string += "</ul>\n"
|
||||
return content_string
|
||||
|
10
src/forms.py
10
src/forms.py
@ -1,11 +1,9 @@
|
||||
from flask_wtf import FlaskForm
|
||||
from flask_wtf import CSRFProtect
|
||||
from wtforms import TextField, SubmitField, ValidationError, validators
|
||||
from flask_wtf import CSRFProtect, FlaskForm
|
||||
from wtforms import StringField, SubmitField, ValidationError, validators
|
||||
|
||||
csrf = CSRFProtect()
|
||||
|
||||
|
||||
class SearchForm(FlaskForm):
|
||||
query_str = TextField(
|
||||
"Query", [validators.Required("Please enter the search term")])
|
||||
submit = SubmitField("Search")
|
||||
query_str = StringField("Query", [validators.DataRequired("Please enter the search term")])
|
||||
submit = SubmitField("Search")
|
||||
|
@ -1,5 +1,5 @@
|
||||
Markdown==3.1.1
|
||||
WTForms==2.2.1
|
||||
Flask==1.1.2
|
||||
Flask_WTF==0.14.3
|
||||
Whoosh==2.7.4
|
||||
Markdown
|
||||
WTForms
|
||||
Flask
|
||||
Flask_WTF
|
||||
Whoosh
|
||||
|
@ -6,7 +6,7 @@
|
||||
--error: rgb(255,0,0);
|
||||
--footerbg0: rgb(192,192,192);
|
||||
--link0: rgb(0,0,120);
|
||||
--link1: rgb(255,255,255);
|
||||
--link1: rgb(0,0,0);
|
||||
--menulink0: rgb(0,0,120);
|
||||
--menulink1: rgb(255,255,255);
|
||||
--menubg0: rgb(192,192,192);
|
||||
|
@ -29,16 +29,6 @@ html {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
code {
|
||||
border-radius: 25px;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
page-break-inside: avoid;
|
||||
font-family: monospace;
|
||||
white-space: pre;
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
footer {
|
||||
height: 100px;
|
||||
padding-top: 20px;
|
||||
@ -48,10 +38,6 @@ footer .center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
ul {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.container {
|
||||
min-height: 100%;
|
||||
padding-bottom: 50px;
|
||||
@ -90,6 +76,10 @@ ul {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
|
||||
.main-menu-dropdown img {
|
||||
float: left;
|
||||
}
|
||||
.main-menu-dropdown span {
|
||||
float: left;
|
||||
font-family: monospace;
|
||||
@ -165,3 +155,40 @@ ul {
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.entry {
|
||||
border-radius: 0 10px 30px 0;
|
||||
margin-bottom: 20px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.entry h1,
|
||||
.entry h2 {
|
||||
margin: 5px auto 2px auto;
|
||||
}
|
||||
|
||||
.entry ul {
|
||||
padding-left: 20;
|
||||
}
|
||||
|
||||
figure {
|
||||
padding:20px;
|
||||
}
|
||||
|
||||
ul {
|
||||
padding-left:20px;
|
||||
}
|
||||
|
||||
ol {
|
||||
padding-left:20px;
|
||||
}
|
||||
|
||||
code {
|
||||
border-radius: 25px;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
page-break-inside: avoid;
|
||||
font-family: monospace;
|
||||
white-space: pre;
|
||||
display: inline-block
|
||||
}
|
||||
|
0
src/static/graphics/.gitkeep
Normal file
0
src/static/graphics/.gitkeep
Normal file
BIN
src/static/graphics/logo.png
Normal file
BIN
src/static/graphics/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.1 KiB |
@ -2,14 +2,17 @@
|
||||
<head>
|
||||
<title>{{ title }}</title>
|
||||
<link href="{{ url_for('static', filename='css/' + style + '.css') }}" rel="stylesheet" type="text/css">
|
||||
<link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='graphics/logo.png') }}">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width" initial-scale=1.0>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Menu -->
|
||||
<div class="main-menu-dropdown">
|
||||
<!-- <img class="logo" src="/static/images/logo.png"> -->
|
||||
<span>{{ title }}</span>
|
||||
<a href="{{ url_for('index') }}">
|
||||
<img class="logo" src="{{ url_for('static', filename='graphics/logo.png') }}">
|
||||
<span>{{ title }}</span>
|
||||
</a>
|
||||
<input type="checkbox" id="main-menu-check">
|
||||
<label for="main-menu-check" class="show-menu">☰</label>
|
||||
<div class="main-menu">
|
||||
|
Loading…
x
Reference in New Issue
Block a user