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,17 @@
|
|
1
|
+
---
|
2
|
+
title: Middlemac Project
|
3
|
+
layout: template-logo-large
|
4
|
+
xhtml: true
|
5
|
+
---
|
6
|
+
|
7
|
+
<%= product_name %>
|
8
|
+
===================
|
9
|
+
|
10
|
+
This is a blank project. It's got a couple of groups already set up.
|
11
|
+
|
12
|
+
* * *
|
13
|
+
|
14
|
+
<%= nav_legitimate_children %>
|
15
|
+
|
16
|
+
* * *
|
17
|
+
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,51 @@
|
|
1
|
+
##############################################################################
|
2
|
+
# Gemfile (and Gemfile.lock)
|
3
|
+
#
|
4
|
+
# This file contains the Ruby gem manifest for Middlemac's dependencies.
|
5
|
+
#
|
6
|
+
# To ensure that the correct gems are installed, do `bundle install`.
|
7
|
+
#
|
8
|
+
# Note that Gemfile.lock is under version control; `bundle install` will
|
9
|
+
# ensure that the correct gem versions are used when this repository is
|
10
|
+
# checked out. To update to newer gems and update Gemfile.lock, use
|
11
|
+
# `bundle update`.
|
12
|
+
##############################################################################
|
13
|
+
|
14
|
+
source 'https://rubygems.org'
|
15
|
+
|
16
|
+
|
17
|
+
#######################################
|
18
|
+
# Middlemac, natch.
|
19
|
+
#######################################
|
20
|
+
gem 'middlemac', '~> 2.0.0'
|
21
|
+
gem 'middlemac-extras', '~> 1.0.8'
|
22
|
+
gem 'middleman-targets', '~> 1.0.7'
|
23
|
+
gem 'middleman-pagegroups', '~> 1.0.4'
|
24
|
+
|
25
|
+
|
26
|
+
#######################################
|
27
|
+
# Core gems
|
28
|
+
#######################################
|
29
|
+
gem 'middleman', '~> 4.1.7'
|
30
|
+
gem 'middleman-core'
|
31
|
+
gem 'middleman-cli'
|
32
|
+
gem 'middleman-livereload' # Live-reloading plugin
|
33
|
+
gem 'middleman-syntax' # Syntax Highlighting
|
34
|
+
|
35
|
+
|
36
|
+
#######################################
|
37
|
+
# Style and fonts
|
38
|
+
#######################################
|
39
|
+
gem 'middleman-compass'
|
40
|
+
gem 'font-awesome-sass'
|
41
|
+
|
42
|
+
|
43
|
+
#######################################
|
44
|
+
# Utilities and tools
|
45
|
+
#######################################
|
46
|
+
|
47
|
+
|
48
|
+
#######################################
|
49
|
+
# Core gems
|
50
|
+
#######################################
|
51
|
+
gem 'tzinfo-data', platforms: [:mswin, :mingw] # Time zone data for Windows
|
@@ -0,0 +1,309 @@
|
|
1
|
+
################################################################################
|
2
|
+
# config.rb
|
3
|
+
# Configure Middleman to generate Apple HelpBook containers for multiple
|
4
|
+
# targets.
|
5
|
+
################################################################################
|
6
|
+
|
7
|
+
##########################################################################
|
8
|
+
# Targets Configuration
|
9
|
+
# Middlemac is capable of building multiple targets for variants of your
|
10
|
+
# application using the `middleman-targets` gem. Activate it and change
|
11
|
+
# the option values here to suit your needs. Note that middleman-targets
|
12
|
+
# adds configuration parameters to the base Middleman application; these
|
13
|
+
# are *not* extension options.
|
14
|
+
##########################################################################
|
15
|
+
activate :MiddlemanTargets
|
16
|
+
|
17
|
+
# Set the default target, i.e, the target that is used automatically when you
|
18
|
+
# `middleman build` or `middleman server` without the `targets` CLI option.
|
19
|
+
config[:target] = :pro
|
20
|
+
|
21
|
+
# Targets
|
22
|
+
|
23
|
+
# NOTE: Ruby has a type of variable called a `symbol`, which are used below
|
24
|
+
# quite extensively and look like :this_symbol. Except they’re not really
|
25
|
+
# variables; you can’t assign values to them. Their value is themselves,
|
26
|
+
# though they have useful string representations (:this_symbol.to_s). You
|
27
|
+
# can even get the symbol representation of this_string.to_sym. Because
|
28
|
+
# they're unique, they make excellent array/hash keys and excellent,
|
29
|
+
# guaranteed unique values.
|
30
|
+
|
31
|
+
# :CFBundleID
|
32
|
+
# Just as different versions of your app must have different bundle identifiers
|
33
|
+
# so the OS can distinguish them, their help files must have unique bundle IDs,
|
34
|
+
# too. Your application specifies the help file `CFBundleID` in its
|
35
|
+
# `CFBundleHelpBookName` entry. Therefore for each target, ensure that your
|
36
|
+
# application has a `CFBundleHelpBookName` that matches the `CFBundleID` that
|
37
|
+
# you will set here.
|
38
|
+
|
39
|
+
# :HPDBookIconPath
|
40
|
+
# If specified a target-specific icon will be used as the help book icon by
|
41
|
+
# Apple’s help viewer. This path must be relative to the location of the
|
42
|
+
# `Resources` directory per Apple’s specification. If `nil` (or not present)
|
43
|
+
# then the default `shared/icon_32x32@2x.png` will be used.
|
44
|
+
|
45
|
+
# :CFBundleName
|
46
|
+
# This value will be used for correct .plists and .strings setup, and will
|
47
|
+
# determine final .help directory name. All targets should use the same
|
48
|
+
# :CFBundleName. Built targets will be named `CFBundleName (target).help`.
|
49
|
+
# This is *not* intended to be a product name, which is defined below.
|
50
|
+
|
51
|
+
# :ProductName
|
52
|
+
# You can specify different product names for each build target. The product
|
53
|
+
# name for the current target will be available via the `product_name` helper.
|
54
|
+
|
55
|
+
# :ProductVersion
|
56
|
+
# You can specify different product versions for each build target. The
|
57
|
+
# product version for the current target will be available via the
|
58
|
+
# `product_version` helper.
|
59
|
+
|
60
|
+
# :ProductURI
|
61
|
+
# You can specify different product URIs for each build target. The URI
|
62
|
+
# for the current target will be available via the `product_uri` helper.
|
63
|
+
|
64
|
+
# (other)
|
65
|
+
# You can specify additional .plist and .strings keys here, too. Have a look
|
66
|
+
# at `Info.plist.erb` and `InfoPlist.strings.erb`; simply use the exact key
|
67
|
+
# name and they will be supported. This is probably unneeded unless you are
|
68
|
+
# implementing advanced help book features.
|
69
|
+
|
70
|
+
# :Features
|
71
|
+
# A hash of features that a particular target supports or doesn't support.
|
72
|
+
# The `has_feature` function and several helpers will use the true/false value
|
73
|
+
# of these features in order to conditionally include content.
|
74
|
+
|
75
|
+
config[:targets] = {
|
76
|
+
:free =>
|
77
|
+
{
|
78
|
+
:CFBundleID => 'com.sample.project.free.help',
|
79
|
+
:HPDBookIconPath => nil,
|
80
|
+
:CFBundleName => 'New Project',
|
81
|
+
:ProductName => 'New Project',
|
82
|
+
:ProductVersion => '2.0.0',
|
83
|
+
:ProductURI => 'http://www.sample.com',
|
84
|
+
:features =>
|
85
|
+
{
|
86
|
+
:feature_advertise_pro => true,
|
87
|
+
:feature_performs_miracles => false,
|
88
|
+
:feature_insults_user => true,
|
89
|
+
:feature_shows_pink_rectangle => true,
|
90
|
+
}
|
91
|
+
},
|
92
|
+
|
93
|
+
:pro =>
|
94
|
+
{
|
95
|
+
:CFBundleID => 'com.sample.project.pro.help',
|
96
|
+
:HPDBookIconPath => nil,
|
97
|
+
:CFBundleName => 'New Project',
|
98
|
+
:ProductName => 'New Project Pro',
|
99
|
+
:ProductVersion => '2.0.0',
|
100
|
+
:ProductURI => 'http://www.sample.com',
|
101
|
+
:features =>
|
102
|
+
{
|
103
|
+
:feature_advertise_pro => false,
|
104
|
+
:feature_performs_miracles => true,
|
105
|
+
:feature_insults_user => false,
|
106
|
+
:feature_shows_pink_rectangle => true,
|
107
|
+
}
|
108
|
+
},
|
109
|
+
|
110
|
+
} # targets
|
111
|
+
|
112
|
+
# By enabling :target_magic_images, target specific images will be used instead
|
113
|
+
# of the image you specify if it'ss prefixed with :target_magic_word. For
|
114
|
+
# example, you might request "all-my_image.png", and "pro-my_image.png" (if it
|
115
|
+
# exists) will be used in your :pro target instead.
|
116
|
+
#
|
117
|
+
# Important: when this is enabled, images from *other* targets will *not* be
|
118
|
+
# included in the build! In the example above, *any* image prefixed with "free-"
|
119
|
+
# would not be included in the output directory.
|
120
|
+
config[:target_magic_images] = true
|
121
|
+
config[:target_magic_word] = 'all'
|
122
|
+
|
123
|
+
|
124
|
+
################################################################
|
125
|
+
# Page Groups Configuration
|
126
|
+
# Middlemac uses the `middleman-pagegroups` gem in order to
|
127
|
+
# automate nearly all of the navigation in your help book
|
128
|
+
# project.
|
129
|
+
################################################################
|
130
|
+
activate :MiddlemanPageGroups do |config|
|
131
|
+
|
132
|
+
# Indicate whether or not numeric file name prefixes used for sorting
|
133
|
+
# pages should be eliminated during output. This results in cleaner
|
134
|
+
# URI's. Helpers such as `page_name` and Middleman helpers such as
|
135
|
+
# `page_class` will reflect the pretty name.
|
136
|
+
config.strip_file_prefixes = true
|
137
|
+
|
138
|
+
# Indicates whether or not Middleman's built-in `page_class` helper is
|
139
|
+
# extended to include the page_group and page_name.
|
140
|
+
config.extend_page_class = true
|
141
|
+
|
142
|
+
# the following options provide defaults for the built-in helpers and
|
143
|
+
# sample partials. They'll also work in your own partials and helpers.
|
144
|
+
|
145
|
+
config.nav_breadcrumbs_class = 'breadcrumbs'
|
146
|
+
config.nav_breadcrumbs_alt_class = 'breadcrumbs'
|
147
|
+
config.nav_breadcrumbs_alt_label = 'Current page'
|
148
|
+
config.nav_brethren_class = 'table_contents'
|
149
|
+
config.nav_brethren_index_class = 'related-topics'
|
150
|
+
config.nav_legitimate_children_class = 'table_contents'
|
151
|
+
config.nav_prev_next_class = 'navigate_prev_next'
|
152
|
+
config.nav_prev_next_label_prev = 'Previous'
|
153
|
+
config.nav_prev_next_label_next = 'Next'
|
154
|
+
config.nav_toc_index_class = 'help_map'
|
155
|
+
|
156
|
+
end
|
157
|
+
|
158
|
+
|
159
|
+
################################################################
|
160
|
+
# Extras Configuration
|
161
|
+
# Middlemac uses the `middlemac-extras` gem in order to
|
162
|
+
# provide other useful tools. They can be configured here.
|
163
|
+
################################################################
|
164
|
+
activate :MiddlemacExtras do |config|
|
165
|
+
|
166
|
+
# If set to true, then the enhanced image_tag helper will be used
|
167
|
+
# to include @2x srcset automatically, if the image asset exists.
|
168
|
+
config.retina_srcset = true
|
169
|
+
|
170
|
+
# If set to true then the `image_tag` helper will work for images even
|
171
|
+
# if you don't specify an extension, but only if a file exists on disk
|
172
|
+
# that has one of the extensions in :img_auto_extensions_order.
|
173
|
+
config.img_auto_extensions = true
|
174
|
+
|
175
|
+
# Set this to an array of extensions in the order of precedence for
|
176
|
+
# using `image_tag` without file extensions.
|
177
|
+
config.img_auto_extensions_order = %w(.svg .png .jpg .jpeg .gif .tiff .tif)
|
178
|
+
|
179
|
+
end
|
180
|
+
|
181
|
+
|
182
|
+
################################################################
|
183
|
+
# Configuration
|
184
|
+
# Change the option values to suit your needs.
|
185
|
+
################################################################
|
186
|
+
activate :Middlemac do |options|
|
187
|
+
|
188
|
+
# Directory where finished .help bundle should go. It should be relative
|
189
|
+
# to this file, or make nil to leave in this help project directory. The
|
190
|
+
# *actual* output directory will be an Apple Help bundle at this location
|
191
|
+
# named in the form `#{CFBundleName} (target).help`. You might want to target
|
192
|
+
# the `Resources` directory of your XCode project so that your XCode project
|
193
|
+
# is always up to date.
|
194
|
+
options.Help_Output_Location = nil
|
195
|
+
|
196
|
+
# Indicates the name of the breadcrumbs helper to use for breadcrumbs.
|
197
|
+
# Built-in breadcrumbs are "nav_breadcrumbs" and "nav_breadcrumbs_alt".
|
198
|
+
# Change to `nil` to disable breadcrumbs completely.
|
199
|
+
options.Breadcrumbs = 'nav_breadcrumbs'
|
200
|
+
|
201
|
+
# This was removed in Middleman version 4.0. We are reintroducing it
|
202
|
+
# as a Middlemac feature.
|
203
|
+
options.partials_dir = 'Resources/Base.lproj/assets/partials'
|
204
|
+
|
205
|
+
end #activate
|
206
|
+
|
207
|
+
|
208
|
+
################################################################
|
209
|
+
# STOP! There's nothing below here that you should have to
|
210
|
+
# change. Just follow the conventions and framework provided.
|
211
|
+
################################################################
|
212
|
+
|
213
|
+
|
214
|
+
#===============================================================
|
215
|
+
# Setup directories to mirror Help Book directory layout.
|
216
|
+
#===============================================================
|
217
|
+
set :source, 'Contents'
|
218
|
+
set :build_dir, 'Contents (build)'
|
219
|
+
|
220
|
+
set :fonts_dir, 'Resources/Base.lproj/assets/fonts'
|
221
|
+
set :images_dir, 'Resources/Base.lproj/assets/images'
|
222
|
+
set :js_dir, 'Resources/Base.lproj/assets/javascripts'
|
223
|
+
set :css_dir, 'Resources/Base.lproj/assets/stylesheets'
|
224
|
+
|
225
|
+
set :layouts_dir, 'Resources/Base.lproj/assets/_layouts'
|
226
|
+
set :data_dir, 'Contents/Resources/Base.lproj/assets/_data'
|
227
|
+
|
228
|
+
|
229
|
+
#===============================================================
|
230
|
+
# Ignore items we don't want copied to the destination
|
231
|
+
#===============================================================
|
232
|
+
#ignore 'data/*'
|
233
|
+
|
234
|
+
|
235
|
+
#===============================================================
|
236
|
+
# All of our links and assets must be relative to the file
|
237
|
+
# location, and never absolute. However we will *use* absolute
|
238
|
+
# paths with root being the source directory; they will be
|
239
|
+
# converted to relative paths at build.
|
240
|
+
#===============================================================
|
241
|
+
set :strip_index_file, false
|
242
|
+
set :relative_links, true
|
243
|
+
activate :relative_assets do |options|
|
244
|
+
options.rewrite_ignore = [/image_sizes\.css/]
|
245
|
+
end
|
246
|
+
|
247
|
+
|
248
|
+
#===============================================================
|
249
|
+
# Default to Apple-recommended HTML 4.01 layout.
|
250
|
+
#===============================================================
|
251
|
+
set :haml, :format => :html4
|
252
|
+
page 'Resources/Base.lproj/*.html', :layout => :'layout-html4'
|
253
|
+
|
254
|
+
|
255
|
+
#===============================================================
|
256
|
+
# Add-on features
|
257
|
+
#===============================================================
|
258
|
+
activate :syntax
|
259
|
+
|
260
|
+
|
261
|
+
################################################################################
|
262
|
+
# Helpers
|
263
|
+
################################################################################
|
264
|
+
|
265
|
+
|
266
|
+
#===============================================================
|
267
|
+
# Methods defined in this helpers block are available in
|
268
|
+
# templates.
|
269
|
+
#===============================================================
|
270
|
+
helpers do
|
271
|
+
|
272
|
+
# no helpers here, but the Middlemac class offers quite a few,
|
273
|
+
# or you can add your own.
|
274
|
+
|
275
|
+
end #helpers
|
276
|
+
|
277
|
+
|
278
|
+
################################################################################
|
279
|
+
# Build-specific configurations
|
280
|
+
################################################################################
|
281
|
+
|
282
|
+
|
283
|
+
#===============================================================
|
284
|
+
# :server - the server is running and watching files.
|
285
|
+
#===============================================================
|
286
|
+
configure :server do
|
287
|
+
|
288
|
+
# Reload the browser automatically whenever files change
|
289
|
+
# activate :livereload, :host => '127.0.0.1'
|
290
|
+
|
291
|
+
compass_config do |config|
|
292
|
+
config.output_style = :expanded
|
293
|
+
config.sass_options = { :line_comments => true }
|
294
|
+
end
|
295
|
+
|
296
|
+
end #configure
|
297
|
+
|
298
|
+
|
299
|
+
#===============================================================
|
300
|
+
# :build - build is executed specifically.
|
301
|
+
#===============================================================
|
302
|
+
configure :build do
|
303
|
+
|
304
|
+
compass_config do |config|
|
305
|
+
config.output_style = :expanded
|
306
|
+
config.sass_options = { :line_comments => false }
|
307
|
+
end
|
308
|
+
|
309
|
+
end #configure
|
Binary file
|
data/lib/middlemac.rb
ADDED
@@ -0,0 +1,274 @@
|
|
1
|
+
require 'middleman-core'
|
2
|
+
|
3
|
+
|
4
|
+
################################################################################
|
5
|
+
# **Middlemac** (an extension to **Middleman**) is a tool to build Mac OS X
|
6
|
+
# application help book files from simple source documents. It handles all of
|
7
|
+
# the esoteric details for you, and provides easy-to-use helpers for working
|
8
|
+
# with multiple versions of your application (e.g., pro and free versions)
|
9
|
+
# while minimizing source code.
|
10
|
+
# @author Jim Derry <balthisar@gmail.com>
|
11
|
+
################################################################################
|
12
|
+
class Middlemac < ::Middleman::Extension
|
13
|
+
|
14
|
+
|
15
|
+
############################################################
|
16
|
+
# Define the options that are to be set within `config.rb`
|
17
|
+
# as extension options.
|
18
|
+
############################################################
|
19
|
+
option :Help_Output_Location, nil, 'Directory to place the built helpbook.'
|
20
|
+
option :Breadcrumbs, 'breadcrumbs', 'The name of the breadcrumbs helper to use for breadcrumbs.'
|
21
|
+
option :partials_dir, 'Resources/Base.lproj/assets/partials', 'A convenient shortcut to common partials.'
|
22
|
+
|
23
|
+
|
24
|
+
# @!group Extension Configuration
|
25
|
+
|
26
|
+
# @!attribute [rw] options[:Help_Output_Location]=
|
27
|
+
# Specifies the directory where the finished `.help` bundle should go. It
|
28
|
+
# must be relative to your `config.rb` file, or set it to `nil` to leave the
|
29
|
+
# output in the default location (in the help project directory). The *actual*
|
30
|
+
# output directory will be an Apple Help bundle at this location named in the
|
31
|
+
# form `#{CFBundleName} (target).help`. By targeting the `Resources` directory
|
32
|
+
# of your XCode project with this option, it’s possible to ensure that an
|
33
|
+
# Xcode project is automatically up to date every time a help project is
|
34
|
+
# built.
|
35
|
+
# @param [String] value The directory where the final help bundle will be
|
36
|
+
# built.
|
37
|
+
# @return [String] Returns the current value of this option.
|
38
|
+
|
39
|
+
# @!attribute [rw] options[:Breadcrumbs]=
|
40
|
+
# Indicates the name of the breadcrumbs helper to use for breadcrumbs.
|
41
|
+
# Built-in breadcrumbs are "nav_breadcrumbs" and "nav_breadcrumbs_alt".
|
42
|
+
# Change to `nil` to disable breadcrumbs completely. Breadcrumbs helpers are
|
43
|
+
# part of the `middleman-pagegroups` extension (which is a component of this
|
44
|
+
# extension).
|
45
|
+
# @param [String] value The name of the breadcrumbs helper to use.
|
46
|
+
# @return [String] Returns the current value of this option.
|
47
|
+
|
48
|
+
# @!attribute [rw] options[:partials_dir]=
|
49
|
+
# Specifies the default location for partials. Prior to **Middleman** 4.0,
|
50
|
+
# all partials were kept in a common directory. **Middlemac** restores this
|
51
|
+
# previous behavior by allowing all partials to be grouped in a common
|
52
|
+
# directory. When using the `partial` helper, this directory will be checked
|
53
|
+
# first for the existence of a partial; if not found then the default, built
|
54
|
+
# in behavior will take over.
|
55
|
+
# @param [String] value The directory to search for partials.
|
56
|
+
# @return [String] Returns the current value of this option.
|
57
|
+
|
58
|
+
# @!endgroup
|
59
|
+
|
60
|
+
|
61
|
+
############################################################
|
62
|
+
# initialize
|
63
|
+
# @visibility private
|
64
|
+
############################################################
|
65
|
+
def initialize(app, options_hash={}, &block)
|
66
|
+
|
67
|
+
super
|
68
|
+
|
69
|
+
end # initialize
|
70
|
+
|
71
|
+
|
72
|
+
############################################################
|
73
|
+
# after_configuration
|
74
|
+
# Callback occurs before `before_build`.
|
75
|
+
# @visibility private
|
76
|
+
#############################################################
|
77
|
+
def after_configuration
|
78
|
+
|
79
|
+
# Set the correct :build_dir based on the options.
|
80
|
+
|
81
|
+
dir = options[:Help_Output_Location] || File.expand_path('./')
|
82
|
+
cf_bundle_name = app.config[:targets][app.config[:target]][:CFBundleName]
|
83
|
+
target = app.config[:target]
|
84
|
+
|
85
|
+
app.config[:build_dir] = File.join(dir, "#{cf_bundle_name} (#{target}).help", 'Contents')
|
86
|
+
|
87
|
+
end
|
88
|
+
|
89
|
+
|
90
|
+
############################################################
|
91
|
+
# after_build
|
92
|
+
# Callback occurs one time after the build.
|
93
|
+
# @visibility private
|
94
|
+
############################################################
|
95
|
+
def after_build(builder)
|
96
|
+
|
97
|
+
run_help_indexer
|
98
|
+
|
99
|
+
end # after_build
|
100
|
+
|
101
|
+
|
102
|
+
############################################################
|
103
|
+
# Helpers
|
104
|
+
# Methods defined in this helpers block are available in
|
105
|
+
# templates.
|
106
|
+
############################################################
|
107
|
+
|
108
|
+
helpers do
|
109
|
+
|
110
|
+
#--------------------------------------------------------
|
111
|
+
# This helper returns the name of the breadcrumbs
|
112
|
+
# partial configured to be used in your project, i.e.,
|
113
|
+
# the value of `options[:Breadcrumbs]`.
|
114
|
+
# @return [String] The name of the configured breadcrumbs
|
115
|
+
# partial.
|
116
|
+
#--------------------------------------------------------
|
117
|
+
def breadcrumbs
|
118
|
+
extensions[:Middlemac].options[:Breadcrumbs]
|
119
|
+
end
|
120
|
+
|
121
|
+
|
122
|
+
#--------------------------------------------------------
|
123
|
+
# Returns the name of the configured partials directory
|
124
|
+
# to use by default with the `partials` helper, i.e., the
|
125
|
+
# value of `options[:partials_dir]`.
|
126
|
+
# @return [String] The path of the configured default
|
127
|
+
# partials directory.
|
128
|
+
#--------------------------------------------------------
|
129
|
+
def partials_dir
|
130
|
+
extensions[:Middlemac].options[:partials_dir]
|
131
|
+
end
|
132
|
+
|
133
|
+
|
134
|
+
#--------------------------------------------------------
|
135
|
+
# Returns the product `CFBundleIdentifier` for the
|
136
|
+
# current target as configured in your `config.rb`.
|
137
|
+
# @return [String] The `cfBundleIdentifier`.
|
138
|
+
#--------------------------------------------------------
|
139
|
+
def cfBundleIdentifier
|
140
|
+
config[:targets][config[:target]][:CFBundleID]
|
141
|
+
end
|
142
|
+
|
143
|
+
|
144
|
+
#--------------------------------------------------------
|
145
|
+
# Returns the product `CFBundleName` for the current
|
146
|
+
# target as configured in your `config.rb`.
|
147
|
+
# @return [String] The `CFBundleName`.
|
148
|
+
#--------------------------------------------------------
|
149
|
+
def cfBundleName
|
150
|
+
config[:targets][config[:target]][:CFBundleName]
|
151
|
+
end
|
152
|
+
|
153
|
+
|
154
|
+
#--------------------------------------------------------
|
155
|
+
# Returns the `ProductName` for the current target
|
156
|
+
# as configured in your `config.rb`.
|
157
|
+
# @return [String] The `ProductName`.
|
158
|
+
#--------------------------------------------------------
|
159
|
+
def product_name
|
160
|
+
config[:targets][config[:target]][:ProductName]
|
161
|
+
end
|
162
|
+
|
163
|
+
|
164
|
+
#--------------------------------------------------------
|
165
|
+
# Returns the `ProductVersion` for the current target
|
166
|
+
# as configured in your `config.rb`.
|
167
|
+
# @return [String] The `ProductVersion`.
|
168
|
+
#--------------------------------------------------------
|
169
|
+
def product_version
|
170
|
+
config[:targets][config[:target]][:ProductVersion]
|
171
|
+
end
|
172
|
+
|
173
|
+
|
174
|
+
#--------------------------------------------------------
|
175
|
+
# Returns the `ProductURI` for the current target
|
176
|
+
# as configured in your `config.rb`.
|
177
|
+
# @return [String] The `ProductURI`.
|
178
|
+
#--------------------------------------------------------
|
179
|
+
def product_uri
|
180
|
+
config[:targets][config[:target]][:ProductURI]
|
181
|
+
end
|
182
|
+
|
183
|
+
|
184
|
+
#--------------------------------------------------------
|
185
|
+
# Extends the built-in `partials` helper to allow the
|
186
|
+
# use of a default partials directory as configured with
|
187
|
+
# `options[:partials_dir]`. Middleman 4.0 removed the
|
188
|
+
# option `partials_dir` which increased flexibility a
|
189
|
+
# lot, but hurt backwards compatibility. When used the
|
190
|
+
# default location will be searched first for the
|
191
|
+
# specified partial; if not found then the built-in
|
192
|
+
# behavior will be used.
|
193
|
+
# @param [String] template The partial file to use.
|
194
|
+
# @param [Hash] opts Options to use for the partial.
|
195
|
+
# Consult **Middleman**’s documentation for possible
|
196
|
+
# options.
|
197
|
+
# @param [Block] &block An option block as per the
|
198
|
+
# default implementation by **Middleman**.
|
199
|
+
# @group Extended Helpers
|
200
|
+
#--------------------------------------------------------
|
201
|
+
def partial(template, opts={}, &block)
|
202
|
+
file_check = File.join(extensions[:Middlemac].options[:partials_dir], "_#{template}")
|
203
|
+
if ::Middleman::TemplateRenderer.resolve_template( @app, file_check)
|
204
|
+
super(file_check, opts, &block)
|
205
|
+
else
|
206
|
+
super(template, opts, &block)
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
|
211
|
+
end #helpers
|
212
|
+
|
213
|
+
|
214
|
+
############################################################
|
215
|
+
# Instance Methods
|
216
|
+
# @!group Instance Methods
|
217
|
+
############################################################
|
218
|
+
|
219
|
+
|
220
|
+
#########################################################
|
221
|
+
# Runs Apple’s the help indexer if it is available on
|
222
|
+
# the system.
|
223
|
+
# @return [Void]
|
224
|
+
#########################################################
|
225
|
+
def run_help_indexer
|
226
|
+
|
227
|
+
cf_bundle_name = app.config[:targets][app.config[:target]][:CFBundleName]
|
228
|
+
target = app.config[:target]
|
229
|
+
|
230
|
+
# see whether a help indexer is available.
|
231
|
+
`command -v hiutil > /dev/null`
|
232
|
+
if $?.success?
|
233
|
+
|
234
|
+
index_dir = File.expand_path(File.join(app.config[:build_dir], 'Resources/', 'Base.lproj/'))
|
235
|
+
index_dst = File.expand_path(File.join(index_dir, "#{cf_bundle_name}.helpindex"))
|
236
|
+
|
237
|
+
say "'…#{index_dir.split(//).last(60).join}' (indexing)", :cyan
|
238
|
+
say "'…#{index_dst.split(//).last(60).join}' (final file)", :cyan
|
239
|
+
|
240
|
+
`hiutil -Cf "#{index_dst}" "#{index_dir}"`
|
241
|
+
else
|
242
|
+
say "NOTE: `hiutil` is not found, so no index will exist for target '#{target}'.", :red
|
243
|
+
end
|
244
|
+
|
245
|
+
end #run_help_indexer
|
246
|
+
|
247
|
+
|
248
|
+
#########################################################
|
249
|
+
# Output colored messages using ANSI codes.
|
250
|
+
# @param [String] message The message to output to the
|
251
|
+
# console.
|
252
|
+
# @param [Symbol] color The color in which to display
|
253
|
+
# the message.
|
254
|
+
# @returns [Void]
|
255
|
+
# @!visibility private
|
256
|
+
#########################################################
|
257
|
+
def say(message = '', color = :reset)
|
258
|
+
colors = { :blue => "\033[34m",
|
259
|
+
:cyan => "\033[36m",
|
260
|
+
:green => "\033[32m",
|
261
|
+
:red => "\033[31m",
|
262
|
+
:yellow => "\033[33m",
|
263
|
+
:reset => "\033[0m",
|
264
|
+
}
|
265
|
+
|
266
|
+
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
267
|
+
puts message
|
268
|
+
else
|
269
|
+
puts colors[color] + message + colors[:reset]
|
270
|
+
end
|
271
|
+
end # say
|
272
|
+
|
273
|
+
|
274
|
+
end # class MiddlemacExtras
|