diff --git a/app/db.py b/app/db.py index 01639a0..22ea12a 100644 --- a/app/db.py +++ b/app/db.py @@ -112,10 +112,16 @@ class Subnode: return 100-fuzz.ratio(self.wikilink, other.wikilink) def go(self): - # returns a set of go links contained in this node + """ + returns a set of go links contained in this subnode + go links are blocks of the form: + - [[go]] protocol://example.org/url + protocol defaults to https. + """ golinks = subnode_to_actions(self, 'go') sanitized_golinks = [] for golink in golinks: + # should probably instead check for contains: // if golink.startswith('http'): sanitized_golinks.append(golink) else: @@ -123,6 +129,18 @@ class Subnode: sanitized_golinks.append('https://' + golink) return sanitized_golinks + def pull(self): + """ + returns a set of pull links contained in this subnode + pull links are blocks of the form: + - [[pull]] [[node]] + """ + + # TODO: test. + pull_links = subnode_to_actions(self, 'pull') + entities = content_to_outlinks(pull_links) + return entities + def subnode_to_actions(subnode, action): # hack hack. diff --git a/app/static/css/screen-dark.css b/app/static/css/screen-dark.css index fb1b354..2f9ea9e 100644 --- a/app/static/css/screen-dark.css +++ b/app/static/css/screen-dark.css @@ -68,10 +68,26 @@ h2 { font-size: 1.2em; } margin-bottom: 1em; } -.backlinks { - display: inline-block; +.links { + width: 100%; font-family: sans-serif; + display: flex; + background: #161616; + color: #cfcfcf; + padding: 0.5em; + margin-bottom: 10px; + border-radius: 10px; + gap: 10px; +} + +.backlinks { /*background: #1f1f2f; */ + float: left; + width: 20%; + +.pushlinks { + /*background: #1f1f2f; */ + width: 20%; background: #161616; color: #cfcfcf; padding: 0.5em; @@ -79,7 +95,22 @@ h2 { font-size: 1.2em; } border-radius: 10px; } -.backlinks-header { +.pulllinks, .forwardlinks { + /*background: #1f1f2f; */ + background: #161616; + width: 20%; + color: #cfcfcf; + padding: 0.5em; + margin-bottom: 10px; + border-radius: 10px; +} + +.backlinks-header, .pushlinks-header, .pulllinks-header, .forwardlinks-header { + font-style: italic; + margin-bottom: 1em; +} + +.links-header { font-style: italic; margin-bottom: 1em; } diff --git a/app/templates/node_rendered.html b/app/templates/node_rendered.html index 08d1da4..3b8eae1 100644 --- a/app/templates/node_rendered.html +++ b/app/templates/node_rendered.html @@ -38,12 +38,55 @@ Try listing nodes or perhaps search. {% endfor %} - + + + + {% endif %} {% endblock %}