Introduction to Cultural Analytics & Python
This repository hosts the course materials for "Introduction to Cultural Analytics: Data, Computation & Culture," an undergraduate course taught at Cornell in the spring of 2020 and 2021. It includes an online textbook designed for the class, Introduction to Cultural Analytics & Python, which demonstrates how Python can be used to study cultural materials such as song lyrics, short stories, newspaper articles, tweets, Reddit posts, and film screenplays.
Course website and textbook: https://melaniewalsh.github.io/Intro-Cultural-Analytics/
Jupyter Book Overview and Repository Structure
The HTML files are currently hidden in this branch of the GitHub repository, but you can find them in the gh-pages branch.
Below I will briefly explain the structure of this repository and some important Jupyter Book features.
/bookcontains all the materials that generate the Jupyter Book
/bindercontains materials that set up the virtual Binder environment for running Jupyter notebooks in the cloud
The configuration file
/book/_config.yml is where I establish key features of the book, such as the title, logo, and whether users can open the Jupyter notebook files in the cloud.
Table of Contents file
The table of contents file
/book/_toc.yml establishes the table of contents structure on the left-hand side of the web page.
To include a Markdown or Jupyter notebook file in the table of contents, you include the flag
- file: followed by the file path without the file extension, as shown below:
- file: welcome - part: How To chapters: - file: How-To-Interact-With-This-Book title: Interact With This Book - part: The Course chapters: - file: course-schedule title: Course Schedule - file: syllabus title: Course Syllabus - part: The Book chapters: - file: Command-Line/The-Command-Line - file: Python/Python sections: - file: Python/Installation - file: Python/How-to-Use-Jupyter-Notebooks
If you want the title in the table of contents to be different from the title in the notebook, you can also specify a different
title below the
- file: flag. Finally, you can include section headers within the table of contents by using the
- part flag or designate nested chapters by including
The Jupyter notebook files can be found in directories named for chapters:
Data can be can be found in
Texts can be can be found in
Custom CSS styling can be found in
/book/_static/custom.css (it's a bit messy at the moment, sorry)
How to Build and Publish Jupyter Book with GitHub Pages
jupyter-book build /bookor
jb build /book, where
/bookis the directory with your Jupyter notebook files
A fully-rendered HTML version of the book will be built in
/book/_build/html/. You can push these HTML files to a GitHub pages website by pushing them to the
gh-pages branch of a GitHub repository.
One easy way to push to the
gh-pages branch is to install
ghp-import -n -p -f book/_build/html
Learn More About Jupyter Book
You can learn more about Jupyter Book by exploring the documentation: https://jupyterbook.org/intro.html
This book is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) License. The code is licensed under a GNU General Public License v3.0.