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

pandoc v2 has deprecated some options and extensions so manuskript is giving error. #304

Closed
rp-karanth opened this Issue Jan 16, 2018 · 6 comments

Comments

Projects
None yet
4 participants
@rp-karanth
Copy link

commented Jan 16, 2018

The newer version of pandoc has deprecated many extensions, so there is need to make manuskript compatible to both version.

This was the error popped up when I ran manuskript with pandoc v2.05
pandoc 2.0.5

--normalize has been removed.  Normalization is now automatic.
--smart/-S has been removed.  Use +smart or -smart extension instead.
For example: pandoc -f markdown+smart -t markdown-smart.
Try pandoc --help for more information.

@rp-karanth rp-karanth changed the title pandoc v2 has deprecated some options and extensions so it is giving error. pandoc v2 has deprecated some options and extensions so manuskript is giving error. Jan 16, 2018

@olivierkes olivierkes added the bug label Jan 18, 2018

@olivierkes

This comment has been minimized.

Copy link
Owner

commented Jan 18, 2018

Right, thanks.
Do you know what else has been deprecated?

@rp-karanth

This comment has been minimized.

Copy link
Author

commented Jan 18, 2018

In his announcement John MacFarlane enlisted them in pandoc-discuss google group.
These are exerpts from it.

 --reference-doc replaces --reference-docx and --reference-odt 
  --smart removed (instead use +smart on reader and/or writer) 
  --normalize removed (normalization is automatic) 
  --latex-engine removed (instead use --pdf-engine) 
  --parse-raw removed (instead use -f latex+raw_tex or -f html+raw_html) 
  --epub-stylesheet removed (instead use --css) 
  --mathml no longer takes an argument 

I would also like to add additional information list of newly added options.

  --eol (specifies line endings), 
  --log (prints JSON representation of info and warning messages), 
  --request-header (allows specifying a header to be used when 
    pandoc fetches external resources), 
  --lua-filter (for running lua filters, see below), 
  --epub-subdirectory (for changing the directory used in epub 
    containers), 
  --resource-path (for setting the search path for images and 
    other resources), 
  --abbreviations (for specifying a custom abbreviations 
    file so that the Markdown parser can be sensitive to 
    abbreviations), 
  --syntax-definition (allowing XML syntax highlighting definitions 
    to be loaded dynamically). 

@gedakc gedakc added this to the 0.7.0 milestone Feb 20, 2018

@gedakc

This comment has been minimized.

Copy link
Collaborator

commented Mar 5, 2018

I've been looking into this issue and don't have a solution, but wanted to capture some of my findings.

First, the pandoc options can be found in the GUI when the File -> Compile F6 window is open and one of the Export to Pandoc options is chosen. The list of options is on the left-hand side under the Pandoc heading as shown in the following screen shot:

screenshot_20180305_104325

The source code that mentions the --normalize and --smart command line options is manuskript/exporter/pandoc/abstractPlainText.py.

Secondly when testing with pandoc v2.1.1 on Ubuntu 17.10 I can choose not to enable either the --normalize or --smart option, but still encounter other issues. For example when using Pandoc HTML export, the following error message is displayed:

$ Debug: Web rendering engine used: QWebView
Running manuskript version 0.6.0.
Note: No translator found or loaded for locale en_CA.
Loading: /home/user/test-doc.msk
Detected file format version: 1. Zip: True.
Project /home/user/test-doc.msk loaded.
[WARNING] This document format requires a nonempty <title> element.
  Please specify either 'title' or 'pagetitle' in the metadata.
  Falling back to 'Untitled'

More work is needed to fix this issue so that both Pandoc v1.x and v2.x will function properly.

@rsnyman

This comment has been minimized.

Copy link

commented Jul 4, 2018

I've been hacking on this a little to see if I can get it to work. In manuskript/exporter/pandoc/__init__.py on line 68, change --variable to --metadata and that solves the "nonempty <title> element" error.

I also added some more PDF/LaTeX options to make my PDFs prettier ;-)

By the way, great work! I looked at a number of other open source book writing apps, and Manuskript is by far the best.

@gedakc gedakc modified the milestones: 0.7.0, 0.8.0 Aug 15, 2018

gedakc added a commit to gedakc/manuskript that referenced this issue Nov 20, 2018

Add support for pandoc v2 command line options
Now both pandoc v1 and v2 are supported.

Closes issue olivierkes#304
@gedakc

This comment has been minimized.

Copy link
Collaborator

commented Nov 20, 2018

Thank you @rsnyman for the tip about the --metadata flag to address the "nonempty <title> element" issue I encountered.

In my testing this PR successfully adds support for pandoc version 2. Additionally pandoc version 1 continued to work properly and I did not observe any regressions.

I would appreciate if someone would also test this PR and provide feedback.

@gedakc

This comment has been minimized.

Copy link
Collaborator

commented Nov 26, 2018

PR #418 has been merged into the develop branch for inclusion in the next release of Manuskript.

@gedakc gedakc closed this Nov 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.