From e84f272485eb9dd51b7c77787c0c102bbd24eedd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Fri, 28 Jul 2017 15:49:39 +0200 Subject: [PATCH 1/3] Rename partial templates with leading underscore --- .../doc/html/{list_items.html => _list_items.html} | 0 .../html/{method_detail.html => _method_detail.html} | 0 .../html/{method_summary.html => _method_summary.html} | 0 ...{methods_inherited.html => _methods_inherited.html} | 0 .../doc/html/{other_types.html => _other_types.html} | 0 src/compiler/crystal/tools/doc/templates.cr | 10 +++++----- 6 files changed, 5 insertions(+), 5 deletions(-) rename src/compiler/crystal/tools/doc/html/{list_items.html => _list_items.html} (100%) rename src/compiler/crystal/tools/doc/html/{method_detail.html => _method_detail.html} (100%) rename src/compiler/crystal/tools/doc/html/{method_summary.html => _method_summary.html} (100%) rename src/compiler/crystal/tools/doc/html/{methods_inherited.html => _methods_inherited.html} (100%) rename src/compiler/crystal/tools/doc/html/{other_types.html => _other_types.html} (100%) diff --git a/src/compiler/crystal/tools/doc/html/list_items.html b/src/compiler/crystal/tools/doc/html/_list_items.html similarity index 100% rename from src/compiler/crystal/tools/doc/html/list_items.html rename to src/compiler/crystal/tools/doc/html/_list_items.html diff --git a/src/compiler/crystal/tools/doc/html/method_detail.html b/src/compiler/crystal/tools/doc/html/_method_detail.html similarity index 100% rename from src/compiler/crystal/tools/doc/html/method_detail.html rename to src/compiler/crystal/tools/doc/html/_method_detail.html diff --git a/src/compiler/crystal/tools/doc/html/method_summary.html b/src/compiler/crystal/tools/doc/html/_method_summary.html similarity index 100% rename from src/compiler/crystal/tools/doc/html/method_summary.html rename to src/compiler/crystal/tools/doc/html/_method_summary.html diff --git a/src/compiler/crystal/tools/doc/html/methods_inherited.html b/src/compiler/crystal/tools/doc/html/_methods_inherited.html similarity index 100% rename from src/compiler/crystal/tools/doc/html/methods_inherited.html rename to src/compiler/crystal/tools/doc/html/_methods_inherited.html diff --git a/src/compiler/crystal/tools/doc/html/other_types.html b/src/compiler/crystal/tools/doc/html/_other_types.html similarity index 100% rename from src/compiler/crystal/tools/doc/html/other_types.html rename to src/compiler/crystal/tools/doc/html/_other_types.html diff --git a/src/compiler/crystal/tools/doc/templates.cr b/src/compiler/crystal/tools/doc/templates.cr index e4a473eeee32..b000cc60aaf2 100644 --- a/src/compiler/crystal/tools/doc/templates.cr +++ b/src/compiler/crystal/tools/doc/templates.cr @@ -6,23 +6,23 @@ module Crystal::Doc end record ListItemsTemplate, types : Array(Type), current_type : Type? do - ECR.def_to_s "#{__DIR__}/html/list_items.html" + ECR.def_to_s "#{__DIR__}/html/_list_items.html" end record MethodSummaryTemplate, title : String, methods : Array(Method) | Array(Macro) do - ECR.def_to_s "#{__DIR__}/html/method_summary.html" + ECR.def_to_s "#{__DIR__}/html/_method_summary.html" end record MethodDetailTemplate, title : String, methods : Array(Method) | Array(Macro) do - ECR.def_to_s "#{__DIR__}/html/method_detail.html" + ECR.def_to_s "#{__DIR__}/html/_method_detail.html" end record MethodsInheritedTemplate, type : Type, ancestor : Type, methods : Array(Method), label : String do - ECR.def_to_s "#{__DIR__}/html/methods_inherited.html" + ECR.def_to_s "#{__DIR__}/html/_methods_inherited.html" end record OtherTypesTemplate, title : String, type : Type, other_types : Array(Type) do - ECR.def_to_s "#{__DIR__}/html/other_types.html" + ECR.def_to_s "#{__DIR__}/html/_other_types.html" end record MainTemplate, body : String, types : Array(Type), repository_name : String do From b3a22a6332c001f074504072dd03872cbbc120e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Mon, 12 Mar 2018 14:55:51 +0000 Subject: [PATCH 2/3] Add _head.html partial to dry up html head --- src/compiler/crystal/tools/doc/html/_head.html | 6 ++++++ src/compiler/crystal/tools/doc/html/main.html | 4 +--- src/compiler/crystal/tools/doc/html/type.html | 4 +--- src/compiler/crystal/tools/doc/templates.cr | 4 ++++ 4 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 src/compiler/crystal/tools/doc/html/_head.html diff --git a/src/compiler/crystal/tools/doc/html/_head.html b/src/compiler/crystal/tools/doc/html/_head.html new file mode 100644 index 000000000000..d95c11ee7ecb --- /dev/null +++ b/src/compiler/crystal/tools/doc/html/_head.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/compiler/crystal/tools/doc/html/main.html b/src/compiler/crystal/tools/doc/html/main.html index 35fd5069b933..f971dde4749f 100644 --- a/src/compiler/crystal/tools/doc/html/main.html +++ b/src/compiler/crystal/tools/doc/html/main.html @@ -1,10 +1,8 @@ - + <%= HeadTemplate.new("") %> - - README - <%= repository_name %> <%= type.full_name %> - <%= type.repository_name %>