Giter Club home page Giter Club logo

Comments (14)

DCsunset avatar DCsunset commented on July 20, 2024 1

The bug has been fixed in v0.4.0.
The usage of recursive includes has been updated in README.md.

from pandoc-include.

DCsunset avatar DCsunset commented on July 20, 2024

Hi, @ksebby

Could you post a simple piece of code to reproduce the problem?
I have tested locally and can't reproduce it.

from pandoc-include.

ksebby avatar ksebby commented on July 20, 2024

Thanks @DCsunset. I am running

pandoc docs/templates/Tools.md --filter pandoc-include -o docs/ToolsGuide.md -t markdown -s

in the root directory of this repo https://github.com/xDBio-Inc/cwl-tools/tree/combined_karl

from pandoc-include.

ksebby avatar ksebby commented on July 20, 2024

I got rid of the need for recursion in my docs as it wasn't really necessary. If you still want to play around with it you can git checkout 888943a from the main branch. Thanks.

from pandoc-include.

DCsunset avatar DCsunset commented on July 20, 2024

Sorry for missing your comment 4 days ago (because Github didn't send to me any notification).

It seems that the paths in the file are not processed correctly.
I may fix the bug later.

from pandoc-include.

normenmueller avatar normenmueller commented on July 20, 2024

@DCsunset It looks like this bug reappears in v0.7.0 ... at least on my Mac. I have one Main.md which includes xxx/Main.md which in turn includes xxx/1.md and xxx/2.md. Running pandoc Main.md --filter pandoc-include -o Main.pdf results in

Traceback (most recent call last):
  File "/Users/normenmueller/Library/Python/3.7/bin/pandoc-include", line 8, in <module>
    sys.exit(main())
  File "/Users/normenmueller/Library/Python/3.7/lib/python/site-packages/pandoc_include.py", line 160, in main
    return pf.run_filter(action, doc=doc)
  File "/usr/local/lib/python3.7/site-packages/panflute/io.py", line 258, in run_filter
    return run_filters([action], *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/panflute/io.py", line 239, in run_filters
    doc = doc.walk(action, doc)
  File "/usr/local/lib/python3.7/site-packages/panflute/base.py", line 265, in walk
    ans = list(chain.from_iterable(ans))
  File "/usr/local/lib/python3.7/site-packages/panflute/base.py", line 263, in <genexpr>
    ans = ((item,) if type(item) != list else item for item in ans)
  File "/usr/local/lib/python3.7/site-packages/panflute/base.py", line 260, in <genexpr>
    ans = (item.walk(action, doc) for item in obj)
  File "/usr/local/lib/python3.7/site-packages/panflute/base.py", line 276, in walk
    altered = action(self, doc)
  File "/Users/normenmueller/Library/Python/3.7/lib/python/site-packages/pandoc_include.py", line 108, in action
    fn + ' ' + entry + ' ' + os.getcwd())
TypeError: can only concatenate str (not "NoneType") to str
Error running filter pandoc-include:
Filter returned error status 1

Traceback (most recent call last):
  File "/Users/normenmueller/Library/Python/3.7/bin/pandoc-include", line 8, in <module>
    sys.exit(main())
  File "/Users/normenmueller/Library/Python/3.7/lib/python/site-packages/pandoc_include.py", line 160, in main
    return pf.run_filter(action, doc=doc)
  File "/usr/local/lib/python3.7/site-packages/panflute/io.py", line 258, in run_filter
    return run_filters([action], *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/panflute/io.py", line 239, in run_filters
    doc = doc.walk(action, doc)
  File "/usr/local/lib/python3.7/site-packages/panflute/base.py", line 265, in walk
    ans = list(chain.from_iterable(ans))
  File "/usr/local/lib/python3.7/site-packages/panflute/base.py", line 263, in <genexpr>
    ans = ((item,) if type(item) != list else item for item in ans)
  File "/usr/local/lib/python3.7/site-packages/panflute/base.py", line 260, in <genexpr>
    ans = (item.walk(action, doc) for item in obj)
  File "/usr/local/lib/python3.7/site-packages/panflute/base.py", line 276, in walk
    altered = action(self, doc)
  File "/Users/normenmueller/Library/Python/3.7/lib/python/site-packages/pandoc_include.py", line 132, in action
    raw, extra_args=pandoc_options)
  File "/usr/local/lib/python3.7/site-packages/panflute/tools.py", line 413, in convert_text
    out = inner_convert_text(text, in_fmt, out_fmt, extra_args)
  File "/usr/local/lib/python3.7/site-packages/panflute/tools.py", line 436, in inner_convert_text
    out = run_pandoc(text, args)
  File "/usr/local/lib/python3.7/site-packages/panflute/tools.py", line 337, in run_pandoc
    raise IOError('')
OSError
Error running filter pandoc-include:
Filter returned error status 1

from pandoc-include.

DCsunset avatar DCsunset commented on July 20, 2024

@normenmueller I fixed some bugs and release v0.7.2. I hope it solves this problem.

from pandoc-include.

normenmueller avatar normenmueller commented on July 20, 2024

@DCsunset Thanks for the fast reply and patch!

However, it still does not work... guess there is a problem with spaces in path names? I tried !include 10\ Anhang/Main.md but

pandoc Main.md --filter pandoc-include -o Main.pdf
Traceback (most recent call last):
  File "/Users/normenmueller/Library/Python/3.7/bin/pandoc-include", line 8, in <module>
    sys.exit(main())
  File "/Users/normenmueller/Library/Python/3.7/lib/python/site-packages/pandoc_include.py", line 161, in main
    return pf.run_filter(action, doc=doc)
  File "/Users/normenmueller/Library/Python/3.7/lib/python/site-packages/panflute/io.py", line 266, in run_filter
    return run_filters([action], *args, **kwargs)
  File "/Users/normenmueller/Library/Python/3.7/lib/python/site-packages/panflute/io.py", line 247, in run_filters
    doc = doc.walk(action, doc)
  File "/Users/normenmueller/Library/Python/3.7/lib/python/site-packages/panflute/base.py", line 265, in walk
    ans = list(chain.from_iterable(ans))
  File "/Users/normenmueller/Library/Python/3.7/lib/python/site-packages/panflute/base.py", line 263, in <genexpr>
    ans = ((item,) if type(item) != list else item for item in ans)
  File "/Users/normenmueller/Library/Python/3.7/lib/python/site-packages/panflute/base.py", line 260, in <genexpr>
    ans = (item.walk(action, doc) for item in obj)
  File "/Users/normenmueller/Library/Python/3.7/lib/python/site-packages/panflute/base.py", line 276, in walk
    altered = action(self, doc)
  File "/Users/normenmueller/Library/Python/3.7/lib/python/site-packages/pandoc_include.py", line 108, in action
    '%r %r %r' % (fn, entry, os.getcwd()))
ValueError: Included file not found: '10\xa0Anhang/Main.md' None '/Users/normenmueller/Worspace/eam/ads'
Error running filter pandoc-include:
Filter returned error status 1

from pandoc-include.

DCsunset avatar DCsunset commented on July 20, 2024

The spaces needn't be escaped. You might remove the backslashes and try it again.

from pandoc-include.

normenmueller avatar normenmueller commented on July 20, 2024

@DCsunset I guess the error is on my site, but !include 10 Anhang/Main.md also does not work. No error is thrown, though, but it just quits normally with a PDF but without the included content.

from pandoc-include.

DCsunset avatar DCsunset commented on July 20, 2024

@normenmueller Could you post the !include lines in your Main.md and xxx/Main.md?
If you add some options to pandoc-include, you could post it as well.
Then I could try to reproduce it on my machine.

from pandoc-include.

normenmueller avatar normenmueller commented on July 20, 2024
/doc
 |- 01 Intro/
 |- ...
 |- 10 Annex/
     |- Main.md
     |- 1.md
     |- 2.md
 |- Main.md

Main.md

---
title: '...'
subtitle: '...'
author: Normen Müller
abstract: |
  tbd
...

!include 10 Annex/Main.md

/10 Annex/Main.md

# Bla Blub

!include ./1.md

!include ./2.md

Shell:

$ cd /doc
$ pandoc Main.md --filter pandoc-include -o Main.pdf

from pandoc-include.

DCsunset avatar DCsunset commented on July 20, 2024

There seems no problem when compiling on my computer.
Did you update pandoc-include to v0.7.2?

from pandoc-include.

normenmueller avatar normenmueller commented on July 20, 2024

My mistake. If you rename the resulting PDF but open the old PDF... then the error is in front of the computer ;-)

from pandoc-include.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.