middleman-pagegroups 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +8 -1
  3. data/.yardopts +8 -0
  4. data/CHANGELOG.md +24 -4
  5. data/README.md +5 -5
  6. data/Rakefile +201 -7
  7. data/documentation_project/Gemfile +2 -2
  8. data/documentation_project/config.rb +15 -19
  9. data/documentation_project/source/documentation/100_nested_folder/another_file.html.md.erb +19 -0
  10. data/documentation_project/source/documentation/100_nested_folder/index.html.md.erb +25 -0
  11. data/documentation_project/source/documentation/100_nested_folder/one_file.html.md.erb +11 -0
  12. data/documentation_project/source/documentation/100_nested_folder/stray.txt +6 -0
  13. data/documentation_project/source/documentation/10_concepts.html.md.erb +1 -1
  14. data/documentation_project/source/documentation/20_directory_organization.html.md.erb +12 -10
  15. data/documentation_project/source/documentation/40_resources.html.md.erb +3 -68
  16. data/documentation_project/source/documentation/50_helpers.html.md.erb +41 -163
  17. data/documentation_project/source/documentation/60_sample_partials.html.md.erb +23 -22
  18. data/documentation_project/source/documentation/80_config.html.md.erb +6 -0
  19. data/documentation_project/source/documentation/90_cli.html.md.erb +47 -0
  20. data/documentation_project/source/partials/_yard_config.erb +744 -0
  21. data/documentation_project/source/partials/_yard_helpers.erb +710 -0
  22. data/documentation_project/source/partials/_yard_helpers_css.erb +523 -0
  23. data/documentation_project/source/partials/_yard_helpers_extended.erb +56 -0
  24. data/documentation_project/source/partials/_yard_resources.erb +540 -0
  25. data/documentation_project/source/stylesheets/_middlemac_minimal.scss +287 -0
  26. data/features/helpers_and_resources.feature +120 -0
  27. data/features/support/env.rb +20 -0
  28. data/fixtures/middleman_pagegroups_app/config.rb +17 -0
  29. data/fixtures/middleman_pagegroups_app/source/20_sub_folder_02/index.html.md.erb +8 -0
  30. data/fixtures/middleman_pagegroups_app/source/20_sub_folder_02/not_legitimate.html.md.erb +8 -0
  31. data/fixtures/middleman_pagegroups_app/source/20_sub_folder_02/sibling_one.html.md.erb +8 -0
  32. data/fixtures/middleman_pagegroups_app/source/20_sub_folder_02/sibling_two.html.md.erb +8 -0
  33. data/fixtures/middleman_pagegroups_app/source/_partial.md.erb +111 -0
  34. data/fixtures/middleman_pagegroups_app/source/index.html.md.erb +23 -0
  35. data/fixtures/middleman_pagegroups_app/source/layout.erb +6 -0
  36. data/fixtures/middleman_pagegroups_app/source/sub_folder_01/10_sibling_one.html.md.erb +7 -0
  37. data/fixtures/middleman_pagegroups_app/source/sub_folder_01/20_sibling_two.html.md.erb +7 -0
  38. data/fixtures/middleman_pagegroups_app/source/sub_folder_01/30_sibling_three.html.md.erb +7 -0
  39. data/fixtures/middleman_pagegroups_app/source/sub_folder_01/index.html.md.erb +9 -0
  40. data/lib/middleman-pagegroups/extension.rb +468 -110
  41. data/lib/middleman-pagegroups/partials.rb +9 -12
  42. data/lib/middleman-pagegroups/version.rb +1 -1
  43. data/middleman-pagegroups.gemspec +10 -2
  44. data/yard/readme.md +5 -0
  45. data/yard/template-grouped/default/module/html/method_details_list.erb +11 -0
  46. data/yard/template-partials/default/method_details/setup.rb +4 -0
  47. data/yard/template-partials/default/module/html/attribute_details.erb +9 -0
  48. data/yard/template-partials/default/module/html/method_details_list.erb +10 -0
  49. data/yard/template-partials/default/module/setup.rb +6 -0
  50. data/yard/template-partials/default/onefile/html/layout.erb +1 -0
  51. data/yard/template-partials/default/onefile/html/setup.rb +4 -0
  52. data/yard/yard_extensions.rb +109 -0
  53. metadata +105 -7
@@ -666,3 +666,290 @@ div.image_article:after
666
666
  display: table;
667
667
  clear: both;
668
668
  }
669
+
670
+ //*************************************
671
+ // For partials extracted from YARD
672
+ //*************************************
673
+
674
+ $yard_color_symbol: rgba(0,136,204,1);
675
+ $yard_font_mono: Menlo, Consolas, Monaco, Courier, monospace;
676
+
677
+ div.attr_details,
678
+ div.method_details_list,
679
+ dl.examples_list
680
+ {
681
+ .inline
682
+ {
683
+ display: inline;
684
+
685
+ p:first-child
686
+ {
687
+ display: inline;
688
+ }
689
+ }
690
+
691
+ .method_details
692
+ {
693
+ border-top: 1px dotted #aaa;
694
+ margin-top: 15px;
695
+ padding-top: 0;
696
+
697
+ &.first
698
+ {
699
+ border: 0;
700
+ }
701
+ }
702
+
703
+ p.signature,
704
+ h3.signature,
705
+ dt
706
+ {
707
+ font-size: 0.9em;
708
+ font-weight: normal;
709
+ font-family: $yard_font_mono;
710
+ padding: 6px 10px;
711
+ margin-top: 18px;
712
+ background: #f2f3ff;
713
+ border: 1px solid #d8d8e5;
714
+ -moz-border-radius: 3px;
715
+ -webkit-border-radius: 3px;
716
+ color: $yard_color_symbol;
717
+
718
+ strong
719
+ {
720
+ color: inherit;;
721
+ }
722
+
723
+ tt
724
+ {
725
+ font-family: inherit;
726
+ }
727
+
728
+ .overload
729
+ {
730
+ display: block;
731
+ }
732
+
733
+ .extras
734
+ {
735
+ font-weight: normal;
736
+ font-family: sans-serif;
737
+ color: #444;
738
+ font-size: 1em;
739
+ }
740
+
741
+ .not_defined_here,
742
+ .aliases
743
+ {
744
+ display: block;
745
+ font-weight: normal;
746
+ font-size: 0.9em;
747
+ font-family: $yard_font_mono;
748
+ margin-top: 0px;
749
+ color: #555;
750
+
751
+ .names
752
+ {
753
+ font-family: $yard_font_mono;
754
+ font-weight: bold;
755
+ color: #000;
756
+ font-size: 1.2em;
757
+ }
758
+ }
759
+ }
760
+
761
+ dt
762
+ {
763
+ font-weight: bold;
764
+ }
765
+
766
+ div.docstring
767
+ {
768
+ div.discussion
769
+ {
770
+
771
+ }
772
+ }
773
+
774
+ div.tags
775
+ {
776
+ margin-bottom: 12px;
777
+
778
+ .tag_title
779
+ {
780
+ font-size: 1em;
781
+ margin-bottom: 0;
782
+ font-weight: bold; }
783
+
784
+ ul
785
+ {
786
+ margin-top: 5px;
787
+ padding-left: 30px;
788
+ list-style: square;
789
+
790
+ li {
791
+ margin-bottom: 3px;
792
+ }
793
+
794
+ .name
795
+ {
796
+ font-family: $yard_font_mono;
797
+ font-weight: bold;
798
+ }
799
+
800
+ .note
801
+ {
802
+ padding: 3px 6px;
803
+ }
804
+
805
+ }
806
+
807
+ .examples
808
+ {
809
+ .tag_title
810
+ {
811
+ margin-bottom: 10px;
812
+ font-weight: bold;
813
+ }
814
+
815
+ .inline p
816
+ {
817
+ padding: 0;
818
+ margin: 0;
819
+ margin-left: 15px;
820
+ font-weight: bold;
821
+ font-size: 0.9em;
822
+ }
823
+ }
824
+
825
+ .overload
826
+ {
827
+ .overload_item
828
+ {
829
+ list-style: none;
830
+ margin-bottom: 25px;
831
+
832
+ .signature
833
+ {
834
+ padding: 2px 8px;
835
+ background: #e5e8ff;
836
+ border: 1px solid #d8d8e5;
837
+ -moz-border-radius: 3px;
838
+ -webkit-border-radius: 3px;
839
+ }
840
+ }
841
+
842
+ .signature
843
+ { margin-left: -15px;
844
+ font-family: monospace;
845
+ display: block;
846
+ font-size: 1.1em;
847
+ }
848
+
849
+ .docstring
850
+ {
851
+ margin-top: 15px;
852
+ }
853
+
854
+ }
855
+
856
+ /* syntax highlighting */
857
+ //.source_code { display: none; padding: 3px 8px; border-left: 8px solid #ddd; margin-top: 5px; }
858
+ //#filecontents pre.code, .docstring pre.code, .source_code pre { font-family: monospace; }
859
+ //#filecontents pre.code, .docstring pre.code { display: block; }
860
+ //.source_code .lines { padding-right: 12px; color: #555; text-align: right; }
861
+
862
+ #filecontents pre.code,
863
+ .docstring pre.code,
864
+ pre.example
865
+ {
866
+ padding: 5px 12px; margin-top: 4px; border: 1px solid #eef; background: #f5f5ff;
867
+ }
868
+
869
+ pre.code
870
+ {
871
+ color: #000;
872
+
873
+ info.file { color: #555; }
874
+
875
+ .val { color: #036A07; }
876
+
877
+ .tstring_content,
878
+ .heredoc_beg,
879
+ .heredoc_end,
880
+ .qwords_beg,
881
+ .qwords_end,
882
+ .tstring,
883
+ .dstring
884
+ {
885
+ color: #036A07;
886
+ }
887
+
888
+ .fid,
889
+ .rubyid_new,
890
+ .rubyid_to_s,
891
+ .rubyid_to_sym,
892
+ .rubyid_to_f,
893
+ .dot + pre.code .id,
894
+ .rubyid_to_i pre.code .rubyid_each
895
+ {
896
+ color: #0085FF;
897
+ }
898
+
899
+ .comment
900
+ {
901
+ color: #0066FF;
902
+ }
903
+
904
+ .const,
905
+ .constant
906
+ {
907
+ color: #585CF6;
908
+ }
909
+
910
+ .label,
911
+ .symbol
912
+ {
913
+ color: #C5060B;
914
+ }
915
+
916
+ .kw,
917
+ .rubyid_require,
918
+ .rubyid_extend,
919
+ .rubyid_include
920
+ {
921
+ color: #0000FF;
922
+ }
923
+
924
+ .ivar
925
+ {
926
+ color: #318495;
927
+ }
928
+
929
+ .gvar,
930
+ .rubyid_backref,
931
+ .rubyid_nth_ref
932
+ {
933
+ color: #6D79DE;
934
+ }
935
+
936
+ .regexp,
937
+ .dregexp
938
+ {
939
+ color: #036A07;
940
+ }
941
+
942
+ a
943
+ {
944
+ border-bottom: 1px dotted #bbf;
945
+ }
946
+
947
+ }
948
+ }
949
+
950
+ table.source_code
951
+ {
952
+ display: none;
953
+ }
954
+
955
+ }
@@ -0,0 +1,120 @@
1
+ Feature: Provide helpers and resource items to make multiple targets easy to manage.
2
+
3
+ As a software developer
4
+ I want to use helpers and resource items
5
+ In order to enable automatic navigation of items.
6
+
7
+ Background:
8
+ Given a built app at "middleman_pagegroups_app"
9
+
10
+ Scenario:
11
+ Source files and directories with prefixes must be built without
12
+ prefixes, and all files must be present when built.
13
+ When I cd to "build"
14
+ Then the following directories should exist:
15
+ | sub_folder_01 |
16
+ | sub_folder_02 |
17
+ And the following files should exist:
18
+ | index.html |
19
+ | sub_folder_01/index.html |
20
+ | sub_folder_01/sibling_one.html |
21
+ | sub_folder_01/sibling_two.html |
22
+ | sub_folder_01/sibling_three.html |
23
+ | sub_folder_02/index.html |
24
+ | sub_folder_02/sibling_one.html |
25
+ | sub_folder_02/sibling_two.html |
26
+ | sub_folder_02/not_legitimate.html |
27
+ And the following directories should not exist:
28
+ | 20_sub_folder_02 |
29
+ And the following files should not exist:
30
+ | index.html |
31
+ | sub_folder_01/10_sibling_one.html |
32
+ | sub_folder_01/20_sibling_two.html |
33
+ | sub_folder_01/30_sibling_three.html |
34
+
35
+
36
+ Scenario: The CSS Class Helpers provide correct values when used.
37
+ When I cd to "build"
38
+ And the file "index.html" should contain 'nav_breadcrumbs_alt_class: breadcrumbs'
39
+ And the file "index.html" should contain 'nav_breadcrumbs_alt_label: Current page'
40
+ And the file "index.html" should contain 'nav_breadcrumbs_class: breadcrumbs'
41
+ And the file "index.html" should contain 'nav_brethren_class: table_contents'
42
+ And the file "index.html" should contain 'nav_brethren_index_class: related-topics'
43
+ And the file "index.html" should contain 'nav_legitimate_children_class: table_contents'
44
+ And the file "index.html" should contain 'nav_prev_next_class: navigate_prev_next'
45
+ And the file "index.html" should contain 'nav_prev_next_label_next: Next'
46
+ And the file "index.html" should contain 'nav_prev_next_label_prev: Previous'
47
+ And the file "index.html" should contain 'nav_toc_index_class: breadcrumbs'
48
+
49
+
50
+ Scenario: The extended page_classes helper provides correct values when used.
51
+ When I cd to "build"
52
+ And the file "index.html" should contain 'page_classes: index source'
53
+ When I cd to "sub_folder_01"
54
+ And the file "index.html" should contain 'page_classes: index sub_folder_01'
55
+ And the file "sibling_one.html" should contain 'page_classes: sibling_one sub_folder_01'
56
+ And the file "sibling_two.html" should contain 'page_classes: sibling_two sub_folder_01'
57
+ And the file "sibling_three.html" should contain 'page_classes: sibling_three sub_folder_01'
58
+ When I cd to "../sub_folder_02"
59
+ And the file "index.html" should contain 'page_classes: index sub_folder_02'
60
+ And the file "sibling_one.html" should contain 'page_classes: sibling_one sub_folder_02'
61
+ And the file "sibling_two.html" should contain 'page_classes: sibling_two sub_folder_02'
62
+ And the file "not_legitimate.html" should contain 'page_classes: not_legitimate sub_folder_02'
63
+
64
+
65
+ Scenario:
66
+ The resource extensions must deliver correct results when used, ensuring
67
+ that helpers and partials will have access to the correct data for
68
+ rendering.
69
+ When I cd to "build"
70
+ And the file "index.html" should contain 'current_resource.breadcrumbs:[#<Middleman::Sitemap::Resource path=index.html>]'
71
+ And the file "index.html" should contain 'current_resource.brethren:[]'
72
+ And the file "index.html" should contain 'current_resource.brethren_next:nil'
73
+ And the file "index.html" should contain 'current_resource.brethren_previous:nil'
74
+ And the file "index.html" should contain 'current_resource.group_count:1'
75
+ And the file "index.html" should contain 'current_resource.legitimate_children:[#<Middleman::Sitemap::Resource path=sub_folder_01/index.html>, #<Middleman::Sitemap::Resource path=20_sub_folder_02/index.html>]'
76
+ And the file "index.html" should contain 'current_resource.navigator_eligible:nil'
77
+ And the file "index.html" should contain 'current_resource.page_group:source'
78
+ And the file "index.html" should contain 'current_resource.page_name:index'
79
+ And the file "index.html" should contain 'current_resource.page_sequence:nil'
80
+ And the file "index.html" should contain 'current_resource.parent:nil'
81
+ And the file "index.html" should contain 'current_resource.sort_order:0'
82
+
83
+
84
+ Scenario:
85
+ The resource extensions must deliver correct results when used, ensuring
86
+ that helpers and partials will have access to the correct data for
87
+ rendering.
88
+ When I cd to "build/sub_folder_01/"
89
+ And the file "sibling_two.html" should contain 'current_resource.breadcrumbs:[#<Middleman::Sitemap::Resource path=index.html>, #<Middleman::Sitemap::Resource path=sub_folder_01/index.html>, #<Middleman::Sitemap::Resource path=sub_folder_01/20_sibling_two.html>]'
90
+ And the file "sibling_two.html" should contain 'current_resource.brethren:[#<Middleman::Sitemap::Resource path=sub_folder_01/10_sibling_one.html>, #<Middleman::Sitemap::Resource path=sub_folder_01/30_sibling_three.html>]'
91
+ And the file "sibling_two.html" should contain 'current_resource.brethren_next:#<Middleman::Sitemap::Resource path=sub_folder_01/30_sibling_three.html>'
92
+ And the file "sibling_two.html" should contain 'current_resource.brethren_previous:#<Middleman::Sitemap::Resource path=sub_folder_01/10_sibling_one.html>'
93
+ And the file "sibling_two.html" should contain 'current_resource.group_count:3'
94
+ And the file "sibling_two.html" should contain 'current_resource.legitimate_children:[]'
95
+ And the file "sibling_two.html" should contain 'current_resource.navigator_eligible:true'
96
+ And the file "sibling_two.html" should contain 'current_resource.page_group:sub_folder_01'
97
+ And the file "sibling_two.html" should contain 'current_resource.page_name:sibling_two'
98
+ And the file "sibling_two.html" should contain 'current_resource.page_sequence:2'
99
+ And the file "sibling_two.html" should contain 'current_resource.parent:#<Middleman::Sitemap::Resource path=sub_folder_01/index.html>'
100
+ And the file "sibling_two.html" should contain 'current_resource.sort_order:20'
101
+
102
+
103
+ Scenario:
104
+ The resource extensions must deliver correct results when used, ensuring
105
+ that helpers and partials will have access to the correct data for
106
+ rendering.
107
+ When I cd to "build/sub_folder_02/"
108
+ And the file "sibling_one.html" should contain 'current_resource.breadcrumbs:[#<Middleman::Sitemap::Resource path=index.html>, #<Middleman::Sitemap::Resource path=20_sub_folder_02/index.html>, #<Middleman::Sitemap::Resource path=20_sub_folder_02/sibling_one.html>]'
109
+ And the file "sibling_one.html" should contain 'current_resource.brethren:[#<Middleman::Sitemap::Resource path=20_sub_folder_02/sibling_two.html>]'
110
+ And the file "sibling_one.html" should contain 'current_resource.brethren_next:#<Middleman::Sitemap::Resource path=20_sub_folder_02/sibling_two.html>'
111
+ And the file "sibling_one.html" should contain 'current_resource.brethren_previous:nil'
112
+ And the file "sibling_one.html" should contain 'current_resource.group_count:2'
113
+ And the file "sibling_one.html" should contain 'current_resource.legitimate_children:[]'
114
+ And the file "sibling_one.html" should contain 'current_resource.navigator_eligible:nil'
115
+ And the file "sibling_one.html" should contain 'current_resource.page_group:sub_folder_02'
116
+ And the file "sibling_one.html" should contain 'current_resource.page_name:sibling_one'
117
+ And the file "sibling_one.html" should contain 'current_resource.page_sequence:1'
118
+ And the file "sibling_one.html" should contain 'current_resource.parent:#<Middleman::Sitemap::Resource path=20_sub_folder_02/index.html>'
119
+ And the file "sibling_one.html" should contain 'current_resource.sort_order:10'
120
+
@@ -0,0 +1,20 @@
1
+ PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__)))
2
+ ENV['TEST'] = 'true'
3
+
4
+ require 'middleman'
5
+ require 'middleman-core/step_definitions'
6
+ require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-pagegroups')
7
+
8
+
9
+ require 'cucumber/formatter/pretty'
10
+ class QuietFormatter < Cucumber::Formatter::Pretty
11
+ def initialize(runtime, io, options)
12
+ $stderr = File.new( '/dev/null', 'w' )
13
+ super(runtime, io, options)
14
+ end
15
+
16
+ def after_features(features)
17
+ $stderr = STDOUT
18
+ super(features)
19
+ end
20
+ end
@@ -0,0 +1,17 @@
1
+ activate :MiddlemanPageGroups do |options|
2
+
3
+ options[:strip_file_prefixes] = true
4
+ options[:extend_page_class] = true
5
+
6
+ options[:nav_breadcrumbs_class] = 'breadcrumbs'
7
+ options[:nav_breadcrumbs_alt_class] = 'breadcrumbs'
8
+ options[:nav_breadcrumbs_alt_label] = 'Current page'
9
+ options[:nav_brethren_class] = 'table_contents'
10
+ options[:nav_brethren_index_class] = 'related-topics'
11
+ options[:nav_legitimate_children_class] = 'table_contents'
12
+ options[:nav_prev_next_class] = 'navigate_prev_next'
13
+ options[:nav_prev_next_label_prev] = 'Previous'
14
+ options[:nav_prev_next_label_next] = 'Next'
15
+ options[:nav_toc_index_class] = 'help_map'
16
+
17
+ end