Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downloading Pandoc #5

Open
cuppajoeman opened this issue Apr 2, 2020 · 12 comments
Open

Downloading Pandoc #5

cuppajoeman opened this issue Apr 2, 2020 · 12 comments

Comments

@cuppajoeman
Copy link
Contributor

I am running void linux, I have pandoc installed. On a fresh install of caou, I get the following after running caou file.md

- Downloading Pandoc ( ... X pandoc installation failed.

@corollari
Copy link
Owner

The way pandoc is downloaded is through

const pandocBaseUrl = "https://github.com/corollari/caoutchouc/raw/master/vendor"
const pandoc = new BinWrapper()
	.src(`${pandocBaseUrl}/osx/pandoc`, 'darwin')
    .src(`${pandocBaseUrl}/linux/pandoc`, 'linux')
    .src(`${pandocBaseUrl}/win/x86/pandoc.exe`, 'win32', 'x86')
    .src(`${pandocBaseUrl}/win/x64/pandoc.exe`, 'win32', 'x64')
    .dest(path.join(__dirname, 'pandoc'))
    .use(process.platform === 'win32' ? 'pandoc.exe' : 'pandoc')

could it be that bin-wrapper doesn't recognize void linux as linux?

@cuppajoeman
Copy link
Contributor Author

That seems like the case, I definitely have pandoc installed. I'm not too familiar with binwrapper, but do you have any suggestions on how I could go about debugging this?

@corollari
Copy link
Owner

The reason why I set caou to use bin-wrapper to install caou is because I found that that the last versions of pandoc produce a latex output that is incorrect (compiler errors on it). With bin-wrapper I could pin a specific version of pandoc that worked properly.

With that said, I think it should be quite easy to sidestep that by removing bin-wrapper from the source and trying to use the pandoc installed locally directly.

@cuppajoeman
Copy link
Contributor Author

I removed the bin-wrapper stuff and in spawn_child I used "pandoc" directly. The following was the output on file.md (contains the working example from .io site)

void_cup@cuppajoeman:~$ caou file.md 
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./file.cautex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-02-25>
! Argument of \@fileswith@pti@ns has an extra }.
<inserted text> 
                \par 
l.8 \usepackage
               {lmodern}
? 
Runaway argument?
article{\@fileswith@ptions \@pkgextension }\def \reserved@b {\@fileswith@ptions
 \ETC.
! Paragraph ended before \@fileswith@pti@ns was complete.
<to be read again> 
                   \par 
l.8 \usepackage
               {lmodern}
? 
! TeX capacity exceeded, sorry [input stack size=5000].
<to be read again> 
                   \[email protected] 
l.8 \usepackage
               {lmodern}
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on file.log.

I suppose these are the compiler errors you mentioned.

@corollari
Copy link
Owner

Yep that looks like it, back when I debugged it I ended up fixing several errors manually but that just uncovered other errors. That may no longer be true for newer versions of pandoc tho.

@corollari
Copy link
Owner

I've started looking at the source code of bin-wrapper and it seems that the problem you encountered wasn't because bin-wrapper couldn't correctly detect your OS but because of some other problem.

With that said I'm not sure what could it be, could you try to check if the files are being installed in some directory for which your user doesn't have permission?

@cuppajoeman
Copy link
Contributor Author

I recently changed to ubuntu. I tried installing caou, and I got the same error msg ( x pandoc installation failed)... Not sure if this helps with what you just mentioned though. Lmk if you want me to try something else out.

Also I appreciate you answering my questions on the other repo! And I think I understand how the index.js file works now.

Though do you have any recommendation on how I can start testing stuff out? Right now I've been editing directly in the global node_modules repo which requires sudo to edit. Could you run me through your workflow for debugging/trying stuff out with caou?

@corollari
Copy link
Owner

I recently changed to ubuntu. I tried installing caou, and I got the same error msg

That's strange, as I've been using travis, which uses ubuntu, to produce all my cautchouc documents and so far it's been working fine. I'll investigate this issue more and come back to you.

Also I appreciate you answering my questions on the other repo!

No problem 👍

Though do you have any recommendation on how I can start testing stuff out?

What I do is simulate a package installation using npm link, which just simlinks the current package to node_modules. The workflow is like this:

git clone [email protected]:corollari/caoutchouc.git
cd caoutchouc
npm install
npm link
caou # Uses the caou in the current directory

@cuppajoeman
Copy link
Contributor Author

cuppajoeman commented Apr 13, 2020

After following your workflow above, I can now generate PDF files! and it works!

So maybe something fishy is going on when you try to do a global installation...

Also now that I have something I can work with, what should focus on next? Should I try to make it work with the newest version of pandoc?

In addition, I have found by removing the extension raw_attribute caou works with the newest version of pandoc.

@corollari
Copy link
Owner

So maybe something fishy is going on when you try to do a global installation...

Yeah that seems to be the case. I've tried again to reproduce the issue on Ubuntu 16.04 LTS doing the following:

# Install node 12
sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs

# Install caou
npm install caou -g

# Run caou
echo "# a" > a.md
caou a.md

And it worked fine (well I didn't get a pdf because I missed the latex installation but the caoutex file was generated properly), so I think I'm missing something there.

Also now that I have something I can work with, what should focus on next? Should I try to make it work with the newest version of pandoc?

That would be perfect!

@cuppajoeman
Copy link
Contributor Author

cuppajoeman commented May 2, 2020

Alright, I suppose at this point, we can say that caou is working on the newest version of pandoc. So I was thinking ahead a little bit and being able to modify the margins, and having markdown images (online ones) working seem like good features.

Having the website back up and going would be awesome as well! I'm just trying to think of what my next step would be here.

Also let me know if there is a better way to communicate with you rather than on this issue.

@corollari
Copy link
Owner

So I was thinking ahead a little bit and being able to modify the margins, and having markdown images (online ones) working seem like good features.

Great! I personally think that just working on what you find the most interesting and useful is the best way forward, as I've found that usually other people tend to require the same features that one finds important.

Having the website back up and going would be awesome as well! I'm just trying to think of what my next step would be here.

Yeah that would be great, I think setting it up on a server is going to be easy, but I'm afraid we will soon hit the problems I encountered the last time I used it:

  • The standard sharelatex container uses an account system which is completely admin-based, meaning that it is impossible for random users to create an account of their own, an admin has to create every new account. I believe it should be possible to get around this restriction, but the sharelatex code is completely undocumented and getting around it is quite hard.
  • Because of how all services are bundled together in the sharelatex container, servers using it are fundamentally unscalable. We would need to decouple several parts in order to get something workable, and that might be a large amount of work.

Also let me know if there is a better way to communicate with you rather than on this issue.

I use telegram (@corollari) and whatsapp as my go-to chat apps but if you'd rather use twitter (@corolari) I'm available there too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants