mkdocs_fedi_comments.link_maker ¶
LinkMaker
dataclass
¶
Creates links to pages
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_url
|
str
|
|
required |
site_url
|
str
|
|
required |
Source code in mkdocs_fedi_comments/link_maker.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
ap_object ¶
ap_object(page_url: str)
Creates a link to the page object
>>> link_maker = LinkMaker("http://comments.example/", "http://site.example")
>>> link_maker.ap_object("page.md")
'http://comments.example/pages/aHR0cDovL3NpdGUuZXhhbXBsZS9wYWdlLm1k'
Source code in mkdocs_fedi_comments/link_maker.py
19 20 21 22 23 24 25 26 27 28 29 30 | |
comments ¶
comments(page_url: str)
Creates a link to the comments API call
>>> link_maker = LinkMaker("http://comments.example/", "http://site.example")
>>> link_maker.comments("page.md")
'http://comments.example/comments/aHR0cDovL3NpdGUuZXhhbXBsZS9wYWdlLm1k'
Source code in mkdocs_fedi_comments/link_maker.py
32 33 34 35 36 37 38 39 40 41 42 | |
fedi_actor ¶
fedi_actor()
Creates a link to the fedi_actor
>>> link_maker = LinkMaker("http://comments.example/", "http://site.example/path/")
>>> link_maker.fedi_actor()
'http://site.example/path/fedi-actor.json'
Source code in mkdocs_fedi_comments/link_maker.py
44 45 46 47 48 49 50 51 52 53 54 | |