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 @@
1[1[
2 [
3 "2022-10-09",
4 "New documentation: <a href=\"/fastapi/\">FastAPI</a>"
5 ],
2 [6 [
3 "2022-10-02",7 "2022-10-02",
4 "New documentation: <a href=\"/svelte/\">Svelte</a>"8 "New documentation: <a href=\"/svelte/\">Svelte</a>"
lib/docs/filters/fastapi/entries.rb+2−17
@@ -14,27 +14,12 @@ module Docs · 13 unmodified lines
14 at_css('h1').content14 at_css('h1').content
15 end15 end
16 16
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
26 def get_type17 def get_type
27 if path_parts.length <= 118 if path_parts.length <= 1
28 data = at_css('h1').content19 at_css('h1').content
29 else20 else
30 data = path_parts[0...path_parts.length-1].join(": ").titleize + ": " + at_css('h1').content21 path_parts[0...-1].join(": ").titleize + ": " + at_css('h1').content
31 end22 end
32
33 data
34 end
35
36 def path_count
37 path_parts.length
38 end23 end
39 24
40 def additional_entries25 def additional_entries