GithubHelp home page GithubHelp logo

nbconvert's Introduction

nbconvert

Installation

Simply install WP Pusher by downloading and installing the package from a zip file then add my wordpress plugin from my git repo! You do this by adding the uri into the git plugin installer (ghandic/nbconvert)

How it works

Simply add a shortcode and a url to the notebook file into your page editor on wordpress and voila

[nbconvert url="https://github.com/ghandic/confluenceapi/blob/master/examples/Updating%20a%20confluence%20page.ipynb"]

PHP then sends the url to an nbviewer API that will convert the ipynb file to html

Example of how it renders on Wordpress default theme

nbconvert's People

Contributors

ghandic avatar rasmuserik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nbconvert's Issues

Strange issue: Check it out on github Last updated: 01/01/1970 00:00:00

Hello,

I followed the exact steps required to install (first install WP Pusher, then pull the repo ghandic/nbcovert, then I used the test shortcode.

All I get is:

Check it out on github Last updated: 01/01/1970 00:00:00

With an empty box and no content.

If I load the URL directly, I see the correct script so it leads me to believe it is an error between the plugin and GitHub.

I am using WordPress 5.5 and the latest version of this plugin (1.0 according to WP Pusher). I have tried using the shortcode in many different ways and also tried the classic editor.

Gist support

I love the work! I notice that, trying to use a Gist (https://gist.github.com/alexwhittemore/fb5913c8146ab441e795a13f9ec8d7ea) rather than a commit in a proper repo, I get no output (the frame renders, but no notebook). Digging into nbconvert.php, it looks like you're parsing the URL methodically to extract info about the repo, user, and so on in order to make sure you're always pulling the latest version of the file. It seems to me like that would architecturally preclude the plugin working for Gists?

Additionally, on that Gist page, I see a pretty handy looking "embed" option. It ends up creating a scrolling iframe, which I don't much love, but it's certainly easy and pretty. I suppose another disadvantage vs nbconvert is that it's not auto-updating.

So perhaps for my use-case (I don't want to serve out of a proper repo), either this embedded gist scheme, or raw HTML manually exported from Jupyter Notebook might be more appropriate solutions?

The generated table corsses the post border.

First of all, thank you for your great work!!! The plugins works great almost in every situation but tables.

I have an ipynb with a wide width table. This table wont collapse inside the wordpress post.

the pic below shows how it looks like.


20200806092256

ipynb: link

wp_enqueue_style was called incorrectly.

I get the following warning when using the plugin:
Notice: wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information.

Uncaught Error: Class 'DOMDocument' not found in nbconvert.php on line 119

Hi Andy,

I would love to use the plugin. Unfortunately, there seems to be an issue. I am using WordPress 5.3 and PHP 7.0.33. When saving a post with the example, I get an error. When I open the post, there is the following error-code:

Uncaught Error: Class 'DOMDocument' not found in /var/www/html/wordpress/wp-content/plugins/nbconvert/nbconvert.php on line 119

nbconvert_getHTMLByID()
wp-content/plugins/nbconvert/nbconvert.php:88
nbconvert_function()
wp-content/plugins/nbconvert/nbconvert.php:13
nbconvert_handler()
wp-includes/shortcodes.php:325
do_shortcode_tag()
preg_replace_callback()
wp-includes/shortcodes.php:199
do_shortcode()
wp-includes/class-wp-hook.php:288
apply_filters()
wp-includes/plugin.php:206
apply_filters()
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php:1550
prepare_item_for_response()
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php:472
get_item()
wp-includes/rest-api/class-wp-rest-server.php:946
dispatch()
wp-includes/rest-api.php:429
rest_do_request()
wp-includes/rest-api.php:1539
rest_preload_api_request()
array_reduce()
wp-admin/edit-form-blocks.php:77
include()
wp-admin/post.php:179

Any solution?

Thanks!

Lost

I am sure this is painfully obviuos, but where does this happen? "You do this by adding the uri into the git plugin installer (ghandic/nbconvert)" Not seeing in in wordpress after uploading the WP Pusher plugin, and don't see it on github, and dont see it as an option for add plugin either.

Update: As usual after asking i figured it out, however, i have a wrap issue with results. Check out. I will look at my css, but may need some help.

Resolved: For what its worth, i modified the .dataframe css to the following to prevent data bleed into the margins. Probably more than needed, but once i got it working i stopped touching it.

div.notebook div.nbconvert div .dataframe {
border:0px dashed;
display: block;
overflow-x: auto;
height: 500px;
overflow-y: auto;
white-space: nowrap;
}

https://sqlshep.com/?p=1174

Shep

rendering latex?

Hello, first of all I'd like to thank you very, very much for this plugin!

Your solution is the only one that seems to work for properly integrating notebooks into blog posts.

But now I'm a bit stuck. I see that all latex math equations are not rendered, please see here:
https://thedatafrog.com/the-logistic-regression/
All maths appear between dollars, as I typed them.

From the code, you're using nbviewer to render the notebook, and I checked that on https://nbviewer.jupyter.org/github/cbernet/maldives/blob/master/one_neuron/logistic_regression_1d.ipynb
the equations are rendered properly.

Would you have an idea of what could be tried to enable the rendering of latex equations?

Any help or pointer would be greatly appreciated, and I will send you a PR if I manage to sort this out.

Cheers!
Colin

License incompatibility with GPL

A quick reminder that MIT is not compatible with WP's GPL license. Just came across it when I wanted to reference your code in my plugin.

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.