-
Notifications
You must be signed in to change notification settings - Fork 441
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
Add breadcrumb list #973
base: master
Are you sure you want to change the base?
Add breadcrumb list #973
Conversation
To be precise, what is displayed in "rurema" is not a breadcrumb list but an inherited list of classes/modules. And this change don't provide an inherited list. |
I'm a little concerned about whether the plural term "namespaces" is appropriate here. |
@nobu Is it better for rename to |
The word "namespaces" feels ambiguous; it doesn't represent that it contains what namespaces. |
I love this feature 👍 Are you ok with rebasing the PR? |
@st0012 Sorry for late, rebased! |
Motivation
When reading several modules has deeply nested namespaces like OpenSSL, the breadcrumb list is very useful.
In Japanese document (called rurema) has breadcrumb like this.
So, I introduce breadcrumb into rdoc.
I tested on
ruby/rdoc
andruby/ruby
.ruby/rdoc
3f19b7a572b883291b7e8f66ec1726fd.mp4
ruby/ruby
26e76f9e48ba1567d606c2efa9001ee7.mp4
Changes
Add methods to
RDoc::ClassModule
to build breadcrumb metadata.RDoc::ClassModule#nesting_namespaces
full_name
by::
RDoc::ClassModule#fully_qualified_nesting_namespaces
RDoc::ClassModule
instance fromRDoc::Store#classes_hash
andRDoc::Store#modules_hash
Add private methods to
RDoc::Generator::Darkfish
to build breadcrumb data for easy-to-use template erb.namespaces_to_class_modules
{ "RDoc" => `RDoc::NormalModule` instance, "ClassModule" => `RDoc::NormalModule` instance }
generate_namespaces_breadcrumb
[{:name=>"RDoc", :path=>"../RDoc.html", :self=>false}, {:name=>"ClassModule", :path=>"../RDoc/ClassModule.html", :self=>true}]
Then, display the breadcrumb in the class template.
My concerns