DEV Community

gus
gus

Posted on

Collab bro??

This week I worked on Joshua Li's SSG, LennahSSG again. I added support for markdown files, with the ability to distinguish and generate appropriate HTML tags for bold and italics.

I logged an issue outlining the broad strokes of what I wanted to do and then dove in.

I started by creating two functions, boldify and italicize, and fleshed it out from there. I added a check when the program receives input (i.e an -i argument is used) to determine if the cli argument refers to a .txt file, .md file, or a directory, and assign a value to a variable from there. Once the readText() function is called, it uses that variable to determine if it should apply the markdown logic. If the file is a .md, and markdown tags are found in a line, the appropriate markdown functions are called until all markdown on that line is converted to HTML tags.

I then created a pull request with the relevant changes. After some back and forth hammering out some finer points of the logic like redundant if statements, as well as making the <title> tag only applicable for .txt file processing, Joshua accepted my changes and merged the pull request.

On my end, Joshua requested to add support for #h1 elements. He got to work and submitted a pull request, after which I requested that he check for both .md and .txt extensions when processing folders, to ensure both get processed appropriately. I noticed some redundant if statements as well which I advised him to merge. He made the requested changes and I merged his pull request.

Overall the process went pretty smoothly. It's been a cool experience but I don't feel I can be completely impartial in my assessment of open source just yet because it's been in the context of schoolwork where deadlines and marks are at play, but I can definitely see how this can be a useful tool so far. I'm still getting used to the way github presents changes as well, and ended up referring to the .cpp without all the highlights and visual aids often to make sense of it.
Looking forward to getting more practice and continuing to work with the community to make dope stuff.

Top comments (0)