Class: SiSU_Markup::MarkupHistory
- Inherits:
-
Object
- Object
- SiSU_Markup::MarkupHistory
- Defined in:
- lib/sisu/sst_identify_markup.rb
Instance Method Summary collapse
- #help_identify ⇒ Object
- #help_query ⇒ Object
-
#initialize(opt) ⇒ MarkupHistory
constructor
A new instance of MarkupHistory.
- #query ⇒ Object
- #sisu_0_1 ⇒ Object
- #sisu_0_16 ⇒ Object
- #sisu_0_37 ⇒ Object
- #sisu_0_38 ⇒ Object
- #sisu_0_42 ⇒ Object
- #sisu_0_57 ⇒ Object
- #sisu_0_65 ⇒ Object
- #sisu_0_66 ⇒ Object
- #sisu_0_69 ⇒ Object
- #sisu_1_0 ⇒ Object
- #sisu_2_0 ⇒ Object
- #sisu_3_0 ⇒ Object
Constructor Details
#initialize(opt) ⇒ MarkupHistory
Returns a new instance of MarkupHistory.
253 254 255 |
# File 'lib/sisu/sst_identify_markup.rb', line 253 def initialize(opt) @opt=opt end |
Instance Method Details
#help_identify ⇒ Object
424 425 426 427 428 429 430 431 |
# File 'lib/sisu/sst_identify_markup.rb', line 424 def help_identify <<WOK sisu --identify [filename] attempts to identify the SiSU markup used in a file WOK end |
#help_query ⇒ Object
416 417 418 419 420 421 422 423 |
# File 'lib/sisu/sst_identify_markup.rb', line 416 def help_query <<WOK sisu --query=[sisu version [0.38] or 'history] provides a short history of changes to SiSU markup WOK end |
#query ⇒ Object
432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 |
# File 'lib/sisu/sst_identify_markup.rb', line 432 def query tell=if @opt.selections.str =~/--query/ tell=case @opt.selections.str when /history/ "#{sisu_3_0}#{sisu_2_0}#{sisu_1_0}#{sisu_0_69}#{sisu_0_66}#{sisu_0_57}#{sisu_0_42}#{sisu_0_38}\n#{sisu_0_37}\n#{sisu_0_16}\n#{sisu_0_1}" when /3.0/ "#{sisu_3_0}#{sisu_2_0}#{sisu_1_0}#{sisu_0_69}#{sisu_0_66}#{sisu_0_57}#{sisu_0_42}#{sisu_0_38}#{sisu_0_16}" when /2.0/ "#{sisu_2_0}#{sisu_1_0}#{sisu_0_69}#{sisu_0_66}#{sisu_0_57}#{sisu_0_42}#{sisu_0_38}#{sisu_0_16}" when /1.0/ "#{sisu_1_0}#{sisu_0_69}#{sisu_0_66}#{sisu_0_57}#{sisu_0_42}#{sisu_0_38}#{sisu_0_16}" when /0.69/ "#{sisu_0_69}#{sisu_0_66}#{sisu_0_57}#{sisu_0_42}#{sisu_0_38}#{sisu_0_16}" when /0.66/ "#{sisu_0_66}#{sisu_0_57}#{sisu_0_42}#{sisu_0_38}#{sisu_0_16}" when /0.65/ "#{sisu_0_65}#{sisu_0_57}#{sisu_0_42}#{sisu_0_38}#{sisu_0_16}" when /0.57/ "#{sisu_0_57}#{sisu_0_42}#{sisu_0_38}#{sisu_0_16}" when /0.42/ "#{sisu_0_42}#{sisu_0_38}#{sisu_0_16}" when /0.38/ "#{sisu_0_38}#{sisu_0_16}" when /0.37/ "#{sisu_0_37}\n#{sisu_0_16}" when /0.1[6-9]|0.2[0-9]|0.3[0-6]/ "#{sisu_0_16}\n#{sisu_0_1}" when /0.[1-9]|0.1[1-4]/ sisu_0_1 else puts "NOT RECOGNISED: #{@opt.selections.str}" help_query end tell else help_query end end |
#sisu_0_1 ⇒ Object
409 410 411 412 413 414 415 |
# File 'lib/sisu/sst_identify_markup.rb', line 409 def sisu_0_1 <<WOK SiSU 0.1 headers and headings structure represented by header 0{~ and headings/structure 1{ 2{ 3{ 4{~ 5{ 6{ WOK end |
#sisu_0_16 ⇒ Object
399 400 401 402 403 404 405 406 407 408 |
# File 'lib/sisu/sst_identify_markup.rb', line 399 def sisu_0_16 <<WOK SiSU 0.16 (0.15 development branch) introduced the use of the header 0~ and headings/structure 1~ 2~ 3~ 4~ 5~ 6~ in place of the 0.1 header, heading/structure notation WOK end |
#sisu_0_37 ⇒ Object
383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 |
# File 'lib/sisu/sst_identify_markup.rb', line 383 def sisu_0_37 <<WOK SiSU 0.37 introduced the file naming convention, that remains in use in SiSU v1 and v2, using the file extensions .sst .ssm and .ssi to replace .s1 .s2 .s3 .r1 .r2 .r3 and .si this is captured by the following file 'rename' instruction: rename 's/\.s[123]$/\.sst/' *.s{1,2,3} rename 's/\.r[123]$/\.ssm/' *.r{1,2,3} rename 's/\.si$/\.ssi/' *.si The internal document markup remains unchanged, from SiSU 0.16 WOK end |
#sisu_0_38 ⇒ Object
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
# File 'lib/sisu/sst_identify_markup.rb', line 351 def sisu_0_38 <<WOK SiSU 0.38 (a subset of 1.0) introduced alternative experimental header and heading/structure markers, @headername: and headers :A~ :B~ :C~ 1~ 2~ 3~ as the equivalent of (the superceded) 0~headername and headers 1~ 2~ 3~ 4~ 5~ 6~ The internal document markup of SiSU 0.16 remains valid and standard Though note that SiSU 0.37 introduced a new file naming convention SiSU has in effect two sets of levels to be considered, using 0.38 notation A-C headings/levels, pre-ordinary paragraphs /pre-substantive text, and 1-3 headings/levels, levels which are followed by ordinary text. This may be conceptualised as levels A,B,C, 1,2,3, and using such letter number notation, in effect: A must exist, optional B and C may follow in sequence (not strict) 1 must exist, optional 2 and 3 may follow in sequence i.e. there are two independent heading level sequences A,B,C and 1,2,3 (using the 0.16 standard notation 1,2,3 and 4,5,6) on the positive side: * the 0.38 A,B,C,1,2,3 alternative makes explicit an aspect of structuring documents in SiSU that is not otherwise obvious to the newcomer (though it appears more complicated, is more in your face and likely to be understood fairly quickly) * the substantive text follows levels 1,2,3 and it is 'nice' to do most work in those levels WOK end |
#sisu_0_42 ⇒ Object
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 |
# File 'lib/sisu/sst_identify_markup.rb', line 332 def sisu_0_42 <<WOK SiSU 0.42 (a subset of 1.0) is the same as 0.38 with the introduction of some additional endnote types, Introduces some varations on endnotes, in particular the use of the asterisk ~{* for example for describing an author }~ and ~{** for describing a second author }~ * for example for describing an author ** for describing a second author and ~[* my note ]~ or ~[+ another note ]~ which numerically increments an asterisk and plus respectively *1 my note +1 another note WOK end |
#sisu_0_57 ⇒ Object
321 322 323 324 325 326 327 328 329 330 331 |
# File 'lib/sisu/sst_identify_markup.rb', line 321 def sisu_0_57 <<WOK SiSU 0.57 (a subset of 1.0) is the same as 0.42 with the introduction of some a shortcut to use the headers @title and @creator in the first heading [expanded using the contents of the headers @title: and @author:] :A~ @title by @author WOK end |
#sisu_0_65 ⇒ Object
313 314 315 316 317 318 319 320 |
# File 'lib/sisu/sst_identify_markup.rb', line 313 def sisu_0_65 <<WOK SiSU 0.65 same as previous, adds semantic tags /[a-z+][:;]\{.+?\}[:;][a-z+]/ e.g. author:{ Ralph last;{Amissah};last }:author WOK end |
#sisu_0_66 ⇒ Object
305 306 307 308 309 310 311 312 |
# File 'lib/sisu/sst_identify_markup.rb', line 305 def sisu_0_66 <<WOK SiSU 0.66 same as previous, adds semantic tags /[:;]\{.+?\}[:;][a-z+]/ e.g. :{ Ralph last;{Amissah};last }:author WOK end |
#sisu_0_69 ⇒ Object
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 |
# File 'lib/sisu/sst_identify_markup.rb', line 289 def sisu_0_69 <<WOK SiSU 0.69 (same as 1.0) as previous (0.57) with the addition of book index tags /^=\{.+?\}$/ e.g. appended to a paragraph, on a new-line (without a blank line in between) logical structure produced assuming this is the first text "object" ={GNU/Linux community distribution:Debian+2|Fedora|Gentoo;Free Software Foundation+5} Free Software Foundation, 1-6 GNU/Linux community distribution, 1 Debian, 1-3 Fedora, 1 Gentoo, WOK end |
#sisu_1_0 ⇒ Object
283 284 285 286 287 288 |
# File 'lib/sisu/sst_identify_markup.rb', line 283 def sisu_1_0 <<WOK SiSU 1.0 same as 0.69 WOK end |
#sisu_2_0 ⇒ Object
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/sisu/sst_identify_markup.rb', line 264 def sisu_2_0 <<WOK SiSU 2.0 same as 1.0, apart from the changing of headers and the addition of a monospace tag related headers now grouped, e.g. @title: :subtitle: @creator: :author: :translator: :illustrator: see document markup samples, and sisu --help headers the monospace tag takes the form of a has '#' \#{ this enclosed text would be monospaced }# WOK end |
#sisu_3_0 ⇒ Object
256 257 258 259 260 261 262 263 |
# File 'lib/sisu/sst_identify_markup.rb', line 256 def sisu_3_0 <<WOK SiSU 3.0 same as 2.0, apart from change to headers see document markup samples, and sisu --help headers WOK end |