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

exporting documentation to json does not work properly #8495

Open
timotheecour opened this issue Aug 1, 2018 · 4 comments
Open

exporting documentation to json does not work properly #8495

timotheecour opened this issue Aug 1, 2018 · 4 comments
Labels
Documentation Generation Related to documentation generation (but not content).

Comments

@timotheecour
Copy link
Member

./koch web --onlyDocs --json2 --git.commit=devel --onlyDocs -o:/tmp/d30

generates /tmp/d30/docs/theindex.html instead of /tmp/d30/docs/theindex.json

I need theindex.json to allow tooling to search for symbols.

(none of the alternatives I tried work in a satisfactory way, eg: see #7419)

(opening the html in browser and search via cmd+F just isn't a good solution, I need regex; plus, opening in browser is slow especially on that file)

NOTE: ./koch doc --help shows nimweb documentation:
--json2 build JSON of the documentation but doesn't work as shown above

@Araq
Copy link
Member

Araq commented Aug 1, 2018

Btw you need a working 'nimsuggest' for your editor. ;-)

@timotheecour
Copy link
Member Author

timotheecour commented Aug 1, 2018

I'm using sublimetext (as many others, not everyone is using vim or visual studio), but the nim sublimetext plugin NimLine has been broken since > 1 month, see nim-lang/NimLime#99 ; here I diagnose the root cause back to a nimsuggest bug: nim-lang/nimsuggest#83

Regardless of editor integration, there should be a cmd line way to search for symbol declarations (including types, enum values etc). Can nimsuggest be used for that purpose on cmd line?
eg: nimsuggest search '\bclearBi\w+' (ie search symbol using regex; while also following case insensitivity)

If so, this bug is not as important (maybe; there could be other use cases)

@rayman22201
Copy link
Contributor

I got nim jsondoc to work, but it doesn't really do what I thought it does.
jsondoc produces one json file per nim file, and doesn't really produce any kind of index.
This may be useful for tooling / a docsearch server type thing... but doesn't really help the client side search.
I think I should go back to the plan of creating a new json format for theindex inside the rst parser.

jsondoc seems kind of orphaned actually

The other option is to maybe expand jsondoc to provide more data, similar to ctags?
adding in json fields for proc parameters for example...

Though it seems like the compiler api / nimsuggest is a better / more dynamic solution that.

@krux02
Copy link
Contributor

krux02 commented Oct 20, 2018

Information like "needed to get theindex.json for tooling" does not belong in the title.

@krux02 krux02 changed the title [search] --json2 doesn' work with ./koch web (needed to get theindex.json for tooling) exporting documentation to json does not work properly Oct 20, 2018
@krux02 krux02 added Documentation Generation Related to documentation generation (but not content). and removed Tools labels Oct 28, 2018
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