History

fastapi: add news entry

Simon Legner committed 4 years ago

Commit add806d1 parent 3f2cee92 files · +6 −17Browse files

Unified · Split

2 files
  1. assets/javascripts/news.json +4 −0
  2. lib/docs/filters/fastapi/entries.rb +2 −17
assets/javascripts/news.json+4−0
@@ -1,4 +1,8 @@
11 [
2+ [
3+ "2022-10-09",
4+ "New documentation: <a href=\"/fastapi/\">FastAPI</a>"
5+ ],
26 [
37 "2022-10-02",
48 "New documentation: <a href=\"/svelte/\">Svelte</a>"
lib/docs/filters/fastapi/entries.rb+2−17
@@ -14,27 +14,12 @@ module Docs · 13 unmodified lines
1414 at_css('h1').content
1515 end
1616
17− def get_name_other
18− header = at_css('h1')
19− if header
20− header.content
21− else
22− path_parts.last.titleize
23− end
24− end
25−
2617 def get_type
2718 if path_parts.length <= 1
28− data = at_css('h1').content
19+ at_css('h1').content
2920 else
30− data = path_parts[0...path_parts.length-1].join(": ").titleize + ": " + at_css('h1').content
21+ path_parts[0...-1].join(": ").titleize + ": " + at_css('h1').content
3122 end
32−
33− data
34− end
35−
36− def path_count
37− path_parts.length
3823 end
3924
4025 def additional_entries