Comments (8)
I just pushed a fix that should work, but since I had to touch several parts of the code I wouldn't be surprised if I missed something.
BTW, TravisCI is failing right now because I can't get pandoc to install on their docker containers, but the tests are passing on my side
from panflute.
I recently have experimented quite a few different ways of setting up travis for pandoc project. Do you want me to pull request on the travis setup? (and you want sudo = false
, right?)
from panflute.
Yes, I think sudo=false
is by default in TravisCI. My current build is quite simple, but feel free to send me any PR if you see anything that can be improved (this is the first time I've used Travis).
I also suspect there's a bug that pops up only in some systems and that might be picked up by Travis in this case. I need to change the JSON loading code to fix that for good, but that would probably wait a few days unless you or someone else spot that bug on the field (so it's not only Travis's specific config that gives the bug)
from panflute.
I just pushed a fix that should work, but since I had to touch several parts of the code I wouldn't be surprised if I missed something.
I tried updating panflute, but the version is still 1.4.2. By the way, can you provide a quicker way to check version like the attribute panflute.__version__
?
Thanks.
from panflute.
I can confirm 1.4.3 works. I installed using pip install git+git://github.com/sergiocorreia/panflute.git
. It's still 1.4.2 in panflute 1.4.2 : Python Package Index.
from panflute.
Having a .version variable makes sense; I'll probably follow suggestion 3 of this link
from panflute.
I think this one need to reopen:
from panflute import *
x = [Para(Str('Something')), Para(Space, Str('else'))]
c1 = TableCell(*x)
c2 = TableCell(Header(Str('Title')))
rows = [TableRow(c1, c2)]
table = Table(*rows, header=None)
print(convert_text([table], input_format='panflute', output_format='native'))
will output
[Table [] [AlignDefault,AlignDefault] [0.0,0.0]
[]
[[[Para [Str "Something"]
,Para [Space,Str "else"]]
,[Header 1 ("",[],[]) [Str "Title"]]]]]
Notice the 2nd line is an empty "list". pandoc seems to parse this just fine. But the problem is when this is passed to panflute, panflute will complain IndexError: table header has an incorrect number of cols: 0 rows but expected 2
.
And in the case when pandoc has no header row, it will output a "list" of "list" that looks like this:
[[]
,[]]
So even if pandoc is fine with []
, a list of empty lists might be better because it is what pandoc output, and because this is what "panflute requires".
from panflute.
Just submitted a fix:
- The bug was in converting the table to json. Now it prints the list of empty lists.
- I also allow
convert_text(elem)
whereelem
is any arbitrary panflute element (so you don't have to wrap it in a list. - Also added a test case for this
from panflute.
Related Issues (20)
- Creating a Panflute filter that interacts with other filters HOT 1
- Reimplement the panflute.stringify with native pandoc writer HOT 2
- Unable to get Panflute filter comments.py to work correctly HOT 1
- Add comparison method to Element class? HOT 2
- Compatibility with Pandoc 2.18 HOT 3
- Using panflute as a writer rather than a filter HOT 8
- Stringifying the terms of a definition list results in AttributeError HOT 7
- Hwo to use the span method? HOT 1
- Applying panflute filter multiple times generates an unexpected result
- Can't convert markdown style citations to LaTeX style using panflute filter HOT 5
- Navigation with next and prev unstable HOT 3
- Add space before footnote in stringify function HOT 4
- Is there solution to add custom style for lists with panflute ? HOT 2
- Avoid side-effects in walk
- Figure, Table: to_json() crashes if caption is None HOT 1
- Reading the value of `--resource-path` inside a panflute filter ? HOT 3
- Trying to create new metadata from metadata
- Removal of click dependency HOT 3
- Installing globally on Ubuntu HOT 2
- Consider different check for RawInline formats?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from panflute.