# Working with markdown files

**URL:** <https://discourse.jupyter.org/t/working-with-markdown-files/5732>\
**Category:** Notebook\
**Created:** [August 26, 2020, 9:07am UTC](https://discourse.jupyter.org/t/working-with-markdown-files/5732 "2020-08-26T09:07:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexxx](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@alexxx](https://discourse.jupyter.org/u/alexxx)\
**Post date:** [August 26, 2020, 9:07am UTC](https://discourse.jupyter.org/t/working-with-markdown-files/5732/1 "2020-08-26T09:07:44Z")

</div>

Up to now I worked happily with **.ipynb** files, and I start to feel confortable with the Jupyter interface.  
So I thought about working with other kind of files inside this interface.  
As an example, I have a _lab book.txt_ file that I use as a diary of the work I daily perform.

There is a way to edit it into the Jupyter interface as a markdown?  
To explain me better: if I create a new **.txt** file, and under _Language_ I select _Markdown_, the interface simply highlights the header’s color and not much more.  
If instead in a **.ipynb** file I select a cell as markdown, the visualization capability is much more enhanced, up to the possibility to evaluate LaTeX code…

I know I could just work with a _lab book.ipynb_ file and set all the cells to Markdown, but I dislike the fact that I could work with it just inside Jupyter, due to the large amount of additional stuff the .ipynb include in the file - opening it inside a common text editor would be awkward…

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [August 26, 2020, 2:54pm UTC](https://discourse.jupyter.org/t/working-with-markdown-files/5732/2 "2020-08-26T14:54:00Z")

</div>

You could use [Jupytext](https://github.com/mwouts/jupytext#command-line-conversion) to convert your markdown to a notebook, work with it in Jupyter as you prefer, and then convert the edited notebook back to markdown for long-term storage and/or later opening it in a text editor for a quick edit.

---

<div class="post-metadata">

**Author:** ![alexxx](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@alexxx](https://discourse.jupyter.org/u/alexxx)\
**Post date:** [August 27, 2020, 6:39am UTC](https://discourse.jupyter.org/t/working-with-markdown-files/5732/3 "2020-08-27T06:39:51Z")

</div>

Yes, I discovered **Jupytext** a minute after posting my question (sorry), and started experimenting with it.  
It is not bad, but annoying in requiring that I now have to keep two files, one _.ipynb_ and one _.md_.

---

<div class="post-metadata">

**Author:** ![matthew.brett](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/matthew.brett/32/2204_2.png) [@matthew.brett](https://discourse.jupyter.org/u/matthew.brett)\
**Post date:** [August 27, 2020, 9:58am UTC](https://discourse.jupyter.org/t/working-with-markdown-files/5732/4 "2020-08-27T09:58:00Z")

</div>

Personally, I use the `.Rmd` format from Jupytext, and treat that as the source file. I can open this in Jupyter Notebook, and reload in the browser to get any edits I’ve done on the `.Rmd` file from my text editor. I treat any generated `.ipynb` as the rendered version of the notebook, and I often don’t store that in source control.

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [August 27, 2020, 2:13pm UTC](https://discourse.jupyter.org/t/working-with-markdown-files/5732/5 "2020-08-27T14:13:23Z")

</div>

To sort of rephrase what @matthew.brett said: You don’t have to keep both. You don’t have to do the pairing it talks about early in the usage section. The [command line approach](https://github.com/mwouts/jupytext#command-line-conversion) is a simpler way to go about it. I thought you wanted markdown in the end, and so I suggested you convert from markdown over to a notebook for editing and convert back to markdown after. The notebook format you can delete. You can write nice little bash scripts to handle those steps as you use it more.
