nbdev-tutorial: nbdev_build_docs & Github Pages not working properly - python

Good evening,
following the nbdev tutorial (Klick) from scratch i could not get the hosted documentation to look nice. Also the link to an exisiting module is missing.
Github pages output:
Github repo that stores this project:
(Klick)
The weird thing is that everything works just fine (no errors), still the rendered Github page looks much nicer in the tutorial.

Related

How to make the output appear in github using jupyter notebook

I am using Github to create a portfolio. I wrote some code in Google Colab and uploaded it to Github. But I can't see the output. I'd like to see the output appear, so the person who sees my portfolio would understand what I have done.
Is there any way to show the output in github?
Colab:
Github:
nbviewer, provided by the Jupyter community, offers many types of rich output rendering and interactivity for previously run notebooks.
nbviewer has several full-featured abilities GitHub doesn't and presents it in a nice way that's not overwhelming for those not as tech savvy as GitHub users. You can point it at any GitHub or gist, or even where the notebook code is online at a URL. The link to the view can be shared with others.
I like to think of the Github notebook viewer as a quick preview.

Convert PDF to HTML without losing any format

I'm developing a Python Flask webapp and I'm trying to convert some user uploaded pdfs to nicely formatted HTML, like the HTML that is being produced when you display a pdf inside an iframe.
I tried several things so far:
the pdfminer.six library, produced messy HTML,
trying to grab the produced HTML, when rendering a PDF with pdf.js, which is apparently hidden in a Shadow DOM with no access to its inner HTML
finally I came across pdf2htmlEX (https://github.com/pdf2htmlEX/pdf2htmlEX) which produced exactly what I wanted.
Locally, this solution worked great, however in the production state (Heroku) I was unable to install it correctly. The project is deprecated and the documentation is limited and terrible. The problem has something to do with broken dependencies.
So, how to convert PDFs to HTML effectively without losing any format using Python or any other tool?
Thanks a lots.
if anyone is willing to help me getting the pdf2htmlEX to work on heroku, leave a comment and I will post more details in a different post
This is not going to be trivial. But I'll give some pointers.
You need an app.json in which you define your buildpacks.
https://devcenter.heroku.com/articles/app-json-schema#buildpacks
If this project is available via apt it's going to be easy. You just use the Heroku's Apt buildpack define an Aptfile that says which packages it needs to install. Example
Then it installs it automatically and you are done.
If it is not available as a package you will need to create your own buildpack.
https://devcenter.heroku.com/articles/buildpack-api
Example used here.
Another solution is to dockerize your project and execute it as a docker container.

Hosting Jupyter Notebook Python App on a Webpage

I've made a simple python GUI application using ipywidgets, ipycanvas, and numpy. I made the program on Jupyter notebook as an ipynb file. I would now like to take my application and put it on a webpage. What is the best way to take this Jupyter notebook app and host it on the web?
I've looked a bit into Binder and Django, but I can't seem to find enough resources or documentation on the net to help me learn how to do this.
If you already have it working as a Jupyter notebook (.ipynb file), I'd suggest that sticking with that as the core item for now. I'd suggest getting running via MyBinder.org based on either this example repo or this one. Or a combination of the two.
This video is recent and a good reference for many of the steps of setting up a repo with your content.
You essentially make a copy of the Binder templates under your control and then edit them to have your content. You adapt the URLs that trigger launches so that when you share the link, they launch a session via MyBInder.org with your content. Most often the steps can be performed right in the Github browser-based interface without you needing to use git or work locally. If you have something fancier you need, you may have to move to using more complex configuration file set-ups and those may necessitate some use of git and local editing.
If you hit some technical road blocks, post your questions here using the 'questions' category as suggested in this post about 'Debugging your Binder'.
Maybe once the basics of sharing the notebook or appmode version are working with your own content, you may want to check out Voila or some of the other ways you can share a jupyter notebook-based app discussed here.
Jupyter itself is made with Tornado web framework.
There are many bindings to another popular web frameworks.
I once tried on it, and I found that pyramid-notebook is easy to use.
For a quick build I recommend Binder. This is how you can quickly set up Binder with voila:
Checkout this Git Repo: https://github.com/lschmiddey/book_recommender_voila
In combination with this blogpost: https://lschmiddey.github.io/fastpages_/2020/09/28/Build-binder-app-Part4.html

Sphinx docs displaying locally but not at URL when pushed to GitHub

I generated Python docs using Sphinx using make html. When I opened index.html in my browser the docs displayed as expected and all links worked as expected.
I then committed all docs and pushed to a branch in GitHub.
When I access the url https://<my company>.github.io/<my repo>/ the page displays but the CSS isn't working and some of the links do not work. Does anybody know why this might be?
The problem was that some files were missing. After reading this I added an empty .nojekyll which resolved the issue.

Default template is broken on new Mezzanine install.

I had a little trouble even getting Mezzanine to install and now that I have the css seems broken. I have looked all over the web and can't seem to find out where my mistake is. The instructions I followed are here:
https://www.a2hosting.com/kb/developer-corner/python/installing-and-configuring-mezzanine-on-shared-hosting
My site is as at the following link:
http://wakeofthetranscendent.a2hosted.com/
I really am not even sure of what code to post because I have no idea where the problem is. I was able to get it running using runserver on my laptop but as my a2 account is shared I don't have that option.

Categories