Questions tagged [pypandoc]
46 questions
1
vote
1 answer
Flask and CSS file in pandoc generated HTML
I have a Flask application generating and serving static HTML from markdown with pypandoc. Everything goes fine, but the css file is served as text/html and not text/css, therefore it is not interpretated.
Firefox/Chromium gives the following error…

laconis
- 97
- 8
1
vote
1 answer
Using pypandoc.convert_file from docx to txt - how to prevent text wrapping in table columns?
I am using pypandoc to convert docx files to txt:
f = 'some file.docx'
o = pypandoc.convert_file(f, 'plain', outputfile='file.txt')
assert o == '', o
The problem is that the result is best fitted for visual readability - the text in table columns…

SergL
- 11
- 3
1
vote
0 answers
How to wrap raw HTML blocks in markdown
Here is the example markdown code that I'm getting from pandoc:
### Header
Paragraph
- Item
- Item
//COMPLEX TABLE WITH NESTED CELLS GOES HERE AS RAW HTML//
Paragraph
The markdown file will be used with Hugo, so I need to wrap…

Ildar Akhmetov
- 1,331
- 13
- 22
1
vote
0 answers
AttributeError: module 'pandoc' has no attribute 'main'
Python 3.8.2
python -m pip install pandoc
python -m pandoc
After installing pandoc and trying to run it with valid arguments, the following exception pops up.
Traceback (most recent call last):
File…

Rolex
- 11
- 3
1
vote
1 answer
pandoc: `RawBlock` in filter
What is the correct use of the RawBlock function in Pandoc filters?
#!/usr/bin/env python
from pandocfilters import toJSONFilter, Str, Para, Emph, Header, RawBlock
import re
def replace(key, value, format, meta):
if key == 'Str':
if…

NicolasBourbaki
- 853
- 1
- 6
- 19
1
vote
1 answer
How to convert dotx file to html file in python?
This is my code which failing at the moment
import os
import pypandoc
source_dir = 'source'
result_dir = 'result'
for file in os.listdir(source_dir):
output_files1 = []
source_file = source_dir + '/'+file
output_file = result_dir +…

Sankar guru
- 935
- 1
- 7
- 16
1
vote
0 answers
pypandoc | Convert multiple files
Objective:
I want to use Pypandoc to create a function where the user inputs three arguments being:
(i) an input folder;
(ii) a file format to convert to; and
(iii) an output folder.
Problem:
Before I convert this to a loop to convert multiple…

Bandit King
- 183
- 10
1
vote
0 answers
Have error by using pypandoc writing to file
I'm trying to write to file the string that i got after running pypandoc.
After writing to file im getting a bounch of UnicodeEncodeError's.
My question how can i write to file without any encoding.
To write string as is?
Thank you.
from…

user3193813
- 147
- 1
- 1
- 8
1
vote
0 answers
Django: Convert Word doc to pdf in Python on machine without Word installed
I'm currently working on a Django web-app that needs to retrieve several documents from a DMS, merge them into a single, large PDF, and distribute this file as output for the user.
The largest issue in this process stems from the fact that some of…

pseudoku
- 716
- 4
- 11
1
vote
0 answers
how to install throttle module in python3 using terminal?
I am working on web scraping. while reading an e-book I came across this Throttle Module .
It wanted me to import following module :
from chp1.throttle import Throttle
It is showing me the error suggesting that the chp1 module does not exist.
I…

IamBatman
- 85
- 1
- 10
1
vote
1 answer
Using pandoc and pandoc-citeproc with Jupyter notebooks
I am developing an infrastructure where developers can document their verification tests using Jupyter notebooks. One part of the infrastructure will be a python script that can convert their .ipynb files to .html files to provide public-facing…

Bill Spotz
- 33
- 5
1
vote
0 answers
Why is pypandoc giving the error "RuntimeError: Missing format!" in this setup.py script?
I have a setup.py script for a module. This setup.py script features conversion of a Markdown README file to reStructuredText (suitable for PyPI). When an attempt is made to install this module using pip (sudo pip install supermodule), the following…

d3pd
- 7,935
- 24
- 76
- 127
0
votes
1 answer
Make Pandoc recognize 'ragged right' attribute
I'm converting plenty of documents from Word, LibreOffice and HTML into TeX source. I've encountered this issue that Pandoc is unable to recognize the text being ragged right and thus the text stays on the left although it was supposed to be on the…

Just Bucket
- 53
- 6
0
votes
1 answer
Convert nested lists from JSON string to MD string using pypandoc
Foreword
I am totally aware that converting JSON (complex data structure) to MD (markup language) is probably an ill defined concept as they are not able to represent the same things. Anyway I think that it can be done for simple structure such as…

jlandercy
- 7,183
- 1
- 39
- 57
0
votes
0 answers
AWS lambda function throws error even after providing all modules
I want to convert .docx file to .txt and If .docx has tables I want to maintain them in good way in .txt file , so I am using pypandoc for this purpose .
In my local this is working like charm.
When I zip it with all dependencies and put it in s3 to…

Rahul Ranjan
- 1
- 2