New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change class hierarchy markup to ordered-list #90
Conversation
生成されるHTMLはこう変わります。 変更前<h1>class Hash</h1>
<p>
クラスの継承リスト: Hash
< <a href="../class/Enumerable.html">Enumerable</a>
< <a href="../class/Object.html">Object</a>
< <a href="../class/Kernel.html">Kernel</a>
< <a href="../class/BasicObject.html">BasicObject</a>
<br> dynamic include:
<a href="../class/JSON=3a=3aGenerator=3a=3aGeneratorMethods=3a=3aHash.html">JSON::Generator::GeneratorMethods::Hash</a> (by <a href="../library/json.html">json</a>)
</p> 変更後
|
継承リストのあたり領域は左側が一等地で右側は不揃いで重要度の低いものとなりがちなところ、継承リストの親側、つまりBasicObjectやKernel、Object等は情報量ゼロで多くの場合ノイズであり、それを一等地に置くのはあまり良くないかなと感じました |
こんな感じでHTMLのリストの順序はそのまま見た目を逆順にできそう? diff --git a/data/bitclust/template.offline/class b/data/bitclust/template.offline/class
index 405249d..2f975c0 100644
--- a/data/bitclust/template.offline/class
+++ b/data/bitclust/template.offline/class
@@ -33,7 +33,7 @@
<% unless @entry.alias? %>
<nav>
<%= _('ancestors') %>:
- <ol class="inline-breadcrumb-list">
+ <ol class="inline-breadcrumb-list inline-breadcrumb-list--ancestors">
<% supers.reverse_each do |c| %>
<li>
<%= class_link(c.name) %>
diff --git a/theme/default/style.css b/theme/default/style.css
index 3d3296a..898f3ed 100644
--- a/theme/default/style.css
+++ b/theme/default/style.css
@@ -298,6 +298,26 @@ hr {
margin-bottom: 0;
}
+.inline-breadcrumb-list.inline-breadcrumb-list--ancestors {
+ display: inline-flex;
+ flex-direction: row-reverse;
+}
+
+.inline-breadcrumb-list.inline-breadcrumb-list--ancestors li {
+ display: inline-flex;
+}
+
+.inline-breadcrumb-list.inline-breadcrumb-list--ancestors li + li::before {
+ content: "";
+ padding: inherit;
+}
+
+.inline-breadcrumb-list.inline-breadcrumb-list--ancestors li + li::after {
+ content: "<";
+ padding-left: 0.1rem;
+ padding-right: 0.1rem;
+}
+
.inline-breadcrumb-list li + li::before {
content: ">";
padding-left: 0.1rem; |
29cea6d
to
1715975
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
今までと見た目上かわらなさそうなので、いいんじゃないかなあと思います(ブラウザの問題なのか継承リストの部分コピペしようとしたときにちょっと挙動が怪しい感じがしますが)。
content: ">"; | ||
padding-left: 0.1rem; | ||
padding-right: 0.1rem; | ||
} | ||
|
||
.inline-ancestors-list { | ||
display: inline-flex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I useの https://caniuse.com/#feat=flexbox みて不安だったので調べました、IE11なら大丈夫そうかな (IEで確認してないので分からないけど)
https://developer.mozilla.org/ja/docs/Web/CSS/display
特にもう意見も出なさそうなので、マージしてみます。 |
変更内容
#88 を承けて、継承リストを順序付きリストで記述するように変更してみました。ただし、これまでと比べて記述順序が逆になっています。
それと、これは些細な変更ですが、dynamic include等の継承リスト以降に続く可能性がある情報について、これまでbr要素とテキストノードで表現されていたのを、それぞれp要素で囲むようにしました。これは、その方が構造的に適切で、かつそうした方がデザインが崩れにくく、結果的に実装しやすかったためです。
順序変更の理由
ということを踏まえて考えた結果、これまでの継承リストと記述順序を逆にした方が良いのでは、と思い変更しています。
変更前
変更後