Baby's First Open Source Contribution
Tags: opensource, firstyearincode, ruby, tdd
Published: 2019-11-25 04:16:14

<h1><center>GitPitch Tags for Dev.to</center></h1>
*********************************************************

I have been revisiting my previous DEV posts to update content and build a consistent format between each post. Through that process -and as I developed additional ideas for what I want to achieve with my DEV journal- I began to see the need for something to help accomplish two objectives...

1. I wanted an extremely simple method to update a single post with more content, preferably through Github. 
2. I wanted a method to embed a slideshow in a post, but something with fewer steps than using SlideShare or Speakerdeck. 

After some quick research, I landed on GitPitch as the perfect option. With a GITPITCH.md markdown file in a GitHub repo, a presentation is instantly available through a GitPitch URL! 

Check out this example from GitPitch! 

{% gitpitch https://gitpitch.com/gitpitch/in-60-seconds#/ %}

Fortunately, DEV.to had Liquid tags for SlideShare and Speakerdeck but not GitPitch. I thought it was a perfect time and task for my first open source contribution. Given my existing knowledge of Ruby and ERB, it was simple enough to get a grasp of the process without getting tied up with researching the work itself. 

I submitted a pull request to DEV.to explaining what I was hoping to achieve. With the approval, DEV.to provided a document to guide the creation of a Liquid tag. I hadn't come across any need for Liquid before and I was happy to learn a little about it through the process. I was on my way once I forked and cloned the DEV.to platform to run locally on my machine while I built the tag. 

*********************************************************
<h1><center> Let's get started! </center></h1>
*********************************************************

I created an RSpec file to keep myself on the right track and meet the pull request requirements.

{% gist https://gist.github.com/JaredHarbison/651dee9d009608fb22ffd88d4c03c401 file=DEV.to||GitPitchContribution||gitpitch_tag_spec.rb %}

Next I built the tag methods. I used other Liquid tag source code for a little direction, but still found opportunities to write new code and refactor things down to a reasonable minimum. 

{% gist https://gist.github.com/JaredHarbison/651dee9d009608fb22ffd88d4c03c401 file=DEV.to||GitPitchContribution||gitpitch_tag.rb %}

I included a partial file to a simple iframe embed of a gitpitch tag. I looked at other partials to determine a reasonably consistent height for the iframe. Checkout the example below from GitPitch!

{% gist https://gist.github.com/JaredHarbison/651dee9d009608fb22ffd88d4c03c401 file=DEV.to||GitPitchContribution||_gitpitch.html.erb %}

My last step was an extremely brief addition to the DEV Community Editor Guide! Peak inside the Gist below for usage instructions for the tag or the Editor Guide itself. 

{% gist https://gist.github.com/JaredHarbison/651dee9d009608fb22ffd88d4c03c401 file=DEV.to||GitPitchContribution||_editor_guide_text.html.erb %}

It was a lot of fun to contribute and I can't wait to start using the GitPitch tag! I realize now this fits pretty squarely within how I found software engineering- with a "need it? make it!" mentality. 

*********************************************************
<h1><center> That's all folks! </center></h1>