{"action":"created","issue":{"url":"https://api.github.com/repos/jgm/pandoc/issues/4541","repository_url":"https://api.github.com/repos/jgm/pandoc","labels_url":"https://api.github.com/repos/jgm/pandoc/issues/4541/labels{/name}","comments_url":"https://api.github.com/repos/jgm/pandoc/issues/4541/comments","events_url":"https://api.github.com/repos/jgm/pandoc/issues/4541/events","html_url":"https://github.com/jgm/pandoc/issues/4541","id":312436214,"number":4541,"title":"Define selector syntax for document subsets","user":{"login":"nichtich","id":299856,"avatar_url":"https://avatars2.githubusercontent.com/u/299856?v=4","gravatar_id":"","url":"https://api.github.com/users/nichtich","html_url":"https://github.com/nichtich","followers_url":"https://api.github.com/users/nichtich/followers","following_url":"https://api.github.com/users/nichtich/following{/other_user}","gists_url":"https://api.github.com/users/nichtich/gists{/gist_id}","starred_url":"https://api.github.com/users/nichtich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nichtich/subscriptions","organizations_url":"https://api.github.com/users/nichtich/orgs","repos_url":"https://api.github.com/users/nichtich/repos","events_url":"https://api.github.com/users/nichtich/events{/privacy}","received_events_url":"https://api.github.com/users/nichtich/received_events","type":"User","site_admin":false},"labels":[{"id":113084,"url":"https://api.github.com/repos/jgm/pandoc/labels/enhancement","name":"enhancement","color":"fbca04","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-04-09T08:19:01Z","updated_at":"2018-04-17T16:03:28Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Selection of document subsets such as single chapters and paragraphs should be supported by introduction of a **Pandoc document selectors** such as XPath/XPointer, Fragment Identifiers, and CSS Selectors. This could simplify creation of filters and support transclusion (#81) and annotation of documents.\r\n\r\n### Examples\r\n\r\nA simple example is extraction of links - in this case the selector is `Link`:\r\n\r\n~~~\r\n$ pandoc --select 'Link' -t markdown input.doc\r\n[foo](http://example.org/)[bar](http://example.com/)\r\n~~~\r\n\r\nSome ideas for selector syntax to select elements by their attributes, element type, and values:\r\n\r\n    #id\r\n    .class\r\n    foo=bar\r\n    Header{.class}\r\n    Link[url^=https://]\r\n\r\nSelectors might be combined by alternatives:\r\n\r\n    Subscript | Superscript\r\n \r\nTo select larger parts of a document, a range operator or function is needed, for instance\r\n\r\n    Header[level=1][2] ... Header[level=1]\r\n\r\nwould select the second chapter of a document (everything from including the second header with level 1 up to before the next header with level 1 (inclusion of the second part of a range could be done by a different syntax e.g. `A ...+ B`)."},"comment":{"url":"https://api.github.com/repos/jgm/pandoc/issues/comments/382048225","html_url":"https://github.com/jgm/pandoc/issues/4541#issuecomment-382048225","issue_url":"https://api.github.com/repos/jgm/pandoc/issues/4541","id":382048225,"user":{"login":"nichtich","id":299856,"avatar_url":"https://avatars2.githubusercontent.com/u/299856?v=4","gravatar_id":"","url":"https://api.github.com/users/nichtich","html_url":"https://github.com/nichtich","followers_url":"https://api.github.com/users/nichtich/followers","following_url":"https://api.github.com/users/nichtich/following{/other_user}","gists_url":"https://api.github.com/users/nichtich/gists{/gist_id}","starred_url":"https://api.github.com/users/nichtich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nichtich/subscriptions","organizations_url":"https://api.github.com/users/nichtich/orgs","repos_url":"https://api.github.com/users/nichtich/repos","events_url":"https://api.github.com/users/nichtich/events{/privacy}","received_events_url":"https://api.github.com/users/nichtich/received_events","type":"User","site_admin":false},"created_at":"2018-04-17T16:03:28Z","updated_at":"2018-04-17T16:03:28Z","author_association":"CONTRIBUTOR","body":"Thanks for feedback and suggestions! XPath could help if there was an official serialization of the abstract syntax tree in XML. Without native support in pandoc (more specific: pandoc-types), there is a risk of differing implementations. A selector language for pandoc document model should not depend on a specific programming language or technology. At least a simple selector syntax is needed for #81 anyway to specify parts of a document. Another use case is converting annotations between formats (e.g. comments in Word documents and in annotations from services like [hypothes.is](https://web.hypothes.is/)): see [fragment selectors in Web annotation](https://www.w3.org/TR/annotation-model/#fragment-selector). "}}
{"actor":{"display_login":"nichtich"}}