You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by dd...@apache.org on 2020/08/01 16:41:53 UTC

[freemarker-docgen] 04/04: Always show "bookmarks" next to the breadcrumbs. Other adjustments in that row.

This is an automated email from the ASF dual-hosted git repository.

ddekany pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/freemarker-docgen.git

commit 7414ae8a260867916565b26c3f2bd5228ae4ab85
Author: ddekany <dd...@apache.org>
AuthorDate: Sat Aug 1 17:41:19 2020 +0200

    Always show "bookmarks" next to the breadcrumbs. Other adjustments in that row.
---
 .../docgen/core/less/lib/components/bookmarks.less | 11 ++++---
 .../core/less/lib/components/breadcrumb.less       | 23 +++++++++-----
 .../freemarker/docgen/core/less/lib/variables.less |  6 +++-
 .../docgen/core/templates/navigation.ftlh          | 36 ++++++++++++----------
 4 files changed, 45 insertions(+), 31 deletions(-)

diff --git a/freemarker-docgen-core/src/main/resources-gulp/org/freemarker/docgen/core/less/lib/components/bookmarks.less b/freemarker-docgen-core/src/main/resources-gulp/org/freemarker/docgen/core/less/lib/components/bookmarks.less
index 32b959c..2c09b84 100644
--- a/freemarker-docgen-core/src/main/resources-gulp/org/freemarker/docgen/core/less/lib/components/bookmarks.less
+++ b/freemarker-docgen-core/src/main/resources-gulp/org/freemarker/docgen/core/less/lib/components/bookmarks.less
@@ -17,11 +17,13 @@
  * under the License.
  */
 .bookmarks {
-  text-align: right;
-  display: none;
+  overflow: hidden;
+  white-space: nowrap;
 
-  @media (min-width: @screen-md-min) {
-    display: block;
+  padding-top: @breadcrumb-row-padding-top;
+  font-size: @breadcrumb-row-font-size-xs;
+  @media (min-width: @screen-xs-min) {
+    font-size: @breadcrumb-row-font-size-sm;
   }
 
   &::before {
@@ -41,7 +43,6 @@
     margin: 0;
     padding: 0;
     display: inline-block;
-    font-size: 13px;
 
     li {
       display: inline-block;
diff --git a/freemarker-docgen-core/src/main/resources-gulp/org/freemarker/docgen/core/less/lib/components/breadcrumb.less b/freemarker-docgen-core/src/main/resources-gulp/org/freemarker/docgen/core/less/lib/components/breadcrumb.less
index 5c546e8..1d6495d 100644
--- a/freemarker-docgen-core/src/main/resources-gulp/org/freemarker/docgen/core/less/lib/components/breadcrumb.less
+++ b/freemarker-docgen-core/src/main/resources-gulp/org/freemarker/docgen/core/less/lib/components/breadcrumb.less
@@ -16,17 +16,24 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-.breadcrumb {
-  list-style-type: none;
-  margin: 0;
-  padding: 6px 0 0 0;
-  font-size: 12px;
-  display: block;
+.breadcrumbs {
+  padding-top: @breadcrumb-row-padding-top;
+  // Right padding is the spacing between .breadcrumbs and .bookmarks (this works as overflow is hidden)
+  padding-right: 1.5em;
   white-space: nowrap;
   overflow: hidden;
 
-  @media (min-width: @screen-sm-min) {
-    font-size: 13px;
+  font-size: @breadcrumb-row-font-size-xs;
+  @media (min-width: @screen-xs-min) {
+    font-size: @breadcrumb-row-font-size-sm;
+  }
+
+  ul {
+    display: inline-block;
+    display: block;
+    margin: 0;
+    padding: 0;
+    list-style-type: none;
   }
 
   li {
diff --git a/freemarker-docgen-core/src/main/resources-gulp/org/freemarker/docgen/core/less/lib/variables.less b/freemarker-docgen-core/src/main/resources-gulp/org/freemarker/docgen/core/less/lib/variables.less
index 7f734d5..64bbcdf 100644
--- a/freemarker-docgen-core/src/main/resources-gulp/org/freemarker/docgen/core/less/lib/variables.less
+++ b/freemarker-docgen-core/src/main/resources-gulp/org/freemarker/docgen/core/less/lib/variables.less
@@ -59,4 +59,8 @@
 @container-lg:  @screen-lg-min - (@gutter-width * 2) - 20px; // subtract for scrollbar
 
 @hamburger-icon-height: 30px;
-@hamburger-icon-top: 2px;
\ No newline at end of file
+@hamburger-icon-top: 2px;
+
+@breadcrumb-row-font-size-xs: 11px;
+@breadcrumb-row-font-size-sm: 13px;
+@breadcrumb-row-padding-top: 6px;
diff --git a/freemarker-docgen-core/src/main/resources/org/freemarker/docgen/core/templates/navigation.ftlh b/freemarker-docgen-core/src/main/resources/org/freemarker/docgen/core/templates/navigation.ftlh
index 6d0531e..abbd1c5 100644
--- a/freemarker-docgen-core/src/main/resources/org/freemarker/docgen/core/templates/navigation.ftlh
+++ b/freemarker-docgen-core/src/main/resources/org/freemarker/docgen/core/templates/navigation.ftlh
@@ -62,23 +62,25 @@
     </#if>
     <#local curNode = curNode?parent>
   </#list>
-  <#if (path?size > 1)>
-    <ul class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList"><#t>
-      <#list path as step>
-        <li class="step-${step?index}" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><#t>
-          <a class="label" itemprop="item" href="${CreateLinkFromNode(step)}"><#t>
-            <span itemprop="name"><#recurse u.getRequiredTitleElement(step) using nodeHandlers></span><#t>
-          </a><#t>
+  <div class="breadcrumbs">
+    <#if (path?size > 1)>
+      <ul class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList"><#t>
+        <#list path as step>
+          <li class="step-${step?index}" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><#t>
+            <a class="label" itemprop="item" href="${CreateLinkFromNode(step)}"><#t>
+              <span itemprop="name"><#recurse u.getRequiredTitleElement(step) using nodeHandlers></span><#t>
+            </a><#t>
+          </li><#t>
+        </#list>
+      </ul><#t>
+    <#else>
+      <ul class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList"><#t>
+        <li class="step-0" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><#t>
+          <span itemprop="name">Table of Contents</span><#t>
         </li><#t>
-      </#list>
-    </ul><#t>
-  <#else>
-    <ul class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList"><#t>
-      <li class="step-0" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><#t>
-        <span itemprop="name">Table of Contents</span><#t>
-      </li><#t>
-    </ul><#t>
-  </#if>
+      </ul><#t>
+    </#if>
+  </div>
 </#macro>
 
 
@@ -109,7 +111,7 @@
   <#if internalBookmarks?size != 0 || externalBookmarks?size != 0>
     <div class="bookmarks" title="Bookmarks"><#t>
         <span class="sr-only">Bookmarks:</span><#t>
-        <ul class="bookmark-list"><#t>
+        <ul><#t>
           <#local curHref = CreateLinkFromNode(.node)>
           <#list internalBookmarks?keys as k>
             <li><#t>