{"action":"created","issue":{"url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/341","labels_url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/341/labels{/name}","comments_url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/341/comments","events_url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/341/events","html_url":"https://github.com/asciidoctor/asciidoctorj/pull/341","id":90089514,"number":341,"title":"Added annotation based processor configuration","user":{"login":"robertpanzer","id":1163662,"avatar_url":"https://avatars.githubusercontent.com/u/1163662?v=3","gravatar_id":"","url":"https://api.github.com/users/robertpanzer","html_url":"https://github.com/robertpanzer","followers_url":"https://api.github.com/users/robertpanzer/followers","following_url":"https://api.github.com/users/robertpanzer/following{/other_user}","gists_url":"https://api.github.com/users/robertpanzer/gists{/gist_id}","starred_url":"https://api.github.com/users/robertpanzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertpanzer/subscriptions","organizations_url":"https://api.github.com/users/robertpanzer/orgs","repos_url":"https://api.github.com/users/robertpanzer/repos","events_url":"https://api.github.com/users/robertpanzer/events{/privacy}","received_events_url":"https://api.github.com/users/robertpanzer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-22T12:50:01Z","updated_at":"2015-06-22T19:43:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/asciidoctor/asciidoctorj/pulls/341","html_url":"https://github.com/asciidoctor/asciidoctorj/pull/341","diff_url":"https://github.com/asciidoctor/asciidoctorj/pull/341.diff","patch_url":"https://github.com/asciidoctor/asciidoctorj/pull/341.patch"},"body":"This should implement #196 \r\n\r\nIt is now possible to add these annotations:\r\n- `@Name` to define block or macro names for BlockProcessors, BlockMacro- and InlineMacroProcessors\r\n- `@ContentModel` to define the content model of a BlockProcessor\r\n- `@Contexts` to define the contexts of a BlockProcessor\r\n- `@DefaultAttribute` to define default attributes to pass to the process method of a processor\r\n- `@DefaultAttributes` to define multiple `@DefaultAttribute`s on one type\r\n- `@Location` to define where content generated by a DocinfoProcessor is to be placed.\r\n\r\n`@PositionalAttributes` are missing yet because I am not aware what they should do.\r\n\r\nIn general the implementation adds options to the processors *class* object that serve as a default configuration for the instances. (see https://github.com/asciidoctor/asciidoctor/blob/master/lib/asciidoctor/extensions.rb#L84)\r\n\r\nIf this is a way to pursue docs and javadocs should be enhanced.\r\nAlso the javadocs of the new annotations should be extended with examples.\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/comments/114234332","html_url":"https://github.com/asciidoctor/asciidoctorj/pull/341#issuecomment-114234332","issue_url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/341","id":114234332,"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},"created_at":"2015-06-22T19:43:44Z","updated_at":"2015-06-22T19:43:44Z","body":"@robertpanzer, this is really amazing. Extensions for AsciidoctorJ just got a whole lot more awesome. I'm raising my glass to your work tonight.\r\n\r\n> Staying compatible is imo a top priority.\r\n\r\n:+1: Certainly a tough challenge, but since a bulk of the Asciidoctor user base goes through AsciidoctorJ, giving them a clear path forward is crucial.\r\n\r\n> But it is only possible because Alex has provided such an excellent test suite!\r\n\r\n:+1: :+1:\r\n\r\nOne for the test suite, and one for teamwork.\r\n\r\n> @PositionalAttributes are missing yet because I am not aware what they should do.\r\n\r\nPositional attributes map indexed positions in the attribute list to attribute names. For instance, the positional attributes for the image block macro are \"alt\", \"width\", \"height\" so you can write a shorthand version of the block macro, like `image::pic.jpg[Picture,100,200]`. Effectively, the block macro gets interpreted as `image::pic.jpg[alt=Picture, width=100, height=200]`. The value of the annotation would then be `@PositionalAttributes(\"alt\", \"width\", \"height\")` Does that make sense?"}}