2007-01-22 15:36:51 +01:00
|
|
|
# Copyright (C) 2006 Andrea Censi <andrea (at) rubyforge.org>
|
|
|
|
#
|
|
|
|
# This file is part of Maruku.
|
2010-06-05 04:36:31 +02:00
|
|
|
#
|
2007-01-22 15:36:51 +01:00
|
|
|
# Maruku is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
2010-06-05 04:36:31 +02:00
|
|
|
#
|
2007-01-22 15:36:51 +01:00
|
|
|
# Maruku is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2010-06-05 04:36:31 +02:00
|
|
|
#
|
2007-01-22 15:36:51 +01:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with Maruku; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
2010-06-05 04:36:31 +02:00
|
|
|
|
|
|
|
dir = File.dirname(__FILE__)
|
|
|
|
$LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
|
2007-01-22 15:36:51 +01:00
|
|
|
|
|
|
|
require 'rexml/document'
|
|
|
|
|
|
|
|
module MaRuKu
|
2010-06-05 04:36:31 +02:00
|
|
|
module In
|
|
|
|
module Markdown
|
|
|
|
module SpanLevelParser; end
|
|
|
|
module BlockLevelParser; end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
module Out
|
|
|
|
module Markdown; end
|
|
|
|
module HTML; end
|
|
|
|
module Latex; end
|
|
|
|
end
|
|
|
|
|
|
|
|
module Strings; end
|
|
|
|
|
|
|
|
module Helpers; end
|
|
|
|
|
|
|
|
module Errors; end
|
|
|
|
|
|
|
|
class MDElement
|
|
|
|
include REXML
|
|
|
|
include MaRuKu
|
|
|
|
include Out::Markdown
|
|
|
|
include Out::HTML
|
|
|
|
include Out::Latex
|
|
|
|
include Strings
|
|
|
|
include Helpers
|
|
|
|
include Errors
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
class MDDocument < MDElement
|
|
|
|
include In::Markdown
|
|
|
|
include In::Markdown::SpanLevelParser
|
|
|
|
include In::Markdown::BlockLevelParser
|
|
|
|
end
|
2007-01-22 15:36:51 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
class Maruku < MaRuKu::MDDocument; end
|
|
|
|
|
|
|
|
|
|
|
|
# Structures definition
|
|
|
|
require 'maruku/structures'
|
|
|
|
require 'maruku/structures_inspect'
|
|
|
|
|
|
|
|
require 'maruku/defaults'
|
|
|
|
# Less typing
|
|
|
|
require 'maruku/helpers'
|
|
|
|
|
|
|
|
# Code for parsing whole Markdown documents
|
|
|
|
require 'maruku/input/parse_doc'
|
|
|
|
|
|
|
|
# Ugly things kept in a closet
|
|
|
|
require 'maruku/string_utils'
|
|
|
|
require 'maruku/input/linesource'
|
|
|
|
require 'maruku/input/type_detection'
|
|
|
|
|
|
|
|
# A class for reading and sanitizing inline HTML
|
|
|
|
require 'maruku/input/html_helper'
|
|
|
|
|
|
|
|
# Code for parsing Markdown block-level elements
|
|
|
|
require 'maruku/input/parse_block'
|
|
|
|
|
|
|
|
# Code for parsing Markdown span-level elements
|
|
|
|
require 'maruku/input/charsource'
|
|
|
|
require 'maruku/input/parse_span_better'
|
|
|
|
require 'maruku/input/rubypants'
|
|
|
|
|
|
|
|
require 'maruku/input/extensions'
|
|
|
|
|
|
|
|
require 'maruku/attributes'
|
|
|
|
|
|
|
|
require 'maruku/structures_iterators'
|
|
|
|
|
2010-06-05 04:36:31 +02:00
|
|
|
require 'maruku/errors'
|
2007-01-22 15:36:51 +01:00
|
|
|
|
|
|
|
# Code for creating a table of contents
|
|
|
|
require 'maruku/toc'
|
|
|
|
|
2008-10-15 17:29:35 +02:00
|
|
|
# Support for div Markdown extension
|
|
|
|
require 'maruku/ext/div'
|
2009-12-31 22:54:01 +01:00
|
|
|
# Support for fenced codeblocks extension
|
|
|
|
require 'maruku/ext/fenced_code'
|
2008-10-15 17:29:35 +02:00
|
|
|
|
2007-01-22 15:36:51 +01:00
|
|
|
# Version and URL
|
|
|
|
require 'maruku/version'
|
|
|
|
|
|
|
|
|
|
|
|
# Exporting to html
|
|
|
|
require 'maruku/output/to_html'
|
|
|
|
|
|
|
|
# Exporting to latex
|
|
|
|
require 'maruku/output/to_latex'
|
|
|
|
require 'maruku/output/to_latex_strings'
|
|
|
|
require 'maruku/output/to_latex_entities'
|
|
|
|
|
|
|
|
# Pretty print
|
|
|
|
require 'maruku/output/to_markdown'
|
|
|
|
|
2007-02-17 06:40:06 +01:00
|
|
|
# S5 slides
|
|
|
|
require 'maruku/output/s5/to_s5'
|
|
|
|
require 'maruku/output/s5/fancy'
|
|
|
|
|
2007-01-22 15:36:51 +01:00
|
|
|
# Exporting to text: strips all formatting (not complete)
|
|
|
|
require 'maruku/output/to_s'
|
|
|
|
|
|
|
|
# class Maruku is the global interface
|
|
|
|
require 'maruku/maruku'
|