From b2ad6ef192e23e3cb3315f114f482fb3f8d52e33 Mon Sep 17 00:00:00 2001 From: ginkouno Date: Thu, 5 Oct 2017 18:15:43 +0900 Subject: [PATCH 1/2] Link to api title from toc --- lib/prmd/templates/table_of_contents.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/prmd/templates/table_of_contents.erb b/lib/prmd/templates/table_of_contents.erb index 718807bb..c46a2168 100644 --- a/lib/prmd/templates/table_of_contents.erb +++ b/lib/prmd/templates/table_of_contents.erb @@ -6,6 +6,6 @@ <% _, schemata = schema.dereference(property) %> - <%= schemata['title'].split(' - ', 2).last %> <% schemata.fetch('links', []).each do |l| %> - - <%= l['method'] %> <%= build_link_path(schema, l) %> + - <%= l['method'] %> <%= build_link_path(schema, l) %> <% end %> <% end %> From a02c758e2310dde0d5fb64b5901885da7e9c49ea Mon Sep 17 00:00:00 2001 From: ginkouno Date: Thu, 5 Oct 2017 20:18:15 +0900 Subject: [PATCH 2/2] Fix toc link at test --- test/commands/render_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/commands/render_test.rb b/test/commands/render_test.rb index eff8a6c2..c7393864 100644 --- a/test/commands/render_test.rb +++ b/test/commands/render_test.rb @@ -39,7 +39,7 @@ def test_render_for_toc assert_match /^## The table of contents/, markdown assert_match 'POST /apps', markdown + assert_match '- POST /apps', markdown assert_match '