MarkBind / markbind

MarkBind is a tool for generating content-heavy websites from source files in Markdown format
https://markbind.org/
MIT License
135 stars 124 forks source link

Docs: show how to include dividers in the siteNav #543

Closed damithc closed 4 years ago

damithc commented 5 years ago

v1.15.2

Suggestion: provide a way to have dividers in the siteNav. An example (from Hexo):

image

Chng-Zhi-Xuan commented 5 years ago
<navigation>
  * Getting Started
  * [Home :glyphicon-home:]({{baseUrl}}/index.html)
  * <br></br>
  * <hr></hr>
  * Basic Usage
  * [Home :glyphicon-home:]({{baseUrl}}/index.html)
</navigation>

It is already supported, just tested with the above template 😀

Key is to use <br> and <hr> as a list item.

yamgent commented 5 years ago

Key is to use <br> and <hr> as a list item.

This also works (<br> need not be a list item, and we can use Markdown's horizontal bar)

<navigation>
  * Getting Started
  * [Home :glyphicon-home:]({{baseUrl}}/index.html)
  <br><br>
  * ------
  * Basic Usage
  * [Home :glyphicon-home:]({{baseUrl}}/index.html)
</navigation>

Should we document it as part of tips and tricks?

Chng-Zhi-Xuan commented 5 years ago

The since the <navigation> area is assumed to only contain list items (by Page.js#formatSiteNav), I would prefer not to have HTML tags separating the list items. I think your workaround works because Markdown-It treats the <br> tag as part of the previous line?

As for documentation, we can seamlessly add it to the site-nav example within Tweaking the page structure section which I think fits better than Tips & Tricks section.

damithc commented 5 years ago

Nice find. This worked too:

* [Object-Oriented Programming]({{ baseUrl }}/programming/toc/oop.html)
* ------------------------------------------------------------------------
* <br>%%**Appendices**%%<br>
* [Appendix A: Installing 3rd Party Modules]({{ baseUrl }}/programming/toc/thirdparty.html)

image

Should we document it as part of tips and tricks?

Can even be a part of the main documentation of site-nav

acjh commented 5 years ago

Do we render separate lists around the divider? Can someone help to check the HTML of the Hexo example?

acjh commented 5 years ago

Hexo doesn't use a list, but it's one <div>:

<div class="inner">
  <strong class="sidebar-title">Getting Started</strong>
  <a href="/docs/" class="sidebar-link current">Overview</a>
  <a href="/docs/setup" class="sidebar-link">Setup</a>
  <a href="/docs/configuration" class="sidebar-link">Configuration</a>
  <a href="/docs/commands" class="sidebar-link">Commands</a>
  <a href="/docs/migration" class="sidebar-link">Migration</a>
  <strong class="sidebar-title">Basic Usage</strong>
  <a href="/docs/writing" class="sidebar-link">Writing</a>
  ...
</div>

Let's show an example that keeps it to one list.

Tejas2805 commented 4 years ago

Screen Shot 2020-02-27 at 3 48 57 AM

We already have something like this in the Reader Facing Features Section. Do you all still want to document it separately in siteNav ? Will do that then.

damithc commented 4 years ago

We already have something like this in the Reader Facing Features Section. Do you all still want to document it separately in siteNav ? Will do that then.

I think it's better to mention it as an additional tip. In fact, we can also mention how to add a divider to navigation menus too. e.g., image

Tejas2805 commented 4 years ago

Fixed by #1063 This can be closed.

Tejas2805 commented 4 years ago

Can be closed now.