minor changes & api change

master
Your Name 6 years ago
parent 2f38f54f0d
commit fb56053a4b

@ -13,3 +13,23 @@ img{
padding-bottom: 10px; padding-bottom: 10px;
max-width: 50%; max-width: 50%;
} }
.content{
padding-left: 50px;
display: none;
}
@media print {
.content{
display:block;
}
}
@media only screen and (max-width: 600px) {
#main{font-family: monospace;
max-width: 100%;
}
}

@ -37,7 +37,7 @@ ______ ______ ______ ______ __ ______
<label><input type="checkbox" name="links" value="links">Links</label> <label><input type="checkbox" name="links" value="links">Links</label>
</div--> </div-->
<div id="main"> <div id="main">
<p class="mono"> <span class="mono">
POETIC SOFTWARE <br> POETIC SOFTWARE <br>
--------------- <br> --------------- <br>
<br> <br>
@ -58,6 +58,8 @@ POETIC SOFTWARE <br>
#+# #+# #+# #+# #+# #+# #+#+# #+#+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#+# #+#+# #+# #+# #+# #+# #+#
######## ######## ### ### ### ### ### ### ### ### ########## ######## ######## ### ### ### ### ### ### ### ### ##########
</pre> </pre>
<label><input type="checkbox" id="showall" name="showall" value="showall">show all</label><br>
<br> <br>
INTRODUCTION INTRODUCTION
{% for post in posts %} {% for post in posts %}
@ -75,7 +77,9 @@ INTRODUCTION
{% for post in posts %} {% for post in posts %}
{% if "thesis"|string() == post.category|string() %} {% if "thesis"|string() == post.category|string() %}
<div class="post"> <div class="post">
<a href="min/{{ post.pid }}"><p>{{count|length}}. {{ post.title|safe }}<p></a></div> <a href="min/{{ post.pid }}"><p>{{count|length}}. {{ post.title|safe }}<p></a>
<div class="content">{{ post.writingfield|safe }}</div></div>
{% set __ = count.append(1) %} {% set __ = count.append(1) %}
{% endif %} {% endif %}
{% else %} {% else %}
@ -88,7 +92,9 @@ INTRODUCTION
{% for post in posts %} {% for post in posts %}
{% if "exercise"|string() == post.category|string() %} {% if "exercise"|string() == post.category|string() %}
<div class="post"> <div class="post">
<a href="min/{{ post.pid }}"><p>{{count|length}}. {{ post.title|safe }}<p></a></div> <a href="min/{{ post.pid }}"><p>{{count|length}}. {{ post.title|safe }}<p></a>
<div class="content">{{ post.writingfield|safe }}</div>
</div>
{% set __ = count.append(1) %} {% set __ = count.append(1) %}
{% endif %} {% endif %}
{% else %} {% else %}
@ -101,7 +107,9 @@ INTRODUCTION
{% for post in posts %} {% for post in posts %}
{% if "concept"|string() == post.category|string() %} {% if "concept"|string() == post.category|string() %}
<div class="post"> <div class="post">
<a href="min/{{ post.pid }}"><p>{{ post.title|safe }}<p></a></div> <a href="min/{{ post.pid }}"><p>{{ post.title|safe }}<p></a>
<div class="content">{{ post.writingfield|safe }}</div>
</div>
{% endif %} {% endif %}
{% else %} {% else %}
<em>The Software is lacking a introduction, ask your system administrator about it.</em> <em>The Software is lacking a introduction, ask your system administrator about it.</em>
@ -109,9 +117,22 @@ INTRODUCTION
</p> </span>
</div> </div>
<script>
const checkbox = document.getElementById('showall')
checkbox.addEventListener('change', (event) => {
if (event.target.checked) {
$(".content").css({"display":"block"})
} else {
$(".content").css({"display":"none"})
}
})
</script>
</body> </body>
</html> </html>

@ -170,7 +170,7 @@ def get_words(query):
#text = cleanhtml(text) #text = cleanhtml(text)
regex = re.compile('[%s]' % re.escape(string.punctuation)) regex = re.compile('[%s]' % re.escape(string.punctuation))
#text = regex.sub('', text) #text = regex.sub('', text)
soup = BeautifulSoup(text,"lxml") soup = BeautifulSoup(text)
for id, word in enumerate(soup.prettify().split()): for id, word in enumerate(soup.prettify().split()):
if "<" not in word or ">" not in word or "=" not in word: if "<" not in word or ">" not in word or "=" not in word:
word = regex.sub('', word) word = regex.sub('', word)
@ -199,7 +199,7 @@ def get_words(query):
#text = cleanhtml(text) #text = cleanhtml(text)
#regex = re.compile('[%s]' % re.escape(string.punctuation)) #regex = re.compile('[%s]' % re.escape(string.punctuation))
#text = regex.sub('', text) #text = regex.sub('', text)
soup = BeautifulSoup(text,"lxml") soup = BeautifulSoup(text)
for id, word in enumerate(soup.prettify().split()): for id, word in enumerate(soup.prettify().split()):
if word.startswith(query) and ("<" not in word or ">" not in word or "=" not in word): if word.startswith(query) and ("<" not in word or ">" not in word or "=" not in word):
a = {} a = {}
@ -225,7 +225,7 @@ def replace_with(link, n, pid):
post = Posts.query.filter_by(pid=pid).first() post = Posts.query.filter_by(pid=pid).first()
frompost = Posts.query.filter_by(pid=link).first() frompost = Posts.query.filter_by(pid=link).first()
html = post.writingfield html = post.writingfield
soup = BeautifulSoup(html,"lxml") soup = BeautifulSoup(html)
words = soup.prettify().split() words = soup.prettify().split()
words[n] = words[n]+" <a class='linkTo' href='"+str(link)+"'>→ "+frompost.title+"</a>" words[n] = words[n]+" <a class='linkTo' href='"+str(link)+"'>→ "+frompost.title+"</a>"
print(words) print(words)

Loading…
Cancel
Save