Polished Render ( added feature matches ) / Added more data eplanations
This commit is contained in:
parent
22c46de555
commit
1770c0fb1e
7 changed files with 48 additions and 6 deletions
|
@ -21,4 +21,7 @@
|
|||
"networks_write":[],
|
||||
"formats_read":["ascii","utf-8","utf-16"],
|
||||
"formats_write":["ascii","utf-8","utf-16"],
|
||||
"generic_name":["Text Editor", "Operating System", "Productivity Tool"]}
|
||||
"generic_name":["Text Editor", "IDE", "Snake Game",
|
||||
"Tetris Game",
|
||||
"Browser",
|
||||
"Operating System", "Productivity Tool", "Religion"]}
|
||||
|
|
1
data/generic/IDE.html
Normal file
1
data/generic/IDE.html
Normal file
|
@ -0,0 +1 @@
|
|||
Integrated Development Environments are special types of Text Editors specifically designed for editing code. Usually used for programming, but could be used for editing text based file-formats. IDE's functions may include things like: Syntax Highlighting, Auto-Formatting ( Automatically adds tabs and spaces to indent the code ) and other useful features.
|
1
data/generic/Religion.html
Normal file
1
data/generic/Religion.html
Normal file
|
@ -0,0 +1 @@
|
|||
Some software grew to form whole Religions around them.
|
1
data/interface/Electron.html
Normal file
1
data/interface/Electron.html
Normal file
|
@ -0,0 +1 @@
|
|||
Electron is a stripped down Chromium web-browser used as a component in an unfortunate amount of modern software. Since it's a tiny web-browser, it gives the developers the ability to deploy their websites as pieces of software installable locally. Hopefully locally. Since it's a small browser, you can't know for sure what parts are local. Electron apps are something in between web-sites and real software. But they feel like real software to the user. One more problem with Electron is that most of the times developing a native application using a native way of rendering it will result in much, much more optimized experience. Electron apps usually eat a lot of resources.
|
4
data/networks/ActivityPub.html
Normal file
4
data/networks/ActivityPub.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
ActivityPub is a social media protocol allowing federation. Which is an idea of linking two different social medias together. Think: liking and commenting on Facebook a post from Twitter. Of course neither Facebook nor Twitter are on the ActivityPub protocol. ActivityPub's social networks include things like: Mastodon, PixelFed and PeerTube.
|
||||
<br>
|
||||
<br>
|
||||
More about ActivityPub you can find on <a href="https://en.wikipedia.org/wiki/ActivityPub">WIKIPEDIA</a>.
|
|
@ -107,13 +107,40 @@ def html(page, json):
|
|||
l = json.get(c, [])
|
||||
if not l:
|
||||
continue
|
||||
|
||||
|
||||
# I want to look whether this category has a list of files
|
||||
alldata = list(os.listdir("data"))
|
||||
allfiles = []
|
||||
for folder in alldata:
|
||||
if c.startswith(folder):
|
||||
try:
|
||||
allfiles = list(os.listdir("data/"+folder))
|
||||
break
|
||||
except:
|
||||
pass
|
||||
# Count matches
|
||||
matches = 0
|
||||
for i in l:
|
||||
if i.startswith("*"):
|
||||
matches += 1
|
||||
if matches:
|
||||
matchtext = "<i>( "+str(matches)+" )</i>"
|
||||
else:
|
||||
matchtext = ""
|
||||
page = page + "<details>"
|
||||
page = page +"<summary>"+categories[c]+":</summary>"
|
||||
page = page +"<summary>"+categories[c]+": "+matchtext+"</summary>"
|
||||
|
||||
for i in l:
|
||||
page = page + " "+i+"<br>"
|
||||
page = page + "</details>"
|
||||
matchtext = ""
|
||||
if i.startswith("*"):
|
||||
i = i[1:]
|
||||
matchtext = " <i>( match )</i> "
|
||||
if i+".html" in allfiles:
|
||||
datapage = open("data/"+folder+"/"+i+".html")
|
||||
page = page + "<details><summary> "+matchtext+i+"</summary><span><p>"+datapage.read()+"<p></span></details>"
|
||||
else:
|
||||
page = page + " "+matchtext+i+"<br>"
|
||||
page = page + "<span><br></span></details>"
|
||||
|
||||
|
||||
return page
|
||||
|
@ -141,7 +168,7 @@ def suggestions(page, json):
|
|||
except:
|
||||
frac = 0
|
||||
|
||||
if frac < 40 and not more: # Below 40% features match
|
||||
if frac < 20 and not more: # Below 40% features match
|
||||
page = page + """<hr><details>
|
||||
<summary><h1 title="Click to show more / less.">Problematic Competitors:</h1></summary>"""
|
||||
more = True
|
||||
|
|
|
@ -88,6 +88,11 @@ def suggest(json_data):
|
|||
for b in json_data.get(c, []):
|
||||
if b in i.get(c, []):
|
||||
score += 1
|
||||
# Pass the found datapoint into the renderer
|
||||
try:
|
||||
i[c][i[c].index(b)] = "*"+b
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
# If software has issues of any kind we move it down.
|
||||
if "issues" in i and score:
|
||||
|
|
Loading…
Reference in a new issue