|
| 1 | += Contributors Guide |
| 2 | + |
| 3 | +Improvements to Windup documentation are welcome. |
| 4 | + |
| 5 | +In order to contribute, you will need a GitHub account and to have `git` installed on your machine. You can also log a {JiraWindupURL}[Jira issue] to track the changes. |
| 6 | + |
| 7 | +Use the following steps to submit a change to the Windup documentation repository. |
| 8 | + |
| 9 | +. Fork the link:https://github.com/windup/windup-documentation[windup-documentation] GitHub repository. |
| 10 | ++ |
| 11 | +Click the *Fork* button in the top right corner of the page. |
| 12 | +. Clone the forked repository locally. |
| 13 | ++ |
| 14 | +[source,terminal,subs="attributes+"] |
| 15 | +---- |
| 16 | +$ git clone git@github.com:YOUR_USERNAME/windup-documentation.git |
| 17 | +---- |
| 18 | +. Add the upstream repository. |
| 19 | ++ |
| 20 | +[source,terminal,subs="attributes+"] |
| 21 | +---- |
| 22 | +git remote add -f upstream git@github.com:windup/windup-documentation.git |
| 23 | +---- |
| 24 | +. Get the latest changes. |
| 25 | ++ |
| 26 | +[source,terminal,subs="attributes+"] |
| 27 | +---- |
| 28 | +$ git fetch upstream |
| 29 | +---- |
| 30 | +. Check out a topic branch. |
| 31 | ++ |
| 32 | +[source,terminal,subs="attributes+"] |
| 33 | +---- |
| 34 | +$ git checkout -b BRANCH_NAME upstream/master |
| 35 | +---- |
| 36 | +. Make the desired edits. |
| 37 | ++ |
| 38 | +The documentation is written in link:http://asciidoc.org/[AsciiDoc]. Review the xref:asciidoc_guidelines[AsciiDoc Guidelines and Tips] section of this guide before making changes. |
| 39 | +. Build the guides to verify your changes. |
| 40 | +.. Navigate to the appropriate guide's directory and issue the following command. Note that you must have link:http://asciidoctor.org/[Asciidoctor] installed. |
| 41 | ++ |
| 42 | +[source,terminal,subs="attributes+"] |
| 43 | +---- |
| 44 | +$ cd docs/cli-guide/ |
| 45 | +$ asciidoctor -t -dbook -a toc -o html/cli-guide.html master.adoc |
| 46 | +---- |
| 47 | +.. View the generated HTML file in a browser. |
| 48 | +. Add each new or updated file to git. |
| 49 | ++ |
| 50 | +[source,terminal,subs="attributes+"] |
| 51 | +---- |
| 52 | +$ git add FILE_NAME.adoc |
| 53 | +---- |
| 54 | +. Commit the changes locally. |
| 55 | ++ |
| 56 | +[source,terminal,subs="attributes+"] |
| 57 | +---- |
| 58 | +$ git commit -m "My commit message." |
| 59 | +---- |
| 60 | +. Push the changes to your forked repository. |
| 61 | ++ |
| 62 | +[source,terminal,subs="attributes+"] |
| 63 | +---- |
| 64 | +$ git push origin HEAD |
| 65 | +---- |
| 66 | +. Open a pull request to merge your changes to the master branch. |
| 67 | +.. Navigate to your forked repository in a browser: https://github.com/YOUR_USERNAME/windup-documentation. |
| 68 | +.. Open a new pull request. Be sure to review the diff before submitting. |
| 69 | +.. A member of the Windup documentation team will merge or provide feedback on your request. |
| 70 | + |
| 71 | +== Building the Guides |
| 72 | + |
| 73 | +Navigate to the appropriate guide's directory and issue the following command. Note that you must have link:http://asciidoctor.org/[Asciidoctor] installed. |
| 74 | + |
| 75 | +[source,terminal,subs="attributes+"] |
| 76 | +---- |
| 77 | +$ cd docs/cli-guide/ |
| 78 | +$ asciidoctor -t -dbook -a toc -o html/cli-guide.html master.adoc |
| 79 | +---- |
| 80 | + |
| 81 | +View the generated HTML file in a browser. |
| 82 | + |
| 83 | +== Publishing the Guides |
| 84 | + |
| 85 | +The Windup guides are published downstream on the link:https://access.redhat.com/documentation/en/migration_toolkit_for_applications/[Red Hat Customer Portal]. |
| 86 | + |
| 87 | +[[asciidoc_guidelines]] |
| 88 | +== AsciiDoc Guidelines and Tips |
| 89 | + |
| 90 | +=== AsciiDoc Editors |
| 91 | + |
| 92 | +The following editors make editing and reviewing AsciiDoc files easy. |
| 93 | + |
| 94 | +* link:https://atom.io/[Atom] with the `asciidoc-preview` and `language-asciidoc` packages. |
| 95 | +* link:http://asciidocfx.com/[AsciidocFX] |
| 96 | +* Any basic editor, such as gedit, with the Chrome link:https://chrome.google.com/webstore/detail/asciidoctorjs-live-previe/iaalpfgpbocpdfblpnhhgllgbdbchmia?hl=en[Asciidoctor.js] plugin |
| 97 | + |
| 98 | +=== AsciiDoc Syntax Basics |
| 99 | + |
| 100 | +For a comprehensive reference of AsciiDoc syntax, see the link:http://asciidoc.org/userguide.html[AsciiDoc User Guide]. |
| 101 | + |
| 102 | +* Headings |
| 103 | ++ |
| 104 | +[source,terminal,subs="attributes+"] |
| 105 | +---- |
| 106 | += Heading Level 1 |
| 107 | +== Heading Level 2 |
| 108 | +=== Heading Level 3 |
| 109 | +---- |
| 110 | +* Bold text |
| 111 | ++ |
| 112 | +[source,terminal,subs="attributes+"] |
| 113 | +---- |
| 114 | + *Bold text* |
| 115 | +---- |
| 116 | +* Italic text |
| 117 | ++ |
| 118 | +[source,terminal,subs="attributes+"] |
| 119 | +---- |
| 120 | +_Italic text_ |
| 121 | +---- |
| 122 | +* Monospace text |
| 123 | ++ |
| 124 | +[source,terminal,subs="attributes+"] |
| 125 | +---- |
| 126 | +`Monospace text` |
| 127 | +---- |
| 128 | +* Bullets |
| 129 | ++ |
| 130 | +[source,terminal,subs="attributes+"] |
| 131 | +---- |
| 132 | +* Item one |
| 133 | +* Item two |
| 134 | +---- |
| 135 | +* Numbered list |
| 136 | ++ |
| 137 | +[source,terminal,subs="attributes+"] |
| 138 | +---- |
| 139 | +. Step one |
| 140 | +. Step two |
| 141 | +---- |
| 142 | + |
| 143 | +* Code block |
| 144 | ++ |
| 145 | +-------- |
| 146 | +---- |
| 147 | +System.out.println("Hello"); |
| 148 | +---- |
| 149 | +-------- |
| 150 | + |
| 151 | +=== Creating a New AsciiDoc File |
| 152 | + |
| 153 | +* Name the file using only letters, numbers, and dashes, and with an extension of `.adoc`. For example, `my-topic.adoc`. |
| 154 | +* Add an anchor at the top of the file, using underscores. For example, `\[[my_anchor]]`. |
| 155 | +* Start each topic with a level one heading. For example, `= My Heading`. |
| 156 | +* Add this new topic to the `master.adoc` file using the `include::` syntax. |
| 157 | +** Pass in a `leveloffset=+N` to adjust the heading levels in the included file to be the correct level. |
| 158 | + |
| 159 | +.Example master.adoc File |
| 160 | + |
| 161 | +[source,terminal,subs="attributes+"] |
| 162 | +---- |
| 163 | += My Guide Title |
| 164 | +
|
| 165 | +\include::topics/my-topic.adoc[leveloffset=+1] |
| 166 | +---- |
| 167 | + |
| 168 | +.Example my-topic.adoc File |
| 169 | +[source,terminal,subs="attributes+"] |
| 170 | +---- |
| 171 | +[[my_anchor]] |
| 172 | += My Heading |
| 173 | +
|
| 174 | +Text here. |
| 175 | +
|
| 176 | +== My Subsection |
| 177 | +
|
| 178 | +Text here. |
| 179 | +---- |
| 180 | + |
| 181 | + |
| 182 | +=== Linking to Other Files |
| 183 | + |
| 184 | +Use `xref` to link to a section within the same guide. You must define an explicit anchor in order to link. |
| 185 | + |
| 186 | +.Link to a Section in the Same Guide |
| 187 | +[source,terminal,subs="attributes+"] |
| 188 | +---- |
| 189 | +For more information, see xref:section_anchor[This Section]. |
| 190 | +... |
| 191 | +
|
| 192 | +[[section_anchor]] |
| 193 | +== This Section |
| 194 | +... |
| 195 | +---- |
| 196 | + |
| 197 | +Use `link` to reference an external URL. |
| 198 | + |
| 199 | +.Link to an External Link |
| 200 | +[source,terminal,subs="attributes+"] |
| 201 | +---- |
| 202 | +Navigate to the link:https://github.com/windup/windup-documentation[Windup GitHub repository]. |
| 203 | +---- |
| 204 | + |
| 205 | +=== Using AsciiDoc Attributes |
| 206 | + |
| 207 | +The Windup documentation defines several AsciiDoc attributes in the `docs/templates/document-attributes.adoc` file. This allows you to define the value one place and then used it repeatedly throughout the guides. An example usage of this is defining the Windup version. |
| 208 | + |
| 209 | +==== Defining an Attribute |
| 210 | + |
| 211 | +Define an attribute in the `document-attributes.adoc` file using the following syntax. |
| 212 | + |
| 213 | +[source,terminal,subs="attributes+"] |
| 214 | +---- |
| 215 | +:ProductVersion: 5.0.0.Final |
| 216 | +---- |
| 217 | + |
| 218 | +==== Using an Attribute |
| 219 | + |
| 220 | +An attribute can then be referenced in an AsciiDoc file using the following syntax. |
| 221 | + |
| 222 | +[source,terminal,subs="attributes+"] |
| 223 | +---- |
| 224 | +The Windup version is {ProductVersion}. |
| 225 | +---- |
| 226 | + |
| 227 | +This will be resolved as "The Windup version is 5.0.0.Final". |
0 commit comments