# File lib/nanoc/base/result_data/item_rep.rb, line 238
    def compiled_content(params={})
      # Make sure we're not binary
      if self.item.binary?
        raise Nanoc::Errors::CannotGetCompiledContentOfBinaryItem.new(self)
      end

      # Notify
      Nanoc::NotificationCenter.post(:visit_started, self.item)
      Nanoc::NotificationCenter.post(:visit_ended,   self.item)

      # Get name of last pre-layout snapshot
      snapshot = params.fetch(:snapshot) { @content[:pre] ? :pre : :last }
      is_moving = [ :pre, :post, :last ].include?(snapshot)

      # Check existance of snapshot
      if !is_moving && snapshots.find { |s| s.first == snapshot && s.last == true }.nil?
        raise Nanoc::Errors::NoSuchSnapshot.new(self, snapshot)
      end

      # Require compilation
      if @content[snapshot].nil? || (!self.compiled? && is_moving)
        raise Nanoc::Errors::UnmetDependency.new(self)
      else
        @content[snapshot]
      end
    end