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

The file 'dochack.js' not generated with the documentation #8952

Closed
sodic opened this issue Sep 12, 2018 · 3 comments
Closed

The file 'dochack.js' not generated with the documentation #8952

sodic opened this issue Sep 12, 2018 · 3 comments
Labels
Documentation Generation Related to documentation generation (but not content).

Comments

@sodic
Copy link

sodic commented Sep 12, 2018

The doc and doc2 commands produce an HTML document which relies on a file named dochack.js. Since the commands do not generate this file, most of the documentation's dynamic functionalities are broken.

Minimal example

Make a file called sample.nim with the following content:

## This module is a sample

proc foo*(bar: int): int = 
  ## Adds 1 to the provided bar.
  bar + 1

Run the doc commands as described in the official documentation:

nim doc sample.nim

Open the generated sample.html file and try to group entries or use the search bar. The operation should fail and an error should be reported in the console.

Conclusion

  • If this is a bug, nothing else needs to be said.
  • If this is an improper/incoplete way to go about generating documentation and the file is indeed present when the docs are generated in a proper manner, I believe the online documentation should be updated.
  • If this is the intended behavior and those dynamic functionalities should be disabled by default (e.g. a flag needs to be added to generate the dochack.js file), that should also be mentioned in the online docgen documentation. In addition, I would propose to disable said functionalities in a more obvious way like not having them appear in the HTML at all (instead of them silently failing).
@andreaferretti andreaferretti added Tools Documentation Content Related to documentation content (not generation). labels Sep 12, 2018
@timotheecour
Copy link
Member

timotheecour commented Oct 21, 2018

dochack.js is not enough; theindex.html is also needed:

nim doc -o:htmldocs --project --index:on pathto/main.nim
nim js -o:htmldocs/dochack.js $nimc_D/tools/dochack/dochack.nim
open htmldocs/main.html # in chrome
# open developper tools; type something in search bar; shows error that theindex.html is missing

@krux02 krux02 added Documentation Generation Related to documentation generation (but not content). and removed Documentation Content Related to documentation content (not generation). labels Oct 21, 2018
@krux02 krux02 removed the Tools label Oct 28, 2018
@Araq
Copy link
Member

Araq commented Jan 13, 2019

Now it's built with koch docs.

@Araq Araq closed this as completed Jan 13, 2019
@timotheecour
Copy link
Member

timotheecour commented Jan 13, 2019

verified this now works locally including search:

./koch docs
python -m SimpleHTTPServer 9009
open http://localhost:9009/md5.html
# now search works

EDIT: /cc @Araq
we could also support search in docs for third party libs, not just for Nim's docs; ie, nim doc --project should take care of this, not specialized by ./koch docs
so shall we re-open and label as low-priority ?

mjfh added a commit to status-im/nimbus-eth1 that referenced this issue Jan 18, 2022
why:
  Some helper file will not be generated by the nim document gereator,
  so they have been stashed from a later nim version to be provided when
  missing.

  This problem was known with an earlier nim version (see here
  nim-lang/Nim#8952) but was reported solved.
  Maybe we need a second look into that.
zah pushed a commit to status-im/nimbus-eth1 that referenced this issue Jan 22, 2022
why:
  Some helper file will not be generated by the nim document gereator,
  so they have been stashed from a later nim version to be provided when
  missing.

  This problem was known with an earlier nim version (see here
  nim-lang/Nim#8952) but was reported solved.
  Maybe we need a second look into that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Generation Related to documentation generation (but not content).
Projects
None yet
Development

No branches or pull requests

5 participants