├── .gitignore ├── Capfile ├── Gemfile ├── Gemfile.lock ├── README.markdown ├── Rakefile ├── assets ├── images │ ├── belongs_to.png │ ├── book_icon.gif │ ├── bullet.gif │ ├── challenge.png │ ├── chapters_icon.gif │ ├── check_bullet.gif │ ├── credits_pic_blank.gif │ ├── csrf.png │ ├── customized_error_messages.png │ ├── edge_badge.png │ ├── error_messages.png │ ├── feature_tile.gif │ ├── footer_tile.gif │ ├── fxn.png │ ├── getting_started │ │ ├── new_post.png │ │ ├── routing_error_no_controller.png │ │ ├── routing_error_no_route_matches.png │ │ ├── template_is_missing_posts_new.png │ │ ├── unknown_action_create_for_posts.png │ │ └── unknown_action_new_for_posts.png │ ├── grey_bullet.gif │ ├── habtm.png │ ├── has_many.png │ ├── has_many_through.png │ ├── has_one.png │ ├── has_one_through.png │ ├── header_backdrop.png │ ├── header_tile.gif │ ├── i18n │ │ ├── demo_html_safe.png │ │ ├── demo_localized_pirate.png │ │ ├── demo_translated_en.png │ │ ├── demo_translated_pirate.png │ │ ├── demo_translation_missing.png │ │ └── demo_untranslated.png │ ├── icons │ │ ├── README │ │ ├── callouts │ │ │ ├── 1.png │ │ │ ├── 10.png │ │ │ ├── 11.png │ │ │ ├── 12.png │ │ │ ├── 13.png │ │ │ ├── 14.png │ │ │ ├── 15.png │ │ │ ├── 2.png │ │ │ ├── 3.png │ │ │ ├── 4.png │ │ │ ├── 5.png │ │ │ ├── 6.png │ │ │ ├── 7.png │ │ │ ├── 8.png │ │ │ └── 9.png │ │ ├── caution.png │ │ ├── example.png │ │ ├── favicon.ico │ │ ├── home.png │ │ ├── important.png │ │ ├── next.png │ │ ├── note.png │ │ ├── prev.png │ │ ├── tip.png │ │ ├── up.png │ │ └── warning.png │ ├── jaimeiniesta.jpg │ ├── nav_arrow.gif │ ├── polymorphic.png │ ├── posts_index.png │ ├── radar.png │ ├── rails_guides_kindle_cover.jpg │ ├── rails_guides_logo.gif │ ├── rails_logo_remix.gif │ ├── rails_welcome.png │ ├── session_fixation.png │ ├── tab_grey.gif │ ├── tab_info.gif │ ├── tab_note.gif │ ├── tab_red.gif │ ├── tab_yellow.gif │ ├── tab_yellow.png │ ├── validation_error_messages.png │ └── vijaydev.jpg ├── javascripts │ ├── guides.js │ └── syntaxhighlighter │ │ ├── shBrushAS3.js │ │ ├── shBrushAppleScript.js │ │ ├── shBrushBash.js │ │ ├── shBrushCSharp.js │ │ ├── shBrushColdFusion.js │ │ ├── shBrushCpp.js │ │ ├── shBrushCss.js │ │ ├── shBrushDelphi.js │ │ ├── shBrushDiff.js │ │ ├── shBrushErlang.js │ │ ├── shBrushGroovy.js │ │ ├── shBrushJScript.js │ │ ├── shBrushJava.js │ │ ├── shBrushJavaFX.js │ │ ├── shBrushPerl.js │ │ ├── shBrushPhp.js │ │ ├── shBrushPlain.js │ │ ├── shBrushPowerShell.js │ │ ├── shBrushPython.js │ │ ├── shBrushRuby.js │ │ ├── shBrushSass.js │ │ ├── shBrushScala.js │ │ ├── shBrushSql.js │ │ ├── shBrushVb.js │ │ ├── shBrushXml.js │ │ └── shCore.js └── stylesheets │ ├── fixes.css │ ├── kindle.css │ ├── main.css │ ├── print.css │ ├── reset.css │ ├── style.css │ └── syntaxhighlighter │ ├── shCore.css │ ├── shCoreDefault.css │ ├── shCoreDjango.css │ ├── shCoreEclipse.css │ ├── shCoreEmacs.css │ ├── shCoreFadeToGrey.css │ ├── shCoreMDUltra.css │ ├── shCoreMidnight.css │ ├── shCoreRDark.css │ ├── shThemeDefault.css │ ├── shThemeDjango.css │ ├── shThemeEclipse.css │ ├── shThemeEmacs.css │ ├── shThemeFadeToGrey.css │ ├── shThemeMDUltra.css │ ├── shThemeMidnight.css │ ├── shThemeRDark.css │ └── shThemeRailsGuides.css ├── config └── deploy.rb ├── rails_guides.rb ├── rails_guides ├── body_converter.rb ├── check_anchors.rb ├── generator.rb ├── helpers.rb ├── indexer.rb ├── levenshtein.rb ├── markdown_render.rb ├── text_process.rb └── version.rb ├── source ├── CN │ ├── 2_2_release_notes.textile │ ├── 2_3_release_notes.textile │ ├── 3_0_release_notes.textile │ ├── 3_1_release_notes.textile │ ├── 3_2_release_notes.textile │ ├── _feedback.html.erb │ ├── _license.html.erb │ ├── _welcome.html.erb │ ├── action_controller_overview.textile │ ├── action_mailer_basics.textile │ ├── action_view_overview.textile │ ├── active_model_basics.textile │ ├── active_record_basics.textile │ ├── active_record_querying.textile │ ├── active_record_validations_callbacks.textile │ ├── active_support_core_extensions.textile │ ├── active_support_instrumentation.textile │ ├── ajax_on_rails.textile │ ├── api_documentation_guidelines.textile │ ├── asset_pipeline.textile │ ├── association_basics.md │ ├── caching_with_rails.textile │ ├── command_line.textile │ ├── configuring.textile │ ├── contributing_to_ruby_on_rails.textile │ ├── credits.html.erb │ ├── debugging_rails_applications.textile │ ├── engines.textile │ ├── form_helpers.textile │ ├── generators.textile │ ├── getting_started.backup.textile │ ├── getting_started.textile │ ├── i18n.textile │ ├── index.html.erb │ ├── initialization.textile │ ├── layout.html.erb │ ├── layouts_and_rendering.textile │ ├── migrations.textile │ ├── nested_model_forms.textile │ ├── performance_testing.textile │ ├── plugins.textile │ ├── rails_application_templates.textile │ ├── rails_on_rack.textile │ ├── routing.textile │ ├── ruby_on_rails_guides_guidelines.textile │ ├── security.textile │ ├── testing.textile │ └── upgrading_ruby_on_rails.textile ├── EN │ ├── 2_2_release_notes.md │ ├── 2_2_release_notes.textile │ ├── 2_3_release_notes.md │ ├── 2_3_release_notes.textile │ ├── 3_0_release_notes.md │ ├── 3_0_release_notes.textile │ ├── 3_1_release_notes.md │ ├── 3_1_release_notes.textile │ ├── 3_2_release_notes.md │ ├── 3_2_release_notes.textile │ ├── 4_0_release_notes.md │ ├── _license.html.erb │ ├── _welcome.html.erb │ ├── action_controller_overview.md │ ├── action_controller_overview.textile │ ├── action_mailer_basics.md │ ├── action_mailer_basics.textile │ ├── action_view_overview.md │ ├── action_view_overview.textile │ ├── active_model_basics.md │ ├── active_model_basics.textile │ ├── active_record_basics.md │ ├── active_record_basics.textile │ ├── active_record_querying.md │ ├── active_record_querying.textile │ ├── active_record_validations_callbacks.md │ ├── active_record_validations_callbacks.textile │ ├── active_support_core_extensions.md │ ├── active_support_core_extensions.textile │ ├── active_support_instrumentation.md │ ├── active_support_instrumentation.textile │ ├── ajax_on_rails.md │ ├── ajax_on_rails.textile │ ├── api_documentation_guidelines.md │ ├── api_documentation_guidelines.textile │ ├── asset_pipeline.md │ ├── asset_pipeline.textile │ ├── association_basics.md │ ├── association_basics.textile │ ├── caching_with_rails.md │ ├── caching_with_rails.textile │ ├── command_line.md │ ├── command_line.textile │ ├── configuring.md │ ├── configuring.textile │ ├── contributing_to_ruby_on_rails.md │ ├── contributing_to_ruby_on_rails.textile │ ├── credits.html.erb │ ├── debugging_rails_applications.md │ ├── debugging_rails_applications.textile │ ├── development_dependencies_install.md │ ├── documents.yaml │ ├── engines.md │ ├── engines.textile │ ├── form_helpers.md │ ├── form_helpers.textile │ ├── generators.md │ ├── generators.textile │ ├── getting_started.md │ ├── getting_started.textile │ ├── i18n.md │ ├── i18n.textile │ ├── index.html.erb │ ├── initialization.md │ ├── initialization.textile │ ├── layout.html.erb │ ├── layouts_and_rendering.md │ ├── layouts_and_rendering.textile │ ├── migrations.md │ ├── migrations.textile │ ├── nested_model_forms.md │ ├── nested_model_forms.textile │ ├── performance_testing.md │ ├── performance_testing.textile │ ├── plugins.md │ ├── plugins.textile │ ├── rails_application_templates.md │ ├── rails_application_templates.textile │ ├── rails_on_rack.md │ ├── rails_on_rack.textile │ ├── routing.md │ ├── routing.textile │ ├── ruby_on_rails_guides_guidelines.md │ ├── ruby_on_rails_guides_guidelines.textile │ ├── security.md │ ├── security.textile │ ├── testing.md │ ├── testing.textile │ ├── upgrading_ruby_on_rails.md │ └── upgrading_ruby_on_rails.textile ├── documents_CN.yaml ├── documents_EN.yaml └── kindle │ ├── KINDLE.md │ ├── KINDLE.md~HEAD │ ├── copyright.html.erb │ ├── copyright.html.erb~HEAD │ ├── layout.html.erb │ ├── layout.html.erb~HEAD │ ├── rails_guides.opf.erb │ ├── rails_guides.opf.erb~HEAD │ ├── toc.html.erb │ ├── toc.html.erb~HEAD │ ├── toc.ncx.erb │ ├── toc.ncx.erb~HEAD │ ├── welcome.html.erb │ └── welcome.html.erb~HEAD └── w3c_validator.rb /.gitignore: -------------------------------------------------------------------------------- 1 | /output 2 | /.bundle 3 | /.rvmrc 4 | tags 5 | .lock 6 | /.git* 7 | /.gitignore 8 | *.swp 9 | *.orig 10 | *~ 11 | *.bak 12 | *.DS_Store 13 | -------------------------------------------------------------------------------- /Capfile: -------------------------------------------------------------------------------- 1 | load 'deploy' 2 | # Uncomment if you are using Rails' asset pipeline 3 | # load 'deploy/assets' 4 | Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } 5 | load 'config/deploy' # remove this line to skip loading any of the default tasks -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'http://ruby.taobao.org' 2 | 3 | gem "activesupport" , '>= 3.0' 4 | gem "actionpack", '>= 3.0' 5 | 6 | group :doc do 7 | gem 'RedCloth', '~> 4.2' 8 | gem 'w3c_validators' 9 | gem 'redcarpet' 10 | end 11 | 12 | gem 'rake', '>= 0.8.7' 13 | gem 'capistrano' 14 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: http://ruby.taobao.org/ 3 | specs: 4 | RedCloth (4.2.9) 5 | actionpack (3.2.3) 6 | activemodel (= 3.2.3) 7 | activesupport (= 3.2.3) 8 | builder (~> 3.0.0) 9 | erubis (~> 2.7.0) 10 | journey (~> 1.0.1) 11 | rack (~> 1.4.0) 12 | rack-cache (~> 1.2) 13 | rack-test (~> 0.6.1) 14 | sprockets (~> 2.1.2) 15 | activemodel (3.2.3) 16 | activesupport (= 3.2.3) 17 | builder (~> 3.0.0) 18 | activesupport (3.2.3) 19 | i18n (~> 0.6) 20 | multi_json (~> 1.0) 21 | builder (3.0.0) 22 | capistrano (2.11.2) 23 | highline 24 | net-scp (>= 1.0.0) 25 | net-sftp (>= 2.0.0) 26 | net-ssh (>= 2.0.14) 27 | net-ssh-gateway (>= 1.1.0) 28 | erubis (2.7.0) 29 | highline (1.6.11) 30 | hike (1.2.1) 31 | i18n (0.6.0) 32 | journey (1.0.3) 33 | json (1.6.6) 34 | multi_json (1.2.0) 35 | net-scp (1.0.4) 36 | net-ssh (>= 1.99.1) 37 | net-sftp (2.0.5) 38 | net-ssh (>= 2.0.9) 39 | net-ssh (2.3.0) 40 | net-ssh-gateway (1.1.0) 41 | net-ssh (>= 1.99.1) 42 | nokogiri (1.5.2) 43 | rack (1.4.1) 44 | rack-cache (1.2) 45 | rack (>= 0.4) 46 | rack-test (0.6.1) 47 | rack (>= 1.0) 48 | rake (0.9.2.2) 49 | redcarpet (2.1.1) 50 | sprockets (2.1.2) 51 | hike (~> 1.2) 52 | rack (~> 1.0) 53 | tilt (~> 1.1, != 1.3.0) 54 | tilt (1.3.3) 55 | w3c_validators (1.2) 56 | json 57 | nokogiri 58 | 59 | PLATFORMS 60 | ruby 61 | 62 | DEPENDENCIES 63 | RedCloth (~> 4.2) 64 | actionpack (>= 3.0) 65 | activesupport (>= 3.0) 66 | capistrano 67 | rake (>= 0.8.7) 68 | redcarpet 69 | w3c_validators 70 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | desc 'Generate guides (for authors) in English, use ONLY=foo to process just "foo.textile"' 2 | task :generate_guides_EN do 3 | ENV['GUIDES_LANGUAGE']='EN' 4 | ruby "rails_guides.rb" 5 | end 6 | 7 | 8 | desc "Task description" 9 | task :generate_guides_CN do 10 | ENV['GUIDES_LANGUAGE']='CN' 11 | ruby "rails_guides.rb" 12 | end 13 | 14 | task :generate_guides => [:generate_guides_CN, :generate_guides_EN ] 15 | 16 | desc 'Validate guides, use ONLY=foo to process just "foo.html"' 17 | task :validate_guides do 18 | ruby "w3c_validator.rb" 19 | end 20 | -------------------------------------------------------------------------------- /assets/images/belongs_to.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/belongs_to.png -------------------------------------------------------------------------------- /assets/images/book_icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/book_icon.gif -------------------------------------------------------------------------------- /assets/images/bullet.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/bullet.gif -------------------------------------------------------------------------------- /assets/images/challenge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/challenge.png -------------------------------------------------------------------------------- /assets/images/chapters_icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/chapters_icon.gif -------------------------------------------------------------------------------- /assets/images/check_bullet.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/check_bullet.gif -------------------------------------------------------------------------------- /assets/images/credits_pic_blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/credits_pic_blank.gif -------------------------------------------------------------------------------- /assets/images/csrf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/csrf.png -------------------------------------------------------------------------------- /assets/images/customized_error_messages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/customized_error_messages.png -------------------------------------------------------------------------------- /assets/images/edge_badge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/edge_badge.png -------------------------------------------------------------------------------- /assets/images/error_messages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/error_messages.png -------------------------------------------------------------------------------- /assets/images/feature_tile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/feature_tile.gif -------------------------------------------------------------------------------- /assets/images/footer_tile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/footer_tile.gif -------------------------------------------------------------------------------- /assets/images/fxn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/fxn.png -------------------------------------------------------------------------------- /assets/images/getting_started/new_post.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/getting_started/new_post.png -------------------------------------------------------------------------------- /assets/images/getting_started/routing_error_no_controller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/getting_started/routing_error_no_controller.png -------------------------------------------------------------------------------- /assets/images/getting_started/routing_error_no_route_matches.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/getting_started/routing_error_no_route_matches.png -------------------------------------------------------------------------------- /assets/images/getting_started/template_is_missing_posts_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/getting_started/template_is_missing_posts_new.png -------------------------------------------------------------------------------- /assets/images/getting_started/unknown_action_create_for_posts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/getting_started/unknown_action_create_for_posts.png -------------------------------------------------------------------------------- /assets/images/getting_started/unknown_action_new_for_posts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/getting_started/unknown_action_new_for_posts.png -------------------------------------------------------------------------------- /assets/images/grey_bullet.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/grey_bullet.gif -------------------------------------------------------------------------------- /assets/images/habtm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/habtm.png -------------------------------------------------------------------------------- /assets/images/has_many.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/has_many.png -------------------------------------------------------------------------------- /assets/images/has_many_through.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/has_many_through.png -------------------------------------------------------------------------------- /assets/images/has_one.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/has_one.png -------------------------------------------------------------------------------- /assets/images/has_one_through.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/has_one_through.png -------------------------------------------------------------------------------- /assets/images/header_backdrop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/header_backdrop.png -------------------------------------------------------------------------------- /assets/images/header_tile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/header_tile.gif -------------------------------------------------------------------------------- /assets/images/i18n/demo_html_safe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/i18n/demo_html_safe.png -------------------------------------------------------------------------------- /assets/images/i18n/demo_localized_pirate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/i18n/demo_localized_pirate.png -------------------------------------------------------------------------------- /assets/images/i18n/demo_translated_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/i18n/demo_translated_en.png -------------------------------------------------------------------------------- /assets/images/i18n/demo_translated_pirate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/i18n/demo_translated_pirate.png -------------------------------------------------------------------------------- /assets/images/i18n/demo_translation_missing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/i18n/demo_translation_missing.png -------------------------------------------------------------------------------- /assets/images/i18n/demo_untranslated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/i18n/demo_untranslated.png -------------------------------------------------------------------------------- /assets/images/icons/README: -------------------------------------------------------------------------------- 1 | Replaced the plain DocBook XSL admonition icons with Jimmac's DocBook 2 | icons (http://jimmac.musichall.cz/ikony.php3). I dropped transparency 3 | from the Jimmac icons to get round MS IE and FOP PNG incompatibilies. 4 | 5 | Stuart Rackham 6 | -------------------------------------------------------------------------------- /assets/images/icons/callouts/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/callouts/1.png -------------------------------------------------------------------------------- /assets/images/icons/callouts/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/callouts/10.png -------------------------------------------------------------------------------- /assets/images/icons/callouts/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/callouts/11.png -------------------------------------------------------------------------------- /assets/images/icons/callouts/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/callouts/12.png -------------------------------------------------------------------------------- /assets/images/icons/callouts/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/callouts/13.png -------------------------------------------------------------------------------- /assets/images/icons/callouts/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/callouts/14.png -------------------------------------------------------------------------------- /assets/images/icons/callouts/15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/callouts/15.png -------------------------------------------------------------------------------- /assets/images/icons/callouts/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/callouts/2.png -------------------------------------------------------------------------------- /assets/images/icons/callouts/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/callouts/3.png -------------------------------------------------------------------------------- /assets/images/icons/callouts/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/callouts/4.png -------------------------------------------------------------------------------- /assets/images/icons/callouts/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/callouts/5.png -------------------------------------------------------------------------------- /assets/images/icons/callouts/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/callouts/6.png -------------------------------------------------------------------------------- /assets/images/icons/callouts/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/callouts/7.png -------------------------------------------------------------------------------- /assets/images/icons/callouts/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/callouts/8.png -------------------------------------------------------------------------------- /assets/images/icons/callouts/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/callouts/9.png -------------------------------------------------------------------------------- /assets/images/icons/caution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/caution.png -------------------------------------------------------------------------------- /assets/images/icons/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/example.png -------------------------------------------------------------------------------- /assets/images/icons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/favicon.ico -------------------------------------------------------------------------------- /assets/images/icons/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/home.png -------------------------------------------------------------------------------- /assets/images/icons/important.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/important.png -------------------------------------------------------------------------------- /assets/images/icons/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/next.png -------------------------------------------------------------------------------- /assets/images/icons/note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/note.png -------------------------------------------------------------------------------- /assets/images/icons/prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/prev.png -------------------------------------------------------------------------------- /assets/images/icons/tip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/tip.png -------------------------------------------------------------------------------- /assets/images/icons/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/up.png -------------------------------------------------------------------------------- /assets/images/icons/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/icons/warning.png -------------------------------------------------------------------------------- /assets/images/jaimeiniesta.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/jaimeiniesta.jpg -------------------------------------------------------------------------------- /assets/images/nav_arrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/nav_arrow.gif -------------------------------------------------------------------------------- /assets/images/polymorphic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/polymorphic.png -------------------------------------------------------------------------------- /assets/images/posts_index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/posts_index.png -------------------------------------------------------------------------------- /assets/images/radar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/radar.png -------------------------------------------------------------------------------- /assets/images/rails_guides_kindle_cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/rails_guides_kindle_cover.jpg -------------------------------------------------------------------------------- /assets/images/rails_guides_logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/rails_guides_logo.gif -------------------------------------------------------------------------------- /assets/images/rails_logo_remix.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/rails_logo_remix.gif -------------------------------------------------------------------------------- /assets/images/rails_welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/rails_welcome.png -------------------------------------------------------------------------------- /assets/images/session_fixation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/session_fixation.png -------------------------------------------------------------------------------- /assets/images/tab_grey.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/tab_grey.gif -------------------------------------------------------------------------------- /assets/images/tab_info.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/tab_info.gif -------------------------------------------------------------------------------- /assets/images/tab_note.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/tab_note.gif -------------------------------------------------------------------------------- /assets/images/tab_red.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/tab_red.gif -------------------------------------------------------------------------------- /assets/images/tab_yellow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/tab_yellow.gif -------------------------------------------------------------------------------- /assets/images/tab_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/tab_yellow.png -------------------------------------------------------------------------------- /assets/images/validation_error_messages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/validation_error_messages.png -------------------------------------------------------------------------------- /assets/images/vijaydev.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruby-china/rails-guides-old/cb526c27e168e245ef09e9d86f7b08160e53ea37/assets/images/vijaydev.jpg -------------------------------------------------------------------------------- /assets/javascripts/guides.js: -------------------------------------------------------------------------------- 1 | function guideMenu(){ 2 | if (document.getElementById('guides').style.display == "none") { 3 | document.getElementById('guides').style.display = "block"; 4 | } else { 5 | document.getElementById('guides').style.display = "none"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushAS3.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Created by Peter Atoria @ http://iAtoria.com 25 | 26 | var inits = 'class interface function package'; 27 | 28 | var keywords = '-Infinity ...rest Array as AS3 Boolean break case catch const continue Date decodeURI ' + 29 | 'decodeURIComponent default delete do dynamic each else encodeURI encodeURIComponent escape ' + 30 | 'extends false final finally flash_proxy for get if implements import in include Infinity ' + 31 | 'instanceof int internal is isFinite isNaN isXMLName label namespace NaN native new null ' + 32 | 'Null Number Object object_proxy override parseFloat parseInt private protected public ' + 33 | 'return set static String super switch this throw true try typeof uint undefined unescape ' + 34 | 'use void while with' 35 | ; 36 | 37 | this.regexList = [ 38 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments 39 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments 40 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings 41 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings 42 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers 43 | { regex: new RegExp(this.getKeywords(inits), 'gm'), css: 'color3' }, // initializations 44 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords 45 | { regex: new RegExp('var', 'gm'), css: 'variable' }, // variable 46 | { regex: new RegExp('trace', 'gm'), css: 'color1' } // trace 47 | ]; 48 | 49 | this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags); 50 | }; 51 | 52 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 53 | Brush.aliases = ['actionscript3', 'as3']; 54 | 55 | SyntaxHighlighter.brushes.AS3 = Brush; 56 | 57 | // CommonJS 58 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 59 | })(); 60 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushBash.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var keywords = 'if fi then elif else for do done until while break continue case function return in eq ne ge le'; 25 | var commands = 'alias apropos awk basename bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' + 26 | 'cksum clear cmp comm command cp cron crontab csplit cut date dc dd ddrescue declare df ' + 27 | 'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' + 28 | 'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' + 29 | 'free fsck ftp gawk getopts grep groups gzip hash head history hostname id ifconfig ' + 30 | 'import install join kill less let ln local locate logname logout look lpc lpr lprint ' + 31 | 'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' + 32 | 'mv netstat nice nl nohup nslookup open op passwd paste pathchk ping popd pr printcap ' + 33 | 'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' + 34 | 'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' + 35 | 'sleep sort source split ssh strace su sudo sum symlink sync tail tar tee test time ' + 36 | 'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' + 37 | 'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' + 38 | 'vi watch wc whereis which who whoami Wget xargs yes' 39 | ; 40 | 41 | this.regexList = [ 42 | { regex: /^#!.*$/gm, css: 'preprocessor bold' }, 43 | { regex: /\/[\w-\/]+/gm, css: 'plain' }, 44 | { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments 45 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings 46 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings 47 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords 48 | { regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' } // commands 49 | ]; 50 | } 51 | 52 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 53 | Brush.aliases = ['bash', 'shell']; 54 | 55 | SyntaxHighlighter.brushes.Bash = Brush; 56 | 57 | // CommonJS 58 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 59 | })(); 60 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushCSharp.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var keywords = 'abstract as base bool break byte case catch char checked class const ' + 25 | 'continue decimal default delegate do double else enum event explicit ' + 26 | 'extern false finally fixed float for foreach get goto if implicit in int ' + 27 | 'interface internal is lock long namespace new null object operator out ' + 28 | 'override params private protected public readonly ref return sbyte sealed set ' + 29 | 'short sizeof stackalloc static string struct switch this throw true try ' + 30 | 'typeof uint ulong unchecked unsafe ushort using virtual void while'; 31 | 32 | function fixComments(match, regexInfo) 33 | { 34 | var css = (match[0].indexOf("///") == 0) 35 | ? 'color1' 36 | : 'comments' 37 | ; 38 | 39 | return [new SyntaxHighlighter.Match(match[0], match.index, css)]; 40 | } 41 | 42 | this.regexList = [ 43 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, func : fixComments }, // one line comments 44 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments 45 | { regex: /@"(?:[^"]|"")*"/g, css: 'string' }, // @-quoted strings 46 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings 47 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 48 | { regex: /^\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion 49 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // c# keyword 50 | { regex: /\bpartial(?=\s+(?:class|interface|struct)\b)/g, css: 'keyword' }, // contextual keyword: 'partial' 51 | { regex: /\byield(?=\s+(?:return|break)\b)/g, css: 'keyword' } // contextual keyword: 'yield' 52 | ]; 53 | 54 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); 55 | }; 56 | 57 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 58 | Brush.aliases = ['c#', 'c-sharp', 'csharp']; 59 | 60 | SyntaxHighlighter.brushes.CSharp = Brush; 61 | 62 | // CommonJS 63 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 64 | })(); 65 | 66 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushCpp.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Copyright 2006 Shin, YoungJin 25 | 26 | var datatypes = 'ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR ' + 27 | 'DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH ' + 28 | 'HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP ' + 29 | 'HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY ' + 30 | 'HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT ' + 31 | 'HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE ' + 32 | 'LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF ' + 33 | 'LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR ' + 34 | 'LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR ' + 35 | 'PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT ' + 36 | 'PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 ' + 37 | 'POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR ' + 38 | 'PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 ' + 39 | 'PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT ' + 40 | 'SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG ' + 41 | 'ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM ' + 42 | 'char bool short int __int32 __int64 __int8 __int16 long float double __wchar_t ' + 43 | 'clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS ' + 44 | 'FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t ' + 45 | '__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t ' + 46 | 'jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler ' + 47 | 'sig_atomic_t size_t _stat __stat64 _stati64 terminate_function ' + 48 | 'time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf ' + 49 | 'va_list wchar_t wctrans_t wctype_t wint_t signed'; 50 | 51 | var keywords = 'break case catch class const __finally __exception __try ' + 52 | 'const_cast continue private public protected __declspec ' + 53 | 'default delete deprecated dllexport dllimport do dynamic_cast ' + 54 | 'else enum explicit extern if for friend goto inline ' + 55 | 'mutable naked namespace new noinline noreturn nothrow ' + 56 | 'register reinterpret_cast return selectany ' + 57 | 'sizeof static static_cast struct switch template this ' + 58 | 'thread throw true false try typedef typeid typename union ' + 59 | 'using uuid virtual void volatile whcar_t while'; 60 | 61 | var functions = 'assert isalnum isalpha iscntrl isdigit isgraph islower isprint' + 62 | 'ispunct isspace isupper isxdigit tolower toupper errno localeconv ' + 63 | 'setlocale acos asin atan atan2 ceil cos cosh exp fabs floor fmod ' + 64 | 'frexp ldexp log log10 modf pow sin sinh sqrt tan tanh jmp_buf ' + 65 | 'longjmp setjmp raise signal sig_atomic_t va_arg va_end va_start ' + 66 | 'clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen ' + 67 | 'fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell ' + 68 | 'fwrite getc getchar gets perror printf putc putchar puts remove ' + 69 | 'rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ' + 70 | 'ungetc vfprintf vprintf vsprintf abort abs atexit atof atoi atol ' + 71 | 'bsearch calloc div exit free getenv labs ldiv malloc mblen mbstowcs ' + 72 | 'mbtowc qsort rand realloc srand strtod strtol strtoul system ' + 73 | 'wcstombs wctomb memchr memcmp memcpy memmove memset strcat strchr ' + 74 | 'strcmp strcoll strcpy strcspn strerror strlen strncat strncmp ' + 75 | 'strncpy strpbrk strrchr strspn strstr strtok strxfrm asctime ' + 76 | 'clock ctime difftime gmtime localtime mktime strftime time'; 77 | 78 | this.regexList = [ 79 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments 80 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments 81 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings 82 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 83 | { regex: /^ *#.*/gm, css: 'preprocessor' }, 84 | { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'color1 bold' }, 85 | { regex: new RegExp(this.getKeywords(functions), 'gm'), css: 'functions bold' }, 86 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword bold' } 87 | ]; 88 | }; 89 | 90 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 91 | Brush.aliases = ['cpp', 'c']; 92 | 93 | SyntaxHighlighter.brushes.Cpp = Brush; 94 | 95 | // CommonJS 96 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 97 | })(); 98 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushCss.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | function getKeywordsCSS(str) 25 | { 26 | return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b'; 27 | }; 28 | 29 | function getValuesCSS(str) 30 | { 31 | return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b'; 32 | }; 33 | 34 | var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' + 35 | 'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' + 36 | 'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' + 37 | 'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' + 38 | 'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' + 39 | 'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' + 40 | 'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' + 41 | 'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' + 42 | 'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' + 43 | 'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' + 44 | 'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' + 45 | 'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' + 46 | 'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' + 47 | 'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index'; 48 | 49 | var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+ 50 | 'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+ 51 | 'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double '+ 52 | 'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+ 53 | 'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+ 54 | 'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+ 55 | 'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+ 56 | 'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+ 57 | 'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+ 58 | 'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+ 59 | 'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+ 60 | 'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+ 61 | 'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+ 62 | 'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow'; 63 | 64 | var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif'; 65 | 66 | this.regexList = [ 67 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments 68 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings 69 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings 70 | { regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors 71 | { regex: /(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)/g, css: 'value' }, // sizes 72 | { regex: /!important/g, css: 'color3' }, // !important 73 | { regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords 74 | { regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values 75 | { regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts 76 | ]; 77 | 78 | this.forHtmlScript({ 79 | left: /(<|<)\s*style.*?(>|>)/gi, 80 | right: /(<|<)\/\s*style\s*(>|>)/gi 81 | }); 82 | }; 83 | 84 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 85 | Brush.aliases = ['css']; 86 | 87 | SyntaxHighlighter.brushes.CSS = Brush; 88 | 89 | // CommonJS 90 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 91 | })(); 92 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushDelphi.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var keywords = 'abs addr and ansichar ansistring array as asm begin boolean byte cardinal ' + 25 | 'case char class comp const constructor currency destructor div do double ' + 26 | 'downto else end except exports extended false file finalization finally ' + 27 | 'for function goto if implementation in inherited int64 initialization ' + 28 | 'integer interface is label library longint longword mod nil not object ' + 29 | 'of on or packed pansichar pansistring pchar pcurrency pdatetime pextended ' + 30 | 'pint64 pointer private procedure program property pshortstring pstring ' + 31 | 'pvariant pwidechar pwidestring protected public published raise real real48 ' + 32 | 'record repeat set shl shortint shortstring shr single smallint string then ' + 33 | 'threadvar to true try type unit until uses val var varirnt while widechar ' + 34 | 'widestring with word write writeln xor'; 35 | 36 | this.regexList = [ 37 | { regex: /\(\*[\s\S]*?\*\)/gm, css: 'comments' }, // multiline comments (* *) 38 | { regex: /{(?!\$)[\s\S]*?}/gm, css: 'comments' }, // multiline comments { } 39 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line 40 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 41 | { regex: /\{\$[a-zA-Z]+ .+\}/g, css: 'color1' }, // compiler Directives and Region tags 42 | { regex: /\b[\d\.]+\b/g, css: 'value' }, // numbers 12345 43 | { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // numbers $F5D3 44 | { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword 45 | ]; 46 | }; 47 | 48 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 49 | Brush.aliases = ['delphi', 'pascal', 'pas']; 50 | 51 | SyntaxHighlighter.brushes.Delphi = Brush; 52 | 53 | // CommonJS 54 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 55 | })(); 56 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushDiff.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | this.regexList = [ 25 | { regex: /^\+\+\+.*$/gm, css: 'color2' }, 26 | { regex: /^\-\-\-.*$/gm, css: 'color2' }, 27 | { regex: /^\s.*$/gm, css: 'color1' }, 28 | { regex: /^@@.*@@$/gm, css: 'variable' }, 29 | { regex: /^\+[^\+]{1}.*$/gm, css: 'string' }, 30 | { regex: /^\-[^\-]{1}.*$/gm, css: 'comments' } 31 | ]; 32 | }; 33 | 34 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 35 | Brush.aliases = ['diff', 'patch']; 36 | 37 | SyntaxHighlighter.brushes.Diff = Brush; 38 | 39 | // CommonJS 40 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 41 | })(); 42 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushErlang.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by Jean-Lou Dupont 25 | // http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html 26 | 27 | // According to: http://erlang.org/doc/reference_manual/introduction.html#1.5 28 | var keywords = 'after and andalso band begin bnot bor bsl bsr bxor '+ 29 | 'case catch cond div end fun if let not of or orelse '+ 30 | 'query receive rem try when xor'+ 31 | // additional 32 | ' module export import define'; 33 | 34 | this.regexList = [ 35 | { regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'), css: 'constants' }, 36 | { regex: new RegExp("\\%.+", 'gm'), css: 'comments' }, 37 | { regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'), css: 'preprocessor' }, 38 | { regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'), css: 'functions' }, 39 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, 40 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, 41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } 42 | ]; 43 | }; 44 | 45 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 46 | Brush.aliases = ['erl', 'erlang']; 47 | 48 | SyntaxHighlighter.brushes.Erland = Brush; 49 | 50 | // CommonJS 51 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 52 | })(); 53 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushGroovy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by Andres Almiray 25 | // http://jroller.com/aalmiray/entry/nice_source_code_syntax_highlighter 26 | 27 | var keywords = 'as assert break case catch class continue def default do else extends finally ' + 28 | 'if in implements import instanceof interface new package property return switch ' + 29 | 'throw throws try while public protected private static'; 30 | var types = 'void boolean byte char short int long float double'; 31 | var constants = 'null'; 32 | var methods = 'allProperties count get size '+ 33 | 'collect each eachProperty eachPropertyName eachWithIndex find findAll ' + 34 | 'findIndexOf grep inject max min reverseEach sort ' + 35 | 'asImmutable asSynchronized flatten intersect join pop reverse subMap toList ' + 36 | 'padRight padLeft contains eachMatch toCharacter toLong toUrl tokenize ' + 37 | 'eachFile eachFileRecurse eachB yte eachLine readBytes readLine getText ' + 38 | 'splitEachLine withReader append encodeBase64 decodeBase64 filterLine ' + 39 | 'transformChar transformLine withOutputStream withPrintWriter withStream ' + 40 | 'withStreams withWriter withWriterAppend write writeLine '+ 41 | 'dump inspect invokeMethod print println step times upto use waitForOrKill '+ 42 | 'getText'; 43 | 44 | this.regexList = [ 45 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments 46 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments 47 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings 48 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 49 | { regex: /""".*"""/g, css: 'string' }, // GStrings 50 | { regex: new RegExp('\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b', 'gi'), css: 'value' }, // numbers 51 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // goovy keyword 52 | { regex: new RegExp(this.getKeywords(types), 'gm'), css: 'color1' }, // goovy/java type 53 | { regex: new RegExp(this.getKeywords(constants), 'gm'), css: 'constants' }, // constants 54 | { regex: new RegExp(this.getKeywords(methods), 'gm'), css: 'functions' } // methods 55 | ]; 56 | 57 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); 58 | } 59 | 60 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 61 | Brush.aliases = ['groovy']; 62 | 63 | SyntaxHighlighter.brushes.Groovy = Brush; 64 | 65 | // CommonJS 66 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 67 | })(); 68 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushJScript.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var keywords = 'break case catch continue ' + 25 | 'default delete do else false ' + 26 | 'for function if in instanceof ' + 27 | 'new null return super switch ' + 28 | 'this throw true try typeof var while with' 29 | ; 30 | 31 | var r = SyntaxHighlighter.regexLib; 32 | 33 | this.regexList = [ 34 | { regex: r.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings 35 | { regex: r.multiLineSingleQuotedString, css: 'string' }, // single quoted strings 36 | { regex: r.singleLineCComments, css: 'comments' }, // one line comments 37 | { regex: r.multiLineCComments, css: 'comments' }, // multiline comments 38 | { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion 39 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords 40 | ]; 41 | 42 | this.forHtmlScript(r.scriptScriptTags); 43 | }; 44 | 45 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 46 | Brush.aliases = ['js', 'jscript', 'javascript']; 47 | 48 | SyntaxHighlighter.brushes.JScript = Brush; 49 | 50 | // CommonJS 51 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 52 | })(); 53 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushJava.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var keywords = 'abstract assert boolean break byte case catch char class const ' + 25 | 'continue default do double else enum extends ' + 26 | 'false final finally float for goto if implements import ' + 27 | 'instanceof int interface long native new null ' + 28 | 'package private protected public return ' + 29 | 'short static strictfp super switch synchronized this throw throws true ' + 30 | 'transient try void volatile while'; 31 | 32 | this.regexList = [ 33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments 34 | { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments 35 | { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments 36 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings 37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 38 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers 39 | { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno 40 | { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword 41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword 42 | ]; 43 | 44 | this.forHtmlScript({ 45 | left : /(<|<)%[@!=]?/g, 46 | right : /%(>|>)/g 47 | }); 48 | }; 49 | 50 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 51 | Brush.aliases = ['java']; 52 | 53 | SyntaxHighlighter.brushes.Java = Brush; 54 | 55 | // CommonJS 56 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 57 | })(); 58 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushJavaFX.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by Patrick Webster 25 | // http://patrickwebster.blogspot.com/2009/04/javafx-brush-for-syntaxhighlighter.html 26 | var datatypes = 'Boolean Byte Character Double Duration ' 27 | + 'Float Integer Long Number Short String Void' 28 | ; 29 | 30 | var keywords = 'abstract after and as assert at before bind bound break catch class ' 31 | + 'continue def delete else exclusive extends false finally first for from ' 32 | + 'function if import in indexof init insert instanceof into inverse last ' 33 | + 'lazy mixin mod nativearray new not null on or override package postinit ' 34 | + 'protected public public-init public-read replace return reverse sizeof ' 35 | + 'step super then this throw true try tween typeof var where while with ' 36 | + 'attribute let private readonly static trigger' 37 | ; 38 | 39 | this.regexList = [ 40 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, 41 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, 42 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, 43 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, 44 | { regex: /(-?\.?)(\b(\d*\.?\d+|\d+\.?\d*)(e[+-]?\d+)?|0x[a-f\d]+)\b\.?/gi, css: 'color2' }, // numbers 45 | { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'variable' }, // datatypes 46 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } 47 | ]; 48 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); 49 | }; 50 | 51 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 52 | Brush.aliases = ['jfx', 'javafx']; 53 | 54 | SyntaxHighlighter.brushes.JavaFX = Brush; 55 | 56 | // CommonJS 57 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 58 | })(); 59 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushPerl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by David Simmons-Duffin and Marty Kube 25 | 26 | var funcs = 27 | 'abs accept alarm atan2 bind binmode chdir chmod chomp chop chown chr ' + 28 | 'chroot close closedir connect cos crypt defined delete each endgrent ' + 29 | 'endhostent endnetent endprotoent endpwent endservent eof exec exists ' + 30 | 'exp fcntl fileno flock fork format formline getc getgrent getgrgid ' + 31 | 'getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr ' + 32 | 'getnetbyname getnetent getpeername getpgrp getppid getpriority ' + 33 | 'getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid ' + 34 | 'getservbyname getservbyport getservent getsockname getsockopt glob ' + 35 | 'gmtime grep hex index int ioctl join keys kill lc lcfirst length link ' + 36 | 'listen localtime lock log lstat map mkdir msgctl msgget msgrcv msgsnd ' + 37 | 'oct open opendir ord pack pipe pop pos print printf prototype push ' + 38 | 'quotemeta rand read readdir readline readlink readpipe recv rename ' + 39 | 'reset reverse rewinddir rindex rmdir scalar seek seekdir select semctl ' + 40 | 'semget semop send setgrent sethostent setnetent setpgrp setpriority ' + 41 | 'setprotoent setpwent setservent setsockopt shift shmctl shmget shmread ' + 42 | 'shmwrite shutdown sin sleep socket socketpair sort splice split sprintf ' + 43 | 'sqrt srand stat study substr symlink syscall sysopen sysread sysseek ' + 44 | 'system syswrite tell telldir time times tr truncate uc ucfirst umask ' + 45 | 'undef unlink unpack unshift utime values vec wait waitpid warn write'; 46 | 47 | var keywords = 48 | 'bless caller continue dbmclose dbmopen die do dump else elsif eval exit ' + 49 | 'for foreach goto if import last local my next no our package redo ref ' + 50 | 'require return sub tie tied unless untie until use wantarray while'; 51 | 52 | this.regexList = [ 53 | { regex: new RegExp('#[^!].*$', 'gm'), css: 'comments' }, 54 | { regex: new RegExp('^\\s*#!.*$', 'gm'), css: 'preprocessor' }, // shebang 55 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, 56 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, 57 | { regex: new RegExp('(\\$|@|%)\\w+', 'g'), css: 'variable' }, 58 | { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, 59 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } 60 | ]; 61 | 62 | this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags); 63 | } 64 | 65 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 66 | Brush.aliases = ['perl', 'Perl', 'pl']; 67 | 68 | SyntaxHighlighter.brushes.Perl = Brush; 69 | 70 | // CommonJS 71 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 72 | })(); 73 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushPhp.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var funcs = 'abs acos acosh addcslashes addslashes ' + 25 | 'array_change_key_case array_chunk array_combine array_count_values array_diff '+ 26 | 'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+ 27 | 'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+ 28 | 'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+ 29 | 'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+ 30 | 'array_push array_rand array_reduce array_reverse array_search array_shift '+ 31 | 'array_slice array_splice array_sum array_udiff array_udiff_assoc '+ 32 | 'array_udiff_uassoc array_uintersect array_uintersect_assoc '+ 33 | 'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+ 34 | 'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+ 35 | 'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+ 36 | 'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+ 37 | 'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+ 38 | 'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+ 39 | 'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+ 40 | 'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+ 41 | 'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+ 42 | 'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+ 43 | 'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+ 44 | 'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+ 45 | 'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+ 46 | 'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+ 47 | 'gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set '+ 48 | 'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+ 49 | 'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+ 50 | 'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+ 51 | 'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+ 52 | 'parse_ini_file parse_str parse_url passthru pathinfo print readlink realpath rewind rewinddir rmdir '+ 53 | 'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+ 54 | 'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+ 55 | 'stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk '+ 56 | 'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+ 57 | 'strtoupper strtr strval substr substr_compare'; 58 | 59 | var keywords = 'abstract and array as break case catch cfunction class clone const continue declare default die do ' + 60 | 'else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach ' + 61 | 'function include include_once global goto if implements interface instanceof namespace new ' + 62 | 'old_function or private protected public return require require_once static switch ' + 63 | 'throw try use var while xor '; 64 | 65 | var constants = '__FILE__ __LINE__ __METHOD__ __FUNCTION__ __CLASS__'; 66 | 67 | this.regexList = [ 68 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments 69 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments 70 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings 71 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings 72 | { regex: /\$\w+/g, css: 'variable' }, // variables 73 | { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // common functions 74 | { regex: new RegExp(this.getKeywords(constants), 'gmi'), css: 'constants' }, // constants 75 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keyword 76 | ]; 77 | 78 | this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags); 79 | }; 80 | 81 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 82 | Brush.aliases = ['php']; 83 | 84 | SyntaxHighlighter.brushes.Php = Brush; 85 | 86 | // CommonJS 87 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 88 | })(); 89 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushPlain.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | }; 25 | 26 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 27 | Brush.aliases = ['text', 'plain']; 28 | 29 | SyntaxHighlighter.brushes.Plain = Brush; 30 | 31 | // CommonJS 32 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 33 | })(); 34 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushPowerShell.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributes by B.v.Zanten, Getronics 25 | // http://confluence.atlassian.com/display/CONFEXT/New+Code+Macro 26 | 27 | var keywords = 'Add-Content Add-History Add-Member Add-PSSnapin Clear(-Content)? Clear-Item ' + 28 | 'Clear-ItemProperty Clear-Variable Compare-Object ConvertFrom-SecureString Convert-Path ' + 29 | 'ConvertTo-Html ConvertTo-SecureString Copy(-Item)? Copy-ItemProperty Export-Alias ' + 30 | 'Export-Clixml Export-Console Export-Csv ForEach(-Object)? Format-Custom Format-List ' + 31 | 'Format-Table Format-Wide Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command ' + 32 | 'Get-Content Get-Credential Get-Culture Get-Date Get-EventLog Get-ExecutionPolicy ' + 33 | 'Get-Help Get-History Get-Host Get-Item Get-ItemProperty Get-Location Get-Member ' + 34 | 'Get-PfxCertificate Get-Process Get-PSDrive Get-PSProvider Get-PSSnapin Get-Service ' + 35 | 'Get-TraceSource Get-UICulture Get-Unique Get-Variable Get-WmiObject Group-Object ' + 36 | 'Import-Alias Import-Clixml Import-Csv Invoke-Expression Invoke-History Invoke-Item ' + 37 | 'Join-Path Measure-Command Measure-Object Move(-Item)? Move-ItemProperty New-Alias ' + 38 | 'New-Item New-ItemProperty New-Object New-PSDrive New-Service New-TimeSpan ' + 39 | 'New-Variable Out-Default Out-File Out-Host Out-Null Out-Printer Out-String Pop-Location ' + 40 | 'Push-Location Read-Host Remove-Item Remove-ItemProperty Remove-PSDrive Remove-PSSnapin ' + 41 | 'Remove-Variable Rename-Item Rename-ItemProperty Resolve-Path Restart-Service Resume-Service ' + 42 | 'Select-Object Select-String Set-Acl Set-Alias Set-AuthenticodeSignature Set-Content ' + 43 | 'Set-Date Set-ExecutionPolicy Set-Item Set-ItemProperty Set-Location Set-PSDebug ' + 44 | 'Set-Service Set-TraceSource Set(-Variable)? Sort-Object Split-Path Start-Service ' + 45 | 'Start-Sleep Start-Transcript Stop-Process Stop-Service Stop-Transcript Suspend-Service ' + 46 | 'Tee-Object Test-Path Trace-Command Update-FormatData Update-TypeData Where(-Object)? ' + 47 | 'Write-Debug Write-Error Write(-Host)? Write-Output Write-Progress Write-Verbose Write-Warning'; 48 | var alias = 'ac asnp clc cli clp clv cpi cpp cvpa diff epal epcsv fc fl ' + 49 | 'ft fw gal gc gci gcm gdr ghy gi gl gm gp gps group gsv ' + 50 | 'gsnp gu gv gwmi iex ihy ii ipal ipcsv mi mp nal ndr ni nv oh rdr ' + 51 | 'ri rni rnp rp rsnp rv rvpa sal sasv sc select si sl sleep sort sp ' + 52 | 'spps spsv sv tee cat cd cp h history kill lp ls ' + 53 | 'mount mv popd ps pushd pwd r rm rmdir echo cls chdir del dir ' + 54 | 'erase rd ren type % \\?'; 55 | 56 | this.regexList = [ 57 | { regex: /#.*$/gm, css: 'comments' }, // one line comments 58 | { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // variables $Computer1 59 | { regex: /\-[a-zA-Z]+\b/g, css: 'keyword' }, // Operators -not -and -eq 60 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings 61 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 62 | { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' }, 63 | { regex: new RegExp(this.getKeywords(alias), 'gmi'), css: 'keyword' } 64 | ]; 65 | }; 66 | 67 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 68 | Brush.aliases = ['powershell', 'ps']; 69 | 70 | SyntaxHighlighter.brushes.PowerShell = Brush; 71 | 72 | // CommonJS 73 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 74 | })(); 75 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushPython.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by Gheorghe Milas and Ahmad Sherif 25 | 26 | var keywords = 'and assert break class continue def del elif else ' + 27 | 'except exec finally for from global if import in is ' + 28 | 'lambda not or pass print raise return try yield while'; 29 | 30 | var funcs = '__import__ abs all any apply basestring bin bool buffer callable ' + 31 | 'chr classmethod cmp coerce compile complex delattr dict dir ' + 32 | 'divmod enumerate eval execfile file filter float format frozenset ' + 33 | 'getattr globals hasattr hash help hex id input int intern ' + 34 | 'isinstance issubclass iter len list locals long map max min next ' + 35 | 'object oct open ord pow print property range raw_input reduce ' + 36 | 'reload repr reversed round set setattr slice sorted staticmethod ' + 37 | 'str sum super tuple type type unichr unicode vars xrange zip'; 38 | 39 | var special = 'None True False self cls class_'; 40 | 41 | this.regexList = [ 42 | { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, 43 | { regex: /^\s*@\w+/gm, css: 'decorator' }, 44 | { regex: /(['\"]{3})([^\1])*?\1/gm, css: 'comments' }, 45 | { regex: /"(?!")(?:\.|\\\"|[^\""\n])*"/gm, css: 'string' }, 46 | { regex: /'(?!')(?:\.|(\\\')|[^\''\n])*'/gm, css: 'string' }, 47 | { regex: /\+|\-|\*|\/|\%|=|==/gm, css: 'keyword' }, 48 | { regex: /\b\d+\.?\w*/g, css: 'value' }, 49 | { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, 50 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, 51 | { regex: new RegExp(this.getKeywords(special), 'gm'), css: 'color1' } 52 | ]; 53 | 54 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); 55 | }; 56 | 57 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 58 | Brush.aliases = ['py', 'python']; 59 | 60 | SyntaxHighlighter.brushes.Python = Brush; 61 | 62 | // CommonJS 63 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 64 | })(); 65 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushRuby.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by Erik Peterson. 25 | 26 | var keywords = 'alias and BEGIN begin break case class def define_method defined do each else elsif ' + 27 | 'END end ensure false for if in module new next nil not or raise redo rescue retry return ' + 28 | 'self super then throw true undef unless until when while yield'; 29 | 30 | var builtins = 'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' + 31 | 'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' + 32 | 'ThreadGroup Thread Time TrueClass'; 33 | 34 | this.regexList = [ 35 | { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments 36 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings 37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings 38 | { regex: /\b[A-Z0-9_]+\b/g, css: 'constants' }, // constants 39 | { regex: /:[a-z][A-Za-z0-9_]*/g, css: 'color2' }, // symbols 40 | { regex: /(\$|@@|@)\w+/g, css: 'variable bold' }, // $global, @instance, and @@class variables 41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords 42 | { regex: new RegExp(this.getKeywords(builtins), 'gm'), css: 'color1' } // builtins 43 | ]; 44 | 45 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); 46 | }; 47 | 48 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 49 | Brush.aliases = ['ruby', 'rails', 'ror', 'rb']; 50 | 51 | SyntaxHighlighter.brushes.Ruby = Brush; 52 | 53 | // CommonJS 54 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 55 | })(); 56 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushSass.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | function getKeywordsCSS(str) 25 | { 26 | return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b'; 27 | }; 28 | 29 | function getValuesCSS(str) 30 | { 31 | return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b'; 32 | }; 33 | 34 | var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' + 35 | 'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' + 36 | 'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' + 37 | 'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' + 38 | 'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' + 39 | 'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' + 40 | 'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' + 41 | 'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' + 42 | 'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' + 43 | 'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' + 44 | 'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' + 45 | 'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' + 46 | 'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' + 47 | 'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index'; 48 | 49 | var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+ 50 | 'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+ 51 | 'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero digits disc dotted double '+ 52 | 'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+ 53 | 'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+ 54 | 'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+ 55 | 'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+ 56 | 'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+ 57 | 'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+ 58 | 'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+ 59 | 'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+ 60 | 'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+ 61 | 'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+ 62 | 'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow'; 63 | 64 | var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif'; 65 | 66 | var statements = '!important !default'; 67 | var preprocessor = '@import @extend @debug @warn @if @for @while @mixin @include'; 68 | 69 | var r = SyntaxHighlighter.regexLib; 70 | 71 | this.regexList = [ 72 | { regex: r.multiLineCComments, css: 'comments' }, // multiline comments 73 | { regex: r.singleLineCComments, css: 'comments' }, // singleline comments 74 | { regex: r.doubleQuotedString, css: 'string' }, // double quoted strings 75 | { regex: r.singleQuotedString, css: 'string' }, // single quoted strings 76 | { regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors 77 | { regex: /\b(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)\b/g, css: 'value' }, // sizes 78 | { regex: /\$\w+/g, css: 'variable' }, // variables 79 | { regex: new RegExp(this.getKeywords(statements), 'g'), css: 'color3' }, // statements 80 | { regex: new RegExp(this.getKeywords(preprocessor), 'g'), css: 'preprocessor' }, // preprocessor 81 | { regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords 82 | { regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values 83 | { regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts 84 | ]; 85 | }; 86 | 87 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 88 | Brush.aliases = ['sass', 'scss']; 89 | 90 | SyntaxHighlighter.brushes.Sass = Brush; 91 | 92 | // CommonJS 93 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 94 | })(); 95 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushScala.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by Yegor Jbanov and David Bernard. 25 | 26 | var keywords = 'val sealed case def true trait implicit forSome import match object null finally super ' + 27 | 'override try lazy for var catch throw type extends class while with new final yield abstract ' + 28 | 'else do if return protected private this package false'; 29 | 30 | var keyops = '[_:=><%#@]+'; 31 | 32 | this.regexList = [ 33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments 34 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments 35 | { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // multi-line strings 36 | { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double-quoted string 37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 38 | { regex: /0x[a-f0-9]+|\d+(\.\d+)?/gi, css: 'value' }, // numbers 39 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords 40 | { regex: new RegExp(keyops, 'gm'), css: 'keyword' } // scala keyword 41 | ]; 42 | } 43 | 44 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 45 | Brush.aliases = ['scala']; 46 | 47 | SyntaxHighlighter.brushes.Scala = Brush; 48 | 49 | // CommonJS 50 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 51 | })(); 52 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushSql.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var funcs = 'abs avg case cast coalesce convert count current_timestamp ' + 25 | 'current_user day isnull left lower month nullif replace right ' + 26 | 'session_user space substring sum system_user upper user year'; 27 | 28 | var keywords = 'absolute action add after alter as asc at authorization begin bigint ' + 29 | 'binary bit by cascade char character check checkpoint close collate ' + 30 | 'column commit committed connect connection constraint contains continue ' + 31 | 'create cube current current_date current_time cursor database date ' + 32 | 'deallocate dec decimal declare default delete desc distinct double drop ' + 33 | 'dynamic else end end-exec escape except exec execute false fetch first ' + 34 | 'float for force foreign forward free from full function global goto grant ' + 35 | 'group grouping having hour ignore index inner insensitive insert instead ' + 36 | 'int integer intersect into is isolation key last level load local max min ' + 37 | 'minute modify move name national nchar next no numeric of off on only ' + 38 | 'open option order out output partial password precision prepare primary ' + 39 | 'prior privileges procedure public read real references relative repeatable ' + 40 | 'restrict return returns revoke rollback rollup rows rule schema scroll ' + 41 | 'second section select sequence serializable set size smallint static ' + 42 | 'statistics table temp temporary then time timestamp to top transaction ' + 43 | 'translation trigger true truncate uncommitted union unique update values ' + 44 | 'varchar varying view when where with work'; 45 | 46 | var operators = 'all and any between cross in join like not null or outer some'; 47 | 48 | this.regexList = [ 49 | { regex: /--(.*)$/gm, css: 'comments' }, // one line and multiline comments 50 | { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings 51 | { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // single quoted strings 52 | { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'color2' }, // functions 53 | { regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such 54 | { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword 55 | ]; 56 | }; 57 | 58 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 59 | Brush.aliases = ['sql']; 60 | 61 | SyntaxHighlighter.brushes.Sql = Brush; 62 | 63 | // CommonJS 64 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 65 | })(); 66 | 67 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushVb.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var keywords = 'AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto ' + 25 | 'Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate ' + 26 | 'CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType ' + 27 | 'Date Decimal Declare Default Delegate Dim DirectCast Do Double Each ' + 28 | 'Else ElseIf End Enum Erase Error Event Exit False Finally For Friend ' + 29 | 'Function Get GetType GoSub GoTo Handles If Implements Imports In ' + 30 | 'Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module ' + 31 | 'MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing ' + 32 | 'NotInheritable NotOverridable Object On Option Optional Or OrElse ' + 33 | 'Overloads Overridable Overrides ParamArray Preserve Private Property ' + 34 | 'Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume ' + 35 | 'Return Select Set Shadows Shared Short Single Static Step Stop String ' + 36 | 'Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until ' + 37 | 'Variant When While With WithEvents WriteOnly Xor'; 38 | 39 | this.regexList = [ 40 | { regex: /'.*$/gm, css: 'comments' }, // one line comments 41 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings 42 | { regex: /^\s*#.*$/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion 43 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // vb keyword 44 | ]; 45 | 46 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); 47 | }; 48 | 49 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 50 | Brush.aliases = ['vb', 'vbnet']; 51 | 52 | SyntaxHighlighter.brushes.Vb = Brush; 53 | 54 | // CommonJS 55 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 56 | })(); 57 | -------------------------------------------------------------------------------- /assets/javascripts/syntaxhighlighter/shBrushXml.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | function process(match, regexInfo) 25 | { 26 | var constructor = SyntaxHighlighter.Match, 27 | code = match[0], 28 | tag = new XRegExp('(<|<)[\\s\\/\\?]*(?[:\\w-\\.]+)', 'xg').exec(code), 29 | result = [] 30 | ; 31 | 32 | if (match.attributes != null) 33 | { 34 | var attributes, 35 | regex = new XRegExp('(? [\\w:\\-\\.]+)' + 36 | '\\s*=\\s*' + 37 | '(? ".*?"|\'.*?\'|\\w+)', 38 | 'xg'); 39 | 40 | while ((attributes = regex.exec(code)) != null) 41 | { 42 | result.push(new constructor(attributes.name, match.index + attributes.index, 'color1')); 43 | result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string')); 44 | } 45 | } 46 | 47 | if (tag != null) 48 | result.push( 49 | new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword') 50 | ); 51 | 52 | return result; 53 | } 54 | 55 | this.regexList = [ 56 | { regex: new XRegExp('(\\<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\>|>)', 'gm'), css: 'color2' }, // 57 | { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // 58 | { regex: new XRegExp('(<|<)[\\s\\/\\?]*(\\w+)(?.*?)[\\s\\/\\?]*(>|>)', 'sg'), func: process } 59 | ]; 60 | }; 61 | 62 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 63 | Brush.aliases = ['xml', 'xhtml', 'xslt', 'html']; 64 | 65 | SyntaxHighlighter.brushes.Xml = Brush; 66 | 67 | // CommonJS 68 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 69 | })(); 70 | -------------------------------------------------------------------------------- /assets/stylesheets/fixes.css: -------------------------------------------------------------------------------- 1 | /* 2 | Fix a rendering issue affecting WebKits on Mac. 3 | See https://github.com/lifo/docrails/issues#issue/16 for more information. 4 | */ 5 | .syntaxhighlighter a, 6 | .syntaxhighlighter div, 7 | .syntaxhighlighter code, 8 | .syntaxhighlighter table, 9 | .syntaxhighlighter table td, 10 | .syntaxhighlighter table tr, 11 | .syntaxhighlighter table tbody, 12 | .syntaxhighlighter table thead, 13 | .syntaxhighlighter table caption, 14 | .syntaxhighlighter textarea { 15 | line-height: 1.25em !important; 16 | } 17 | -------------------------------------------------------------------------------- /assets/stylesheets/kindle.css: -------------------------------------------------------------------------------- 1 | p { text-indent: 0; } 2 | 3 | p, H1, H2, H3, H4, H5, H6, H7, H8, table { margin-top: 1em;} 4 | 5 | .pagebreak { page-break-before: always; } 6 | #toc H3 { 7 | text-indent: 1em; 8 | } 9 | #toc .document { 10 | text-indent: 2em; 11 | } -------------------------------------------------------------------------------- /assets/stylesheets/print.css: -------------------------------------------------------------------------------- 1 | /* Guides.rubyonrails.org */ 2 | /* Print.css */ 3 | /* Created January 30, 2009 */ 4 | /* Modified January 31, 2009 5 | --------------------------------------- */ 6 | 7 | body, .wrapper, .note, .info, code, #topNav, .L, .R, #frame, #container, #header, #navigation, #footer, #feature, #mainCol, #subCol, #extraCol, .content {position: static; text-align: left; text-indent: 0; background: White; color: Black; border-color: Black; width: auto; height: auto; display: block; float: none; min-height: 0; margin: 0; padding: 0;} 8 | 9 | body { 10 | background: #FFF; 11 | font-size: 10pt !important; 12 | font-family: "Times New Roman", Times, serif, sans-serif; 13 | line-height: 1.5; 14 | color: #000; 15 | padding: 0 3%; 16 | } 17 | 18 | .hide, .nav { 19 | display: none !important; 20 | } 21 | 22 | a:link, a:visited { 23 | background: transparent; 24 | font-weight: bold; 25 | text-decoration: underline; 26 | } 27 | 28 | hr { 29 | background:#ccc; 30 | color:#ccc; 31 | width:100%; 32 | height:2px; 33 | margin:2em 0; 34 | padding:0; 35 | border:none; 36 | } 37 | 38 | h1,h2,h3,h4,h5,h6 { font-family: "Helvetica Neue", Arial, "Lucida Grande", sans-serif; } 39 | code { font:.9em "Courier New", Monaco, Courier, monospace; } 40 | 41 | img { float:left; margin:1.5em 1.5em 1.5em 0; } 42 | a img { border:none; } 43 | 44 | blockquote { 45 | margin:1.5em; 46 | padding:1em; 47 | font-style:italic; 48 | font-size:.9em; 49 | } 50 | 51 | .small { font-size: .9em; } 52 | .large { font-size: 1.1em; } 53 | -------------------------------------------------------------------------------- /assets/stylesheets/reset.css: -------------------------------------------------------------------------------- 1 | /* Guides.rubyonrails.org */ 2 | /* Reset.css */ 3 | /* Created January 30, 2009 4 | --------------------------------------- */ 5 | 6 | html, body, div, span, applet, object, iframe, 7 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 8 | a, abbr, acronym, address, big, cite, code, 9 | del, dfn, em, font, img, ins, kbd, q, s, samp, 10 | small, strike, strong, sub, sup, tt, var, 11 | b, u, i, center, 12 | dl, dt, dd, ol, ul, li, 13 | fieldset, form, label, legend, 14 | table, caption, tbody, tfoot, thead, tr, th, td { 15 | margin: 0; 16 | padding: 0; 17 | border: 0; 18 | outline: 0; 19 | font-size: 100%; 20 | background: transparent; 21 | } 22 | 23 | body {line-height: 1; color: black; background: white;} 24 | a img {border:none;} 25 | ins {text-decoration: none;} 26 | del {text-decoration: line-through;} 27 | 28 | :focus { 29 | -moz-outline:0; 30 | outline:0; 31 | outline-offset:0; 32 | } 33 | 34 | /* tables still need 'cellspacing="0"' in the markup */ 35 | table {border-collapse: collapse; border-spacing: 0;} 36 | caption, th, td {text-align: left; font-weight: normal;} 37 | 38 | blockquote, q {quotes: none;} 39 | blockquote:before, blockquote:after, 40 | q:before, q:after { 41 | content: ''; 42 | content: none; 43 | } 44 | -------------------------------------------------------------------------------- /assets/stylesheets/style.css: -------------------------------------------------------------------------------- 1 | /* Guides.rubyonrails.org */ 2 | /* Style.css */ 3 | /* Created January 30, 2009 4 | --------------------------------------- */ 5 | 6 | /* 7 | --------------------------------------- 8 | Import advanced style sheet 9 | --------------------------------------- 10 | */ 11 | 12 | @import url("reset.css"); 13 | @import url("main.css"); 14 | -------------------------------------------------------------------------------- /assets/stylesheets/syntaxhighlighter/shThemeDefault.css: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | .syntaxhighlighter { 18 | background-color: white !important; 19 | } 20 | .syntaxhighlighter .line.alt1 { 21 | background-color: white !important; 22 | } 23 | .syntaxhighlighter .line.alt2 { 24 | background-color: white !important; 25 | } 26 | .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { 27 | background-color: #e0e0e0 !important; 28 | } 29 | .syntaxhighlighter .line.highlighted.number { 30 | color: black !important; 31 | } 32 | .syntaxhighlighter table caption { 33 | color: black !important; 34 | } 35 | .syntaxhighlighter .gutter { 36 | color: #afafaf !important; 37 | } 38 | .syntaxhighlighter .gutter .line { 39 | border-right: 3px solid #6ce26c !important; 40 | } 41 | .syntaxhighlighter .gutter .line.highlighted { 42 | background-color: #6ce26c !important; 43 | color: white !important; 44 | } 45 | .syntaxhighlighter.printing .line .content { 46 | border: none !important; 47 | } 48 | .syntaxhighlighter.collapsed { 49 | overflow: visible !important; 50 | } 51 | .syntaxhighlighter.collapsed .toolbar { 52 | color: blue !important; 53 | background: white !important; 54 | border: 1px solid #6ce26c !important; 55 | } 56 | .syntaxhighlighter.collapsed .toolbar a { 57 | color: blue !important; 58 | } 59 | .syntaxhighlighter.collapsed .toolbar a:hover { 60 | color: red !important; 61 | } 62 | .syntaxhighlighter .toolbar { 63 | color: white !important; 64 | background: #6ce26c !important; 65 | border: none !important; 66 | } 67 | .syntaxhighlighter .toolbar a { 68 | color: white !important; 69 | } 70 | .syntaxhighlighter .toolbar a:hover { 71 | color: black !important; 72 | } 73 | .syntaxhighlighter .plain, .syntaxhighlighter .plain a { 74 | color: black !important; 75 | } 76 | .syntaxhighlighter .comments, .syntaxhighlighter .comments a { 77 | color: #008200 !important; 78 | } 79 | .syntaxhighlighter .string, .syntaxhighlighter .string a { 80 | color: blue !important; 81 | } 82 | .syntaxhighlighter .keyword { 83 | color: #006699 !important; 84 | } 85 | .syntaxhighlighter .preprocessor { 86 | color: gray !important; 87 | } 88 | .syntaxhighlighter .variable { 89 | color: #aa7700 !important; 90 | } 91 | .syntaxhighlighter .value { 92 | color: #009900 !important; 93 | } 94 | .syntaxhighlighter .functions { 95 | color: #ff1493 !important; 96 | } 97 | .syntaxhighlighter .constants { 98 | color: #0066cc !important; 99 | } 100 | .syntaxhighlighter .script { 101 | font-weight: bold !important; 102 | color: #006699 !important; 103 | background-color: none !important; 104 | } 105 | .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { 106 | color: gray !important; 107 | } 108 | .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { 109 | color: #ff1493 !important; 110 | } 111 | .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { 112 | color: red !important; 113 | } 114 | 115 | .syntaxhighlighter .keyword { 116 | font-weight: bold !important; 117 | } 118 | -------------------------------------------------------------------------------- /assets/stylesheets/syntaxhighlighter/shThemeDjango.css: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | .syntaxhighlighter { 18 | background-color: #0a2b1d !important; 19 | } 20 | .syntaxhighlighter .line.alt1 { 21 | background-color: #0a2b1d !important; 22 | } 23 | .syntaxhighlighter .line.alt2 { 24 | background-color: #0a2b1d !important; 25 | } 26 | .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { 27 | background-color: #233729 !important; 28 | } 29 | .syntaxhighlighter .line.highlighted.number { 30 | color: white !important; 31 | } 32 | .syntaxhighlighter table caption { 33 | color: #f8f8f8 !important; 34 | } 35 | .syntaxhighlighter .gutter { 36 | color: #497958 !important; 37 | } 38 | .syntaxhighlighter .gutter .line { 39 | border-right: 3px solid #41a83e !important; 40 | } 41 | .syntaxhighlighter .gutter .line.highlighted { 42 | background-color: #41a83e !important; 43 | color: #0a2b1d !important; 44 | } 45 | .syntaxhighlighter.printing .line .content { 46 | border: none !important; 47 | } 48 | .syntaxhighlighter.collapsed { 49 | overflow: visible !important; 50 | } 51 | .syntaxhighlighter.collapsed .toolbar { 52 | color: #96dd3b !important; 53 | background: black !important; 54 | border: 1px solid #41a83e !important; 55 | } 56 | .syntaxhighlighter.collapsed .toolbar a { 57 | color: #96dd3b !important; 58 | } 59 | .syntaxhighlighter.collapsed .toolbar a:hover { 60 | color: white !important; 61 | } 62 | .syntaxhighlighter .toolbar { 63 | color: white !important; 64 | background: #41a83e !important; 65 | border: none !important; 66 | } 67 | .syntaxhighlighter .toolbar a { 68 | color: white !important; 69 | } 70 | .syntaxhighlighter .toolbar a:hover { 71 | color: #ffe862 !important; 72 | } 73 | .syntaxhighlighter .plain, .syntaxhighlighter .plain a { 74 | color: #f8f8f8 !important; 75 | } 76 | .syntaxhighlighter .comments, .syntaxhighlighter .comments a { 77 | color: #336442 !important; 78 | } 79 | .syntaxhighlighter .string, .syntaxhighlighter .string a { 80 | color: #9df39f !important; 81 | } 82 | .syntaxhighlighter .keyword { 83 | color: #96dd3b !important; 84 | } 85 | .syntaxhighlighter .preprocessor { 86 | color: #91bb9e !important; 87 | } 88 | .syntaxhighlighter .variable { 89 | color: #ffaa3e !important; 90 | } 91 | .syntaxhighlighter .value { 92 | color: #f7e741 !important; 93 | } 94 | .syntaxhighlighter .functions { 95 | color: #ffaa3e !important; 96 | } 97 | .syntaxhighlighter .constants { 98 | color: #e0e8ff !important; 99 | } 100 | .syntaxhighlighter .script { 101 | font-weight: bold !important; 102 | color: #96dd3b !important; 103 | background-color: none !important; 104 | } 105 | .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { 106 | color: #eb939a !important; 107 | } 108 | .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { 109 | color: #91bb9e !important; 110 | } 111 | .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { 112 | color: #edef7d !important; 113 | } 114 | 115 | .syntaxhighlighter .comments { 116 | font-style: italic !important; 117 | } 118 | .syntaxhighlighter .keyword { 119 | font-weight: bold !important; 120 | } 121 | -------------------------------------------------------------------------------- /assets/stylesheets/syntaxhighlighter/shThemeEclipse.css: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | .syntaxhighlighter { 18 | background-color: white !important; 19 | } 20 | .syntaxhighlighter .line.alt1 { 21 | background-color: white !important; 22 | } 23 | .syntaxhighlighter .line.alt2 { 24 | background-color: white !important; 25 | } 26 | .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { 27 | background-color: #c3defe !important; 28 | } 29 | .syntaxhighlighter .line.highlighted.number { 30 | color: white !important; 31 | } 32 | .syntaxhighlighter table caption { 33 | color: black !important; 34 | } 35 | .syntaxhighlighter .gutter { 36 | color: #787878 !important; 37 | } 38 | .syntaxhighlighter .gutter .line { 39 | border-right: 3px solid #d4d0c8 !important; 40 | } 41 | .syntaxhighlighter .gutter .line.highlighted { 42 | background-color: #d4d0c8 !important; 43 | color: white !important; 44 | } 45 | .syntaxhighlighter.printing .line .content { 46 | border: none !important; 47 | } 48 | .syntaxhighlighter.collapsed { 49 | overflow: visible !important; 50 | } 51 | .syntaxhighlighter.collapsed .toolbar { 52 | color: #3f5fbf !important; 53 | background: white !important; 54 | border: 1px solid #d4d0c8 !important; 55 | } 56 | .syntaxhighlighter.collapsed .toolbar a { 57 | color: #3f5fbf !important; 58 | } 59 | .syntaxhighlighter.collapsed .toolbar a:hover { 60 | color: #aa7700 !important; 61 | } 62 | .syntaxhighlighter .toolbar { 63 | color: #a0a0a0 !important; 64 | background: #d4d0c8 !important; 65 | border: none !important; 66 | } 67 | .syntaxhighlighter .toolbar a { 68 | color: #a0a0a0 !important; 69 | } 70 | .syntaxhighlighter .toolbar a:hover { 71 | color: red !important; 72 | } 73 | .syntaxhighlighter .plain, .syntaxhighlighter .plain a { 74 | color: black !important; 75 | } 76 | .syntaxhighlighter .comments, .syntaxhighlighter .comments a { 77 | color: #3f5fbf !important; 78 | } 79 | .syntaxhighlighter .string, .syntaxhighlighter .string a { 80 | color: #2a00ff !important; 81 | } 82 | .syntaxhighlighter .keyword { 83 | color: #7f0055 !important; 84 | } 85 | .syntaxhighlighter .preprocessor { 86 | color: #646464 !important; 87 | } 88 | .syntaxhighlighter .variable { 89 | color: #aa7700 !important; 90 | } 91 | .syntaxhighlighter .value { 92 | color: #009900 !important; 93 | } 94 | .syntaxhighlighter .functions { 95 | color: #ff1493 !important; 96 | } 97 | .syntaxhighlighter .constants { 98 | color: #0066cc !important; 99 | } 100 | .syntaxhighlighter .script { 101 | font-weight: bold !important; 102 | color: #7f0055 !important; 103 | background-color: none !important; 104 | } 105 | .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { 106 | color: gray !important; 107 | } 108 | .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { 109 | color: #ff1493 !important; 110 | } 111 | .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { 112 | color: red !important; 113 | } 114 | 115 | .syntaxhighlighter .keyword { 116 | font-weight: bold !important; 117 | } 118 | .syntaxhighlighter .xml .keyword { 119 | color: #3f7f7f !important; 120 | font-weight: normal !important; 121 | } 122 | .syntaxhighlighter .xml .color1, .syntaxhighlighter .xml .color1 a { 123 | color: #7f007f !important; 124 | } 125 | .syntaxhighlighter .xml .string { 126 | font-style: italic !important; 127 | color: #2a00ff !important; 128 | } 129 | -------------------------------------------------------------------------------- /assets/stylesheets/syntaxhighlighter/shThemeEmacs.css: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | .syntaxhighlighter { 18 | background-color: black !important; 19 | } 20 | .syntaxhighlighter .line.alt1 { 21 | background-color: black !important; 22 | } 23 | .syntaxhighlighter .line.alt2 { 24 | background-color: black !important; 25 | } 26 | .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { 27 | background-color: #2a3133 !important; 28 | } 29 | .syntaxhighlighter .line.highlighted.number { 30 | color: white !important; 31 | } 32 | .syntaxhighlighter table caption { 33 | color: #d3d3d3 !important; 34 | } 35 | .syntaxhighlighter .gutter { 36 | color: #d3d3d3 !important; 37 | } 38 | .syntaxhighlighter .gutter .line { 39 | border-right: 3px solid #990000 !important; 40 | } 41 | .syntaxhighlighter .gutter .line.highlighted { 42 | background-color: #990000 !important; 43 | color: black !important; 44 | } 45 | .syntaxhighlighter.printing .line .content { 46 | border: none !important; 47 | } 48 | .syntaxhighlighter.collapsed { 49 | overflow: visible !important; 50 | } 51 | .syntaxhighlighter.collapsed .toolbar { 52 | color: #ebdb8d !important; 53 | background: black !important; 54 | border: 1px solid #990000 !important; 55 | } 56 | .syntaxhighlighter.collapsed .toolbar a { 57 | color: #ebdb8d !important; 58 | } 59 | .syntaxhighlighter.collapsed .toolbar a:hover { 60 | color: #ff7d27 !important; 61 | } 62 | .syntaxhighlighter .toolbar { 63 | color: white !important; 64 | background: #990000 !important; 65 | border: none !important; 66 | } 67 | .syntaxhighlighter .toolbar a { 68 | color: white !important; 69 | } 70 | .syntaxhighlighter .toolbar a:hover { 71 | color: #9ccff4 !important; 72 | } 73 | .syntaxhighlighter .plain, .syntaxhighlighter .plain a { 74 | color: #d3d3d3 !important; 75 | } 76 | .syntaxhighlighter .comments, .syntaxhighlighter .comments a { 77 | color: #ff7d27 !important; 78 | } 79 | .syntaxhighlighter .string, .syntaxhighlighter .string a { 80 | color: #ff9e7b !important; 81 | } 82 | .syntaxhighlighter .keyword { 83 | color: aqua !important; 84 | } 85 | .syntaxhighlighter .preprocessor { 86 | color: #aec4de !important; 87 | } 88 | .syntaxhighlighter .variable { 89 | color: #ffaa3e !important; 90 | } 91 | .syntaxhighlighter .value { 92 | color: #009900 !important; 93 | } 94 | .syntaxhighlighter .functions { 95 | color: #81cef9 !important; 96 | } 97 | .syntaxhighlighter .constants { 98 | color: #ff9e7b !important; 99 | } 100 | .syntaxhighlighter .script { 101 | font-weight: bold !important; 102 | color: aqua !important; 103 | background-color: none !important; 104 | } 105 | .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { 106 | color: #ebdb8d !important; 107 | } 108 | .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { 109 | color: #ff7d27 !important; 110 | } 111 | .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { 112 | color: #aec4de !important; 113 | } 114 | -------------------------------------------------------------------------------- /assets/stylesheets/syntaxhighlighter/shThemeFadeToGrey.css: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | .syntaxhighlighter { 18 | background-color: #121212 !important; 19 | } 20 | .syntaxhighlighter .line.alt1 { 21 | background-color: #121212 !important; 22 | } 23 | .syntaxhighlighter .line.alt2 { 24 | background-color: #121212 !important; 25 | } 26 | .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { 27 | background-color: #2c2c29 !important; 28 | } 29 | .syntaxhighlighter .line.highlighted.number { 30 | color: white !important; 31 | } 32 | .syntaxhighlighter table caption { 33 | color: white !important; 34 | } 35 | .syntaxhighlighter .gutter { 36 | color: #afafaf !important; 37 | } 38 | .syntaxhighlighter .gutter .line { 39 | border-right: 3px solid #3185b9 !important; 40 | } 41 | .syntaxhighlighter .gutter .line.highlighted { 42 | background-color: #3185b9 !important; 43 | color: #121212 !important; 44 | } 45 | .syntaxhighlighter.printing .line .content { 46 | border: none !important; 47 | } 48 | .syntaxhighlighter.collapsed { 49 | overflow: visible !important; 50 | } 51 | .syntaxhighlighter.collapsed .toolbar { 52 | color: #3185b9 !important; 53 | background: black !important; 54 | border: 1px solid #3185b9 !important; 55 | } 56 | .syntaxhighlighter.collapsed .toolbar a { 57 | color: #3185b9 !important; 58 | } 59 | .syntaxhighlighter.collapsed .toolbar a:hover { 60 | color: #d01d33 !important; 61 | } 62 | .syntaxhighlighter .toolbar { 63 | color: white !important; 64 | background: #3185b9 !important; 65 | border: none !important; 66 | } 67 | .syntaxhighlighter .toolbar a { 68 | color: white !important; 69 | } 70 | .syntaxhighlighter .toolbar a:hover { 71 | color: #96daff !important; 72 | } 73 | .syntaxhighlighter .plain, .syntaxhighlighter .plain a { 74 | color: white !important; 75 | } 76 | .syntaxhighlighter .comments, .syntaxhighlighter .comments a { 77 | color: #696854 !important; 78 | } 79 | .syntaxhighlighter .string, .syntaxhighlighter .string a { 80 | color: #e3e658 !important; 81 | } 82 | .syntaxhighlighter .keyword { 83 | color: #d01d33 !important; 84 | } 85 | .syntaxhighlighter .preprocessor { 86 | color: #435a5f !important; 87 | } 88 | .syntaxhighlighter .variable { 89 | color: #898989 !important; 90 | } 91 | .syntaxhighlighter .value { 92 | color: #009900 !important; 93 | } 94 | .syntaxhighlighter .functions { 95 | color: #aaaaaa !important; 96 | } 97 | .syntaxhighlighter .constants { 98 | color: #96daff !important; 99 | } 100 | .syntaxhighlighter .script { 101 | font-weight: bold !important; 102 | color: #d01d33 !important; 103 | background-color: none !important; 104 | } 105 | .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { 106 | color: #ffc074 !important; 107 | } 108 | .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { 109 | color: #4a8cdb !important; 110 | } 111 | .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { 112 | color: #96daff !important; 113 | } 114 | 115 | .syntaxhighlighter .functions { 116 | font-weight: bold !important; 117 | } 118 | -------------------------------------------------------------------------------- /assets/stylesheets/syntaxhighlighter/shThemeMDUltra.css: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | .syntaxhighlighter { 18 | background-color: #222222 !important; 19 | } 20 | .syntaxhighlighter .line.alt1 { 21 | background-color: #222222 !important; 22 | } 23 | .syntaxhighlighter .line.alt2 { 24 | background-color: #222222 !important; 25 | } 26 | .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { 27 | background-color: #253e5a !important; 28 | } 29 | .syntaxhighlighter .line.highlighted.number { 30 | color: white !important; 31 | } 32 | .syntaxhighlighter table caption { 33 | color: lime !important; 34 | } 35 | .syntaxhighlighter .gutter { 36 | color: #38566f !important; 37 | } 38 | .syntaxhighlighter .gutter .line { 39 | border-right: 3px solid #435a5f !important; 40 | } 41 | .syntaxhighlighter .gutter .line.highlighted { 42 | background-color: #435a5f !important; 43 | color: #222222 !important; 44 | } 45 | .syntaxhighlighter.printing .line .content { 46 | border: none !important; 47 | } 48 | .syntaxhighlighter.collapsed { 49 | overflow: visible !important; 50 | } 51 | .syntaxhighlighter.collapsed .toolbar { 52 | color: #428bdd !important; 53 | background: black !important; 54 | border: 1px solid #435a5f !important; 55 | } 56 | .syntaxhighlighter.collapsed .toolbar a { 57 | color: #428bdd !important; 58 | } 59 | .syntaxhighlighter.collapsed .toolbar a:hover { 60 | color: lime !important; 61 | } 62 | .syntaxhighlighter .toolbar { 63 | color: #aaaaff !important; 64 | background: #435a5f !important; 65 | border: none !important; 66 | } 67 | .syntaxhighlighter .toolbar a { 68 | color: #aaaaff !important; 69 | } 70 | .syntaxhighlighter .toolbar a:hover { 71 | color: #9ccff4 !important; 72 | } 73 | .syntaxhighlighter .plain, .syntaxhighlighter .plain a { 74 | color: lime !important; 75 | } 76 | .syntaxhighlighter .comments, .syntaxhighlighter .comments a { 77 | color: #428bdd !important; 78 | } 79 | .syntaxhighlighter .string, .syntaxhighlighter .string a { 80 | color: lime !important; 81 | } 82 | .syntaxhighlighter .keyword { 83 | color: #aaaaff !important; 84 | } 85 | .syntaxhighlighter .preprocessor { 86 | color: #8aa6c1 !important; 87 | } 88 | .syntaxhighlighter .variable { 89 | color: aqua !important; 90 | } 91 | .syntaxhighlighter .value { 92 | color: #f7e741 !important; 93 | } 94 | .syntaxhighlighter .functions { 95 | color: #ff8000 !important; 96 | } 97 | .syntaxhighlighter .constants { 98 | color: yellow !important; 99 | } 100 | .syntaxhighlighter .script { 101 | font-weight: bold !important; 102 | color: #aaaaff !important; 103 | background-color: none !important; 104 | } 105 | .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { 106 | color: red !important; 107 | } 108 | .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { 109 | color: yellow !important; 110 | } 111 | .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { 112 | color: #ffaa3e !important; 113 | } 114 | -------------------------------------------------------------------------------- /assets/stylesheets/syntaxhighlighter/shThemeMidnight.css: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | .syntaxhighlighter { 18 | background-color: #0f192a !important; 19 | } 20 | .syntaxhighlighter .line.alt1 { 21 | background-color: #0f192a !important; 22 | } 23 | .syntaxhighlighter .line.alt2 { 24 | background-color: #0f192a !important; 25 | } 26 | .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { 27 | background-color: #253e5a !important; 28 | } 29 | .syntaxhighlighter .line.highlighted.number { 30 | color: #38566f !important; 31 | } 32 | .syntaxhighlighter table caption { 33 | color: #d1edff !important; 34 | } 35 | .syntaxhighlighter .gutter { 36 | color: #afafaf !important; 37 | } 38 | .syntaxhighlighter .gutter .line { 39 | border-right: 3px solid #435a5f !important; 40 | } 41 | .syntaxhighlighter .gutter .line.highlighted { 42 | background-color: #435a5f !important; 43 | color: #0f192a !important; 44 | } 45 | .syntaxhighlighter.printing .line .content { 46 | border: none !important; 47 | } 48 | .syntaxhighlighter.collapsed { 49 | overflow: visible !important; 50 | } 51 | .syntaxhighlighter.collapsed .toolbar { 52 | color: #428bdd !important; 53 | background: black !important; 54 | border: 1px solid #435a5f !important; 55 | } 56 | .syntaxhighlighter.collapsed .toolbar a { 57 | color: #428bdd !important; 58 | } 59 | .syntaxhighlighter.collapsed .toolbar a:hover { 60 | color: #1dc116 !important; 61 | } 62 | .syntaxhighlighter .toolbar { 63 | color: #d1edff !important; 64 | background: #435a5f !important; 65 | border: none !important; 66 | } 67 | .syntaxhighlighter .toolbar a { 68 | color: #d1edff !important; 69 | } 70 | .syntaxhighlighter .toolbar a:hover { 71 | color: #8aa6c1 !important; 72 | } 73 | .syntaxhighlighter .plain, .syntaxhighlighter .plain a { 74 | color: #d1edff !important; 75 | } 76 | .syntaxhighlighter .comments, .syntaxhighlighter .comments a { 77 | color: #428bdd !important; 78 | } 79 | .syntaxhighlighter .string, .syntaxhighlighter .string a { 80 | color: #1dc116 !important; 81 | } 82 | .syntaxhighlighter .keyword { 83 | color: #b43d3d !important; 84 | } 85 | .syntaxhighlighter .preprocessor { 86 | color: #8aa6c1 !important; 87 | } 88 | .syntaxhighlighter .variable { 89 | color: #ffaa3e !important; 90 | } 91 | .syntaxhighlighter .value { 92 | color: #f7e741 !important; 93 | } 94 | .syntaxhighlighter .functions { 95 | color: #ffaa3e !important; 96 | } 97 | .syntaxhighlighter .constants { 98 | color: #e0e8ff !important; 99 | } 100 | .syntaxhighlighter .script { 101 | font-weight: bold !important; 102 | color: #b43d3d !important; 103 | background-color: none !important; 104 | } 105 | .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { 106 | color: #f8bb00 !important; 107 | } 108 | .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { 109 | color: white !important; 110 | } 111 | .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { 112 | color: #ffaa3e !important; 113 | } 114 | -------------------------------------------------------------------------------- /assets/stylesheets/syntaxhighlighter/shThemeRDark.css: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | .syntaxhighlighter { 18 | background-color: #1b2426 !important; 19 | } 20 | .syntaxhighlighter .line.alt1 { 21 | background-color: #1b2426 !important; 22 | } 23 | .syntaxhighlighter .line.alt2 { 24 | background-color: #1b2426 !important; 25 | } 26 | .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { 27 | background-color: #323e41 !important; 28 | } 29 | .syntaxhighlighter .line.highlighted.number { 30 | color: #b9bdb6 !important; 31 | } 32 | .syntaxhighlighter table caption { 33 | color: #b9bdb6 !important; 34 | } 35 | .syntaxhighlighter .gutter { 36 | color: #afafaf !important; 37 | } 38 | .syntaxhighlighter .gutter .line { 39 | border-right: 3px solid #435a5f !important; 40 | } 41 | .syntaxhighlighter .gutter .line.highlighted { 42 | background-color: #435a5f !important; 43 | color: #1b2426 !important; 44 | } 45 | .syntaxhighlighter.printing .line .content { 46 | border: none !important; 47 | } 48 | .syntaxhighlighter.collapsed { 49 | overflow: visible !important; 50 | } 51 | .syntaxhighlighter.collapsed .toolbar { 52 | color: #5ba1cf !important; 53 | background: black !important; 54 | border: 1px solid #435a5f !important; 55 | } 56 | .syntaxhighlighter.collapsed .toolbar a { 57 | color: #5ba1cf !important; 58 | } 59 | .syntaxhighlighter.collapsed .toolbar a:hover { 60 | color: #5ce638 !important; 61 | } 62 | .syntaxhighlighter .toolbar { 63 | color: white !important; 64 | background: #435a5f !important; 65 | border: none !important; 66 | } 67 | .syntaxhighlighter .toolbar a { 68 | color: white !important; 69 | } 70 | .syntaxhighlighter .toolbar a:hover { 71 | color: #e0e8ff !important; 72 | } 73 | .syntaxhighlighter .plain, .syntaxhighlighter .plain a { 74 | color: #b9bdb6 !important; 75 | } 76 | .syntaxhighlighter .comments, .syntaxhighlighter .comments a { 77 | color: #878a85 !important; 78 | } 79 | .syntaxhighlighter .string, .syntaxhighlighter .string a { 80 | color: #5ce638 !important; 81 | } 82 | .syntaxhighlighter .keyword { 83 | color: #5ba1cf !important; 84 | } 85 | .syntaxhighlighter .preprocessor { 86 | color: #435a5f !important; 87 | } 88 | .syntaxhighlighter .variable { 89 | color: #ffaa3e !important; 90 | } 91 | .syntaxhighlighter .value { 92 | color: #009900 !important; 93 | } 94 | .syntaxhighlighter .functions { 95 | color: #ffaa3e !important; 96 | } 97 | .syntaxhighlighter .constants { 98 | color: #e0e8ff !important; 99 | } 100 | .syntaxhighlighter .script { 101 | font-weight: bold !important; 102 | color: #5ba1cf !important; 103 | background-color: none !important; 104 | } 105 | .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { 106 | color: #e0e8ff !important; 107 | } 108 | .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { 109 | color: white !important; 110 | } 111 | .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { 112 | color: #ffaa3e !important; 113 | } 114 | -------------------------------------------------------------------------------- /assets/stylesheets/syntaxhighlighter/shThemeRailsGuides.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Theme by fxn, took shThemeEclipse.css as starting point. 3 | */ 4 | .syntaxhighlighter { 5 | background-color: #eee !important; 6 | font-family: "Anonymous Pro", "Inconsolata", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace !important; 7 | overflow-y: hidden !important; 8 | overflow-x: auto !important; 9 | } 10 | .syntaxhighlighter .line.alt1 { 11 | background-color: #eee !important; 12 | } 13 | .syntaxhighlighter .line.alt2 { 14 | background-color: #eee !important; 15 | } 16 | .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { 17 | background-color: #c3defe !important; 18 | } 19 | .syntaxhighlighter .line.highlighted.number { 20 | color: #eee !important; 21 | } 22 | .syntaxhighlighter table caption { 23 | color: #222 !important; 24 | } 25 | .syntaxhighlighter .gutter { 26 | color: #787878 !important; 27 | } 28 | .syntaxhighlighter .gutter .line { 29 | border-right: 3px solid #d4d0c8 !important; 30 | } 31 | .syntaxhighlighter .gutter .line.highlighted { 32 | background-color: #d4d0c8 !important; 33 | color: #eee !important; 34 | } 35 | .syntaxhighlighter.printing .line .content { 36 | border: none !important; 37 | } 38 | .syntaxhighlighter.collapsed { 39 | overflow: visible !important; 40 | } 41 | .syntaxhighlighter.collapsed .toolbar { 42 | color: #3f5fbf !important; 43 | background: #eee !important; 44 | border: 1px solid #d4d0c8 !important; 45 | } 46 | .syntaxhighlighter.collapsed .toolbar a { 47 | color: #3f5fbf !important; 48 | } 49 | .syntaxhighlighter.collapsed .toolbar a:hover { 50 | color: #aa7700 !important; 51 | } 52 | .syntaxhighlighter .toolbar { 53 | color: #a0a0a0 !important; 54 | background: #d4d0c8 !important; 55 | border: none !important; 56 | } 57 | .syntaxhighlighter .toolbar a { 58 | color: #a0a0a0 !important; 59 | } 60 | .syntaxhighlighter .toolbar a:hover { 61 | color: red !important; 62 | } 63 | .syntaxhighlighter .plain, .syntaxhighlighter .plain a { 64 | color: #222 !important; 65 | } 66 | .syntaxhighlighter .comments, .syntaxhighlighter .comments a { 67 | color: #708090 !important; 68 | } 69 | .syntaxhighlighter .string, .syntaxhighlighter .string a { 70 | font-style: italic !important; 71 | color: #6588A8 !important; 72 | } 73 | .syntaxhighlighter .keyword { 74 | color: #64434d !important; 75 | } 76 | .syntaxhighlighter .preprocessor { 77 | color: #646464 !important; 78 | } 79 | .syntaxhighlighter .variable { 80 | color: #222 !important; 81 | } 82 | .syntaxhighlighter .value { 83 | color: #009900 !important; 84 | } 85 | .syntaxhighlighter .functions { 86 | color: #ff1493 !important; 87 | } 88 | .syntaxhighlighter .constants { 89 | color: #0066cc !important; 90 | } 91 | .syntaxhighlighter .script { 92 | color: #222 !important; 93 | background-color: none !important; 94 | } 95 | .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { 96 | color: gray !important; 97 | } 98 | .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { 99 | color: #222 !important; 100 | font-weight: bold !important; 101 | } 102 | .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { 103 | color: red !important; 104 | } 105 | 106 | .syntaxhighlighter .xml .keyword { 107 | color: #64434d !important; 108 | font-weight: normal !important; 109 | } 110 | .syntaxhighlighter .xml .color1, .syntaxhighlighter .xml .color1 a { 111 | color: #7f007f !important; 112 | } 113 | .syntaxhighlighter .xml .string { 114 | font-style: italic !important; 115 | color: #6588A8 !important; 116 | } 117 | -------------------------------------------------------------------------------- /config/deploy.rb: -------------------------------------------------------------------------------- 1 | set :application, "Rails Guides" 2 | set :domain, "www.railschina.org" 3 | set :use_sudo, false 4 | set :user, "ruby" 5 | set :repository, "./output" 6 | set :scm, :none 7 | 8 | 9 | role :web, domain 10 | role :app, domain 11 | role :db, domain, :primary => true 12 | 13 | set :deploy_to, "/home/#{user}/www/rails-guides" 14 | set :deploy_via, :copy 15 | 16 | 17 | namespace :local do 18 | task :generate_guides do 19 | print "generate the lastest guides" 20 | system "rake generate_guides_CN RAILS_VERSION=3.2.13" 21 | end 22 | end 23 | 24 | namespace :deploy do 25 | task :migrate do 26 | end 27 | task :finalize_update do 28 | end 29 | task :start do 30 | end 31 | task :stop do 32 | end 33 | task :restart do 34 | end 35 | end 36 | 37 | #callbacks 38 | #after 'deploy:setup', 'remote:create_symlink' 39 | before 'deploy:setup', 'local:generate_guides' 40 | -------------------------------------------------------------------------------- /rails_guides.rb: -------------------------------------------------------------------------------- 1 | pwd = File.dirname(__FILE__) 2 | $:.unshift pwd 3 | 4 | # This is a predicate useful for the doc:guides task of applications. 5 | def bundler? 6 | # Note that rake sets the cwd to the one that contains the Rakefile 7 | # being executed. 8 | File.exists?('Gemfile') 9 | end 10 | 11 | # Loading Action Pack requires rack and erubis. 12 | require 'rubygems' 13 | 14 | begin 15 | # Guides generation in the Rails repo. 16 | as_lib = File.join(pwd, "../activesupport/lib") 17 | ap_lib = File.join(pwd, "../actionpack/lib") 18 | 19 | $:.unshift as_lib if File.directory?(as_lib) 20 | $:.unshift ap_lib if File.directory?(ap_lib) 21 | rescue LoadError 22 | # Guides generation from gems. 23 | gem "actionpack", '>= 3.0' 24 | end 25 | 26 | begin 27 | require 'redcloth' 28 | require 'redcarpet' 29 | rescue Gem::LoadError 30 | # This can happen if doc:guides is executed in an application. 31 | $stderr.puts('Generating guides requires RedCloth & BlueCloth') 32 | $stderr.puts(< 4.2' 36 | gem 'redcarpet', '~> 2.0' 37 | 38 | to the Gemfile, run 39 | 40 | bundle install 41 | 42 | and try again. 43 | ERROR 44 | 45 | exit 1 46 | end 47 | 48 | require "rails_guides/text_process" 49 | RedCloth.send(:include, RailsGuides::TextProcess) 50 | 51 | 52 | require "rails_guides/generator" 53 | require "rails_guides/version" 54 | RailsGuides::Generator.new.generate 55 | -------------------------------------------------------------------------------- /rails_guides/body_converter.rb: -------------------------------------------------------------------------------- 1 | #coding: utf-8 2 | require "rails_guides/indexer" 3 | require "rails_guides/markdown_render" 4 | module RailsGuides 5 | class BodyConverter 6 | attr_accessor :body, :markup, :view, :header_capture,:lb 7 | def initialize(body,view,markup) 8 | @markup = markup 9 | @body = body 10 | @view = view 11 | if @markup == "textile" 12 | @header_capture = /h2\.(.*)/ 13 | @lb = lambda { |text,lite_mode| textile(text,lite_mode) } 14 | else 15 | @header_capture = /##\s*(.*)/ 16 | @lb = lambda { |text,void| markdown(text) } 17 | end 18 | end 19 | 20 | def convert_body 21 | set_header_section 22 | body = set_index 23 | 24 | lb.call(body,false).html_safe 25 | end 26 | 27 | def set_header_section 28 | body.sub!(/(.*?)endprologue\./m, '').strip! 29 | header = $1 30 | header =~ header_capture 31 | page_title = "Ruby on Rails Guides 中文: #{$1.strip}" 32 | header = lb.call(header,false) 33 | view.content_for(:page_title) { page_title.html_safe } 34 | view.content_for(:header_section) { header.html_safe } 35 | end 36 | 37 | def set_index 38 | index = <<-INDEX 39 |
40 |

目录

41 |
    42 | INDEX 43 | 44 | i = Indexer.new(body,@markup) 45 | i.index 46 | i.level_hash.each do |key, value| 47 | link = view.content_tag(:a, :href => key[:id]) { lb.call(key[:title],true).html_safe } 48 | 49 | children = value.keys.map do |k| 50 | view.content_tag(:li, 51 | view.content_tag(:a, :href => k[:id]) { lb.call(k[:title],true).html_safe }) 52 | end 53 | 54 | children_ul = children.empty? ? "" : view.content_tag(:ul, children.join(" ").html_safe) 55 | 56 | index << view.content_tag(:li, link.html_safe + children_ul.html_safe) 57 | end 58 | 59 | index << '
' 60 | index << '
' 61 | 62 | view.content_for(:index_section) { index.html_safe } 63 | 64 | i.result 65 | end 66 | 67 | def textile(body, lite_mode) 68 | t = RedCloth.new(body) 69 | t.hard_breaks = false 70 | t.lite_mode = lite_mode 71 | t.to_html(:notestuff, :plusplus_textile, :code) 72 | end 73 | 74 | def markdown(body) 75 | rndr = MarkdownRender.new :with_toc_data => true 76 | md = Redcarpet::Markdown.new rndr, :table => true 77 | md.render body 78 | end 79 | 80 | 81 | 82 | end 83 | end 84 | -------------------------------------------------------------------------------- /rails_guides/check_anchors.rb: -------------------------------------------------------------------------------- 1 | require 'rails_guides/levenshtein' 2 | 3 | module RailsGuides 4 | module CheckAnchors 5 | def warn_about_broken_links(html) 6 | anchors = extract_anchors(html) 7 | check_fragment_identifiers(html, anchors) 8 | end 9 | 10 | def extract_anchors(html) 11 | # Textile generates headers with IDs computed from titles. 12 | anchors = Set.new 13 | html.scan(/ Levenshtein.distance(fragment_identifier, b) 33 | } 34 | puts "*** BROKEN LINK: ##{fragment_identifier}, perhaps you meant ##{guess}." 35 | end 36 | end 37 | end 38 | 39 | 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /rails_guides/generator.rb: -------------------------------------------------------------------------------- 1 | #coding: utf-8 2 | require 'set' 3 | require 'fileutils' 4 | 5 | require 'active_support/core_ext/string/output_safety' 6 | require 'active_support/core_ext/object/blank' 7 | require 'action_controller' 8 | require 'action_view' 9 | 10 | require 'rails_guides/helpers' 11 | require 'rails_guides/body_converter' 12 | require 'rails_guides/check_anchors' 13 | 14 | module RailsGuides 15 | class Generator 16 | include CheckAnchors 17 | attr_reader :guides_dir, :source_dir, :output_dir, :edge, :all 18 | 19 | GUIDES_RE = /\.(?:textile|erb|markdown|md)$/ 20 | 21 | def initialize(output=nil) 22 | set_flags_from_environment 23 | 24 | if kindle? 25 | check_for_kindlegen 26 | register_kindle_mime_types 27 | end 28 | 29 | initialize_dirs(output) 30 | create_output_dir_if_needed 31 | end 32 | 33 | def set_flags_from_environment 34 | @edge = ENV['EDGE'] == '1' 35 | @all = ENV['ALL'] == '1' 36 | @kindle = ENV['KINDLE'] == '1' 37 | @version = ENV['RAILS_VERSION'] || RailsGuides::Version 38 | @lang = ENV['GUIDES_LANGUAGE'] 39 | end 40 | 41 | def register_kindle_mime_types 42 | Mime::Type.register_alias("application/xml", :opf, %w(opf)) 43 | Mime::Type.register_alias("application/xml", :ncx, %w(ncx)) 44 | end 45 | 46 | def generate 47 | generate_guides 48 | copy_assets 49 | generate_mobi if kindle? 50 | end 51 | 52 | private 53 | 54 | def kindle? 55 | @kindle 56 | end 57 | 58 | def check_for_kindlegen 59 | if `which kindlegen`.blank? 60 | raise "Can't create a kindle version without `kindlegen`." 61 | end 62 | end 63 | 64 | def generate_mobi 65 | opf = "#{output_dir}/rails_guides.opf" 66 | out = "#{output_dir}/kindlegen.out" 67 | 68 | system "kindlegen #{opf} -o #{mobi} > #{out} 2>&1" 69 | puts "Guides compiled as Kindle book to #{mobi}" 70 | puts "(kindlegen log at #{out})." 71 | end 72 | 73 | def mobi 74 | "ruby_on_rails_guides_#@version%s.mobi" % (@lang.present? ? ".#@lang" : '') 75 | end 76 | 77 | def initialize_dirs(output) 78 | @guides_dir = File.join(File.dirname(__FILE__), '..') 79 | @source_dir = "#@guides_dir/source/#@lang" 80 | @output_dir = if output 81 | output 82 | elsif kindle? 83 | "#@guides_dir/output/kindle/#@lang" 84 | else 85 | "#@guides_dir/output/#@lang" 86 | end.sub(%r, '') 87 | end 88 | 89 | def create_output_dir_if_needed 90 | FileUtils.mkdir_p(output_dir) 91 | end 92 | 93 | def generate_guides 94 | guides_to_generate.each do |guide| 95 | output_file = output_file_for(guide) 96 | generate_guide(guide, output_file) if generate?(guide, output_file) 97 | end 98 | end 99 | def guides_to_generate 100 | guides = Dir.entries(source_dir).grep(GUIDES_RE) 101 | 102 | if kindle? 103 | Dir.entries("#{source_dir}/kindle").grep(GUIDES_RE).map do |entry| 104 | guides << "kindle/#{entry}" 105 | end 106 | end 107 | 108 | ENV.key?('ONLY') ? select_only(guides) : guides 109 | end 110 | 111 | def select_only(guides) 112 | prefixes = ENV['ONLY'].split(",").map(&:strip) 113 | guides.select do |guide| 114 | prefixes.any? { |p| guide.start_with?(p) || guide.start_with?("kindle") } 115 | end 116 | end 117 | 118 | def copy_assets 119 | FileUtils.cp_r(Dir.glob("#{guides_dir}/assets/*"), output_dir) 120 | end 121 | 122 | def output_file_for(guide) 123 | if guide =~/\.textile$/ 124 | guide.sub(/\.textile$/, '.html') 125 | elsif guide=~/\.(markdown|md)$/ 126 | guide.sub(/\.markdown|md$/,'.html') 127 | else 128 | guide.sub(/\.erb$/, '') 129 | end 130 | end 131 | 132 | def output_path_for(output_file) 133 | File.join(output_dir, File.basename(output_file)) 134 | end 135 | 136 | def generate?(source_file, output_file) 137 | fin = File.join(source_dir, source_file) 138 | fout = output_path_for(output_file) 139 | all || !File.exist?(fout) || File.mtime(fout) < File.mtime(fin) 140 | end 141 | 142 | def generate_guide(guide, output_file) 143 | output_path = output_path_for(output_file) 144 | puts "Generating #{guide} as #{output_file}" 145 | layout = kindle? ? 'kindle/layout' : 'layout' 146 | 147 | File.open(output_path, 'w') do |f| 148 | view = ActionView::Base.new(source_dir, :edge => @edge, :version => @version, :mobi => "kindle/#{mobi}") 149 | view.extend(Helpers) 150 | 151 | if guide =~ /\.(\w+)\.erb$/ 152 | result = view.render(:layout => layout, :formats => [$1], :file => $`) 153 | else 154 | body = File.read(File.join(source_dir,guide)) 155 | guide =~ /\w+\.(markdown|textile|md)$/ 156 | result = process_body(body,view,layout,$1) 157 | warn_about_broken_links(result) 158 | end 159 | 160 | f.write(result) 161 | end 162 | end 163 | 164 | def process_body(body,view,layout,markup) 165 | body = BodyConverter.new(body,view,markup).convert_body 166 | result = view.render(:layout => layout, :text => body) 167 | end 168 | 169 | 170 | end 171 | end 172 | -------------------------------------------------------------------------------- /rails_guides/helpers.rb: -------------------------------------------------------------------------------- 1 | #coding: utf-8 2 | module RailsGuides 3 | module Helpers 4 | def guide(name, url, options = {}, &block) 5 | link = content_tag(:a, :href => url) { name } 6 | result = content_tag(:dt, link) 7 | result << 8 | if options[:work_in_progress] 9 | content_tag(:dd, "施工中!贡献者: #{options[:contributor] || '匿名'}".html_safe, :class => 'work-in-progress') 10 | elsif !options[:contributor] 11 | content_tag(:dd, :class => 'work-in-progress' ) do 12 | "这篇还没有人翻译,我要翻译本文".html_safe 13 | end 14 | else 15 | content_tag(:dd, :class => 'contributor' ) do 16 | "贡献者:#{options[:contributor] || '匿名'}".html_safe 17 | end 18 | end 19 | result << content_tag(:dd, capture(&block)) 20 | result 21 | end 22 | 23 | def documents_by_section 24 | @documents_by_section ||= YAML.load_file(File.expand_path("../../source/documents_#{ENV['GUIDES_LANGUAGE']}.yaml", __FILE__)) 25 | end 26 | 27 | def documents_flat 28 | documents_by_section.map {|section| section['documents']}.flatten 29 | end 30 | 31 | def finished_documents(documents) 32 | documents.reject { |document| document['work_in_progress'] } 33 | end 34 | 35 | def docs_for_menu(position) 36 | position == 'L' ? documents_by_section.to(3) : documents_by_section.from(4) 37 | end 38 | 39 | def author(name, nick, image = 'credits_pic_blank.gif', &block) 40 | image = "images/#{image}" 41 | 42 | result = content_tag(:img, nil, :src => image, :class => 'left pic', :alt => name, :width => 91, :height => 91) 43 | result << content_tag(:h3, name) 44 | result << content_tag(:p, capture(&block)) 45 | content_tag(:div, result, :class => 'clearfix', :id => nick) 46 | end 47 | 48 | def code(&block) 49 | c = capture(&block) 50 | content_tag(:code, c) 51 | end 52 | end 53 | end 54 | -------------------------------------------------------------------------------- /rails_guides/indexer.rb: -------------------------------------------------------------------------------- 1 | require 'active_support/core_ext/object/blank' 2 | require 'active_support/core_ext/string/inflections' 3 | 4 | module RailsGuides 5 | class Indexer 6 | attr_reader :body, :result,:level_hash,:markup 7 | 8 | def initialize(body,markup) 9 | @body = body 10 | @result = @body.dup 11 | @markup = markup 12 | end 13 | 14 | def index 15 | @level_hash = process(body) 16 | end 17 | 18 | private 19 | def process(string, current_level=3, counters=[1]) 20 | s = StringScanner.new(string) 21 | 22 | level_hash = {} 23 | re = if markup == "textile" 24 | %r{^h(\d)(?:\((#.*?)\))?\s*\.\s*(.*)$} 25 | else 26 | %r{^(###+)\s*(.*)$} 27 | end 28 | while !s.eos? 29 | s.match?(re) 30 | if matched = s.matched 31 | matched =~ re 32 | if markup == "textile" 33 | level, idx, title = $1.to_i, $2, $3.strip 34 | else 35 | level, idx, title = $1.count('#'), nil, $2.strip 36 | end 37 | if level < current_level 38 | # This is needed. Go figure. 39 | return level_hash 40 | elsif level == current_level 41 | index = counters.join("-") 42 | idx ||= '#' + index 43 | if markup == "textile" 44 | @result.sub!(matched, "h#{level}(#{idx}). #{index.gsub('-','.')} #{title}") 45 | end 46 | key = { 47 | :title => title, 48 | :id => idx 49 | } 50 | # Recurse 51 | counters << 1 52 | level_hash[key] = process(s.post_match, current_level + 1, counters) 53 | counters.pop 54 | 55 | # Increment the current level 56 | last = counters.pop 57 | counters << last + 1 58 | end 59 | end 60 | if matched 61 | s.pos += matched.size 62 | else 63 | s.getch 64 | end 65 | end 66 | level_hash 67 | end 68 | end 69 | end 70 | -------------------------------------------------------------------------------- /rails_guides/levenshtein.rb: -------------------------------------------------------------------------------- 1 | module RailsGuides 2 | module Levenshtein 3 | # Based on the pseudocode in http://en.wikipedia.org/wiki/Levenshtein_distance 4 | def self.distance(s1, s2) 5 | s = s1.unpack('U*') 6 | t = s2.unpack('U*') 7 | m = s.length 8 | n = t.length 9 | 10 | # matrix initialization 11 | d = [] 12 | 0.upto(m) { |i| d << [i] } 13 | 0.upto(n) { |j| d[0][j] = j } 14 | 15 | # distance computation 16 | 1.upto(m) do |i| 17 | 1.upto(n) do |j| 18 | cost = s[i] == t[j] ? 0 : 1 19 | d[i][j] = [ 20 | d[i-1][j] + 1, # deletion 21 | d[i][j-1] + 1, # insertion 22 | d[i-1][j-1] + cost, # substitution 23 | ].min 24 | end 25 | end 26 | 27 | # all done 28 | return d[m][n] 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /rails_guides/markdown_render.rb: -------------------------------------------------------------------------------- 1 | class MarkdownRender < Redcarpet::Render::HTML 2 | include RailsGuides::TextProcess 3 | 4 | def initialize(render_option={}) 5 | @index = [0] * 6 6 | super 7 | end 8 | 9 | def header(title, level) 10 | @index[level] += 1 11 | "#{set_index(level).gsub('-','.')} #{title}" 12 | end 13 | 14 | def preprocess(fullbody) 15 | fullbody = plusplus_markdown(fullbody) 16 | fullbody = notestuff(fullbody) 17 | code(fullbody) 18 | end 19 | 20 | def set_index(level) 21 | puts @index[3..level].join("-") 22 | @index[3..level].join("-") 23 | 24 | end 25 | 26 | end 27 | -------------------------------------------------------------------------------- /rails_guides/text_process.rb: -------------------------------------------------------------------------------- 1 | 2 | require 'active_support/core_ext/object/inclusion' 3 | 4 | module RailsGuides 5 | module TextProcess 6 | def notestuff(body) 7 | body.gsub!(/^(TIP|IMPORTANT|CAUTION|WARNING|NOTE|INFO)[.:](.*?)(\n(?=\n)|\Z)/m) do |m| 8 | css_class = case $1 9 | when 'CAUTION', 'IMPORTANT' 10 | 'warning' 11 | when 'TIP' 12 | 'info' 13 | else 14 | $1.downcase 15 | end 16 | %Q(

#{$2.strip}

) 17 | end 18 | body 19 | end 20 | 21 | def plusplus_markdown(body) 22 | body.gsub!(/\+(.*?)\+/) do |m| 23 | matched = $1 24 | matched.gsub!(/[.!()?#`\\_*]/) { |s| "\\" + s[0] } 25 | matched 26 | end 27 | body.gsub!('', '+') #this is real plus 28 | body 29 | end 30 | def plusplus_textile(body) 31 | body.gsub!(/\+(.*?)\+/) do |m| 32 | "#{$1}" 33 | end 34 | body.gsub!('', '+') 35 | end 36 | 37 | def brush_for(code_type) 38 | case code_type 39 | when 'ruby', 'sql', 'plain' 40 | code_type 41 | when 'erb' 42 | 'ruby; html-script: true' 43 | when 'html' 44 | 'xml' # html is understood, but there are .xml rules in the CSS 45 | else 46 | 'plain' 47 | end 48 | end 49 | 50 | def code(body) 51 | body.gsub!(%r{<(yaml|shell|ruby|erb|html|sql|plain)>(.*?)}m) do |m| 52 | < 54 |
55 |
56 | #{ERB::Util.h($2).strip}
57 | 
58 |
59 | 60 | HTML 61 | end 62 | body 63 | end 64 | 65 | end 66 | end 67 | 68 | -------------------------------------------------------------------------------- /rails_guides/version.rb: -------------------------------------------------------------------------------- 1 | RailsGuides::Version = "3.2.8" 2 | -------------------------------------------------------------------------------- /source/CN/_feedback.html.erb: -------------------------------------------------------------------------------- 1 |

关于 Rails Guides 中文

2 |

3 | 你也可以为 Rails Guides 中文做出贡献. 4 |

5 |

6 | 如果你发现了任何翻译上的错误或者不足.请到 <%= link_to 'GitHub 帐号','https://github.com/ruby-china/rails-guides/'%> clone 并且 fork 一份进行更正提交,我们会很快做出回应。 7 | 如果你发现了任何代码上的 bug 或者不足,你可以到 <%= link_to 'docrails', 'https://github.com/lifo/docrails' %> 进行反馈与更正。 8 | 如果你发现了某一篇文章已经过时了并且并没有做出相应的提示,你也同样可以在 <%= link_to '这里','https://github.com/ruby-china/rails-guides/issues' %> 上发起一个请求来提醒我们。 9 |

10 |

如果对 Rails 有什么建议的话去 <%= link_to '这里', 'https://github.com/rails/rails/issues/'%>.

11 |

当然你不管你有什么想要说的都可以发到 <%= link_to 'Ruby China','http://ruby-china.org' %> 讨论或者 <%= mail_to "cool.zhikai@gmail.com","mail我"%>.欢迎加入到 Ruby on Rails 社区!

12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /source/CN/_license.html.erb: -------------------------------------------------------------------------------- 1 |

Rails Guides 中文 licensed under a Creative Commons Attribution-Share Alike 3.0 License

2 |

"Rails", "Ruby on Rails", and the Rails logo are trademarks of David Heinemeier Hansson. All rights reserved.

3 | -------------------------------------------------------------------------------- /source/CN/_welcome.html.erb: -------------------------------------------------------------------------------- 1 |

Ruby on Rails Guides 中文 (<%= @version %>)

2 | 3 | <% if @edge %> 4 |

5 | 这是一个 Edge Guides, 基于 master 分支. 6 |

7 |

8 | 如果你需要的是一个稳定版的文档,你可以参见 这里 9 |

10 | <% else %> 11 |

12 | 这里是一个全新的 Rails Guides for Rails 基于 <%= @version %>. 13 | 这份教程能让你更快更高效用 Rails 进行开发,让你你更深入地了解 Rails 的一切。 14 |

15 | <% end %> 16 |

17 | 你能在这里找到官方的原版 Rails Guides . 18 |

19 |

20 | Ruby on Rails Guides 中文需要热心的你,加入翻译或者建议. 21 |

22 | -------------------------------------------------------------------------------- /source/CN/active_model_basics.textile: -------------------------------------------------------------------------------- 1 | h2. Active Model Basics 2 | 3 | This guide should provide you with all you need to get started using model classes. Active Model allow for Action Pack helpers to interact with non-ActiveRecord models. Active Model also helps building custom ORMs for use outside of the Rails framework. 4 | 5 | endprologue. 6 | 7 | WARNING. This Guide is based on Rails 3.0. Some of the code shown here will not work in earlier versions of Rails. 8 | 9 | h3. Introduction 10 | 11 | Active Model is a library containing various modules used in developing frameworks that need to interact with the Rails Action Pack library. Active Model provides a known set of interfaces for usage in classes. Some of modules are explained below - 12 | 13 | h4. AttributeMethods 14 | 15 | AttributeMethods module can add custom prefixes and suffixes on methods of a class. It is used by defining the prefixes and suffixes, which methods on the object will use them. 16 | 17 | 18 | class Person 19 | include ActiveModel::AttributeMethods 20 | 21 | attribute_method_prefix 'reset_' 22 | attribute_method_suffix '_highest?' 23 | define_attribute_methods ['age'] 24 | 25 | attr_accessor :age 26 | 27 | private 28 | def reset_attribute(attribute) 29 | send("#{attribute}=", 0) 30 | end 31 | 32 | def attribute_highest?(attribute) 33 | send(attribute) > 100 ? true : false 34 | end 35 | 36 | end 37 | 38 | person = Person.new 39 | person.age = 110 40 | person.age_highest? # true 41 | person.reset_age # 0 42 | person.age_highest? # false 43 | 44 | 45 | 46 | h4. Callbacks 47 | 48 | Callbacks gives Active Record style callbacks. This provides the ability to define the callbacks and those will run at appropriate time. After defining a callbacks you can wrap with before, after and around custom methods. 49 | 50 | 51 | class Person 52 | extend ActiveModel::Callbacks 53 | 54 | define_model_callbacks :update 55 | 56 | before_update :reset_me 57 | 58 | def update 59 | run_callbacks(:update) do 60 | # This will call when we are trying to call update on object. 61 | end 62 | end 63 | 64 | def reset_me 65 | # This method will call when you are calling update on object as a before_update callback as defined. 66 | end 67 | end 68 | 69 | 70 | h4. Conversion 71 | 72 | If a class defines persisted? and id methods then you can include Conversion module in that class and you can able to call Rails conversion methods to objects of that class. 73 | 74 | 75 | class Person 76 | include ActiveModel::Conversion 77 | 78 | def persisted? 79 | false 80 | end 81 | 82 | def id 83 | nil 84 | end 85 | end 86 | 87 | person = Person.new 88 | person.to_model == person #=> true 89 | person.to_key #=> nil 90 | person.to_param #=> nil 91 | 92 | 93 | h4. Dirty 94 | 95 | An object becomes dirty when an object is gone through one or more changes to its attributes and not yet saved. This gives the ability to check whether an object has been changed or not. It also has attribute based accessor methods. Lets consider a Person class with attributes first_name and last_name 96 | 97 | 98 | require 'rubygems' 99 | require 'active_model' 100 | 101 | class Person 102 | include ActiveModel::Dirty 103 | define_attribute_methods [:first_name, :last_name] 104 | 105 | def first_name 106 | @first_name 107 | end 108 | 109 | def first_name=(value) 110 | first_name_will_change! 111 | @first_name = value 112 | end 113 | 114 | def last_name 115 | @last_name 116 | end 117 | 118 | def last_name=(value) 119 | last_name_will_change! 120 | @last_name = value 121 | end 122 | 123 | def save 124 | @previously_changed = changes 125 | end 126 | 127 | end 128 | 129 | 130 | h5. Querying object directly for its list of all changed attributes. 131 | 132 | 133 | person = Person.new 134 | person.first_name = "First Name" 135 | 136 | person.first_name #=> "First Name" 137 | person.first_name = "First Name Changed" 138 | 139 | person.changed? #=> true 140 | 141 | #returns an list of fields arry which all has been changed before saved. 142 | person.changed #=> ["first_name"] 143 | 144 | #returns a hash of the fields that have changed with their original values. 145 | person.changed_attributes #=> {"first_name" => "First Name Changed"} 146 | 147 | #returns a hash of changes, with the attribute names as the keys, and the values will be an array of the old and new value for that field. 148 | person.changes #=> {"first_name" => ["First Name","First Name Changed"]} 149 | 150 | 151 | h5. Attribute based accessor methods 152 | 153 | Track whether the particular attribute has been changed or not. 154 | 155 | 156 | #attr_name_changed? 157 | person.first_name #=> "First Name" 158 | 159 | #assign some other value to first_name attribute 160 | person.first_name = "First Name 1" 161 | 162 | person.first_name_changed? #=> true 163 | 164 | 165 | Track what was the previous value of the attribute. 166 | 167 | 168 | #attr_name_was accessor 169 | person.first_name_was #=> "First Name" 170 | 171 | 172 | Track both previous and current value of the changed attribute. Returns an array if changed else returns nil 173 | 174 | 175 | #attr_name_change 176 | person.first_name_change #=> ["First Name", "First Name 1"] 177 | person.last_name_change #=> nil 178 | 179 | 180 | h4. Validations 181 | 182 | Validations module adds the ability to class objects to validate them in Active Record style. 183 | 184 | 185 | class Person 186 | include ActiveModel::Validations 187 | 188 | attr_accessor :name, :email, :token 189 | 190 | validates :name, :presence => true 191 | validates_format_of :email, :with => /^([^\s]+)((?:[-a-z0-9]\.)[a-z]{2,})$/i 192 | validates! :token, :presence => true 193 | 194 | end 195 | 196 | person = Person.new(:token => "2b1f325") 197 | person.valid? #=> false 198 | person.name = 'vishnu' 199 | person.email = 'me' 200 | person.valid? #=> false 201 | person.email = 'me@vishnuatrai.com' 202 | person.valid? #=> true 203 | person.token = nil 204 | person.valid? #=> raises ActiveModel::StrictValidationFailed 205 | 206 | -------------------------------------------------------------------------------- /source/CN/credits.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :page_title do %> 2 | Ruby on Rails Guides 中文: Credits 3 | <% end %> 4 | 5 | <% content_for :header_section do %> 6 |

Credits

7 | 8 |

以下成员对站点做出贡献。

9 |

本站的所有资源出处为<%= link_to 'Rails Guides','http://guides.rubyonrails.org' %>. 感谢所有支持Ruby on Rails的朋友们!

10 | 翻译者 11 | <% end %> 12 | 13 |

Rails Guides Reviewers

14 | 15 | <%= author('Vijay Dev', 'vijaydev', 'vijaydev.jpg') do %> 16 | Vijayakumar, found as Vijay Dev on the web, is a web applications developer and an open source enthusiast who lives in Chennai, India. He started using Rails in 2009 and began actively contributing to Rails documentation in late 2010. He tweets a lot and also blogs. 17 | <% end %> 18 | 19 | <%= author('Xavier Noria', 'fxn', 'fxn.png') do %> 20 | Xavier Noria has been into Ruby on Rails since 2005. He is a Rails core team member and enjoys combining his passion for Rails and his past life as a proofreader of math textbooks. Xavier is currently an independent Ruby on Rails consultant. Oh, he also tweets and can be found everywhere as "fxn". 21 | <% end %> 22 | 23 |

Rails Guides Designers

24 | 25 | <%= author('Jason Zimdars', 'jz') do %> 26 | Jason Zimdars is an experienced creative director and web designer who has lead UI and UX design for numerous websites and web applications. You can see more of his design and writing at Thinkcage.com or follow him on Twitter. 27 | <% end %> 28 | 29 |

Rails Guides Authors

30 | 31 | <%= author('Ryan Bigg', 'radar', 'radar.png') do %> 32 | Ryan Bigg works as a consultant at RubyX and has been working with Rails since 2006. He's co-authoring a book called Rails 3 in Action and he's written many gems which can be seen on his GitHub page and he also tweets prolifically as @ryanbigg. 33 | <% end %> 34 | 35 | <%= author('Frederick Cheung', 'fcheung') do %> 36 | Frederick Cheung is Chief Wizard at Texperts where he has been using Rails since 2006. He is based in Cambridge (UK) and when not consuming fine ales he blogs at spacevatican.org. 37 | <% end %> 38 | 39 | <%= author('Tore Darell', 'toretore') do %> 40 | Tore Darell is an independent developer based in Menton, France who specialises in cruft-free web applications using Ruby, Rails and unobtrusive JavaScript. His home on the internet is his blog Sneaky Abstractions. 41 | <% end %> 42 | 43 | <%= author('Jeff Dean', 'zilkey') do %> 44 | Jeff Dean is a software engineer with Pivotal Labs. 45 | <% end %> 46 | 47 | <%= author('Mike Gunderloy', 'mgunderloy') do %> 48 | Mike Gunderloy is a consultant with ActionRails. He brings 25 years of experience in a variety of languages to bear on his current work with Rails. His near-daily links and other blogging can be found at A Fresh Cup and he twitters too much. 49 | <% end %> 50 | 51 | <%= author('Mikel Lindsaar', 'raasdnil') do %> 52 | Mikel Lindsaar has been working with Rails since 2006 and is the author of the Ruby Mail gem and core contributor (he helped re-write Action Mailer's API). Mikel is the founder of RubyX, has a blog and tweets. 53 | <% end %> 54 | 55 | <%= author('Cássio Marques', 'cmarques') do %> 56 | Cássio Marques is a Brazilian software developer working with different programming languages such as Ruby, JavaScript, CPP and Java, as an independent consultant. He blogs at /* CODIFICANDO */, which is mainly written in Portuguese, but will soon get a new section for posts with English translation. 57 | <% end %> 58 | 59 | <%= author('James Miller', 'bensie') do %> 60 | James Miller is a software developer for JK Tech in San Diego, CA. You can find James on GitHub, Gmail, Twitter, and Freenode as "bensie". 61 | <% end %> 62 | 63 | <%= author('Pratik Naik', 'lifo') do %> 64 | Pratik Naik is a Ruby on Rails consultant with ActionRails and also a member of the Rails core team. He maintains a blog at has_many :bugs, :through => :rails and has an active twitter account. 65 | <% end %> 66 | 67 | <%= author('Emilio Tagua', 'miloops') do %> 68 | Emilio Tagua —a.k.a. miloops— is an Argentinian entrepreneur, developer, open source contributor and Rails evangelist. Cofounder of Eventioz. He has been using Rails since 2006 and contributing since early 2008. Can be found at gmail, twitter, freenode, everywhere as "miloops". 69 | <% end %> 70 | 71 | <%= author('Heiko Webers', 'hawe') do %> 72 | Heiko Webers is the founder of bauland42, a German web application security consulting and development company focused on Ruby on Rails. He blogs at the Ruby on Rails Security Project. After 10 years of desktop application development, Heiko has rarely looked back. 73 | <% end %> 74 | -------------------------------------------------------------------------------- /source/CN/index.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :page_title do %> 2 | Ruby on Rails Guides 中文 3 | <% end %> 4 | 5 | <% content_for :header_section do %> 6 | <%= render 'welcome' %> 7 | <% end %> 8 | 9 | <% content_for :index_section do %> 10 |
11 |
12 |
Rails Guides (英文) 现在已经有了 <%= link_to 'Kindle版本', 'https://kindle.amazon.com' %>, 13 | 在 iPad, iPhone, Mac, Anroid..上使用 <%= link_to 'kindle书阅读器', 'http://www.amazon.com/gp/kindle/kcp' %>一样也可以使用,点击 <%= link_to '下载', 'http://guides.rubyonrails.org/kindle/ruby_on_rails_guides_v4.0.0.mobi' %>. 14 |
15 |
如果文章被打上了这样的标签就说明这文章还没有完成或者还没有人认领翻译,如果是前者请耐心等待对应贡献者的文章,如果是后者你可以直接<%= link_to "fork并翻译","https://github.com/ruby-china/rails-guides" %>,我们欢迎任何形式的建议
16 |
17 |
18 | <% end %> 19 | 20 | <% documents_by_section.each do |section| %> 21 |

<%= section['name'] %>

22 |
23 | <% section['documents'].each do |document| %> 24 | <%= guide(document['name'], document['url'], :contributor => document['contributor'], :work_in_progress => document['work_in_progress']) do %> 25 |

<%= document['description'] %>

26 | <% end %> 27 | <% end %> 28 |
29 | <% end %> 30 | -------------------------------------------------------------------------------- /source/CN/layout.html.erb: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | <%= yield(:page_title) || 'Ruby on Rails Guides' %> 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | <% if @edge %> 25 |
26 | edge-badge 27 |
28 | <% end %> 29 |
30 | 38 |
39 | 64 |
65 | 66 |
67 |
68 | <%= yield :header_section %> 69 | 70 | <%= yield :index_section %> 71 |
72 |
73 | 74 |
75 |
76 |
77 | <%= yield.html_safe %> 78 | <%= render 'feedback' %> 79 |
80 |
81 |
82 | 83 |
84 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /source/CN/ruby_on_rails_guides_guidelines.textile: -------------------------------------------------------------------------------- 1 | h2. Ruby on Rails Guides Guidelines 2 | 3 | This guide documents guidelines for writing Ruby on Rails Guides. This guide follows itself in a graceful loop, serving itself as an example. 4 | 5 | endprologue. 6 | 7 | h3. Textile 8 | 9 | Guides are written in "Textile":http://www.textism.com/tools/textile/. There is comprehensive "documentation":http://redcloth.org/hobix.com/textile/ and a "cheatsheet":http://redcloth.org/hobix.com/textile/quick.html for markup. 10 | 11 | h3. Prologue 12 | 13 | Each guide should start with motivational text at the top (that's the little introduction in the blue area). The prologue should tell the reader what the guide is about, and what they will learn. See for example the "Routing Guide":routing.html. 14 | 15 | h3. Titles 16 | 17 | The title of every guide uses +h2+; guide sections use +h3+; subsections +h4+; etc. 18 | 19 | Capitalize all words except for internal articles, prepositions, conjunctions, and forms of the verb to be: 20 | 21 | 22 | h5. Middleware Stack is an Array 23 | h5. When are Objects Saved? 24 | 25 | 26 | Use the same typography as in regular text: 27 | 28 | 29 | h6. The :content_type Option 30 | 31 | 32 | h3. API Documentation Guidelines 33 | 34 | The guides and the API should be coherent and consistent where appropriate. Please have a look at these particular sections of the "API Documentation Guidelines":api_documentation_guidelines.html: 35 | 36 | * "Wording":api_documentation_guidelines.html#wording 37 | * "Example Code":api_documentation_guidelines.html#example-code 38 | * "Filenames":api_documentation_guidelines.html#filenames 39 | * "Fonts":api_documentation_guidelines.html#fonts 40 | 41 | Those guidelines apply also to guides. 42 | 43 | h3. HTML Guides 44 | 45 | h4. Generation 46 | 47 | To generate all the guides, just +cd+ into the +guides+ directory and execute: 48 | 49 | 50 | bundle exec rake generate_guides 51 | 52 | 53 | (You may need to run +bundle install+ first to install the required gems.) 54 | 55 | To process +my_guide.textile+ and nothing else use the +ONLY+ environment variable: 56 | 57 | 58 | touch my_guide.textile 59 | bundle exec rake generate_guides ONLY=my_guide 60 | 61 | 62 | By default, guides that have not been modified are not processed, so +ONLY+ is rarely needed in practice. 63 | 64 | To force processing all the guides, pass +ALL=1+. 65 | 66 | It is also recommended that you work with +WARNINGS=1+. This detects duplicate IDs and warns about broken internal links. 67 | 68 | If you want to generate guides in a language other than English, you can keep them in a separate directory under +source+ (eg. source/es) and use the +GUIDES_LANGUAGE+ environment variable: 69 | 70 | 71 | bundle exec rake generate_guides GUIDES_LANGUAGE=es 72 | 73 | 74 | h4. Validation 75 | 76 | Please validate the generated HTML with: 77 | 78 | 79 | bundle exec rake validate_guides 80 | 81 | 82 | Particularly, titles get an ID generated from their content and this often leads to duplicates. Please set +WARNINGS=1+ when generating guides to detect them. The warning messages suggest a solution. 83 | 84 | h3. Kindle Guides 85 | 86 | h4(#generation-kindle). Generation 87 | 88 | To generate guides for the Kindle, you need to provide +KINDLE=1+ as an environment variable: 89 | 90 | 91 | KINDLE=1 bundle exec rake generate_guides 92 | 93 | -------------------------------------------------------------------------------- /source/CN/upgrading_ruby_on_rails.textile: -------------------------------------------------------------------------------- 1 | h2. Ruby on Rails 升级指南 2 | 3 | 本指南提供了当你欲将应用升级到一个更新版本的 Ruby on Rails 时可以遵循的一些步骤。这些步骤在每次的发布指南中也可以找到。 4 | 5 | endprologue. 6 | 7 | h3. 一般性建议 8 | 9 | 在尝试升级一个已经存在的应用之前请保证你有恰切的理由这么做。你需要权衡再三:对新的特性的需求,对旧代码寻求支持所增加的难度,你现有的时间和技术水准,等等。 10 | 11 | h4(#general_testing). 测试覆盖率 12 | 13 | 能保证升级后你的应用还可以正常工作的万全之策在升级之前拥有良好的测试覆盖率。如果你还没有对你的应用进行过大量的自动化测试,你需要花时间手动对所有做过改动的部分进行测试。 对于 Rails 升级而言,这意味着应用中的每一个 functionality 。想对自己好点儿的话在升级 Rails 之前还是确认一个良好的测试覆盖率吧。 14 | 15 | h4(#general_ruby). Ruby 版本 16 | 17 | Rails 通常都是紧随最新的 Ruby 版本而发布。 18 | 19 | * Rails 3 以上版本需要 Ruby 1.8.7 或更高。 对于更早的 Ruby 版本官方已经停止支持,所以你还是尽可能趁早升级吧。 20 | * Rails 3.2.x 将是支持 Ruby 1.8.7 的最后一个分支。 21 | * Rails 4 只支持 Ruby 1.9.3。 22 | 23 | 建议:Ruby 1.8.7 p248 及 p249 存在可导致 Ruby 崩溃的 marshaling bugs。 Ruby 的 Enterprise Edition 自 1.8.7-2010.02 的发布修复了此问题。 作为 1.9 的开端的 Ruby 1.9.1 也公然存在这个段错误(segfaults)而不可以用。因此如果你想使用 1.9.x ,请直接跳到 1.9.2 或 1.9.3 可保畅行无阻。 24 | 25 | h3. 升级 Rails 3.2 至 Rails 4.0 26 | 27 | 注:本节还在完善中。 28 | 29 | 如果你的应用现今跑在 3.2.x 之前的任何版本上,在尝试升级到 Rails 4.0 之前你需要先升级至 Rails 3.2。 30 | 31 | 如下的改动是为了升级你的应用至 Rails 4.0. 32 | 33 | h4(#plugins4_0). vendor/plugins 34 | 35 | Rails 4.0 不再支持从 vendor/plugins 载入插件。你必须通过从插件中提取出 gem 的方式来替换掉任何插件,然后把它们添加到你的 Gemfile 中, 如果你不选择把它们制作成 gem 的方式,你可以把它们移到 lib/my_plugin/* ,然后在 config/initializers/my_plugin.rb 中添加一个正确的 initializer。 36 | 37 | h4(#identity_map4_0). IdentityMap 38 | 39 | Rails 4.0 从 ActiveRecord 中去掉了 IdentityMap , 源于 "some inconsistencies with associations":https://github.com/rails/rails/commit/302c912bf6bcd0fa200d964ec2dc4a44abe328a6. 如果你曾经在应用中手动开启了它,你必须去掉下面的配置,以使之不再有效: config.active_record.identity_map. 40 | 41 | h3. 升级 Rails 3.1 至 Rails 3.2 42 | 43 | 如果你的应用现今跑在 3.1.x 之前的任何版本上,在尝试升级到 Rails 3.2 之前你需要先升级至 Rails 3.1 。 44 | 45 | 如下的改动是为了升级你的应用至 Rails 3.2.2 ,这是 Rails 最新的 3.2.x 版本 。 46 | 47 | h4(#gemfile3_2). Gemfile 48 | 49 | 对你的 +Gemfile+ 作如下改动: 50 | 51 | 52 | gem 'rails', '= 3.2.2' 53 | 54 | group :assets do 55 | gem 'sass-rails', '~> 3.2.3' 56 | gem 'coffee-rails', '~> 3.2.1' 57 | gem 'uglifier', '>= 1.0.3' 58 | end 59 | 60 | 61 | h4(#config_dev3_2). config/environments/development.rb 62 | 63 | 你需要添加很多新的配置设置到你的开发环境: 64 | 65 | 66 | # 对 Active Record models 的 mass assignment protection 抛出异常 67 | config.active_record.mass_assignment_sanitizer = :strict 68 | 69 | # Log the query plan for queries taking more than this (works 70 | # with SQLite, MySQL, and PostgreSQL) 71 | config.active_record.auto_explain_threshold_in_seconds = 0.5 72 | 73 | 74 | h4(#config_test3_2). config/environments/test.rb 75 | 76 | mass_assignment_sanitizer 的配置设置同样要添加到 config/environments/test.rb: 77 | 78 | 79 | # 对 Active Record models 的 mass assignment protection 抛出异常 80 | config.active_record.mass_assignment_sanitizer = :strict 81 | 82 | 83 | h4(#plugins3_2). vendor/plugins 84 | 85 | Rails 3.2 弱化了 vendor/plugins ,在 Rails 4.0 中则完全去掉了。 因此它并非是升级 Rails 3.2 而严格需要的一部分,你可以通过从插件中提取出 gem 的方式来替换掉任何插件,然后把它们添加到你的 Gemfile 中, 如果你不选择把它们制作成 gem 的方式,你可以把它们移到 lib/my_plugin/* ,然后在 config/initializers/my_plugin.rb 中添加一个正确的 initializer。 86 | 87 | h3. 升级 Rails 3.0 至 Rails 3.1 88 | 89 | 如果你的应用现今跑在 3.0.x 之前的任何版本上,在尝试升级到 Rails 3.1 之前你需要先升级至 Rails 3.0 。 90 | 91 | 如下的改动是为了升级你的应用至 Rails 3.1.3 ,这是 Rails 最新的 3.1.x 版本。 92 | 93 | h4(#gemfile3_1). Gemfile 94 | 95 | 对你的 +Gemfile+ 作如下改动: 96 | 97 | 98 | gem 'rails', '= 3.1.3' 99 | gem 'mysql2' 100 | 101 | # Needed for the new asset pipeline 102 | group :assets do 103 | gem 'sass-rails', "~> 3.1.5" 104 | gem 'coffee-rails', "~> 3.1.1" 105 | gem 'uglifier', ">= 1.0.3" 106 | end 107 | 108 | # 在 Rails 3.1 中 jQuery 是默认 JavaScript 库。 109 | gem 'jquery-rails' 110 | 111 | 112 | h4(#config_app3_1). config/application.rb 113 | 114 | asset pipeline 需要增加如下几行: 115 | 116 | 117 | config.assets.enabled = true 118 | config.assets.version = '1.0' 119 | 120 | 121 | 如果你的应用使用了 "/assets" 给一个 resource 作为路由,你或许希望可以更改 assets 的前缀来避免冲突: 122 | 123 | 124 | # Defaults to '/assets' 125 | config.assets.prefix = '/asset-files' 126 | 127 | 128 | h4(#config_dev3_1). config/environments/development.rb 129 | 130 | 在 config.action_view.debug_rjs = true 中去掉 RJS 设置。 131 | 132 | 如果你开启了 asset pipeline 请增加这些设置: 133 | 134 | 135 | # 不压缩 assets 136 | config.assets.compress = false 137 | 138 | # Expands the lines which load the assets 139 | config.assets.debug = true 140 | 141 | 142 | h4(#config_prod3_1). config/environments/production.rb 143 | 144 | 同样下面的大部分改动都是为 asset pipeline 而做。 更详细的内容可以阅读 "Asset Pipeline":asset_pipeline.html 指南。 145 | 146 | 147 | # 压缩 JavaScripts 和 CSS 文件 148 | config.assets.compress = true 149 | 150 | # 当找不到一个预编译的 asset 时不要后退回 assets pipeline 151 | config.assets.compile = false 152 | 153 | # 为 assets URLs 生成摘要 154 | config.assets.digest = true 155 | 156 | # 默认为 Rails.root.join("public/assets") 157 | # config.assets.manifest = YOUR_PATH 158 | 159 | # 预编译额外的 assets ( 已经添加的 application.js, application.css, 及所有的非JS/CSS ) 160 | # config.assets.precompile += %w( search.js ) 161 | 162 | # 强制对应用的所有访问都是通过 SSL,使用 Strict-Transport-Security 以及 secure cookies。 163 | # config.force_ssl = true 164 | 165 | 166 | h4(#config_test3_1). config/environments/test.rb 167 | 168 | 在 test environment 中添加这些可以提升测试效能: 169 | 170 | 171 | # 配置静态 asset 服务器,测试开启了 Cache-Control 时的性能 172 | config.serve_static_assets = true 173 | config.static_cache_control = "public, max-age=3600" 174 | 175 | 176 | h4(#config_wp3_1). config/initializers/wrap_parameters.rb 177 | 178 | 如果你希望把参数打包进一个嵌套的哈希时,请添加包含如下内容的文件。在一个新的应用中这个是默认打开的。 179 | 180 | 181 | # 在你修改了该文件后务必重启服务器。 182 | # 该文件对 ActionController::ParamsWrapper 的设置是默认开启的。 183 | 184 | # 打开 JSON 的参数打包功能。通过给 :format 设置一个空数组可关闭该功能。 185 | ActiveSupport.on_load(:action_controller) do 186 | wrap_parameters :format => [:json] 187 | end 188 | 189 | # 关闭 JSON 的默认根元素功能。 190 | ActiveSupport.on_load(:active_record) do 191 | self.include_root_in_json = false 192 | end 193 | 194 | 195 | -------------------------------------------------------------------------------- /source/EN/_license.html.erb: -------------------------------------------------------------------------------- 1 |

This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License

2 |

"Rails", "Ruby on Rails", and the Rails logo are trademarks of David Heinemeier Hansson. All rights reserved.

3 | -------------------------------------------------------------------------------- /source/EN/_welcome.html.erb: -------------------------------------------------------------------------------- 1 |

Ruby on Rails Guides (<%= @version %>)

2 | 3 | <% if @edge %> 4 |

5 | These are Edge Guides, based on the current master branch. 6 |

7 |

8 | If you are looking for the ones for the stable version, please check 9 | http://guides.rubyonrails.org instead. 10 |

11 | <% else %> 12 |

13 | These are the new guides for Rails 3.2 based on <%= @version %>. 14 | These guides are designed to make you immediately productive with Rails, and to help you understand how all of the pieces fit together. 15 |

16 | <% end %> 17 |

18 | The guides for Rails 2.3.x are available at http://guides.rubyonrails.org/v2.3.11/. 19 |

20 | -------------------------------------------------------------------------------- /source/EN/credits.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :page_title do %> 2 | Ruby on Rails Guides: Credits 3 | <% end %> 4 | 5 | <% content_for :header_section do %> 6 |

Credits

7 | 8 |

We'd like to thank the following people for their tireless contributions to this project.

9 | 10 | <% end %> 11 | 12 |

Rails Guides Reviewers

13 | 14 | <%= author('Vijay Dev', 'vijaydev', 'vijaydev.jpg') do %> 15 | Vijayakumar, found as Vijay Dev on the web, is a web applications developer and an open source enthusiast who lives in Chennai, India. He started using Rails in 2009 and began actively contributing to Rails documentation in late 2010. He tweets a lot and also blogs. 16 | <% end %> 17 | 18 | <%= author('Xavier Noria', 'fxn', 'fxn.png') do %> 19 | Xavier Noria has been into Ruby on Rails since 2005. He is a Rails core team member and enjoys combining his passion for Rails and his past life as a proofreader of math textbooks. Xavier is currently an independent Ruby on Rails consultant. Oh, he also tweets and can be found everywhere as "fxn". 20 | <% end %> 21 | 22 |

Rails Guides Designers

23 | 24 | <%= author('Jason Zimdars', 'jz') do %> 25 | Jason Zimdars is an experienced creative director and web designer who has lead UI and UX design for numerous websites and web applications. You can see more of his design and writing at Thinkcage.com or follow him on Twitter. 26 | <% end %> 27 | 28 |

Rails Guides Authors

29 | 30 | <%= author('Ryan Bigg', 'radar', 'radar.png') do %> 31 | Ryan Bigg works as a consultant at RubyX and has been working with Rails since 2006. He's co-authoring a book called Rails 3 in Action and he's written many gems which can be seen on his GitHub page and he also tweets prolifically as @ryanbigg. 32 | <% end %> 33 | 34 | <%= author('Oscar Del Ben', 'oscardelben', 'oscardelben.jpg') do %> 35 | Oscar Del Ben is a software engineer at Wildfire. He's a regular open source contributor (Github account) and tweets regularly at @oscardelben. 36 | <% end %> 37 | 38 | <%= author('Frederick Cheung', 'fcheung') do %> 39 | Frederick Cheung is Chief Wizard at Texperts where he has been using Rails since 2006. He is based in Cambridge (UK) and when not consuming fine ales he blogs at spacevatican.org. 40 | <% end %> 41 | 42 | <%= author('Tore Darell', 'toretore') do %> 43 | Tore Darell is an independent developer based in Menton, France who specialises in cruft-free web applications using Ruby, Rails and unobtrusive JavaScript. His home on the internet is his blog Sneaky Abstractions. 44 | <% end %> 45 | 46 | <%= author('Jeff Dean', 'zilkey') do %> 47 | Jeff Dean is a software engineer with Pivotal Labs. 48 | <% end %> 49 | 50 | <%= author('Mike Gunderloy', 'mgunderloy') do %> 51 | Mike Gunderloy is a consultant with ActionRails. He brings 25 years of experience in a variety of languages to bear on his current work with Rails. His near-daily links and other blogging can be found at A Fresh Cup and he twitters too much. 52 | <% end %> 53 | 54 | <%= author('Mikel Lindsaar', 'raasdnil') do %> 55 | Mikel Lindsaar has been working with Rails since 2006 and is the author of the Ruby Mail gem and core contributor (he helped re-write Action Mailer's API). Mikel is the founder of RubyX, has a blog and tweets. 56 | <% end %> 57 | 58 | <%= author('Cássio Marques', 'cmarques') do %> 59 | Cássio Marques is a Brazilian software developer working with different programming languages such as Ruby, JavaScript, CPP and Java, as an independent consultant. He blogs at /* CODIFICANDO */, which is mainly written in Portuguese, but will soon get a new section for posts with English translation. 60 | <% end %> 61 | 62 | <%= author('James Miller', 'bensie') do %> 63 | James Miller is a software developer for JK Tech in San Diego, CA. You can find James on GitHub, Gmail, Twitter, and Freenode as "bensie". 64 | <% end %> 65 | 66 | <%= author('Pratik Naik', 'lifo') do %> 67 | Pratik Naik is a Ruby on Rails developer at 37signals and also a member of the Rails core team. He maintains a blog at has_many :bugs, :through => :rails and has a semi-active twitter account. 68 | <% end %> 69 | 70 | <%= author('Emilio Tagua', 'miloops') do %> 71 | Emilio Tagua —a.k.a. miloops— is an Argentinian entrepreneur, developer, open source contributor and Rails evangelist. Cofounder of Eventioz. He has been using Rails since 2006 and contributing since early 2008. Can be found at gmail, twitter, freenode, everywhere as "miloops". 72 | <% end %> 73 | 74 | <%= author('Heiko Webers', 'hawe') do %> 75 | Heiko Webers is the founder of bauland42, a German web application security consulting and development company focused on Ruby on Rails. He blogs at the Ruby on Rails Security Project. After 10 years of desktop application development, Heiko has rarely looked back. 76 | <% end %> 77 | -------------------------------------------------------------------------------- /source/EN/index.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :page_title do %> 2 | Ruby on Rails Guides 3 | <% end %> 4 | 5 | <% content_for :header_section do %> 6 | <%= render 'welcome' %> 7 | <% end %> 8 | 9 | <% content_for :index_section do %> 10 |
11 |
12 |
Rails Guides are also available for the <%= link_to 'Kindle', 'https://kindle.amazon.com' %> 13 | and <%= link_to 'Free Kindle Reading Apps', 'http://www.amazon.com/gp/kindle/kcp' %> for the iPad, 14 | iPhone, Mac, Android, etc. Download them from <%= link_to 'here', @mobi %>. 15 |
16 |
Guides marked with this icon are currently being worked on and will not be available in the Guides Index menu. While still useful, they may contain incomplete information and even errors. You can help by reviewing them and posting your comments and corrections.
17 |
18 |
19 | <% end %> 20 | 21 | <% documents_by_section.each do |section| %> 22 |

<%= section['name'] %>

23 |
24 | <% section['documents'].each do |document| %> 25 | <%= guide(document['name'], document['url'], :work_in_progress => document['work_in_progress']) do %> 26 |

<%= document['description'] %>

27 | <% end %> 28 | <% end %> 29 |
30 | <% end %> 31 | -------------------------------------------------------------------------------- /source/EN/layout.html.erb: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | <%= yield(:page_title) || 'Ruby on Rails Guides' %> 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | <% if @edge %> 22 |
23 | edge-badge 24 |
25 | <% end %> 26 |
27 |
28 | More at rubyonrails.org: 29 | Overview | 30 | Download | 31 | Deploy | 32 | Code | 33 | Screencasts | 34 | Documentation | 35 | Ecosystem | 36 | Community | 37 | Blog 38 |
39 |
40 | 65 |
66 | 67 |
68 |
69 | <%= yield :header_section %> 70 | 71 | <%= yield :index_section %> 72 |
73 |
74 | 75 |
76 |
77 |
78 | <%= yield.html_safe %> 79 | 80 |

Feedback

81 |

82 | You're encouraged to help improve the quality of this guide. 83 |

84 |

85 | If you see any typos or factual errors you are confident to 86 | patch, please clone <%= link_to 'docrails', 'https://github.com/lifo/docrails' %> 87 | and push the change yourself. That branch of Rails has public write access. 88 | Commits are still reviewed, but that happens after you've submitted your 89 | contribution. <%= link_to 'docrails', 'https://github.com/lifo/docrails' %> is 90 | cross-merged with master periodically. 91 |

92 |

93 | You may also find incomplete content, or stuff that is not up to date. 94 | Please do add any missing documentation for master. Check the 95 | <%= link_to 'Ruby on Rails Guides Guidelines', 'ruby_on_rails_guides_guidelines.html' %> 96 | for style and conventions. 97 |

98 |

99 | If for whatever reason you spot something to fix but cannot patch it yourself, please 100 | <%= link_to 'open an issue', 'https://github.com/rails/rails/issues' %>. 101 |

102 |

And last but not least, any kind of discussion regarding Ruby on Rails 103 | documentation is very welcome in the <%= link_to 'rubyonrails-docs mailing list', 'http://groups.google.com/group/rubyonrails-docs' %>. 104 |

105 |
106 |
107 |
108 | 109 |
110 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /source/EN/ruby_on_rails_guides_guidelines.md: -------------------------------------------------------------------------------- 1 | Ruby on Rails Guides Guidelines 2 | =============================== 3 | 4 | This guide documents guidelines for writing Ruby on Rails Guides. This guide follows itself in a graceful loop, serving itself as an example. 5 | 6 | -------------------------------------------------------------------------------- 7 | 8 | Markdown 9 | ------- 10 | 11 | Guides are written in [GitHub Flavored Markdown](http://github.github.com/github-flavored-markdown/). There is comprehensive [documentation for Markdown](http://daringfireball.net/projects/markdown/syntax), a [cheatsheet](http://daringfireball.net/projects/markdown/basics), and [additional documentation](http://github.github.com/github-flavored-markdown/) on the differences from traditional Markdown. 12 | 13 | Prologue 14 | -------- 15 | 16 | Each guide should start with motivational text at the top (that's the little introduction in the blue area). The prologue should tell the reader what the guide is about, and what they will learn. See for example the [Routing Guide](routing.html). 17 | 18 | Titles 19 | ------ 20 | 21 | The title of every guide uses `h1`; guide sections use `h2`; subsections `h3`; etc. However, the generated HTML output will have the heading tag starting from `

`. 22 | 23 | ``` 24 | Guide Title 25 | =========== 26 | 27 | Section 28 | ------- 29 | 30 | ### Sub Section 31 | ``` 32 | 33 | Capitalize all words except for internal articles, prepositions, conjunctions, and forms of the verb to be: 34 | 35 | ``` 36 | #### Middleware Stack is an Array 37 | #### When are Objects Saved? 38 | ``` 39 | 40 | Use the same typography as in regular text: 41 | 42 | ``` 43 | ##### The `:content_type` Option 44 | ``` 45 | 46 | API Documentation Guidelines 47 | ---------------------------- 48 | 49 | The guides and the API should be coherent and consistent where appropriate. Please have a look at these particular sections of the [API Documentation Guidelines](api_documentation_guidelines.html:) 50 | 51 | * [Wording](api_documentation_guidelines.html#wording) 52 | * [Example Code](api_documentation_guidelines.html#example-code) 53 | * [Filenames](api_documentation_guidelines.html#filenames) 54 | * [Fonts](api_documentation_guidelines.html#fonts) 55 | 56 | Those guidelines apply also to guides. 57 | 58 | HTML Guides 59 | ----------- 60 | 61 | ### Generation 62 | 63 | To generate all the guides, just `cd` into the **`guides`** directory and execute: 64 | 65 | ``` 66 | bundle exec rake guides:generate 67 | ``` 68 | 69 | or 70 | 71 | ``` 72 | bundle exec rake guides:generate:html 73 | ``` 74 | 75 | (You may need to run `bundle install` first to install the required gems.) 76 | 77 | To process `my_guide.md` and nothing else use the `ONLY` environment variable: 78 | 79 | ``` 80 | touch my_guide.md 81 | bundle exec rake guides:generate ONLY=my_guide 82 | ``` 83 | 84 | By default, guides that have not been modified are not processed, so `ONLY` is rarely needed in practice. 85 | 86 | To force processing all the guides, pass `ALL=1`. 87 | 88 | It is also recommended that you work with `WARNINGS=1`. This detects duplicate IDs and warns about broken internal links. 89 | 90 | If you want to generate guides in a language other than English, you can keep them in a separate directory under `source` (eg. `source/es`) and use the `GUIDES_LANGUAGE` environment variable: 91 | 92 | ``` 93 | bundle exec rake guides:generate GUIDES_LANGUAGE=es 94 | ``` 95 | 96 | If you want to see all the environment variables you can use to configure the generation script just run: 97 | 98 | ``` 99 | rake 100 | ``` 101 | 102 | ### Validation 103 | 104 | Please validate the generated HTML with: 105 | 106 | ``` 107 | bundle exec rake guides:validate 108 | ``` 109 | 110 | Particularly, titles get an ID generated from their content and this often leads to duplicates. Please set `WARNINGS=1` when generating guides to detect them. The warning messages suggest a solution. 111 | 112 | Kindle Guides 113 | ------------- 114 | 115 | ### Generation 116 | 117 | To generate guides for the Kindle, use the following rake task: 118 | 119 | ``` 120 | bundle exec rake guides:generate:kindle 121 | ``` 122 | -------------------------------------------------------------------------------- /source/EN/ruby_on_rails_guides_guidelines.textile: -------------------------------------------------------------------------------- 1 | h2. Ruby on Rails Guides Guidelines 2 | 3 | This guide documents guidelines for writing Ruby on Rails Guides. This guide follows itself in a graceful loop, serving itself as an example. 4 | 5 | endprologue. 6 | 7 | h3. Textile 8 | 9 | Guides are written in "Textile":http://www.textism.com/tools/textile/. There is comprehensive "documentation":http://redcloth.org/hobix.com/textile/ and a "cheatsheet":http://redcloth.org/hobix.com/textile/quick.html for markup. 10 | 11 | h3. Prologue 12 | 13 | Each guide should start with motivational text at the top (that's the little introduction in the blue area). The prologue should tell the reader what the guide is about, and what they will learn. See for example the "Routing Guide":routing.html. 14 | 15 | h3. Titles 16 | 17 | The title of every guide uses +h2+; guide sections use +h3+; subsections +h4+; etc. 18 | 19 | Capitalize all words except for internal articles, prepositions, conjunctions, and forms of the verb to be: 20 | 21 | 22 | h5. Middleware Stack is an Array 23 | h5. When are Objects Saved? 24 | 25 | 26 | Use the same typography as in regular text: 27 | 28 | 29 | h6. The :content_type Option 30 | 31 | 32 | h3. API Documentation Guidelines 33 | 34 | The guides and the API should be coherent and consistent where appropriate. Please have a look at these particular sections of the "API Documentation Guidelines":api_documentation_guidelines.html: 35 | 36 | * "Wording":api_documentation_guidelines.html#wording 37 | * "Example Code":api_documentation_guidelines.html#example-code 38 | * "Filenames":api_documentation_guidelines.html#filenames 39 | * "Fonts":api_documentation_guidelines.html#fonts 40 | 41 | Those guidelines apply also to guides. 42 | 43 | h3. HTML Guides 44 | 45 | h4. Generation 46 | 47 | To generate all the guides, just +cd+ into the *+guides+* directory and execute: 48 | 49 | 50 | bundle exec rake generate_guides 51 | 52 | 53 | (You may need to run +bundle install+ first to install the required gems.) 54 | 55 | To process +my_guide.textile+ and nothing else use the +ONLY+ environment variable: 56 | 57 | 58 | touch my_guide.textile 59 | bundle exec rake generate_guides ONLY=my_guide 60 | 61 | 62 | By default, guides that have not been modified are not processed, so +ONLY+ is rarely needed in practice. 63 | 64 | To force processing all the guides, pass +ALL=1+. 65 | 66 | It is also recommended that you work with +WARNINGS=1+. This detects duplicate IDs and warns about broken internal links. 67 | 68 | If you want to generate guides in a language other than English, you can keep them in a separate directory under +source+ (eg. source/es) and use the +GUIDES_LANGUAGE+ environment variable: 69 | 70 | 71 | bundle exec rake generate_guides GUIDES_LANGUAGE=es 72 | 73 | 74 | h4. Validation 75 | 76 | Please validate the generated HTML with: 77 | 78 | 79 | bundle exec rake validate_guides 80 | 81 | 82 | Particularly, titles get an ID generated from their content and this often leads to duplicates. Please set +WARNINGS=1+ when generating guides to detect them. The warning messages suggest a solution. 83 | 84 | h3. Kindle Guides 85 | 86 | h4(#generation-kindle). Generation 87 | 88 | To generate guides for the Kindle, you need to provide +KINDLE=1+ as an environment variable: 89 | 90 | 91 | KINDLE=1 bundle exec rake generate_guides 92 | 93 | -------------------------------------------------------------------------------- /source/kindle/KINDLE.md: -------------------------------------------------------------------------------- 1 | # Rails Guides on the Kindle 2 | 3 | 4 | ## Synopsis 5 | 6 | 1. Obtain `kindlegen` from the link below and put the binary in your path 7 | 2. Run `KINDLE=1 rake generate_guides` to generate the guides and compile the `.mobi` file 8 | 3. Copy `output/kindle/rails_guides.mobi` to your Kindle 9 | 10 | ## Resources 11 | 12 | * [StackOverflow: Kindle Periodical Format](http://stackoverflow.com/questions/5379565/kindle-periodical-format) 13 | * Example Periodical [.ncx](https://gist.github.com/808c971ed087b839d462) and [.opf](https://gist.github.com/d6349aa8488eca2ee6d0) 14 | * [Kindle Publishing guidelines](http://kindlegen.s3.amazonaws.com/AmazonKindlePublishingGuidelines.pdf) 15 | * [KindleGen & Kindle Previewer](http://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000234621) 16 | 17 | ## TODO 18 | 19 | ### Post release 20 | 21 | * Integrate generated Kindle document in to published HTML guides 22 | * Tweak heading styles (most docs use h3/h4/h5, which end up being smaller than the text under it) 23 | * Tweak table styles (smaller text? Many of the tables are unusable on a Kindle in portrait mode) 24 | * Have the HTML/XML TOC 'drill down' into the TOCs of the individual guides 25 | * `.epub` generation. 26 | 27 | -------------------------------------------------------------------------------- /source/kindle/KINDLE.md~HEAD: -------------------------------------------------------------------------------- 1 | # Rails Guides on the Kindle 2 | 3 | 4 | ## Synopsis 5 | 6 | 1. Obtain `kindlegen` from the link below and put the binary in your path 7 | 2. Run `KINDLE=1 rake generate_guides` to generate the guides and compile the `.mobi` file 8 | 3. Copy `output/kindle/rails_guides.mobi` to your Kindle 9 | 10 | ## Resources 11 | 12 | * [StackOverflow: Kindle Periodical Format](http://stackoverflow.com/questions/5379565/kindle-periodical-format) 13 | * Example Periodical [.ncx](https://gist.github.com/808c971ed087b839d462) and [.opf](https://gist.github.com/d6349aa8488eca2ee6d0) 14 | * [Kindle Publishing guidelines](http://kindlegen.s3.amazonaws.com/AmazonKindlePublishingGuidelines.pdf) 15 | * [KindleGen & Kindle Previewer](http://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000234621) 16 | 17 | ## TODO 18 | 19 | ### Post release 20 | 21 | * Integrate generated Kindle document in to published HTML guides 22 | * Tweak heading styles (most docs use h3/h4/h5, which end up being smaller than the text under it) 23 | * Tweak table styles (smaller text? Many of the tables are unusable on a Kindle in portrait mode) 24 | * Have the HTML/XML TOC 'drill down' into the TOCs of the individual guides 25 | * `.epub` generation. 26 | 27 | -------------------------------------------------------------------------------- /source/kindle/copyright.html.erb: -------------------------------------------------------------------------------- 1 | <%= render 'license' %> -------------------------------------------------------------------------------- /source/kindle/copyright.html.erb~HEAD: -------------------------------------------------------------------------------- 1 | <%= render 'license' %> -------------------------------------------------------------------------------- /source/kindle/layout.html.erb: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | <%= yield(:page_title) || 'Ruby on Rails Guides' %> 9 | 10 | 11 | 12 | 13 | 14 | 15 | <% if content_for? :header_section %> 16 | <%= yield :header_section %> 17 |
18 | <% end %> 19 | 20 | <% if content_for? :index_section %> 21 | <%= yield :index_section %> 22 |
23 | <% end %> 24 | 25 | <%= yield.html_safe %> 26 | 27 | 28 | -------------------------------------------------------------------------------- /source/kindle/layout.html.erb~HEAD: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | <%= yield(:page_title) || 'Ruby on Rails Guides' %> 9 | 10 | 11 | 12 | 13 | 14 | 15 | <% if content_for? :header_section %> 16 | <%= yield :header_section %> 17 |
18 | <% end %> 19 | 20 | <% if content_for? :index_section %> 21 | <%= yield :index_section %> 22 |
23 | <% end %> 24 | 25 | <%= yield.html_safe %> 26 | 27 | 28 | -------------------------------------------------------------------------------- /source/kindle/rails_guides.opf.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Ruby on Rails Guides (<%= @version %>) 9 | 10 | en-us 11 | Ruby on Rails 12 | Ruby on Rails 13 | Reference 14 | <%= Time.now.strftime('%Y-%m-%d') %> 15 | 16 | These guides are designed to make you immediately productive with Rails, and to help you understand how all of the pieces fit together. 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | <% documents_flat.each do |document| %> 26 | 27 | <% end %> 28 | 29 | <% %w{toc.html credits.html welcome.html copyright.html}.each do |url| %> 30 | 31 | <% end %> 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | <% documents_flat.each do |document| %> 44 | 45 | <% end %> 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /source/kindle/rails_guides.opf.erb~HEAD: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Ruby on Rails Guides (<%= @version %>) 9 | 10 | en-us 11 | Ruby on Rails 12 | Ruby on Rails 13 | Reference 14 | <%= Time.now.strftime('%Y-%m-%d') %> 15 | 16 | These guides are designed to make you immediately productive with Rails, and to help you understand how all of the pieces fit together. 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | <% documents_flat.each do |document| %> 26 | 27 | <% end %> 28 | 29 | <% %w{toc.html credits.html welcome.html copyright.html}.each do |url| %> 30 | 31 | <% end %> 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | <% documents_flat.each do |document| %> 44 | 45 | <% end %> 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /source/kindle/toc.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :page_title do %> 2 | Ruby on Rails Guides 3 | <% end %> 4 | 5 |

Table of Contents

6 |
7 | 8 | <% documents_by_section.each_with_index do |section, i| %> 9 |

<%= "#{i + 1}." %> <%= section['name'] %>

10 |
    11 | <% section['documents'].each do |document| %> 12 |
  • 13 | <%= document['name'] %> 14 | <% if document['work_in_progress']%>(WIP)<% end %> 15 |
  • 16 | <% end %> 17 |
18 | <% end %> 19 |
20 |
25 | -------------------------------------------------------------------------------- /source/kindle/toc.html.erb~HEAD: -------------------------------------------------------------------------------- 1 | <% content_for :page_title do %> 2 | Ruby on Rails Guides 3 | <% end %> 4 | 5 |

Table of Contents

6 |
7 | 8 | <% documents_by_section.each_with_index do |section, i| %> 9 |

<%= "#{i + 1}." %> <%= section['name'] %>

10 |
    11 | <% section['documents'].each do |document| %> 12 |
  • 13 | <%= document['name'] %> 14 | <% if document['work_in_progress']%>(WIP)<% end %> 15 |
  • 16 | <% end %> 17 |
18 | <% end %> 19 |
20 |
25 | -------------------------------------------------------------------------------- /source/kindle/toc.ncx.erb: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Ruby on Rails Guides 13 | docrails 14 | 15 | 16 | 17 | Table of Contents 18 | 19 | 20 | 21 | 22 | 23 | Introduction 24 | 25 | 26 | 27 | 28 | 29 | Welcome 30 | 31 | 32 | 33 | 34 | Credits 35 | 36 | 37 | 38 | Copyright & License 39 | 40 | 41 | 42 | 43 | <% play_order = 4 %> 44 | <% documents_by_section.each_with_index do |section, section_no| %> 45 | 46 | 47 | <%= section['name'] %> 48 | 49 | 50 | 51 | <% section['documents'].each_with_index do |document, document_no| %> 52 | 53 | 54 | <%= document['name'] %> 55 | 56 | 57 | 58 | <% end %> 59 | 60 | <% end %> 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /source/kindle/toc.ncx.erb~HEAD: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Ruby on Rails Guides 13 | docrails 14 | 15 | 16 | 17 | Table of Contents 18 | 19 | 20 | 21 | 22 | 23 | Introduction 24 | 25 | 26 | 27 | 28 | 29 | Welcome 30 | 31 | 32 | 33 | 34 | Credits 35 | 36 | 37 | 38 | Copyright & License 39 | 40 | 41 | 42 | 43 | <% play_order = 4 %> 44 | <% documents_by_section.each_with_index do |section, section_no| %> 45 | 46 | 47 | <%= section['name'] %> 48 | 49 | 50 | 51 | <% section['documents'].each_with_index do |document, document_no| %> 52 | 53 | 54 | <%= document['name'] %> 55 | 56 | 57 | 58 | <% end %> 59 | 60 | <% end %> 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /source/kindle/welcome.html.erb: -------------------------------------------------------------------------------- 1 | <%= render 'welcome' %> 2 | 3 |

Kindle Edition

4 | 5 | The Kindle Edition of the Rails Guides should be considered a work in progress. Feedback is really welcome, please see the "Feedback" section at the end of each guide for instructions. 6 | -------------------------------------------------------------------------------- /source/kindle/welcome.html.erb~HEAD: -------------------------------------------------------------------------------- 1 | <%= render 'welcome' %> 2 | 3 |

Kindle Edition

4 | 5 | The Kindle Edition of the Rails Guides should be considered a work in progress. Feedback is really welcome, please see the "Feedback" section at the end of each guide for instructions. 6 | -------------------------------------------------------------------------------- /w3c_validator.rb: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------------------------- 2 | # 3 | # This script validates the generated guides against the W3C Validator. 4 | # 5 | # Guides are taken from the output directory, from where all .html files are 6 | # submitted to the validator. 7 | # 8 | # This script is prepared to be launched from the railties directory as a rake task: 9 | # 10 | # rake validate_guides 11 | # 12 | # If nothing is specified, all files will be validated, but you can check just 13 | # some of them using this environment variable: 14 | # 15 | # ONLY 16 | # Use ONLY if you want to validate only one or a set of guides. Prefixes are 17 | # enough: 18 | # 19 | # # validates only association_basics.html 20 | # ONLY=assoc rake validate_guides 21 | # 22 | # Separate many using commas: 23 | # 24 | # # validates only association_basics.html and migrations.html 25 | # ONLY=assoc,migrations rake validate_guides 26 | # 27 | # --------------------------------------------------------------------------- 28 | 29 | require 'rubygems' 30 | require 'w3c_validators' 31 | include W3CValidators 32 | 33 | module RailsGuides 34 | class Validator 35 | 36 | def validate 37 | validator = MarkupValidator.new 38 | STDOUT.sync = true 39 | errors_on_guides = {} 40 | 41 | guides_to_validate.each do |f| 42 | results = validator.validate_file(f) 43 | 44 | if results.validity 45 | print "." 46 | else 47 | print "E" 48 | errors_on_guides[f] = results.errors 49 | end 50 | end 51 | 52 | show_results(errors_on_guides) 53 | end 54 | 55 | private 56 | def guides_to_validate 57 | guides = Dir["./guides/output/*.html"] 58 | guides.delete("./guides/output/layout.html") 59 | ENV.key?('ONLY') ? select_only(guides) : guides 60 | end 61 | 62 | def select_only(guides) 63 | prefixes = ENV['ONLY'].split(",").map(&:strip) 64 | guides.select do |guide| 65 | prefixes.any? {|p| guide.start_with?("./guides/output/#{p}")} 66 | end 67 | end 68 | 69 | def show_results(error_list) 70 | if error_list.size == 0 71 | puts "\n\nAll checked guides validate OK!" 72 | else 73 | error_summary = error_detail = "" 74 | 75 | error_list.each_pair do |name, errors| 76 | error_summary += "\n #{name}" 77 | error_detail += "\n\n #{name} has #{errors.size} validation error(s):\n" 78 | errors.each do |error| 79 | error_detail += "\n "+error.to_s.gsub("\n", "") 80 | end 81 | end 82 | 83 | puts "\n\nThere are #{error_list.size} guides with validation errors:\n" + error_summary 84 | puts "\nHere are the detailed errors for each guide:" + error_detail 85 | end 86 | end 87 | 88 | end 89 | end 90 | 91 | RailsGuides::Validator.new.validate 92 | --------------------------------------------------------------------------------