Browse Source

Work on intro

intro
jlukic 9 years ago
parent
commit
5ee07f84d7
  1. 3
      server/documents/behaviors/api.html.eco
  2. 289
      server/documents/introduction/getting-started.html.eco
  3. 28
      server/documents/introduction/new.html.eco
  4. 3
      server/files/javascript/docs.js
  5. 13
      server/files/stylesheets/docs.css
  6. BIN
      server/raw/images/setup/install.gif

3
server/documents/behaviors/api.html.eco

@ -501,10 +501,11 @@ type : 'UI Behavior'
$('.follow.button') $('.follow.button')
.api({ .api({
onResponse: function(response) { onResponse: function(response) {
// do some adjustments to response // make some adjustments to response
return response; return response;
}, },
successTest: function(response) { successTest: function(response) {
// test whether a json response is valid
return response.success || false; return response.success || false;
} }
onSuccess: function(response) { onSuccess: function(response) {

289
server/documents/introduction/getting-started.html.eco

@ -0,0 +1,289 @@
---
layout : 'default'
css : 'started'
standalone : true
title : 'Getting Started'
description : 'Getting started with Semantic UI'
type : 'Introduction'
---
<script src="/javascript/new.js"></script>
<%- @partial('header') %>
<div class="main ui intro container">
<h2 class="ui dividing header">Installing</h2>
<div class="ui four item pointing menu">
<a data-tab="npm" class="active item">NPM</a>
<a data-tab="meteor" class="item">Atmosphere</a>
<a data-tab="npm" class="item">Bower</a>
<a data-tab="git" class="item">Git</a>
</div>
<div class="ui active tab" data-tab="npm">
<div class="no example">
<div class="ui accordion">
<div class="title">
<h4 class="ui header">Install NodeJS</h4>
<p>To use our build tools you will need Node</p>
<i class="dropdown icon"></i>
</div>
<div class="content">
<div class="ui top attached tabular menu">
<a data-tab="mac" class="active item">Mac</a>
<a data-tab="linux" class="item">Linux</a>
<a data-tab="win" class="item">Windows</a>
</div>
<div class="ui bottom attached active padded tab segment" data-tab="mac">
<h4>Option 1: Homebrew</h4>
<p>After installing <a href="http://brew.sh/" target="_blank">homebrew</a></p>
<div class="ignored code" data-type="bash">
brew install node
</div>
<h4>Option 2: Git</h4>
<div class="ignored code" data-type="bash">
git clone git://github.com/ry/node.git
cd node
./configure
make
sudo make install
</div>
</div>
<div class="ui tab" data-tab="linux">
<p>This is a popular install method that will avoid requiring sudo.</p>
<div class="ignored code" data-type="bash" data-title="Install without sudo">
mkdir ~/local
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
git clone git://github.com/joyent/node.git
cd node
./configure --prefix=~/local
make install
git clone git://github.com/isaacs/npm.git
cd npm
make install
</div>
</div>
<div class="ui tab" data-tab="win">
<p>Download the <a href="http://nodejs.org/download/">NodeJS executable</a>.</p>
</div>
</div>
</div>
</div>
<div class="no example">
<h4>Add Semantic UI to Your Project</h4>
<p>Semantic UI is released as a package on NPM.</p>
<div class="ignored code" data-type="bash">
# navigate to your project directory
npm install semantic-ui --save
</div>
</div>
<div class="no example">
<h4>Run Setup</h4>
<p>Hey this is the fun part</p>
<img src="/images/setup/install.gif" class="ui image">
</div>
<div class="no example">
<h4>Include Semantic UI in Your Project</h4>
<div class="ignored code" data-type="html">
<link rel="stylesheet" type="text/css" href="/semantic/dist/semantic.min.css">
<script src="semantic/dist/semantic.min.js"></script>
</div>
</div>
</div>
<h2 class="ui dividing header">Build Tools</h2>
<div class="no example">
<h4>Using Build Tools</h4>
<div class="ignored code" data-type="bash">
cd semantic/ # or your install directory
gulp
</div>
</div>
<div class="no example">
<h4>Available Commands</h4>
<table class="ui definition table">
<thead>
<th>Command</th>
<th>Description</th>
</thead>
<tbody>
<tr>
<td>install</td>
<td>Asks install questions will automatically run if not setup.</td>
</tr>
<tr>
<td>watch (default)</td>
<td>Watches for changes in source files, and builds file on change</td>
</tr>
<tr>
<td>build</td>
<td>Build all files</td>
</tr>
<tr>
<td>clean</td>
<td>Cleans <code>dist/</code> folder</td>
</tr>
<tr>
<td>version</td>
<td>Outputs current version</td>
</tr>
<tr>
<td>build-javascript</td>
<td>Build js files</td>
</tr>
<tr>
<td>build-css</td>
<td>Build css files</td>
</tr>
<tr>
<td>build-assets</td>
<td>Build assets files</td>
</tr>
<tr>
<td>serve-docs</td>
<td>Serves files to local docs instance</td>
</tr>
<tr>
<td>build-docs</td>
<td>Builds files to docs folder</td>
</tr>
</tbody>
</table>
</div>
<div class="no example">
<h4>Configuring Paths</h4>
<p>Build tool settings are stored in a special file called <code>semantic.json</code> It can be included in any folder that is in a parent folder of the semantic install folder. </p>
<p>If you used the npm or meteor, a semantic.json file is automatically generated for you in the root of your project. If you used a different install, you can run <code>gulp install</code> or manually rename <code>semantic.json.example</code>.</p>
<div class="ignored code">
{
// base path added to all other paths specified in "paths"
"base": "",
"paths": {
"source": {
// source theme.config
"config" : "src/theme.config",
// source definition folder
"definitions" : "src/definitions/",
// source site theme
"site" : "src/site/",
// source themes folder
"themes" : "src/themes/"
},
"output": {
// packaged source (both compressed/uncompressed)
"packaged" : "dist/",
// uncompressed source
"uncompressed" : "dist/components/",
// compressed source
"compressed" : "dist/components/",
// output directory for theme assets
"themes" : "dist/themes/"
},
// directory for gulp clean task
"clean" : "dist/"
},
// when set to an integer permission, will set dist files with this file permission
"permission" : false,
// whether gulp watch/build should run RTLCSS
"rtl": false
// will only include components with these names
components: [
'reset',
'site',
'button',
'container',
'divider',
'flag',
'header',
'icon',
'image',
'input',
'label',
'list',
'loader',
'rail',
'reveal',
'segment',
'step',
'breadcrumb',
'form',
'grid',
'menu',
'message',
'table',
'ad',
'card',
'comment',
'feed',
'item',
'statistic',
'accordion',
'checkbox',
'dimmer',
'dropdown',
'embed',
'modal',
'nag',
'popup',
'progress',
'rating',
'search',
'shape',
'sidebar',
'sticky',
'tab',
'transition',
'api',
'form',
'state',
'visibility'
],
// whether to include special project maintainer tasks
admin: false
}
</div>
</div>
<h2 class="ui dividing header">Recipes</h2>
<div class="no example">
<h4>Import Gulp Tasks</h4>
<p>You don't have to use our gulp pipeline, just import the task into your own</p>
<div class="ignored code">
var
watch = require('semantic/tasks/watch'),
build = require('semantic/tasks/build')
;
gulp.task('watch ui', 'Watch Semantic UI', watch));
gulp.task('build ui', 'Watch Semantic UI', build));
</div>
</div>
</div>

28
server/documents/introduction/new.html.eco

@ -23,11 +23,17 @@ type : 'Introduction'
<a href="https://github.com/Semantic-Org/Semantic-UI/blob/master/RELEASE-NOTES.md" target="_blank" class="ui button">View Release Notes</a> <a href="https://github.com/Semantic-Org/Semantic-UI/blob/master/RELEASE-NOTES.md" target="_blank" class="ui button">View Release Notes</a>
<h2 class="ui dividing header">Project</h2>
<div class="example">
<h4 class="ui header">Built with Flexbox</h4>
<p>13 components: <a href="/collections/form.html">Form</a>, <a href="/collections/zzzz/">Grid</a>, <a href="/collections/zzzz/">Menu</a>, <a href="/elements/message.html">Message</a>, <a href="/elements/button.html">Button</a>, <a href="/elements/segment.html">Segment</a>, <a href="/elements/step.html">Step</a>, <a href="/modules/dropdown.html">Dropdown</a>, <a href="/modules/modal.html">Modal</a>, <a href="/views/feed.html">Feed</a>, <a href="/views/statistics.html">Statistic</a>, <a href="/views/card.html">Card</a>, <a href="/views/item.html">Item</a> now use <a href="https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Flexible_boxes" target="_blank"><code>flexbox</code></a> for positioning. This allows for elements to automatically match heights, and resize content</p>
</div>
<h2 class="ui dividing header">Grids</h2> <h2 class="ui dividing header">Grids</h2>
<div class="example"> <div class="example">
<h4 class="ui header">Flexbox</h4> <h4 class="ui header">Equal Height by Default</h4>
<p>Grids in 2.0 now use <a href="https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Flexible_boxes" target="_blank"><code>flexbox</code></a> and are equal height across rows by default.</p> <p>Grids in 2.0 now use <a href="https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Flexible_boxes" target="_blank"><code>flexbox</code></a> and are equal height across rows by default.</p>
<div class="ui three column divided grid"> <div class="ui three column divided grid">
<div class="row"> <div class="row">
@ -205,8 +211,9 @@ type : 'Introduction'
</div> </div>
<div class="dropdown example"> <div class="dropdown example">
<h4 class="ui header">Nested Menus</h4> <h4 class="ui header">Scrolling and Nested Menus</h4>
<p>Nested scrolling menus are now supported. These menus support all the same keyboard shortcuts and filtering as regular menus.</p> <p><a href="modules/dropdown.html#scrolling">Scrolling menu</a> and nested menus are now supported.</p>
<p>Listing choices in a nested menu will still give all the same keyboard shortcuts and filtering as regular menus.</p>
<div class="ui floating dropdown labeled icon button"> <div class="ui floating dropdown labeled icon button">
<i class="filter icon"></i> <i class="filter icon"></i>
<span class="text">Filter Posts</span> <span class="text">Filter Posts</span>
@ -270,7 +277,6 @@ type : 'Introduction'
<li><code>ctrl+click</code> will add a single additional selected label</li> <li><code>ctrl+click</code> will add a single additional selected label</li>
<li><code>shift+right</code> will extend selection</li> <li><code>shift+right</code> will extend selection</li>
<li><code>page down</code> and <code>page up</code> will select first element in next page</li> <li><code>page down</code> and <code>page up</code> will select first element in next page</li>
<li><code>a-z</code> will select value matching first letter</li>
</ul> </ul>
<li>Custom error messages are now supported with search selects</li> <li>Custom error messages are now supported with search selects</li>
</ul> </ul>
@ -280,7 +286,7 @@ type : 'Introduction'
<div class="example"> <div class="example">
<h4 class="ui header">Horizontal Groups</h4> <h4 class="ui header">Horizontal Groups</h4>
<p>Horizontal groups are now available.</p> <p>Horizontal groups are now available for <a href="/elements/segment.html">segment</a>.</p>
<div class="ui horizontal segments"> <div class="ui horizontal segments">
<div class="ui segment"> <div class="ui segment">
<p>Top</p> <p>Top</p>
@ -362,7 +368,7 @@ type : 'Introduction'
<div class="example"> <div class="example">
<h4 class="ui header">Flexible Menus</h4> <h4 class="ui header">Flexible Menus</h4>
<p>Menus have been completely rewritten to use flexbox. Items inside a menu will automatically adjust to align with other menu items regardless of size.</p> <p><a href="/collections/menu.html">Menus</a> have been completely rewritten to use <code>flexbox</code>. Items inside a menu will automatically adjust to align with other menu items regardless of size.</p>
<div class="ui top attached menu"> <div class="ui top attached menu">
<div class="item"> <div class="item">
<img src="/images/logo.png"> <img src="/images/logo.png">
@ -380,7 +386,7 @@ type : 'Introduction'
</div> </div>
<div class="example"> <div class="example">
<h4 class="ui header">Vertical Tabs</h4> <h4 class="ui header">Vertical Tabs</h4>
<p>Menus now include a new <code>vertical tabular</code> menu type.</p> <p>Menus now include a new <a href="/collections/menu.html#tabular"><code>vertical tabular</code></a> menu type.</p>
<div class="ui grid"> <div class="ui grid">
<div class="four wide column"> <div class="four wide column">
<div class="ui vertical fluid tabular menu"> <div class="ui vertical fluid tabular menu">
@ -507,7 +513,7 @@ type : 'Introduction'
<div class="external example"> <div class="external example">
<h4 class="ui header">Translates Any API</h4> <h4 class="ui header">Translates Any API</h4>
<p>API now lets you adjust a server's JSON response using a new callback, <code>onResponse</code>. This can let you restructure third party APIs to match your local data requirements.</p> <p><a href="/behaviors/api.html">API</a> now lets you adjust a server's JSON response using a new callback, <a href="/behaviors/api.html#response-callbacks"><code>onResponse</code></a>. This can let you restructure third party APIs to match your local data requirements.</p>
<div class="ui search"> <div class="ui search">
<div class="ui left icon input"> <div class="ui left icon input">
<input class="prompt" type="text" placeholder="Search GitHub"> <input class="prompt" type="text" placeholder="Search GitHub">
@ -559,7 +565,7 @@ type : 'Introduction'
<div class="mock example"> <div class="mock example">
<h4 class="ui header">Mocked Responses</h4> <h4 class="ui header">Mocked Responses</h4>
<p>API now supports mocked responses, letting you specify how responses are returned in advance.</p> <p><a href="/behaviors/api.html">API</a> now supports mocked responses, letting you specify how responses are returned in advance.</p>
<div class="code" data-type="javascript"> <div class="code" data-type="javascript">
$('.toggle.button') $('.toggle.button')
.api({ .api({
@ -582,11 +588,11 @@ type : 'Introduction'
</div> </div>
<div class="async example"> <div class="async example">
<h4 class="ui header">Custom Backends</h4> <h4 class="ui header">Custom Backends</h4>
<p>API can now use custom asynchronous callbacks for resolving API requests, this can let you use other custom XHR backends, or local data to resolve requests.</p> <p><a href="/behaviors/api.html">API</a> can now use <a href="/behaviors/api.html#using-custom-backends">custom asynchronous callbacks</a> for resolving API requests, this can let you use other custom XHR backends, or local data to resolve requests.</p>
<div class="code" data-type="javascript"> <div class="code" data-type="javascript">
$('.toggle.button') $('.toggle.button')
.api({ .api({
// lets just pretend this button mostly doesnt work // lets wait a half second then try your luck
mockResponseAsync: function(settings, callback) { mockResponseAsync: function(settings, callback) {
var var
unlikelySuccess = (Math.random() < 0.3), unlikelySuccess = (Math.random() < 0.3),

3
server/files/javascript/docs.js

@ -74,6 +74,8 @@ semantic.ready = function() {
$shownExample = $example.filter('.shown'), $shownExample = $example.filter('.shown'),
$prerenderedExample = $example.has('.ui.dropdown, .ui.search, .ui.rating, .ui.dimmer, .ui.embed'), $prerenderedExample = $example.has('.ui.dropdown, .ui.search, .ui.rating, .ui.dimmer, .ui.embed'),
$visibilityExample = $example.filter('.visiblity').find('.overlay, .demo.segment, .items img'),
$sidebarButton = $('.fixed.launch.button'), $sidebarButton = $('.fixed.launch.button'),
$code = $('div.code').not('.existing'), $code = $('div.code').not('.existing'),
@ -792,6 +794,7 @@ semantic.ready = function() {
$sectionExample.visibility('refresh'); $sectionExample.visibility('refresh');
$sticky.sticky('refresh'); $sticky.sticky('refresh');
$footer.visibility('refresh'); $footer.visibility('refresh');
$visibilityExample.visibility('refresh');
}, },
createAnnotation: function() { createAnnotation: function() {

13
server/files/stylesheets/docs.css

@ -924,6 +924,19 @@ blockquote .author {
display: none; display: none;
} }
/*----------------
Getting Started
-----------------*/
#example.started .tab.segment > .example:first-child {
margin-top: 0em;
padding-top: 0em;
}
#example.started .tab.segment > .example:last-child {
margin-bottom: 0em;
padding-bottom: 0em;
}
/*---------------- /*----------------
Theming Theming
-----------------*/ -----------------*/

BIN
server/raw/images/setup/install.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Loading…
Cancel
Save