├── .gitattributes ├── .github └── workflows │ └── rspec.yml ├── .gitignore ├── .ruby-version ├── .tool-versions ├── CONTRIBUTING.md ├── Gemfile ├── Gemfile.lock ├── LICENSE.md ├── Procfile ├── README.md ├── Rakefile ├── app.rb ├── assets ├── javascripts │ ├── analytics.js │ ├── application.js │ ├── checkboxes.js │ ├── doc_page.js │ └── md5.js └── stylesheets │ ├── application.css │ ├── big_checkbox.scss │ ├── coderay.css │ ├── doc_page.scss │ ├── flags.scss │ ├── font_awesome.scss │ ├── header.scss │ ├── step.scss │ └── toc.scss ├── config.ru ├── lib ├── big_checkbox.rb ├── contents.rb ├── doc_page.rb ├── erector_scss.rb ├── flags.rb ├── html5_page.rb ├── markdown_page.rb ├── markdown_renderer.rb ├── media_wiki.rb ├── media_wiki_page.rb ├── raw_page.rb ├── site.rb ├── site_extensions │ ├── docs.rb │ ├── installfest.rb │ ├── intro-to-rails.rb │ └── javascript-snake-game.rb ├── site_index.rb ├── step.rb ├── step_page.rb └── titleizer.rb ├── locales ├── en │ ├── captions.yml │ ├── general.yml │ ├── header_sections.yml │ └── sites.yml ├── es │ ├── captions.yml │ ├── general.yml │ ├── header_sections.yml │ └── sites.yml └── zh-tw │ ├── captions.yml │ ├── general.yml │ └── header_section.yml ├── public ├── flags │ ├── ES.png │ ├── US.png │ └── ZH-TW.png ├── fonts │ ├── aleo-bold-webfont.eot │ ├── aleo-bold-webfont.svg │ ├── aleo-bold-webfont.ttf │ ├── aleo-bold-webfont.woff │ ├── aleo-regular-webfont.eot │ ├── aleo-regular-webfont.svg │ ├── aleo-regular-webfont.ttf │ ├── aleo-regular-webfont.woff │ ├── aleo.css │ ├── opensans-bold.woff │ ├── opensans-italic.woff │ ├── opensans.css │ └── opensans.woff └── img │ ├── check-box.png │ ├── check-dim.png │ ├── check.png │ ├── grid.jpg │ ├── macos.png │ ├── navbar_texture.gif │ ├── tux-trans.png │ └── windows.png ├── sites ├── docs │ └── docs.step ├── frontend │ ├── HTML_attributes.step │ ├── HTML_structure.step │ ├── HTML_tags.step │ ├── _consider_deploying_to_github.step │ ├── _consider_deploying_to_github_again.step │ ├── _developer_tools.step │ ├── _working_effectively_and_efficiently.md │ ├── add_more_elements.step │ ├── add_starter_files.step │ ├── basic_CSS.step │ ├── basic_javascript.step │ ├── deploying_to_github.step │ ├── deploying_to_github_again.step │ ├── developer_tools.step │ ├── front-end-lesson.zip-manifest │ ├── frontend.step │ ├── get_a_sticker.step │ ├── grid.html │ ├── griding_with_bootstrap.step │ ├── html_quick_reference.md │ ├── img │ │ ├── boxmodel.png │ │ ├── css.png │ │ ├── css_bundler.png │ │ ├── css_class.png │ │ ├── css_id.png │ │ ├── css_zen.png │ │ ├── devtools.png │ │ ├── devtools_console.png │ │ ├── devtools_elements.png │ │ ├── devtools_network.png │ │ ├── devtools_script.png │ │ ├── get_a_sticker_fork_button.png │ │ ├── get_a_sticker_https.png │ │ ├── get_a_sticker_output.png │ │ ├── github_create_repo.png │ │ ├── github_name_your_repo.png │ │ ├── hello_html.png │ │ ├── hello_omg.png │ │ ├── hello_structure.png │ │ ├── hello_style.png │ │ ├── hello_title.png │ │ ├── hello_world.png │ │ ├── hello_world_2line.png │ │ ├── hello_world_2line2.png │ │ ├── hello_world_jazzy.png │ │ ├── html_tags_list.png │ │ ├── jquery_result.png │ │ ├── page.png │ │ ├── page_anchors.png │ │ ├── page_html.png │ │ ├── page_img.png │ │ ├── page_sample.jpg │ │ ├── prompt.png │ │ └── zip.png │ ├── introduction_to_html.step │ ├── jquery.step │ ├── jquery_vs_javascript.step │ ├── make_a_web_page.step │ ├── make_columns.step │ ├── resources.step │ ├── tool_installation.step │ └── zip_content │ │ ├── .gitignore │ │ ├── index.html │ │ └── resources │ │ ├── javascript.js │ │ ├── layout.css │ │ └── picture.jpg ├── installfest │ ├── _command-line-glossary.md │ ├── _general-glossary.md │ ├── _install_atom_for_mac.step │ ├── _install_homebrew.step │ ├── _install_ruby.step │ ├── _install_rvm.step │ ├── _install_textmate.step │ ├── _ruby-and-rails-glossary.md │ ├── _switch_to_home_directory.step │ ├── choose_your_operating_system.step │ ├── clean_up.step │ ├── configure_git.step │ ├── create_a_github_account.step │ ├── create_a_heroku_account.step │ ├── create_a_rails_app.step │ ├── create_an_ssh_key.step │ ├── deploy_a_rails_app.step │ ├── editors.step │ ├── get_a_sticker.step │ ├── glossary.step │ ├── img │ │ ├── AboutThisMac.png │ │ ├── WinRailsInstaller.jpg │ │ ├── appstore.jpg │ │ ├── directory.png │ │ ├── get_a_sticker_you_should_see.png │ │ ├── install_atom_mac.gif │ │ ├── railsbridge_ubuntu12-checkbox.png │ │ ├── railsbridge_windowsScreenshot-commandprompt-pinnedtotaskbar.png │ │ ├── railsbridge_windowsScreenshot-commandprompt_ror.png │ │ ├── railsbridge_windows_findingCommandPrompt_win7.png │ │ ├── railsbridge_windows_findingCommandPrompt_win8.png │ │ ├── successful_rails_install.png │ │ ├── xcode-prefs.jpg │ │ └── xcode-tools-install.png │ ├── install_xcode.step │ ├── install_xcode_command_line_tools.step │ ├── install_xcode_from_app_store.step │ ├── install_xcode_from_dvd.step │ ├── installfest.step │ ├── linux.step │ ├── macOS.step │ ├── osx_rvm.step │ └── windows.step ├── intro-to-rails │ ├── CRUD_with_scaffolding.step │ ├── _consider_deploying.step │ ├── _consider_deploying_again.step │ ├── _deploying_to_heroku.step │ ├── _deploying_to_heroku_again.step │ ├── _switch_to_home_directory.step │ ├── _working_effectively_and_efficiently.md │ ├── add_the_project_to_a_git_repo.step │ ├── allow_people_to_vote.step │ ├── clean_up_links_on_the_topics_list.step │ ├── creating_a_migration.step │ ├── credits_and_next_steps.step │ ├── deploying_to_heroku.step │ ├── deploying_to_heroku_again.step │ ├── getting_started.step │ ├── glossary.step │ ├── hooking_up_votes_and_topics.step │ ├── img │ │ ├── Seattle_list_with_topic.png │ │ ├── Seattle_topic_created.png │ │ ├── Seattle_topic_list_page.png │ │ ├── Start_page.png │ │ ├── atom_add_folder_to_project.png │ │ ├── atom_project_as_folder.png │ │ ├── finished_app.png │ │ ├── mvc.png │ │ ├── rails4_rails_info_routing.png │ │ └── workflow.png │ ├── intro-to-rails.step │ ├── make_the_topic_title_a_link.step │ ├── rails_architecture.step │ ├── redirect_to_the_topics_list_after_creating_a_new_topic.step │ ├── ruby_language.step │ ├── running_your_application_locally.step │ ├── setting_the_default_page.step │ └── voting_on_topics.step ├── javascript-snake-game │ ├── img │ │ └── browser_console.png │ ├── javascript-snake-game.step │ ├── js-snake-game-tutorial.zip-manifest │ ├── js │ │ ├── chunk.js │ │ ├── lesson-10.js │ │ ├── lesson-11.js │ │ ├── lesson-12.js │ │ ├── lesson-13.js │ │ ├── lesson-2.js │ │ ├── lesson-3.js │ │ ├── lesson-4.js │ │ ├── lesson-5.js │ │ ├── lesson-6.js │ │ ├── lesson-7.js │ │ ├── lesson-8.js │ │ ├── lesson-9.js │ │ └── snake.js │ ├── lesson-1.step │ ├── lesson-10.step │ ├── lesson-11.step │ ├── lesson-12.step │ ├── lesson-13.step │ ├── lesson-14.step │ ├── lesson-2.step │ ├── lesson-3.step │ ├── lesson-4.step │ ├── lesson-5.step │ ├── lesson-6.step │ ├── lesson-7.step │ ├── lesson-8.step │ ├── lesson-9.step │ └── zip_content │ │ ├── index.html │ │ └── snake.js ├── javascript-to-do-list-with-react │ ├── AdvancedTodoList.zip-manifest │ ├── adding_an_item.step │ ├── building_complex_applications_with_react.step │ ├── creating_a_list.step │ ├── deploying_your_site.step │ ├── developer_tools.step │ ├── javascript-to-do-list-with-react.step │ ├── loading_items.step │ ├── marking_an_item_as_complete.step │ ├── next_steps.step │ └── zip_content │ │ ├── app.js │ │ ├── console-polyfill.js │ │ ├── debut_light.png │ │ ├── index.html │ │ ├── store.js │ │ └── styles.css ├── javascript-to-do-list │ ├── IntermediateTodoList.zip-manifest │ ├── _deploying_your_site.md │ ├── _lesson_format.md │ ├── _teachers_note.md │ ├── adding_an_item.step │ ├── creating_a_list.step │ ├── deploying_your_site.step │ ├── developer_tools.step │ ├── img │ │ ├── browser_console.png │ │ ├── finished_app.png │ │ ├── network_tab.png │ │ └── text_editor_html.png │ ├── javascript-to-do-list.step │ ├── loading_items.step │ ├── marking_an_item_as_complete.step │ ├── next_steps.step │ ├── playing_with_jquery.step │ ├── programming_with_javascript.step │ ├── the_basics_of_a_website.step │ └── zip_content │ │ ├── app.js │ │ ├── debut_light.png │ │ ├── index.html │ │ └── styles.css ├── job-board │ ├── add_a_navbar.step │ ├── add_a_new_job_form.step │ ├── add_more_things.step │ ├── create_a_rails_app.step │ ├── crud_and_resourceful_routing.step │ ├── delete_job_listings.step │ ├── img │ │ ├── crud_grid.jpg │ │ ├── crud_rails_methods.jpg │ │ ├── rails-routes.png │ │ └── request-cycle.jpg │ ├── job-board.step │ ├── listing_the_jobs.step │ ├── make_a_jobs_home_page.step │ ├── make_the_form_work.step │ ├── store_jobs_in_the_database.step │ ├── the_request_cycle.step │ └── update_job_listings.step ├── learn-to-code │ ├── argv.md │ ├── arrays.md │ ├── computers.md │ ├── extra.md │ ├── functions.md │ ├── hashes.md │ ├── img │ │ ├── cookie-recipe.gif │ │ ├── dot.jpg │ │ ├── fruit-banana-snack-banana.svg │ │ ├── one-infinite-loop.jpg │ │ ├── snack-apple.svg │ │ ├── snack-fruit.svg │ │ ├── spoon.jpg │ │ ├── truthiness.png │ │ ├── warehouse.jpg │ │ └── wargames-terminal.jpg │ ├── input_and_output.md │ ├── learn-to-code.md │ ├── logic.md │ ├── loops.md │ ├── methods.md │ ├── next_steps.md │ ├── nil.md │ ├── numbers.md │ ├── objects.md │ ├── sinatra.md │ ├── strings.md │ ├── the_command_line.md │ ├── todo-learntocode.md │ └── variables.md ├── message-board │ ├── add_other_features_of_your_choosing.step │ ├── add_pages_to_create_and_look_at_individual_posts.step │ ├── add_replying.step │ ├── commands.md │ ├── create_a_new_rails_app_with_a_static_home_page.step │ ├── creating_a_new_controller.md │ ├── img │ │ ├── create_post.png │ │ ├── create_reply.png │ │ ├── header.png │ │ ├── inline_reply.png │ │ ├── post_index.png │ │ ├── request-cycle.jpg │ │ ├── show_post.png │ │ ├── show_replies.png │ │ └── static_home_page.png │ ├── inline_replying_on_a_post.step │ ├── install_devise.step │ ├── make_a_posts_index_page.step │ ├── make_it_pretty_with_bootstrap.step │ ├── message-board.step │ ├── mvc_overview.md │ └── the_request_cycle.md ├── ruby │ ├── arrays.step │ ├── booleans.step │ ├── classes.step │ ├── command_line.step │ ├── conditionals.step │ ├── datatypes.step │ ├── functions.step │ ├── hashes.step │ ├── how_to_write_a_program.step │ ├── input_and_output.step │ ├── irb.step │ ├── loops.step │ ├── nil.step │ ├── numbers_and_arithmetic.step │ ├── overview:_building_blocks.step │ ├── overview:_organizing.step │ ├── ruby.step │ ├── running_programs_from_a_file.step │ ├── strings.step │ ├── summary:_basics.step │ ├── summary:_tools.step │ ├── symbols.step │ ├── using_virtual_machines.step │ ├── variables.step │ ├── what_is_ruby.step │ └── working_with_collections.step ├── testing-rails-applications │ ├── additional_concepts.step │ ├── final_challenge.step │ ├── img │ │ └── rails-test-types.png │ ├── testing-rails-applications.step │ ├── testing_frameworks.step │ ├── types_of_tests.step │ └── what_are_tests.step └── workshop │ ├── activities.md │ ├── beginners.mw │ ├── closing.deck.md │ ├── command_prompt.mw │ ├── diagrams.mw │ ├── foundational_skills.deck.md │ ├── helpful_examples.mw │ ├── img │ ├── Win7_search_programs.jpg │ ├── acrobat.jpg │ ├── agile.jpg │ ├── cheatsheet.png │ ├── ey_logo_rgb.png │ ├── firefox.png │ ├── git.png │ ├── git_bash.png │ ├── itunes.png │ ├── linux_logo.gif │ ├── mac_terminal_sm.png │ ├── os_x_logo.jpg │ ├── rails_logo.jpg │ ├── railsbridge_logo.png │ ├── ruby-logo.jpg │ ├── rubygems.png │ ├── windows_logo.gif │ └── wordpress.jpg │ ├── more_teacher_training.deck.md │ ├── more_teacher_training_2016.deck.md │ ├── noobie-outline.txt │ ├── resources.md │ ├── ruby_for_beginners.deck.md │ ├── ruby_for_programmers.deck.md │ ├── ta_cheat_sheet.md │ ├── teacher_cheat_sheet.md │ ├── teaching_tips.md │ ├── topics.md │ ├── web_apps.deck.md │ ├── welcome.deck.md │ └── workshop.md ├── spec ├── app_deck_spec.rb ├── app_spec.rb ├── contents_spec.rb ├── markdown_spec.rb ├── media_wiki_spec.rb ├── site_index_spec.rb ├── site_spec.rb ├── site_syntax_spec.rb ├── sites │ └── meals │ │ ├── _find_utensils.step │ │ ├── breakfast.deck.md │ │ ├── clean_up.md │ │ ├── eat_a_meal.step │ │ ├── find_some_vegetables.step │ │ ├── meals.step │ │ ├── omnivorous.step │ │ ├── orphaned_page.step │ │ ├── prepare_a_meal.step │ │ └── vegetarian.step ├── spec_helper.rb ├── step_page_spec.rb ├── step_spec.rb ├── support │ ├── i18n_helper.rb │ └── matchers.rb └── titleizer_spec.rb └── step_file_reference.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/dealing-with-line-endings 2 | 3 | # Set default behaviour, in case users don't have core.autocrlf set. 4 | * text=auto 5 | 6 | -------------------------------------------------------------------------------- /.github/workflows/rspec.yml: -------------------------------------------------------------------------------- 1 | name: RSpec 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | rspec: 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: actions/checkout@v3 17 | 18 | - name: Set up Ruby 19 | uses: ruby/setup-ruby@v1 20 | with: 21 | bundler-cache: true 22 | 23 | - name: Install dependencies 24 | run: bundle install 25 | 26 | - name: Run test and linter 27 | run: 28 | bundle exec rake 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .bundle 3 | .env 4 | .idea 5 | .rvmrc 6 | .sass-cache 7 | Thumbs.db 8 | .byebug_history 9 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 3.2.2 2 | -------------------------------------------------------------------------------- /.tool-versions: -------------------------------------------------------------------------------- 1 | ruby 3.2.2 2 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | ruby '3.2.2' 4 | 5 | gem 'activesupport' 6 | gem "erector", github: "erector/erector" 7 | gem "sinatra" 8 | gem "sinatra-contrib" 9 | gem "nokogiri" 10 | gem "thin" 11 | gem 'rack-codehighlighter' 12 | gem 'coderay' 13 | gem "deckrb" 14 | gem "sass" 15 | gem "redcarpet" 16 | gem "rubyzip" 17 | gem "i18n" 18 | gem 'font-awesome-sass' 19 | gem 'bootstrap-sass' 20 | gem 'jquery-cdn' 21 | gem 'sprockets' 22 | gem 'ffi' 23 | gem 'backports' 24 | 25 | group :development do 26 | gem "rspec" 27 | gem "rerun" 28 | gem "rake" 29 | gem "rack-test" 30 | gem 'files', github: "alexch/files" 31 | gem 'rb-fsevent', :platform => :ruby 32 | end 33 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: rackup -s thin -p $PORT 2 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | def windows? 2 | Rake::Win32.windows? 3 | end 4 | 5 | begin 6 | require 'rspec/core/rake_task' 7 | 8 | task :default => :spec 9 | 10 | desc "Run all specs" 11 | RSpec::Core::RakeTask.new(:spec) do |t| 12 | t.pattern = "spec/**/*_spec.rb" 13 | t.rspec_opts = 14 | "--format d" 15 | t.rspec_opts += " --color" unless windows? 16 | # t.ruby_opts="-w" 17 | end 18 | rescue LoadError # swallow Heroku deploy error 19 | end 20 | 21 | def rerun cmd, rerun_opts = nil 22 | if windows? 23 | exec cmd 24 | else 25 | exec "rerun #{rerun_opts} -- #{cmd}" 26 | end 27 | end 28 | 29 | desc "run the site locally (visit http://localhost:9292)" 30 | task :run do 31 | rerun "rackup -s thin -p #{ENV['PORT'] || 9292}" 32 | end 33 | -------------------------------------------------------------------------------- /assets/javascripts/analytics.js: -------------------------------------------------------------------------------- 1 | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ 2 | (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), 3 | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 4 | })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); 5 | 6 | ga('create', 'UA-40977319-4', 'auto'); 7 | ga('send', 'pageview'); 8 | -------------------------------------------------------------------------------- /assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | //= require 'jquery' 2 | //= require 'doc_page' 3 | //= require 'bootstrap/dropdown' 4 | //= require 'analytics' 5 | //= require 'md5' 6 | //= require 'checkboxes' 7 | -------------------------------------------------------------------------------- /assets/javascripts/checkboxes.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | function saveCheckboxValue (hashcode, value) { 3 | try { 4 | localStorage['checkbox_' + hashcode] = value; 5 | } catch (e) { } 6 | } 7 | 8 | function fetchCheckboxValue (hashcode) { 9 | try { 10 | return localStorage['checkbox_' + hashcode]; 11 | } catch (e) { 12 | return false; 13 | } 14 | } 15 | 16 | var $checkboxes = $('.big_checkbox'); 17 | 18 | $checkboxes.each(function () { 19 | var $checkbox = $(this); 20 | var content = $checkbox.closest('.step').text(); 21 | var hashcode = md5(content); 22 | $checkbox.data('hashcode', hashcode); 23 | $checkbox.prop('checked', fetchCheckboxValue(hashcode) === 'true'); 24 | }); 25 | 26 | $checkboxes.on('change', function (event) { 27 | var $checkbox = $(event.target); 28 | saveCheckboxValue($checkbox.data('hashcode'), $checkbox.prop('checked')); 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /assets/javascripts/doc_page.js: -------------------------------------------------------------------------------- 1 | // HTML5 Shims... 2 | document.createElement('main'); 3 | document.createElement('footer'); 4 | 5 | $(document).ready(function () { 6 | $('[data-toggle-selector]').on('click', function (event) { 7 | event.preventDefault(); 8 | var toToggle = $(event.target).data('toggle-selector'); 9 | var originallyVisible = $(toToggle).hasClass('visible'); 10 | $('.toc').removeClass('visible'); 11 | $(toToggle).toggleClass('visible', !originallyVisible); 12 | return false; 13 | }); 14 | 15 | $('.toggler').on('click', function (e) { 16 | e.preventDefault(); 17 | $(this).closest('.collapsable').toggleClass('closed'); 18 | }); 19 | 20 | $('.expand-all').on('click', function (e) { 21 | e.preventDefault(); 22 | $('.closed').removeClass('closed'); 23 | $('.expand-all').remove(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | //= require 'opensans' 2 | //= require 'aleo' 3 | //= require 'doc_page' 4 | //= require 'flags' 5 | //= require 'big_checkbox' 6 | //= require 'header' 7 | //= require 'toc' 8 | //= require 'step' 9 | //= require 'font_awesome' 10 | //= require 'coderay' 11 | -------------------------------------------------------------------------------- /assets/stylesheets/big_checkbox.scss: -------------------------------------------------------------------------------- 1 | $big_checkbox_size: 20px; 2 | 3 | input.big_checkbox[type=checkbox] { 4 | display:none; 5 | + label { 6 | height: $big_checkbox_size; 7 | width: $big_checkbox_size; 8 | display:inline-block; 9 | padding: 2px; 10 | margin: 0 12px -8px 0; 11 | background-color: white; 12 | z-index: 2; 13 | border: 2px solid #dadada; 14 | 15 | &:hover { 16 | background-image: url(/img/check-dim.png); 17 | background-size: cover; 18 | cursor: pointer; 19 | } 20 | } 21 | 22 | &:checked { 23 | + label { 24 | background-image: url(/img/check.png); 25 | background-size: cover; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /assets/stylesheets/flags.scss: -------------------------------------------------------------------------------- 1 | ul.flags { 2 | min-width: 0; 3 | position: relative; 4 | 5 | > li { 6 | display: block; 7 | 8 | > a { 9 | position: relative; 10 | display: block; 11 | padding: 10px 14px; 12 | line-height: 20px; 13 | } 14 | 15 | > img:hover { 16 | background-color: #eee; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /assets/stylesheets/font_awesome.scss: -------------------------------------------------------------------------------- 1 | $fa-font-path: '/fonts/font-awesome/'; 2 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | require 'rack/codehighlighter' 2 | require 'coderay' 3 | 4 | use Rack::ShowExceptions 5 | use Rack::ShowStatus 6 | use Rack::Static, :urls => ["/css", "/img"], :root => "public" 7 | use Rack::Codehighlighter, :coderay, :element => "pre.code", :pattern => /\A\s*:::(\w+)\s*\n/ 8 | use Rack::Codehighlighter, :coderay, 9 | :element => "pre>code", 10 | :markdown => true, 11 | :pattern => /\A[:@]{3}\s?(\w+)\s*(\n| )/i 12 | 13 | # require 'thin/logging' 14 | # Thin::Logging.debug = true 15 | 16 | require './app' 17 | run Rack::Cascade.new([ 18 | Deck::RackApp.public_file_server, 19 | InstallFest 20 | ]) 21 | -------------------------------------------------------------------------------- /lib/big_checkbox.rb: -------------------------------------------------------------------------------- 1 | require 'erector_scss' 2 | 3 | class BigCheckbox < Erector::Widget 4 | # for testing -- set the next number 5 | def self.number= checkbox_number 6 | @@checkbox_number = checkbox_number 7 | end 8 | 9 | def content 10 | # check.png from http://findicons.com/icon/251632/check?id=396591 11 | # technique thanks to http://nicolasgallagher.com/css-background-image-hacks/ 12 | # and http://stackoverflow.com/questions/3772273/pure-css-checkbox-image-replacement 13 | # and https://gist.github.com/592332 14 | checkbox_number = (@@checkbox_number ||= 0) 15 | input.big_checkbox type: "checkbox", name: "big_checkbox_#{checkbox_number}", value: "valuable", id: "big_checkbox_#{checkbox_number}" 16 | label for: "big_checkbox_#{checkbox_number}" 17 | @@checkbox_number += 1 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/erector_scss.rb: -------------------------------------------------------------------------------- 1 | require 'sass' 2 | 3 | class Erector::Widget 4 | def self.scss content 5 | Sass.compile(content) 6 | end 7 | end 8 | 9 | -------------------------------------------------------------------------------- /lib/flags.rb: -------------------------------------------------------------------------------- 1 | 2 | # Flag icons borrowed from https://www.gosquared.com/resources/flag-icons/ 3 | # Put them in public/flags 4 | class Flags < Erector::Widget 5 | needs :locale 6 | 7 | def initialize *args 8 | super 9 | @locales = ["en", "es", "zh-tw"] 10 | end 11 | 12 | def image_for_locale(locale) 13 | image_name = {"en" => "us"}[locale.to_s] || locale 14 | "/flags/#{image_name.upcase}.png" 15 | end 16 | 17 | def subdomain_for_locale(locale) 18 | {"en" => "docs"}[locale.to_s] || locale 19 | end 20 | 21 | def content 22 | li class: 'dropdown' do 23 | a class: 'dropdown-toggle', 'data-toggle' => 'dropdown', href: '#' do 24 | img src: image_for_locale(@locale) 25 | end 26 | ul class: 'flags dropdown-menu' do 27 | @locales.each do |locale| 28 | li { 29 | a(href:"http://#{subdomain_for_locale(locale)}.railsbridge.org") { 30 | img src: image_for_locale(locale) 31 | } 32 | } 33 | end 34 | end 35 | end 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /lib/html5_page.rb: -------------------------------------------------------------------------------- 1 | class Html5ExternalRenderer < ExternalRenderer 2 | # render 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 |