-
Notifications
You must be signed in to change notification settings - Fork 351
Collapse nested module names #907
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
Merged
josevalim
merged 23 commits into
elixir-lang:master
from
davidsulc:collapse-nested-module-names
Oct 26, 2018
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
6fc3139
collapse module names per config
davidsulc 033ccec
display collapsed prefixes in sidebar
davidsulc febc7d1
ran mix build
davidsulc aaa5f49
documented the collapse_nested_module_names option
davidsulc 45bc111
replaced pipe with function call
davidsulc 50d8fee
provide context for collapsed module names
davidsulc 3fbbca8
refactored empty node handling in sidebar
davidsulc 4397d19
diplay context module in sidebar as non-clickable element
davidsulc b98c920
context modules must be inserted in each type separately
davidsulc a9aa6e6
handle collapsing when clicking on prefix
davidsulc 43b7116
only display an indication of shortening, not the prefix itself
davidsulc 6df86bd
ran formatter
davidsulc 4af999f
display nested modules beneath prefix
davidsulc 648a2ef
removed group_modules_by_nesting artifact
davidsulc e126525
removed dead code
davidsulc d0f4dd6
streamlined sidebar styling
davidsulc 990d7c4
renamed title_truncated to nested_title
davidsulc 4d19b91
add context nodes in UI
davidsulc b124154
used iodata to build JSONed sidebar items
davidsulc eb4fa8e
added test for :group_modules_by_nesting
davidsulc ff459ac
added fixtures
davidsulc d373d59
rename block helpers for consistency
davidsulc a3a1cf4
add module nesting information in the retriever
davidsulc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
assets/js/template-helpers/newGroup.js → assets/js/template-helpers/groupChanged.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
assets/js/template-helpers/isEmptyNode.js → assets/js/template-helpers/hasContent.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export default function (context, nestedContext, options) { | ||
// context.nestedContext is also reset each time a new group | ||
// is encountered (the value is reset within the #groupChanged | ||
// block helper) | ||
if (context.nestedContext !== nestedContext) { | ||
context.nestedContext = nestedContext | ||
return options.fn(this) | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,58 @@ | ||
<ul id="full-list"> | ||
{{#each nodes as |node nodeId|}} | ||
{{#newGroup ../this node.group}} | ||
{{#each nodes as |node nodeId|}} | ||
{{#groupChanged ../this node.group}} | ||
<li class="group">{{node.group}}</li> | ||
{{/newGroup}} | ||
<li class="{{#isLocal node.id}}clicked open{{/isLocal}}"> | ||
{{/groupChanged}} | ||
|
||
{{!-- When visiting a module page, the link to this module page | ||
in the menu should not link to a new page, instead should link | ||
to the top of the page itself. --}} | ||
{{#isEmptyNode node}} | ||
<a href="{{node.id}}.html" title="{{node.title}}">{{node.title}}</a> | ||
{{else}} | ||
<a href="{{node.id}}.html" title="{{node.title}}" class="expand">{{node.title}}</a> | ||
{{#nestingChanged ../this node.nested_context}} | ||
<li class="nesting-context" title="{{node.nested_context}}" aria-hidden="true">{{node.nested_context}}</li> | ||
{{/nestingChanged}} | ||
|
||
<ul> | ||
<li> | ||
<a href="{{node.id}}.html#content">Top</a> | ||
</li> | ||
|
||
{{#isArray node.headers}} | ||
{{#each node.headers}} | ||
<li> | ||
<a href="{{node.id}}.html#{{{anchor}}}">{{id}}</a> | ||
</li> | ||
{{/each}} | ||
<li class="{{#isLocal node.id}}clicked open{{/isLocal}} {{#if node.nested_title}}nested{{/if}}"> | ||
{{! When visiting a module page, the link to this module page | ||
in the menu should not link to a new page, instead should link | ||
to the top of the page itself. }} | ||
<a href="{{node.id}}.html" title="{{node.title}}" {{#hasContent node}}class="expand"{{/hasContent}}> | ||
{{#if node.nested_title}} | ||
{{node.nested_title}} | ||
{{else}} | ||
{{#showSummary node}} | ||
<li> | ||
<a href="{{node.id}}.html#summary">Summary</a> | ||
</li> | ||
{{/showSummary}} | ||
{{#each node.nodeGroups as |group|}} | ||
<li class="docs"> | ||
<a href="{{node.id}}.html#{{group.key}}" class="expand">{{group.name}}</a> | ||
<ul class="{{group.key}}-list deflist"> | ||
{{#each group.nodes}} | ||
<li> | ||
<a href="{{node.id}}.html#{{anchor}}">{{id}}</a> | ||
</li> | ||
{{/each}} | ||
</ul> | ||
</li> | ||
{{/each}} | ||
{{/isArray}} | ||
</ul> | ||
{{/isEmptyNode}} | ||
</li> | ||
{{/each}} | ||
{{node.title}} | ||
{{/if}} | ||
</a> | ||
|
||
{{#hasContent node}} | ||
<ul> | ||
<li> | ||
<a href="{{node.id}}.html#content">Top</a> | ||
</li> | ||
|
||
{{#isArray node.headers}} | ||
{{#each node.headers}} | ||
<li> | ||
<a href="{{node.id}}.html#{{{anchor}}}">{{id}}</a> | ||
</li> | ||
{{/each}} | ||
{{else}} | ||
{{#showSummary node}} | ||
<li> | ||
<a href="{{node.id}}.html#summary">Summary</a> | ||
</li> | ||
{{/showSummary}} | ||
{{#each node.nodeGroups as |group|}} | ||
<li class="docs"> | ||
<a href="{{node.id}}.html#{{group.key}}" class="expand">{{group.name}}</a> | ||
<ul class="{{group.key}}-list deflist"> | ||
{{#each group.nodes}} | ||
<li> | ||
<a href="{{node.id}}.html#{{anchor}}">{{id}}</a> | ||
</li> | ||
{{/each}} | ||
</ul> | ||
</li> | ||
{{/each}} | ||
{{/isArray}} | ||
</ul> | ||
{{/hasContent}} | ||
</li> | ||
{{/each}} | ||
</ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...s/epub/dist/epub-d7f1cf89be483a67606b.css → ...s/epub/dist/epub-0b04cd47f7bc89621d0b.css
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...rs/epub/dist/epub-d7f1cf89be483a67606b.js → ...rs/epub/dist/epub-0b04cd47f7bc89621d0b.js
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.