1. Creating an OPE Textbook#
Creating an OPE textbook Documentation
1.1. Steps#
Create an empty repsitory
Download OPEEFFORT tools repository
cd tools-main
Generate an SSH key, using the email associated with your github account
ssh-keygen -t rsa -b 4096 -C 'your_email@bu.edu'
Use this command to look at the content of your key, then copy and add the SSH key to your associated github account: Settings > SSH and GPG keys
cat ~/.ssh/config/id_rsa.pub
Make sure you are able to use github commands on your linux machine, if not run the commands below
sudo apt update
sudo apt install git
Within the tools directory, clone the empty repository you created with the command below: fill in the username and repository name
git clone git@github.com:your_github_username/your_github_empty_repo.git
Install the OPE Command Line Tool by running the install.sh file in the tools directory as shown below
./install.sh
Paste the outputted export path line in your command-line
Verify installation by running the ope command
ope
Run this command (including your own project repo name and repo url) to create a new project using the empty repository URL as shown below You can find your repo’s SSH URL when you the green <> Code button on your github repo This will create subdirectories of books, containers, and content in your github repo
ope new_project your_project_name your_repo_url
Create a new book in your repository, replacing your_book_name
ope new_book your_book_name
Move to your book’s content directory, edit the configure file to change book settings (title, author, logo, URL to publish to, and jupyter extensions enabling)
If you want to change your textbook’s logo on the top left corner of your book: change the logo .png name and place a new .png in the content directory
nano your_book_name
If your are looking for which line and column an error is on, you can use the command below to be able to see the line and column numbers
nano -c your_book_name
In order to see all the changes you are making in these files you must publish the book using the command below, there is a few reasons this command may not run yet
make pub
To do this, make sure you are in your_book_name directory, you should be able to see your Makefile in this directory (you can verify the pub target exists at the top of the Makefile, when you open it)
If you are receiving an error message regarding ghp-import, install the ghp-import command which is used to publish content to GitHub Pages
pip install ghp-import
To avoid more errors and make ghp-import globally accessible – make sure to add ‘ghp-import’s binary path to your system’s path by modifying your shell (.bashrc or .zshrc) as shown below
export PATH= '/usr/local/bin:$PATH'
Reload your terminal to apply changes
source ~/.bashrc
Verify command installation by running the command below
ghp-import --version