{"action":"created","comment":{"url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/pulls/comments/29476848","id":29476848,"diff_hunk":"@@ -14,17 +13,9 @@ class ChartBlockMacro < Extensions::BlockMacroProcessor\n   named :chart\n \n   def process(parent, target, attrs)\n+    engine = (attrs.key? 'engine') ? attrs['engine'].downcase : 'c3js'\n     raw_data = PlainRubyCSV.read(File.join parent.document.base_dir, attrs['data-uri'])","path":"lib/chart-block-macro/extension.rb","position":11,"original_position":11,"commit_id":"e7841dac225f234037b835da78f321672565d819","original_commit_id":"e7841dac225f234037b835da78f321672565d819","user":{"login":"mojavelinux","id":79351,"avatar_url":"https://avatars.githubusercontent.com/u/79351?v=3","gravatar_id":"","url":"https://api.github.com/users/mojavelinux","html_url":"https://github.com/mojavelinux","followers_url":"https://api.github.com/users/mojavelinux/followers","following_url":"https://api.github.com/users/mojavelinux/following{/other_user}","gists_url":"https://api.github.com/users/mojavelinux/gists{/gist_id}","starred_url":"https://api.github.com/users/mojavelinux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mojavelinux/subscriptions","organizations_url":"https://api.github.com/users/mojavelinux/orgs","repos_url":"https://api.github.com/users/mojavelinux/repos","events_url":"https://api.github.com/users/mojavelinux/events{/privacy}","received_events_url":"https://api.github.com/users/mojavelinux/received_events","type":"User","site_admin":false},"body":"Could you change this so that the data is read from the target and the type is the first positional attribute? Perhaps you should also follow the block extension by making engine the second positional attribute.\r\n\r\n```\r\n...\r\nname_positional_attributes 'type', 'engine'\r\n...\r\n```\r\n\r\nand\r\n\r\n```\r\n...\r\nraw_data = PlainRubyCSV.read(File.join parent.document.base_dir, target)\r\nhtml = ChartBackend.process engine, attrs['type'], raw_data\r\n...\r\n```\r\n\r\nHowever, to resolve the target, you should use the file resolution built in to Asciidoctor core.\r\n\r\n```\r\ndata_path = parent.normalize_asset_path(target, 'target')\r\nraw_data = parent.read_asset(data_path, warn_on_failure: true, normalize: true)\r\n```\r\n\r\nWe probably need a cleaner API in core for handling this because it still doesn't account for reading data from URIs. Perhaps file an issue to get this cleaned up with this extension as a reference.","created_at":"2015-04-30T22:30:34Z","updated_at":"2015-04-30T22:30:34Z","html_url":"https://github.com/asciidoctor/asciidoctor-extensions-lab/pull/32#discussion_r29476848","pull_request_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/pulls/32","_links":{"self":{"href":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/pulls/comments/29476848"},"html":{"href":"https://github.com/asciidoctor/asciidoctor-extensions-lab/pull/32#discussion_r29476848"},"pull_request":{"href":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/pulls/32"}}},"pull_request":{"url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/pulls/32","id":26797649,"html_url":"https://github.com/asciidoctor/asciidoctor-extensions-lab/pull/32","diff_url":"https://github.com/asciidoctor/asciidoctor-extensions-lab/pull/32.diff","patch_url":"https://github.com/asciidoctor/asciidoctor-extensions-lab/pull/32.patch","issue_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/issues/32","number":32,"state":"open","locked":false,"title":"Add Chartist.js backend to the chart macro extension","user":{"login":"Mogztter","id":333276,"avatar_url":"https://avatars.githubusercontent.com/u/333276?v=3","gravatar_id":"","url":"https://api.github.com/users/Mogztter","html_url":"https://github.com/Mogztter","followers_url":"https://api.github.com/users/Mogztter/followers","following_url":"https://api.github.com/users/Mogztter/following{/other_user}","gists_url":"https://api.github.com/users/Mogztter/gists{/gist_id}","starred_url":"https://api.github.com/users/Mogztter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mogztter/subscriptions","organizations_url":"https://api.github.com/users/Mogztter/orgs","repos_url":"https://api.github.com/users/Mogztter/repos","events_url":"https://api.github.com/users/Mogztter/events{/privacy}","received_events_url":"https://api.github.com/users/Mogztter/received_events","type":"User","site_admin":false},"body":"Resolves #24","created_at":"2015-01-04T18:02:43Z","updated_at":"2015-04-30T22:30:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"485dc29e1016dc051ffbf0c0385fb4ef6fa867dc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/pulls/32/commits","review_comments_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/pulls/32/comments","review_comment_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/issues/32/comments","statuses_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/statuses/e7841dac225f234037b835da78f321672565d819","head":{"label":"Mogztter:issue-24","ref":"issue-24","sha":"e7841dac225f234037b835da78f321672565d819","user":{"login":"Mogztter","id":333276,"avatar_url":"https://avatars.githubusercontent.com/u/333276?v=3","gravatar_id":"","url":"https://api.github.com/users/Mogztter","html_url":"https://github.com/Mogztter","followers_url":"https://api.github.com/users/Mogztter/followers","following_url":"https://api.github.com/users/Mogztter/following{/other_user}","gists_url":"https://api.github.com/users/Mogztter/gists{/gist_id}","starred_url":"https://api.github.com/users/Mogztter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mogztter/subscriptions","organizations_url":"https://api.github.com/users/Mogztter/orgs","repos_url":"https://api.github.com/users/Mogztter/repos","events_url":"https://api.github.com/users/Mogztter/events{/privacy}","received_events_url":"https://api.github.com/users/Mogztter/received_events","type":"User","site_admin":false},"repo":{"id":22389587,"name":"asciidoctor-extensions-lab","full_name":"Mogztter/asciidoctor-extensions-lab","owner":{"login":"Mogztter","id":333276,"avatar_url":"https://avatars.githubusercontent.com/u/333276?v=3","gravatar_id":"","url":"https://api.github.com/users/Mogztter","html_url":"https://github.com/Mogztter","followers_url":"https://api.github.com/users/Mogztter/followers","following_url":"https://api.github.com/users/Mogztter/following{/other_user}","gists_url":"https://api.github.com/users/Mogztter/gists{/gist_id}","starred_url":"https://api.github.com/users/Mogztter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mogztter/subscriptions","organizations_url":"https://api.github.com/users/Mogztter/orgs","repos_url":"https://api.github.com/users/Mogztter/repos","events_url":"https://api.github.com/users/Mogztter/events{/privacy}","received_events_url":"https://api.github.com/users/Mogztter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Mogztter/asciidoctor-extensions-lab","description":"A lab and incubator for Asciidoctor extensions.","fork":true,"url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab","forks_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/forks","keys_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/teams","hooks_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/hooks","issue_events_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/issues/events{/number}","events_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/events","assignees_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/assignees{/user}","branches_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/branches{/branch}","tags_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/tags","blobs_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/statuses/{sha}","languages_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/languages","stargazers_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/stargazers","contributors_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/contributors","subscribers_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/subscribers","subscription_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/subscription","commits_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/contents/{+path}","compare_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/merges","archive_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/downloads","issues_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/issues{/number}","pulls_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/pulls{/number}","milestones_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/milestones{/number}","notifications_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/labels{/name}","releases_url":"https://api.github.com/repos/Mogztter/asciidoctor-extensions-lab/releases{/id}","created_at":"2014-07-29T17:51:58Z","updated_at":"2015-03-29T09:48:23Z","pushed_at":"2015-04-11T15:18:27Z","git_url":"git://github.com/Mogztter/asciidoctor-extensions-lab.git","ssh_url":"git@github.com:Mogztter/asciidoctor-extensions-lab.git","clone_url":"https://github.com/Mogztter/asciidoctor-extensions-lab.git","svn_url":"https://github.com/Mogztter/asciidoctor-extensions-lab","homepage":null,"size":415,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"asciidoctor:master","ref":"master","sha":"4c6d08e8ce81be9ef18320d94cad38a565311dec","user":{"login":"asciidoctor","id":3137042,"avatar_url":"https://avatars.githubusercontent.com/u/3137042?v=3","gravatar_id":"","url":"https://api.github.com/users/asciidoctor","html_url":"https://github.com/asciidoctor","followers_url":"https://api.github.com/users/asciidoctor/followers","following_url":"https://api.github.com/users/asciidoctor/following{/other_user}","gists_url":"https://api.github.com/users/asciidoctor/gists{/gist_id}","starred_url":"https://api.github.com/users/asciidoctor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asciidoctor/subscriptions","organizations_url":"https://api.github.com/users/asciidoctor/orgs","repos_url":"https://api.github.com/users/asciidoctor/repos","events_url":"https://api.github.com/users/asciidoctor/events{/privacy}","received_events_url":"https://api.github.com/users/asciidoctor/received_events","type":"Organization","site_admin":false},"repo":{"id":16607974,"name":"asciidoctor-extensions-lab","full_name":"asciidoctor/asciidoctor-extensions-lab","owner":{"login":"asciidoctor","id":3137042,"avatar_url":"https://avatars.githubusercontent.com/u/3137042?v=3","gravatar_id":"","url":"https://api.github.com/users/asciidoctor","html_url":"https://github.com/asciidoctor","followers_url":"https://api.github.com/users/asciidoctor/followers","following_url":"https://api.github.com/users/asciidoctor/following{/other_user}","gists_url":"https://api.github.com/users/asciidoctor/gists{/gist_id}","starred_url":"https://api.github.com/users/asciidoctor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asciidoctor/subscriptions","organizations_url":"https://api.github.com/users/asciidoctor/orgs","repos_url":"https://api.github.com/users/asciidoctor/repos","events_url":"https://api.github.com/users/asciidoctor/events{/privacy}","received_events_url":"https://api.github.com/users/asciidoctor/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/asciidoctor/asciidoctor-extensions-lab","description":"A lab and incubator for Asciidoctor extensions.","fork":false,"url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab","forks_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/forks","keys_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/teams","hooks_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/hooks","issue_events_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/issues/events{/number}","events_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/events","assignees_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/assignees{/user}","branches_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/branches{/branch}","tags_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/tags","blobs_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/git/refs{/sha}","trees_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/statuses/{sha}","languages_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/languages","stargazers_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/stargazers","contributors_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/contributors","subscribers_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/subscribers","subscription_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/subscription","commits_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/commits{/sha}","git_commits_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/git/commits{/sha}","comments_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/comments{/number}","issue_comment_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/issues/comments{/number}","contents_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/contents/{+path}","compare_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/merges","archive_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/downloads","issues_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/issues{/number}","pulls_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/pulls{/number}","milestones_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/milestones{/number}","notifications_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/labels{/name}","releases_url":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/releases{/id}","created_at":"2014-02-07T07:59:01Z","updated_at":"2015-04-28T09:03:45Z","pushed_at":"2015-04-11T15:18:27Z","git_url":"git://github.com/asciidoctor/asciidoctor-extensions-lab.git","ssh_url":"git@github.com:asciidoctor/asciidoctor-extensions-lab.git","clone_url":"https://github.com/asciidoctor/asciidoctor-extensions-lab.git","svn_url":"https://github.com/asciidoctor/asciidoctor-extensions-lab","homepage":null,"size":873,"stargazers_count":11,"watchers_count":11,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":23,"forks":10,"open_issues":23,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/pulls/32"},"html":{"href":"https://github.com/asciidoctor/asciidoctor-extensions-lab/pull/32"},"issue":{"href":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/issues/32"},"comments":{"href":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/asciidoctor/asciidoctor-extensions-lab/statuses/e7841dac225f234037b835da78f321672565d819"}}}}