From add806dd0fa04d83243cc52876e1cbb2ee8f8704 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Sun, 9 Oct 2022 09:25:42 +0200 Subject: [PATCH] fastapi: add news entry --- assets/javascripts/news.json | 4 ++++ lib/docs/filters/fastapi/entries.rb | 19 ++----------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index e596a931..cb2b1f34 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,4 +1,8 @@ [ + [ + "2022-10-09", + "New documentation: FastAPI" + ], [ "2022-10-02", "New documentation: Svelte" diff --git a/lib/docs/filters/fastapi/entries.rb b/lib/docs/filters/fastapi/entries.rb index d2923bf8..c410bb24 100644 --- a/lib/docs/filters/fastapi/entries.rb +++ b/lib/docs/filters/fastapi/entries.rb @@ -14,27 +14,12 @@ module Docs at_css('h1').content end - def get_name_other - header = at_css('h1') - if header - header.content - else - path_parts.last.titleize - end - end - def get_type if path_parts.length <= 1 - data = at_css('h1').content + at_css('h1').content else - data = path_parts[0...path_parts.length-1].join(": ").titleize + ": " + at_css('h1').content + path_parts[0...-1].join(": ").titleize + ": " + at_css('h1').content end - - data - end - - def path_count - path_parts.length end def additional_entries