[ https://issues.apache.org/jira/browse/SPARK-10382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14952171#comment-14952171 ]
Xusen Yin commented on SPARK-10382: ----------------------------------- Yes, the simplest way to use it is modifying the _config.yml, add a line -octopress-render-code. So we can use render_code in current markdown files directly. I have tested it. It works. I'll grab the code out and modify it because we will add new functions such as locating the code snippet with label, other than line number. > Make example code in user guide testable > ---------------------------------------- > > Key: SPARK-10382 > URL: https://issues.apache.org/jira/browse/SPARK-10382 > Project: Spark > Issue Type: Brainstorming > Components: Documentation, ML, MLlib > Reporter: Xiangrui Meng > Assignee: Xusen Yin > Priority: Critical > > The example code in the user guide is embedded in the markdown and hence it > is not easy to test. It would be nice to automatically test them. This JIRA > is to discuss options to automate example code testing and see what we can do > in Spark 1.6. > One option I propose is to move actual example code to spark/examples and > test compilation in Jenkins builds. Then in the markdown, we can reference > part of the code to show in the user guide. This requires adding a Jekyll tag > that is similar to > https://github.com/jekyll/jekyll/blob/master/lib/jekyll/tags/include.rb, > e.g., called include_example. > {code} > {% include_example scala ml.KMeansExample guide %} > {code} > Jekyll will find > `examples/src/main/scala/org/apache/spark/examples/ml/KMeansExample.scala` > and pick code blocks marked "guide" and put them under `{% highlight %}` in > the markdown. We can discuss the syntax for marker comments. > Just one way to implement this. It would be nice to hear more ideas. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org