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

Docs shouldn't collapse pragmas inside runnableExamples/code blocks #14174

Closed
metagn opened this issue Apr 30, 2020 · 1 comment · Fixed by #14385
Closed

Docs shouldn't collapse pragmas inside runnableExamples/code blocks #14174

metagn opened this issue Apr 30, 2020 · 1 comment · Fixed by #14385

Comments

@metagn
Copy link
Collaborator

metagn commented Apr 30, 2020

Example

template byaddr*(lhs, typ, ex) =
  ## Allows a syntax for lvalue reference, exact analog to
  ## `auto& a = ex;` in C++
  runnableExamples:
    var s = @[10,11,12]
    var a {.byaddr.} = s[0]
    a+=100
    doAssert s == @[110,11,12]
    doAssert a is int
    var b {.byaddr.}: int = s[0]
    doAssert a.addr == b.addr

Current Output

image

Expected Output

image

Additional Information

@metagn metagn changed the title Docs collapse pragmas inside runnableExamples Docs shouldn't collapse pragmas inside runnableExamples/code blocks Apr 30, 2020
@timotheecour
Copy link
Member

timotheecour commented May 9, 2020

auto-collapsed pragmas (at least as currently implemented) is a misfeature IMO. I keep clicking on uncollapse in docs so it ends up wasting more time that it saves in "cosmetics".
Either we disable the collapsing, or we refine the blacklist to only collapse a very short list, eg:

  • raises: []
  • tags: []
    and maybe a few more, but that's it

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

Successfully merging a pull request may close this issue.

2 participants