| commit | 70cc6c9721d98a4dcadbf47fd5193e5c36c9c372 | [log] [tgz] |
|---|---|---|
| author | YangJie <yangjie01@baidu.com> | Mon Feb 17 14:42:49 2025 +0800 |
| committer | GitHub <noreply@github.com> | Mon Feb 17 14:42:49 2025 +0800 |
| tree | 362ba82047f895de84188ad17d4f14521239daa4 | |
| parent | 75b7a6871868ec8084cb2d8e2b204adde9d215c9 [diff] |
[SPARK-51124][DOC] Self-host JavaScript and CSS in Spark 3.5.0 website
Execute the following command and regenerate the docs related to version 3.5.0 on v3.5.0 tag
```
git cherry-pick 31fbf013e7cba1deeb359c0af17295488cf66461
git cherry-pick 3b892bd632502c56c1f76f858a4531f76118024b
git cherry-pick e395f33dd37f212b6e95b08467e95b58acd73d73
git cherry-pick 03f7200d5b6c63a732162b4762f72ac94a64a3f8
cd docs
SKIP_API=1 PRODUCTION=1 bundle exec jekyll build
```
then copy all contents in `spark/docs/_site` to `site/docs/3.5.0/` and manually reverted the deletion of the following section:
```
<!-- Matomo -->
<script type="text/javascript">
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["disableCookies"]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://analytics.apache.org/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '40']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
```In this directory you will find text files formatted using Markdown, with an .md suffix.
Building the site requires Jekyll Rouge. The easiest way to install the right version of these tools is using Bundler and running bundle install in this directory.
See also https://github.com/apache/spark/blob/master/docs/README.md
A site build will update the directories and files in the site directory with the generated files. Using Jekyll via bundle exec jekyll locks it to the right version. So after this you can generate the html website by running bundle exec jekyll build in this directory. Use the --watch flag to have jekyll recompile your files as you save changes.
In addition to generating the site as HTML from the Markdown files, jekyll can serve the site via a web server. To build the site and run a web server use the command bundle exec jekyll serve which runs the web server on port 4000, then visit the site at http://localhost:4000.
Please make sure you always run bundle exec jekyll build after testing your changes with bundle exec jekyll serve, otherwise you end up with broken links in a few places.
To update Jekyll or any other gem please follow these steps:
Gemfilebundle update which updates the Gemfile.lockThe docs are not generated as part of the website. They are built separately for each release of Spark from the Spark source repository and then copied to the website under the docs directory. See the instructions for building those in the readme in the Spark project's /docs directory.
We also use Rouge for syntax highlighting in documentation Markdown pages. Its HTML output is compatible with CSS files designed for Pygments.
To mark a block of code in your Markdown to be syntax highlighted by jekyll during the compile phase, use the following syntax:
{% highlight scala %}
// Your Scala code goes here, you can replace Scala with many other
// supported languages too.
{% endhighlight %}
You probably don't need to install that unless you want to regenerate the Pygments CSS file. It requires Python, and can be installed by running sudo easy_install Pygments.
To merge pull request, use the merge_pr.py script which also squashes the commits.