{"action":"closed","issue":{"url":"https://api.github.com/repos/nichtich/Pandoc-Elements/issues/80","repository_url":"https://api.github.com/repos/nichtich/Pandoc-Elements","labels_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/issues/80/comments","events_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/issues/80/events","html_url":"https://github.com/nichtich/Pandoc-Elements/issues/80","id":316462305,"number":80,"title":"\"dir\" option at ImagesFromCode should be relative from the input file.","user":{"login":"TakeAsh","id":3276865,"avatar_url":"https://avatars3.githubusercontent.com/u/3276865?v=4","gravatar_id":"","url":"https://api.github.com/users/TakeAsh","html_url":"https://github.com/TakeAsh","followers_url":"https://api.github.com/users/TakeAsh/followers","following_url":"https://api.github.com/users/TakeAsh/following{/other_user}","gists_url":"https://api.github.com/users/TakeAsh/gists{/gist_id}","starred_url":"https://api.github.com/users/TakeAsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TakeAsh/subscriptions","organizations_url":"https://api.github.com/users/TakeAsh/orgs","repos_url":"https://api.github.com/users/TakeAsh/repos","events_url":"https://api.github.com/users/TakeAsh/events{/privacy}","received_events_url":"https://api.github.com/users/TakeAsh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-04-21T04:59:33Z","updated_at":"2018-04-24T20:16:20Z","closed_at":"2018-04-24T20:16:20Z","author_association":"CONTRIBUTOR","body":"Thank you for adding \"dir\" option at ImagesFromCode.\r\nI tried this option for my filter script.\r\n```perl\r\n#!/usr/bin/env perl\r\nuse strict;\r\n\r\nuse Pandoc::Filter;\r\nuse Pandoc::Filter::ImagesFromCode;\r\n\r\npandoc_filter 'CodeBlock.plantuml' => Pandoc::Filter::ImagesFromCode->new(\r\n    from => 'puml',\r\n    to   => sub { $_[0] eq 'latex' ? 'eps' : 'svg' },\r\n    dir  => 'images',\r\n    run  => [ 'plantuml', '-T$to$', '-o .', '$infile$' ],\r\n);\r\n```\r\n\r\nI ran the command at `Pandoc-Elements` folder.\r\n`Pandoc-Elements>pandoc -s -t html5 --toc --filter \"examples/plantuml.pl\" -o \"examples/plantuml-sample.html\" \"examples/plantuml-sample.md\"`\r\n\r\nThen outputed html file was placed in `examples` folder, and the img tags refered `images` subfolder.\r\n```\r\n<div>\r\n  <img src=\"images/0e76bdfc35464648ab2ec5d9561ed892.svg\" class=\"plantuml\" />\r\n</div>\r\n```\r\n\r\nBut the image files were outputed not `Pandoc-Elements/examples/images` but `Pandoc-Elements/images`.\r\nSo, outputed html can't render the img tags correctly.\r\n\"dir\" option at ImagesFromCode should be relative not from current working folder but from the input file."}}
{"actor":{"display_login":"nichtich"}}