{"action":"created","issue":{"url":"https://api.github.com/repos/atom/atom/issues/6817","labels_url":"https://api.github.com/repos/atom/atom/issues/6817/labels{/name}","comments_url":"https://api.github.com/repos/atom/atom/issues/6817/comments","events_url":"https://api.github.com/repos/atom/atom/issues/6817/events","html_url":"https://github.com/atom/atom/issues/6817","id":76910012,"number":6817,"title":"Create a \"(pre)?viewer\" API","user":{"login":"lee-dohm","id":1038121,"avatar_url":"https://avatars.githubusercontent.com/u/1038121?v=3","gravatar_id":"","url":"https://api.github.com/users/lee-dohm","html_url":"https://github.com/lee-dohm","followers_url":"https://api.github.com/users/lee-dohm/followers","following_url":"https://api.github.com/users/lee-dohm/following{/other_user}","gists_url":"https://api.github.com/users/lee-dohm/gists{/gist_id}","starred_url":"https://api.github.com/users/lee-dohm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lee-dohm/subscriptions","organizations_url":"https://api.github.com/users/lee-dohm/orgs","repos_url":"https://api.github.com/users/lee-dohm/repos","events_url":"https://api.github.com/users/lee-dohm/events{/privacy}","received_events_url":"https://api.github.com/users/lee-dohm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/atom/atom/labels/enhancement","name":"enhancement","color":"bfd4f2"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-16T01:10:53Z","updated_at":"2015-05-20T19:54:03Z","closed_at":null,"body":"We already have Markdown and ASCIIDoc files that have their respective previewers for the rendered version of the document. We have viewers for images and there is a package for \"viewing\" audio files. And then I saw the [perldoc package](https://atom.io/packages/perldoc) today, which extracts the documentation from the current file, renders it and views it.\r\n\r\nWe should have one API with, most importantly, **one** keybinding to be used to view or preview *any* file type. So no matter what the active file is, if I hit <kbd>Ctrl+Alt+P</kbd> (for example) the registered viewer for that file type opens up in a new pane. If more than one viewer for that file type is registered, you can select the default one ... or press, for example, <kbd>Shift+Ctrl+Alt+P</kbd> to bring up a viewer list and select one.\r\n\r\n## Requirements\r\n\r\n> The key words \"MUST\", \"MUST NOT\", \"REQUIRED\", \"SHALL\", \"SHALL NOT\", \"SHOULD\", \"SHOULD NOT\", \"RECOMMENDED\",  \"MAY\", and \"OPTIONAL\" in this document are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt).\r\n\r\n* **MUST** allow packages to register viewers by scope name using the services API\r\n* **MUST** offer a command `file-viewer:open` to open the single (or default) registered viewer for the file in the active editor (or selected file in the tree-view)\r\n* **MUST** offer a command `file-viewer:listViewers` to open the list of registered viewers for the file in the active editor (or selected file in the tree-view)\r\n* **SHOULD** allow the single (or default) registered viewer to be opened for files that do not have an \"opener\" registered, such as image, archive or audio types\r\n* **OPTIONAL** offer a hex viewer as an option for all file types (see the [hex package](https://atom.io/packages/hex) for an awesome example)\r\n"},"comment":{"url":"https://api.github.com/repos/atom/atom/issues/comments/104015164","html_url":"https://github.com/atom/atom/issues/6817#issuecomment-104015164","issue_url":"https://api.github.com/repos/atom/atom/issues/6817","id":104015164,"user":{"login":"rgbkrk","id":836375,"avatar_url":"https://avatars.githubusercontent.com/u/836375?v=3","gravatar_id":"","url":"https://api.github.com/users/rgbkrk","html_url":"https://github.com/rgbkrk","followers_url":"https://api.github.com/users/rgbkrk/followers","following_url":"https://api.github.com/users/rgbkrk/following{/other_user}","gists_url":"https://api.github.com/users/rgbkrk/gists{/gist_id}","starred_url":"https://api.github.com/users/rgbkrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgbkrk/subscriptions","organizations_url":"https://api.github.com/users/rgbkrk/orgs","repos_url":"https://api.github.com/users/rgbkrk/repos","events_url":"https://api.github.com/users/rgbkrk/events{/privacy}","received_events_url":"https://api.github.com/users/rgbkrk/received_events","type":"User","site_admin":false},"created_at":"2015-05-20T19:54:03Z","updated_at":"2015-05-20T19:54:03Z","body":"With something like that, I'd be more happy with providing a viewer for IPython/Jupyter notebooks right inline (instead of just the language package add on).\r\n\r\nThe hex package is pretty great. Going beyond that, I'm still hoping for a solid hex editor within Atom."}}