Skip to content

Commit

Permalink
Added stats to the main page
Browse files Browse the repository at this point in the history
  • Loading branch information
claire-lex committed Jun 12, 2024
1 parent f986124 commit 858c6c6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ or contributions.

## Contents


Currently, there are **63 protocols** with a total of 667 resources.
- [ATG](#atg)
- [BACnet/IP](#bacnetip)
- [BSAP](#bsap)
Expand Down
1 change: 1 addition & 0 deletions srcs/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@

markdown.t_toc = "Contents"
markdown.t_details = "Detailed page"
markdown.t_stats = "Currently, there are **{0} protocols** with a total of {1} resources."

#-----------------------------------------------------------------------------#
# TOOL CONFIGURATION #
Expand Down
4 changes: 3 additions & 1 deletion srcs/out/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def gen_awesome_list(self, protocols: Protocols, links: Links, write=True) -> st
"""Convert protocols to a nice awesome list in Markdown."""
self.protocols = protocols.all_as_objects
self.links = links
self.stats = protocols.count
keywords = {
m.f_title: self.__f_title,
m.f_description: self.__f_description,
Expand Down Expand Up @@ -140,7 +141,8 @@ def __f_logo(self) -> str:
return IMG(LIST_TITLE, LIST_LOGO)

def __f_toc(self) -> str:
toc = [H2(m.t_toc)+"\n"]
toc = [H2(m.t_toc) + "\n"]
toc += ["\n" + m.t_stats.format(self.stats, self.links.count)]
for protocol in self.protocols:
toc.append("- " + INTLINK(protocol.name))
return "\n".join(toc)
Expand Down

0 comments on commit 858c6c6

Please sign in to comment.