PageRenderTime 61ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 0ms

/site/Docs/Contribute/Contributing-to-NuGet-Documentation.markdown

http://nugetdocs.codeplex.com
Markdown | 357 lines | 254 code | 103 blank | 0 comment | 0 complexity | 82423abb4bf0b29de33112ae0724284c MD5 | raw file
  1. # Contributing to NuGet Documentation
  2. These docs are written in markdown. For an introduction to markdown, see [our sample markdown](#Sample_Markdown). For documentation conventions, see [our documentation conventions](#Documentation_Conventions).
  3. ## Workflow
  4. The basic workflow for contributing to NuGet Docs is simple.
  5. 0. **Create a Fork.** Within the NuGet Docs codeplex website, create a fork. [Detailed instructions are below](#Create_a_Fork).
  6. 1. **Clone the repository.** [Mercurial](http://tortoisehg.bitbucket.org/download/index.html) (hg)
  7. (for instructions using Visual Studio integration, see the next section,
  8. [Setting up Source Control with Visual HG](#Setting_up_Source_Control_with_Visual_HG))
  9. hg clone https://hg01.codeplex.com/{username}/{forkname}
  10. 2. **Edit the docs.** Open the `Site.sln` solution in Visual Studio (or Visual Web Developer) and
  11. edit the .markdown files within the `Docs` folder.
  12. 3. **Add new files to the repository.** If you add new files, be sure to run:
  13. hg add
  14. 4. **Commit changes.** Remember, this commits changes to your local repository.
  15. hg commit
  16. 5. **Push the repository.** When you are done with your changes, push your repository to your online fork.
  17. hg push
  18. 6. **[Send a pull request](#Send_a_Pull_Request)** and we’ll review
  19. your changes and if they’re good, we’ll pull them into the main docs.
  20. 7. **Admire your handy work!** by visiting http://docs.nuget.org/ !
  21. ## Setting up Source Control with Visual HG
  22. If you have never used HG before or if you’d like a refresher
  23. then [HG init](http://hginit.com/) is a good starting point.
  24. Another helpful tool to make editing our docs easy is [VisualHG](http://visualhg.codeplex.com),
  25. which integrates into Visual Studio.
  26. The following steps will help you get started...
  27. ### Pre-requisites
  28. 1. Install VisualHg from [http://visualhg.codeplex.com](http://visualhg.codeplex.com).
  29. 2. Create a local folder for the NuGet docs repository such as `C:\dev\nugetdocs`.
  30. ### Create a Fork
  31. Unless you have direct commit access to the repository (which most of you won’t), you’ll
  32. need to create a fork of the docs in order to contribute docs.
  33. 1. Navigate to the [Source Code tab](http://nugetdocs.codeplex.com/SourceControl/list/changesets)
  34. of the [NuGetDocs CodePlex website](http://nugetdocs.codeplex.com/).
  35. 2. Click on the **Create Fork** link. Enter a name and description for the fork and click **Save**.
  36. ![Creating a fork](images/creating-a-fork.png)
  37. 3. Once the fork is created, you’ll have a personalized repository URL for your fork that looks like:
  38. **https://hg01.codeplex.com/forks/*{your-username}*/*{your-fork-name}***
  39. ![A Fork](images/list-of-forks.png)
  40. ### Clone the repository
  41. There is a bug in VisualHG 1.4.1 that prevents cloning a repository directly from within Visual
  42. Studio in some machines. You can install TortoiseHG to do this.
  43. 1. **Using VisualHG** Clone the repository:
  44. 1. Run VisualHg (from Visual Studio: **File** -> **VisualHg** -> **Repo Browser**).
  45. 2. The **TortoiseHg Workbench** window is displayed.
  46. 3. Select **File** -> **Clone Repository** to launch the Clone Repository Dialog.
  47. 2. **Using TortoiseHG** If the previous step fails due to the bug mentioned earlier, use TortoiseHG ([install](http://tortoisehg.bitbucket.org/download/index.html)) instead to clone the repository.
  48. 1. Within Windows Explorer, right click on the local nuget docs folder you created.
  49. 2. Select **TortoiseHG** -> **Clone** (or `CTRL+SHIFT+N`) to launch the Clone Repository Dialog.
  50. ![TortoiseHg Workbench](images/TortoiseHg-Workbench.png)
  51. 3. This brings up the Clone Repository dialog. Enter the URL to your fork (e.g. **https://hg01.codeplex.com/forks/myusername/myfork**) as the source
  52. and your local folder as the destination.<br />
  53. ![Clone dialog box](images/Clone-dialog-box.png)
  54. 4. For those of you more familiar with Team System or Subversion, the followings steps are useful for making
  55. VisualHG behave more like Subversion or TFS. Set up VisualHg to automatically "update" after "pull":
  56. 1. From the **TortoiseHg Workbench** dialog box select **File** -> **Settings**.
  57. 2. In the **TortoiseHg Settings** dialog box, click the tab for the NuGet Docs repository.
  58. 4. Click **Workbench** on the left and make sure **After Pull Operation** is set to **Update** on the right.
  59. ![Update after Pull](images/After-Pull-Operation.png)
  60. 5. To make a VisualHg "commit" work like a SVN or TFS check-in, set up Visual Hg to automatically "push" after "commit":
  61. 1. In the **TortoiseHg Settings** dialog box, click the tab for the NuGet Docs repository.
  62. 2. Click **Commit** on the left and put the repository URL in the **Push After Commit** box on the right.
  63. ![Push after Commit](images/Push-After-Commit.png)
  64. 6. To make Visual Studio recognize markdown files and apply some of the
  65. markdown formatting while you edit, use the Extension Manager to find and install
  66. the extension named "Markdown Mode".
  67. ### Write some documentation
  68. 1. Get the latest version of the docs (from **TortoiseHg Workbench** click **Pull Incoming Changes from Selected URL**).
  69. 2. Make your changes.
  70. 3. Test the changes by running the site locally (`CTRL + F5` in Visual Studio) and reviewing the docs.
  71. 3. Save your changes to the repository:
  72. 1. Right-click the project or the folder that has your changes
  73. and select VisualHg -> Commit.
  74. 2. The changed files about to be committed are shown and you are prompted to enter
  75. a brief comment describing the changes.
  76. ![Commit dialog box](images/VisualHG-Commit-dialog-box.png)
  77. 3. Click Commit
  78. ### Send a Pull Request
  79. 1. When you&#8217;re done with all of your changes, go to the [Forks Page](http://nugetdocs.codeplex.com/SourceControl/network).
  80. 2. To the right of your fork is a link to **Send Pull Request**.
  81. 3. Clicking this brings up a dialog to enter details about your pull request.
  82. Once we get the pull request, we'll review it and merge the changes into the main docs.
  83. ## Documentation Conventions
  84. 1. All documentation is placed under the "docs" folder in the site.
  85. 2. Folder/File names use dashes (Tilde Slash) as separators.
  86. 3. Use relative URL for images and links (tilde slash will be resolved if you use it).
  87. ## Sample Markdown
  88. ### Code and Preformatted Text
  89. Indent four spaces to create an escaped &lt;pre&gt;&lt;code&gt; block:
  90. printf("goodbye world!"); /* his suicide note
  91. was in C */
  92. The text will be wrapped in tags, and displayed in a monospaced font. The first four spaces will
  93. be stripped off, but all other whitespace will be preserved.
  94. Markdown and HTML is ignored within a code block:
  95. <blink>
  96. You would hate this if it weren't
  97. wrapped in a code block.
  98. </blink>
  99. ### Message Boxes
  100. We have added support for some well know classes to add styles to draw attention to items you want
  101. to call out in a document. Unfortunately mark down does not have a way to added class attributes
  102. so you will have to write the HTML by hand and embed it.
  103. #### Informatiom
  104. <p class="info">
  105. &lt;p class="info"&gt;Some Informational Text...&lt;/p&gt;
  106. </p>
  107. #### Caution
  108. <p class="caution">
  109. &lt;p class="caution"&gt;Some Caution Text...&lt;/p&gt;
  110. </p>
  111. #### Error
  112. <p class="error">
  113. &lt;p class="error"&gt;Some Error Text...&lt;/p&gt;
  114. </p>
  115. ### Code Spans
  116. Use backticks to create an inline &lt;code&gt; span:
  117. Press the `<Tab>` key, then type a `$`.
  118. (The backtick key is in the upper left corner of most keyboards.)
  119. Like code blocks, code spans will be displayed in a monospaced font. Markdown and HTML will not
  120. work within them. Note that, unlike code blocks, code spans require you to manually escape any
  121. HTML within!
  122. ### Linebreaks
  123. End a line with two spaces to add a &lt;br/&gt; linebreak:
  124. How do I love thee?
  125. Let me count the ways
  126. Italics and Bold
  127. *This is italicized*, and so is _this_.
  128. **This is bold**, and so is __this__.
  129. Use ***italics and bold together*** if you ___have to___.
  130. ###Basic Links
  131. There are three ways to write links. Each is easier to read than the last:
  132. Here's an inline link to [Google](http://www.google.com/).
  133. Here's a reference-style link to [Google][1].
  134. Here's a very readable link to [Yahoo!][yahoo].
  135. [1]: http://www.google.com/
  136. [yahoo]: http://www.yahoo.com/
  137. The link definitions can appear anywhere in the document -- before or after the place where you
  138. use them. The link definition names [1] and [yahoo] can be any unique string, and are case-insensitive;
  139. [yahoo] is the same as [YAHOO].
  140. ### Advanced Links
  141. Links can have a title attribute, which will show up on hover. Title attributes can also be added; they
  142. are helpful if the link itself is not descriptive enough to tell users where they're going.
  143. Here's a [poorly-named link](http://www.google.com/ "Google").
  144. Never write "[click here][^2]".
  145. Visit [us][web].
  146. [^2]: http://www.w3.org/QA/Tips/noClickHere
  147. (Advice against the phrase "click here")
  148. [web]: http://stackoverflow.com/ "Stack Overflow"
  149. You can also use standard HTML hyperlink syntax.
  150. <a href="http://example.com" title="example">example</a>
  151. ### Bare URLs
  152. We have modified our Markdown parser to support "naked" URLs (in most but not all cases -- beware of
  153. unusual characters in your URLs); they will be converted to links automatically:
  154. I often visit http://example.com.
  155. Force URLs by enclosing them in angle brackets:
  156. Have you seen <http://example.com>?
  157. All URLs must be fully qualified path names. We do not support relative paths.
  158. ### Horizontal Rules
  159. Insert a horizontal rule &lt;hr/&gt; by putting three or more hyphens, asterisks, or underscores
  160. on a line by themselves:
  161. Rule #1
  162. ---
  163. Rule #2
  164. *******
  165. Rule #3
  166. ___
  167. Using spaces between the characters also works:
  168. Rule #4
  169. - - - -
  170. ### Simple lists
  171. A bulleted &lt;ul&gt; list:
  172. - Use a minus sign for a bullet
  173. + Or plus sign
  174. * Or an asterisk
  175. A numbered &lt;ol&gt; list:
  176. 1. Numbered lists are easy
  177. 2. Markdown keeps track of the numbers for you
  178. 7. So this will be item 3.
  179. A double-spaced list:
  180. - This list gets wrapped in &lt;p&gt; tags
  181. - So there will be extra space between items
  182. Advanced lists: Nesting
  183. To put other Markdown blocks in a list; just indent four spaces for each nesting level:
  184. 1. Lists in a list item:
  185. - Indented four spaces.
  186. * indented eight spaces.
  187. - Four spaces again.
  188. 2. Multiple paragraphs in a list items:
  189. It's best to indent the paragraphs four spaces
  190. You can get away with three, but it can get
  191. confusing when you nest other things.
  192. Stick to four.
  193. We indented the first line an extra space to align
  194. it with these paragraphs. In real use, we might do
  195. that to the entire list so that all items line up.
  196. This paragraph is still part of the list item, but it looks messy to humans. So it's a
  197. good idea to wrap your nested paragraphs manually, as we did with the first two.
  198. 3. Blockquotes in a list item:
  199. > Skip a line and
  200. > indent the >'s four spaces.
  201. 4. Preformatted text in a list item:
  202. Skip a line and indent eight spaces.
  203. That's four spaces for the list
  204. and four to trigger the code block.
  205. ### Simple Blockquotes
  206. Add a > to the beginning of any line to create a &lt;blockquote&gt;.
  207. > The syntax is based on the way email programs
  208. > usually do quotations. You don't need to hard-wrap
  209. > the paragraphs in your blockquotes, but it looks much nicer if you do. Depends how lazy you feel.
  210. Advanced blockquotes: Nesting
  211. To put other Markdown blocks in a &lt;blockquote&gt;, just add a &gt; followed by a space:
  212. > The > on the blank lines is optional.
  213. > Include it or don't; Markdown doesn't care.
  214. >
  215. > But your plain text looks better to
  216. > humans if you include the extra `>`
  217. > between paragraphs.
  218. Blockquotes within a blockquote:
  219. > A standard blockquote is indented
  220. > > A nested blockquote is indented more
  221. > > > > You can nest to any depth.
  222. Lists in a blockquote:
  223. > - A list in a blockquote
  224. > - With a > and space in front of it
  225. > * A sublist
  226. Preformatted text in a blockquote:
  227. > Indent five spaces total. The first
  228. > one is part of the blockquote designator.
  229. Images
  230. Images are exactly like links, but they have an exclamation point in front of them:
  231. ![Valid XHTML](http://w3.org/Icons/valid-xhtml10).
  232. The word in square brackets is the alt text, which gets displayed if the browser can't show
  233. the image. Be sure to include meaningful alt text for screen-reading software.
  234. Just like links, images work with reference syntax and titles:
  235. This page is ![valid XHTML][checkmark].
  236. [checkmark]: http://w3.org/Icons/valid-xhtml10
  237. "What are you smiling at?"
  238. Note: Markdown does not currently support the shortest reference syntax for images:
  239. Here's a broken ![checkmark].
  240. But you can use a slightly more verbose version of implicit reference names:
  241. This ![checkmark][] works.
  242. The reference name is also used as the alt text.
  243. ### Inline HTML
  244. If you need to do something that Markdown can't handle, use HTML. Note that we only support a very strict subset of HTML!
  245. Strikethrough humor is <strike>funny</strike>.
  246. Markdown is smart enough not to mangle your span-level HTML:
  247. <u>Markdown works *fine* in here.</u>
  248. Block-level HTML elements have a few restrictions:
  249. They must be separated from surrounding text by blank lines.
  250. The begin and end tags of the outermost block element must not be indented.
  251. Markdown can't be used within HTML blocks.
  252. <pre>
  253. You can <em>not</em> use Markdown in here.
  254. </pre>