-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Readme viewer #5299
Readme viewer #5299
Conversation
Can I get a review on this? |
Hi @toonijn - Sorry for the delay. I don't have front-end expertise but thought I'd build your branch and try it out from a functional perspective. However, when I build/run your branch, I see the following... Is there anything I need to enable to get this to display correctly? As a general comment on the PR, I'm wondering why we'd constrain markdown views to just readme.md files and not all markdown files in general? |
The markdown preview is added to the tree view. So editing markdown files is still the same. If you save the file you are editing in your screenshot, then go back to the filetree, you should see in the directory of the file the preview of that readme.md. It's like the readme-file in a github repo. Can you confirm this? |
Hmm. I had started with a README.md file (from GH), but I just tried creating a new text, renamed How is preview enabled? Is this handled by some extension? |
@kevin-bates It should be default enabled. It should show up in your screenshot. Just a sanity check: did you run |
Thanks for that
I've tried chrome, firefox and safari, regular and private windows. Since I'm unable to provide a code review anyway, I'm not sure how useful my being able to run this really is - although it would allow me to provide a functional review. |
First of all, thank you for taking the time to try it out. I have reproduced the issue on Windows. On my linux everything was working as expected. The problem was that windows does not specify the mimetype of a file (I removed a check that only displayed text/markdown mimetypes). @kevin-bates a functional review would be very useful feedback. Looking forward to your comments! |
Cool - with this last commit, I'm able to preview readme.md files in various directories under my (notebook) root. I'm running this on a mac, so it must have a similar issue that Windows had. This does seem useful. I'm just not sure if it's too specific. Also, if I have |
The reason why I wanted to implement this is to use it in our university's JupyterHub server. If a student logs in to their server and uses Jupyter for the first time, it would be very helpful to post a small specific quick-start guide. But I can see multiple uses:
I agree for single-user situations it maybe isn't that much of an advantage. But in the multi-user case it would be much appreciated. You bring up a good point, about |
I agree with your use cases - especially those in more collaborative or replicated (edu) environments. You're right about the file type determination, suffix tends to be the first order of determination. When I have both readme.md and readme.txt present, it seems like the markdown file takes precedence. This seems good but I don't know if that's just dumb luck. However, if there's a way to force markdowns to take priority - that would be good. We need to avoid random behavior. If I delete the previewed file, the preview remains until the next refresh even though the tree reflects the current state. Is there a way to hook the preview into the tree refresh? |
detect deletion of files
Thanks for the update Toon! Unfortunately, this will need a review performed by one of the front-end-knowledgable maintainers at this point. I've requested reviews based on the suggestions GH provides. |
Hi @kevin-bates, thanks for your contribution! Unfortunately, I'm not available to review right now |
We'll discuss this PR at the Notebook Meeting this Wednesday (30 minutes before the JupyterLab meeting). This is really great work, @toonijn, and greatly appreciated! Thank you for devoting a significant amount of time to this. This is a pretty significant chunk of code and it adds a "new feature" in Jupyter Notebook. We've been avoiding accepting "new features" since we don't have any people available to maintain + review these kinds of additions (most of our dev time has been focused on JupyterLab; but the messaging around this hasn't exactly been clear). We'll try to give this a solid review on Wednesday, but I can't promise that we'll merge this in the end. We're stretched a bit too thin to support many new features. In the meantime, you can, of course, offer this as a notebook extension. Either way, I'll update you on Wednesday with our decision here. Thanks, again! |
FYI, we have similar features implemented as an extension: https://github.com/NII-cloud-operation/Jupyter-LC_index . This one puts README.md at the bottom and also puts README.svg on the top. One unresolved drawback is that this extension trusts SVG blindly. |
Thanks for considering. Small note: a large part of the changed files is a minor refactor to bring all markdown-renders in the same code. (notebook/static/base/js/markdown.js) |
@toonijn Thanks for your work here. Let me give you an update—we met last week to discuss the current state of jupyter/notebook and various PRs adding new features (this PR was at the top of the list). In short, our plan is to not accept new features into the core classic Jupyter Notebook frontend. Unfortunately, we just don't have the bandwidth on our core development team to support new features here. Instead, we are going to encourage contributors to create Notebook extensions when they want to offer new frontend features to the community. We are working on adding this message to the README, issue templates and PR templates from this point forward. For this PR, there are two things to discuss:
I really appreciate all the work you put in here, @toonijn. I'm sorry we couldn't have a more positive message here. |
I'm closing this for now, but let me know if you're still interested in submitted the code duplication fix. I'm happy to review that work in another PR. Thanks! |
Any updates of this very useful piece of work becoming available as an extension ? :) |
@fbe555 |
A first draft to add a view of the readme in a directory. As suggested in #2485 (comment).