{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Yields": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Methods": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Returns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Handler for "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": ".. only::"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " — always drop with a warning."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Receives": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warnings": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Attributes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": ".. only:: html"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " blocks frequently contain "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": ".. raw:: html"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " nodes, which must never reach the IR — raw HTML in untrusted doc sources is a security risk.  We cannot safely parse Sphinx conditional expressions, so we drop every "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "only"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " block regardless of the condition."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "TODO: this is the only HTML-adjacent handler and it should probably accept a "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "passthrough=True"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " option (or a set of safe condition expressions) so callers can opt in to receiving the parsed RST content when they know the block does not contain raw HTML.  The handler would then parse "
            },
            {
              "__type": "Emphasis",
              "__tag": 4047,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "content"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " via "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "parse()"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and return the resulting nodes just like other handlers do, rather than always returning "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "[]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ".  Until that option exists, maintainers who want the content must rewrite or remove the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": ".. only::"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " wrapper in their source."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Attributes",
    "Methods",
    "Returns",
    "Yields",
    "Receives",
    "Other Parameters",
    "Raises",
    "Warns",
    "Warnings",
    "Notes"
  ],
  "item_file": "/papyri/directives.py",
  "item_line": 441,
  "item_type": "function",
  "aliases": [
    "papyri.directives.only_handler"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "argument",
        "annotation": "str",
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "options",
        "annotation": "dict[str, str]",
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "content",
        "annotation": "str",
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      }
    ],
    "return_annotation": "list[Any]",
    "target_name": "only_handler"
  },
  "references": null,
  "qa": "papyri.directives:only_handler",
  "arbitrary": [],
  "local_refs": []
}