Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notebook Cells and Output seem to look the same #6

Open
PhilipMay opened this issue Mar 12, 2021 · 1 comment
Open

Notebook Cells and Output seem to look the same #6

PhilipMay opened this issue Mar 12, 2021 · 1 comment

Comments

@PhilipMay
Copy link

Hi,
the code cells of jupyter notebooks and the outputs seem to look the same.
See here: https://nb2hugo.netlify.app/post/blogging-with-jupyter-notebooks-and-hugo/
Maybe you could add an css class attribute to the output cells so they can be selected by css?

Thanks
Philip

@Etrama
Copy link

Etrama commented Jun 30, 2024

I had the same issue so I wrote some CSS to handle it. I use hugo with the papermod theme. Here are links to my gists, they also have instructions on where to place them within your hugo theme:

  1. Dataframe Renderer
  2. Differentiate code cells and output cells

Once you add these files to the right location (under your hugo theme: theme/your-extra-folder-if-applicable/assets/css/extended/. You can copy and paste both the files above in that location, with the appropriate changes made for your folder.

You also need to add an extra line in your hugo config to make this. I use a config.yml file so I added:
customCSS: ["themes/papermod-my-personal-version/assets/css/extended/df_render.css",
"themes/papermod-my-personal-version/assets/css/extended/jupyter_cell_output_render.css"]

You'll need to adapt the path in the customCSS to reflect your folder as well, same as the initial one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants