{"action":"created","comment":{"url":"https://api.github.com/repos/bokeh/bokeh/pulls/comments/84733936","pull_request_review_id":5492889,"id":84733936,"diff_hunk":"@@ -1,3 +1,10 @@\n+\"\"\"\n+This is an example doc string\n+\n+* Foo\n+* Bar\n+\n+\"\"\"","path":"sphinx/source/docs/user_guide/examples/layout_vertical.py","position":7,"original_position":7,"commit_id":"71126466ecf3e32f13bf1ddd4b9f4eb8f8bcbdb5","original_commit_id":"71126466ecf3e32f13bf1ddd4b9f4eb8f8bcbdb5","user":{"login":"bryevdv","id":1078448,"avatar_url":"https://avatars.githubusercontent.com/u/1078448?v=3","gravatar_id":"","url":"https://api.github.com/users/bryevdv","html_url":"https://github.com/bryevdv","followers_url":"https://api.github.com/users/bryevdv/followers","following_url":"https://api.github.com/users/bryevdv/following{/other_user}","gists_url":"https://api.github.com/users/bryevdv/gists{/gist_id}","starred_url":"https://api.github.com/users/bryevdv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryevdv/subscriptions","organizations_url":"https://api.github.com/users/bryevdv/orgs","repos_url":"https://api.github.com/users/bryevdv/repos","events_url":"https://api.github.com/users/bryevdv/events{/privacy}","received_events_url":"https://api.github.com/users/bryevdv/received_events","type":"User","site_admin":false},"body":"Here's an example of a docstring that can be added to the top of an example. The RST content will *not* currently be renderered where the `bokeh-embed` happens, but *will* be rendered in the dedicated page that gets generated for this example. (Tho maybe that should be configurable in the directive). But this makes it super easy, e.g. to add indexing directives, so that all the examples can be indexed better. ","created_at":"2016-10-24T17:03:51Z","updated_at":"2016-10-24T17:03:51Z","html_url":"https://github.com/bokeh/bokeh/pull/5399#discussion_r84733936","pull_request_url":"https://api.github.com/repos/bokeh/bokeh/pulls/5399","_links":{"self":{"href":"https://api.github.com/repos/bokeh/bokeh/pulls/comments/84733936"},"html":{"href":"https://github.com/bokeh/bokeh/pull/5399#discussion_r84733936"},"pull_request":{"href":"https://api.github.com/repos/bokeh/bokeh/pulls/5399"}}},"pull_request":{"url":"https://api.github.com/repos/bokeh/bokeh/pulls/5399","id":90649919,"html_url":"https://github.com/bokeh/bokeh/pull/5399","diff_url":"https://github.com/bokeh/bokeh/pull/5399.diff","patch_url":"https://github.com/bokeh/bokeh/pull/5399.patch","issue_url":"https://api.github.com/repos/bokeh/bokeh/issues/5399","number":5399,"state":"open","locked":false,"title":"Improvements to bokeh-plot directive","user":{"login":"bryevdv","id":1078448,"avatar_url":"https://avatars.githubusercontent.com/u/1078448?v=3","gravatar_id":"","url":"https://api.github.com/users/bryevdv","html_url":"https://github.com/bryevdv","followers_url":"https://api.github.com/users/bryevdv/followers","following_url":"https://api.github.com/users/bryevdv/following{/other_user}","gists_url":"https://api.github.com/users/bryevdv/gists{/gist_id}","starred_url":"https://api.github.com/users/bryevdv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryevdv/subscriptions","organizations_url":"https://api.github.com/users/bryevdv/orgs","repos_url":"https://api.github.com/users/bryevdv/repos","events_url":"https://api.github.com/users/bryevdv/events{/privacy}","received_events_url":"https://api.github.com/users/bryevdv/received_events","type":"User","site_admin":false},"body":"[This is WIP]\r\n\r\nThe `bokeh-plot` directive in `bokeh.sphinxext` has been somewhat rickety for some time. This PR makes some cleanup and improvements:\r\n\r\n* re-uses code runner from server instead of customized redundant code runner and fragile custom monkeypatching\r\n* generates a dedicated page for every `.py` example, in addition to wherever the `bokeh-plot` embed is\r\n* initial docstrings in `.py` examples are rendered as ReST above the example in the dedicated page. Can be used to add additional indexing, information, etc. \r\n* Better sphinx build output\r\n* moves `source_examples` to just `examples` subdir (The vast majority of files changes just reflect this renaming)\r\n\r\nPlease note: This PR adds a custom `Parser` for `*.py` files. *Any* `.py` files in the Sphinx source dir will be treated as examples to run and build. They should really also always go in an `examples` subdirectory as a convention. \r\n\r\nA few issues to note:\r\n* The source read order had to be controlled, to read  all the `.py` files first. \r\n* except the \"extension\" examples, which are currently made last to avoid a giant build slowdown (see https://github.com/bokeh/bokeh/issues/5101#issuecomment-254684325)\r\n* currently assumes `curdoc().add_root` is called, but `show` and `save` are automatically patched to do this. Examples that create and manage their own `Document` don't work (there were only two) \r\n\r\nI've also had to disable the extensions widget example until https://github.com/bokeh/bokeh/issues/5315 is fixed \r\n\r\nFinal note: this stanza had to be added to the `server` block in the nginx config for the docs:\r\n```\r\n        location /scripts {\r\n            if ($http_referer ~* (.*)en\\/(.*?)\\/(.*)) {\r\n                set $v $2;\r\n                rewrite ^(.*)\\/(.*).js$ http://bokeh.pydata.org/en/$v/scripts/$2.js redirect;\r\n            }\r\n        }\r\n```\r\nThis allows the autoload scripts to have an \"absolute\" location `/scrips/bokeh-plot-foo.js` etc. but that is correctly prefixed by the version that it was referred from. There might be a better way to configure nginx (separate server block for every version?) that would handle this more automatically, without having to inspect $http_referer but this will do for now.","created_at":"2016-10-24T16:44:32Z","updated_at":"2016-10-24T17:03:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e4c674aec94678ce1bb468af2066ac2bab2b79fa","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/bokeh/bokeh/pulls/5399/commits","review_comments_url":"https://api.github.com/repos/bokeh/bokeh/pulls/5399/comments","review_comment_url":"https://api.github.com/repos/bokeh/bokeh/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bokeh/bokeh/issues/5399/comments","statuses_url":"https://api.github.com/repos/bokeh/bokeh/statuses/71126466ecf3e32f13bf1ddd4b9f4eb8f8bcbdb5","head":{"label":"bokeh:bryanv/sphinx_plot_directive","ref":"bryanv/sphinx_plot_directive","sha":"71126466ecf3e32f13bf1ddd4b9f4eb8f8bcbdb5","user":{"login":"bokeh","id":8440965,"avatar_url":"https://avatars.githubusercontent.com/u/8440965?v=3","gravatar_id":"","url":"https://api.github.com/users/bokeh","html_url":"https://github.com/bokeh","followers_url":"https://api.github.com/users/bokeh/followers","following_url":"https://api.github.com/users/bokeh/following{/other_user}","gists_url":"https://api.github.com/users/bokeh/gists{/gist_id}","starred_url":"https://api.github.com/users/bokeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bokeh/subscriptions","organizations_url":"https://api.github.com/users/bokeh/orgs","repos_url":"https://api.github.com/users/bokeh/repos","events_url":"https://api.github.com/users/bokeh/events{/privacy}","received_events_url":"https://api.github.com/users/bokeh/received_events","type":"Organization","site_admin":false},"repo":{"id":3834332,"name":"bokeh","full_name":"bokeh/bokeh","owner":{"login":"bokeh","id":8440965,"avatar_url":"https://avatars.githubusercontent.com/u/8440965?v=3","gravatar_id":"","url":"https://api.github.com/users/bokeh","html_url":"https://github.com/bokeh","followers_url":"https://api.github.com/users/bokeh/followers","following_url":"https://api.github.com/users/bokeh/following{/other_user}","gists_url":"https://api.github.com/users/bokeh/gists{/gist_id}","starred_url":"https://api.github.com/users/bokeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bokeh/subscriptions","organizations_url":"https://api.github.com/users/bokeh/orgs","repos_url":"https://api.github.com/users/bokeh/repos","events_url":"https://api.github.com/users/bokeh/events{/privacy}","received_events_url":"https://api.github.com/users/bokeh/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bokeh/bokeh","description":"Interactive Web Plotting for Python","fork":false,"url":"https://api.github.com/repos/bokeh/bokeh","forks_url":"https://api.github.com/repos/bokeh/bokeh/forks","keys_url":"https://api.github.com/repos/bokeh/bokeh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bokeh/bokeh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bokeh/bokeh/teams","hooks_url":"https://api.github.com/repos/bokeh/bokeh/hooks","issue_events_url":"https://api.github.com/repos/bokeh/bokeh/issues/events{/number}","events_url":"https://api.github.com/repos/bokeh/bokeh/events","assignees_url":"https://api.github.com/repos/bokeh/bokeh/assignees{/user}","branches_url":"https://api.github.com/repos/bokeh/bokeh/branches{/branch}","tags_url":"https://api.github.com/repos/bokeh/bokeh/tags","blobs_url":"https://api.github.com/repos/bokeh/bokeh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bokeh/bokeh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bokeh/bokeh/git/refs{/sha}","trees_url":"https://api.github.com/repos/bokeh/bokeh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bokeh/bokeh/statuses/{sha}","languages_url":"https://api.github.com/repos/bokeh/bokeh/languages","stargazers_url":"https://api.github.com/repos/bokeh/bokeh/stargazers","contributors_url":"https://api.github.com/repos/bokeh/bokeh/contributors","subscribers_url":"https://api.github.com/repos/bokeh/bokeh/subscribers","subscription_url":"https://api.github.com/repos/bokeh/bokeh/subscription","commits_url":"https://api.github.com/repos/bokeh/bokeh/commits{/sha}","git_commits_url":"https://api.github.com/repos/bokeh/bokeh/git/commits{/sha}","comments_url":"https://api.github.com/repos/bokeh/bokeh/comments{/number}","issue_comment_url":"https://api.github.com/repos/bokeh/bokeh/issues/comments{/number}","contents_url":"https://api.github.com/repos/bokeh/bokeh/contents/{+path}","compare_url":"https://api.github.com/repos/bokeh/bokeh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bokeh/bokeh/merges","archive_url":"https://api.github.com/repos/bokeh/bokeh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bokeh/bokeh/downloads","issues_url":"https://api.github.com/repos/bokeh/bokeh/issues{/number}","pulls_url":"https://api.github.com/repos/bokeh/bokeh/pulls{/number}","milestones_url":"https://api.github.com/repos/bokeh/bokeh/milestones{/number}","notifications_url":"https://api.github.com/repos/bokeh/bokeh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bokeh/bokeh/labels{/name}","releases_url":"https://api.github.com/repos/bokeh/bokeh/releases{/id}","deployments_url":"https://api.github.com/repos/bokeh/bokeh/deployments","created_at":"2012-03-26T15:40:01Z","updated_at":"2016-10-24T04:43:21Z","pushed_at":"2016-10-24T16:44:32Z","git_url":"git://github.com/bokeh/bokeh.git","ssh_url":"git@github.com:bokeh/bokeh.git","clone_url":"https://github.com/bokeh/bokeh.git","svn_url":"https://github.com/bokeh/bokeh","homepage":"http://bokeh.pydata.org/en/latest/","size":185424,"stargazers_count":4748,"watchers_count":4748,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1090,"mirror_url":null,"open_issues_count":762,"forks":1090,"open_issues":762,"watchers":4748,"default_branch":"master"}},"base":{"label":"bokeh:master","ref":"master","sha":"afcc47fcf24201a10e1b64317d42dc967d1490a5","user":{"login":"bokeh","id":8440965,"avatar_url":"https://avatars.githubusercontent.com/u/8440965?v=3","gravatar_id":"","url":"https://api.github.com/users/bokeh","html_url":"https://github.com/bokeh","followers_url":"https://api.github.com/users/bokeh/followers","following_url":"https://api.github.com/users/bokeh/following{/other_user}","gists_url":"https://api.github.com/users/bokeh/gists{/gist_id}","starred_url":"https://api.github.com/users/bokeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bokeh/subscriptions","organizations_url":"https://api.github.com/users/bokeh/orgs","repos_url":"https://api.github.com/users/bokeh/repos","events_url":"https://api.github.com/users/bokeh/events{/privacy}","received_events_url":"https://api.github.com/users/bokeh/received_events","type":"Organization","site_admin":false},"repo":{"id":3834332,"name":"bokeh","full_name":"bokeh/bokeh","owner":{"login":"bokeh","id":8440965,"avatar_url":"https://avatars.githubusercontent.com/u/8440965?v=3","gravatar_id":"","url":"https://api.github.com/users/bokeh","html_url":"https://github.com/bokeh","followers_url":"https://api.github.com/users/bokeh/followers","following_url":"https://api.github.com/users/bokeh/following{/other_user}","gists_url":"https://api.github.com/users/bokeh/gists{/gist_id}","starred_url":"https://api.github.com/users/bokeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bokeh/subscriptions","organizations_url":"https://api.github.com/users/bokeh/orgs","repos_url":"https://api.github.com/users/bokeh/repos","events_url":"https://api.github.com/users/bokeh/events{/privacy}","received_events_url":"https://api.github.com/users/bokeh/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bokeh/bokeh","description":"Interactive Web Plotting for Python","fork":false,"url":"https://api.github.com/repos/bokeh/bokeh","forks_url":"https://api.github.com/repos/bokeh/bokeh/forks","keys_url":"https://api.github.com/repos/bokeh/bokeh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bokeh/bokeh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bokeh/bokeh/teams","hooks_url":"https://api.github.com/repos/bokeh/bokeh/hooks","issue_events_url":"https://api.github.com/repos/bokeh/bokeh/issues/events{/number}","events_url":"https://api.github.com/repos/bokeh/bokeh/events","assignees_url":"https://api.github.com/repos/bokeh/bokeh/assignees{/user}","branches_url":"https://api.github.com/repos/bokeh/bokeh/branches{/branch}","tags_url":"https://api.github.com/repos/bokeh/bokeh/tags","blobs_url":"https://api.github.com/repos/bokeh/bokeh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bokeh/bokeh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bokeh/bokeh/git/refs{/sha}","trees_url":"https://api.github.com/repos/bokeh/bokeh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bokeh/bokeh/statuses/{sha}","languages_url":"https://api.github.com/repos/bokeh/bokeh/languages","stargazers_url":"https://api.github.com/repos/bokeh/bokeh/stargazers","contributors_url":"https://api.github.com/repos/bokeh/bokeh/contributors","subscribers_url":"https://api.github.com/repos/bokeh/bokeh/subscribers","subscription_url":"https://api.github.com/repos/bokeh/bokeh/subscription","commits_url":"https://api.github.com/repos/bokeh/bokeh/commits{/sha}","git_commits_url":"https://api.github.com/repos/bokeh/bokeh/git/commits{/sha}","comments_url":"https://api.github.com/repos/bokeh/bokeh/comments{/number}","issue_comment_url":"https://api.github.com/repos/bokeh/bokeh/issues/comments{/number}","contents_url":"https://api.github.com/repos/bokeh/bokeh/contents/{+path}","compare_url":"https://api.github.com/repos/bokeh/bokeh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bokeh/bokeh/merges","archive_url":"https://api.github.com/repos/bokeh/bokeh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bokeh/bokeh/downloads","issues_url":"https://api.github.com/repos/bokeh/bokeh/issues{/number}","pulls_url":"https://api.github.com/repos/bokeh/bokeh/pulls{/number}","milestones_url":"https://api.github.com/repos/bokeh/bokeh/milestones{/number}","notifications_url":"https://api.github.com/repos/bokeh/bokeh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bokeh/bokeh/labels{/name}","releases_url":"https://api.github.com/repos/bokeh/bokeh/releases{/id}","deployments_url":"https://api.github.com/repos/bokeh/bokeh/deployments","created_at":"2012-03-26T15:40:01Z","updated_at":"2016-10-24T04:43:21Z","pushed_at":"2016-10-24T16:44:32Z","git_url":"git://github.com/bokeh/bokeh.git","ssh_url":"git@github.com:bokeh/bokeh.git","clone_url":"https://github.com/bokeh/bokeh.git","svn_url":"https://github.com/bokeh/bokeh","homepage":"http://bokeh.pydata.org/en/latest/","size":185424,"stargazers_count":4748,"watchers_count":4748,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1090,"mirror_url":null,"open_issues_count":762,"forks":1090,"open_issues":762,"watchers":4748,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bokeh/bokeh/pulls/5399"},"html":{"href":"https://github.com/bokeh/bokeh/pull/5399"},"issue":{"href":"https://api.github.com/repos/bokeh/bokeh/issues/5399"},"comments":{"href":"https://api.github.com/repos/bokeh/bokeh/issues/5399/comments"},"review_comments":{"href":"https://api.github.com/repos/bokeh/bokeh/pulls/5399/comments"},"review_comment":{"href":"https://api.github.com/repos/bokeh/bokeh/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bokeh/bokeh/pulls/5399/commits"},"statuses":{"href":"https://api.github.com/repos/bokeh/bokeh/statuses/71126466ecf3e32f13bf1ddd4b9f4eb8f8bcbdb5"}}}}
{"actor":{"display_login":"bryevdv"}}