Skip to content

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

Closed
Abinash-bit wants to merge 1 commit intoOpenAstronomy:mainfrom
Abinash-bit:patch-3
Closed

Update grab.py such that code snippets is visible in the website.#95
Abinash-bit wants to merge 1 commit intoOpenAstronomy:mainfrom
Abinash-bit:patch-3

Conversation

@Abinash-bit
Copy link
Copy Markdown
Contributor

Preserving Code Snippets:

In the strip_tags() function, the <pre> and <code> tags are replaced with appropriate .. code-block:: and inline code formatting for reStructuredText (rst).

Handling Code in HTML Content:

In html2rst_allign_post() , any HTML <pre> and <code> blocks are converted to rst code blocks, ensuring that code snippets are properly formatted on the OA website.

Feed Parsing

The grab_student() function correctly fetches content from RSS feeds and processes either the full HTML content or summary based on the availability.

Before

Screenshot 2024-10-09 093100

After

Screenshot 2024-10-09 093036

So this fixes #53 .

Copy link
Copy Markdown
Member

@dpshelio dpshelio left a comment

Choose a reason for hiding this comment

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

Thanks! I've committed the bits that were just style changes on individual commits and create a new PR #96 for the changes for code snippets, they need a bit of work.

Comment thread grab.py
Comment on lines -76 to +103
dates.append(item_date)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This probably shouldn't be deleted. Otherwise, it won't be able to return the max of the date at the end of the function.

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.

When pulled from Medium, the articles do not show the code snippets embedded in them.

2 participants