-
Notifications
You must be signed in to change notification settings - Fork 35
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
Backwards compatible HTML generation #43
Comments
👍 ! This reminds me of an old tool that I used back in 2002, called HTMLgen (I think it doesn't exist anymore, the new htmlgen package is something else). It allowed for really easy creation of HTML documents programmatically, this is some of my old code from my dissertation, creating pages with auto-generated images from numerical simulations: import HTMLgen as html
doc = html.SimpleDocument(title=fname)
doc.append(html.Heading(1,fname,align='center'))
# now make a table with the images
tab = html.Table('Slices along %s direction' % dir,
column1_align='center',cell_align='center')
tab.body = []
col = 1; l1 = []; l2 = []
for img in images:
l1.append(html.Image(img[1]))
l2.append(img[0])
if col%3:
col += 1
else:
#print 'finished row' # dbg
tab.body.extend([l1,l2])
col = 1; l1 = []; l2 = []
doc.append(tab)
doc.write(os.path.join(html_dir,'index.html')) I haven't needed to do something quite like this lately, but last I'd looked, there really wasn't anything as convenient as this. Looking at the vdom examples feels very natural and reminds me of this code. It would be great to have not only the interactive in-notebook capabilities, but also, where possible, plain html output. I suspect this would be useful not only for classic nb but also possibly in nbviewer/nbconvert/sphinx contexts. |
ps - interesting bit of archeology, HTMLgen is still online. Since they highlight that it reuires python 1.5 or later, I'm going to bet it may not have seen much maintenance lately :) |
I might take a shot at this :) @rgbkrk what do you think about taking a dependency on lxml2 for this? It has wheels for all major platforms so should be ok? If not I'll try make a pure non-dependent version. |
That seems sensible. Amusingly I've gone the other direction as well using |
As discussed over in jupyterlab/jupyterlab#3200, for use in older notebook interfaces, it would be valuable if vdom exposed an easy way of generating HTML.
The text was updated successfully, but these errors were encountered: