dalibo / pandocker

🐳 A simple docker image for pandoc with filters, templates, fonts, and the latex bazaar
https://hub.docker.com/r/dalibo/pandocker/
BSD 3-Clause "New" or "Revised" License
145 stars 23 forks source link

Include pandoc-crossref #122

Closed colindean closed 4 years ago

colindean commented 4 years ago

Is your feature request related to a problem? Please describe.

My build uses pandoc-crossref, which I've installed locally. It's not available in pandocker.

Describe the solution you'd like

pandoc-crossref could be included in pandocker.

Describe alternatives you've considered

I could build and ship my own fork.

Additional context

https://github.com/lierdakil/pandoc-crossref

colindean commented 4 years ago

It looks like there's https://github.com/kiwi0fruit/py-pandoc-crossref available in pypi!

colindean commented 4 years ago

I tried adding py-pandoc-crossref to requirements.txt

diff --git a/requirements.txt b/requirements.txt
index cdb8c5f..dc5643a 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -11,3 +11,4 @@ pandoc-mustache==0.1
 pandoc-dalibo-guidelines==1.1.1
 PyPDF2==1.26
 Pygments==2.4
+py-pandoc-crossref==0.3.6.0

but I'm getting this error:

Collecting py-pandoc-crossref==0.3.6.0 (from -r requirements.txt (line 14))
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-jrsd6zua/py-pandoc-crossref/setup.py", line 119
        raise RuntimeError(f'SHA256 hash does not match for {filename}')
                                                                      ^
    SyntaxError: invalid syntax

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-jrsd6zua/py-pandoc-crossref/
The command '/bin/sh -c pip3 --no-cache-dir install --find-links file://${PWD}/cache -r requirements.txt' returned a non-zero code: 1
make: *** [build] Error 1

…is this a Python2/Python3 thing?

colindean commented 4 years ago

My inexperience with the Python ecosystem is showing. I use make warm-cache before make build and that succeeded. When I clear the cache and run make build, the pip3 inside the container can't find py-pandoc-crossref:

Collecting py-pandoc-crossref==0.3.6.0 (from -r requirements.txt (line 14))
  Could not find a version that satisfies the requirement py-pandoc-crossref==0.3.6.0 (from -r requirements.txt (line 14)) (from versions: )
No matching distribution found for py-pandoc-crossref==0.3.6.0 (from -r requirements.txt (line 14))
colindean commented 4 years ago

I tried an older version 0.3.5.0.2 – 0.3.6.0 just came out hours ago? – as well as upgrading pip before running the install from requirements.txt and it still can't find the package.

colindean commented 4 years ago

I think I figured it out. py-pandoc-crossref requires python 3.6+ and Debian stretch includes python 3.5.

…Interested in using a new version of Debian?

daamien commented 4 years ago

Hi @colindean !

We planned to upgrade to debian buster and made a failed attempt this summer
https://github.com/dalibo/pandocker/pull/100

Unfortunatelly the texlive distibution system is a mess on debian buster... We have to figure how we can make it work....

My understanding is that pandoc-crossref is written in Haskell so I don't see why the python3.6 should be required. I'll try to make it work without py-pandoc-crossref...

colindean commented 4 years ago

Upgrading to buster breaks tlmgr

tlmgr: Remote repository is newer than local (2018 < 2019)
Cross release updates are only supported with
  update-tlmgr-latest(.sh/.exe) --update
Please see https://tug.org/texlive/upgrade.html for details.

https://tug.org/texlive/upgrade.html has instructions but https://tex.stackexchange.com/questions/495054/tlmgr-remote-repository-is-newer-than-local-2018-2019 advises:

To add to Ralf's correct answer, here an explanation why tlmgr gives this error: Debian/buster comes with TL2018, and thus refuses to work with the 2019 repositories, even in self mode. I agree that this is an inconvenience, and I will see whether I remove this check in self mode, either in upstream tlmgr, or only in the Debian packages.

For now there is no good solution but either stick with Debian's packages, which are at the status of about January 2019, or install upstream TUG's TL and ignore the Debian one.

The package texlive-fonts-extra includes ~some~ all fonts that are installed by tlmgr:

colindean commented 4 years ago

The chief problem of installing texlife-font-extra is that it's another 1,101,775.0 kiB on disk. That's probably excessive.

colindean commented 4 years ago

Abandoning the Python approach and going to the release binaries.