Sha256: 0292e96d018f4a919e9cd51769f22c3db6bf9057ff8a4b49eef389034cc3f2a8

Contents?: true

Size: 718 Bytes

Versions: 19

Compression:

Stored size: 718 Bytes

Contents

FS       = require 'fs'
Path     = require 'path'
Entities = require '../_entities'
Markdown = require '../tools/markdown'

module.exports = class Entities.Extra
  @name: "Extra"

  constructor: (@environment, @path) ->
    @name    = Path.relative(@environment.options.basedir, @path)
    @content = FS.readFileSync @path, 'utf-8'

    if @environment.options.debug
      Winston.info "Creating new Extra Entity"
      Winston.info " name: " + @name
      Winston.info " content: " + @content

    @parsed = if /\.(markdown|md)$/.test @path
      Markdown.convert(@content)
    else
      "<p>"+@content.replace(/\n/g, '<br/>')+"</p>"

  linkify: ->

  inspect: ->
    {
      path: @path,
      parsed: @parsed
    }

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ela-4.1.6 node_modules/codo/lib/entities/extra.coffee
ela-4.1.5 node_modules/codo/lib/entities/extra.coffee
ela-4.1.4 node_modules/codo/lib/entities/extra.coffee
ela-4.1.3 node_modules/codo/lib/entities/extra.coffee
ela-4.1.2 node_modules/codo/lib/entities/extra.coffee
ela-4.1.1 node_modules/codo/lib/entities/extra.coffee
ela-4.1.0 node_modules/codo/lib/entities/extra.coffee
ela-4.0.0 node_modules/codo/lib/entities/extra.coffee
ela-3.4.3 node_modules/codo/lib/entities/extra.coffee
ela-3.4.2 node_modules/codo/lib/entities/extra.coffee
ela-3.4.0 node_modules/codo/lib/entities/extra.coffee
ela-3.3.1 node_modules/codo/lib/entities/extra.coffee
ela-3.3.0 node_modules/codo/lib/entities/extra.coffee
ela-3.2.0 node_modules/codo/lib/entities/extra.coffee
ela-3.1.1 node_modules/codo/lib/entities/extra.coffee
ela-3.1.0 node_modules/codo/lib/entities/extra.coffee
ela-3.0.0 node_modules/codo/lib/entities/extra.coffee
ela-2.0.0 node_modules/codo/lib/entities/extra.coffee
ela-1.1.0 node_modules/codo/lib/entities/extra.coffee