<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ShivB</title>
    <description>The latest articles on DEV Community by ShivB (@shivbhosale).</description>
    <link>https://dev.to/shivbhosale</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F257412%2F14eddba5-6208-4875-a6eb-6ba4b3214791.jpeg</url>
      <title>DEV Community: ShivB</title>
      <link>https://dev.to/shivbhosale</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shivbhosale"/>
    <language>en</language>
    <item>
      <title>Jupyter Notebooks as Blogs</title>
      <dc:creator>ShivB</dc:creator>
      <pubDate>Thu, 24 Oct 2019 20:17:44 +0000</pubDate>
      <link>https://dev.to/shivbhosale/jupyter-notebooks-as-blogs-26l1</link>
      <guid>https://dev.to/shivbhosale/jupyter-notebooks-as-blogs-26l1</guid>
      <description>&lt;p&gt;I've been a lurker for quite some time and finally decided to make my first post today for the sake of Hacktober Fest. I got into react around 3 weeks ago and quickly started enjoying it. I'm pretty late to the #hacktoberfest party but here is a fun two-day project that I did.&lt;/p&gt;

&lt;h3&gt;
  
  
  What did I make?
&lt;/h3&gt;

&lt;p&gt;It's a react component that can display a typical jupyter notebook from a file or URL like a blog post. That's pretty much it. It's still a work in progress tho.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FShivBhosale%2FReact-Jupyter-Viewer%2Fmaster%2Fstatic%2FSupportCoverImages.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FShivBhosale%2FReact-Jupyter-Viewer%2Fmaster%2Fstatic%2FSupportCoverImages.png" title="Mobile" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(cover image src: &lt;a href="https://notionpress.com/blog/wp-content/uploads/2018/06/Cover-design.png" rel="noopener noreferrer"&gt;https://notionpress.com/blog/wp-content/uploads/2018/06/Cover-design.png&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;I've seen a lot of technical blogs with this similar style of representing explanations along with code examples in an interleaved fashion so I thought that it'd be a sweet component to have in my own blog. &lt;/p&gt;

&lt;h3&gt;
  
  
  Why?
&lt;/h3&gt;

&lt;p&gt;The obvious question one might ask is, "why would you want to do that if there is already a '.ipynb' previewer provided by Jupyter or GitHub?". There were mainly 5 reasons that compelled me to make this component:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1) I was surprised to not find any react package that already did this! I needed a component that was easy to use. 
This is as easy as it gets:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./App.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;JupViewer&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./JupViewer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;App&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Component&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;App&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;JupViewer&lt;/span&gt;
          &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Jupyter as a Blog!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
          &lt;span class="nx"&gt;subtitle&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;I've always wanted to publish my jupyter notebooks as blogs. Finally I can.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
          &lt;span class="nx"&gt;coverImg&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://notionpress.com/blog/wp-content/uploads/2018/06/Cover-design.png&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://raw.githubusercontent.com/jakevdp/PythonDataScienceHandbook/master/notebooks/00.00-Preface.ipynb&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;2) I have too many jupyter notebooks with my programming notes, lying around, and I'm too lazy to boot a jupyter notebook for that. I use my jupyter notebooks for note-making or recording some interesting algorithm problems that I've solved. I needed something that was easily accessible.&lt;/li&gt;
&lt;li&gt;3) I wanted the ability to download the jupyter notebook as pdf to review my programming notes in free time. Github doesn't allow me to download jupyter notebooks as PDFs. Plus GitHub's mobile view of a jupyter notebook is not very pretty.
Looks decent on mobile too.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dark&lt;/th&gt;
&lt;th&gt;Light&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FShivBhosale%2FReact-Jupyter-Viewer%2Fmaster%2Fstatic%2FJupDarkMobile.png" title="Mobile" alt="alt text"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FShivBhosale%2FReact-Jupyter-Viewer%2Fmaster%2Fstatic%2FLightThemeMobile.png" title="Mobile" alt="alt text"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;4) I wanted to publish some of my programming explorations on my blog and I realized that the ability to embed a jupyter notebook as a blog works out really well as I only have to work with markdown and not care about CSS or HTML. 
Works pretty well with markdown.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FShivBhosale%2FReact-Jupyter-Viewer%2Fmaster%2Fstatic%2Fmarkdown_notebook.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FShivBhosale%2FReact-Jupyter-Viewer%2Fmaster%2Fstatic%2Fmarkdown_notebook.png" title="Mobile" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;5) I needed a dark theme. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Although the scope of this component, currently, is very specific to my needs, I hope that someone out there with needs similar to mine will be benefited by this. &lt;/p&gt;

&lt;p&gt;GitHub Link to Repo: &lt;a href="https://github.com/ShivBhosale/React-Jupyter-Viewer" rel="noopener noreferrer"&gt;https://github.com/ShivBhosale/React-Jupyter-Viewer&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Finally
&lt;/h3&gt;

&lt;p&gt;Your inputs and suggestions are welcome! &lt;/p&gt;

&lt;h3&gt;
  
  
  Edits
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;E1: Added updated features&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>hacktoberfest</category>
      <category>react</category>
      <category>jupyter</category>
      <category>reactnative</category>
    </item>
  </channel>
</rss>
