DEV Community


Posted on

Week 3: Getting comfort and a bit exciting about open source

In the lab this week, I co-operate with an amazing classmate and you guys can check out his talented work at Andre

Making changes to Andre repo

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"
Enter fullscreen mode Exit fullscreen mode
path.extname(file) === ".md"
Enter fullscreen mode Exit fullscreen mode

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
          .map((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.
Enter fullscreen mode Exit fullscreen mode

Then after update his 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

The challenging

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.

Git command line version is not that scary

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

Top comments (0)