typora-issues icon indicating copy to clipboard operation
typora-issues copied to clipboard

[Suggestion] Outline, distinguish position without children

Open kris7453 opened this issue 5 years ago • 5 comments

It is difficult to style position without children. I want to use outline-expander in my theme, but not display it to positions without any child. Current structure for all nodes in outline look like this:

<li class="outline-item-wrapper outline-h4">
   <div class="outline-item">
      <span class="outline-expander"></span>
      <span class="outline-label" data-ref="n187">Block notation</span>
   </div>
   <ul class="outline-children"></ul>
</li>

Can I ask to add class e.g. outline-has-no-child for outline-item-wrapper without children or remove outline-expander from nodes without further descendants?

kris7453 avatar Dec 15 '20 17:12 kris7453

.outline-item-signle on li means there's no children.

abnerlee avatar Dec 17 '20 15:12 abnerlee

relates #4060

abnerlee avatar Dec 17 '20 15:12 abnerlee

Ok, I found that class. In my case class doesn't appear, till I don't check Collapsible Outline on Left Panel option in preferences. Sorry for useless issue. So then, there is typo in class name, shouldn't it be outline-item-single?

kris7453 avatar Dec 18 '20 20:12 kris7453

Ok, I found that class. In my case class doesn't appear, till I don't check Collapsible Outline on Left Panel option in preferences.

You want this class when there's no collapse / expand icon? Could you share your user case?

So then, there is typo in class name, shouldn't it be outline-item-single?

Thanks for pointing out, we will add outline-item-single for correctness.

abnerlee avatar Dec 20 '20 14:12 abnerlee

You want this class when there's no collapse / expand icon? Could you share your user case?

No, I wanted that class before, cause I didn't notice that there is an option to enable collapsible outline. When I saw expanders in document structure, I thought that this is abandoned idea. It is great, that user is able to choose, if want unfold some of the headers or see whole outline unfolded at once.

I was thinking about adding class to ancestors of active node, to be able to create an outline with all folded nodes and unfold only ancestors of the active node, to have cleaner view when a file have too many headers. I'm not sure if it's great idea, but I will create new issue if I consider that this idea is good, or maybe You will implement it earlier, before I consider to create an issue.

kris7453 avatar Dec 22 '20 15:12 kris7453