如何向Varnish-cache.org贡献内容

这就是我们向Varnish-cache.org添加内容的机制(参见phk的说明 我们的网站是如何运作的 以深入了解Site的内部结构)。

Git存储库

网站内容位于GitHub中,网址为:

https://github.com/varnishcache/homepage

要提供您自己的贡献,分叉项目,并向我们发送一个拉动请求。

狮身人面像和RST

网站资源是用来写的 RST --reStrupredText,这是最初为Python构思的文档格式(也用于Varnish发行版以及格式化VMOD文档)。 Sphinx 用于呈现来自RST源的网页。

所以你需要 learn markup with RST and Sphinx ;您将需要 install Sphinx 若要在本地系统上测试渲染,请执行以下操作。

生成文件

从源生成Web内容是由 MakefileR1 回购的目录::

$ cd R1
$ make help
Please use `make <target>' where <target> is one of
html       to make standalone HTML files
dirhtml    to make HTML files named index.html in directories
singlehtml to make a single large HTML file
pickle     to make pickle files
json       to make JSON files
htmlhelp   to make HTML files and a HTML help project
qthelp     to make HTML files and a qthelp project
applehelp  to make an Apple Help Book
devhelp    to make HTML files and a Devhelp project
epub       to make an epub
latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter
latexpdf   to make LaTeX files and run them through pdflatex
latexpdfja to make LaTeX files and run them through platex/dvipdfmx
text       to make text files
man        to make manual pages
texinfo    to make Texinfo files
info       to make Texinfo files and run them through makeinfo
gettext    to make PO message catalogs
changes    to make an overview of all changed/added/deprecated items
xml        to make Docutils-native XML files
pseudoxml  to make pseudoxml-XML files for display purposes
linkcheck  to check all external links for integrity
doctest    to run all doctests embedded in the documentation (if enabled)
coverage   to run coverage check of the documentation (if enabled)

大多数情况下,你只需要 make html 以测试您的贡献的呈现效果。

雪花石膏主题

我们使用 alabaster theme ,您可能需要将其添加到本地的Python安装中:

$ sudo pip install alabaster

我们发现,您可能需要将alabaster包安装目录链接到Sphinx希望找到主题的目录。例如(在我的机器上),雪花石膏安装到::

/usr/local/lib/python2.7/dist-packages/alabaster

Sphinx希望在以下方面找到主题:

/usr/share/sphinx/themes

因此,要使make目标成功运行::

$ cd /usr/share/sphinx/themes
$ ln -s /usr/local/lib/python2.7/dist-packages/alabaster

测试渲染

现在,您可以编辑网站资源库中的内容,并通过调用 R1 目录::

$ cd $REPO/R1
$ make html
sphinx-build -b html -d build/doctrees   source build/html
Running Sphinx v1.2.3
loading pickled environment... done
building [html]: targets for 1 source files that are out of date
updating environment: 0 added, 1 changed, 0 removed
reading sources... [100%] tips/contribdoc/index
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] tips/index
writing additional files... genindex search
copying static files... done
copying extra files... done
dumping search index... done
dumping object inventory... done
build succeeded.

成功生成后,新呈现的内容保存在 R1/source/build 目录,以便您可以使用浏览器查看。

向我们发送拉入请求

当你的贡献建设成功后,给我们发一份公关,我们会很高兴听到你的消息!