Javascript Templating Language and Engine— Mustache.js with Node and Express
- Javascript templating is used to display client-side view templates using Javascript and JSON.
- Template is an HTML element.
Mustache
- Mustache is a logic-less template syntax.
- It used for HTML, config files, source code.
- You can implement it using mustache.js.
- There is a medium feature that provide both Code blocks & Inline code.
- Ruby is a programming language whereas Rails is a gem, or a Ruby library.
- Rails provide classes to save database, handle URLs and display HTML.
A Complete Guide to Flexbox
- You can use flex value in display property.
- By default, flex items are laid out in the source order.
- FLex property accepts a unitless value that serves as a proportion.
- if you want to set the container distributed equally to all children, you have to set flex-grow to 1.
- flex-shrink defines the ability for a flex item to shrink if necessary.
- nowrap (default): all flex items will be on one line
- wrap: flex items will wrap onto multiple lines, from top to bottom.
- wrap-reverse: flex items will wrap onto multiple lines from bottom to top.
- flex-flow is a shorthand for the flex-direction and flex-wrap properties, which together define the flex container’s main and cross axes.It has a default value which is row nowrap.
- flex-basis defines the default size of an element before the remaining space is distributed.
- You can use one property instead of using flex-grow, flex-shrink and flex-basis combined which is flex.
- flex-start (default): items are packed toward the start of the flex-direction.
- flex-end: items are packed toward the end of the flex-direction.
- start: items are packed toward the start of the writing-mode direction.
- end: items are packed toward the end of the writing-mode direction.
- left: items are packed toward left edge of the container, unless that doesn’t make sense with the flex-direction, then it behaves like start.
- right: items are packed toward right edge of the container, unless that doesn’t make sense with the flex-direction, then it behaves like end.
- center: items are centered along the line space-between: items are evenly distributed in the line; first item is on the start line, last item on the end line.
- space-around: items are evenly distributed in the line with equal space around them. Note that visually the spaces aren’t equal, since all the items have equal space on both sides. The first item will have one unit of space against the container edge, but two units of space between the next item because that next item has its own spacing that applies.
- space-evenly: items are distributed so that the spacing between any two items (and the space to the edges) is equal.
- stretch (default): stretch to fill the container (still respect min-width/max-width)
- flex-start / start / self-start: items are placed at the start of the cross axis. The difference between these is subtle, and is about respecting the flex-direction rules or the writing-mode rules.
- flex-end / end / self-end: items are placed at the end of the cross axis. The difference again is subtle and is about respecting flex-direction rules vs. writing-mode rules.
- center: items are centered in the cross-axis
- baseline: items are aligned such as their baselines align
- normal (default): items are packed in their default position as if no value was set.
- flex-start / start: items packed to the start of the container. The (more supported) flex-start honors the flex-direction while start honors the writing-mode direction.
- flex-end / end: items packed to the end of the container. The (more support) flex-end honors the flex-direction while end honors the writing-mode direction.
- center: items centered in the container
- space-between: items evenly distributed; the first line is at the start of the container while the last one is at the end
- space-around: items evenly distributed with equal space around each line
- space-evenly: items are evenly distributed with equal space around them
- stretch: lines stretch to take up the remaining space.