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

feature request: html output, div around line block #1623

Closed
uvtc opened this issue Sep 11, 2014 · 8 comments
Closed

feature request: html output, div around line block #1623

uvtc opened this issue Sep 11, 2014 · 8 comments

Comments

@uvtc
Copy link

uvtc commented Sep 11, 2014

I'd like for the html output of line blocks to have a div around them so that I can style them.

That is, I'd like this:

| this
| that

to produce html like <div class="line-block">this<br/>that</div>, rather than <p>this<br/>that</p>.

Currently, to get something similar I need to do:

<div class="line-block">

| this
| that

</div>

(newlines required) but, of course, that still keeps the <p>'s around the line block.

@jgm
Copy link
Owner

jgm commented Sep 11, 2014

Eventually I'd like to introduce a native LineBlock
element, which would make this possible. But currently
line blocks just get parsed to paragraphs with line breaks.

+++ John Gabriele [Sep 11 14 13:54 ]:

I'd like for the html output of line blocks to have a div around them so that I can style them.

That is, I'd like this:

| this
| that

to produce html like <div class="line-block">this<br/>that</div>, rather than <p>this<br/>that</p>.

Currently, to get something similar I need to do:

<div class="line-block">

| this
| that

</div>

(newlines required) but, of course, that still keeps the <p>'s around the line block.


Reply to this email directly or view it on GitHub:
#1623

@mb21
Copy link
Collaborator

mb21 commented Jan 23, 2017

We have a LineBlock element now, but the HTML writer doesn't emit a special class:

$ pandoc
| this
| that


<div style="white-space: pre-line;">this
that</div>

@jgm jgm closed this as completed Mar 5, 2017
@uvtc
Copy link
Author

uvtc commented Mar 5, 2017

Can I now style the lineblock from my css without adding any special html to my source file?

@mb21
Copy link
Collaborator

mb21 commented Mar 6, 2017

@jgm was this closed in error?

The proposal is to remove style="white-space: pre-line from the div and add class="lineblock" instead. Analogous to what we did for the smallcaps...

@jgm jgm reopened this Mar 6, 2017
@jgm
Copy link
Owner

jgm commented Mar 6, 2017

Okay.
@uvtc did you want to override the style="white-space: pre-line" or add additional styling?
In the latter case there's also the option of keeping the style and adding the class. This would mean we don't depend on special CSS definitions in the template, and documents processed using old templates don't break. Not sure what is best here...

@jgm jgm added this to the pandoc 2.0 milestone Mar 6, 2017
@uvtc
Copy link
Author

uvtc commented Mar 6, 2017

I wanted to add additional styling (for example, a thick border-left) --- otherwise, line blocks tend to blend in and look too much like regular paragraphs.

@mb21
Copy link
Collaborator

mb21 commented Mar 6, 2017

Speaking as a web dev, personally, I was never really comfortable with the style attribute...

@jgm
Copy link
Owner

jgm commented Mar 11, 2017

I'd be okay with using a div with class and adding CSS to the templates.
We'd need a small change in the HTML writer, plus changes to the styles in

default.html5
default.html4
default.epub2
default.epub3
default.revealjs
default.s5
default.slideous
default.slidy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants