Online /info
¶
Render SearXNG instance documentation.
Usage in a Flask app route:
from searx import infopage
_INFO_PAGES = infopage.InfoPageSet(infopage.MistletoePage)
@app.route('/info/<pagename>', methods=['GET'])
def info(pagename):
locale = request.preferences.get_value('locale')
page = _INFO_PAGES.get_page(pagename, locale)
- class searx.infopage.InfoPage(fname)[source]¶
A page of the
online documentation
.- property content¶
Content of the page (rendered in a Jinja conntext)
- get_ctx()[source]¶
Jinja context to render
InfoPage.content
- property html¶
Render Markdown (CommonMark) to HTML by using markdown-it-py.
- property raw_content¶
Raw content of the page (without any jinja rendering)
- property title¶
Title of the content (without any markup)
- class searx.infopage.InfoPageSet(page_class: Optional[Type[InfoPage]] = None, info_folder: Optional[str] = None)[source]¶
Cached rendering of the online documentation a SearXNG instance has.
- Parameters:
- get_page(pagename: str, locale: Optional[str] = None)[source]¶
Return
pagename
instance ofInfoPage
- Parameters:
pagename (str) – name of the page, a value from
InfoPageSet.toc
locale (str) – language of the page, e.g.
en
,zh_Hans_CN
(default:InfoPageSet.i18n_origin
)