Project rename
All checks were successful
CI Pipeline / build (push) Successful in 12s

This commit is contained in:
2025-12-02 13:21:13 +01:00
parent 29ebb9a8d1
commit dec346254c
36 changed files with 114 additions and 114 deletions

View File

@@ -1,28 +0,0 @@
# frozen_string_literal: true
require "nokogiri"
require_relative "ezdoc/version"
require_relative "ezdoc/nodes/base"
require_relative "ezdoc/nodes/run"
require_relative "ezdoc/nodes/image"
require_relative "ezdoc/nodes/paragraph"
require_relative "ezdoc/nodes/list"
require_relative "ezdoc/nodes/list_item"
require_relative "ezdoc/nodes/table"
require_relative "ezdoc/nodes/table_row"
require_relative "ezdoc/nodes/table_cell"
require_relative "ezdoc/image_dimensions"
require_relative "ezdoc/style"
require_relative "ezdoc/xml/content_types"
require_relative "ezdoc/xml/relationships"
require_relative "ezdoc/xml/document_xml"
require_relative "ezdoc/xml/numbering"
require_relative "ezdoc/xml/styles_xml"
require_relative "ezdoc/builder"
require_relative "ezdoc/package"
require_relative "ezdoc/document"
module Ezdoc
class Error < StandardError; end
end

28
lib/notare.rb Normal file
View File

@@ -0,0 +1,28 @@
# frozen_string_literal: true
require "nokogiri"
require_relative "notare/version"
require_relative "notare/nodes/base"
require_relative "notare/nodes/run"
require_relative "notare/nodes/image"
require_relative "notare/nodes/paragraph"
require_relative "notare/nodes/list"
require_relative "notare/nodes/list_item"
require_relative "notare/nodes/table"
require_relative "notare/nodes/table_row"
require_relative "notare/nodes/table_cell"
require_relative "notare/image_dimensions"
require_relative "notare/style"
require_relative "notare/xml/content_types"
require_relative "notare/xml/relationships"
require_relative "notare/xml/document_xml"
require_relative "notare/xml/numbering"
require_relative "notare/xml/styles_xml"
require_relative "notare/builder"
require_relative "notare/package"
require_relative "notare/document"
module Notare
class Error < StandardError; end
end

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Ezdoc
module Notare
module Builder
def p(text = nil, style: nil, &block)
para = Nodes::Paragraph.new(style: resolve_style(style))

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Ezdoc
module Notare
class Document
include Builder

View File

@@ -2,7 +2,7 @@
require "fastimage"
module Ezdoc
module Notare
class ImageDimensions
EMUS_PER_INCH = 914_400
DEFAULT_DPI = 96

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Ezdoc
module Notare
module Nodes
class Base
# Base class for all document nodes

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Ezdoc
module Notare
module Nodes
class Image < Base
attr_reader :path, :width_emu, :height_emu, :rid, :filename

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Ezdoc
module Notare
module Nodes
class List < Base
attr_reader :items, :type, :num_id

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Ezdoc
module Notare
module Nodes
class ListItem < Base
attr_reader :runs, :list_type, :num_id

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Ezdoc
module Notare
module Nodes
class Paragraph < Base
attr_reader :runs, :style

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Ezdoc
module Notare
module Nodes
class Run < Base
attr_reader :text, :bold, :italic, :underline, :style

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Ezdoc
module Notare
module Nodes
class Table < Base
attr_reader :rows

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Ezdoc
module Notare
module Nodes
class TableCell < Base
attr_reader :runs

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Ezdoc
module Notare
module Nodes
class TableRow < Base
attr_reader :cells

View File

@@ -2,7 +2,7 @@
require "zip"
module Ezdoc
module Notare
class Package
def initialize(document)
@document = document

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Ezdoc
module Notare
class Style
attr_reader :name, :bold, :italic, :underline, :color, :size, :font,
:align, :indent, :spacing_before, :spacing_after

View File

@@ -1,5 +1,5 @@
# frozen_string_literal: true
module Ezdoc
module Notare
VERSION = "0.0.1"
end

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Ezdoc
module Notare
module Xml
class ContentTypes
NAMESPACE = "http://schemas.openxmlformats.org/package/2006/content-types"

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Ezdoc
module Notare
module Xml
class DocumentXml
NAMESPACES = {

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Ezdoc
module Notare
module Xml
class Numbering
NAMESPACE = "http://schemas.openxmlformats.org/wordprocessingml/2006/main"

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Ezdoc
module Notare
module Xml
class Relationships
NAMESPACE = "http://schemas.openxmlformats.org/package/2006/relationships"

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Ezdoc
module Notare
module Xml
class StylesXml
NAMESPACE = "http://schemas.openxmlformats.org/wordprocessingml/2006/main"