beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mabdullah353 <>
Subject [GitHub] incubator-beam-site pull request #59: [BEAM-501] Infrastructure for toggling...
Date Wed, 02 Nov 2016 04:58:49 GMT
GitHub user mabdullah353 opened a pull request:

    [BEAM-501] Infrastructure for toggling code snippets in documentation.

    ## Working
    This commit will enable mark down language to support two languages `java` and `python`,
By adding a nav bar on top of code blocks.
    Add html class as `language-python` or `language-java` and the HTML elements visibility
will be controlled based on user selected language preferences.
    Code blocks in markdown languages starting with *```java* or *```python* have by default
`langauge-java` or `language-python` classes so no special attributes required to apply this
    ## Example
    1) Toggles for code block.
    Add python code below the java code in markdown language, It will be converted into selectable
code block div.
    > ```java "some-code-in-java"
    > ```python "sam-code-in-python"
    And user will see block like this.
    <img width="1186" alt="screen shot 2016-11-02 at 9 47 30 am" src="">
    2) Section of text.
    Wrap a text with attributes having class `language-java` or `language-python` and it's
visibility will be changed based on user preferences.
    > To use Beam, your driver program must first create an instance of the Beam SDK class
`Pipeline` <span class="language-java">(typically in the `main()` function)</span><span
class="language-python">(typically in `def`)</span>.
    When `java` is selected then this will render as:
    <img width="1176" alt="screen shot 2016-11-02 at 9 50 54 am" src="">
    And for `python` it will render as:
    <img width="1150" alt="screen shot 2016-11-02 at 9 51 23 am" src="">
    3) User preference persistence:
    The language preference will be stored on HTML5 local storage, keeping it persistence
per user bases.

You can merge this pull request into a Git repository by running:

    $ git pull asf-site

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #59
commit 2d80cee3be9da2515e927afd67541899b2dde258
Author: Abdullah Bashir <>
Date:   2016-11-02T04:04:41Z

    [BEAM-501] Infrastructure for toggling code snippets in documentation


If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message