middlemac 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +24 -0
- data/.yardopts +7 -0
- data/CHANGELOG.md +43 -0
- data/Gemfile +18 -0
- data/LICENSE.md +22 -0
- data/README.md +225 -0
- data/Rakefile +213 -0
- data/bin/middlemac +103 -0
- data/documentation_project/.gitignore +37 -0
- data/documentation_project/Contents/Info.plist.erb +42 -0
- data/documentation_project/Contents/Resources/Base.lproj/010_what_is_middlemac/index.html.md.erb +126 -0
- data/documentation_project/Contents/Resources/Base.lproj/020_setup_tutorial/index.html.md.erb +168 -0
- data/documentation_project/Contents/Resources/Base.lproj/030_skills_refresher/10_markdown_skill.html.md.erb +63 -0
- data/documentation_project/Contents/Resources/Base.lproj/030_skills_refresher/20_frontmatter_skill.html.md.erb +54 -0
- data/documentation_project/Contents/Resources/Base.lproj/030_skills_refresher/30_middleman_skill.html.md.erb +93 -0
- data/documentation_project/Contents/Resources/Base.lproj/030_skills_refresher/40_ruby_skill.html.md.erb +67 -0
- data/documentation_project/Contents/Resources/Base.lproj/030_skills_refresher/50_ruby_ecosystem.html.md.erb +136 -0
- data/documentation_project/Contents/Resources/Base.lproj/030_skills_refresher/60_filetypes_skill.html.md.erb +165 -0
- data/documentation_project/Contents/Resources/Base.lproj/030_skills_refresher/index.html.md.erb +35 -0
- data/documentation_project/Contents/Resources/Base.lproj/040_setup/index.html.md.erb +88 -0
- data/documentation_project/Contents/Resources/Base.lproj/050_structure/010_directories_and_images.html.md.erb +176 -0
- data/documentation_project/Contents/Resources/Base.lproj/050_structure/020_layouts_and_templates.html.md.erb +71 -0
- data/documentation_project/Contents/Resources/Base.lproj/050_structure/025_css.html.md.erb +71 -0
- data/documentation_project/Contents/Resources/Base.lproj/050_structure/030_groups.html.md.erb +83 -0
- data/documentation_project/Contents/Resources/Base.lproj/050_structure/040_breadcrumbs.html.md.erb +43 -0
- data/documentation_project/Contents/Resources/Base.lproj/050_structure/050_navigator.html.md.erb +26 -0
- data/documentation_project/Contents/Resources/Base.lproj/050_structure/060_targets.html.md.erb +63 -0
- data/documentation_project/Contents/Resources/Base.lproj/050_structure/070_features.html.md.erb +122 -0
- data/documentation_project/Contents/Resources/Base.lproj/050_structure/index.html.md.erb +21 -0
- data/documentation_project/Contents/Resources/Base.lproj/050_structure/not_free.html.md.erb +43 -0
- data/documentation_project/Contents/Resources/Base.lproj/050_structure/not_pro.html.md.erb +43 -0
- data/documentation_project/Contents/Resources/Base.lproj/060_content/010_frontmatter.html.md.erb +88 -0
- data/documentation_project/Contents/Resources/Base.lproj/060_content/030_helpers.html.md.erb +247 -0
- data/documentation_project/Contents/Resources/Base.lproj/060_content/040_partials.html.md.erb +121 -0
- data/documentation_project/Contents/Resources/Base.lproj/060_content/050_resources.html.md.erb +60 -0
- data/documentation_project/Contents/Resources/Base.lproj/060_content/070_including_excluding.html.md.erb +68 -0
- data/documentation_project/Contents/Resources/Base.lproj/060_content/080_markdown_links_images.html.md.erb +93 -0
- data/documentation_project/Contents/Resources/Base.lproj/060_content/090_css_image_sizes.html.md.erb +90 -0
- data/documentation_project/Contents/Resources/Base.lproj/060_content/100_using_local_data.html.md.erb +37 -0
- data/documentation_project/Contents/Resources/Base.lproj/060_content/index.html.md.erb +21 -0
- data/documentation_project/Contents/Resources/Base.lproj/070_preview_build/index.html.md.erb +78 -0
- data/documentation_project/Contents/Resources/Base.lproj/090_build_application/10_apple_help_setup.html.md.erb +110 -0
- data/documentation_project/Contents/Resources/Base.lproj/090_build_application/20_xcode_integration.html.md.erb +64 -0
- data/documentation_project/Contents/Resources/Base.lproj/090_build_application/index.html.md.erb +25 -0
- data/documentation_project/Contents/Resources/Base.lproj/100_reference/10_cli_ref.html.md.erb +72 -0
- data/documentation_project/Contents/Resources/Base.lproj/100_reference/20_config_ref.html.md.erb +56 -0
- data/documentation_project/Contents/Resources/Base.lproj/100_reference/30_helpers_ext_ref.html.md.erb +51 -0
- data/documentation_project/Contents/Resources/Base.lproj/100_reference/40_helpers_ref.html.md.erb +45 -0
- data/documentation_project/Contents/Resources/Base.lproj/100_reference/50_resource_ext_ref.html.md.erb +25 -0
- data/documentation_project/Contents/Resources/Base.lproj/100_reference/index.html.md.erb +26 -0
- data/documentation_project/Contents/Resources/Base.lproj/110_acknowledgements/index.html.md.erb +61 -0
- data/documentation_project/Contents/Resources/Base.lproj/120_backwards_compatibility/index.html.md.erb +88 -0
- data/documentation_project/Contents/Resources/Base.lproj/130_all_help_content/index.html.md.erb +15 -0
- data/documentation_project/Contents/Resources/Base.lproj/InfoPlist.strings.erb +10 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/_data/globals.yml +11 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/_layouts/layout-html4.haml +22 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/_layouts/layout-xhtml.haml +28 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/_layouts/template-logo-large.haml +30 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/_layouts/template-logo-medium.haml +30 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/_layouts/template-logo-small.haml +30 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/fonts/font-awesome/FontAwesome.otf +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/fonts/font-awesome/fontawesome-webfont.eot +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/fonts/font-awesome/fontawesome-webfont.svg +655 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/fonts/font-awesome/fontawesome-webfont.ttf +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/fonts/font-awesome/fontawesome-webfont.woff +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/fonts/font-awesome/fontawesome-webfont.woff2 +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/all-sample.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/all-sample@2x.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/free-middlemac-logo-small.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/free-middlemac-logo-small@2x.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/free-middlemac-logo.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/free-middlemac-logo@2x.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/middlemac-logo-small.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/middlemac-logo-small@2x.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/middlemac-logo.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/middlemac-logo@2x.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/mm-extras/middlemac-extras-small.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/mm-extras/middlemac-extras-small@2x.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/mm-extras/middlemac-extras.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/mm-extras/middlemac-extras@2x.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/mm-extras/sub_images/middlemac-extras-small.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/mm-extras/sub_images/middlemac-extras-small@2x.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/mm-extras/sub_images/middlemac-extras.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/mm-extras/sub_images/middlemac-extras@2x.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/mm-pagegroups/middleman-pagegroups-small.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/mm-pagegroups/middleman-pagegroups.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/mm-targets/free-logo-small.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/mm-targets/free-logo-small@2x.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/mm-targets/free-logo.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/mm-targets/free-logo@2x.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/mm-targets/pro-logo-small.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/mm-targets/pro-logo-small@2x.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/mm-targets/pro-logo.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/mm-targets/pro-logo@2x.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/pro-middlemac-logo-small.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/pro-middlemac-logo-small@2x.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/pro-middlemac-logo.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/images/pro-middlemac-logo@2x.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/javascripts/all.js +1 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_nav_breadcrumbs.haml +11 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_nav_breadcrumbs_alt.haml +15 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_nav_brethren.haml +18 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_nav_brethren_index.haml +14 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_nav_legitimate_children.haml +16 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_nav_prev_next.haml +21 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_nav_toc_index.haml +21 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_yard_extras_config.erb +200 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_yard_extras_helpers.erb +146 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_yard_extras_helpers_extended.erb +135 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_yard_middlemac_config.erb +207 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_yard_middlemac_helpers.erb +297 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_yard_middlemac_helpers_extended.erb +96 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_yard_pagegroups_config.erb +744 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_yard_pagegroups_helpers.erb +710 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_yard_pagegroups_helpers_css.erb +523 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_yard_pagegroups_helpers_extended.erb +56 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_yard_pagegroups_resources.erb +540 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_yard_targets_config.erb +402 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_yard_targets_helpers.erb +235 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_yard_targets_helpers_extended.erb +138 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_yard_targets_instance.erb +81 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/partials/_yard_targets_resources.erb +109 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/stylesheets/_apple_helpbook.scss +946 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/stylesheets/_github.scss +61 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/stylesheets/_normalize.scss +374 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/stylesheets/breadcrumb-separator-light.png +0 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/stylesheets/image_sizes.css.erb +8 -0
- data/documentation_project/Contents/Resources/Base.lproj/assets/stylesheets/style.css.scss +4 -0
- data/documentation_project/Contents/Resources/Base.lproj/index.html.md.erb +31 -0
- data/documentation_project/Contents/Resources/shared/free-icon_256x256.png +0 -0
- data/documentation_project/Contents/Resources/shared/free-icon_256x256@2x.png +0 -0
- data/documentation_project/Contents/Resources/shared/free-icon_32x32.png +0 -0
- data/documentation_project/Contents/Resources/shared/free-icon_32x32@2x.png +0 -0
- data/documentation_project/Contents/Resources/shared/icon_256x256.png +0 -0
- data/documentation_project/Contents/Resources/shared/icon_256x256@2x.png +0 -0
- data/documentation_project/Contents/Resources/shared/icon_32x32.png +0 -0
- data/documentation_project/Contents/Resources/shared/icon_32x32@2x.png +0 -0
- data/documentation_project/Contents/Resources/shared/pro-icon_256x256.png +0 -0
- data/documentation_project/Contents/Resources/shared/pro-icon_256x256@2x.png +0 -0
- data/documentation_project/Contents/Resources/shared/pro-icon_32x32.png +0 -0
- data/documentation_project/Contents/Resources/shared/pro-icon_32x32@2x.png +0 -0
- data/documentation_project/Gemfile +51 -0
- data/documentation_project/HelpViewerApp/HelpViewerApp.xcodeproj/project.pbxproj +529 -0
- data/documentation_project/HelpViewerApp/HelpViewerApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/documentation_project/HelpViewerApp/HelpViewerApp.xcodeproj/xcshareddata/xcschemes/Help (free).xcscheme +80 -0
- data/documentation_project/HelpViewerApp/HelpViewerApp.xcodeproj/xcshareddata/xcschemes/HelpViewerApp (free).xcscheme +91 -0
- data/documentation_project/HelpViewerApp/HelpViewerApp.xcodeproj/xcshareddata/xcschemes/HelpViewerApp (pro).xcscheme +91 -0
- data/documentation_project/HelpViewerApp/HelpViewerApp/AppDelegate.h +16 -0
- data/documentation_project/HelpViewerApp/HelpViewerApp/AppDelegate.m +45 -0
- data/documentation_project/HelpViewerApp/HelpViewerApp/Assets.xcassets/AppIcon.appiconset/Contents.json +58 -0
- data/documentation_project/HelpViewerApp/HelpViewerApp/Base.lproj/MainMenu.xib +115 -0
- data/documentation_project/HelpViewerApp/HelpViewerApp/Info-free.plist +38 -0
- data/documentation_project/HelpViewerApp/HelpViewerApp/Info-pro.plist +38 -0
- data/documentation_project/HelpViewerApp/HelpViewerApp/main.m +13 -0
- data/documentation_project/HelpViewerApp/README.md +43 -0
- data/documentation_project/Middlemac (free).help/.gitignore +3 -0
- data/documentation_project/Middlemac (pro).help/.gitignore +3 -0
- data/documentation_project/config.rb +309 -0
- data/documentation_project/middlemac.webloc +0 -0
- data/features/main_features.feature +44 -0
- data/features/support/env.rb +20 -0
- data/fixtures/middlemac_app/.gitignore +25 -0
- data/fixtures/middlemac_app/Contents/Info.plist.erb +42 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/10_hello_world_file.html.md.erb +22 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/20_goodbye_world_file.html.md.erb +22 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/30_sample_group_number_one/index.html.md.erb +24 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/30_sample_group_number_one/page_one.html.md.erb +20 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/30_sample_group_number_one/page_two.html.md.erb +19 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/40_sample_group_number_two/01_nested_group_example/01_page_one.html.md.erb +18 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/40_sample_group_number_two/01_nested_group_example/02_pagina_dos.html.md.erb +19 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/40_sample_group_number_two/01_nested_group_example/03_page_san.html.md.erb +18 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/40_sample_group_number_two/01_nested_group_example/index.html.md.erb +18 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/40_sample_group_number_two/02_page_two.html.md.erb +19 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/40_sample_group_number_two/03_page_three.html.md.erb +19 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/40_sample_group_number_two/index.html.md.erb +24 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/45_testing_world_file.html.md.erb +55 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/50_entire_world_file.html.md.erb +15 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/InfoPlist.strings.erb +10 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/_new_style_partial.erb +1 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/_data/globals.yml +11 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/_layouts/layout-html4.haml +22 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/_layouts/layout-xhtml.haml +28 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/_layouts/template-logo-large.haml +30 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/_layouts/template-logo-medium.haml +30 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/_layouts/template-logo-small.haml +30 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/fonts/font-awesome/FontAwesome.otf +0 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/fonts/font-awesome/fontawesome-webfont.eot +0 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/fonts/font-awesome/fontawesome-webfont.svg +655 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/fonts/font-awesome/fontawesome-webfont.ttf +0 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/fonts/font-awesome/fontawesome-webfont.woff +0 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/fonts/font-awesome/fontawesome-webfont.woff2 +0 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/images/_empty_directory.html.md.erb +1 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/javascripts/all.js +1 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/partials/_nav_breadcrumbs.haml +11 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/partials/_nav_breadcrumbs_alt.haml +15 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/partials/_nav_brethren.haml +18 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/partials/_nav_brethren_index.haml +14 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/partials/_nav_legitimate_children.haml +16 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/partials/_nav_prev_next.haml +21 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/partials/_nav_toc_index.haml +21 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/partials/_partials_dir_partial.erb +1 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/stylesheets/_apple_helpbook.scss +946 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/stylesheets/_github.scss +61 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/stylesheets/_normalize.scss +374 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/stylesheets/breadcrumb-separator-light.png +0 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/stylesheets/image_sizes.css.erb +8 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/assets/stylesheets/style.css.scss +4 -0
- data/fixtures/middlemac_app/Contents/Resources/Base.lproj/index.html.md.erb +17 -0
- data/fixtures/middlemac_app/Contents/Resources/shared/icon_256x256.png +0 -0
- data/fixtures/middlemac_app/Contents/Resources/shared/icon_256x256@2x.png +0 -0
- data/fixtures/middlemac_app/Contents/Resources/shared/icon_32x32.png +0 -0
- data/fixtures/middlemac_app/Contents/Resources/shared/icon_32x32@2x.png +0 -0
- data/fixtures/middlemac_app/Gemfile +51 -0
- data/fixtures/middlemac_app/config.rb +309 -0
- data/fixtures/middlemac_app/middlemac.webloc +0 -0
- data/lib/middlemac.rb +6 -0
- data/lib/middlemac/extension.rb +274 -0
- data/lib/middlemac/version.rb +5 -0
- data/middlemac.gemspec +38 -0
- data/yard/readme.md +9 -0
- data/yard/template-grouped/default/module/html/method_details_list.erb +11 -0
- data/yard/template-partials/default/method_details/setup.rb +4 -0
- data/yard/template-partials/default/module/html/attribute_details.erb +9 -0
- data/yard/template-partials/default/module/html/method_details_list.erb +10 -0
- data/yard/template-partials/default/module/setup.rb +6 -0
- data/yard/template-partials/default/onefile/html/layout.erb +1 -0
- data/yard/template-partials/default/onefile/html/setup.rb +4 -0
- data/yard/yard_extensions.rb +109 -0
- metadata +454 -0
@@ -0,0 +1,63 @@
|
|
1
|
+
---
|
2
|
+
title: Markdown
|
3
|
+
blurb: Although you can hand-write all of your documents in HTML, why not take
|
4
|
+
advantage of the clarity and ease of use offered by Markdown?
|
5
|
+
layout: template-logo-medium
|
6
|
+
---
|
7
|
+
<%= md_links %>
|
8
|
+
<%= md_images %>
|
9
|
+
|
10
|
+
<%= current_page.data.title %>
|
11
|
+
==============================
|
12
|
+
|
13
|
+
<%= current_page.data.blurb %>
|
14
|
+
|
15
|
+
_Middlemac_ takes care of a lot of the details for generating Apple Help Books,
|
16
|
+
and that may be reason enough to use _Middlemac_. However if you decide _not_ to
|
17
|
+
use Markdown, then you’re throwing away the single, largest contributor to your
|
18
|
+
help file building productivity that there is.
|
19
|
+
|
20
|
+
|
21
|
+
What is Markdown?
|
22
|
+
-----------------
|
23
|
+
|
24
|
+
In the words of the estimable John Gruber (the author of the original Markdown):
|
25
|
+
|
26
|
+
> Markdown is a text-to-HTML conversion tool for web writers. Markdown allows
|
27
|
+
> you to write using an easy-to-read, easy-to-write plain text format, then
|
28
|
+
> convert it to structurally valid XHTML (or HTML).
|
29
|
+
|
30
|
+
This offers the powerful advantage of having text-based source files that are
|
31
|
+
themselves very highly legible. For example, this opening of this section of
|
32
|
+
the page was written so:
|
33
|
+
|
34
|
+
~~~ markdown
|
35
|
+
What is Markdown?
|
36
|
+
-----------------
|
37
|
+
|
38
|
+
In the words of the estimable John Gruber (the author of the original Markdown):
|
39
|
+
|
40
|
+
> Markdown is a text-to-HTML conversion tool for web writers. Markdown allows
|
41
|
+
> you to write using an easy-to-read, easy-to-write plain text format, then
|
42
|
+
> convert it to structurally valid XHTML (or HTML).
|
43
|
+
|
44
|
+
This offers the powerful advantage of having text-based source files that are
|
45
|
+
themselves very highly legible. For example, this opening of this section of
|
46
|
+
the page was written so:
|
47
|
+
~~~
|
48
|
+
|
49
|
+
As you can see, it’s highly legible and uses a lot of the same text formatting
|
50
|
+
idioms with which you are doubtlessly already aware.
|
51
|
+
|
52
|
+
|
53
|
+
Markdown Syntax and Engine
|
54
|
+
--------------------------
|
55
|
+
|
56
|
+
There are several “flavors” of Markdown, but they all adhere to John Gruber’s
|
57
|
+
original as a base line and extend it in various ways. For the most part, they
|
58
|
+
are all fairly well compatible.
|
59
|
+
|
60
|
+
_Middlemac_ uses [_Kramdown_](http://kramdown.gettalong.org/) as its Markdown
|
61
|
+
engine because that’s what _Middleman_ uses by default. You can read about all
|
62
|
+
its features an syntax on its
|
63
|
+
[documentation page](http://kramdown.gettalong.org/documentation.html).
|
@@ -0,0 +1,54 @@
|
|
1
|
+
---
|
2
|
+
title: Front Matter
|
3
|
+
blurb: <em>Middleman</em> (and hence <em>Middlemac</em>) source files use
|
4
|
+
front matter to control many features of pages.
|
5
|
+
layout: template-logo-medium
|
6
|
+
---
|
7
|
+
<%= md_links %>
|
8
|
+
<%= md_images %>
|
9
|
+
|
10
|
+
<%= current_page.data.title %>
|
11
|
+
==============================
|
12
|
+
|
13
|
+
<%= current_page.data.blurb %>
|
14
|
+
|
15
|
+
Front matter is a document header section that contains key-value data that
|
16
|
+
applies to a page. This data can be referred to later for output or control.
|
17
|
+
For example, the title of this page was specified with a `title:` key in the
|
18
|
+
source document’s front matter, and its layout was specified with a `layout:`
|
19
|
+
key.
|
20
|
+
|
21
|
+
Front matter can also control page order (a feature of _Middleman_’s
|
22
|
+
`middleman-pagegroups` gem), inclusion of pages for targets/features (provided
|
23
|
+
by the `middleman-targets` gem), and more.
|
24
|
+
|
25
|
+
Here’s this document’s front matter:
|
26
|
+
|
27
|
+
~~~ yaml
|
28
|
+
---
|
29
|
+
title: Front Matter
|
30
|
+
blurb: <em>Middleman</em> (and hence <em>Middlemac</em>) source files use
|
31
|
+
front matter to control a lot of features of pages.
|
32
|
+
layout: template-logo-medium
|
33
|
+
---
|
34
|
+
~~~
|
35
|
+
|
36
|
+
## Declaring Front Matter
|
37
|
+
|
38
|
+
Front matter is defined as being delimited at the beginning and end with a line
|
39
|
+
consisting of a series of three hyphens (`-`), and this block must appear at the
|
40
|
+
top of a document.
|
41
|
+
|
42
|
+
Although specific front matter keys are discussed elsewhere in this
|
43
|
+
documentation it’s worth pointing out that the `title:` and `:blurb` are used
|
44
|
+
extensively in _Middlemac_. For example all of the automatic navigation
|
45
|
+
features are built using this data, meaning that this data need only appear
|
46
|
+
once, here, in this very document.
|
47
|
+
|
48
|
+
## Markdown in Front Matter
|
49
|
+
|
50
|
+
You may have noticed that the front matter contains HTML. Because the front
|
51
|
+
matter consists of data rather than content specifically targeted for display,
|
52
|
+
it is not processed by the Markdown engine. Front matter is one of the very
|
53
|
+
few places in a _Middlemac_ project where you have to revert to using HTML.
|
54
|
+
|
@@ -0,0 +1,93 @@
|
|
1
|
+
---
|
2
|
+
title: Middleman
|
3
|
+
blurb: <em>Middleman</em> is the engine that makes <em>Middlemac</em> possible.
|
4
|
+
It’s critical to know a little bit about this tool.
|
5
|
+
layout: template-logo-medium
|
6
|
+
---
|
7
|
+
<%= md_links %>
|
8
|
+
<%= md_images %>
|
9
|
+
|
10
|
+
<%= current_page.data.title %>
|
11
|
+
==============================
|
12
|
+
|
13
|
+
<%= current_page.data.blurb %>
|
14
|
+
|
15
|
+
_Middleman_ is a [static site generator using all the shortcuts and tools in
|
16
|
+
modern web development](http://middlemanapp.com). It was intended to have been
|
17
|
+
a tool to create static websites with most of the dynamism of websites running
|
18
|
+
on technologies such as PHP and Ruby on Rails. Static websites are fast and
|
19
|
+
secure.
|
20
|
+
|
21
|
+
Apple Help Books, in their essence, are static websites.
|
22
|
+
|
23
|
+
_Middleman_ with the help of _Middlemac_ is the perfect tool in your help file
|
24
|
+
development toolchain.
|
25
|
+
|
26
|
+
Builder _and_ server
|
27
|
+
--------------------
|
28
|
+
_Middleman_ doesn’t merely build final output; it includes a non-configuration
|
29
|
+
server that makes it much easier to develop your website or help book. Features
|
30
|
+
such as live reload mean that when you change your source file, the site in
|
31
|
+
your web browser will update automatically.
|
32
|
+
|
33
|
+
The server captures changes to most of your source files. However in certain
|
34
|
+
circumstances you may have to restart the server to recognize certain changes,
|
35
|
+
such as new directories in your source code.
|
36
|
+
|
37
|
+
|
38
|
+
Basic concepts
|
39
|
+
--------------
|
40
|
+
_Middleman_’s basic concepts are these:
|
41
|
+
|
42
|
+
- Organize your site in a source directory that mirrors the desired structure
|
43
|
+
on the server (or in our case, in our help book).
|
44
|
+
- Add file extensions to the source files to indicate the type of pre-processing
|
45
|
+
that you want to perform on each of them.
|
46
|
+
- Provide the ability to include partials and use helpers to improve your
|
47
|
+
content development productivity, while keeping yourself DRY.
|
48
|
+
- Provide the ability to use templates and layouts to bring uniformity to your
|
49
|
+
website (in our case, to your help book).
|
50
|
+
- Act as a server in developer mode, building content dynamically as you develop
|
51
|
+
it.
|
52
|
+
- Build final output, ready to use wherever you need it.
|
53
|
+
|
54
|
+
|
55
|
+
Using _Middleman_
|
56
|
+
-----------------
|
57
|
+
|
58
|
+
Because _Middlemac_ is an extension to _Middleman_, it’s worth noting that you
|
59
|
+
will actually execute `middleman` to serve or to build your projects.
|
60
|
+
|
61
|
+
To start the built-in server in order to preview your work, simply do:
|
62
|
+
|
63
|
+
~~~ bash
|
64
|
+
bundle exec middleman serve --target free
|
65
|
+
~~~
|
66
|
+
|
67
|
+
Instructions for accessing the server (the address and port) will be reported to
|
68
|
+
you.
|
69
|
+
|
70
|
+
Note, too, that `--target` specifies an option; the example about would serve
|
71
|
+
the `free` target.
|
72
|
+
|
73
|
+
To build the `pro` target, you would do this:
|
74
|
+
|
75
|
+
~~~ bash
|
76
|
+
bundle exec middleman build --target pro
|
77
|
+
~~~
|
78
|
+
|
79
|
+
And if you wanted to build every target at once, simply this:
|
80
|
+
|
81
|
+
~~~ bash
|
82
|
+
bundle exec middleman build_all
|
83
|
+
~~~
|
84
|
+
|
85
|
+
|
86
|
+
More about _Middleman_
|
87
|
+
----------------------
|
88
|
+
|
89
|
+
If you stick to the conventions it’s not necessary to become an expert in
|
90
|
+
_Middleman_. However as you grow your skills you may want to consider using
|
91
|
+
some of its more advanced features or even add your own extensions. You can
|
92
|
+
access _Middleman_’s full documentation on its
|
93
|
+
[documentation website](https://middlemanapp.com/basics/install/).
|
@@ -0,0 +1,67 @@
|
|
1
|
+
---
|
2
|
+
title: Ruby
|
3
|
+
blurb: As the language that powers <em>Middlemac</em>, it’s worth taking a
|
4
|
+
short look at the Ruby language.
|
5
|
+
layout: template-logo-medium
|
6
|
+
---
|
7
|
+
<%= md_links %>
|
8
|
+
<%= md_images %>
|
9
|
+
|
10
|
+
<%= current_page.data.title %>
|
11
|
+
==============================
|
12
|
+
|
13
|
+
<%= current_page.data.blurb %>
|
14
|
+
|
15
|
+
[Ruby](https://www.ruby-lang.org/en/) is the language that _Middlemac_,
|
16
|
+
_Middleman_, and many of the others tools are written with. You do not have to
|
17
|
+
learn Ruby to take advantage of _Middlemac_, although some ability to work with
|
18
|
+
it will be invaluable to you.
|
19
|
+
|
20
|
+
Ruby may surprise you
|
21
|
+
---------------------
|
22
|
+
|
23
|
+
If you’re a software developer, then it’s highly likely that you will be able to
|
24
|
+
read most Ruby code immediately. Coming from an Objective-C or Swift background,
|
25
|
+
these are a few things that may surprise you.
|
26
|
+
|
27
|
+
### Symbols
|
28
|
+
Ruby has a type of identifier called a `symbol`. They are used quite extensively
|
29
|
+
and look like `:this_symbol`. As identifiers and not variables, you can’t assign
|
30
|
+
values to them. Their value is themselves, though they have useful string
|
31
|
+
representations (`:this_symbol.to_s`). You can even get the symbol
|
32
|
+
representation of `'this_string'.to_sym`. Because they're unique, they make
|
33
|
+
excellent array/hash keys and excellent, guaranteed unique values.
|
34
|
+
|
35
|
+
### Everything is an object
|
36
|
+
Everything is an object, including what are fundamental datatypes in other
|
37
|
+
languages. Need to convert the integer `i` to a float? It’s as easy as
|
38
|
+
`i.to_f`.
|
39
|
+
|
40
|
+
### Everything has a return value
|
41
|
+
In Ruby you don’t require `return value`, or `result := value`, or
|
42
|
+
`function_name = value`. Just `value`, alone, will return its value. Even `if`
|
43
|
+
statements return values:
|
44
|
+
|
45
|
+
~~~ ruby
|
46
|
+
result = if answer == 'yes'
|
47
|
+
"The answer as affirmative."
|
48
|
+
else
|
49
|
+
"The answer was something else."
|
50
|
+
end
|
51
|
+
~~~
|
52
|
+
|
53
|
+
This example assigns the appropriate string to the variable `result`.
|
54
|
+
|
55
|
+
|
56
|
+
Just enough Ruby
|
57
|
+
----------------
|
58
|
+
To work effectively with _Middlemac_ you’ll only have to learn enough Ruby to
|
59
|
+
do a few simple things:
|
60
|
+
|
61
|
+
- Set variables in the `config.rb` file.
|
62
|
+
- Use a few helper functions from within files, e.g., `partial 'my_file'`.
|
63
|
+
- Use conditionals, if you want them. You know: simply `if/else/end`, or even
|
64
|
+
`unless/else/end`.
|
65
|
+
|
66
|
+
Examples of these last two points can be seen when we take a look at
|
67
|
+
[File Types][filetypes_skill].
|
@@ -0,0 +1,136 @@
|
|
1
|
+
---
|
2
|
+
title: Ruby’s Ecosystem
|
3
|
+
blurb: Ruby has a huge ecosystem the can be confusing to new users. This
|
4
|
+
article makes a very brief introduction that should shorten the learning
|
5
|
+
curve.
|
6
|
+
layout: template-logo-medium
|
7
|
+
---
|
8
|
+
<%= md_links %>
|
9
|
+
<%= md_images %>
|
10
|
+
|
11
|
+
<%= current_page.data.title %>
|
12
|
+
==============================
|
13
|
+
|
14
|
+
<%= current_page.data.blurb %>
|
15
|
+
|
16
|
+
Gems
|
17
|
+
----
|
18
|
+
|
19
|
+
“Gems” are packages of Ruby or compiled code in a standard format that serve as
|
20
|
+
extensions or library additions to Ruby. _Middlemac_ is a system consisting of
|
21
|
+
the `middlemac` gem, among others.
|
22
|
+
|
23
|
+
By default Ruby is configured to fetch gems from
|
24
|
+
[rubygems.org](https://rubygems.org/), which is convenient as long as you are
|
25
|
+
connected to the internet.
|
26
|
+
|
27
|
+
Gems, as software, have versions and can have dependencies on other gems. This
|
28
|
+
can lead to dependency hell when multiple versions of multiple gems are
|
29
|
+
installed having a clash due to mixed dependencies. Luckily this has been mostly
|
30
|
+
solved via the use of Bundler.
|
31
|
+
|
32
|
+
Bundler
|
33
|
+
-------
|
34
|
+
|
35
|
+
Bundler is a gem version management system that ensures that the correct gem
|
36
|
+
version is used on a per-project basis, as specified in the `Gemfile` and locked
|
37
|
+
in `Gemfile.lock` (more on these below).
|
38
|
+
|
39
|
+
Using bundler will ensure that gem versions of known compatibility will be used.
|
40
|
+
For example, _Middlemac_ requires _Middleman_ version 4.1.7 or higher, which
|
41
|
+
itself requires other gems of specific versions. Bundler will ensure that when
|
42
|
+
building a _Middlemac_ project, _only_ the correct gems are used.
|
43
|
+
|
44
|
+
When you see a command such as:
|
45
|
+
|
46
|
+
~~~ bash
|
47
|
+
bundle exec middleman build
|
48
|
+
~~~
|
49
|
+
|
50
|
+
…it means that Bundler will execute the `middleman` gem, and will take
|
51
|
+
responsibility for ensuring the correct gem versions are used. If we want to
|
52
|
+
leave it up to chance, we might try this:
|
53
|
+
|
54
|
+
~~~ bash
|
55
|
+
middleman build
|
56
|
+
~~~
|
57
|
+
|
58
|
+
…and this might work, or it might not. Without using Bundler, the default
|
59
|
+
versions of gems installed on your system will be used, and they might not be
|
60
|
+
compatible the default version of `middleman`.
|
61
|
+
|
62
|
+
Ruby projects, including _Middlemac_ help book projects, specify gem versions
|
63
|
+
using a file in the project directory called `Gemfile`.
|
64
|
+
|
65
|
+
|
66
|
+
`Gemfile` and `Gemfile.lock`
|
67
|
+
----------------------------
|
68
|
+
|
69
|
+
Your _Middlemac_ project contains this file to specify to Bundler which versions
|
70
|
+
of Ruby gems should be used. In general you don't have to bother with this file
|
71
|
+
at all. However if you become more advanced and want to use other gems, you’ll
|
72
|
+
have to dive into this file eventually.
|
73
|
+
|
74
|
+
This file contains gems and the versions that are allowed. For example,
|
75
|
+
this documentation project’s `Gemfile` contains something similar to this:
|
76
|
+
|
77
|
+
~~~ ruby
|
78
|
+
gem 'middleman-pagegroups', '~> 1.0.3'
|
79
|
+
~~~
|
80
|
+
|
81
|
+
This declaration tells Bundler that `middleman-pagegroups` is a gem that is
|
82
|
+
required for this project, and that any version greater than 1.0.3 is allowed,
|
83
|
+
but only in the `1.0.x` series. The `~>` is called a “pessimistic operator” and
|
84
|
+
is used if we don’t trust the `1.1.x` will break nothing.
|
85
|
+
|
86
|
+
Other operators are available, too, of course, and are a simple web search away.
|
87
|
+
|
88
|
+
The file `Gemfile.lock` is generated automatically by Bundler, and you should
|
89
|
+
never, ever modify this file yourself (you should also exclude it from version
|
90
|
+
control). This file is the file that indicates to Bundler the _exact_ versions
|
91
|
+
of Gems that will be used. It ensures that the set of gems always stays
|
92
|
+
consistent (even if you update gems) unless you deliberately want it to do
|
93
|
+
otherwise.
|
94
|
+
|
95
|
+
### `bundle install`
|
96
|
+
|
97
|
+
When you `cd` into a project directory, you can:
|
98
|
+
|
99
|
+
~~~ bash
|
100
|
+
bundle install
|
101
|
+
~~~
|
102
|
+
|
103
|
+
This tells Bundler to check the `Gemfile` and install any gems that are required
|
104
|
+
but are missing, typically from [rubygems.org](https://rubygems.org/). After
|
105
|
+
installing the gems Bundler will also update the `Gemfile.lock`, thereby
|
106
|
+
freezing the versions to be used in your project.
|
107
|
+
|
108
|
+
What happens if I install a newer version of a Ruby gem? For example, if the
|
109
|
+
`Gemfile` is configured to use `middleman-pagegroups` 1.0.3 or above, and I’ve
|
110
|
+
been building with it for weeks, and then update my gem to 1.0.4? In this case,
|
111
|
+
as long as 1.0.3 is still installed on your system, Bundler will still use this
|
112
|
+
version.
|
113
|
+
|
114
|
+
You’ll either have to update the `Gemfile` with 1.0.4 and then `bundle install`
|
115
|
+
again, or…
|
116
|
+
|
117
|
+
### `bundle update`
|
118
|
+
|
119
|
+
This tells Bundler to install newer versions of all of your Gems, if available,
|
120
|
+
and within the pessimistic version checks in the `Gemfile`, and also updates
|
121
|
+
`Gemfile.lock` so that newer versions of the gems will be used.
|
122
|
+
|
123
|
+
~~~ bash
|
124
|
+
bundle update
|
125
|
+
~~~
|
126
|
+
|
127
|
+
|
128
|
+
`config.rb`
|
129
|
+
-----------
|
130
|
+
|
131
|
+
Nearly every Ruby project, including your _Middlemac_ help book project, follows
|
132
|
+
the convention of configuration via a `config.rb` file in the root level of your
|
133
|
+
project directory.
|
134
|
+
|
135
|
+
Information specific to _Middlemac_’s `config.rb` is available in the
|
136
|
+
[appropriate section][setup-index] of this documentation.
|
@@ -0,0 +1,165 @@
|
|
1
|
+
---
|
2
|
+
title: File Types
|
3
|
+
blurb: <em>Middleman</em> uses several filetypes to get its job done. An
|
4
|
+
understanding of their differences is important to your successful use
|
5
|
+
of <em>Middlemac</em>.
|
6
|
+
layout: template-logo-medium
|
7
|
+
---
|
8
|
+
<%= md_links %>
|
9
|
+
<%= md_images %>
|
10
|
+
|
11
|
+
<%= current_page.data.title %>
|
12
|
+
==============================
|
13
|
+
|
14
|
+
<%= current_page.data.blurb %>
|
15
|
+
|
16
|
+
Although you can use static `.html` files to build your help book, you would be
|
17
|
+
sacrificing a lot of _Middleman_’s utility to do so, because static html is
|
18
|
+
simply copied to your build directory as-is, with no opportunity to take
|
19
|
+
advantages of the infrastructure that _Middleman_ and _Middlemac_ offer you.
|
20
|
+
Instead you will probably chose a combination of `.haml`, `.md`, and `.erb`
|
21
|
+
files, and even combinations of them in a single file!
|
22
|
+
|
23
|
+
Filetype extensions
|
24
|
+
-------------------
|
25
|
+
As distributed, _Middleman_ (and thus _Middlemac_) understand several file type
|
26
|
+
extensions and will process them accordingly.
|
27
|
+
|
28
|
+
`.html`
|
29
|
+
|
30
|
+
: HTML files are regarded as already processed, and they will be copied
|
31
|
+
verbatim to the build directory.
|
32
|
+
|
33
|
+
`.erb`
|
34
|
+
|
35
|
+
: Embedded Ruby files are files that contain Ruby code embedded in them. This
|
36
|
+
is useful for including simple if/else logic and including partials and
|
37
|
+
using helpers. Ruby code is delimited within `<%% %>` (generates no output)
|
38
|
+
or `<%%= %>` (does generate output) tags.
|
39
|
+
|
40
|
+
For example, `<%%= "Hello, #{name}! %>` outputs a string into a generated
|
41
|
+
HTML document, and you will encounter several more examples within this
|
42
|
+
documentation.
|
43
|
+
|
44
|
+
`.haml`
|
45
|
+
|
46
|
+
: The “HTML abstraction markup language” excels at enforcing structure in your
|
47
|
+
HTML-target documents, and is clutter-free and easy to read. It supports
|
48
|
+
many built-in filters for including content in Ruby, Markdown, raw source
|
49
|
+
code, and more. _Middlemac_’s templates, layouts, and partials are written
|
50
|
+
in HAML.
|
51
|
+
|
52
|
+
You can learn more about HAML on [its website](http://haml.info/).
|
53
|
+
|
54
|
+
`.md`
|
55
|
+
|
56
|
+
: Markdown is a plain-text formatting syntax that is exceedingly easy to read
|
57
|
+
and write in its source form, and mostly internally logically consistent.
|
58
|
+
_Middlemac_ uses [kramdown](http://kramdown.gettalong.org/) as its
|
59
|
+
text-to-HTML engine, and offers several useful features not found in
|
60
|
+
plain vanilla Markdown.
|
61
|
+
|
62
|
+
`.scss`
|
63
|
+
|
64
|
+
: “Sassy” CSS files use SASS markup and render into standard `.css` files.
|
65
|
+
You can use SASS as you see fit; it’s fully compatible with CSS, and all
|
66
|
+
CSS is valid SCSS. Why “SASS” and “SCSS”? SASS is the name of the project
|
67
|
+
as well as an older, non-CSS compatible format. So, SASS is the project,
|
68
|
+
and SCSS is the file format.
|
69
|
+
|
70
|
+
You can learn more about SASS on [its website](http://sass-lang.com/).
|
71
|
+
|
72
|
+
|
73
|
+
Files with a leading underscore
|
74
|
+
-------------------------------
|
75
|
+
|
76
|
+
Regardless of the file type, files with a leading underscore (“\_”) will be
|
77
|
+
processed by _Middleman_ (if it’s a type that _Middleman_ recognizes), but
|
78
|
+
_will not_ be copied to your build directory. An example of this type of file
|
79
|
+
is a partial, which we want _Middleman_ to process and make ready for use, but
|
80
|
+
which we don’t want copied to the output directory because its content will be
|
81
|
+
included in other files that need it.
|
82
|
+
|
83
|
+
|
84
|
+
Filetype chaining
|
85
|
+
-----------------
|
86
|
+
_This_ is what’s cool about the _Middleman_ build system: files are chained
|
87
|
+
and processed multiple times by multiple processing systems, with the end
|
88
|
+
result of producing the final file format. What does this mean? Let’s look at
|
89
|
+
this example:
|
90
|
+
|
91
|
+
`hello_world.html.erb`
|
92
|
+
|
93
|
+
Middleman will produce a file (that’s then copied to the build output) named
|
94
|
+
`hello_world.html` after processing it as an `.erb` file. For example:
|
95
|
+
|
96
|
+
~~~~ erb
|
97
|
+
<body>
|
98
|
+
<p><%%= hello_world_function %></p>
|
99
|
+
</body>
|
100
|
+
~~~~
|
101
|
+
|
102
|
+
Will produce a `hello_world.html` file containing this (assuming that
|
103
|
+
`hello_world_function` exists):
|
104
|
+
|
105
|
+
~~~~ erb
|
106
|
+
<body>
|
107
|
+
<p>Hello, world!</p>
|
108
|
+
</body>
|
109
|
+
~~~~
|
110
|
+
|
111
|
+
What if we try this?
|
112
|
+
|
113
|
+
`hello_world.html.md.erb`
|
114
|
+
|
115
|
+
~~~~ markdown
|
116
|
+
# Introduction
|
117
|
+
<%%= hello_world_function %>
|
118
|
+
~~~~
|
119
|
+
|
120
|
+
Accounting for removing all of the HTML head section, etc., we end up with:
|
121
|
+
|
122
|
+
~~~~ html
|
123
|
+
<body>
|
124
|
+
<h1>Introduction</h1>
|
125
|
+
<p>Hello, world!</p>
|
126
|
+
</body>
|
127
|
+
~~~~
|
128
|
+
|
129
|
+
It’s important to understand that file type chaining works from right to left.
|
130
|
+
The last extension is processed first, then the penultimate extension, then the
|
131
|
+
antepenultimate extension, etc.
|
132
|
+
|
133
|
+
If you try to use a file named `hello_world.html.erb.md` then the results will
|
134
|
+
be unexpected. Markdown will encounter `<%% %>` tag-sets and attempt to render
|
135
|
+
them in HTML. When the ERB processor is passed the file, it will no longer
|
136
|
+
encounter the tag-sets with the embedded Ruby.
|
137
|
+
|
138
|
+
|
139
|
+
HAML rarely needs to be chained
|
140
|
+
-------------------------------
|
141
|
+
|
142
|
+
HAML includes filters and support for Ruby directly, and so it rarely needs to
|
143
|
+
be chained. For example:
|
144
|
+
|
145
|
+
~~~~ haml
|
146
|
+
%h1 Introduction
|
147
|
+
%p= hello_world_function
|
148
|
+
- if true == true
|
149
|
+
%p Well, duh.
|
150
|
+
%p
|
151
|
+
:markdown
|
152
|
+
_Today_a computer told me “Hello, world.” It was **only** addressing me,
|
153
|
+
and so I don’t know why it addressed me as the whole world.
|
154
|
+
~~~~
|
155
|
+
|
156
|
+
The use of `=` in the `%p=` tag is a flag that indicates HAML should be
|
157
|
+
expecting Ruby code. Likewise, the solitary `-` indicates Ruby code and will not
|
158
|
+
generate output. The use of `:markdown` indicates that Markdown-formatted text
|
159
|
+
will be used.
|
160
|
+
|
161
|
+
This might make you think that HAML is a Swiss Army knife, and why bother with
|
162
|
+
other filetypes? Test it: once you’re familiar with the all of the basics,
|
163
|
+
try coming back to this page’s source and convert if from `.html.md.erb` to
|
164
|
+
`.html.haml`, and then choose whichever works for you.
|
165
|
+
|