Skip to content

Commit

Permalink
Transform blockquotes
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed May 16, 2020
1 parent e835f68 commit 3a851b3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions package.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,20 @@
tag.name = "tt"
[x.unwrap() if x.name else x for x in tag.contents]

# Reformat code literal blocks
for tag in contents.findAll("div", class_="highlight-default"):
tag.div.unwrap()
tag.pre.unwrap()
tag.name = "pre"
tag["class"] = "literal-block"
tag.string = "\n" + tag.text.strip() + "\n"

# Transform blockquotes
for tag in contents.findAll("blockquote"):
tag.div.unwrap()
if tag.p:
tag.p.unwrap()

# Remove Sphinx Header
contents.h1.decompose()

Expand Down

0 comments on commit 3a851b3

Please sign in to comment.