Linux or OS X - Windows may work, but is unsupported.Or, if you'd like to check out what Slate is capable of, take a look at the sample docs. Getting started with Slate is super easy! Simply fork this repository and follow the instructions below. Of course, if you don't want to use GitHub, you're also welcome to host your docs elsewhere. Not only does this mean you get free hosting for your docs with Github Pages, but it also makes it simple for other developers to make pull requests to your docs if they find typos or other problems. Let your users update your documentation for you - By default, your Slate-generated documentation is hosted in a public Github repository. We've made sure that the performance remains excellent, even for larger documents. ![]() We're using Slate at TripIt to build documentation for our new API, where our table of contents has over 180 entries. As you scroll, it displays your current position in the document. Out-of-the-box syntax highlighting for almost 100 languages, no configuration required.Īutomatic, smoothly scrolling table of contents on the far left of the page. In your document, you'll distinguish different languages by specifying the language name at the top of each code block, just like with Github Flavored Markdown. Write code samples in multiple languages - If your API has bindings in multiple programming languages, you can easily put in tabs to switch between them. Everything is written in Markdown - even the code samples are just Markdown code blocks. Slate is just Markdown - When you write docs with Slate, you're just writing Markdown, which makes it simple to edit and understand. ![]() As you scroll, your browser's hash will update to the nearest header, so linking to a particular point in the documentation is still natural and easy. We haven't sacrificed linkability, though. Slate puts the entire documentation on a single page. Slate is responsive, so it looks great on tablets, phones, and even in print.Įverything on a single page - Gone are the days when your users had to search through a million pages to find what they wanted. Inspired by Stripe's and Paypal's API docs. FeaturesĬlean, intuitive design - With Slate, the description of your API is on the left side of your documentation, and all the code examples are on the right side. The example above was created with Slate. However, when you have a large number of loop passes with relatively complex calculations in the loop body, the conventional foreach loop is significantly faster.Slate helps you create beautiful, intelligent, responsive API documentation. Since commands with the Foreach-Object and the implicit foreach are shorter and require less typing (not just because of the alias “%”), no reason appears to exist to work with the foreach command itself. The parentheses around the Get-Culture cmdlet (which gets information such as current language settings) ensure that the TextInfo property is applied to the result (an object) returned by the cmdlet. Notice that I used the alias “%” for Foreach-Object. The command in this example doesn’t just retrieve the last names of the AD users but also uses the ToTitleCase method to convert the initial letters into capital letters if the property surname is unequal to NULL. while(($inp = Read-Host -Prompt "Select a command") -ne "Q") ![]() With each iteration, the user is asked to press a key to select a menu item. The following snippet demonstrates how you could use while for a simple menu system. If you want to use a loop counter, you have to initialize it before the while statement and increment or decrement it in the loop body. ![]() In contrast to the for loop, the condition can only contain a boolean expression. It is called a pretest loop because the instructions in the loop body are not executed, even once, if the loop condition doesn’t match. The while loop works just as you might know it from other languages.
0 Comments
Leave a Reply. |