V-Squared / V-Squared.github.io

Initiative for Modular and Upgradable Mini and All-In-One PC. Standards — Know How — Blueprints — Trailblazer Products
http://v-squared.github.io/
Other
2 stars 1 forks source link

Epic►005►Parent: Compile Know How►GitHub Template #48

Open VillageHubertChen opened 8 years ago

VillageHubertChen commented 8 years ago
VillageHubertChen commented 8 years ago

Programming the Nav Bar System

VillageHubertChen commented 8 years ago

The Library Shelf Metaphor

VillageHubertChen commented 8 years ago

Kramdown Cheat Sheet

To Do

Reference

VillageHubertChen commented 8 years ago

Material Design in V²Site

Introduction to Google Material Design

Introduction to Angular Material

How to use Material in HTML

How to use Material in Kramdown

VillageHubertChen commented 8 years ago

Styling of V² Articles

VillageHubertChen commented 8 years ago

How to use v2-Tooltip

VillageHubertChen commented 8 years ago

How to use v2-Tab

VillageHubertChen commented 8 years ago

How to use SVG with v2-Tooltip

VillageHubertChen commented 8 years ago

Building a Big Web Site on GitHub

Wishlist on Site for V²

Implementation

Developing and Hosting on GitHub

GitHub Pages is hosted directly from your GitHub repository. Just edit, push and the changes are live. This makes the development and contribution very easy, as we are using the exact same GitHub tools to develop and publish all other V² projects. Hosting of Open Source Projects including their GitHub Pages on GitHub is free.

Layout with uikit & Material Design

UI Kit

We worked with Bootstrap in the last year and were very happy with it. But time is moving on. uikit is using a more modern approach that helps us to make our layouts with less code in less time. Pages designed with uikit look modern. When properly designed they work well on any screen size.

Google Material Design

Google Material Design is the latest layout framework that we added to our toolbox. So far we like it very much. It comes with good templates, good documentation on templates and design in general. And it is based on Angular as well. Eventually we will need to make a call to pick one of the two frameworks. For now we are using both

Jekyll Website Compiler

Introduction

Jekyll is developed by GitHub in Ruby. It takes your authored pages, binds it with a template and generates a static html site complete with powerful navigation. You can author your pages in either Markdown or HTML or a mix of both.

We will use Markdown for most pages, since writing in Markdown is so much faster than writing in HTML. But for pages that require a more fancy layout we will begin in Markdown and at a certain point either convert it to HTML completely or inject HTML into passages that can not be expressed in Markdown.

The Authored pages are easy to read and fast to write, since most layout information is removed and placed into the template pages. This makes writing and editing very fast. Similarly useful are include directives for commonly used page parts, such as a navigation header or a footer.

Not to forget that Markdown is intuitive to read even for non developers, making it easy for anybody to contribute a page improvement using GitHub Pull Request.

How Jekyll works when editing on GitHub

You can edit your Jekyll Web Site on GitHub just using the GitHub Editor in your web browser. All you need to do is find the file to edit, open it, do your edit and commit the file. Committing the file will trigger the Jekyll compiler of your repository on the GitHub server. It will generate the updated version of your site automatically. Just view it in your browser to make sure the changes are as intended.

How Jekyll works when working local

Of course you can work local. This provides all advantages that you are already used to when using Git. Pull your repository with a Git Client, such as SmartGit or GitHub Client. Next install Jekyll. Whenever you made changes to files that you want to check in a browser you need to invoke your Jekyll compiler, then view the generated pages in your browser. Once you are satisfied you commit your repository to GitHub. Be sure that you have set GitIgnore of your GitHub Repository to Jekyll. This makes sure that the files which are generated by your local Jekyll compiler are not uploaded to GitHub. The Jekyll compiler on the GitHub server will generate them again.

Strength of Jekyll versus WordPress or Joomla

What you can not do in Jekyll

URL: V-Squared.github.io

Even Microsoft uses microsoft.github.io and Twitter uses twitter.github.io. As such V-Squared.github.io follows the same pattern.

Fast styling with SASS

Significantly more efficient styling in SASS that compiles into CSS. This is made possible by SASS introducing programming concepts such as procedures and variables to CSS. Jekyll uses SASS.

Powerful Template by Liquid

Liquid is a powerful and efficient language for templates. It allows to code templates that are good looking, are fully responsive and offer powerful navigation. V²Site will be hosted in a mashup of three hosting providers: GitHub, Shopify and a generic one. The first two have Liquid build in, the third one can easily be upgraded to it. This way all parts of the website can use the same template.

Features

Markdown forever to Publish Workflow

We will author most pages in Markdown. This workflow will allow that they will stay in Markdown forever. That means even after the page is published in HTML we can make subsequent changes to the original Markdown file and compile it into an updated HTML page to be published.

All other workflows either do not support Markdown at all, or they start in Markdown and at some point require conversion to HTML with all subsequent edits to be done in HTML.

This is a big deal. We are publishing standards and tutorials. Most of our pages will be of interests for at least 5 years. But they will not be static. Instead they will undergo frequent changes. They will not be big changes, but minor improvements, fixes and updates. Being able to do this in Markdown instead of HTML makes this much faster and convenient!

Note: Markdown has dialects. GitHub Issues use the dialect GitHub Flavored Markdown versus Jekyll uses Kramdown. Usually developing an Article in GitHub Issues and then copy pasting it into a Jekyll page works fine, but occasionally you have the odd glitch that you need to fix. Kramdown ads a few much needed features, such as injecting CSS Styles or add reasonable footnotes.

Contribution through GitHub Pull Requests

Now this could not be easier. The hosted pages are in the GitHub repository gh-pages. As with any repository, it can be branched or forked. The contributor can develop and test locally. When he is satisfied with his changes he makes a pull request, that we will test and when quality is satisfactory we will merge it. Just like with any other project on GitHub.

Everybody can contribute to the site

Who uses GitHub takes this for granted. Anybody can contribute changes. But as a user of standards of a Standard Organization this is kind of a new thing: Anybody can easily and efficiently contribute changes with the GitHub Fork → Improve → Pull Request Workflow. And because it is so efficient, we will get back to every Pull Request!

Site Preview and Staging through Cloud9

After implementing the new feature / fixing the bug we need to test it before publishing the new version. This is done through Cloud9 IDE. Workflow:

  1. Pull the project from the GitHub gh-pages repository
  2. Make changes
  3. Perform all test the developer can do. Cloud9 can host site
  4. Share the URL of the hosted site to all tester
  5. Tester give feedback. Fix any bugs. Share again. Repeat until testers are happy
  6. Push to the project to the gh-pages repository. This publishes the new pages.

Markdown Preview

There are powerful editors available, such as StackEdit and Classeur. They allow you to write in the left pane in Markdown and to see the final Page Layout including formatted Tables and Images in the right pane. Cloud9 IDE has such Markdown Previewer built in.

Simple, few dependencies, robust, little maintenance

V²Site is made up of static HTML. It can not be much simpler and as such it is very robust. This allows us to spend most time on content development and little to no time on things like updating the SQL data base or updating plugins and subsequently resolving conflicts of plugins.

We also do not need to set up three servers: Development + Integration + Production Server and write a complex handbook on workflow and maintenance.

Very fast writing of Articles and Blogs

This is the purpose and strengths of Jekyll. As Author you will write directives, such as which template to use directly into the file together with content and formatting in Markdown. Jekyll will add the formatting drawn from the mentioned template, add the includes and convert it all to nice HTML, linked to the proper css style sheet.

Jekyll is supposed to take care of things like navigation toolbar and footer. We will see how this will work out in real life. But it is from GitHub and as such we expect it to work.

Version Management

Since the whole site is in a GitHub repository it comes with the very powerful Version Management of Git / GitHub. We use it for all other projects, so nothing new to learn!

Same Workflow for Pages and Blog

Convenient! Less to learn!

Deep Linking

When clicking on an entry to the table of contents the article soft-scrolls to the corresponding position. Additionally the URL-Bar in the browser is updated to add a hashtag accordingly. This way the reader can share by sending this URL not only the Article, but also this reading position. → #112

Fully usable on Mobile & Tablet

This means all functions are available and actually still fun to use when browsing our site on a small device, such as Mobile and Tablet. To make this happen we need two things:

Responsive Design

Responsive web site design accommodates the smaller physical screen sizes of mobile and tablets. This is far more complex than merely scaling down the size of the page and goes beyond the scope of this article. Suffice to say we hand coded the template for our web site using the latest libraries to provide a pleasant user experience on small devices.

Fast Code

A website that has instant response on a desktop could have a lag of several seconds on a mobile device. This is unacceptable to the users. Once we finish coding a new feature we test it on mobile devices and in case it is too slow we optimize the code until the UI feels fast enough to the user.

Usable in China

Why it is important

There are two key reasons: One: Our core development team is located in China, as such we need to be able to access the website that we develop. _Two: _ In Campaign 4 we will work with OEMs, that many of are located in China.

The Problems and Solutions

Social Media

In China two critical parts of the western internet are not available: Social Media: Our marketing relies heavily on web sites such as YouTube, Twitter, Facebook, etc. We need to code the site that it a) still loads fast if these sites are not accessible b) offer an alternative to get the same information.

Library CDNs

Nowadays websites load the script librarys from CDNs, which are also not available in China. We need to add code to load the libraries from alternative places. → #101

Integration of Social Media

  1. Blog: For what is going on, developing content
  2. Twitter, Facebook, Google+ -> Announce new content, fish readers
  3. Feedback improves content
  4. Page Section: Compile blog + feedback into evergreen Article type content

Benefits to our current workflow

Goes with GitHub Philosophy

Faster content development

We tried to develop content on our Joomla site. The process was so complicated that the logistics of Joomla was distracting from creating content. This workflow promises to be so simple that the focus is on creating content.

It can compliment CMS

It is not clear if we will keep the CMS for www.villagetronic.com. Whatever we do, it is expected this new site development and publishing workflow can be used. Either as a replacement or as content development workflow to generate the HTML pages to be published in Joomla.

How to Implement Shop, Ticket and Forum

Shop

We are currently testing Shopify. It appears that its monthly fee of $9 or $29 is well worth for us the added features and the reduced maintenance work. So far we prefer it over the Joomla Shop Plugin that we used before.

Ticket System

So far we are using osTicket. We are very happy with it. It is a php + MySQL app that can be easily installed on many hoster with even the lowest cost hosting packaged.

Forum

Before we used Kunena on Joomla and were very happy with it. Our research shows that there is a variety of Forum apps that are php + MySQL that are even more powerful than Kunena and can be easily installed on many hoster with even the lowest cost hosting packaged.

Modern websites are a mashup of services

So we would end up with minimum three hosting services for our final site:

  1. GitHub: Jekyll, GitHub Issues for development and contribution
  2. Shopify: Shop
  3. Standard Hoster: for Ticket and Forum

Cost → $0

Item Cost
Hosting on GitHub $0
IDE and Tools $0
Templates & Plugins $0
Shop Shopify $9 or $29 / month
Standard Hoster $1 / month

Compatibility with Angular

Out of the box Jekyll and Angular are not compatible. But they can be made to work together easily enough. All our web apps are written in Angular.

Powerful Navigation

Good Navigation on a website with lots of content is very important. V²Site is build with our V²GitHub Template that offers 5 Level Navigation, that remains fast and usable on mobile devices. Table of contents are fast to access and offer deep linking.

References

Action

VillageHubertChen commented 8 years ago

Maintainers Manual V²Site

Making Changes to Board-Bar or Book-Bar

Creating a new Article

VillageHubertChen commented 8 years ago

Workflow for custom page

This Article was extracted from Article►Introduction to V²Plan System #54, as we now take a different, more simple solution for this kind of page. However, the general approach is still valid. I am storing this Article for later reference. When used, this Article need to be adapted for the specifics of the new page.

Introduction Page in HTML

Content

Each Article is listed as a Card with the following content:

Formatting with Angular Material Cards

Why HTML in the Beginning

We need a specific page layout which Kramdown can not deliver. By custom designing this page in HTML with Angular Material Styling we can create a significantly improved user experience.

In the Kramdown in the End

The Introduction Page in HTML is great to read for the reader, but horrible for the author. This is why all our other pages are written in Kramdown rather than HTML. To make this happen we need to develop a → Jekyll Template for Introduction Page.

Why Angular Material

V² Site is made in Material Design

Material Design is a visual language complete with theoretical white paper, template, examples, tutorials and training materials. Only announced in summer 2014 it was widely successful and in 2015 most Android Apps already use it. We chose Material Design because it delivers a consistent experience for our V² Site visitor on all of his devices.

Angular Material

All of V² Site's Web Apps are written in Angular. Angular Material is the UI framework implementation of Google Material Design in Angular. Angular Material is well documented, robust and easy to use in development. It also integrates well with Liquid and Jekyll, which are the Template Language and Web Site Compiler that we use to generate V² Site.


Jekyll Template for Introduction Page

Purpose of Jekyll Templates

We needed a specific page layout which Kramdown could not deliver. Thus we used HTML with custom styling. Now the Introduction Page in HTML is great to read for the reader, but horrible for the author. This is why all our other pages are written in Kramdown rather than HTML.

This is exactly the job of a Liquid page template for Jekyll.

What the Template does

Simply put, it will make Kramdown Source that looks like this:

??? convert the pseudo code below to Kramdown code???

look like that:

??? copy the HTML code from the by then complete HTML Intro Page???

Coding the Template in Liquid

Our V²Site web site is compiled with Jekyll. It uses the Liquid Templating Language. As such we need to develop

How to use the Template

Add it in the Front Matter

Current Front Matter uses the template layout: "page"

---
layout: page
menu: System
title: V² Plan System
---

Same Front Matter, but with template layout: "intro"

---
layout: intro
menu: System
title: V² Plan System
---

Change Introduction Page to Kramdown

Why Kramdown

One of the principle objectives of V² Site is to allow anybody to edit any page content with ease! Page source code in complex HTML is counter productive to this goal. Instead Kramdown delivers the easy editing experience we want to deliver to our users!

Why now we can use Kramdown

Because at this time we have learned to create a Jekyll Template for Introduction Page.

What needs to be done

VillageHubertChen commented 8 years ago

How I'm using Jekyll (Content Creation)

LukasChen commented 8 years ago

How I'm using Jekyll (Developer)

VillageHubertChen commented 8 years ago

Content Creation Workflow

Consider to use the Wiki for Incubation like this

Content Creation Workflow Overview

  1. Identify you have something that ought to be documented
  2. Check if there are existing pages on our site ready to take this content
    • Yes: Add content to that page. You are done
    • No: Continue
  3. Incubation of Article in Issue
    • Create an Issue and start writing content until you reach one of two points
      • Content feels mature and you determined page location and page name → Continue 6.
      • Content feels the size is Article Series and not Article → Continue 4.
  4. Incubation of Article Series in Wiki
    • Create a prefix for this Article series. It will be used to group this series versus another.
    • Break up content into individual Articles. Each with an Article Name
    • Create Articles in Wiki accordingly and move content from Issue to new Wiki Pages
      • Use method of create link to Article in Side Navigation bar, then click it to create article
    • Continue working on the Article Series until it is mature
      • In the Wiki it is so fast to create and delete pages and update navigation, that restructuring becomes fast. It is even fast to move an Article from one Article Series to another. Restructure your Article series here until structure is mature. Never move the Article series to the site before the structure is mature! Changing structure there is extremely time consuming and upsetting.
    • Proof reading. Get an external editor to proof read your Article series. Focus is on checking:
      • No Article has been forgotten
      • Structure is clear
      • Article Names are final
  5. Creating a Book (Container of Article Series)
    • create the folder in code to contain the article files
    • create book entry in book-bar.yml
  6. Creating Article
    • Create the markdown file in code in proper folder
    • create article entry in book-bar.yml
    • If this is an article series you need to repeat this step for all articles
  7. Promotion
    • Announce the new Article / Series on our social network
    • If it is a common problem, find places in stackedit and quora to publish it there too
VillageHubertChen commented 8 years ago

Page Structure & Menu System

Page Structure of V²Plan as Tree Diagram

When developing the content for a board we first develop its page structure with a text based tree diagram. This can be done with any text editor when set to mono spaced font, such as Courier. Below is a snapshot of the tree as developed in → Page Structure for V²►Plan #78 .

The three vertical lines represent the three levels of the Book Shelf Metaphor Navigation:

  1. Board
  2. Book
  3. Article

page-structure-v2-plan-tree

Implemented Page Structure in Menu Navigation

page-structure-v2-plan-menu

This is the same Page Structure implemented as Navigation System. The top horizontal bar is the top navigation layer (which we call Board-Bar). It is the equivalent to the left most vertical line in previous tree diagram. The next horizontal menu bar is what we call the Book-Bar. It matches with the middle line in previous diagram. Each Book contains one ore many Articles. In this snap shot the Book "System" is selected. You can see its Articles in the Article-Bar which is left to the image

Menu on Mobile Screen shows Shelf Metaphor

page-structure-v2-plan-menu-mobile

This is the same window, only reduced in width. At the reduced width the menus do not fit any longer and are collapsed to Off Canvas Menu Icons, represented by three horizontal bars. Beside the Icons we spell out which Navigation Level they represent. So in case you ever forgot where the Board Bar and Book-Bar go, simply reduce the screen width.

VillageHubertChen commented 8 years ago

@bcaswelch Please review above documentation and let me know if clear