Re: Doc generation fails
This issue is now fixed on devel, but there's another regression with `nim doc` \+ `runnableExamples`: [https://github.com/nim-lang/Nim/issues/14485](https://github.com/nim-lang/Nim/issues/14485) .
Re: Doc generation fails
I have reported this in issue [https://github.com/nim-lang/Nim/issues/14473](https://github.com/nim-lang/Nim/issues/14473) . Thanks for providing that minimal example.
Re: Doc generation fails
I have seen a similar issue on nim devel too. I am trying to create a reproducible example for that. I also see runnableExamples trying to get executed from sequtils.. My Nim module does import sequtils, but there are no runnableExamples in it. Also, I think this issue happens when I have \--path switches in my config.nims .. the nim doc doesn't seem to find modules that are specified via \--path or \--NimblePath. It only recognizes packages installed in the default ~/.nimble.
Re: Doc generation fails
This happens on nim devel (the version should be 1.3.5). I see that you are using nim stable 1.2.0.
Re: Doc generation fails
hmm... I did not occured error. My environment is here. $ nim --version Nim Compiler Version 1.2.0 [Linux: amd64] Compiled at 2020-04-03 Copyright (c) 2006-2020 by Andreas Rumpf active boot switches: -d:release Run ⟩ cat /etc/os-release NAME="Ubuntu" VERSION="19.10 (Eoan Ermine)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 19.10" VERSION_ID="19.10" HOME_URL="https://www.ubuntu.com/; SUPPORT_URL="https://help.ubuntu.com/; BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/; PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy; VERSION_CODENAME=eoan UBUNTU_CODENAME=eoan Run ⟩ cat main.nim import sequtils template doit():untyped = ## doit ## return output only toSeq([1,2,3,4,5]) echo doit() /tmp ⟩ nim doc main.nim Hint: used config file '/home/vagrant/.choosenim/toolchains/nim-1.2.0/config/nim.cfg' [Conf] Hint: used config file '/home/vagrant/.choosenim/toolchains/nim-1.2.0/config/nimdoc.cfg' [Conf] Hint: system [Processing] Hint: widestrs [Processing] Hint: io [Processing] Hint: main [Processing] Hint: sequtils [Processing] Hint: macros [Processing] Hint: 17834 LOC; 0.108 sec; 15.91MiB peakmem; Debug build; proj: /tmp/main.nim; out: /tmp/main.html [SuccessX] Run
Re: Doc generation fails
Here a mini example which displays this error on nim-devel : #cxtimeb.nim import sequtils template doit():untyped = ## doit ## return output only toSeq([1,2,3,4,5]) echo doit() Run Output ok : @[1, 2, 3, 4, 5] Run nim doc cxtimeb.nim /home/lxuser/.cache/nim/cxtimeb_d/runnableExamples/cxtimeb_examples1.nim(15, 12) Error: undeclared identifier: 'toSeq' [runnableExamples] failed: generated file: '/home/lxuser/.cache/nim/cxtimeb_d/runnableExamples/cxtimeb_group0_examples.nim' group: '(rdoccmd: "", docCmd: "" Run
Re: Doc generation fails
There are no runnableExamples in my module. The module imports sequtils The only way I found to circumvent this error in docgen is to add following line in my module : export sequtils Run I think this should not be required.
Re: Doc generation fails
I want to watch code of cxtimeb.nim.
Doc generation fails
After most recent improvements to doc generation I see this error running nim doc : /home/lxuser/.cache/nim/cxtimeb_d/runnableExamples/cxtimeb_examples1.nim(15, 12) Error: undeclared identifier: 'toSeq' [runnableExamples] failed: generated file: '/home/lxuser/.cache/nim/cxtimeb_d/runnableExamples/cxtimeb_group0_examples.nim' group: '(rdoccmd: "", docCmd: "", code: "# autogenerated by docgen\n# Run There are no runnableExamples in cxtimeb.nim . The module itself compiles and works fine. The autogenerated cxtimeb_examples1.nim does not import sequtils hence toSeq causes an error.
Re: Doc generation fails
Is there `import sequtils` in runnableExamples? runnableExamples: import sequtils echo toSeq(1..10) Run