@@ -124,9 +124,31 @@ class ElasticCompatPreprocessor < Asciidoctor::Extensions::Preprocessor
124
124
/^\[ "source", ?"[^"]+", ?subs="(#{ Asciidoctor ::CC_ANY } +)"\] $/
125
125
CODE_BLOCK_RX = /^-----*$/
126
126
SNIPPET_RX = %r{^//\s *(AUTOSENSE|KIBANA|CONSOLE|SENSE:[^\n <]+)$}
127
- LEGACY_MACROS = 'added|beta|coming|deprecated|dev|experimental|ga_stack|ga_serverless|ga_ess|beta_serverless|beta_ess|coming_serverless|coming_ess|deprecated_serverless|deprecated_ess|dev_serverless|dev_ess|preview_serverless|preview_ess|discontinued_stack|discontinued_ess|discontinued_serverless'
128
- LEGACY_BLOCK_MACRO_RX = /^\s *(#{ LEGACY_MACROS } )\[ (.*)\] \s *$/
129
- LEGACY_INLINE_MACRO_RX = /(#{ LEGACY_MACROS } )\[ (.*)\] /
127
+ LEGACY = 'added|experimental'
128
+ BETA = 'beta|beta_serverless|beta_ess'
129
+ COMING = 'coming|coming_serverless|coming_ess'
130
+ DEP = 'deprecated|deprecated_serverless|deprecated_ess'
131
+ DEV = 'dev|dev_serverless|dev_ess'
132
+ DISC = 'discontinued_stack|discontinued_ess|discontinued_serverless'
133
+ GA = 'ga_stack|ga_serverless|ga_ess'
134
+ PREV = 'preview_serverless|preview_ess'
135
+ MACROS = "#{ LEGACY } |#{ BETA } |#{ COMING } |#{ DEP } |#{ DEV } |#{ DISC } |#{ GA } |#{ PREV } "
136
+ BLOCK_MACRO_RX = /^\s *(#{ MACROS } )\[ (.*)\] \s *$/
137
+ INLINE_MACRO_RX = /(#{ MACROS } )\[ (.*)\] /
138
+ # BETA_BLOCK_MACRO_RX = /^\s*(#{BETA_MACROS})\[(.*)\]\s*$/
139
+ # BETA_INLINE_MACRO_RX = /(#{BETA_MACROS})\[(.*)\]/
140
+ # COMING_BLOCK_MACRO_RX = /^\s*(#{COMING_MACROS})\[(.*)\]\s*$/
141
+ # COMING_INLINE_MACRO_RX = /(#{COMING_MACROS})\[(.*)\]/
142
+ # DEP_BLOCK_MACRO_RX = /^\s*(#{DEP_MACROS})\[(.*)\]\s*$/
143
+ # DEP_INLINE_MACRO_RX = /(#{DEP_MACROS})\[(.*)\]/
144
+ # DEV_BLOCK_MACRO_RX = /^\s*(#{DEV_MACROS})\[(.*)\]\s*$/
145
+ # DEV_INLINE_MACRO_RX = /(#{DEV_MACROS})\[(.*)\]/
146
+ # DISC_BLOCK_MACRO_RX = /^\s*(#{DISC_MACROS})\[(.*)\]\s*$/
147
+ # DISC_INLINE_MACRO_RX = /(#{DISC_MACROS})\[(.*)\]/
148
+ # GA_BLOCK_MACRO_RX = /^\s*(#{GA_MACROS})\[(.*)\]\s*$/
149
+ # GA_INLINE_MACRO_RX = /(#{GA_MACROS})\[(.*)\]/
150
+ # PREV_BLOCK_MACRO_RX = /^\s*(#{PREV_MACROS})\[(.*)\]\s*$/
151
+ # PREV_INLINE_MACRO_RX = /(#{PREV_MACROS})\[(.*)\]/
130
152
131
153
def process ( _document , reader )
132
154
reader . extend ReaderExtension
@@ -213,11 +235,24 @@ def postprocess(line)
213
235
214
236
# First convert the "block" version of these macros. We convert them
215
237
# to block macros because they are alone on a line
216
- line . gsub! ( LEGACY_BLOCK_MACRO_RX , '\1::[\2]' )
238
+ line . gsub! ( BLOCK_MACRO_RX , '\1::[\2]' )
239
+ # line.gsub!(BETA_BLOCK_MACRO_RX, '\1::[\2]')
240
+ # line.gsub!(COMING_BLOCK_MACRO_RX, '\1::[\2]')
241
+ # line.gsub!(DEP_BLOCK_MACRO_RX, '\1::[\2]')
242
+ # line.gsub!(DEV_BLOCK_MACRO_RX, '\1::[\2]')
243
+ # line.gsub!(DISC_BLOCK_MACRO_RX, '\1::[\2]')
244
+ # line.gsub!(GA_BLOCK_MACRO_RX, '\1::[\2]')
245
+ # line.gsub!(PREV_BLOCK_MACRO_RX, '\1::[\2]')
217
246
# Then convert the "inline" version of these macros. We convert them
218
247
# to inline macros because they are *not* at the start of the line....
219
- line . gsub! ( LEGACY_INLINE_MACRO_RX , '\1:[\2]' )
220
-
248
+ line . gsub! ( INLINE_MACRO_RX , '\1:[\2]' )
249
+ # line.gsub!(BETA_INLINE_MACRO_RX, '\1:[\2]')
250
+ # line.gsub!(COMING_INLINE_MACRO_RX, '\1:[\2]')
251
+ # line.gsub!(DEP_INLINE_MACRO_RX, '\1:[\2]')
252
+ # line.gsub!(DEV_INLINE_MACRO_RX, '\1:[\2]')
253
+ # line.gsub!(DISC_INLINE_MACRO_RX, '\1:[\2]')
254
+ # line.gsub!(GA_INLINE_MACRO_RX, '\1:[\2]')
255
+ # line.gsub!(PREV_INLINE_MACRO_RX, '\1:[\2]')
221
256
# Transform Elastic's traditional comment based marking for
222
257
# AUTOSENSE/KIBANA/CONSOLE snippets into a marker that we can pick
223
258
# up during tree processing to turn the snippet into a marked up
0 commit comments