You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes. But I do not like github wikis (as we cannot refer to different versions) and so what we could do is use something similar we use for our Directions API docs: mkdocs
To get inline and up-to-date code documentation, my (little) experience is that it's best to have documentation directives in the code, and then auto-build the documentation (e.g. Sphinx). The reason being that if I'm e.g. developing a function, it's easy enough to just tweak the docstring, but I'm probably going to be too lazy to dig up the documentation file and tweak it.
You could get versioning by using readthedocs etc. I think that's per-release, but you can probably configure something so that the current state of the the master branch is also viewable.
Unfortunately, I'm not familiar enough with Java to recommend which documentation builder to use. (Though I see Sphinx has a java plugin.)
All the documentation source would be in git, so they can "read and edit it" - is that what you mean? It wouldn't be pretty (e.g. just markdown), but that's the point of the published version. That'd be a nice separation.
Yes, sounds like a similar approach like it would be with the linked mkdocs
The reason being that if I'm e.g. developing a function, it's easy enough to just tweak the
docstring, but I'm probably going to be too lazy to dig up the documentation file and tweak it.
Do you mean one could embed an example of code in the source code and it would 'somehow' appear in the docs?
Not really, as both is Java code and automatically refactored and test would fail to compile or run.
Sure, IDE's can handle trivial refactoring, but much of the time you'll be stuck having to manually maintain them. The fact that tests fail / don't compile is my point: we want that for documentation.
This issue was more meant to create a better structure of the docs and also make examples in the documentation properly working even after refactoring.
Of course, improving documentation is always good and nice. The best thing is if new developers ask questions and get answers and then they condense their new knowledge into a pull request which we can together improve step by step. If I would just add more docs I would not know which parts are important to go into detail etc
the lack of clear documentation makes contribution for new developers difficult
For me, the lack of javadoc documentation made it quite hard. I think what we need are is a javadoc convention that applies to all new contributions. I would suggest to adopt the javadoc rules from the Google Java Style Guide. Should we discuss javadoc documentation in a separate issue?
That is the javadocs that we automatically create already. What I meant is a code snippet that we could directly integrate in the docs and would automatically refresh itself somehow :) if the referenced/underlying code changes.
If/when using the Maven site plugin to generate html docs you can use code snippets; you add special comments to the source code and create a reference in the doc page source.
I've used this before but only on APT sourced pages, not sure how good the support of macro's is in other supported markup flavors...
Apparently current versions of Doxia support macro's in markdown as well:
Macros are currently only supported for APT, Xdoc and FML formats. Starting with Doxia 1.7 (maven-site-plugin 3.5), macros are also supported for XHTML and Markdown. Macros are not (and probably will never be) supported by Confluence, Docbook and Twiki modules.
Should we discuss javadoc documentation in a separate issue?
Yes, and a rule like this sounds really good!
If/when using the Maven site plugin to generate html docs you can use code snippets;
Wow, this looks nice - now the question is: will it be refactored by e.g. IntelliJ or Netbeans :) ? Maybe we should create a separate 'docs module' with sources only for documentation purposes? E.g. how to do simple routing or fetch some results from a LocationIndex or link to already existing unit tests that show these tasks from the docs?
Sounds good all round. One comment - when evaluating solutions, we may need to e.g. refer to some GH code from within map-matching, and I'm not sure if that'll be supported. That, or we e.g. merge map-matching into the GH repo.
Activity
[-]Updated documentation[/-][+]Update documentation[/+]improved docs to match master #774
karussell commentedon Sep 12, 2016
I'm not that happy with the documentation right now. So if someone has an idea how we can:
this would be awesome!
no need to add a snapshot repo #774
devemux86 commentedon Sep 12, 2016
You mean the GitHub Wikis?
karussell commentedon Sep 12, 2016
Yes. But I do not like github wikis (as we cannot refer to different versions) and so what we could do is use something similar we use for our Directions API docs: mkdocs
kodonnell commentedon Sep 12, 2016
@karussell - is hosting on github required?
To get inline and up-to-date code documentation, my (little) experience is that it's best to have documentation directives in the code, and then auto-build the documentation (e.g. Sphinx). The reason being that if I'm e.g. developing a function, it's easy enough to just tweak the docstring, but I'm probably going to be too lazy to dig up the documentation file and tweak it.
You could get versioning by using readthedocs etc. I think that's per-release, but you can probably configure something so that the current state of the the master branch is also viewable.
Unfortunately, I'm not familiar enough with Java to recommend which documentation builder to use. (Though I see Sphinx has a java plugin.)
karussell commentedon Sep 12, 2016
@kodonnell Thanks for the input.
It is important that all can read and edit it there, yes. But we could host it somewhere else as 'main entry'.
kodonnell commentedon Sep 12, 2016
All the documentation source would be in git, so they can "read and edit it" - is that what you mean? It wouldn't be pretty (e.g. just markdown), but that's the point of the published version. That'd be a nice separation.
karussell commentedon Sep 12, 2016
Yes, sounds like a similar approach like it would be with the linked mkdocs
Do you mean one could embed an example of code in the source code and it would 'somehow' appear in the docs?
kodonnell commentedon Sep 12, 2016
Here's an example using javadoc:
It's not actually a very nicely presented one - you can usually configure how it looks, including having more generic helpful documentation, etc.
Yes, I think so. Examples are included above (source - line 1554 of above, doco).
I don't think mkdocs actually strips documentation out from code files.
Revert "no need to add a snapshot repo #774"
8 remaining items
kodonnell commentedon Oct 10, 2016
Sure, IDE's can handle trivial refactoring, but much of the time you'll be stuck having to manually maintain them. The fact that tests fail / don't compile is my point: we want that for documentation.
kodonnell commentedon Nov 30, 2016
The lack of clear documentation makes contribution for new developers difficult - see e.g. discussion here. So maybe this is higher priority?
karussell commentedon Nov 30, 2016
This issue was more meant to create a better structure of the docs and also make examples in the documentation properly working even after refactoring.
Of course, improving documentation is always good and nice. The best thing is if new developers ask questions and get answers and then they condense their new knowledge into a pull request which we can together improve step by step. If I would just add more docs I would not know which parts are important to go into detail etc
stefanholder commentedon Dec 1, 2016
For me, the lack of javadoc documentation made it quite hard. I think what we need are is a javadoc convention that applies to all new contributions. I would suggest to adopt the javadoc rules from the Google Java Style Guide. Should we discuss javadoc documentation in a separate issue?
mprins commentedon Dec 1, 2016
If/when using the Maven site plugin to generate html docs you can use code snippets; you add special comments to the source code and create a reference in the doc page source.
I've used this before but only on APT sourced pages, not sure how good the support of macro's is in other supported markup flavors...
mprins commentedon Dec 1, 2016
Apparently current versions of Doxia support macro's in markdown as well:
link
karussell commentedon Dec 1, 2016
Yes, and a rule like this sounds really good!
Wow, this looks nice - now the question is: will it be refactored by e.g. IntelliJ or Netbeans :) ? Maybe we should create a separate 'docs module' with sources only for documentation purposes? E.g. how to do simple routing or fetch some results from a LocationIndex or link to already existing unit tests that show these tasks from the docs?
karussell commentedon Dec 1, 2016
Also what to comment and what not is important and this is a good read: https://visualstudiomagazine.com/articles/2013/06/01/roc-rocks.aspx
stefanholder commentedon Dec 1, 2016
I just created #891, where we can further discuss javadoc documentation.
mprins commentedon Dec 1, 2016
also there's a doclet: https://github.com/jtulach/codesnippet4javadoc to get code snippets in the javadoc, eg from test cases into test javadoc if you will
kodonnell commentedon Dec 1, 2016
Sounds good all round. One comment - when evaluating solutions, we may need to e.g. refer to some GH code from within map-matching, and I'm not sure if that'll be supported. That, or we e.g. merge map-matching into the GH repo.
karussell commentedon Jan 22, 2017
Here is another interesting project: https://github.com/Abnaxos/pegdown-doclet where one can write markdown directly in the javadocs, even with code blocks known from github
remove code in isochrone docs further until graphhopper#774 is fixed
(WIP) Isochrone documentation (#1303)