Giter Club home page Giter Club logo

Comments (7)

n-riesco avatar n-riesco commented on June 26, 2024

To help me understand, please, could you give me an example of what you're trying to do?

Have you seen this documentation? It includes an example to inject HTML into an output cell.

from ijavascript.

n-riesco avatar n-riesco commented on June 26, 2024

Not sure whether this may help you: a kernel spec may include custom.css and custom.js. See IPEP25.

from ijavascript.

holyjak avatar holyjak commented on June 26, 2024

Thanks for the quick response!

I don't know how it is possible but I have overlooked the documentation. I guess the $$html$$ could perhaps work though CSS styles should be inside <head>, which this doesn't enable.

What I am trying to achieve: I have this notebook that I use with RISE to produce live presentation slides. I would like to center the 2nd line, i.e. "Jakub Holý - Iterate conference 8/2015". So I want to have either

.my-centered { text-align: center }

// And later, on the slide/cell:
<p class="my-centered">Jakub Holý - Iterate conference 8/2015</p>

(using a class rather then style so that I can use it on multiple elements) or just this

.text_cell_render p  { text-align: center }

The question is where to put it.

Regarding custom.(css|js), I think those would only be useful if they could be in the notebook directory, i.e. for that notebook, not all.

Thank you!

from ijavascript.

n-riesco avatar n-riesco commented on June 26, 2024

This should do the trick using IJavascript:

$$html$$ = '<script>document.styleSheets[0].insertRule(".rendered_html .my-centered { text-align: center; }", 0);</script>';

But I would also ask this question on the Jupyter mailing list. There may be a recommended way to add a custom.css to a notebook.

from ijavascript.

n-riesco avatar n-riesco commented on June 26, 2024

This message from the mailing list may be relevant:

https://groups.google.com/d/msg/jupyter/Hak-Xjwro3k/_NznabngCwAJ

from ijavascript.

n-riesco avatar n-riesco commented on June 26, 2024

@jakubholynet I'm closing this issue. If the comments above don't help, please, feel free to reopen this issue.

from ijavascript.

holyjak avatar holyjak commented on June 26, 2024

Thank you!

from ijavascript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.