<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" >

  <title>Erik L. Arneson — Writer and Software Developer</title>
  <subtitle>Erik L. Arneson is a freelance writer and software developer with WordPress experience. He is located in Portland, Oregon.</subtitle>
  <generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator>
  <link href="https://arnesonium.com/feeds/jupyter.xml" rel="self" type="application/atom+xml" />
  <link href="https://arnesonium.com/" rel="alternate" type="text/html" />
  <updated>2026-06-18T15:03:10+00:00</updated>
  <id>https://arnesonium.com/feeds/jupyter.xml</id>
  <author>
    <name>Erik L. Arneson</name>
  </author>
      <entry>
        
        <title>Writing and Reviewing Jupyter Notebooks</title>
        <author>
          <name>Erik L. Arneson</name>
        </author>        
        <link href="https://arnesonium.com/2023/05/reviewing-jupyter-process" rel="alternate" type="text/html" title="Writing and Reviewing Jupyter Notebooks" />
        <updated>2023-05-18T00:00:00+00:00</updated>
        <id>https://arnesonium.com/2023/05/reviewing-jupyter-process</id>
          <category term="jupyter" />
        
          <category term="writing" />
        
          <category term="emacs" />
        
          <category term="pandoc" />
        <content type="html" xml:base="https://arnesonium.com/2023/05/reviewing-jupyter-process">&lt;p&gt;A recent project involves delivering a finished product as a collection of &lt;a href=&quot;https://jupyter.org/&quot;&gt;Jupyter Notebooks&lt;/a&gt;. This process involves using Emacs for writing, Git for version control, and a slightly tricky process for enabling non-Jupyter, non-Emacs users to perform document review.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;Writing—just like programming—ideally includes a review process before anything is delivered to the client. Even first drafts need at least two readers before delivery. I’ve previously discussed how &lt;a href=&quot;https://arnesonium.com/2022/10/org-mode-to-docx-pipeline&quot;&gt;I use Org Mode and Pandoc to deliver DOCX files&lt;/a&gt;, and DOCX or ODF files unfortunately remain the easiest way to track changes and edits among word processor users.&lt;/p&gt;

&lt;p&gt;Since Jupyter Notebooks are basically JSON documents, the best way to keep track of changes and revisions is using some kind of version control. &lt;a href=&quot;https://towardsdatascience.com/how-to-use-git-github-with-jupyter-notebook-7144d6577b44&quot;&gt;Here is one process using Git and GitHub.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When my notebook files are ready for review, converting them to DOCX files is pretty straightforward.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;First, I use the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jupyter&lt;/code&gt; command line tool to convert to Markdown, like this:&lt;/p&gt;

    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;jupyter nbconvert --to markdown *.ipynb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Next, I use &lt;a href=&quot;https://pandoc.org/&quot;&gt;Pandoc&lt;/a&gt; to convert to DOCX using a reference link.&lt;/p&gt;

    &lt;pre&gt;&lt;code class=&quot;language-fish&quot;&gt;for file in *.md
    pandoc --reference-doc $path_to_refdoc -o $file.docx $file
end
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;renaming-files-with-dired&quot;&gt;Renaming files with Dired&lt;/h2&gt;

&lt;p&gt;At this point, I needed to rename all of the DOCX files and move them to the proper shared folder, so my reviewer could get to them and know what’s going on. We have a &lt;a href=&quot;https://www.computerworld.com/article/2833158/4-rules-for-naming-your-files.html&quot;&gt;naming format for filenames&lt;/a&gt; that helps us track project and versions, so all of the files needed to have at least a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;v1&lt;/code&gt; in them.&lt;/p&gt;

&lt;p&gt;Emacs has a file manager called Dired, which contains powerful features that allow you to modify directory contents just like any other buffer. I now had a bunch of files that ended in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.md.docx&lt;/code&gt; that needed to instead end in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-v1.docx&lt;/code&gt;. Here is the process I used to easily rename them.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;In Emacs, use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;M-x dired&lt;/code&gt; to open the directory.&lt;/li&gt;
  &lt;li&gt;Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;C-x C-q&lt;/code&gt; to run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dired-toggle-read-only&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;M-%&lt;/code&gt; to run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;query-replace&lt;/code&gt;, and replace &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.md.docx&lt;/code&gt; with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-v1.docx&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Finish “writing” the directory with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;C-c C-c&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All done! It was nice and simple. The DOCX files were finally properly named and ready for review.&lt;/p&gt;</content>
      </entry>
    
</feed>
