Class: NRSER::MeanStreak
- Inherits:
-
Object
- Object
- NRSER::MeanStreak
- Defined in:
- lib/nrser/mean_streak.rb
Overview
Tag up terminals with color and style. Uses CommonMarker for the parsing (Markdown / CommonMark / GFM syntax).
MeanStreak instances hold configuration and provide functionality through instance methods, making it easy to use multiple configurations or subclass MeanStreak to further customize functionality.
An instance with default configuration is available via the MeanStreak.default class method, and additional class methods are provided that proxy to the default’s instance methods, providing convenient use of the default config.
Defined Under Namespace
Classes: Document
Class Method Summary collapse
-
.default ⇒ NRSER::MeanStreak
Get the default instance, which has the default configuration and is used by the class methods.
-
.parse(text, options = :DEFAULT, extensions = []) ⇒ CommonMarker::Node
Public: Parses a Markdown string into a ‘document` node.
Instance Method Summary collapse
Class Method Details
.default ⇒ NRSER::MeanStreak
Get the default instance, which has the default configuration and is used by the class methods.
49 50 51 52 |
# File 'lib/nrser/mean_streak.rb', line 49 def self.default # TODO cache? new end |
.parse(text, options = :DEFAULT, extensions = []) ⇒ CommonMarker::Node
Public: Parses a Markdown string into a ‘document` node.
string - String to be parsed option - A Symbol or of Symbols indicating the parse options extensions - An of Symbols indicating the extensions to use
64 65 66 |
# File 'lib/nrser/mean_streak.rb', line 64 def self.parse text, = :DEFAULT, extensions = [] end |
Instance Method Details
#parse(source, **options) ⇒ return_type
Document parse method.
Returns @todo Document return value.
81 82 83 84 85 86 |
# File 'lib/nrser/mean_streak.rb', line 81 def parse source, ** NRSER::MeanStreak::Document.parse \ source, **, mean_streak: self end |