Class: Mandoc::ManMeta

Inherits:
Meta
  • Object
show all
Defined in:
ext/mandoc/rb_mandoc.c

Instance Method Summary collapse

Methods inherited from Meta

#arch, #date, #deroff, #first_node, #has_body?, #name, #os, #section, #so_target, #title, #volume

Instance Method Details

#manObject

:call-seq:

man -> String

The result depends on struct mparse, which means this method must be called BEFORE the next parse_file method calling.



353
354
355
356
357
358
359
360
361
362
363
364
# File 'ext/mandoc/rb_mandoc.c', line 353

static VALUE
rb_manmeta_m_man (VALUE self)
{
  int original_stdout;
  int read_end = rb_backup_stdout (&original_stdout);

  VALUE parser = rb_iv_get (self, "@parser");
  struct mparse *p = RTYPEDDATA_DATA (parser);
  mparse_copy (p);

  return rb_restore_stdout (original_stdout, read_end);
}

#treeObject

:call-seq:

tree -> String


316
317
318
319
320
321
322
323
324
325
326
327
# File 'ext/mandoc/rb_mandoc.c', line 316

static VALUE
rb_manmeta_m_tree (VALUE self)
{
  struct roff_meta *meta = RTYPEDDATA_DATA (self);

  int original_stdout;
  int read_end = rb_backup_stdout (&original_stdout);

  tree_man (NULL, meta);

  return rb_restore_stdout (original_stdout, read_end);
}