From 448519c5b38ea1286b5fe7250e7dddacecf64839 Mon Sep 17 00:00:00 2001 From: Adam Wiggins Date: Fri, 3 Jun 2011 02:03:48 -0700 Subject: [PATCH] cool symbol up top --- content/dependencies.md | 12 ++++++++++++ content/repo.md | 4 ++-- content/toc.md | 2 +- public/style.css | 30 ++++++++++++++++++++++++++---- public/symbol.png | Bin 0 -> 4376 bytes views/factor.erb | 2 +- views/layout.erb | 1 + web.rb | 6 ++++++ 8 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 content/dependencies.md create mode 100644 public/symbol.png diff --git a/content/dependencies.md b/content/dependencies.md new file mode 100644 index 0000000..9d67446 --- /dev/null +++ b/content/dependencies.md @@ -0,0 +1,12 @@ +## II. Dependencies +### Explicit dependency declaration and isolation + +Most programming languages offer a packaging system for distributing support libraries, such as [CPAN](http://www.cpan.org/) for Perl or [Rubygems](http://rubygems.org/) for Ruby. Libraries installed through a packaging system can typically be installed system-wide (known as "site packages") or only into the directory containing the app (known as "vendoring" or "bundling"). + +A twelve-factor app *never* relies on implicit existence of system-wide packages. It declares all dependencies, completely and exactly, via a *dependency declaration* tool. Furthermore, it uses *dependency isolation* tool during execution to ensure that no implicit dependencies "leak in" from the surrounding system. + +For example, [Gem Bundler](http://gembundler.com/) for Ruby offers the `Gemfile` format for declaration and `bundle exec` for dependency isolation. In, Python there are two separate tools for these steps - [Pip](http://www.pip-installer.org/en/latest/) is used for dependency declaration and [Virtualenv](http://www.virtualenv.org/en/latest/) for dependency isolation. Regardless of tools, dependency declaration and isolation must be used together - only one or the other is not sufficient for the twelve-factor app. + +A key benefit of explicit dependency declaration is setup for new developers on the project. The new developer can check out the app's sourcecode onto a machine with only the language runtime and packager installed. They will be able to set up everything needed to run the app in a single, deterministic command - such as `bundle install` for Ruby/Bundler or `lein deps` for Clojure/Leiningen. In apps where dependencies are not explicit, the developer may have to pick through the documentation or readme to find out what dependency packages need to be installe dmanually. + +In a related point, twelve-factor apps also do not rely on the implicit existence of any system tools. Examples include shelling out to ImageMagick or Curl. While these tools may exist on some systems, there is no guarantee that they will exist on all systems where the app may run in the future, or whether the version found on a future system will be compatible with the app. If the app needs to shell out to a system tool, that tool must be vendored into the app. diff --git a/content/repo.md b/content/repo.md index f46ada6..021ec47 100644 --- a/content/repo.md +++ b/content/repo.md @@ -1,5 +1,5 @@ -Repo | One code repo, many deploys -================================== +## I. Repo +### One code repo, many deploys A twelve-factor app is always tracked in a version control system, with the tracked code history known as a *code reposistory*, often shortened to *code repo* or just *repo*. diff --git a/content/toc.md b/content/toc.md index 4320006..4a9d20a 100644 --- a/content/toc.md +++ b/content/toc.md @@ -4,7 +4,7 @@ The Twelve Factors ## [I. Repo](/repo) ### One code repo, many deploys -## II. Dependencies +## [II. Dependencies](/dependencies) ### Explicit dependency declaration and isolation ## III. Config diff --git a/public/style.css b/public/style.css index c7b7229..091b41e 100644 --- a/public/style.css +++ b/public/style.css @@ -3,6 +3,7 @@ body { padding: 0; font-family: Georgia, sans-serif; line-height: 1.5em; + font-size: 14pt; } h1, h2, h3 { @@ -12,7 +13,8 @@ h1, h2, h3 { header { margin: 0; - padding: 26pt; + padding-top: 12pt; + padding-bottom: 26pt; border: 1px solid black; color: #fff; background: #000; @@ -32,12 +34,20 @@ section { } section h1 { font-size: 18pt; - border-bottom: 2px solid #aaa; } article { + text-align: justify; width: 60em; } +article p a { + text-decoration: none; + border-bottom: 1px dashed #444; + color: #000; +} +article p a:hover { + color: #337; +} section#toc { background: #ccc; @@ -47,8 +57,8 @@ section#toc { } section#toc h1 { font-size: 32pt; - border: 0; - margin-bottom: 24pt; + margin-bottom: 30pt; + text-decoration: underline; } section#toc h2 { margin-top: 12pt; @@ -61,9 +71,21 @@ section#toc h2 a:hover { color: #337; } section#toc h3 { + color: #555; font-weight: normal; } +section#factor h2 { + font-size: 32pt; + margin-bottom: 12pt; +} +section#factor h3 { + font-size: 20pt; + font-weight: normal; + color: #999; + margin-bottom: 16pt; +} + footer { color: #444; font-size: 12pt; diff --git a/public/symbol.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+Q^@8fg#4tGEahcU%7h zD=i@BLcWO^SlEx+Kk4gF>06}n_s!zJ5b?K# zPKCz51BUOI#XkoerZ`ythe=Pi{|lx1-7r*XJwAro;@ZZ>ao8B1Sr2W$?Ee8wVu>xk SO@_4q0000 +
<%= render_markdown(@factor) %>
diff --git a/views/layout.erb b/views/layout.erb index 71835b0..af85eb6 100644 --- a/views/layout.erb +++ b/views/layout.erb @@ -16,6 +16,7 @@
+

The Twelve-Factor App

diff --git a/web.rb b/web.rb index 7c97a2e..e0541f1 100644 --- a/web.rb +++ b/web.rb @@ -14,5 +14,11 @@ helpers do def render_markdown(file) markdown = File.read("content/#{file}.md") Maruku.new(markdown).to_html + rescue Errno::ENOENT + halt 404 end end + +not_found do + "Page not found" +end