DEV Community

Cover image for Open source lets us help each other and improve together
Jason
Jason

Posted on

Open source lets us help each other and improve together

Lab2 help us to practice contributing and submitting pull requests to other students' Static Site Generator (SSG). I picked up a few experience that share with you.

what I did

I have a new partner in lab2, and my partner's SSG has different style with most students who author code in Python. The code has lots of details and it looks like a library. My code reference as many library as possible, so it is very different from partner's style. While understanding partner's code, I also found two bugs. The issue 1 is about "pass a bool type as a string to the o_tag function ", and it has fixed. The issue 2 and it is about "the filename should not replace the title name". I didn't change the structure of the code and changed it as little as possible. First, I create a new function named "get_md_body(file, out). This function will read the .md file content and change it to .html file. The function style is I imitate the style of partner's code, which is very similar to the function obtaining .txt file. In order to author this function, I studied "re" library, Lambda expressions and Regular expression. Second, I also author if statement in the main class, so the programming can distinguish .txt and .md files. Third, I create a Pull Request to my partner.

What problems did I have

  • I need to improve the speed of understanding code, so I need to read a lot of code.
  • Need to learn more basic knowledge about git.

What did I learn

  • I studied "re" library;
  • Lambda expressions;
  • Regular expression;
  • how to fork, clone, branch a project;
  • how to create a Pull Request;

What would I do differently next time

I will optimize the program structure and increase compatibility in the future

Top comments (0)