playframework / playframework.com

The Play Framework website
https://playframework.com/
Apache License 2.0
43 stars 65 forks source link

Source code link broken for non-playframework documentation #86

Open gmethvin opened 8 years ago

gmethvin commented 8 years ago

The source code link at the bottom of the documentation seems to assume it is in the playframework repo, for example:

Dulya commented 7 years ago

User should be pointed to an external repository. Do we store the source repository url related to a module?

gmethvin commented 7 years ago

This issue probably needs a bit more explanation of how the documentation system works. Unfortunately there are parts of the process that are not well documented.

Here's what happens:

  1. The documentation is written in individual repositories. Originally this was just https://github.com/playframework/playframework/, but over the past few years we've broken out external modules not part of the core of Play (play-json, scalatestplus-play, play-slick, play-ebean, anorm). This is where we want to link from the website.
  2. We use the playdoc sbt plugin to take the documentation structure and publish an artifact with the playdoc classifier. For example you'll notice the playdoc jars along with sources and javadoc here: http://central.maven.org/maven2/com/typesafe/play/play-json_2.12/2.6.6/
  3. We use omnidoc to merge this structure and create the full rendered documentation. The most relevant code is probably here: https://github.com/playframework/omnidoc/blob/2.6.6/project/OmnidocBuild.scala#L209
  4. The omnidoc/bin/deploy script is used to deploy the rendered docs to https://github.com/playframework/play-generated-docs, which is used by the website.

One way to solve this issue would be to add an additional task to the extraction stage at omnidoc that adds a footer to the markdown documents (in other words, this link will be in the generated docs, not on the website). Another way would be to introduce a file in the generated docs that maps individual page paths to their source repositories. This information could then be used by the Play website to decide which repo should be linked.