Code Monkey home page Code Monkey logo

Comments (9)

jgm avatar jgm commented on August 15, 2024

Andrea has added this feature in
e24ce1c
so you can compile the github version to test it.
The first paragraph after a header will have style "First paragraph" instead of "Text body."
Note that sometimes the first paragraph after a header comes after a non-paragraph block, such as a list or code block; in this case it still gets the "First paragraph" style. In this and a few other cases, you may need to do some manual tweaking, but this should help.

from pandoc.

bdarcus avatar bdarcus commented on August 15, 2024

Cool!

Given my previous problems with ghc and cabal, any tips on how best to compile and test the version without screwing up my setup (again)? I presume I'd want to compile it to a local directory and test there, but am not sure how.

On the logic of the application, I think it's probably generally reasonable to apply the behavior to all following paragraphs. So, for example, it would get applied to the first paragraph following a block (like a blockquote).

When I deal with this in HTML, I normally just have a CSS rule like:

p + p { /* indent first line */ }

from pandoc.

jgm avatar jgm commented on August 15, 2024

Just clone the repository, cd to it, and 'cabal install'.
I wouldn't expect problems if you've been able to do 'cabal install
pandoc' without problems.

+++ bdarcus [Mar 12 11 13:59 ]:

Cool!

Given my previous problems with ghc and cabal, any tips on how best to compile and test the version without screwing up my setup (again)? I presume I'd want to compile it to a local directory and test there, but am not sure how.

#20 (comment)

from pandoc.

bdarcus avatar bdarcus commented on August 15, 2024

OK, compiled fine.

Comments:

Right now, the "First Paragraph" style doesn't get applied to the first paragraph after blocks, so the consequence is that paragraphs immediately following blockquotes and lists, for example, are indented (if I change the body text style to do first-line indent).

Is there any reason not to have done it the other way around: body text for first after block, and then all other paragraphs with "First Line Indent"?

from pandoc.

jgm avatar jgm commented on August 15, 2024

Sometimes an author wants a new paragraph after a blockquote or list, sometimes not. There is no way for pandoc to tell which is intended. So the only question is what is the best default. Let me run this by Andrea.

from pandoc.

arossato avatar arossato commented on August 15, 2024

I'm not sure I understand the problem here. Bruce said:

Right now, the "First Paragraph" style doesn't get applied to the first paragraph after blocks, so the consequence is that paragraphs immediately following blockquotes and lists, for example, are indented (if I change the body text style to do first-line indent).

This is not correct: the first text paragraph immediately following blockquotes or a list paragraph will have a "First paragraph" style. So, if "Text body" has a first line indent, the paragraph after a blockquote will not have the first line indented.

Is there any reason not to have done it the other way around: body text for first after block, and then all other paragraphs with "First Line Indent"?

Yes, there is -- even though I don't know if it is reasonable: the fact is that it is the first paragraph of a section which needs some kind of special treatment (not having the first line indented). So I prefer to keep the normal paragraph as "Text body" and use a special style only for the first paragraph.

from pandoc.

bdarcus avatar bdarcus commented on August 15, 2024

If I run the below test doc, only "one" gets "First Paragraph", where I also expect "three" and "four."

So I'm seeing something different than you are, I guess?

# Introduction

one

two

> block

three

* x
* y
* z

four

five

from pandoc.

arossato avatar arossato commented on August 15, 2024

Sorry I didn't understand. I've sent John a patch that sets the "First paragraph" style for every paragraph immediately following a section heading or definition, ordered and unordered lists.

The first paragraph will not be used after tables, code blocks and horizontal rule. It is easy to change the behavior of the code though.

from pandoc.

jgm avatar jgm commented on August 15, 2024

I've pushed the patch, with modifications to include tables, code blocks, and horizontal rules. (I think it makes sense to make the behavior consistent and predictable.) I also moved 'setFirstPara' from 'inHeaders' to 'blockToOpenDocument', so you can see at a glance which blocks reset this. I'll close this unless someone thinks there's still more to do.

from pandoc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.