In the lab this week, I co-operate with an amazing classmate and you guys can check out his talented work at Andre
I would say the coding part of this lab is not that heavy and challenging like I think it would be. At first, I visit Andre's repo and file an issue to request implement markdown features for the project which support h1 and h2 tags. Then, I fork and clone his project to my local machine and create a new branch to work on.
For the implementation, I will check for the file extension name using
path.extname(file) === ".txt"
path.extname(file) === ".md"
and for the file which have the extension end by ".md" I will use replace() to wrap the line in an corresponding html tags
const html = data .split(/[\r?\n\r?\n]/g) .map((line) => line .replace (/^## (.*$)/gim, '<h2>$1</h2>') .replace(/^# (.*$)/gim, '<h1>$1</h1>') .replace(/(^[a-z](.*)$)/gim, '<p>$1</p>') /* replace any line starting with # and a space with <h1> surrounding itself. replace any line starting with an alphabetical character followed by 0 or more of anything with <p> surrounding itself. */ ).join('\n'); //this makes the content a string rather than array.
Then after update his README.md file I decide to create a pull request and it has been accepted with a few more comments on thing that I could fix it which are only small details
This time I was a bit wiser to choose people which using the same programming language and start a bit earlier than I did last week. But having to review and work on somebody logic is something different. Luckily, Andre and me keep communicate back and forth which make our lab a lot easier. We did spend time to explain our logic and working to solve the problem together so for me it is a pleasure to work with Andre.
I used to work on many Android application project and I used to use Github desktop to host my code on Github. But whenever I try to did something with Git, every programming source that I could find always solve the problem using Git command line and for me Git command line was way too scary to start with. After last week and this week lecture I feeling like I'm gonna go for Git command line from now on since I understand about the staging area and looking git as a camera capturing snapshots of our project really help me to visualize the procedure. One week and already feeling better and a bit more comfortable to work with Git