portfolios_exemple2/themes/academia-hugo/exampleSite/content/post/jupyter/index.md
2021-12-31 12:44:26 +01:00

3.3 KiB

title subtitle summary authors tags categories date featured draft image projects gallery_item
Display Jupyter Notebooks with academia Learn how to blog in academia using Jupyter notebooks Learn how to blog in academia using Jupyter notebooks
admin
2019-02-05T00:00:00Z false false
caption focal_point preview_only
Image credit: [**Unsplash**](https://unsplash.com/photos/CpkOjOcXdUY) false
album caption image
gallery Default theme-default.png
album caption image
gallery Ocean theme-ocean.png
album caption image
gallery Forest theme-forest.png
album caption image
gallery Dark theme-dark.png
album caption image
gallery Apogee theme-apogee.png
album caption image
gallery 1950s theme-1950s.png
album caption image
gallery Coffee theme with Playfair font theme-coffee-playfair.png
album caption image
gallery Strawberry theme-strawberry.png
from IPython.core.display import Image
Image('https://www.python.org/static/community_logos/python-logo-master-v3-TM-flattened.png')

png

print("Welcome to academia!")
Welcome to academia!

Install Python and Jupyter

Install Anaconda which includes Python 3 and Jupyter notebook.

Otherwise, for advanced users, install Jupyter notebook with pip3 install jupyter.

Create a new blog post as usual

Run the following commands in your Terminal, substituting <MY_WEBSITE_FOLDER> and my-post with the file path to your academia website folder and a name for your blog post (without spaces), respectively:

cd <MY_WEBSITE_FOLDER>
hugo new  --kind post post/my-post
cd <MY_WEBSITE_FOLDER>/content/post/my-post/

Create or upload a Jupyter notebook

Run the following command to start Jupyter within your new blog post folder. Then create a new Jupyter notebook (New > Python Notebook) or upload a notebook.

jupyter notebook

Convert notebook to Markdown

jupyter nbconvert Untitled.ipynb --to markdown --NbConvertApp.output_files_dir=.

# Copy the contents of Untitled.md and append it to index.md:
cat Untitled.md | tee -a index.md

# Remove the temporary file:
rm Untitled.md

Edit your post metadata

Open index.md in your text editor and edit the title etc. in the front matter according to your preference.

To set a featured image, place an image named featured into your post's folder.

For other tips, such as using math, see the guide on writing content with academia.