playframework.com icon indicating copy to clipboard operation
playframework.com copied to clipboard

Source code link broken for non-playframework documentation

Open gmethvin opened this issue 9 years ago • 2 comments

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

  • PlaySlick: https://github.com/playframework/playframework/blob/2.5.x/documentation/manual/working/scalaGuide/main/sql/slick/PlaySlick.md
  • ScalaAnorm: https://github.com/playframework/playframework/blob/2.5.x/documentation/manual/working/scalaGuide/main/sql/ScalaAnorm.md

gmethvin avatar Apr 24 '16 22:04 gmethvin

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

Dulya avatar Oct 11 '17 17:10 Dulya

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.

gmethvin avatar Oct 12 '17 01:10 gmethvin