<commit_before># This module groups all functions related to HTML export.
module MaRuKu

require 'nokogiri'
require 'maruku/string_utils'
	 
class MDDocument
	# Render as an HTML fragment (no head, just the content of BODY). (returns a string)
	def to_s5(context={})
		content_only = !context[:content_only].kind_of?(FalseClass)

		doc = Nokogiri::XML::Document.new

		if content_only
			body = Nokogiri::XML::Element.new('div', doc)
		else
			html = Nokogiri::XML::Element.new('html', doc)
			doc << html
			html.add_namespace(nil, 'http://www.w3.org/1999/xhtml')
			html.add_namespace('svg', "http://www.w3.org/2000/svg" )

			head = Nokogiri::XML::Element.new('head', html)<commit_msg>Rollback removal of s5_theme property<commit_after># This module groups all functions related to HTML export.
module MaRuKu

require 'nokogiri'
require 'maruku/string_utils'
	 
class MDDocument

	def s5_theme
	  html_escape(self.attributes[:slide_theme] || "default")
	end
		
	# Render as an HTML fragment (no head, just the content of BODY). (returns a string)
	def to_s5(context={})
		content_only = !context[:content_only].kind_of?(FalseClass)

		doc = Nokogiri::XML::Document.new

		if content_only
			body = Nokogiri::XML::Element.new('div', doc)
		else
			html = Nokogiri::XML::Element.new('html', doc)
			doc << html
			html.add_namespace(nil, 'http://www.w3.org/1999/xhtml')
			html.add_namespace('svg', "http://www.w3.org/2000/svg" )

			head = Nokogiri::XML::Element.new('head', html)
{'fraction_non_alphanumeric': 0.1417004048582996, 'fraction_numerical': 0.016194331983805668, 'mean_word_length': 4.638783269961977, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '640416', 'n_tokens_mistral': 580, 'n_tokens_neox': 516, 'n_words': 122}