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

Verbatim bugs #71

Closed
dbuenzli opened this issue Mar 14, 2017 · 5 comments
Closed

Verbatim bugs #71

dbuenzli opened this issue Mar 14, 2017 · 5 comments
Labels
bug Something isn't working output parser
Milestone

Comments

@dbuenzli
Copy link
Contributor

odoc chokes on topkg's use of verbatims. @trefis thinks this is an octavius bug:

opam pin add topkg https://github.com/dbuenzli/topkg.git#1bcd6ca66f81c7306ec424aa5b8988c4a39edb94
odig odoc topkg
Error src/topkg.mli, line 747, col 44 to line 747, col 45: text expected
Error src/topkg.mli, line 1956, col 61 to line 1956, col 62: unmatched ']'

The corresponding lines are
https://github.com/dbuenzli/topkg/blob/1bcd6ca66f81c7306ec424aa5b8988c4a39edb94/src/topkg.mli#L747
https://github.com/dbuenzli/topkg/blob/1bcd6ca66f81c7306ec424aa5b8988c4a39edb94/src/topkg.mli#L1956

Note that this breaks a significant part of topkg's documentation as it drops all the remaining sections of the docs which in turns breaks many internal links to them.

Worked around by turning a few of these verbatims into code fences in dbuenzli/topkg@56c82f7

@dbuenzli dbuenzli added bug Something isn't working doc-usability parser labels Mar 14, 2017
@dbuenzli
Copy link
Contributor Author

Note that it would be quite nice to review #39 at the same time for the release.

@trefis
Copy link
Contributor

trefis commented Mar 15, 2017

OK, the problem is that in strings like this one:

{v
"--dev-pkg" "%{dev}%"    # for opam >= 2.0
"--dev-pkg" "%{pinned}%" #           < 2.0 v}

The verbatim block is terminated by the v} in "%{dev}%".

This could be improved by requiring some kind of blank just before the terminator (which, I think, is what ocamldoc does).
Until it is though, you can just escape the }, which ocamldoc will support as well. So "%{dev\}%".

@trefis
Copy link
Contributor

trefis commented Mar 15, 2017

Btw, the change to better handle blanks at the beginning/end of verbatim block is exactly the same as the one needed for preformatted code blocks. And will be fixed at the same time. But not before the release.

@dbuenzli
Copy link
Contributor Author

(which, I think, is what ocamldoc does).

Yes ocamldoc has no issues with the above.

@avsm avsm unassigned lpw25 Mar 21, 2018
@aantron aantron added this to the 1.3.1 milestone Oct 26, 2018
@aantron
Copy link
Contributor

aantron commented Oct 31, 2018

The commit linked above fixes this. There is a new test,

t "nested-closer-with-word" "{v {dev} v}";

which checks that a correct comment AST is produced:

((output (ok (((f.ml (1 0) (1 11)) (verbatim {dev}))))) (warnings ()))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working output parser
Projects
None yet
Development

No branches or pull requests

4 participants