Something I realized just now on the topic of attributes. I think I'd like to have tables have attributes as well. But that's not far removed from wanting everything to have attributes (at least all block-level elements and links). This would be a major change, but it will make AST more robust and (hopefully) allow for less changes in the future.

пятница, 3 апреля 2015 г., 20:05:45 UTC+3 пользователь John MacFarlane написал:
There have been a lot of improvements and bug fixes since
the last release (1.13.2).  So it would be good to release the
next version before long.  I wanted to give an opportunity for
discussion of some choice points.

The master branch now contains some breaking API changes:
instead of returning a Pandoc, the readers now returin
Either PandocError Pandoc.  This makes the library safer,
allowing users to handle parsing errors.  Because of this
API change, the version will be 1.14.

There are a number of other things I'd like to fix (or
at least investigate fixing) before the release:

[ ] #2040 - epub stylesheet / --css
[ ] #1995 - popup footnotes
[ ] #1931 - titles inside info elements in docbook
[ ] #1909 - apostrophe in $x$'s being interpreted as open quote
[ ] #1907 - better support for color in latex reader
[ ] #1877 - fix epub reader reference resolution
[ ] #1855 - properly assign mime types
[ ] #1849 - metadata bibliography= implies pandoc-citeproc
[ ] #1844 - render rights with plain writer
[ ] #1834 - strange jpeg crashes - remove bombs in ImageSize parser
[ ] #1820 - disappearing content w malformed div
[ ] #1751, #1670 - support html base tag
[ ] #1735 - exponential performance fro nested brackets
[ ] #1658 - better default for level 4 headers in latex?
[ ] #1609 - remove linear=no from epub cover
[ ] #1606 - make implicit header references case-insensitive?
[ ] #853 - convert docutils citations to regular footnotes?
[ ] #1395 - is there any good alternative to longtable?
[ ] add note to scripting tutorial about 1.14 API differences

In addition to these changes, mb21 has contributed a large
set of changes that add an attributes field to Image, allowing
fine-grained control of image sizing in several output formats
(see the new-image-attributes branch in jgm/pandoc on github).
This is one of the longest-standing requests, and I suspect it
will be a popular feature.  However, this change would require
a change in the underlying Pandoc type (defined in pandoc-types).
Such a change would break many existing filters and custom writers,
so it would be, in some ways, painful.

I think such growing pains are inevitable -- we can't be stuck
with the old types forever.  But it might make sense to (a) wait
for the next release to make these changes, and (b) bundle these
changes with other pandoc-types changes that would make sense.
Perhaps with all those changes we'd want to bump the version to 2.0.
The idea is to minimize the number of releases that will require
upgrades to filters, etc.

Here are some of the other changes to pandoc-types that I think
we'd want to consider:

[ ] adding Attr field to Image (mb21's change)
[ ] adding Attr field to Link
[ ] alternatively:  radical restructuring of the types so that
    everything has an Attr field (this would have advantages of
    uniformity, at the cost of making the structures more awkward to
    work with and pattern match on, and of course this change would require
    massive changes to the pandoc code base)
[ ] changing String to Text everywhere (this would require extensive
    but easy changes throughout the pandoc code base)
[ ] hand-written ToJSON and FromJSON instances, instead of deriving
    generic ones, to make it easier to keep the JSON format stable
    even when the Pandoc type changes
[ ] an Anchor element (might be unnecessary if everything had Attr)
[ ] a Figure block element, capable of containing multiple images
    (this would eliminate some hackery we currently do with a "fig:"
    prefix in image titles)
[ ] a LineBlock block element (#1623, currently we just use a paragraph with
    lots of line breaks, which isn't ideal)
[ ] a PageBreak block element
[ ] replace Strikeout with Deleted; add an Inserted element
[ ] add a SoftBreak element, to give the option of preserving line
    breaks from the source (see #1701)
[ ] allow colspans in Table element (this would require figuring out
    how to do colspans in our markdown table formats)

At this point, I'm most hoping for feedback on whether it makes sense
to release 1.14 without the Image attribute changes, and save those
for a future release where they might be bundled with some of these
other improvements in the Pandoc type.

John

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/affa2598-d059-4285-bf64-e4b94a393e12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.