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

Initial and trailing whitespace on code fences and verbatim #39

Closed
dbuenzli opened this issue Dec 30, 2016 · 2 comments
Closed

Initial and trailing whitespace on code fences and verbatim #39

dbuenzli opened this issue Dec 30, 2016 · 2 comments
Labels

Comments

@dbuenzli
Copy link
Contributor

This is certainly due to an underspecification of the ocamldoc language. As you can see here:

http://docs.mirage.io/cmdliner/Cmdliner/index.html#basics
http://erratique.ch/software/cmdliner/doc/Cmdliner#basics

The first code fence has no initial white line, but the second has. This is the result of writing the first one as:

{[mycode]}

and the second one as:

{[
mycode]}

or

{[
mycode
]}

The last two forms are essential for code fences and verbatims that span more than one-line otherwise you cannot write your code sample properly aligned and indented in your sources which makes the source less readable:

{[let x = 3
let y = 4]}

you really want to write:

{[
let x = 3
let y = 3
]}

I'm not sure which rules ocamldoc follows exactly but my gut feeling is that you should simply ignore a newline just after {[ and {v and just before ]} and v}.

(This is not visible for trailing newlines in the html because at that point you end up a block-level element anyways).

@aantron
Copy link
Contributor

aantron commented Oct 11, 2017

Indeed, I agree with this reasoning, as per ocaml-doc/octavius#6.

@lpw25
Copy link
Contributor

lpw25 commented Oct 12, 2017

Since that PR is merged into octavius I'll close this issue.

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

No branches or pull requests

4 participants