marionettejs / marionettejs.com

:triangular_flag_on_post: Source files for the Marionette site
https://marionettejs.com
MIT License
26 stars 32 forks source link

Add order for doc files #447

Closed denar90 closed 8 years ago

denar90 commented 8 years ago

I propose to add order for doc files. Now we have it alphabetically in nav bar

<nav>
          <% files.forEach(function(file) { %>
            <a href="/docs/<%- tag + '/' + file.basename %>.html"><%- file.title %></a>
          <% }); %>
</nav>

Purpose e.g. installation.doc which has to be first and after all other stuff. Issue related to https://github.com/marionettejs/backbone.marionette/issues/2963

I propose a few ways how it can be solved.

What do you think guys?

samccone commented 8 years ago

:+1:

peterblazejewicz commented 8 years ago

@denar90 maybe only a topics object needs to be added, e.g. (pseudo-code):

<nav>
    <% topics.forEach(function(file) { %>
      <a href="/docs/<%- tag + '/' + file.basename %>.html"><%- file.title %></a>
    <% }); %>
    <hr />
    <% files.forEach(function(file) { %>
      <a href="/docs/<%- tag + '/' + file.basename %>.html"><%- file.title %></a>
    <% }); %>
    <hr />
    <% topics.forEach(function(file) { %>
      <a href="/docs/<%- tag + '/' + file.basename %>.html"><%- file.title %></a>
    <% }); %>
  </nav>

where topics is just a set of most important files and files:

files: _.difference(files, topics)

The topics object can be created in the same place where files are parsed.

denar90 commented 8 years ago

It make sense. Do we need additional line of topics at the bottom?

denar90 commented 8 years ago

I've created PR. It's my vision of solving issue. Can someone take a look? Maybe I'm wrong.