[gi-docgen/title-separator] template: Use a stylable separator for the heading




commit ee630c37c43b6d3eb54fa428a597911222cf87c4
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon May 17 10:19:16 2021 +0100

    template: Use a stylable separator for the heading
    
    The dot can be confused with actual syntax, so we should use something
    else to separate the clickable elements of the heading.
    
    Instead of hard coding the separator, we can use an empty <span> and
    then use CSS to fill it out.
    
    Fixes: #81

 gidocgen/templates/basic/class.html        |  2 +-
 gidocgen/templates/basic/class_method.html |  2 +-
 gidocgen/templates/basic/constant.html     |  2 +-
 gidocgen/templates/basic/ctor.html         |  2 +-
 gidocgen/templates/basic/enum.html         |  2 +-
 gidocgen/templates/basic/function.html     |  2 +-
 gidocgen/templates/basic/interface.html    |  2 +-
 gidocgen/templates/basic/method.html       |  2 +-
 gidocgen/templates/basic/property.html     |  2 +-
 gidocgen/templates/basic/signal.html       |  2 +-
 gidocgen/templates/basic/struct.html       |  2 +-
 gidocgen/templates/basic/style.css         | 11 +++++++++++
 gidocgen/templates/basic/type_func.html    |  2 +-
 gidocgen/templates/basic/vfunc.html        |  2 +-
 14 files changed, 24 insertions(+), 13 deletions(-)
---
diff --git a/gidocgen/templates/basic/class.html b/gidocgen/templates/basic/class.html
index 621a96a..591fa79 100644
--- a/gidocgen/templates/basic/class.html
+++ b/gidocgen/templates/basic/class.html
@@ -49,7 +49,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
 <section id="main" class="content">
   <header>
     <h3>Class</h3>
-    <h1><a href="index.html">{{ namespace.name }}</a>.{{ class.name }}</h1>
+    <h1 aria-label="Name"><a href="index.html">{{ namespace.name }}</a><span class="sep" 
role="presentation"></span>{{ class.name }}</h1>
   </header>
 
   <section>
diff --git a/gidocgen/templates/basic/class_method.html b/gidocgen/templates/basic/class_method.html
index bd8e2f4..3be5273 100644
--- a/gidocgen/templates/basic/class_method.html
+++ b/gidocgen/templates/basic/class_method.html
@@ -34,7 +34,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
 <section id="main" class="content">
   <header>
     <h3>Class method</h3>
-    <h1><a href="index.html">{{ namespace.name }}</a>.<a href="{{ class.link_prefix }}.{{ class.name 
}}.html">{{ class.class_name }}</a>.{{ class_method.name }}</h1>
+    <h1><a href="index.html">{{ namespace.name }}</a><span class="sep"></span><a href="{{ class.link_prefix 
}}.{{ class.name }}.html">{{ class.class_name }}</a><span class="sep"></span>{{ class_method.name }}</h1>
   </header>
 
   <section>
diff --git a/gidocgen/templates/basic/constant.html b/gidocgen/templates/basic/constant.html
index 4334718..20cf94d 100644
--- a/gidocgen/templates/basic/constant.html
+++ b/gidocgen/templates/basic/constant.html
@@ -28,7 +28,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
 <section id="main" class="content">
   <header>
     <h3>Constant</h3>
-    <h1><a href="index.html">{{ namespace.name }}</a>.{{ constant.name }}</h1>
+    <h1><a href="index.html">{{ namespace.name }}</a><span class="sep"></span>{{ constant.name }}</h1>
   </header>
 
   <section>
diff --git a/gidocgen/templates/basic/ctor.html b/gidocgen/templates/basic/ctor.html
index 49efc3e..9161f85 100644
--- a/gidocgen/templates/basic/ctor.html
+++ b/gidocgen/templates/basic/ctor.html
@@ -36,7 +36,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
 <section id="main" class="content">
   <header>
     <h3>Constructor</h3>
-    <h1><a href="index.html">{{ namespace.name }}</a>.<a href="{{ class.link_prefix 
}}.{{class.name}}.html">{{ class.name }}</a>.{{ type_func.name }}</h1>
+    <h1><a href="index.html">{{ namespace.name }}</a><span class="sep"></span><a href="{{ class.link_prefix 
}}.{{class.name}}.html">{{ class.name }}</a><span class="sep"></span>{{ type_func.name }}</h1>
   </header>
 
   <section>
diff --git a/gidocgen/templates/basic/enum.html b/gidocgen/templates/basic/enum.html
index 42398f7..081dece 100644
--- a/gidocgen/templates/basic/enum.html
+++ b/gidocgen/templates/basic/enum.html
@@ -43,7 +43,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
 <section id="main" class="content">
   <header>
     <h3>Enumeration</h3>
-    <h1><a href="index.html">{{ namespace.name }}</a>.{{ enum.name }}</h1>
+    <h1><a href="index.html">{{ namespace.name }}</a><span class="sep"></span>{{ enum.name }}</h1>
   </header>
 
   <section>
diff --git a/gidocgen/templates/basic/function.html b/gidocgen/templates/basic/function.html
index b0b398d..b676726 100644
--- a/gidocgen/templates/basic/function.html
+++ b/gidocgen/templates/basic/function.html
@@ -41,7 +41,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
 <section id="main" class="content">
   <header>
     <h3>Function {% if func.is_macro %}Macro{% endif %}</h3>
-    <h1><a href="index.html">{{ namespace.name }}</a>.{{ func.name }}</h1>
+    <h1><a href="index.html">{{ namespace.name }}</a><span class="sep"></span>{{ func.name }}</h1>
   </header>
 
   <section>
diff --git a/gidocgen/templates/basic/interface.html b/gidocgen/templates/basic/interface.html
index 1f5b1f9..d61ac2d 100644
--- a/gidocgen/templates/basic/interface.html
+++ b/gidocgen/templates/basic/interface.html
@@ -48,7 +48,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
 <section id="main" class="content">
   <header>
     <h3>Interface</h3>
-    <h1><a href="index.html">{{ namespace.name }}</a>.{{ interface.name }}</h1>
+    <h1><a href="index.html">{{ namespace.name }}</a><span class="sep"></span>{{ interface.name }}</h1>
   </header>
 
   <section>
diff --git a/gidocgen/templates/basic/method.html b/gidocgen/templates/basic/method.html
index 8d44f26..13828ce 100644
--- a/gidocgen/templates/basic/method.html
+++ b/gidocgen/templates/basic/method.html
@@ -36,7 +36,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
 <section id="main" class="content">
   <header>
     <h3>Method</h3>
-    <h1><a href="index.html">{{ namespace.name }}</a>.<a href="{{ class.link_prefix }}.{{ class.name 
}}.html">{{ class.name }}</a>.{{ method.name }}</h1>
+    <h1><a href="index.html">{{ namespace.name }}</a><span class="sep"></span><a href="{{ class.link_prefix 
}}.{{ class.name }}.html">{{ class.name }}</a><span class="sep"></span>{{ method.name }}</h1>
   </header>
 
   <section>
diff --git a/gidocgen/templates/basic/property.html b/gidocgen/templates/basic/property.html
index 86ee019..0b2c6fc 100644
--- a/gidocgen/templates/basic/property.html
+++ b/gidocgen/templates/basic/property.html
@@ -36,7 +36,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
 <section id="main" class="content">
   <header>
     <h3>Property</h3>
-    <h1><a href="index.html">{{ namespace.name }}</a>.<a href="{{ class.link_prefix }}.{{ class.name 
}}.html">{{ class.name }}</a>:{{ property.name }}</h1>
+    <h1><a href="index.html">{{ namespace.name }}</a><span class="sep"></span><a href="{{ class.link_prefix 
}}.{{ class.name }}.html">{{ class.name }}</a>:{{ property.name }}</h1>
   </header>
 
   <section>
diff --git a/gidocgen/templates/basic/signal.html b/gidocgen/templates/basic/signal.html
index b4eddeb..6319dc2 100644
--- a/gidocgen/templates/basic/signal.html
+++ b/gidocgen/templates/basic/signal.html
@@ -36,7 +36,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
 <section id="main" class="content">
   <header>
     <h3>Signal</h3>
-    <h1><a href="index.html">{{ namespace.name }}</a>.<a href="{{ class.link_prefix }}.{{ class.name 
}}.html">{{ class.name }}</a>::{{ signal.name }}</h1>
+    <h1><a href="index.html">{{ namespace.name }}</a><span class="sep"></span><a href="{{ class.link_prefix 
}}.{{ class.name }}.html">{{ class.name }}</a>::{{ signal.name }}</h1>
   </header>
 
   <section>
diff --git a/gidocgen/templates/basic/struct.html b/gidocgen/templates/basic/struct.html
index b9b330a..5fd9b75 100644
--- a/gidocgen/templates/basic/struct.html
+++ b/gidocgen/templates/basic/struct.html
@@ -45,7 +45,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
 <section id="main" class="content">
   <header>
     <h3>Struct</h3>
-    <h1><a href="index.html">{{ namespace.name }}</a>.{{ struct.name }}</h1>
+    <h1><a href="index.html">{{ namespace.name }}</a><span class="sep"></span>{{ struct.name }}</h1>
   </header>
 
   <section>
diff --git a/gidocgen/templates/basic/style.css b/gidocgen/templates/basic/style.css
index 46cad54..b4e9722 100644
--- a/gidocgen/templates/basic/style.css
+++ b/gidocgen/templates/basic/style.css
@@ -219,6 +219,17 @@ blockquote {
   margin: var(--box--margin);
 }
 
+span.sep::after {
+  content: "▸";
+}
+
+span.sep {
+  font-size: calc(0.5em * var(--monospace-font-size));
+  opacity: 0.55;
+  padding-left: .25em;
+  padding-right: .25em;
+}
+
 code,
 pre {
   font-family: var(--monospace-font-family);
diff --git a/gidocgen/templates/basic/type_func.html b/gidocgen/templates/basic/type_func.html
index 59fcdf1..360ced7 100644
--- a/gidocgen/templates/basic/type_func.html
+++ b/gidocgen/templates/basic/type_func.html
@@ -36,7 +36,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
 <section id="main" class="content">
   <header>
     <h3>Function</h3>
-    <h1><a href="index.html">{{ namespace.name }}</a>.<a href="{{ class.link_prefix 
}}.{{class.name}}.html">{{ class.name }}</a>.{{ type_func.name }}</h1>
+    <h1><a href="index.html">{{ namespace.name }}</a><span class="sep"></span><a href="{{ class.link_prefix 
}}.{{class.name}}.html">{{ class.name }}</a><span class="sep"></span>{{ type_func.name }}</h1>
   </header>
 
   <section>
diff --git a/gidocgen/templates/basic/vfunc.html b/gidocgen/templates/basic/vfunc.html
index 2f529e5..c66b668 100644
--- a/gidocgen/templates/basic/vfunc.html
+++ b/gidocgen/templates/basic/vfunc.html
@@ -36,7 +36,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
 <section id="main" class="content">
   <header>
     <h3>Virtual Method</h3>
-    <h1><a href="index.html">{{ namespace.name }}</a>.<a href="{{ class.link_prefix }}.{{ class.name 
}}.html">{{ class.name }}</a>.{{ vfunc.name }}</h1>
+    <h1><a href="index.html">{{ namespace.name }}</a><span class="sep"></span><a href="{{ class.link_prefix 
}}.{{ class.name }}.html">{{ class.name }}</a><span class="sep"></span>{{ vfunc.name }}</h1>
   </header>
 
   <section>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]