Skip to content

Update grab.py such that code snippets is visible in the website.#96

Open
dpshelio wants to merge 2 commits intomainfrom
95-1
Open

Update grab.py such that code snippets is visible in the website.#96
dpshelio wants to merge 2 commits intomainfrom
95-1

Conversation

@dpshelio
Copy link
Copy Markdown
Member

Only the code snippets changes from #95 (by @Abinash-bit)

Comment thread grab.py
stripped_html = s.get_data()

# Handle <pre> and <code> tags manually for code snippets
stripped_html = stripped_html.replace('<pre>', '\n.. code-block:: python\n\n ')
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't always be Python code. There are others using julia, c, ...

Also, wouldn't need to indent all the lines to the same column to work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants