{"action":"created","issue":{"url":"https://api.github.com/repos/jupyter/notebook/issues/2485","repository_url":"https://api.github.com/repos/jupyter/notebook","labels_url":"https://api.github.com/repos/jupyter/notebook/issues/2485/labels{/name}","comments_url":"https://api.github.com/repos/jupyter/notebook/issues/2485/comments","events_url":"https://api.github.com/repos/jupyter/notebook/issues/2485/events","html_url":"https://github.com/jupyter/notebook/issues/2485","id":226790506,"node_id":"MDU6SXNzdWUyMjY3OTA1MDY=","number":2485,"title":"Render .md files in Jupyter","user":{"login":"lspvic","id":4335658,"node_id":"MDQ6VXNlcjQzMzU2NTg=","avatar_url":"https://avatars3.githubusercontent.com/u/4335658?v=4","gravatar_id":"","url":"https://api.github.com/users/lspvic","html_url":"https://github.com/lspvic","followers_url":"https://api.github.com/users/lspvic/followers","following_url":"https://api.github.com/users/lspvic/following{/other_user}","gists_url":"https://api.github.com/users/lspvic/gists{/gist_id}","starred_url":"https://api.github.com/users/lspvic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lspvic/subscriptions","organizations_url":"https://api.github.com/users/lspvic/orgs","repos_url":"https://api.github.com/users/lspvic/repos","events_url":"https://api.github.com/users/lspvic/events{/privacy}","received_events_url":"https://api.github.com/users/lspvic/received_events","type":"User","site_admin":false},"labels":[{"id":197515308,"node_id":"MDU6TGFiZWwxOTc1MTUzMDg=","url":"https://api.github.com/repos/jupyter/notebook/labels/type:Enhancement","name":"type:Enhancement","color":"fbca04","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/jupyter/notebook/milestones/15","html_url":"https://github.com/jupyter/notebook/milestone/15","labels_url":"https://api.github.com/repos/jupyter/notebook/milestones/15/labels","id":2090632,"node_id":"MDk6TWlsZXN0b25lMjA5MDYzMg==","number":15,"title":"JupyterLab","description":"","creator":{"login":"gnestor","id":512354,"node_id":"MDQ6VXNlcjUxMjM1NA==","avatar_url":"https://avatars3.githubusercontent.com/u/512354?v=4","gravatar_id":"","url":"https://api.github.com/users/gnestor","html_url":"https://github.com/gnestor","followers_url":"https://api.github.com/users/gnestor/followers","following_url":"https://api.github.com/users/gnestor/following{/other_user}","gists_url":"https://api.github.com/users/gnestor/gists{/gist_id}","starred_url":"https://api.github.com/users/gnestor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnestor/subscriptions","organizations_url":"https://api.github.com/users/gnestor/orgs","repos_url":"https://api.github.com/users/gnestor/repos","events_url":"https://api.github.com/users/gnestor/events{/privacy}","received_events_url":"https://api.github.com/users/gnestor/received_events","type":"User","site_admin":false},"open_issues":16,"closed_issues":6,"state":"open","created_at":"2016-10-24T21:08:49Z","updated_at":"2018-04-16T15:58:11Z","due_on":null,"closed_at":null},"comments":14,"created_at":"2017-05-06T17:49:25Z","updated_at":"2018-06-08T19:58:51Z","closed_at":"2017-10-12T22:51:02Z","author_association":"NONE","body":"Are there any ways to open .md markdown files in jupyter? As there are many .ipynb notebooks cloned from git repositories containing many .md files like README.md. It is very  inconvenient to read these .md files. Currently, clicking the .md in tree view will open the source of the markdown, not the rendered view.\r\n\r\nI notice ViewHandler in v5.0 is introduced. Is there a .md ViewHandler to render markdown files? thanks"},"comment":{"url":"https://api.github.com/repos/jupyter/notebook/issues/comments/395873239","html_url":"https://github.com/jupyter/notebook/issues/2485#issuecomment-395873239","issue_url":"https://api.github.com/repos/jupyter/notebook/issues/2485","id":395873239,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTg3MzIzOQ==","user":{"login":"zen-gineer","id":23371802,"node_id":"MDQ6VXNlcjIzMzcxODAy","avatar_url":"https://avatars1.githubusercontent.com/u/23371802?v=4","gravatar_id":"","url":"https://api.github.com/users/zen-gineer","html_url":"https://github.com/zen-gineer","followers_url":"https://api.github.com/users/zen-gineer/followers","following_url":"https://api.github.com/users/zen-gineer/following{/other_user}","gists_url":"https://api.github.com/users/zen-gineer/gists{/gist_id}","starred_url":"https://api.github.com/users/zen-gineer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zen-gineer/subscriptions","organizations_url":"https://api.github.com/users/zen-gineer/orgs","repos_url":"https://api.github.com/users/zen-gineer/repos","events_url":"https://api.github.com/users/zen-gineer/events{/privacy}","received_events_url":"https://api.github.com/users/zen-gineer/received_events","type":"User","site_admin":false},"created_at":"2018-06-08T19:58:51Z","updated_at":"2018-06-08T19:58:51Z","author_association":"NONE","body":"This code alternatively loops through all files in a given directory and merges all ipynb and readme files into a single ipynb file. \r\n\r\n`#---- Merge with readme ---- ---- ---- ---- ---- --- ---- ---- ---- ----\r\nimport nbformat; import os; import re\r\nmerged = None; oneTime = False; readmeLines = ''; resources = ''\r\nfolderToWalkThrough = os.path.join('.','06-Python-APIs')\r\nfor root, dirs, files in os.walk(folderToWalkThrough, topdown=True):\r\n    for name in files: #Only care about the files\r\n        #print (os.path.join(root,name))\r\n        if re.search('\\.md', name):\r\n            with open (os.path.join(root,name)) as readme:\r\n                readmeLines = readme.read()\r\n            \r\n        if re.search('\\.ipynb', name): #Make sure its a ipython notebook file\r\n            with open(os.path.join(root, name) ) as f:\r\n                nb = nbformat.read(f, as_version=4)\r\n            if merged == None:\r\n                merged = nb\r\n            else:\r\n                if readmeLines: \r\n                    newCell = nbformat.v4.new_markdown_cell(str(readmeLines))\r\n                    merged.cells.insert(-1,newCell)\r\n                    readmeLines = ''\r\n                \r\n                    path = os.path.join(root,name)\r\n                    resources = path.split('Unsolved')[0] if re.search('Unsolved', root) else ''\r\n                    #print(resources)\r\n                    resources = path.split('Solved')[0] if re.search('Solved', root) and not(resources) else resources\r\n                    #print(resources)\r\n                    resources = os.path.join(resources, 'Resources')\r\n                    resources = os.path.join(root,'Resources') if not(os.path.isdir(resources)) else resources\r\n                    #print(resources)\r\n                    if os.path.isdir(resources):\r\n                        csvCode= 'import os\\nimport re\\nimport pandas as pd'\r\n                        csvCode+='\\ncsvData=dict()\\nfor root, dirs, files in os.walk(\\'{0}\\', topdown=True):'.format(resources)\r\n                        csvCode+='\\n    for name in files: #Only care about the files\\n        if re.search(\\'.csv\\',name):'\r\n                        csvCode+='\\n            csvData[name.split(\\'.\\')[0]] = pd.read_csv(open(os.path.join(root,name)))'\r\n                        csvCode+='\\ncsvData'\r\n                        newCodeCell = nbformat.v4.new_code_cell(csvCode)\r\n                        merged.cells.insert(-1,newCodeCell)\r\n                \r\n                merged.cells.insert(-1, nbformat.v4.new_markdown_cell(str(os.path.join(root, name))))\r\n                merged.cells.extend(nb.cells)\r\n\r\nnewMergedCells = nbformat.v4.new_notebook()\r\nnewMergedCells.metadata.name = folderToWalkThrough.replace('.','').replace('/','_').lstrip('_')\r\nnbformat.write(merged, '{0}_Merged.ipynb'.format(newMergedCells.metadata.name))`"}}
{"actor":{"display_login":"zen-gineer"}}