fpinkotlin / fpinkotlin

Source code listings and exercises for Functional Programming in Kotlin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rendering issues for the PDF

narko opened this issue · comments

val purchases: List<Pair<Coffee, Charge>> = List(n) { buyCoffee(cc) } // <1>

In the sample PDF this line shows an indentation issue. Ideally this can be solved by breaking the line earlier?

Sure, maybe everything after = a new line?

That would work :) Thanks!

So it turns out that Asciidoc wraps when it reaches 74 chars with the Manning styles.

Here is what I've done to address this:

  • code style for IDEA updated to 2 character tab and indent (takes effect when importing project)
  • all code reformatted with new format settings
  • line wraps introduced where the above did not bring it within 74 char width

Please shout if you see any other weirdness!

Update: I ended up find a better solution by asking around on the Asciidoctor forums if there was a way to prevent the code from being indented. It turns out that Asciidoctor provides this by way of an indent attribute that can be passed into an include directive. This means that we don't need to do something as invasive as tampering with all the source code formatting. So I've reverted my reformat commits and done more subtle tweaks. I've also added this indent attribute on all include directives, which seems to have done the trick.