fergiemcdowall / norch-bootstrap

A pluggable front-end for Forage based on Angular and Bootstrap
6 stars 0 forks source link

How to best have several templates to choose from? #24

Closed eklem closed 9 years ago

eklem commented 9 years ago

The default template should list out all field names and field content. It can be made a little better, but should show 'out of the box' what's available to play with. A more polished one could fit a certain data set, like the reuters-21578-json or the world-bank-dataset, and could be named norch-bootstrap-reuters-21578 and norch-bootstrap-world-bank-dataset.

The question I got is how to do it best. should these templates be a sub-set/module for norch-bootstrap to require. Something like:

var template = require('norch-bootstrap-reuters-21578')

Or simply be a fork of norch-bootstrap? Then we can explain in the documentation that you just change this variable to change template:

  this.app.use(this.express.static(this.path.join(__dirname,
                                   '../node_modules/norch-bootstrap')));

I got the idea to have it as a subset first, but a fork seems better since there's not that much extra code (bootstrap-stuff) that will change over time. Maybe we can do it the other way around: Require the bootstrap-stuff into the norch-bootstrap, so it's easy to upgrade the actual bootstrap?

fergiemcdowall commented 9 years ago

It would be really nice to provide a pluggable front end with a dataset.

Its definitely best to keep an agnostic front end as default

eklem commented 9 years ago

Then my suggestion is: In norch-bootstrap, we'll stop including the bootstrap files, we just link them from the html, something like this:

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>

Then, all that is left in norch-bootstrap is some html-files (Angular) and a custom css. When people fork it, they only fork the code they will re-code. This will mean they don't create a lot of non-updated bootstrap-code. Maybe we should create a new module called norch-template, or rename norch-bootstrap?

fergiemcdowall commented 9 years ago

Yes, thats a good idea.

eklem commented 9 years ago

Cool (= Thank you, @mewwts for the suggestion to just link in bootstrap stuff.

mewwts commented 9 years ago

:+1: