• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2023-2024 The Khronos Group Inc.
2# SPDX-License-Identifier: Apache-2.0
3
4# open_listing_block - allows a listing block to masquerade as an open
5# block:
6#
7# [open]
8# ----
9# (block content)
10# ----
11#
12# This allows nesting arbitrary open blocks inside 'refpage' open blocks.
13
14require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal'
15
16include ::Asciidoctor
17
18Asciidoctor::Extensions.register do
19    block do
20        named :open
21        on_context :listing
22        process do |parent, reader, attrs|
23            wrapper = create_open_block parent, [], {}
24            parse_content wrapper, reader
25            wrapper
26        end
27    end
28end
29