You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2016/06/29 11:50:37 UTC

[jira] [Commented] (SPARK-16294) Labelling support for the include_example Jekyll plugin

    [ https://issues.apache.org/jira/browse/SPARK-16294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15355077#comment-15355077 ] 

Apache Spark commented on SPARK-16294:
--------------------------------------

User 'liancheng' has created a pull request for this issue:
https://github.com/apache/spark/pull/13972

> Labelling support for the include_example Jekyll plugin
> -------------------------------------------------------
>
>                 Key: SPARK-16294
>                 URL: https://issues.apache.org/jira/browse/SPARK-16294
>             Project: Spark
>          Issue Type: Sub-task
>          Components: Documentation
>    Affects Versions: 2.0.0
>            Reporter: Cheng Lian
>            Assignee: Cheng Lian
>
> Part of the Spark programming guide pages are using the {{include_example}} Jekyll plugin to extract line blocks surrounded by {{example on}} and {{example off}} tag pairs (usually written as comments) from source files under the {{examples}} sub-project.
> One limitation of the {{include_example}} plugin is that all line blocks within a single file must be included in a single example snippet block in the final HTML file. It would be nice to add labelling support to this plugin, so that we mark different line blocks with different labels in the source file:
> {code}
> // $example on:init_session$
> val spark = SparkSession
>   .builder()
>   .appName("Spark Examples")
>   .config("spark.some.config.option", "some-value")
>   .getOrCreate()
> // For implicit conversions like RDDs to DataFrames
> import spark.implicits._
> // $example off:init_session$
> // $example on:create_df$
> val df = spark.read.json("examples/src/main/resources/people.json")
> // Displays the content of the DataFrame to stdout
> df.show()
> // age  name
> // null Michael
> // 30   Andy
> // 19   Justin
> // $example off:create_df$
> {code}
> and then, by referring different labels in the Liquid template, like this:
> {code}
> {% include_example init_session scala/org/apache/spark/examples/sql/SparkSessionExample.scala %}
> {% include_example create_df scala/org/apache/spark/examples/sql/SparkSessionExample.scala %}
> {code}
> we may generate multiple example snippet blocks in the final HTML page from a single source file.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org