Page MenuHomePhabricator

Render markdown / rst in PAWS public
Closed, ResolvedPublic

Description

Files uploaded to PAWS servers with .md / .rst extension should be parsed and rendered as HTML. Currently, .ipynb files are fully rendered, but .md and .rst files displayed as plain text.

This would need to be accomplished in https://github.com/toolforge/paws/blob/master/images/renderer/renderer.py or similar where paws-public URLs are rendered.

Event Timeline

Chicocvenancio moved this task from Backlog to Good first tasks on the PAWS board.
srishakatux changed the visibility from "Public (No Login Required)" to "Outreachy Mentors (Project)".Feb 26 2020, 9:17 PM
srishakatux added a subscriber: srishakatux.

(we'll open this task on March 5th - when the contribution period opens)

srishakatux changed the visibility from "Outreachy Mentors (Project)" to "Public (No Login Required)".Mar 5 2020, 6:24 PM

So here, we wish to create a function that renders .md / .rst files into HTML. Then, we need to map the extension with the required render function call in the "handlers" dictionary. Am I correct?

I'd like to work on this one! Could you please assign it to me?

Hey! I want to start working on this project, I hope it's not too late! I checked the GitHub repo and there seems to be no PRs against this issue. Can I take it up?

Hello @Aashnajena, this task is already assigned, but you could try to collaborate with @Karma2902 on it if they start working on it.

If anyone submits a PR, we can review it and work with it either way. If one PR comes in to add this functionality, someone else could do a PR to improve the code as well.

In this case, it needs to be a change in both the code and the renderer docker image as well if you need a new library that isn't in the standard install for python here https://github.com/toolforge/paws/blob/master/images/renderer/Dockerfile.

If you use the method in the links, you'll need to install the markdown and docutils libraries in the image before using it in the code. You can experiment with that by building the image locally and trying changes to the Dockerfile.

Hi @Bstorm , I made a PR regarding the issue.

Hi @Bstorm , I made a PR regarding the issue.

Thanks!! Really appreciated.

I just reviewed it in github, please see my comments and get back to us for any questions.

Hello @aborrero ! Could you please check the Zulip private chat? It's with regards to the final application.

Hello @aborrero ! Could you please check the Zulip private chat? It's with regards to the final application.

I believe I already replied :-) Feel free to contact if you have more questions.

I'll leave here my email too in case you need it: aborrero@wikimedia.org (although I recv zulip PMs in email anyway)

bd808 added a subscriber: bd808.

Removing claim on task. @Karma2902 has no activity on the associated pull request or here on Phabricator since April 2020.

dcaro removed dcaro as the assignee of this task.Oct 19 2021, 1:42 PM
dcaro added a subscriber: dcaro.

Is it known if the "public link" button previously worked in minikube paws? My version redirects to the same page. If I create the url manually from https://wikitech.wikimedia.org/wiki/PAWS/Getting_started_with_PAWS#Share:
http://hub.paws.local/User:MDipietro_%28WMF%29/Untitled.ipynb
gets a redirect to:
http://hub.paws.local/hub/User:MDipietro_%28WMF%29/Untitled.ipynb
with a 404
tried the same with http://hub.paws.local/User:MDipietro_(WMF)/Untitled.ipynb
Starting to look into how the redirects are happening, though any thoughts on if this is a minikube setup thing? It is possible that this is related to https://github.com/toolforge/paws/pull/90 (T291589) as that is what I'm building minikube off of, having been unsuccessful in getting it to build off the old jupyter. So possibly jupyter upgrade related?
https://jupyterhub.readthedocs.io/en/stable/getting-started/faq.html has some notes, but so far I get much the same (though sometimes with a 404 in a frame with a paws header)

Looks like the public link can work by editing /etc/hosts to include more overrides:

192.168.49.2 public.paws.wmcloud.org
192.168.49.2 paws.wmcloud.org
192.168.49.2 hub.paws.wmcloud.org

for instance (ip from minikube ip)

Thank you @Chicocvenancio for the pointer