1. Principles and Practices, Project management

This week I worked on defining my final project idea and started to getting used to the documentation process.

Principles and Practices (part 1 of 2)

sketch01 sketch02

The initial final project idea I came up is a small device that can attach to a pen and record your movement with the pen. I imagine it uses a motion sensor, like a three-axis accelerometer/gimbal senser to track the position and tilt of the pen. The structure contains a circular slot to insert the pen, and at the bottom of the slot, place a small force sensor (maybe FSR sensor) at the bottom of the slot, use the force sensor's value to determine if the user has started writing or drawing as well as record the force used when drawing. I'd like it to have some kind of network capability, to have a Web interface to show the recorded path, maybe also do some effects and generative image stuff.

The idea is to achieve the path recording functionality as simple as possible and not affecting the normal writing and drawing exprience, acting as an addon for the pen.

Project Management (part 2 of 2)

For this part of the assignment, because I have some exprience in coding and web design, it's not a big challenge for me.

First, I go to the official website of Git, download the installer of Git for Windows and run through the install. Now I have git installed on my machine and can access it by the git-bash commandline utility.

git installed

Then I need to add a ssh key to my fabcloud gitlab account to be able to clone my project template and push changes to it. I go to my project repository, log in, go to the 'preferece/SSH Key' page, click the 'Add new key' button.

Because I already have one ssh key, so I just need to upload the public key to the gitlab account.

ssh key upload key

Now I can connect to the gitlab repository and clone it to my local computer.

clone repo01 clone repo02

Since I'm pretty familar with the Vim key binding, I just use the vim editor that comes with the git installation.

First change the index page heading to create a test commit to see if git is working properly.

vim01 vim02

Use git add and git commit -m "message" commands to create initial commit. When commiting, git prompted me to enter my email and username. Follow the instruction text to set email and username for the current machine, then I can commit successfully.

commit01 commit02

Then use the git push command to push to the remote repo, making sure that everything is fine.

push index page

After that I just started working on the first week's documentation page, it looks a little bit ugly right now, it'll be fixed later.

files

Site Gerneration

I have built websites and worked with some of the static site generation tools before, and some of them is not suited for my taste and workflow in that they are often difficult to install, e.g. have a lot of dependencies or complicate runtime enviroments, and this also hurts performance and the iteration process, e.g. for a change in markup, the site needs to be rebuild and it sometimes takes up to tens of seconds when the site gets bigger. So for this time, I want to take a more minimalistic approch while preserving the flexibility that I want with the templating and markup functionalities.

Below is the shell script I made to generate the html pages from the markdown files. It's only 7 lines but it has the markdown rendering functionality and does variable subsitution in the html template, which are all the things I want.

(TODO: document details)

#!/bin/sh

set -e

gen() {
  filename=$(basename -s .md "$1")
  output="public/$filename.html"

  echo "$1-> $output"
  INPUT_FILE="$1" \
  BASE_NAME="$filename" \
    ./template_eval page.htmltemplate > $output
}

cd $(dirname $0)

if [ "$1" = "" ]
then find pages -name '*.md' | while read input
do gen "$input" &
done
else gen "$1"
fi