Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
nanocify!
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Sep 6, 2011
1 parent e31f83d commit ec74c94
Show file tree
Hide file tree
Showing 43 changed files with 2,206 additions and 41 deletions.
11 changes: 11 additions & 0 deletions Gemfile
@@ -0,0 +1,11 @@
source "http://rubygems.org"

gem 'nanoc', '~> 3.2.0'
gem 'kramdown', '~> 0.13.0'
gem 'nokogiri'
gem 'pygmentize'
gem 'systemu'

group :development do
gem 'adsf'
end
26 changes: 26 additions & 0 deletions Gemfile.lock
@@ -0,0 +1,26 @@
GEM
remote: http://rubygems.org/
specs:
adsf (1.0.1)
rack (>= 1.0.0)
cri (2.0.2)
kramdown (0.13.3)
nanoc (3.2.2)
nanoc3 (>= 3.2.2)
nanoc3 (3.2.2)
cri (~> 2.0)
nokogiri (1.5.0)
pygmentize (0.0.3)
rack (1.3.2)
systemu (2.3.0)

PLATFORMS
ruby

DEPENDENCIES
adsf
kramdown (~> 0.13.0)
nanoc (~> 3.2.0)
nokogiri
pygmentize
systemu
1 change: 1 addition & 0 deletions Rakefile
@@ -0,0 +1 @@
require 'nanoc3/tasks'
45 changes: 45 additions & 0 deletions Rules
@@ -0,0 +1,45 @@
#!/usr/bin/env ruby

# A few helpful tips about the Rules file:
#
# * The string given to #compile and #route are matching patterns for
# identifiers--not for paths. Therefore, you can't match on extension.
#
# * The order of rules is important: for each item, only the first matching
# rule is applied.
#
# * Item identifiers start and end with a slash (e.g. “/about/” for the file
# “content/about.html”). To select all children, grandchildren, … of an
# item, use the pattern “/about/*/”; “/about/*” will also select the parent,
# because “*” matches zero or more characters.

compile '/static/*/' do
# don't filter or layout
end

compile '*' do
if item.binary?
# don't filter binary items
else
# filter :erb
filter :kramdown
filter :colorize_syntax, :default_colorizer => :pygmentize
layout 'default'
end
end

route '/static/*/' do
item.identifier.chop + '.' + item[:extension]
end

route '*' do
if item.binary?
# Write item with identifier /foo/ to /foo.ext
item.identifier.chop + '.' + item[:extension]
else
# Write item with identifier /foo/ to /foo/index.html
item.identifier + 'index.html'
end
end

layout '*', :erb
64 changes: 64 additions & 0 deletions config.yaml
@@ -0,0 +1,64 @@
# A list of file extensions that nanoc will consider to be textual rather than
# binary. If an item with an extension not in this list is found, the file
# will be considered as binary.
text_extensions: [ 'css', 'erb', 'haml', 'htm', 'html', 'js', 'less', 'markdown', 'md', 'php', 'rb', 'sass', 'scss', 'txt', 'xhtml', 'xml' ]

# The path to the directory where all generated files will be written to. This
# can be an absolute path starting with a slash, but it can also be path
# relative to the site directory.
output_dir: output

# A list of index filenames, i.e. names of files that will be served by a web
# server when a directory is requested. Usually, index files are named
# “index.hml”, but depending on the web server, this may be something else,
# such as “default.htm”. This list is used by nanoc to generate pretty URLs.
index_filenames: [ 'index.html' ]

# Whether or not to generate a diff of the compiled content when compiling a
# site. The diff will contain the differences between the compiled content
# before and after the last site compilation.
enable_output_diff: false

# The data sources where nanoc loads its data from. This is an array of
# hashes; each array element represents a single data source. By default,
# there is only a single data source that reads data from the “content/” and
# “layout/” directories in the site directory.
data_sources:
-
# The type is the identifier of the data source. By default, this will be
# `filesystem_unified`.
type: filesystem_unified

# The path where items should be mounted (comparable to mount points in
# Unix-like systems). This is “/” by default, meaning that items will have
# “/” prefixed to their identifiers. If the items root were “/en/”
# instead, an item at content/about.html would have an identifier of
# “/en/about/” instead of just “/about/”.
items_root: /

# The path where layouts should be mounted. The layouts root behaves the
# same as the items root, but applies to layouts rather than items.
layouts_root: /

# Configuration for the “watch” command, which watches a site for changes and
# recompiles if necessary.
watcher:
# A list of directories to watch for changes. When editing this, make sure
# that the “output/” and “tmp/” directories are _not_ included in this list,
# because recompiling the site will cause these directories to change, which
# will cause the site to be recompiled, which will cause these directories
# to change, which will cause the site to be recompiled again, and so on.
dirs_to_watch: [ 'content', 'layouts', 'lib' ]

# A list of single files to watch for changes. As mentioned above, don’t put
# any files from the “output/” or “tmp/” directories in here.
files_to_watch: [ 'config.yaml', 'Rules' ]

# When to send notifications (using Growl or notify-send).
notify_on_compilation_success: true
notify_on_compilation_failure: true

deploy:
default:
options: [ '-Plrtvz', '--delete-after' ]
dst: "italia:~/rubyist.simonecarletti.com"
Empty file added content/index.md
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
67 changes: 67 additions & 0 deletions content/ruby/yardoc.md
@@ -0,0 +1,67 @@
# YARD

YARD is a powerful Ruby documentation tool for generating API documentation from Ruby source code.

## Tag Conventions

YARD provides a [set of Javadoc-inspired tags](http://rubydoc.info/docs/yard/file/docs/Tags.md) the developer can use to enrich the documentation with additional
metadata.

### Order of Tags

Whilst YARD does not enforce a particular order, a common convention makes the source code more readable, especially when the documentation block contains more than 5 tags.

Include tags in the following order:

Description block.

@example

@note
@todo

@param
@return
@raise

@see

@author
@version
@since

@abstract
@api
@deprecated


### Ordering Multiple Tags

We employ the following conventions when a tag appears more than once in a documentation block.

* Multiple `@author` tags should be listed in chronological order, with the creator of the class/method listed at the top.
* Multiple `@param` tags should be listed in argument-declaration order. This makes it easier to visually match the list to the declaration.
* Multiple `@raise` tags should be listed alphabetically by the exception names.

### Required Tags

A `@param` tag is "required" (by convention) for every parameter. The description can be omitted if the meaning of the parameter is obvious.

# Opens a socket connection and returns the TCPSocket instance.
#
# @param [String] host
# @param [Integer] port
# @return [TCPSocket]
def connect(host, port)
end

The `@return` tag is required for every method that returns something other than void. The description can be omitted if the meaning of the parameter is obvious. Whenever possible, find something non-redundant (ideally, more specific) to use for the tag comment.

# Opens a socket connection and returns the TCPSocket instance.
#
# @param [String] host
# @param [Integer] port
# @return [TCPSocket] The socket connection,
# preconfigured with the default set of options.
def connect(host, port)
end
13 changes: 13 additions & 0 deletions content/static/css/style.css
@@ -0,0 +1,13 @@
/* -------------------------------
GLOBAL
------------------------------- */

body {
font-size: 12px;
}


/* reset margin-top if under main */
#main > h1 {
margin-top: 0;
}

0 comments on commit ec74c94

Please sign in to comment.