class_docstr: Search index is a collection of pages and sections (heading
  tags and their following content are sections).
docstr: Create a set of entries in the index for a page. One for
  the page itself and then one for each of its' heading
  tags.
docstr_tok: ["Create","a","set","of","entries","in","the","index","for","a","page",".","One","for","the","page","itself","and","then","one","for","each","of","its","'","heading","tags","."]
code: def add_entry_from_context(self, page: Page) -> None:
      """
      Create a set of entries in the index for a page. One for
      the page itself and then one for each of its' heading
      tags.
      """
      # Create the content parser and feed in the HTML for the
      # full page. This handles all the parsing and prepares
      # us to iterate through it.
      parser = ContentParser()
      assert page.content is not None
      parser.feed(page.content)
      parser.close()
  
      # Get the absolute URL for the page, this is then
      # prepended to the urls of the sections
      url = page.url
  
      # Create an entry for the full page.
      text = (
          parser.stripped_html.rstrip("\n")
          if self.config["indexing"] == "full"
          else ""
      )
      self._add_entry(title=page.title, text=text, loc=url)
  
      if self.config["indexing"] in ["full", "sections"]:
          for section in parser.data:
              self.create_entry_for_section(section, page.toc, url)
  
imports: from __future__ import annotations
  import json
  import logging
  import os
  import re
  import subprocess
  from html.parser import HTMLParser
  from typing import TYPE_CHECKING
label_desc: Use image node_id 4 for calling the SearchIndex obj's underlying member method code with example usage: obj.add_entry_from_context(page) without return types