GitHub user zero323 opened a pull request:

    https://github.com/apache/spark/pull/18051

    [SPARK-18825][SPARKR][DOCS][WIP] Eliminate duplicate links in SparkR API 
doc index

    ## What changes were proposed in this pull request?
    
    Duplicate links come from the `00Index.html` created during package 
installation.  The file has a regular structure, where each link is a table 
row, slitted into two lines:
    
    ```r
    <tr><td style="width: 25%;"><a href="atan.html">atan-method</a></td>
    <td>atan</td></tr>
    ```
    
    
    This PR adds an additional steps to the `R/create-docs.sh`:
    
    - Copy `00Index.html` to the current working directory;
    
          index_path = file.path(libDir, "SparkR", "html", "00Index.html"); 
          invisible(file.copy(index_path, "00Index.html.bck"));writeLines(txt, 
index_path); 
    
    - Reads file and removes problematic lines
    
          txt = readLines(index_path); method_lines = grep("-method</a>", txt, 
fixed = TRUE); 
          txt = txt[-c(method_lines, method_lines + 1)]; 
    
    - Writes file back:
    
          writeLines(txt, index_path)
    
    - Executes current pipeline.
    
    - Restores original content:
    
          invisible(file.rename("00Index.html.bck", index_path))
    
    Arguably this is not the most reliable approach, but doesn't require any 
parser, and can be embedded in the current `create-docs.sh` 
    
    ## How was this patch tested?
    
    Manual inspection of the docs.


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

    $ git pull https://github.com/zero323/spark SPARK-18825

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

    https://github.com/apache/spark/pull/18051.patch

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

    This closes #18051
    
----
commit b28ec94b0c0589736b4e3377d160642b0b6181a6
Author: zero323 <[email protected]>
Date:   2017-05-21T18:19:22Z

    Initial implementation

----


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to