Skip to content
Back to top
View this page
Edit this page

# Online `/info`

Render SearXNG instance documentation.

Usage in a Flask app route:

    from searx import infopage
    from searx.extended_types import sxng_request

    _INFO_PAGES = infopage.InfoPageSet(infopage.MistletoePage)

    @app.route('/info/<pagename>', methods=['GET'])
    def info(pagename):

        locale = sxng_request.preferences.get_value('locale')
        page = _INFO_PAGES.get_page(pagename, locale)

class searx.infopage.InfoPage(fname: str)

  A page of the `online documentation`.

  property raw_content

    Raw content of the page (without any jinja rendering)

  property content

    Content of the page (rendered in a Jinja context)

  property title

    Title of the content (without any markup)

  property html: str

    Render Markdown (CommonMark) to HTML by using markdown-it-py.

  get_ctx() → dict[str, str]

    Jinja context to render `InfoPage.content`

class searx.infopage.InfoPageSet(page_class: type[InfoPage] | None = None, info_folder: str | None = None)

  Cached rendering of the online documentation a SearXNG instance has.

  Parameters:

    - page_class (`InfoPage`) – render online documentation by `InfoPage` parser.

    - info_folder (str) – information directory

  folder: str

    location of the Markdown files

  locale_default: str

    default language

  locales: list[str]

    list of supported languages (aka locales)

  toc: list[str]

    list of articles in the online documentation

  get_page(pagename: str, locale: str | None = None)

    Return `pagename` instance of `InfoPage`

    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`)

  iter_pages(locale: str | None = None, fallback_to_default: bool = False)

    Iterate over all pages of the TOC