blob: abb5850d895c836cb35bee58e1cdb0fe28244bac [file] [log] [blame]
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.
<h1 id="contributing-to-the-apache-geode-documentation">Contributing to the Apache Geode Documentation</h1>
<p>Apache Geode welcomes your contributions to the community&rsquo;s documentation efforts. You can participate by writing new content, reviewing and editing existing content, or fixing bugs. This document covers the following topics:</p>
<li><a href="#working-with-markdown-files">Working with Markdown Files</a></li>
<li><a href="#working-with-images-and-graphics">Working with Images and Graphics</a></li>
<li><a href="#writing-guidelines">Writing Guidelines</a></li>
<p>For instructions on building the documentation locally, see <code>../geode-book/</code>.</p>
<h2 id="working-with-markdown-files">Working with Markdown Files</h2>
<p>You can edit markdown files in any text editor. For more, read <a href="">Daring Fireball&rsquo;s Markdown Syntax page</a>.</p>
<h2 id="working-with-images-and-graphics">Working with Images and Graphics</h2>
<p>Image files in .gif or .png format are in the <code>docs/images</code> directory in the Apache Geode docs repo. Images in .svg format are in the <code>docs/images_svg</code> directory.</p>
<p>Most of the Apache Geode image files have been converted to the open source SVG format. You can insert SVG images directly into an XML topic and modify images using a SVG editor.</p>
<p>The Wikipedia page <a href="">Comparison of Vector Graphics Editors</a> provides a list and comparison of commercial and free vector graphics editors. Note, however, that not all of these programs support the SVG format.</p>
<h2 id="writing-guidelines">Writing Guidelines</h2>
<p>The most important advice we can provide for working with the Apache Geode docs is to spend some time becoming familiar with the existing source files and the structure of the project directory. In particular, note the following conventions and tips:</p>
<li>Top-level subdirectories organize topics into &ldquo;books&rdquo;: basic_config, configuring, developing, etc.</li>
<li>Use lowercase characters for all file and directory names. Separate words in filenames with an underscore (<code>_</code>) character.</li>
<li>Use the <code>.md</code> file extension for topic files.</li>
<li>Add new topics to the existing directories by subject type. Only create a new directory if you are starting a new subject or a new book.</li>
<li>To start a new topic, you can make a copy of an existing file with similar content and edit it.</li>
<li>Use the appropriate document type for the content you are writing. Create multiple topics if you are writing overview, procedural, and reference content.</li>
<li>To edit elements in the navigation pane (the &ldquo;subnav&rdquo;) that appears on the left side of the documentation, navigate to <code>../geode-book/master_middleman/source/subnavs/</code>.</li>
<h2 id="product-name-variables">Product Name Variables</h2>
<p>For flexibility, the product name (a long version and a short one) and version are defined as variables. Here&rsquo;s how to use them:</p>
<p><strong>Define these three variables in <code>../geode-book/config.yml</code>:</strong></p>
<pre class="highlight plaintext"><code>template_variables:
- product_name_long: Apache Geode
- product_name: Geode
- product_version: 1.2
<p><strong>Use the following Ruby syntax to refer to these variables everywhere <em>except</em> in <code>title:</code> lines:</strong></p>
<pre class="highlight plaintext"><code>&lt;%=vars.product_name %&gt;
&lt;%=vars.product_name_long %&gt;
&lt;%=vars.product_version %&gt;
<p><strong>You can&rsquo;t use these variables in <code>title:</code> lines. Here&rsquo;s the workaround:</strong></p>
<p>Instead of:</p>
<pre class="highlight plaintext"><code>---
title: Apache Geode 1.2 Documentation
<p>Do this:</p>
<pre class="highlight plaintext"><code>&lt;% set_title(product_name_long, product_version, "Documentation") %&gt;
<p>Why? Because the <code>title:</code> construct is not Ruby code, it&rsquo;s YAML, and it cannot interpret Ruby variables.</p>
<li>Begin with <code>&lt;%</code>, not <code>&lt;%=</code>. (We&rsquo;re invoking a function, not printing its value.)</li>
<li>Do not put a space before the opening parenthesis (use <code>set_title(</code> not <code>set_title (</code>.)</li>
<li><strong>Do not</strong> quote the three product variable names (<code>product_name</code>, <code>product_name_long</code>, and <code>product_version</code>). <strong>Do</strong> quote all other text.</li>
<li>This feature requires Bookbinder v10.1.7 (Aug 2017) or later.</li>