From 65326b0069d7877348781183b6a53c8ea6952844 Mon Sep 17 00:00:00 2001 From: gconnect Date: Tue, 20 Oct 2020 12:28:34 +0100 Subject: [PATCH 1/6] Changes to .gitignore and build.py --- .gitignore | 4 ++-- build.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 8a9b319..caf42de 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# Byte-compiled / optimized / DLL files + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class @@ -102,4 +102,4 @@ venv.bak/ # mypy .mypy_cache/ -.idea/ +.idea/ \ No newline at end of file diff --git a/build.py b/build.py index ceb9b96..5973e71 100755 --- a/build.py +++ b/build.py @@ -1,4 +1,3 @@ - # thanks: http://eosrei.net/articles/2015/11/latex-templates-python-and-jinja2-generate-pdfs # thanks: http://flask.pocoo.org/snippets/55/ From ed3aed11b20e0ea1a52a95628996fbf8964136cf Mon Sep 17 00:00:00 2001 From: gconnect Date: Fri, 20 Nov 2020 01:32:55 +0100 Subject: [PATCH 2/6] Created header and footer section and modified the navbar --- docs/static/footer.css | 13 +++++++++ docs/static/gwadoc.css | 5 +++- docs/static/header.css | 46 ++++++++++++++++++++++++++++++++ docs/static/sidenav.css | 19 ++++++++----- docs/static/sidenav.js | 8 +++--- templates/base.html | 59 +++++++++++++++++------------------------ templates/footer.html | 26 ++++++++++++++++++ templates/header.html | 14 ++++++++++ templates/index.html | 4 +-- templates/overview.html | 4 +-- templates/relation.html | 2 +- templates/sidenav.html | 8 ++++-- 12 files changed, 153 insertions(+), 55 deletions(-) create mode 100644 docs/static/footer.css create mode 100644 docs/static/header.css create mode 100644 templates/footer.html create mode 100644 templates/header.html diff --git a/docs/static/footer.css b/docs/static/footer.css new file mode 100644 index 0000000..99cf3f1 --- /dev/null +++ b/docs/static/footer.css @@ -0,0 +1,13 @@ +footer{ + min-height : 200px; + background-color : #3C3C3C; + width : auto; +} + +.footnotes{ + margin : 20px; + color: #eeeeee; + text-align : left; + padding: 10px; +} + diff --git a/docs/static/gwadoc.css b/docs/static/gwadoc.css index 6d092a7..0cf7ec5 100644 --- a/docs/static/gwadoc.css +++ b/docs/static/gwadoc.css @@ -5,7 +5,7 @@ body { a:link { text-decoration: none; } a:hover { text-decoration: underline; } -a.toplink { float: right; font-size: medium; } +a.toplink { float: right; font-size: medium; color: #EC7D33;} .rel-id { font-family: monospace; @@ -54,6 +54,9 @@ div.description > ul li { padding: 5px 0px; } div.highlight { background-color: #F4F4F4 } +.relation-name{ +color : #EC7D33; +} @media screen and (max-width: 799px) { body { font-size: small; } h2, h3, h4 { margin: 10px 0px; } diff --git a/docs/static/header.css b/docs/static/header.css new file mode 100644 index 0000000..984ea59 --- /dev/null +++ b/docs/static/header.css @@ -0,0 +1,46 @@ +header{ + background-color : #3C3C3C; + position: fixed; + height : 150px; + width : 100%; + border-bottom : 5px solid #EC7D33; +} +.title{ +color : white; +font-style : bold; +} + +.name{ +color: #BEC2C7; +padding: 5px 30px; +font-size : 12px; +} +.top-header{ +height: 30px; +background-color: #2D2D2D; +} + +.search-button{ +background-color : #EC7D33; +color : white; +} + +.title-search{ +display: flex; +flex-direction : row; +justify-content: space-between; +margin-top : 50px; +margin-left : 30px; +margin-right : 30px; +} + +.search-input{ +margin-right : 0; +width: 200px; +} + .app-container { + display: flex; + } + .overview{ + margin-top : 170px; + } \ No newline at end of file diff --git a/docs/static/sidenav.css b/docs/static/sidenav.css index b234a3f..e69e228 100644 --- a/docs/static/sidenav.css +++ b/docs/static/sidenav.css @@ -1,11 +1,16 @@ -.sidenav{height: 100%;width: 290px;position: fixed;z-index: 1;top: 0;left: 0;background-color: #F5F5F5;overflow-x: hidden;padding-top: 20px; } +.sidenav{width: 300px;position: fixed; z-index: 1;top:150px !important; bottom: 0; left: 0;background-color: #F5F5F5;overflow-x: hidden;padding-top: 20px; } .container {margin-left: 290px;} -.sidenav a {padding: 4px 4px 4px 10px;text-decoration: none;font-size: 12px;color: #010101;background: none;width:100%;text-align: left;cursor: pointer;outline: none;} -.sidenav a:hover, .dropdown-btn:hover {color: #0000FF;} +.sidenav a {text-decoration: none; font-size: 18px; background: none;width:100%;text-align: left;cursor: pointer;outline: none; color:#4D4D4D; font-size: 18px;} +.sidenav a:hover, .dropdown-btn:hover {color: #0000FF; } .dropdown-container {background-color: #F5F5F5;display: none;} -.sidenav>ul{padding-left: 5px;margin-left: 5px;} -.sidenav>ul>li{padding-left: 5px;margin-left: 5px;height: 28px;overflow: hidden;} +.sidenav>ul>li{padding: 20px; margin: 5px; height: 50px;overflow: hidden; font-size: 18px; border: 1px solid #4D4D4D;} .sidenav>ul>li.open{height: auto;} -.pack-up{float: right;margin: 5px 10px 0 0;cursor: pointer;} - +.pack-up{float: right; cursor: pointer;} + .side-li:hover{ +background-color : #F3D5C4; +} +.side-ul ul{ +margin: 8px; +padding: 0; +} diff --git a/docs/static/sidenav.js b/docs/static/sidenav.js index 615fbc7..d47ac2f 100644 --- a/docs/static/sidenav.js +++ b/docs/static/sidenav.js @@ -19,10 +19,8 @@ $(document).ready(function () { $(this).removeClass('fa-minus-circle').addClass('fa fa-plus-circle').parent('li').removeClass('open'); } }) - - - - + + $("#dp-btn1").click(function () { $("#dropList1").toggle(); if(btn1Status==0){ @@ -90,4 +88,4 @@ $(document).ready(function () { console.log(btn4Status); } }) -}) \ No newline at end of file +}) diff --git a/templates/base.html b/templates/base.html index 3d97589..65189c4 100644 --- a/templates/base.html +++ b/templates/base.html @@ -13,14 +13,17 @@ href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> + + + - + + - @@ -30,44 +33,30 @@ {%- endblock %} - - {% include "sidenav.html" %} -
-
- {% block header -%} -

Open Wordnet Documentation

- {%- endblock %} + + +
+ {% include "header.html" %}
- +
+ {% include "sidenav.html" %} +
- {% include "overview.html" %} + {% include "overview.html" %} {% block content %}{% endblock %}
-
- +
+ + +
+ + + + + diff --git a/templates/footer.html b/templates/footer.html new file mode 100644 index 0000000..69b2296 --- /dev/null +++ b/templates/footer.html @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/templates/header.html b/templates/header.html new file mode 100644 index 0000000..16eddce --- /dev/null +++ b/templates/header.html @@ -0,0 +1,14 @@ +
+
+

GLOBAL WORDNET ASSOCIATION

+
+ +
+ + diff --git a/templates/index.html b/templates/index.html index 34b36c6..80d0cf5 100644 --- a/templates/index.html +++ b/templates/index.html @@ -3,9 +3,9 @@ {% block title %}Open Wordnet Documentation{% endblock %} {%- block content -%} -

Contents

+

Contents

{% include "toc.html" %} -

Relations

+

Relations

{% for id in gwadoc.RELATIONS -%} {% set rel = gwadoc.relations[id] -%} {% include "relation.html" %} diff --git a/templates/overview.html b/templates/overview.html index 17b85d9..d9ac550 100644 --- a/templates/overview.html +++ b/templates/overview.html @@ -1,7 +1,7 @@
-

Overview

+

Overview

-

What is wordnet?

+

What is wordnet?

Unlike a standard dictionary, which takes the word as its elementary building block, a wordnet is an online lexical reference system which is organized by concepts.

diff --git a/templates/relation.html b/templates/relation.html index dc46327..79a3246 100644 --- a/templates/relation.html +++ b/templates/relation.html @@ -1,5 +1,5 @@
-

{{ rel.name }} ({{ rel_id(id) }}){{ to_top() }}

+

{{ rel.name }} ({{ rel_id(id) }}){{ to_top() }}

{% if rel.df -%} "{{ rel.df }}" diff --git a/templates/sidenav.html b/templates/sidenav.html index be02949..d1389d0 100644 --- a/templates/sidenav.html +++ b/templates/sidenav.html @@ -1,9 +1,12 @@
-
From 492ef8ff7e3399cc512379ac0d69988b556cdc4e Mon Sep 17 00:00:00 2001 From: gconnect Date: Fri, 20 Nov 2020 11:03:12 +0100 Subject: [PATCH 3/6] Made some changes --- docs/static/gwadoc.css | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/static/gwadoc.css b/docs/static/gwadoc.css index 0cf7ec5..72d80b2 100644 --- a/docs/static/gwadoc.css +++ b/docs/static/gwadoc.css @@ -64,4 +64,5 @@ color : #EC7D33; div.description p, div.description ul { margin-left: 5px; } article table { margin: 2px 0px 2px 0px; } article table td { padding: 1px 0px 1px 5px; } + } From f8cca9b0ca7cc946332ee442fdd95d332bd01681 Mon Sep 17 00:00:00 2001 From: gconnect Date: Tue, 24 Nov 2020 18:32:57 +0100 Subject: [PATCH 4/6] Modified the UI --- docs/static/footer.css | 5 ++-- docs/static/gwadoc.css | 38 ++++++++++++++++++++------- docs/static/header.css | 51 +++++++++++++++++-------------------- docs/static/sidenav.css | 44 +++++++++++++++++++++++++------- docs/static/sidenav.js | 6 ++--- docs/templates/sidenav.html | 41 +++++++++++++---------------- templates/base.html | 22 ++++++++-------- templates/header.html | 7 +++-- templates/index.html | 4 +-- templates/overview.html | 6 ++--- templates/relation.html | 36 +++++++++++++++----------- templates/sidenav.html | 12 ++++----- 12 files changed, 159 insertions(+), 113 deletions(-) diff --git a/docs/static/footer.css b/docs/static/footer.css index 99cf3f1..262f9eb 100644 --- a/docs/static/footer.css +++ b/docs/static/footer.css @@ -1,13 +1,12 @@ footer{ - min-height : 200px; background-color : #3C3C3C; - width : auto; + width : 100%; + padding: 5px; } .footnotes{ margin : 20px; color: #eeeeee; text-align : left; - padding: 10px; } diff --git a/docs/static/gwadoc.css b/docs/static/gwadoc.css index 72d80b2..249cb0e 100644 --- a/docs/static/gwadoc.css +++ b/docs/static/gwadoc.css @@ -5,20 +5,15 @@ body { a:link { text-decoration: none; } a:hover { text-decoration: underline; } -a.toplink { float: right; font-size: medium; color: #EC7D33;} +a.toplink { float: right; font-size: medium; color: #671D5B;} .rel-id { font-family: monospace; } -main { - margin-left: auto; - margin-right: auto; - max-width: 960px; -} - div.description { margin-left: 20px; + margin-top: 16px; } div.description p, div.description ul { margin-left: 20px; @@ -55,8 +50,33 @@ div.description > ul li { padding: 5px 0px; } div.highlight { background-color: #F4F4F4 } .relation-name{ -color : #EC7D33; +color : #671D5B; +margin-top: 16px; +} + +h1, h2, h3, h4,h5,h6, p{ +margin : 0; +padding : 0; +} +.heading1{ +margin-bottom: 8px; +color : #671D5B; } +.heading{ +color : #671D5B; +margin-top : 8px; +} + +.page{ +display: grid; +grid-template-row: 10% 80% 10%; +} + +.section { + display: grid; + grid-template-columns : 25% 70%; + grid-gap: 30px; + } @media screen and (max-width: 799px) { body { font-size: small; } h2, h3, h4 { margin: 10px 0px; } @@ -64,5 +84,5 @@ color : #EC7D33; div.description p, div.description ul { margin-left: 5px; } article table { margin: 2px 0px 2px 0px; } article table td { padding: 1px 0px 1px 5px; } - + .section{display:grid; grid-template-columns: 100%;} } diff --git a/docs/static/header.css b/docs/static/header.css index 984ea59..d4e78a7 100644 --- a/docs/static/header.css +++ b/docs/static/header.css @@ -1,46 +1,43 @@ header{ - background-color : #3C3C3C; - position: fixed; - height : 150px; - width : 100%; - border-bottom : 5px solid #EC7D33; + background-color : #2656A6; + border-bottom : 3px solid #671D5B; + display: grid; + padding: 8px; + grid-template-columns : 80% 20%; + grid-gap : 20px; + justify-content: space-between; + align-items: center; } + +.head{ +display: grid; +position: sticky ; +top: 0; +width: 100%; +grid-template-columns: 100%; + min-height: 3.5rem; +} + .title{ color : white; font-style : bold; +font-size : 24px; +margin-left : 30px; } .name{ -color: #BEC2C7; +color: #A4CBE8; padding: 5px 30px; -font-size : 12px; -} -.top-header{ -height: 30px; -background-color: #2D2D2D; +font-size : 10px; } .search-button{ -background-color : #EC7D33; +background-color : #671D5B; color : white; -} - -.title-search{ -display: flex; -flex-direction : row; -justify-content: space-between; -margin-top : 50px; -margin-left : 30px; margin-right : 30px; } .search-input{ -margin-right : 0; width: 200px; } - .app-container { - display: flex; - } - .overview{ - margin-top : 170px; - } \ No newline at end of file + diff --git a/docs/static/sidenav.css b/docs/static/sidenav.css index e69e228..e00a965 100644 --- a/docs/static/sidenav.css +++ b/docs/static/sidenav.css @@ -1,16 +1,42 @@ -.sidenav{width: 300px;position: fixed; z-index: 1;top:150px !important; bottom: 0; left: 0;background-color: #F5F5F5;overflow-x: hidden;padding-top: 20px; } -.container {margin-left: 290px;} + .sidenav a {text-decoration: none; font-size: 18px; background: none;width:100%;text-align: left;cursor: pointer;outline: none; color:#4D4D4D; font-size: 18px;} .sidenav a:hover, .dropdown-btn:hover {color: #0000FF; } .dropdown-container {background-color: #F5F5F5;display: none;} -.sidenav>ul>li{padding: 20px; margin: 5px; height: 50px;overflow: hidden; font-size: 18px; border: 1px solid #4D4D4D;} +.sidenav>ul>li{ height: 60px; overflow: hidden; font-size: 18px; padding : 24px; border: 1px solid #4D4D4D; +} .sidenav>ul>li.open{height: auto;} -.pack-up{float: right; cursor: pointer;} - .side-li:hover{ -background-color : #F3D5C4; +.side-li:hover{background-color : #A4CBE8;} +ul.side-ul{margin : 0;padding :0px;} +nav{padding:16px; top: 0px; background-color: #F5F5F5; position: sticky; height: 100vh;} +.overview{margin-top : 30px;} +.pack-up{ + cursor: pointer; + border: none; + font-size: 48px; +} +li.side-li.overview{ +margin-top : 10px; +} + +.collapsible { + background-color: #777; + color: white; + cursor: pointer; + padding: 18px; + width: 100%; + border: none; + text-align: left; + outline: none; + font-size: 15px; +} + +.active, .collapsible:hover { + background-color: #555; } -.side-ul ul{ -margin: 8px; -padding: 0; +.list-items { + padding: 0 18px; + display: none; + overflow: hidden; + background-color: #f1f1f1; } diff --git a/docs/static/sidenav.js b/docs/static/sidenav.js index d47ac2f..ea51e35 100644 --- a/docs/static/sidenav.js +++ b/docs/static/sidenav.js @@ -38,7 +38,7 @@ $(document).ready(function () { var btn2Status=0; $(document).ready(function () { - + $("#dp-btn2").click(function () { $("#dropList2").toggle(); if(btn2Status==0){ @@ -56,7 +56,7 @@ $(document).ready(function () { var btn3Status=0; $(document).ready(function () { - + $("#dp-btn3").click(function () { $("#dropList3").toggle(); if(btn3Status==0){ @@ -74,7 +74,7 @@ $(document).ready(function () { var btn4Status=0; $(document).ready(function () { - + $("#dp-btn4").click(function () { $("#dropList4").toggle(); if(btn4Status==0){ diff --git a/docs/templates/sidenav.html b/docs/templates/sidenav.html index 9f0d024..0140166 100644 --- a/docs/templates/sidenav.html +++ b/docs/templates/sidenav.html @@ -1,28 +1,21 @@
-
-
    - {%- set agenda = gwadoc.relations.hierarchy_with_reversals()[2] -%} - {%- for id, rev, children in agenda recursive %} -
  • {{ gwadoc.relations[id].name }} - {%- if rev is not none and rev != id -%} - - {{ gwadoc.relations[rev].name }} - {%- endif -%} - {%- if children %} - {%- if loop.depth == 1 %} - - {%- endif %} -
      {{ loop(children) }}
    - {%- endif %} -
  • - {% endfor %} -
+
    + {%- set agenda = gwadoc.relations.hierarchy_with_reversals()[2] -%} + {%- for id, rev, children in agenda recursive %} +
  • {{ gwadoc.relations[id].name }} + {%- if rev is not none and rev != id -%} + + {{ gwadoc.relations[rev].name }} + {%- endif -%} + {%- if children %} + {%- if loop.depth == 1 %} + + {%- endif %} +
      {{ loop(children) }}
    + {%- endif %} +
  • + {% endfor %} +
-Other Languages -
-
    - {% for - {% endfor %} -
diff --git a/templates/base.html b/templates/base.html index 372e1ea..9bb7fb1 100644 --- a/templates/base.html +++ b/templates/base.html @@ -33,22 +33,24 @@ {%- endblock %} + + -
- {% include "header.html" %} -
-
- {% include "sidenav.html" %} -
-
+
+
{% include "header.html" %}
+
+ +
+
{% include "overview.html" %} {% block content %}{% endblock %}
-
- {% include "footer.html" %} -
+
+ +
+ diff --git a/templates/header.html b/templates/header.html index 16eddce..24192f2 100644 --- a/templates/header.html +++ b/templates/header.html @@ -1,14 +1,17 @@ -
+
+

GLOBAL WORDNET ASSOCIATION

+

Open WordNet Documentation

+
+ diff --git a/templates/index.html b/templates/index.html index 66c6558..07a950a 100644 --- a/templates/index.html +++ b/templates/index.html @@ -3,9 +3,9 @@ {% block title %}Open Wordnet Documentation ({{lang}}){% endblock %} {%- block content -%} -

Contents

+

Contents

{% include "toc.html" %} -

Relations

+

Relations

{% for id in gwadoc.RELATIONS -%} {% set rel = gwadoc.relations[id] -%} {% include "relation.html" %} diff --git a/templates/overview.html b/templates/overview.html index d9ac550..236520f 100644 --- a/templates/overview.html +++ b/templates/overview.html @@ -1,7 +1,7 @@
-

Overview

+

Overview

-

What is wordnet?

+

What is wordnet?

Unlike a standard dictionary, which takes the word as its elementary building block, a wordnet is an online lexical reference system which is organized by concepts.

@@ -21,7 +21,7 @@

What is wordnet?

Open Multilingual Wordnet (OMW) is a collection of wordnets in a variety of languages, all linked through the Collaborative Interlingual Index (CILI), the goal is to make it easy to use wordnets across multiple languages, you can browse and search for cross-lingual matches in OMW.

-

What is Global Wordnet Association?

+

What is Global Wordnet Association?

The Global WordNet Association (GWA) is a free, public and non-commercial organization that provides a platform for discussing, sharing and connecting semantic lexicons (wordnets) for all languages in the world. Our goal is to make compatible, linked, open lexical resources useful for both humans and computers.

diff --git a/templates/relation.html b/templates/relation.html index 79a3246..a420473 100644 --- a/templates/relation.html +++ b/templates/relation.html @@ -1,29 +1,35 @@
-

{{ rel.name }} ({{ rel_id(id) }}){{ to_top() }}

+

+ {{ rel.name }} + + {%- if rel.name.symbol -%} + '{{ rel.name.symbol }}' + + {%- endif -%} + + {%- if rel_id(id) and rel.fa.reverse -%} + ( {{rel_id(id)}} {{ rel_id(rel.fa.reverse) }}) + {%- else -%} + ({{rel_id(id)}}) + {%- endif -%} + +

{% if rel.df -%} - "{{ rel.df }}" + "{{ rel.df }}" {%- endif %} - -
symbol{{ rel.name.symbol or "(no symbol defined)" }}
applicability {%- if rel.fa.synset_synset or rel.fa.sense_synset or rel.fa.sense_sense -%} {%- set dash="–" -%} -
    - {% if rel.fa.synset_synset %}
  • synset{{ dash|safe }}synset
  • {% endif %} - {% if rel.fa.sense_synset %}
  • sense{{ dash|safe }}synset
  • {% endif %} - {% if rel.fa.sense_sense %}
  • sense{{ dash|safe }}sense
  • {% endif %} -
+ + {% if rel.fa.synset_synset %}synset{{ dash|safe }}synset;{% endif %} + {% if rel.fa.sense_synset %}sense{{ dash|safe }}synset;{% endif %} + {% if rel.fa.sense_sense %}sense{{ dash|safe }}sense;{% endif %} + {%- else -%} (not directly applicable) {%- endif -%}
reverse - {%- if rel.fa.reverse -%} - {{ rel_id(rel.fa.reverse) }} - {%- else -%} - (no reverse relation defined) - {%- endif -%} -
example{{ rel.ex | render_rst or "(no example given)" }}

Definition

diff --git a/templates/sidenav.html b/templates/sidenav.html index d1389d0..63f0340 100644 --- a/templates/sidenav.html +++ b/templates/sidenav.html @@ -1,20 +1,20 @@ -
+ From b406336318e7e4fb2412a6c9d6a1cd4c69f811bf Mon Sep 17 00:00:00 2001 From: gconnect Date: Sun, 27 Dec 2020 01:34:32 +0100 Subject: [PATCH 5/6] Added divider between relations, added outline toggle button made it more mobile responsive --- docs/static/gwadoc.css | 11 ++++++++++- docs/static/header.css | 6 +----- docs/static/sidenav.css | 1 + docs/static/toc.js | 8 ++++++++ templates/base.html | 1 + templates/index.html | 3 ++- templates/relation.html | 13 +++++++++++++ templates/toc.html | 6 +++++- 8 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 docs/static/toc.js diff --git a/docs/static/gwadoc.css b/docs/static/gwadoc.css index 249cb0e..cfab695 100644 --- a/docs/static/gwadoc.css +++ b/docs/static/gwadoc.css @@ -36,6 +36,9 @@ article table { border-collapse: separate; border: none; } +article{ + border-bottom: 2px solid #671D5B; +} article table tr, article table th, article table td { border: none; } article table th { font-weight: bold; @@ -77,6 +80,11 @@ grid-template-row: 10% 80% 10%; grid-template-columns : 25% 70%; grid-gap: 30px; } + .toc-items{ + display: none; + } + .outline-toggle{margin: 16px 0 16px 0; background-color: #2557A6; color: white;} + @media screen and (max-width: 799px) { body { font-size: small; } h2, h3, h4 { margin: 10px 0px; } @@ -85,4 +93,5 @@ grid-template-row: 10% 80% 10%; article table { margin: 2px 0px 2px 0px; } article table td { padding: 1px 0px 1px 5px; } .section{display:grid; grid-template-columns: 100%;} -} + nav{width: 100%; margin: 24px;} + } diff --git a/docs/static/header.css b/docs/static/header.css index d4e78a7..6e8d464 100644 --- a/docs/static/header.css +++ b/docs/static/header.css @@ -4,7 +4,6 @@ header{ display: grid; padding: 8px; grid-template-columns : 80% 20%; - grid-gap : 20px; justify-content: space-between; align-items: center; } @@ -34,10 +33,7 @@ font-size : 10px; .search-button{ background-color : #671D5B; color : white; -margin-right : 30px; +margin-right : auto; } -.search-input{ -width: 200px; -} diff --git a/docs/static/sidenav.css b/docs/static/sidenav.css index e00a965..aafdd11 100644 --- a/docs/static/sidenav.css +++ b/docs/static/sidenav.css @@ -40,3 +40,4 @@ margin-top : 10px; overflow: hidden; background-color: #f1f1f1; } + diff --git a/docs/static/toc.js b/docs/static/toc.js new file mode 100644 index 0000000..98da5d5 --- /dev/null +++ b/docs/static/toc.js @@ -0,0 +1,8 @@ +function showToc() { + var x = document.getElementById("toc-content"); + if (x.style.display === "none") { + x.style.display = "block"; + } else { + x.style.display = "none"; + } +} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index 9bb7fb1..ff8d0b1 100644 --- a/templates/base.html +++ b/templates/base.html @@ -28,6 +28,7 @@ + {% block title %}{% endblock %} {%- endblock %} diff --git a/templates/index.html b/templates/index.html index 07a950a..d685362 100644 --- a/templates/index.html +++ b/templates/index.html @@ -9,6 +9,7 @@

Relations

{% for id in gwadoc.RELATIONS -%} {% set rel = gwadoc.relations[id] -%} {% include "relation.html" %} - {% endfor %} +{% include "references.html" %} + {% endblock %} diff --git a/templates/relation.html b/templates/relation.html index a420473..b345720 100644 --- a/templates/relation.html +++ b/templates/relation.html @@ -30,6 +30,18 @@

{%- else -%} (not directly applicable) {%- endif -%} + reverse + {%- if rel.fa.reverse -%} + {{ rel_id(rel.fa.reverse) }} + {%- else -%} + (no reverse relation defined) + {%- endif -%} + {%- if rel.fa.schema_version -%} + introduced in + schema {{ rel.fa.schema_version }} + {%- endif -%} + + example{{ rel.ex | render_rst or "(no example given)" }}

Definition

@@ -88,3 +100,4 @@

Project-specific Names

{% endif %}
+ diff --git a/templates/toc.html b/templates/toc.html index a0e8359..0041578 100644 --- a/templates/toc.html +++ b/templates/toc.html @@ -1,4 +1,7 @@
+ +
+

Contents

    {%- set agenda = gwadoc.relations.hierarchy_with_reversals()[2] -%} @@ -14,6 +17,7 @@ {% endfor %}
-
+
+
From 805ac6ae820c2b4dd541cc43a4974b82ddf9ce67 Mon Sep 17 00:00:00 2001 From: gconnect Date: Mon, 28 Dec 2020 10:15:01 +0100 Subject: [PATCH 6/6] Made the header fixed and added scroll to top button also fixed the mobile responsive issue --- docs/static/gwadoc.css | 59 ++++++++++++++++++++++++++++++++++++----- docs/static/header.css | 20 +++++++------- docs/static/sidenav.css | 22 ++++++++++++--- docs/static/toc.js | 2 +- templates/base.html | 44 +++++++++++++++++++++++------- templates/header.html | 11 +++++--- templates/sidenav.html | 4 +-- 7 files changed, 125 insertions(+), 37 deletions(-) diff --git a/docs/static/gwadoc.css b/docs/static/gwadoc.css index cfab695..bcce61b 100644 --- a/docs/static/gwadoc.css +++ b/docs/static/gwadoc.css @@ -1,5 +1,7 @@ body { font-family: sans-serif; + box-sizing: border-box; + scroll-behavior: smooth; } a:link { text-decoration: none; } @@ -7,6 +9,9 @@ a:hover { text-decoration: underline; } a.toplink { float: right; font-size: medium; color: #671D5B;} +h3 .relation-name { + padding-left: 12px; +} .rel-id { font-family: monospace; } @@ -70,11 +75,6 @@ color : #671D5B; margin-top : 8px; } -.page{ -display: grid; -grid-template-row: 10% 80% 10%; -} - .section { display: grid; grid-template-columns : 25% 70%; @@ -84,6 +84,32 @@ grid-template-row: 10% 80% 10%; display: none; } .outline-toggle{margin: 16px 0 16px 0; background-color: #2557A6; color: white;} +.menu-icon div { + width: 35px; + height: 5px; + background-color: black; + margin: 6px 0; +} + +#myBtn { + display: none; + position: fixed; + bottom: 40px; + right: 45px; + z-index: 999; + font-size: 18px; + border: none; + outline: none; + background-color: #2656A6; + color: white; + cursor: pointer; + padding: 15px; + border-radius: 50px; +} + +#myBtn:hover { + background-color: #555; +} @media screen and (max-width: 799px) { body { font-size: small; } @@ -92,6 +118,25 @@ grid-template-row: 10% 80% 10%; div.description p, div.description ul { margin-left: 5px; } article table { margin: 2px 0px 2px 0px; } article table td { padding: 1px 0px 1px 5px; } - .section{display:grid; grid-template-columns: 100%;} - nav{width: 100%; margin: 24px;} + } + + @media (max-width: 500px) { + nav { + position: relative; + margin-top: 100px; + } + .title-search { + display: none; + } + .top-header .name { + padding: 5px 0; + } + .top-header .title { + margin-left: 0; + } + } + @media (min-width: 501px) { + .menu-icon { + display: none; + } } diff --git a/docs/static/header.css b/docs/static/header.css index 6e8d464..03dcbc1 100644 --- a/docs/static/header.css +++ b/docs/static/header.css @@ -1,4 +1,8 @@ header{ + position: fixed; + top: 0; + z-index: 9999; + width: 100% !important; background-color : #2656A6; border-bottom : 3px solid #671D5B; display: grid; @@ -6,15 +10,7 @@ header{ grid-template-columns : 80% 20%; justify-content: space-between; align-items: center; -} - -.head{ -display: grid; -position: sticky ; -top: 0; -width: 100%; -grid-template-columns: 100%; - min-height: 3.5rem; + overflow-x: hidden; } .title{ @@ -36,4 +32,10 @@ color : white; margin-right : auto; } +@media (max-width: 500px) { + .title { + font-size: 15px; + } +} + diff --git a/docs/static/sidenav.css b/docs/static/sidenav.css index aafdd11..3fc2335 100644 --- a/docs/static/sidenav.css +++ b/docs/static/sidenav.css @@ -2,13 +2,20 @@ .sidenav a {text-decoration: none; font-size: 18px; background: none;width:100%;text-align: left;cursor: pointer;outline: none; color:#4D4D4D; font-size: 18px;} .sidenav a:hover, .dropdown-btn:hover {color: #0000FF; } .dropdown-container {background-color: #F5F5F5;display: none;} -.sidenav>ul>li{ height: 60px; overflow: hidden; font-size: 18px; padding : 24px; border: 1px solid #4D4D4D; +.sidenav>ul>li{ height: 60px; overflow: hidden; font-size: 18px; padding : 24px; border: 0.5px solid #4D4D4D; } .sidenav>ul>li.open{height: auto;} .side-li:hover{background-color : #A4CBE8;} ul.side-ul{margin : 0;padding :0px;} -nav{padding:16px; top: 0px; background-color: #F5F5F5; position: sticky; height: 100vh;} -.overview{margin-top : 30px;} +nav{padding:16px; top: 77px; background-color: #F5F5F5; position: sticky; height: 100vh;width: 337px;} +.overview{margin-top : 90px; padding: 0 12px;} +.anchor { padding-top: 90px; } +:target::before { + content: ""; + display: block; + height: 90px; /* fixed header height*/ + margin: -90px 0 0; /* negative fixed header height */ +} .pack-up{ cursor: pointer; border: none; @@ -40,4 +47,11 @@ margin-top : 10px; overflow: hidden; background-color: #f1f1f1; } - + @media (max-width: 500px) { + nav { + z-index: 1; + top: 0; + position: relative; + } + .overview{margin-top: 20px;} +} diff --git a/docs/static/toc.js b/docs/static/toc.js index 98da5d5..7012289 100644 --- a/docs/static/toc.js +++ b/docs/static/toc.js @@ -5,4 +5,4 @@ function showToc() { } else { x.style.display = "none"; } -} \ No newline at end of file +} diff --git a/templates/base.html b/templates/base.html index ff8d0b1..6899335 100644 --- a/templates/base.html +++ b/templates/base.html @@ -37,20 +37,44 @@ -
-
{% include "header.html" %}
+ +
{% include "header.html" %}
+
- -
-
- {% include "overview.html" %} - {% block content %}{% endblock %} -
-
-
+ +
+ {% include "overview.html" %} + {% block content %}{% endblock %} +
+
+ + + diff --git a/templates/header.html b/templates/header.html index 24192f2..80efbe8 100644 --- a/templates/header.html +++ b/templates/header.html @@ -1,5 +1,5 @@ -
-
+ +

GLOBAL WORDNET ASSOCIATION

Open WordNet Documentation

@@ -10,8 +10,11 @@

Open WordNet Documentation

-
-
+ + + + + diff --git a/templates/sidenav.html b/templates/sidenav.html index 63f0340..360367a 100644 --- a/templates/sidenav.html +++ b/templates/sidenav.html @@ -1,8 +1,8 @@