Hacker News new | ask | show | jobs
by ggoss 2554 days ago
Thanks for the note. Looks good!

Blog post generation from Jupyter Notebooks is definitely something that I plan to add to mine. Hopefully `nbconvert` and my Jinja2 templates get me 90% of the way there; having yours as a reference will be useful if anything really trips me up.

Taking a look at your blog post, don't forget that Bootstrap has a lot of classes built in that make prettifying things like tables really easy [1]. In Sitegen, I apply a few Bootstrap classes to all tables in the BeautifulSoup object like so:

  for table in soup_body.find_all('table'):
      table['class'] = 'table table-striped table-sm table-hover'
  return soup_body
Refer to the `add_table_tags` function here [2] to see what I did directly.

[1] https://getbootstrap.com/docs/4.3/content/tables/

[2] https://github.com/ggoss/sitegen/blob/master/sitegen/md_proc...