public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Tufte CSS and pandoc
@ 2016-12-06 15:25 Kolen Cheung
       [not found] ` <07a2781b-6ae3-45de-b80a-93b1774dd66c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Kolen Cheung @ 2016-12-06 15:25 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 1335 bytes --]

by @jez

https://github.com/jez/tufte-pandoc-jekyll
https://github.com/jez/tufte-pandoc-css
https://github.com/jez/pandoc-sidenote

I spent some time on thinking about how to do basically what he did, until I discovered someone has done it already! (I was checking the Tufte CSS's gtihub issues.)

And yet he didn't announced it here! If he did, I wouldn't be wasting my time almost trying to reinvent what he did. (May be he wanted to announce it only when he thinks it is mature?)

This probably will be used in the pandoc-extras blog (which is why I was thinking about implementing this). And what I just experienced kind of reinforce the idea of having an ecosystem around pandoc. In a sense, it's really about: DIY is good but DRY is best.

-- 
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/07a2781b-6ae3-45de-b80a-93b1774dd66c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Tufte CSS and pandoc
       [not found] ` <07a2781b-6ae3-45de-b80a-93b1774dd66c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2016-12-07 18:08   ` Gwern Branwen
  0 siblings, 0 replies; 2+ messages in thread
From: Gwern Branwen @ 2016-12-07 18:08 UTC (permalink / raw)
  To: pandoc-discuss

On Tue, Dec 6, 2016 at 10:25 AM, Kolen Cheung <christian.kolen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> And yet he didn't announced it here! If he did, I wouldn't be wasting my time almost trying to reinvent what he did. (May be he wanted to announce it only when he thinks it is mature?)

I spent yesterday looking at Tufte CSS & pandoc-sidenotes and trying
to incorporate them into my site. They're nice ideas, but my
impression is that they are far from mature.

Tufte CSS is hard to use because it doesn't commentate any of the CSS
declarations, so it's difficult to know what parts you want to use if
you don't want to use the entire thing and every last class it
defines. It doesn't define them in neat self-contained files, or at
least chunk them cleanly in the master CSS file.

The implementation for various parts are scattered throughout the CSS
file in hardcoded declarations; the sidenotes, for example, use CSS
from everywhere inside it (and it's important that various hardcoded
numbers line up, like the `width:` of the main body and the sidenote
elements and margins). This makes it hard to understand and harder to
copy.

The Tufte CSS sidenotes implementation also seems to be
buggy/incomplete. When I experimented with it on gwern.net, it had
problems with not wrapping ordered/unordered lists and indented
subparagraphs, which then fill out the full margin. (It could be an
interaction with my other CSS but I don't see any examples of them in
the Tufte CSS demo, so I think they haven't tried to support them or
realized that it works only with a small subset of HTML/Markdown.)
Aside from not playing well with any additional CSS styling of
elements like blockquotes (add a background-color to blockquotes for
emphasis, and the coloring stretches all the way to the edge of the
page), which seems to be because it only applies `margin: 65%` or
whatever to the top-level paragraph and table elements but excludes
children. Or something. (CSS, man, how does it work?) I was sort of
able to fix it by a weird hack using `:not()` to exclude blockquotes
from the main margin declaration and applying that separately.

pandoc-sidenotes also has some issues. It couldn't be used in Hakyll
because it didn't export the `Pandoc -> Pandoc` core function, but
after I fixed that & pushed a modularized version of pandoc-sidenotes
and got it working with the modified Tufte CSS, after a great deal of
CSS tweaking, I realized it wasn't rendering *all* of `Pandoc` - it
only handles paragraph elements: it deletes blockquotes and codeblocks
and unordered/ordered lists,  and presumably everything else as well
like math blocks.

Author knows but doesn't know how to fix it:
https://github.com/jez/pandoc-sidenote/issues/4 I can't use
pandoc-sidenote until that's fixed since blockquotes and codeblocks
are a primary use of footnotes for me.

I was able to borrow the sans font suggestions; and after adding an
additional `<div>` to my Hakyll template, I was also able to borrow
the hyperlink-underlining improvement too, which are both nice.

-- 
gwern
https://www.gwern.net


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-12-07 18:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-06 15:25 Tufte CSS and pandoc Kolen Cheung
     [not found] ` <07a2781b-6ae3-45de-b80a-93b1774dd66c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-12-07 18:08   ` Gwern Branwen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).