public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Org-mode reader: Respect PATHs relative to "main" org file
@ 2021-03-21 20:28 krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
       [not found] ` <5e8fd94c-5daf-480a-a759-d19d4d2ef4c5n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org @ 2021-03-21 20:28 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1166 bytes --]

Hello,

I have come across situation, in which I am having following project 
structure:

- `makefile`
- `src/main.org`
- `src/chapters/chapter1.org`

etc ...

File `main.org` contains mostly `#+INCLUDE` directives to individual 
chapter files.
Now when I am specifying `pandoc` command in `makefile` like so:

```
pandoc -f org+smart -t html -o test.html src/main.org
```

I get error about chapter files not being found. Seams like pandoc is 
looking for chapter files in PATH relative to PATH, in which `pandoc` is 
executed, and does not respect PATH, relative to which is `#+INCLUDE` 
directive invoked ...

Is that correct? And is this behavior indended? If it is not, how could I 
fix that? (or someone better versed in Haskell ...)

Regards Tomas

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/5e8fd94c-5daf-480a-a759-d19d4d2ef4c5n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 1687 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Org-mode reader: Respect PATHs relative to "main" org file
       [not found] ` <5e8fd94c-5daf-480a-a759-d19d4d2ef4c5n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-03-22  6:01   ` John MacFarlane
       [not found]     ` <m2zgyvohfl.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: John MacFarlane @ 2021-03-22  6:01 UTC (permalink / raw)
  To: krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, pandoc-discuss


Yes, in general, pandoc always looks for things relative to
the working directory.  (Indeed, it doesn't always even know
what file the bit of text that contains an INCLUDE  is from;
remember that the basic parsers just take string inputs, and
input can come from stdin too.)

The easiest solution to this is to set your --resource-path
to include the src directory.  (See the manual.)




"krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <krulis.tomas.tk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Hello,
>
> I have come across situation, in which I am having following project 
> structure:
>
> - `makefile`
> - `src/main.org`
> - `src/chapters/chapter1.org`
>
> etc ...
>
> File `main.org` contains mostly `#+INCLUDE` directives to individual 
> chapter files.
> Now when I am specifying `pandoc` command in `makefile` like so:
>
> ```
> pandoc -f org+smart -t html -o test.html src/main.org
> ```
>
> I get error about chapter files not being found. Seams like pandoc is 
> looking for chapter files in PATH relative to PATH, in which `pandoc` is 
> executed, and does not respect PATH, relative to which is `#+INCLUDE` 
> directive invoked ...
>
> Is that correct? And is this behavior indended? If it is not, how could I 
> fix that? (or someone better versed in Haskell ...)
>
> Regards Tomas
>
> -- 
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/5e8fd94c-5daf-480a-a759-d19d4d2ef4c5n%40googlegroups.com.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Org-mode reader: Respect PATHs relative to "main" org file
       [not found]     ` <m2zgyvohfl.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
@ 2021-03-22 11:54       ` krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
       [not found]         ` <aeda5b3b-6de2-41fd-85f8-920f5ce93d76n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org @ 2021-03-22 11:54 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 3428 bytes --]

Thank you for your reply, pointing out this cmd-line flag. I have read the 
corresponding part of the manual. If I understand it correctly, the command 
for conversion of `main.org` file to html on Linux OS (Manjaro) should be:

```
pandoc --from org+smart -t html --resource-path .:src -o test.html 
src/main.org
```

However, it doesnt work. I have also tryed `".:src"`, `".":"src"`, and 
other variations; also with `.:./src` and `.:src/chapters` (which shouldnt 
be correct anyway). None of them was working. The only option when the 
included files were found was when I copied `chapters` folder to pandoc 
working directory (which I would like to avoid). I have many times checked 
any misspellings, but I shouldnt make many in "src" :)

I am using pandoc version 2.11.4

What is the correct syntax for this cmdline flag/this use-case? I would 
like to use this flag eventually in defaults file, so what is the correct 
syntax there? From manual, I would gues `resources-path: [".:src"]`, but 
that did not work either ...

Dne pondělí 22. března 2021 v 7:01:48 UTC+1 uživatel John MacFarlane napsal:

>
> Yes, in general, pandoc always looks for things relative to
> the working directory. (Indeed, it doesn't always even know
> what file the bit of text that contains an INCLUDE is from;
> remember that the basic parsers just take string inputs, and
> input can come from stdin too.)
>
> The easiest solution to this is to set your --resource-path
> to include the src directory. (See the manual.)
>
>
>
>
> "krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
> > Hello,
> >
> > I have come across situation, in which I am having following project 
> > structure:
> >
> > - `makefile`
> > - `src/main.org`
> > - `src/chapters/chapter1.org`
> >
> > etc ...
> >
> > File `main.org` contains mostly `#+INCLUDE` directives to individual 
> > chapter files.
> > Now when I am specifying `pandoc` command in `makefile` like so:
> >
> > ```
> > pandoc -f org+smart -t html -o test.html src/main.org
> > ```
> >
> > I get error about chapter files not being found. Seams like pandoc is 
> > looking for chapter files in PATH relative to PATH, in which `pandoc` is 
> > executed, and does not respect PATH, relative to which is `#+INCLUDE` 
> > directive invoked ...
> >
> > Is that correct? And is this behavior indended? If it is not, how could 
> I 
> > fix that? (or someone better versed in Haskell ...)
> >
> > Regards Tomas
> >
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "pandoc-discuss" group.
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pandoc-discuss/5e8fd94c-5daf-480a-a759-d19d4d2ef4c5n%40googlegroups.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/aeda5b3b-6de2-41fd-85f8-920f5ce93d76n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 5623 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Org-mode reader: Respect PATHs relative to "main" org file
       [not found]         ` <aeda5b3b-6de2-41fd-85f8-920f5ce93d76n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-03-23  6:24           ` krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
  0 siblings, 0 replies; 4+ messages in thread
From: krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org @ 2021-03-23  6:24 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 3847 bytes --]

I have also found this issue:

https://github.com/jgm/pandoc/issues/5501

Does it mean that "--resource-path" flag is ignored in org-mode reader??

Dne pondělí 22. března 2021 v 12:54:47 UTC+1 uživatel krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org 
napsal:

> Thank you for your reply, pointing out this cmd-line flag. I have read the 
> corresponding part of the manual. If I understand it correctly, the command 
> for conversion of `main.org` file to html on Linux OS (Manjaro) should be:
>
> ```
> pandoc --from org+smart -t html --resource-path .:src -o test.html src/
> main.org
> ```
>
> However, it doesnt work. I have also tryed `".:src"`, `".":"src"`, and 
> other variations; also with `.:./src` and `.:src/chapters` (which shouldnt 
> be correct anyway). None of them was working. The only option when the 
> included files were found was when I copied `chapters` folder to pandoc 
> working directory (which I would like to avoid). I have many times checked 
> any misspellings, but I shouldnt make many in "src" :)
>
> I am using pandoc version 2.11.4
>
> What is the correct syntax for this cmdline flag/this use-case? I would 
> like to use this flag eventually in defaults file, so what is the correct 
> syntax there? From manual, I would gues `resources-path: [".:src"]`, but 
> that did not work either ...
>
> Dne pondělí 22. března 2021 v 7:01:48 UTC+1 uživatel John MacFarlane 
> napsal:
>
>>
>> Yes, in general, pandoc always looks for things relative to 
>> the working directory. (Indeed, it doesn't always even know 
>> what file the bit of text that contains an INCLUDE is from; 
>> remember that the basic parsers just take string inputs, and 
>> input can come from stdin too.) 
>>
>> The easiest solution to this is to set your --resource-path 
>> to include the src directory. (See the manual.) 
>>
>>
>>
>>
>> "krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes: 
>>
>> > Hello, 
>> > 
>> > I have come across situation, in which I am having following project 
>> > structure: 
>> > 
>> > - `makefile` 
>> > - `src/main.org` 
>> > - `src/chapters/chapter1.org` 
>> > 
>> > etc ... 
>> > 
>> > File `main.org` contains mostly `#+INCLUDE` directives to individual 
>> > chapter files. 
>> > Now when I am specifying `pandoc` command in `makefile` like so: 
>> > 
>> > ``` 
>> > pandoc -f org+smart -t html -o test.html src/main.org 
>> > ``` 
>> > 
>> > I get error about chapter files not being found. Seams like pandoc is 
>> > looking for chapter files in PATH relative to PATH, in which `pandoc` 
>> is 
>> > executed, and does not respect PATH, relative to which is `#+INCLUDE` 
>> > directive invoked ... 
>> > 
>> > Is that correct? And is this behavior indended? If it is not, how could 
>> I 
>> > fix that? (or someone better versed in Haskell ...) 
>> > 
>> > Regards Tomas 
>> > 
>> > -- 
>> > You received this message because you are subscribed to the Google 
>> Groups "pandoc-discuss" group. 
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 
>> > To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/pandoc-discuss/5e8fd94c-5daf-480a-a759-d19d4d2ef4c5n%40googlegroups.com. 
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/6e63b8e5-5109-41a0-ba91-0f9bf3019b71n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 6640 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-23  6:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-21 20:28 Org-mode reader: Respect PATHs relative to "main" org file krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
     [not found] ` <5e8fd94c-5daf-480a-a759-d19d4d2ef4c5n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-03-22  6:01   ` John MacFarlane
     [not found]     ` <m2zgyvohfl.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
2021-03-22 11:54       ` krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
     [not found]         ` <aeda5b3b-6de2-41fd-85f8-920f5ce93d76n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-03-23  6:24           ` krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).