• Alex Kalderimis's avatar
    Add front-matter support to wiki pages · 786cc880
    Alex Kalderimis authored
    This adds wiki page front-matter parsing library code, behind a
    feature flag. The parser abstracts front-matter recognition and
    extraction and explanation of failure.
    
    The WikiPage model is provided with a new attribute `front_matter`,
    which is derived from the content. This attribute can be updated and
    serialized to the wiki-page repository.
    
    The feature flag is gated on a project-by-project basis.
    
    Front-matter parsing is unified across concerns, by
    re-using our existing front-matter parsing Regexp in the new
    front-matter parser, to ensure consistency.
    
    A new module, `Gitlab::WikiPages` is used by model and library code.
    
    `parse_string` is made a separate method so that different languages can
    be supported without modifying other code.
    786cc880
front_matter_parser.rb 3.04 KB