Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@A91y
Copy link
Member

@A91y A91y commented Dec 29, 2023

Addressed in #6

@Mr-Sunglasses
Copy link
Member

Hey @A91y , Awseome can you add line numbers to the response in web and also when we are using curl for the response on terminal it is giving HTML response, it should be plain text response.

Screenshot 2023-12-29 at 1 31 59 PM Screenshot 2023-12-29 at 1 33 55 PM

Copy link
Member

@Mr-Sunglasses Mr-Sunglasses left a comment

Choose a reason for hiding this comment

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

Please refer the to the previous comment for changes.

@A91y
Copy link
Member Author

A91y commented Dec 29, 2023

Right now, I am using pygments, I think it will be difficult to get proper curl output with that, so I'll try something different then.

@Mr-Sunglasses
Copy link
Member

Screenshot 2023-12-29 at 7 26 40 PM

@A91y can we get the pasteview something like this?

@A91y
Copy link
Member Author

A91y commented Dec 29, 2023

Screenshot 2023-12-29 at 7 26 40 PM

@A91y can we get the pasteview something like this?

Yeah! I am trying to find a better option than pygments as it has that curl issue too, by that time I am updating web.html and /web endpoints to support extension as few minor bugs are still there to fix.

@A91y
Copy link
Member Author

A91y commented Dec 29, 2023

@Mr-Sunglasses I am trying https://prismjs.com/ out. If successful, then it will work like a charm, but rendering just plain text while doing curl is still a mystery to me.

Edit: plain text while doing curl is solved in da809bc

@A91y
Copy link
Member Author

A91y commented Dec 29, 2023

@Mr-Sunglasses
image
Got these result after adding some custom css to the HTML Response. Changes can be made further by changing css styling and changing the style in HtmlFormatter.

@A91y A91y requested a review from Mr-Sunglasses December 29, 2023 19:35
@app.get("/paste/{uuid}")
async def get_paste_data(uuid):
path = f"data/{uuid}"
async def get_paste_data(uuid: str, user_agent: Optional[str] = Header(None)) -> Any:
Copy link
Member

Choose a reason for hiding this comment

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

instead of adding typing hits Any we can use Response as both PlainTextResponse and HTMLResponse inherits from class Response

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.

Add file extension support and Syntax highlighting in the response text in web according to the file extension.

2 participants