From 05f888aa65825e3477495c11c9c3dfbfde41fcc4 Mon Sep 17 00:00:00 2001 From: MuhammetDilmac Date: Tue, 13 Jun 2017 11:01:29 +0300 Subject: [PATCH 1/9] Initial commit --- .gitignore | 13 +++++++ .rspec | 2 ++ .travis.yml | 5 +++ CODE_OF_CONDUCT.md | 74 ++++++++++++++++++++++++++++++++++++++++ Gemfile | 4 +++ Html2Docx.gemspec | 36 +++++++++++++++++++ LICENSE.txt | 21 ++++++++++++ README.md | 43 +++++++++++++++++++++++ Rakefile | 6 ++++ bin/console | 14 ++++++++ bin/setup | 8 +++++ lib/Html2Docx.rb | 5 +++ lib/Html2Docx/version.rb | 3 ++ spec/Html2Docx_spec.rb | 11 ++++++ spec/spec_helper.rb | 14 ++++++++ 15 files changed, 259 insertions(+) create mode 100644 .gitignore create mode 100644 .rspec create mode 100644 .travis.yml create mode 100644 CODE_OF_CONDUCT.md create mode 100644 Gemfile create mode 100644 Html2Docx.gemspec create mode 100644 LICENSE.txt create mode 100644 README.md create mode 100644 Rakefile create mode 100755 bin/console create mode 100755 bin/setup create mode 100644 lib/Html2Docx.rb create mode 100644 lib/Html2Docx/version.rb create mode 100644 spec/Html2Docx_spec.rb create mode 100644 spec/spec_helper.rb diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e4a4025 --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +/.bundle/ +/.yardoc +/Gemfile.lock +/_yardoc/ +/coverage/ +/doc/ +/pkg/ +/spec/reports/ +/tmp/ +/.idea/ + +# rspec failure tracking +.rspec_status diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..8c18f1a --- /dev/null +++ b/.rspec @@ -0,0 +1,2 @@ +--format documentation +--color diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..fdf34d4 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +sudo: false +language: ruby +rvm: + - 2.4.0 +before_install: gem install bundler -v 1.15.1 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..9e8fc35 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at iletisim@muhammetdilmac.com.tr. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..31a6b27 --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source "https://rubygems.org" + +# Specify your gem's dependencies in Html2Docx.gemspec +gemspec diff --git a/Html2Docx.gemspec b/Html2Docx.gemspec new file mode 100644 index 0000000..2f77748 --- /dev/null +++ b/Html2Docx.gemspec @@ -0,0 +1,36 @@ +# coding: utf-8 +lib = File.expand_path("../lib", __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require "Html2Docx/version" + +Gem::Specification.new do |spec| + spec.name = "Html2Docx" + spec.version = Html2Docx::VERSION + spec.authors = ["MuhammetDilmac"] + spec.email = ["iletisim@muhammetdilmac.com.tr"] + + spec.summary = %q{TODO: Write a short summary, because Rubygems requires one.} + spec.description = %q{TODO: Write a longer description or delete this line.} + spec.homepage = "TODO: Put your gem's website or public repo URL here." + spec.license = "MIT" + + # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' + # to allow pushing to a single host or delete this section to allow pushing to any host. + if spec.respond_to?(:metadata) + spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'" + else + raise "RubyGems 2.0 or newer is required to protect against " \ + "public gem pushes." + end + + spec.files = `git ls-files -z`.split("\x0").reject do |f| + f.match(%r{^(test|spec|features)/}) + end + spec.bindir = "exe" + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + spec.require_paths = ["lib"] + + spec.add_development_dependency "bundler", "~> 1.15" + spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "rspec", "~> 3.0" +end diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..12726af --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 MuhammetDilmac + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..ebdc036 --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ +# Html2Docx + +Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/Html2Docx`. To experiment with that code, run `bin/console` for an interactive prompt. + +TODO: Delete this and the text above, and describe your gem + +## Installation + +Add this line to your application's Gemfile: + +```ruby +gem 'Html2Docx' +``` + +And then execute: + + $ bundle + +Or install it yourself as: + + $ gem install Html2Docx + +## Usage + +TODO: Write usage instructions here + +## Development + +After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. + +To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). + +## Contributing + +Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/Html2Docx. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. + +## License + +The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). + +## Code of Conduct + +Everyone interacting in the Html2Docx project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/Html2Docx/blob/master/CODE_OF_CONDUCT.md). diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..b7e9ed5 --- /dev/null +++ b/Rakefile @@ -0,0 +1,6 @@ +require "bundler/gem_tasks" +require "rspec/core/rake_task" + +RSpec::Core::RakeTask.new(:spec) + +task :default => :spec diff --git a/bin/console b/bin/console new file mode 100755 index 0000000..74a7d22 --- /dev/null +++ b/bin/console @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby + +require "bundler/setup" +require "Html2Docx" + +# You can add fixtures and/or initialization code here to make experimenting +# with your gem easier. You can also use a different console, if you like. + +# (If you use this, don't forget to add pry to your Gemfile!) +# require "pry" +# Pry.start + +require "irb" +IRB.start(__FILE__) diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..dce67d8 --- /dev/null +++ b/bin/setup @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail +IFS=$'\n\t' +set -vx + +bundle install + +# Do any other automated setup that you need to do here diff --git a/lib/Html2Docx.rb b/lib/Html2Docx.rb new file mode 100644 index 0000000..e0aa189 --- /dev/null +++ b/lib/Html2Docx.rb @@ -0,0 +1,5 @@ +require "Html2Docx/version" + +module Html2Docx + # Your code goes here... +end diff --git a/lib/Html2Docx/version.rb b/lib/Html2Docx/version.rb new file mode 100644 index 0000000..5279c6b --- /dev/null +++ b/lib/Html2Docx/version.rb @@ -0,0 +1,3 @@ +module Html2Docx + VERSION = "0.1.0" +end diff --git a/spec/Html2Docx_spec.rb b/spec/Html2Docx_spec.rb new file mode 100644 index 0000000..b8625ef --- /dev/null +++ b/spec/Html2Docx_spec.rb @@ -0,0 +1,11 @@ +require "spec_helper" + +RSpec.describe Html2Docx do + it "has a version number" do + expect(Html2Docx::VERSION).not_to be nil + end + + it "does something useful" do + expect(false).to eq(true) + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..29b2730 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,14 @@ +require "bundler/setup" +require "Html2Docx" + +RSpec.configure do |config| + # Enable flags like --only-failures and --next-failure + config.example_status_persistence_file_path = ".rspec_status" + + # Disable RSpec exposing methods globally on `Module` and `main` + config.disable_monkey_patching! + + config.expect_with :rspec do |c| + c.syntax = :expect + end +end From afc70ec2a96d16e60c7146a3b007e7047ec12d81 Mon Sep 17 00:00:00 2001 From: MuhammetDilmac Date: Tue, 13 Jun 2017 11:08:11 +0300 Subject: [PATCH 2/9] =?UTF-8?q?*=20Html2Docx.gemspec=20dosyas=C4=B1nda=20g?= =?UTF-8?q?ereksiz=20yorum=20sat=C4=B1rlar=C4=B1=20temizlendi=20*=20Html2D?= =?UTF-8?q?ocx.gemspec=20dosyas=C4=B1nda=20gereksiz=20yere=20kullan=C4=B1l?= =?UTF-8?q?an=20=C3=A7ift=20t=C4=B1rnak=20ibareleri=20temizlendi=20*=20Htm?= =?UTF-8?q?l2Docx.gemspec=20dosyas=C4=B1na=20summary,=20description=20gibi?= =?UTF-8?q?=20alanlar=20dolduruldu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Html2Docx.gemspec | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/Html2Docx.gemspec b/Html2Docx.gemspec index 2f77748..52851b8 100644 --- a/Html2Docx.gemspec +++ b/Html2Docx.gemspec @@ -1,36 +1,29 @@ # coding: utf-8 -lib = File.expand_path("../lib", __FILE__) +lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require "Html2Docx/version" +require 'Html2Docx/version' Gem::Specification.new do |spec| - spec.name = "Html2Docx" + spec.name = 'Html2Docx' spec.version = Html2Docx::VERSION - spec.authors = ["MuhammetDilmac"] - spec.email = ["iletisim@muhammetdilmac.com.tr"] + spec.authors = ['MuhammetDilmac'] + spec.email = ['iletisim@muhammetdilmac.com.tr'] - spec.summary = %q{TODO: Write a short summary, because Rubygems requires one.} - spec.description = %q{TODO: Write a longer description or delete this line.} - spec.homepage = "TODO: Put your gem's website or public repo URL here." - spec.license = "MIT" - - # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' - # to allow pushing to a single host or delete this section to allow pushing to any host. - if spec.respond_to?(:metadata) - spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'" - else - raise "RubyGems 2.0 or newer is required to protect against " \ - "public gem pushes." - end + spec.summary = 'HTML çıktısından Docx oluşturmayı sağlayan ruby' \ + 'kütüphanesi' + spec.description = 'Kendisine özel olarak oluşturulan html çıktısını ' \ + 'işleyerek bu çıktıdan Docx üretmeyi sağlayan ruby ' \ + 'kütüphanesi' + spec.homepage = 'https://www.github.com/MuhammetDilmac/Html2Docx' + spec.license = 'MIT' spec.files = `git ls-files -z`.split("\x0").reject do |f| f.match(%r{^(test|spec|features)/}) end - spec.bindir = "exe" spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } - spec.require_paths = ["lib"] + spec.require_paths = ['lib'] - spec.add_development_dependency "bundler", "~> 1.15" - spec.add_development_dependency "rake", "~> 10.0" - spec.add_development_dependency "rspec", "~> 3.0" + spec.add_development_dependency 'bundler', '~> 1.15' + spec.add_development_dependency 'rake', '~> 10.0' + spec.add_development_dependency 'rspec', '~> 3.0' end From 40b313173999932604eb214c66c603af9c8a4c71 Mon Sep 17 00:00:00 2001 From: MuhammetDilmac Date: Wed, 14 Jun 2017 17:23:21 +0300 Subject: [PATCH 3/9] =?UTF-8?q?*=20Temp=20dizini=20d=C3=BCzg=C3=BCn=20olar?= =?UTF-8?q?ak=20olu=C5=9Fturulmu=C5=9F=20mu=20diye=20kontrol=20ediliyor.?= =?UTF-8?q?=20*=20=C4=B0skelet=20dizininde=20ki=20dosyalar=20temp=20dizini?= =?UTF-8?q?ne=20ta=C5=9F=C4=B1n=C4=B1yor.=20*=20=C4=B0skelet=20dizinine=20?= =?UTF-8?q?bo=C5=9F=20bir=20word=20dosyas=C4=B1n=C4=B1n=20xml'leri=20at?= =?UTF-8?q?=C4=B1ld=C4=B1.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Html2Docx.rb | 14 +- lib/Html2Docx/initialization.rb | 28 ++ skell/[Content_Types].xml | 19 ++ skell/_rels/.rels | 1 + skell/docProps/app.xml | 1 + skell/docProps/core.xml | 1 + skell/word/_rels/document2.xml.rels | 1 + skell/word/document2.xml | 29 ++ skell/word/fontTable.xml | 28 ++ skell/word/settings.xml | 51 ++++ skell/word/styles.xml | 399 ++++++++++++++++++++++++++++ skell/word/theme/theme1.xml | 260 ++++++++++++++++++ skell/word/webSettings.xml | 2 + 13 files changed, 832 insertions(+), 2 deletions(-) create mode 100644 lib/Html2Docx/initialization.rb create mode 100644 skell/[Content_Types].xml create mode 100644 skell/_rels/.rels create mode 100644 skell/docProps/app.xml create mode 100644 skell/docProps/core.xml create mode 100644 skell/word/_rels/document2.xml.rels create mode 100644 skell/word/document2.xml create mode 100644 skell/word/fontTable.xml create mode 100644 skell/word/settings.xml create mode 100644 skell/word/styles.xml create mode 100644 skell/word/theme/theme1.xml create mode 100644 skell/word/webSettings.xml diff --git a/lib/Html2Docx.rb b/lib/Html2Docx.rb index e0aa189..b82d473 100644 --- a/lib/Html2Docx.rb +++ b/lib/Html2Docx.rb @@ -1,5 +1,15 @@ -require "Html2Docx/version" +require 'fileutils' + +require 'Html2Docx/version' +require 'Html2Docx/initialization' module Html2Docx - # Your code goes here... + ROOT_PATH = File.expand_path(File.join(File.dirname(__FILE__), '../')) + TEMP_PATH = Dir.mktmpdir + + def self.start(options = {}) + initialization = Initialization.new(options) + end end + +Html2Docx.start \ No newline at end of file diff --git a/lib/Html2Docx/initialization.rb b/lib/Html2Docx/initialization.rb new file mode 100644 index 0000000..510ef8d --- /dev/null +++ b/lib/Html2Docx/initialization.rb @@ -0,0 +1,28 @@ +module Html2Docx + class Initialization + def initialize(options = {}) + @skell_directory = File.join(ROOT_PATH, 'skell') + + check_temp_directory + copy_skell_directory + end + + def check_temp_directory + unless Dir.exist?(TEMP_PATH) and File.writable?(TEMP_PATH) + raise "Initialization failed. Temp directory is not created success. Temp Directory: #{TEMP_PATH}" + end + end + + def copy_skell_directory + FileUtils.copy_entry @skell_directory, TEMP_PATH + + check_sync_skell_to_temp + end + + def check_sync_skell_to_temp + unless Dir.entries(TEMP_PATH).length == Dir.entries(@skell_directory).length + raise "Initialization failed. Temp directory is not syncronize to skell directory. Temp Directory: #{TEMP_PATH}" + end + end + end +end \ No newline at end of file diff --git a/skell/[Content_Types].xml b/skell/[Content_Types].xml new file mode 100644 index 0000000..035e8db --- /dev/null +++ b/skell/[Content_Types].xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/skell/_rels/.rels b/skell/_rels/.rels new file mode 100644 index 0000000..0afe5c3 --- /dev/null +++ b/skell/_rels/.rels @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/skell/docProps/app.xml b/skell/docProps/app.xml new file mode 100644 index 0000000..e0018a8 --- /dev/null +++ b/skell/docProps/app.xml @@ -0,0 +1 @@ +0100Microsoft Office Word000falsefalse0falsefalse15.0000Normal.dotm \ No newline at end of file diff --git a/skell/docProps/core.xml b/skell/docProps/core.xml new file mode 100644 index 0000000..0e661b9 --- /dev/null +++ b/skell/docProps/core.xml @@ -0,0 +1 @@ +2017-06-13T08:15:35.2330238Z2012-08-07T16:44:00.0000000ZMuhammet DILMAC (ADEO) \ No newline at end of file diff --git a/skell/word/_rels/document2.xml.rels b/skell/word/_rels/document2.xml.rels new file mode 100644 index 0000000..d9d3612 --- /dev/null +++ b/skell/word/_rels/document2.xml.rels @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/skell/word/document2.xml b/skell/word/document2.xml new file mode 100644 index 0000000..fce9df1 --- /dev/null +++ b/skell/word/document2.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/skell/word/fontTable.xml b/skell/word/fontTable.xml new file mode 100644 index 0000000..bc94965 --- /dev/null +++ b/skell/word/fontTable.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/skell/word/settings.xml b/skell/word/settings.xml new file mode 100644 index 0000000..7d5f2e9 --- /dev/null +++ b/skell/word/settings.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/skell/word/styles.xml b/skell/word/styles.xml new file mode 100644 index 0000000..7e6cadb --- /dev/null +++ b/skell/word/styles.xml @@ -0,0 +1,399 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/skell/word/theme/theme1.xml b/skell/word/theme/theme1.xml new file mode 100644 index 0000000..6e0c033 --- /dev/null +++ b/skell/word/theme/theme1.xml @@ -0,0 +1,260 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/skell/word/webSettings.xml b/skell/word/webSettings.xml new file mode 100644 index 0000000..be9f295 --- /dev/null +++ b/skell/word/webSettings.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file From 96aed1badd351e1791d49f66dbe365db83fc9aaf Mon Sep 17 00:00:00 2001 From: MuhammetDilmac Date: Wed, 14 Jun 2017 18:17:40 +0300 Subject: [PATCH 4/9] =?UTF-8?q?*=20Nokogiri=20gemi=20eklendi=20*=20Content?= =?UTF-8?q?Types=20dosyas=C4=B1n=C4=B1n=20y=C3=B6netmek=20i=C3=A7in=20init?= =?UTF-8?q?ial=20ve=20render=20fonksiyonlar=C4=B1=20yaz=C4=B1ld=C4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Html2Docx.gemspec | 1 + lib/Html2Docx.rb | 15 ++++++++++++ lib/Html2Docx/content_types.rb | 45 ++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 lib/Html2Docx/content_types.rb diff --git a/Html2Docx.gemspec b/Html2Docx.gemspec index 52851b8..d67cd1f 100644 --- a/Html2Docx.gemspec +++ b/Html2Docx.gemspec @@ -26,4 +26,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'bundler', '~> 1.15' spec.add_development_dependency 'rake', '~> 10.0' spec.add_development_dependency 'rspec', '~> 3.0' + spec.add_development_dependency 'nokogiri', '~> 1.6', '>= 1.6.8' end diff --git a/lib/Html2Docx.rb b/lib/Html2Docx.rb index b82d473..3823a88 100644 --- a/lib/Html2Docx.rb +++ b/lib/Html2Docx.rb @@ -1,14 +1,29 @@ require 'fileutils' +require 'nokogiri' require 'Html2Docx/version' require 'Html2Docx/initialization' +require 'Html2Docx/content_types' module Html2Docx ROOT_PATH = File.expand_path(File.join(File.dirname(__FILE__), '../')) TEMP_PATH = Dir.mktmpdir def self.start(options = {}) + # Initialization initialization = Initialization.new(options) + content_types = ContentTypes.new(options) + + # Render + content_types.render + end + + def self.temp_path + TEMP_PATH + end + + def self.root_path + ROOT_PATH end end diff --git a/lib/Html2Docx/content_types.rb b/lib/Html2Docx/content_types.rb new file mode 100644 index 0000000..204d73a --- /dev/null +++ b/lib/Html2Docx/content_types.rb @@ -0,0 +1,45 @@ +module Html2Docx + class ContentTypes + def initialize(options = {}) + @content_type_file = File.join(TEMP_PATH, '[Content_Types].xml') + @content_type = File.open(@content_type_file) { |f| Nokogiri::XML(f) } + @types = @content_type.css('Types') + @parts = { default: [], override: [] } + + initial_parts + end + + def initial_parts + @types.children.each do |child| + if child.name == 'Default' + @parts[:default].push( { extension: child.attr('Extension'), content_type: child.attr('ContentType') } ) + elsif child.name == 'Override' + @parts[:override].push( { part_name: child.attr('PartName'), content_type: child.attr('ContentType') } ) + end + end + + @types.remove + end + + def add_parts(object) + if object.fetch(:type) == 'Default' + @parts[:default].push( { extension: object.fetch(:extension), content_type: object.fetch(:content_type) } ) + elsif object.fetch(:type) == 'Override' + @parts[:override].push( { part_name: object.fetch(:part_name), content_type: object.fetch(:content_type) } ) + end + end + + def render + @parts.fetch(:default).each { |child| add_child child } + @parts.fetch(:override).each { |child| add_child child } + end + + def add_child(child) + node = Nokogiri::XML::Node.new('Default', @content_type) + node['Extension'] = child.fetch(:extension) + node['ContentType'] = child.fetch(:content_type) + + @types.add_child(node) + end + end +end \ No newline at end of file From 0b855cd967336643068219b58dc50b127a814378 Mon Sep 17 00:00:00 2001 From: MuhammetDilmac Date: Fri, 16 Jun 2017 12:59:02 +0300 Subject: [PATCH 5/9] =?UTF-8?q?DocumentInitializing=20D=C3=B6k=C3=BCman=20?= =?UTF-8?q?olu=C5=9Fturmay=C4=B1=20ve=20y=C3=B6netmeyi=20sa=C4=9Flayan=20a?= =?UTF-8?q?na=20s=C4=B1n=C4=B1f=C4=B1m=C4=B1z=20olan=20Document=20s=C4=B1n?= =?UTF-8?q?=C4=B1f=C4=B1=20render=20ve=20add=5Fhtml=20metodlar=C4=B1=20ile?= =?UTF-8?q?=20olu=C5=9Fturuldu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Html2Docx.rb | 3 ++ lib/Html2Docx/content_types.rb | 6 ++-- lib/Html2Docx/document.rb | 57 ++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 lib/Html2Docx/document.rb diff --git a/lib/Html2Docx.rb b/lib/Html2Docx.rb index 3823a88..493038e 100644 --- a/lib/Html2Docx.rb +++ b/lib/Html2Docx.rb @@ -4,6 +4,7 @@ require 'Html2Docx/version' require 'Html2Docx/initialization' require 'Html2Docx/content_types' +require 'Html2Docx/document' module Html2Docx ROOT_PATH = File.expand_path(File.join(File.dirname(__FILE__), '../')) @@ -13,8 +14,10 @@ def self.start(options = {}) # Initialization initialization = Initialization.new(options) content_types = ContentTypes.new(options) + document = Document.new(options) # Render + document.render content_types.render end diff --git a/lib/Html2Docx/content_types.rb b/lib/Html2Docx/content_types.rb index 204d73a..030df64 100644 --- a/lib/Html2Docx/content_types.rb +++ b/lib/Html2Docx/content_types.rb @@ -36,10 +36,10 @@ def render def add_child(child) node = Nokogiri::XML::Node.new('Default', @content_type) - node['Extension'] = child.fetch(:extension) - node['ContentType'] = child.fetch(:content_type) + node['Extension'] = child.fetch(:extension, '') + node['ContentType'] = child.fetch(:content_type, '') - @types.add_child(node) + @types << node end end end \ No newline at end of file diff --git a/lib/Html2Docx/document.rb b/lib/Html2Docx/document.rb new file mode 100644 index 0000000..5df2b59 --- /dev/null +++ b/lib/Html2Docx/document.rb @@ -0,0 +1,57 @@ +module Html2Docx + class Document + def initialize(options = {}) + @document_file = File.join(TEMP_PATH, 'word', 'document2.xml') + @document = File.open(@document_file) { |f| Nokogiri::XML(f) } + @body = @document.css('w:body') + @contents = [] + + initial_body + end + + def initial_body + @body.remove + end + + def add_html(html) + html = Nokogiri::HTML(html.gsub!(/\sl\s+|\n/, ' ')) + + elements = html.css('body') + + elements.children.each do |element| + case element.name + when 'p' + # Add paragraph + @contents.push '' + when 'table' + # Add table + @contents.push '' + end + end + end + + def render + @contents.each do |content| + @body << content + end + + @body << sectPr + + File.open(@document_file, 'w') { |f| f.write(@document.to_xml) } + end + + def sectPr + Nokogiri::XML::Builder.new do |xml| + xml.send('w:sectPr') do + xml.send('w:pgSz', { 'w:w' => '12240', 'w:h' => '15840' }) + xml.send('w:pgMar', { + 'w:top' => '1440', 'w:right' => '1440', 'w:bottom' => '1440', 'w:left' => '1440', + 'w:header' => '720', 'w:footer' => '720', 'w:gutter' => '0' + }) + xml.send('w:cols', { 'w:space' => '720' }) + xml.send('w:docGrid', { 'w:linePitch' => 360 }) + end + end.root + end + end +end \ No newline at end of file From de07f579e9e0604394912158917f5c87be65d783 Mon Sep 17 00:00:00 2001 From: MuhammetDilmac Date: Wed, 21 Jun 2017 18:07:03 +0300 Subject: [PATCH 6/9] =?UTF-8?q?ParagraphInitializing=20Merge=20*=20Skell?= =?UTF-8?q?=20dizininde=20bozulan=20dosyalar=20d=C3=BCzeltildi.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Paragrafa ait stil olarak arka plan rengi, yazı hizalaması, satır yüksekliği ve satır girintisi eklendi. * Yazı rengi; `

Html2Docx

` * Yazı Hizalaması: `

Html2Docx

` * Satır Yüksekliği: `

Html2Docx

` * Satır Girintisi: `

Html2Docx

` * Paragraf içinde kalın yazı, altı çizili yazı, üstü çizili yazı, italik yazı ve yazı rengi özellikleri eklendi. * Kalın yazı; `

Html2Docx<

` * Altı çizili yazı: `

Html2Docx

` * Üstü çizili yazı: `

Html2Docx

` * İtalik yazı: `

Html2Docx

` * Yazı Rengi: `

Html2Docx

` Örnek Girgi & Çıktı: [Html2Docx Paragraph Initialization](https://twitter.com/m_dilmac/status/877545135646666752) --- NOTICE.md | 14 + lib/Html2Docx.rb | 36 +- lib/Html2Docx/content_types.rb | 36 +- lib/Html2Docx/document.rb | 68 +- lib/Html2Docx/document_objects/paragraph.rb | 167 ++++ lib/Html2Docx/helpers/document_helper.rb | 25 + lib/Html2Docx/helpers/nokogiri_helper.rb | 11 + lib/Html2Docx/relation.rb | 49 ++ lib/Html2Docx/version.rb | 4 +- skell/[Content_Types].xml | 20 +- skell/word/document2.xml | 30 +- skell/word/fontTable.xml | 29 +- skell/word/settings.xml | 52 +- skell/word/styles.xml | 828 ++++++++++---------- 14 files changed, 810 insertions(+), 559 deletions(-) create mode 100644 NOTICE.md create mode 100644 lib/Html2Docx/document_objects/paragraph.rb create mode 100644 lib/Html2Docx/helpers/document_helper.rb create mode 100644 lib/Html2Docx/helpers/nokogiri_helper.rb create mode 100644 lib/Html2Docx/relation.rb diff --git a/NOTICE.md b/NOTICE.md new file mode 100644 index 0000000..43983da --- /dev/null +++ b/NOTICE.md @@ -0,0 +1,14 @@ +# Document +## Paragraph +### Style Attribute +* text-align (justify, center, left, right). (`

`) +* text-indent (px). (`

`) +* background-color (Hex Color). (`

`) +* line-height (Number). (`

`) + +### Tags +* `` +* `` +* `` +* `` +* `` \ No newline at end of file diff --git a/lib/Html2Docx.rb b/lib/Html2Docx.rb index 493038e..216ad7f 100644 --- a/lib/Html2Docx.rb +++ b/lib/Html2Docx.rb @@ -1,24 +1,47 @@ require 'fileutils' require 'nokogiri' +require 'Html2Docx/helpers/document_helper' +require 'Html2Docx/helpers/nokogiri_helper' + require 'Html2Docx/version' require 'Html2Docx/initialization' require 'Html2Docx/content_types' +require 'Html2Docx/relation' require 'Html2Docx/document' +require 'Html2Docx/document_objects/paragraph' module Html2Docx ROOT_PATH = File.expand_path(File.join(File.dirname(__FILE__), '../')) TEMP_PATH = Dir.mktmpdir def self.start(options = {}) - # Initialization initialization = Initialization.new(options) + content_types = ContentTypes.new(options) + + options[:main_relation] = true + relation = Relation.new(options) + + options[:html] = <<-HTML + + + +

Lorem Ipsum, dizgi ve baskı endüstrisinde kullanılan mıgır metinlerdir.

+

Lorem Ipsum, adı bilinmeyen bir matbaacının bir hurufat numune kitabı oluşturmak üzere bir yazı galerisini alarak karıştırdığı 1500'lerden beri endüstri standardı sahte metinler olarak kullanılmıştır.

+

Beşyüz yıl boyunca varlığını sürdürmekle kalmamış, aynı zamanda pek değişmeden elektronik dizgiye de sıçramıştır.

+

1960'larda Lorem Ipsum pasajları da içeren Letraset yapraklarının yayınlanması ile ve yakın zamanda Aldus PageMaker gibi Lorem Ipsum sürümleri içeren masaüstü yayıncılık yazılımları ile popüler olmuştur.

+

Yaygın inancın tersine, Lorem Ipsum rastgele sözcüklerden oluşmaz.

+

Kökleri M.Ö. 45 tarihinden bu yana klasik Latin edebiyatına kadar uzanan 2000 yıllık bir geçmişi vardır.

+ + + HTML document = Document.new(options) # Render document.render content_types.render + relation.render end def self.temp_path @@ -28,6 +51,17 @@ def self.temp_path def self.root_path ROOT_PATH end + + def self.clear_temp + FileUtils.rm_r TEMP_PATH + end + + def self.get_file(value) + file_path = File.join(TEMP_PATH, value) + file_content = File.read(file_path) + + puts file_content + end end Html2Docx.start \ No newline at end of file diff --git a/lib/Html2Docx/content_types.rb b/lib/Html2Docx/content_types.rb index 030df64..816f133 100644 --- a/lib/Html2Docx/content_types.rb +++ b/lib/Html2Docx/content_types.rb @@ -2,44 +2,50 @@ module Html2Docx class ContentTypes def initialize(options = {}) @content_type_file = File.join(TEMP_PATH, '[Content_Types].xml') - @content_type = File.open(@content_type_file) { |f| Nokogiri::XML(f) } - @types = @content_type.css('Types') - @parts = { default: [], override: [] } - + @content_type = File.open(@content_type_file) {|f| Nokogiri::XML(f)} + @parts = {default: [], override: []} initial_parts end def initial_parts - @types.children.each do |child| + @content_type.root.children.each do |child| if child.name == 'Default' - @parts[:default].push( { extension: child.attr('Extension'), content_type: child.attr('ContentType') } ) + @parts[:default].push({extension: child.attr('Extension'), content_type: child.attr('ContentType')}) elsif child.name == 'Override' - @parts[:override].push( { part_name: child.attr('PartName'), content_type: child.attr('ContentType') } ) + @parts[:override].push({part_name: child.attr('PartName'), content_type: child.attr('ContentType')}) end - end - @types.remove + child.remove + end end def add_parts(object) if object.fetch(:type) == 'Default' - @parts[:default].push( { extension: object.fetch(:extension), content_type: object.fetch(:content_type) } ) + @parts[:default].push({extension: object.fetch(:extension), content_type: object.fetch(:content_type)}) elsif object.fetch(:type) == 'Override' - @parts[:override].push( { part_name: object.fetch(:part_name), content_type: object.fetch(:content_type) } ) + @parts[:override].push({part_name: object.fetch(:part_name), content_type: object.fetch(:content_type)}) end end def render - @parts.fetch(:default).each { |child| add_child child } - @parts.fetch(:override).each { |child| add_child child } + @parts.fetch(:default).each { |child| add_default child} + @parts.fetch(:override).each { |child| add_override child} + + File.open(@content_type_file, 'w') {|f| f.write Helpers::NokogiriHelper.to_xml(@content_type)} end - def add_child(child) + def add_default(child) node = Nokogiri::XML::Node.new('Default', @content_type) node['Extension'] = child.fetch(:extension, '') node['ContentType'] = child.fetch(:content_type, '') + @content_type.root << node + end - @types << node + def add_override(child) + node = Nokogiri::XML::Node.new('Override', @content_type) + node['PartName'] = child.fetch(:part_name, '') + node['ContentType'] = child.fetch(:content_type, '') + @content_type.root << node end end end \ No newline at end of file diff --git a/lib/Html2Docx/document.rb b/lib/Html2Docx/document.rb index 5df2b59..30a1740 100644 --- a/lib/Html2Docx/document.rb +++ b/lib/Html2Docx/document.rb @@ -3,14 +3,17 @@ class Document def initialize(options = {}) @document_file = File.join(TEMP_PATH, 'word', 'document2.xml') @document = File.open(@document_file) { |f| Nokogiri::XML(f) } - @body = @document.css('w:body') + @body = @document.at_xpath('//w:body') @contents = [] initial_body + add_html(options[:html]) end def initial_body - @body.remove + @body.children.each do |child| + child.remove + end end def add_html(html) @@ -22,7 +25,9 @@ def add_html(html) case element.name when 'p' # Add paragraph - @contents.push '' + paragraph = DocumentObjects::Paragraph.new(@document, nil) + paragraph.add_paragraph(element) + @contents.push paragraph.render when 'table' # Add table @contents.push '' @@ -37,21 +42,54 @@ def render @body << sectPr - File.open(@document_file, 'w') { |f| f.write(@document.to_xml) } + @document.root.add_child(@body) + + File.open(@document_file, 'w') { |f| f.write(Helpers::NokogiriHelper.to_xml(@document)) } end def sectPr - Nokogiri::XML::Builder.new do |xml| - xml.send('w:sectPr') do - xml.send('w:pgSz', { 'w:w' => '12240', 'w:h' => '15840' }) - xml.send('w:pgMar', { - 'w:top' => '1440', 'w:right' => '1440', 'w:bottom' => '1440', 'w:left' => '1440', - 'w:header' => '720', 'w:footer' => '720', 'w:gutter' => '0' - }) - xml.send('w:cols', { 'w:space' => '720' }) - xml.send('w:docGrid', { 'w:linePitch' => 360 }) - end - end.root + root = Nokogiri::XML::Node.new('w:sectPr', @document) + root.add_child(pgSz) + root.add_child(pgMar) + root.add_child(cols) + root.add_child(docGrid) + + root + end + + def pgSz + pgSz = Nokogiri::XML::Node.new('w:pgSz', @document) + pgSz['w:w'] = '12240' + pgSz['w:h'] = '15840' + + pgSz + end + + def pgMar + pgMar = Nokogiri::XML::Node.new('w:pgMar', @document) + pgMar['w:top'] = '1440' + pgMar['w:right'] = '1440' + pgMar['w:bottom'] = '1440' + pgMar['w:left'] = '1440' + pgMar['w:header'] = '720' + pgMar['w:footer'] = '720' + pgMar['w:gutter'] = '0' + + pgMar + end + + def cols + cols = Nokogiri::XML::Node.new('w:cols', @document) + cols['w:space'] = '720' + + cols + end + + def docGrid + docGrid = Nokogiri::XML::Node.new('w:docGrid', @document) + docGrid['w:linePitch'] = '360' + + docGrid end end end \ No newline at end of file diff --git a/lib/Html2Docx/document_objects/paragraph.rb b/lib/Html2Docx/document_objects/paragraph.rb new file mode 100644 index 0000000..accc594 --- /dev/null +++ b/lib/Html2Docx/document_objects/paragraph.rb @@ -0,0 +1,167 @@ +module Html2Docx + module DocumentObjects + class Paragraph + def initialize(document, relation) + @document = document + @relation = relation + @paragraph = nil + end + + def add_paragraph(paragraph_object) + create_paragraph(paragraph_object) + end + + def create_paragraph(paragraph_object) + @paragraph = Nokogiri::XML::Node.new('w:p', @document) + + paragraph_style = paragraph_object.attr('style') + add_paragraph_style paragraph_style if paragraph_style + + add_paragraph_child paragraph_object.children + end + + def add_paragraph_style(style_attribute) + paragraph_style = Nokogiri::XML::Node.new('w:pPr', @document) + paragraph_styles = [] + + styles = style_attribute.split(';') + + styles.each do |style| + style = style.strip + attribute, value = style.scan(/(.+):\s?(.+);?/).flatten + + case attribute + when 'text-indent' + paragraph_styles.push add_paragraph_indent(value) + when 'text-align' + paragraph_styles.push add_paragraph_alignment(value) + when 'background-color' + paragraph_styles.push add_paragraph_background_color(value) + when 'line-height' + paragraph_styles.push add_line_height(value) + end + end + + paragraph_styles.each do |style| + paragraph_style.add_child(style) + end + + @paragraph.add_child(paragraph_style) + end + + def add_paragraph_indent(value) + indent_tag = Nokogiri::XML::Node.new('w:ind', @document) + indent_tag['w:firstLine'] = Helpers::DocumentHelper.px_to_indent(value) + + indent_tag + end + + def add_paragraph_alignment(value) + align_tag = Nokogiri::XML::Node.new('w:jc', @document) + value = value.downcase + value = 'both' if value == 'justify' + align_tag['w:val'] = value + + align_tag + end + + def add_paragraph_background_color(value) + background_tag = Nokogiri::XML::Node.new('w:shd', @document) + background_tag['w:val'] = 'clear' + background_tag['w:color'] = 'auto' + background_tag['w:fill'] = Helpers::DocumentHelper.convert_hex_color(value) + + background_tag + end + + def add_line_height(value) + line_height_tag = Nokogiri::XML::Node.new('w:spacing', @document) + line_height_tag['w:line'] = Helpers::DocumentHelper.line_height(value) + + line_height_tag + end + + def add_paragraph_child(children) + children.each do |child| + text_field = create_text_field + text_style = create_text_style + + case child.name + when 'strong' + text_field.add_child add_strong_text(text_style) + when 'i' + text_field.add_child add_italic_text(text_style) + when 'font' + color = child.attr('color') + text_field.add_child add_font_color(text_style, color) unless color.nil? + when 'u' + text_field.add_child add_underline_text(text_style) + when 's' + text_field.add_child add_stroke_text(text_style) + end + + text_field.add_child add_paragraph_text(child.text) + @paragraph.add_child text_field + end + end + + def create_text_field + Nokogiri::XML::Node.new('w:r', @document) + end + + def create_text_style + Nokogiri::XML::Node.new('w:rPr', @document) + end + + def add_paragraph_text(value) + plain_text = Nokogiri::XML::Node.new('w:t', @document) + plain_text['xml:space'] = 'preserve' + plain_text.content = value + + plain_text + end + + def add_strong_text(text_style) + strong_text = Nokogiri::XML::Node.new('w:b', @document) + text_style.add_child(strong_text) + + text_style + end + + def add_italic_text(text_style) + italic_text = Nokogiri::XML::Node.new('w:i', @document) + text_style.add_child(italic_text) + + text_style + end + + def add_font_color(text_style, color) + color_text = Nokogiri::XML::Node.new('w:color', @document) + color_text['w:val'] = Helpers::DocumentHelper.convert_hex_color(color) + text_style.add_child(color_text) + + text_style + end + + def add_underline_text(text_style) + underline_text = Nokogiri::XML::Node.new('w:u', @document) + underline_text['w:val'] = 'single' + text_style.add_child(underline_text) + + text_style + end + + def add_stroke_text(text_style) + stroke_text = Nokogiri::XML::Node.new('w:dstrike ', @document) + stroke_text['w:val'] = true + text_style.add_child(stroke_text) + + text_style + end + + def render + @paragraph + end + end + end +end \ No newline at end of file diff --git a/lib/Html2Docx/helpers/document_helper.rb b/lib/Html2Docx/helpers/document_helper.rb new file mode 100644 index 0000000..8a09aac --- /dev/null +++ b/lib/Html2Docx/helpers/document_helper.rb @@ -0,0 +1,25 @@ +module Html2Docx + module Helpers + class DocumentHelper + def self.height_px_to_word(value) + (value.to_i * 9533.77880184).to_i + end + + def self.convert_hex_color(value) + value.upcase.delete('#') + end + + def self.px_to_indent(value) + value.to_i.to_i * 15 + end + + def self.width_px_to_word(value) + (value.to_i * 9405.9375).to_i + end + + def self.line_height(value) + (value.to_f * 240).to_i + end + end + end +end \ No newline at end of file diff --git a/lib/Html2Docx/helpers/nokogiri_helper.rb b/lib/Html2Docx/helpers/nokogiri_helper.rb new file mode 100644 index 0000000..73996fc --- /dev/null +++ b/lib/Html2Docx/helpers/nokogiri_helper.rb @@ -0,0 +1,11 @@ +module Html2Docx + module Helpers + class NokogiriHelper + def self.to_xml(xml) + xml.to_xml(:save_with => Nokogiri::XML::Node::SaveOptions::AS_XML | Nokogiri::XML::Node::SaveOptions::NO_DECLARATION).strip + end + end + end +end +class NokogiriHelper +end \ No newline at end of file diff --git a/lib/Html2Docx/relation.rb b/lib/Html2Docx/relation.rb new file mode 100644 index 0000000..aa0781a --- /dev/null +++ b/lib/Html2Docx/relation.rb @@ -0,0 +1,49 @@ +module Html2Docx + class Relation + def initialize(options = {}) + @relation_file = nil + @relation = nil + @relations = [] + @last_relation_id = 1 + + if options[:main_relation] + @relation_file = File.join(TEMP_PATH, 'word', '_rels', 'document2.xml.rels') + @relation = File.open(@relation_file) { |f| Nokogiri::XML(f) } + @last_relation_id = @relation.css('Relationship').last.attr('Id').to_i + else + @relation_file = File.join(TEMP_PATH, 'word', '_rels', options.fetch(:file_name)) + @relation = create_relation_file + end + + @relations = @relation.css('Relationship').first + end + + def create_relation_file + document = Nokogiri::XML::Document.new + document.encoding = 'UTF-8' + relations_tag = Nokogiri::XML::Node.new('Relationships', document) + relations_tag['xmlns'] = 'http://schemas.openxmlformats.org/package/2006/relationships' + document.add_child relations_tag + document + end + + def add_relation(type, target) + relation_tag = Nokogiri::XML::Node.new('Relationship', @relation) + relation_tag['Id'] = "rId#{@last_relation_id + 1}" + relation_tag['Type'] = get_type(type) + relation_tag['Target'] = get_target(target) + @relations.add_child(relation_tag) + @last_relation_id = @last_relation_id + 1 + end + + def render + File.open(@relation_file, 'w') { |f| f.write(Helpers::NokogiriHelper.to_xml(@relation)) } + end + + def get_type(type) + end + + def get_target(target) + end + end +end \ No newline at end of file diff --git a/lib/Html2Docx/version.rb b/lib/Html2Docx/version.rb index 5279c6b..a9f8a6d 100644 --- a/lib/Html2Docx/version.rb +++ b/lib/Html2Docx/version.rb @@ -1,3 +1,3 @@ module Html2Docx - VERSION = "0.1.0" -end + VERSION = '0.1.0' +end \ No newline at end of file diff --git a/skell/[Content_Types].xml b/skell/[Content_Types].xml index 035e8db..4d5931e 100644 --- a/skell/[Content_Types].xml +++ b/skell/[Content_Types].xml @@ -1,19 +1 @@ - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/skell/word/document2.xml b/skell/word/document2.xml index fce9df1..ad5106b 100644 --- a/skell/word/document2.xml +++ b/skell/word/document2.xml @@ -1,29 +1 @@ - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/skell/word/fontTable.xml b/skell/word/fontTable.xml index bc94965..a747ba5 100644 --- a/skell/word/fontTable.xml +++ b/skell/word/fontTable.xml @@ -1,28 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/skell/word/settings.xml b/skell/word/settings.xml index 7d5f2e9..e9aaea8 100644 --- a/skell/word/settings.xml +++ b/skell/word/settings.xml @@ -1,51 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/skell/word/styles.xml b/skell/word/styles.xml index 7e6cadb..20b5aea 100644 --- a/skell/word/styles.xml +++ b/skell/word/styles.xml @@ -1,399 +1,429 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 7d94a0c9eea6203d54a82e32b29fb9289cc44a95 Mon Sep 17 00:00:00 2001 From: MuhammetDilmac Date: Wed, 21 Jun 2017 18:18:20 +0300 Subject: [PATCH 7/9] =?UTF-8?q?ParagraphInitializing=20Merge=20*=20Skell?= =?UTF-8?q?=20dizininde=20bozulan=20dosyalar=20d=C3=BCzeltildi.=20*=20NOTI?= =?UTF-8?q?CE.md=20dosyas=C4=B1na=20taglar=20eklendi.=20*=20Paragrafa=20ai?= =?UTF-8?q?t=20stil=20olarak=20arka=20plan=20rengi,=20yaz=C4=B1=20hizalama?= =?UTF-8?q?s=C4=B1,=20sat=C4=B1r=20y=C3=BCksekli=C4=9Fi=20ve=20sat=C4=B1r?= =?UTF-8?q?=20girintisi=20eklendi.=20=20=20*=20Yaz=C4=B1=20rengi;=20`Html2Docx

`=20=20=20*?= =?UTF-8?q?=20Yaz=C4=B1=20Hizalamas=C4=B1:=20`Html2Docx

`=20=20=20*=20Sat=C4=B1r=20Y=C3=BCksekli?= =?UTF-8?q?=C4=9Fi:=20`Html2Docx

`=20?= =?UTF-8?q?=20=20*=20Sat=C4=B1r=20Girintisi:=20`Html2Docx

`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Paragraf içinde kalın yazı, altı çizili yazı, üstü çizili yazı, italik yazı ve yazı rengi özellikleri eklendi. * Kalın yazı; `

Html2Docx<

` * Altı çizili yazı: `

Html2Docx

` * Üstü çizili yazı: `

Html2Docx

` * İtalik yazı: `

Html2Docx

` * Yazı Rengi: `

Html2Docx

` Örnek Girgi & Çıktı: [Html2Docx Paragraph Initialization](https://twitter.com/m_dilmac/status/877545135646666752) --- samples/EmptyPage.docx | Bin 0 -> 10916 bytes .../EmptyPage.docx_FILES/[Content_Types].xml | 1 + samples/EmptyPage.docx_FILES/_rels/.rels | 1 + samples/EmptyPage.docx_FILES/docProps/app.xml | 1 + .../EmptyPage.docx_FILES/docProps/core.xml | 1 + .../word/_rels/document2.xml.rels | 1 + .../EmptyPage.docx_FILES/word/document2.xml | 1 + .../EmptyPage.docx_FILES/word/fontTable.xml | 1 + .../EmptyPage.docx_FILES/word/settings.xml | 1 + samples/EmptyPage.docx_FILES/word/styles.xml | 429 ++++++++++++++++++ .../word/theme/theme1.xml | 260 +++++++++++ .../EmptyPage.docx_FILES/word/webSettings.xml | 2 + ...aphWithStrongItalicUnderLineAndStroke.docx | Bin 0 -> 12675 bytes .../[Content_Types].xml | 1 + .../_rels/.rels | 1 + .../docProps/app.xml | 1 + .../docProps/core.xml | 1 + .../word/_rels/document2.xml.rels | 1 + .../word/document2.xml | 1 + .../word/fontTable.xml | 1 + .../word/settings.xml | 1 + .../word/styles.xml | 1 + .../word/theme/theme1.xml | 2 + .../word/webSettings.xml | 2 + 24 files changed, 712 insertions(+) create mode 100644 samples/EmptyPage.docx create mode 100644 samples/EmptyPage.docx_FILES/[Content_Types].xml create mode 100644 samples/EmptyPage.docx_FILES/_rels/.rels create mode 100644 samples/EmptyPage.docx_FILES/docProps/app.xml create mode 100644 samples/EmptyPage.docx_FILES/docProps/core.xml create mode 100644 samples/EmptyPage.docx_FILES/word/_rels/document2.xml.rels create mode 100644 samples/EmptyPage.docx_FILES/word/document2.xml create mode 100644 samples/EmptyPage.docx_FILES/word/fontTable.xml create mode 100644 samples/EmptyPage.docx_FILES/word/settings.xml create mode 100644 samples/EmptyPage.docx_FILES/word/styles.xml create mode 100644 samples/EmptyPage.docx_FILES/word/theme/theme1.xml create mode 100644 samples/EmptyPage.docx_FILES/word/webSettings.xml create mode 100644 samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx create mode 100644 samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/[Content_Types].xml create mode 100644 samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/_rels/.rels create mode 100644 samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/docProps/app.xml create mode 100644 samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/docProps/core.xml create mode 100644 samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/_rels/document2.xml.rels create mode 100644 samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/document2.xml create mode 100644 samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/fontTable.xml create mode 100644 samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/settings.xml create mode 100644 samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/styles.xml create mode 100644 samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/theme/theme1.xml create mode 100644 samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/webSettings.xml diff --git a/samples/EmptyPage.docx b/samples/EmptyPage.docx new file mode 100644 index 0000000000000000000000000000000000000000..d8b906f84d72089d6615a5365c57b2b2704caa0e GIT binary patch literal 10916 zcmeHtWmsLiw)VoE;_mKVq_{i9DY6z$ad(OpDemr0@#5}o1&X^BcPmol(k-Xm`|Nwa z@BcaTc~+h^le{CD$ru^Qo1rKR0f_;C2EYQ&ghyrWAwjD0U;qF<6aat@fCbkUwXt?I zwszE2b+a{g05Z8+S(4;Hg41LHzybe#{-Z~rHcnoln*}AH!oW?N(z;m)_T>@yoCu{m z*lcnQ)?+OH11~;8L=R>Xg;ju}846>n)L@I-Dn9*YWc~Gokp+^rsN6#H`xoZ|Z`b0O zYqc@n1*ka>Q*TaKVw14OG^w6a8Z@Aj6;ZxPwkPgT%0Hiw$(wCJ5iZtf1h5`n+xVX& zcj^b$!VpIiWyR3@9ooreYFk3aayQ!qyewH`gUpQ=D-NxtZ&#|~CoTLe5u5NTj|h$% zof=hsPqHifELnkUA8k%m;$2LFk-?@RtxSb_g4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+NQ$R*)Z2ZwP?yXU{TB{p0O_0NrH07XSbN literal 0 HcmV?d00001 diff --git a/samples/EmptyPage.docx_FILES/[Content_Types].xml b/samples/EmptyPage.docx_FILES/[Content_Types].xml new file mode 100644 index 0000000..4d5931e --- /dev/null +++ b/samples/EmptyPage.docx_FILES/[Content_Types].xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/samples/EmptyPage.docx_FILES/_rels/.rels b/samples/EmptyPage.docx_FILES/_rels/.rels new file mode 100644 index 0000000..0afe5c3 --- /dev/null +++ b/samples/EmptyPage.docx_FILES/_rels/.rels @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/samples/EmptyPage.docx_FILES/docProps/app.xml b/samples/EmptyPage.docx_FILES/docProps/app.xml new file mode 100644 index 0000000..e0018a8 --- /dev/null +++ b/samples/EmptyPage.docx_FILES/docProps/app.xml @@ -0,0 +1 @@ +0100Microsoft Office Word000falsefalse0falsefalse15.0000Normal.dotm \ No newline at end of file diff --git a/samples/EmptyPage.docx_FILES/docProps/core.xml b/samples/EmptyPage.docx_FILES/docProps/core.xml new file mode 100644 index 0000000..0e661b9 --- /dev/null +++ b/samples/EmptyPage.docx_FILES/docProps/core.xml @@ -0,0 +1 @@ +2017-06-13T08:15:35.2330238Z2012-08-07T16:44:00.0000000ZMuhammet DILMAC (ADEO) \ No newline at end of file diff --git a/samples/EmptyPage.docx_FILES/word/_rels/document2.xml.rels b/samples/EmptyPage.docx_FILES/word/_rels/document2.xml.rels new file mode 100644 index 0000000..d9d3612 --- /dev/null +++ b/samples/EmptyPage.docx_FILES/word/_rels/document2.xml.rels @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/samples/EmptyPage.docx_FILES/word/document2.xml b/samples/EmptyPage.docx_FILES/word/document2.xml new file mode 100644 index 0000000..ad5106b --- /dev/null +++ b/samples/EmptyPage.docx_FILES/word/document2.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/samples/EmptyPage.docx_FILES/word/fontTable.xml b/samples/EmptyPage.docx_FILES/word/fontTable.xml new file mode 100644 index 0000000..a747ba5 --- /dev/null +++ b/samples/EmptyPage.docx_FILES/word/fontTable.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/samples/EmptyPage.docx_FILES/word/settings.xml b/samples/EmptyPage.docx_FILES/word/settings.xml new file mode 100644 index 0000000..e9aaea8 --- /dev/null +++ b/samples/EmptyPage.docx_FILES/word/settings.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/samples/EmptyPage.docx_FILES/word/styles.xml b/samples/EmptyPage.docx_FILES/word/styles.xml new file mode 100644 index 0000000..20b5aea --- /dev/null +++ b/samples/EmptyPage.docx_FILES/word/styles.xml @@ -0,0 +1,429 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/EmptyPage.docx_FILES/word/theme/theme1.xml b/samples/EmptyPage.docx_FILES/word/theme/theme1.xml new file mode 100644 index 0000000..6e0c033 --- /dev/null +++ b/samples/EmptyPage.docx_FILES/word/theme/theme1.xml @@ -0,0 +1,260 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/EmptyPage.docx_FILES/word/webSettings.xml b/samples/EmptyPage.docx_FILES/word/webSettings.xml new file mode 100644 index 0000000..be9f295 --- /dev/null +++ b/samples/EmptyPage.docx_FILES/word/webSettings.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx new file mode 100644 index 0000000000000000000000000000000000000000..34ab494465c40bbdf669b17dbecdf2be332b73bd GIT binary patch literal 12675 zcmeHtV|1lUx9*Caj%_;~yJOq7?T*z!$9Bi;*tTukcE{=9roa8|Z{zNB?)`txJH~p) zdaLT0#aT6L&PPrX1QZ1T4uAyIYRpMIgX$AbDJZqv^5w&iPo|sk^mUpjo`K4r zN62@ktk4MuQc6^)Bx-zpbjwAS_fj?ogYa*yhnb=l3mIQbeO9YdXwfl^ z4d4PfdScMn(7gnT;d~|TT5sa&0pF*8L)!^+bBPV@Wa416d%+PsIY$xu26^UaXCK|a zPZO6nb10ZI7wLoXT-oC6B0>xi{GH3YjX1WIJ_F&{GCSZ0iWal#+5@uOf3(o%T?=DN z!y~re7nk6>lEJ)dp{|3ml_NdfulN6I-~VW(`%mZ7VJDdN!FPxCq$;eRs7RUSDW4x~~OMmG$i#^#) zJDC~BSWBzRq^)@mL|i(4DL>~}f&$AV#wkK=bTmT(9r-IKrr{k)-6%2{qYEj#F&T&C8D{X>pHHoe_AyGko`%7qu2NSN^<1R9!j@n+>BK{RzK!71w9% z!7zkv(U8l$=3Bri8L6n7NQQhVCZ_nhHZm|N2O4y~`BAptx;uq62-HpNYpS*4GR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Hpagdbjwp{TFTC7HiwKe0w*gd; zazzjldUd$L(85Y?MISdo6Tei(m$arihDNfxLU+e)=QL&*u>B}N{`_EK8fW{tnfG!o zugicNMCC)H;Nx1~$1`AJjA2NF`!7K)=rpJJC1<+DjngsuYV^;(3w~K>!7O|toN-u_1db$c&tQD^cuWR+rS+Q3)6nYt#AvGMN z!Jlj4%Eu}c{=9I%J>sMEIB-&1d~(W<60+BQ+^dlnE$&fFc>b<_oX;dKn2bk`?7aO)?j2&r1s_IEStsiq_S@ZCNVdgmYD{%%J7#`OG)G4*fS=YMTc)y?q# zBI1HgmZ;T`%SiA;&YcBGH;|&+rQ0LLEGC*t94)EYk(B$Qk|@m(RSosW9(c5`_h(+< zmyE5j2djq9dK6|+Ngy1C+qy4Mu~)Xa`Hs2Q_3%5o^K0Xa<)Ml~bM9YKkfy+kN(X*8 zR50+uVJWn=bHIY}U3+V?QuFRuD8mh4}->VLO1|AD#wcL9H;+5TBT z(EFVHiFEsC;6ITO|A3~vQxyM^n)qiC|HM4`L&OE_@9yS51u_2&|JC=uhq(WM_aXcn z{+EFFpYi_`IQ;`(@g6b%R}cOcM*XvdUmf^s{O}Jv0C4;sZ~S{S@$cxrhJ^l%Rz~|1 z`u70Q-{F6E&;KC+67%=b`;W8!ckn;oU;cms03;;;2LD9?|BnBw;{F+LN&9d7f2GE9 Xl3?!(T literal 0 HcmV?d00001 diff --git a/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/[Content_Types].xml b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/[Content_Types].xml new file mode 100644 index 0000000..4d5931e --- /dev/null +++ b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/[Content_Types].xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/_rels/.rels b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/_rels/.rels new file mode 100644 index 0000000..0afe5c3 --- /dev/null +++ b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/_rels/.rels @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/docProps/app.xml b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/docProps/app.xml new file mode 100644 index 0000000..5af8832 --- /dev/null +++ b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/docProps/app.xml @@ -0,0 +1 @@ +Microsoft Office Word0falsefalsefalse00.0001Normal.dotmfalse \ No newline at end of file diff --git a/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/docProps/core.xml b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/docProps/core.xml new file mode 100644 index 0000000..e623240 --- /dev/null +++ b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/docProps/core.xml @@ -0,0 +1 @@ +2017-06-21T11:19:28.0251851Z2017-06-21T11:21:41.7268791ZMuhammet DILMAC (ADEO)Muhammet DILMAC (ADEO) \ No newline at end of file diff --git a/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/_rels/document2.xml.rels b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/_rels/document2.xml.rels new file mode 100644 index 0000000..d9d3612 --- /dev/null +++ b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/_rels/document2.xml.rels @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/document2.xml b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/document2.xml new file mode 100644 index 0000000..78501d3 --- /dev/null +++ b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/document2.xml @@ -0,0 +1 @@ +Lorem Ipsum, dizgi ve baskı endüstrisinde kullanılan mıgır metinlerdir. Lorem Ipsum, adı bilinmeyen bir matbaacının bir hurufat numune kitabı oluşturmak üzere bir yazı galerisini alarak karıştırdığı 1500'lerden beri endüstri standardı sahte metinler olarak kullanılmıştır. Beşyüz yıl boyunca varlığını sürdürmekle kalmamış, aynı zamanda pek değişmeden elektronik dizgiye de sıçramıştır. 1960'larda Lorem Ipsum pasajları da içeren Letraset yapraklarının yayınlanması ile ve yakın zamanda Aldus PageMaker gibi Lorem Ipsum sürümleri içeren masaüstü yayıncılık yazılımları ile popüler olmuştur.Yaygın inancın tersine, Lorem Ipsum rastgele sözcüklerden oluşmaz. Kökleri M.Ö. 45 tarihinden bu yana klasik Latin edebiyatına kadar uzanan 2000 yıllık bir geçmişi vardır. Virginia'daki Hampden-Sydney College'dan Latince profesörü Richard McClintock, bir Lorem Ipsum pasajında geçen ve anlaşılması en güç sözcüklerden biri olan 'consectetur' sözcüğünün klasik edebiyattaki örneklerini incelediğinde kesin bir kaynağa ulaşmıştır. Lorm Ipsum, Çiçero tarafından M.Ö. 45 tarihinde kaleme alınan "de Finibus Bonorum et Malorum" (İyi ve Kötünün Sınırları) eserinin 1.10.32 ve 1.10.33 sayılı bölümlerinden gelmektedir. Bu kitap, ahlak kuramı üzerine bir tezdir ve Rönesans döneminde çok popüler olmuştur. Lorem Ipsum pasajının ilk satırı olan "Lorem ipsum dolor sit amet" 1.10.32 sayılı bölümdeki bir satırdan gelmektedir. \ No newline at end of file diff --git a/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/fontTable.xml b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/fontTable.xml new file mode 100644 index 0000000..a747ba5 --- /dev/null +++ b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/fontTable.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/settings.xml b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/settings.xml new file mode 100644 index 0000000..04de91f --- /dev/null +++ b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/settings.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/styles.xml b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/styles.xml new file mode 100644 index 0000000..12e2e54 --- /dev/null +++ b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/styles.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/theme/theme1.xml b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/theme/theme1.xml new file mode 100644 index 0000000..9c5cd2b --- /dev/null +++ b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/theme/theme1.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/webSettings.xml b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/webSettings.xml new file mode 100644 index 0000000..be9f295 --- /dev/null +++ b/samples/TwoParagraphWithStrongItalicUnderLineAndStroke.docx_FILES/word/webSettings.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file From 55bf8fd1ffede478cb69ddacc277c36f676724b7 Mon Sep 17 00:00:00 2001 From: MuhammetDilmac Date: Thu, 22 Jun 2017 13:28:24 +0300 Subject: [PATCH 8/9] DocumentRender Merge * Paragraph output is ready! --- Gemfile | 2 +- Html2Docx.gemspec | 1 + lib/Html2Docx.rb | 55 +-- lib/Html2Docx/content_types.rb | 2 +- lib/Html2Docx/document.rb | 2 +- lib/Html2Docx/helpers/zip_file_generator.rb | 46 ++ lib/Html2Docx/initialization.rb | 45 +- lib/Html2Docx/relation.rb | 4 +- samples/EmptyPage.docx_FILES/word/styles.xml | 430 +----------------- .../word/theme/theme1.xml | 260 +---------- skell/word/styles.xml | 430 +----------------- skell/word/theme/theme1.xml | 260 +---------- 12 files changed, 115 insertions(+), 1422 deletions(-) create mode 100644 lib/Html2Docx/helpers/zip_file_generator.rb diff --git a/Gemfile b/Gemfile index 31a6b27..c72eaf0 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ -source "https://rubygems.org" +source 'https://rubygems.org' # Specify your gem's dependencies in Html2Docx.gemspec gemspec diff --git a/Html2Docx.gemspec b/Html2Docx.gemspec index d67cd1f..91c2ca8 100644 --- a/Html2Docx.gemspec +++ b/Html2Docx.gemspec @@ -27,4 +27,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 10.0' spec.add_development_dependency 'rspec', '~> 3.0' spec.add_development_dependency 'nokogiri', '~> 1.6', '>= 1.6.8' + spec.add_development_dependency 'rubyzip', '~> 1.2.0' end diff --git a/lib/Html2Docx.rb b/lib/Html2Docx.rb index 216ad7f..095da23 100644 --- a/lib/Html2Docx.rb +++ b/lib/Html2Docx.rb @@ -1,8 +1,10 @@ require 'fileutils' require 'nokogiri' +require 'zip' require 'Html2Docx/helpers/document_helper' require 'Html2Docx/helpers/nokogiri_helper' +require 'Html2Docx/helpers/zip_file_generator' require 'Html2Docx/version' require 'Html2Docx/initialization' @@ -13,55 +15,36 @@ module Html2Docx ROOT_PATH = File.expand_path(File.join(File.dirname(__FILE__), '../')) - TEMP_PATH = Dir.mktmpdir - def self.start(options = {}) + def self.clear_temp(tmp) + FileUtils.rm_r tmp + end + + def self.create_docx(output, input) + zf = ZipFileGenerator.new(input, output) + zf.write + + self.clear_temp(input) + end + + def self.render(options = {}) initialization = Initialization.new(options) + options[:temp] = initialization.get_temp_directory content_types = ContentTypes.new(options) options[:main_relation] = true relation = Relation.new(options) + options[:main_relation] = false - options[:html] = <<-HTML - - - -

Lorem Ipsum, dizgi ve baskı endüstrisinde kullanılan mıgır metinlerdir.

-

Lorem Ipsum, adı bilinmeyen bir matbaacının bir hurufat numune kitabı oluşturmak üzere bir yazı galerisini alarak karıştırdığı 1500'lerden beri endüstri standardı sahte metinler olarak kullanılmıştır.

-

Beşyüz yıl boyunca varlığını sürdürmekle kalmamış, aynı zamanda pek değişmeden elektronik dizgiye de sıçramıştır.

-

1960'larda Lorem Ipsum pasajları da içeren Letraset yapraklarının yayınlanması ile ve yakın zamanda Aldus PageMaker gibi Lorem Ipsum sürümleri içeren masaüstü yayıncılık yazılımları ile popüler olmuştur.

-

Yaygın inancın tersine, Lorem Ipsum rastgele sözcüklerden oluşmaz.

-

Kökleri M.Ö. 45 tarihinden bu yana klasik Latin edebiyatına kadar uzanan 2000 yıllık bir geçmişi vardır.

- - - HTML document = Document.new(options) # Render document.render content_types.render relation.render - end - - def self.temp_path - TEMP_PATH - end - - def self.root_path - ROOT_PATH - end - def self.clear_temp - FileUtils.rm_r TEMP_PATH + # Create Docx File + self.create_docx(options.fetch(:output), options.fetch(:temp)) end - - def self.get_file(value) - file_path = File.join(TEMP_PATH, value) - file_content = File.read(file_path) - - puts file_content - end -end - -Html2Docx.start \ No newline at end of file +end \ No newline at end of file diff --git a/lib/Html2Docx/content_types.rb b/lib/Html2Docx/content_types.rb index 816f133..3e72a8c 100644 --- a/lib/Html2Docx/content_types.rb +++ b/lib/Html2Docx/content_types.rb @@ -1,7 +1,7 @@ module Html2Docx class ContentTypes def initialize(options = {}) - @content_type_file = File.join(TEMP_PATH, '[Content_Types].xml') + @content_type_file = File.join(options.fetch(:temp), '[Content_Types].xml') @content_type = File.open(@content_type_file) {|f| Nokogiri::XML(f)} @parts = {default: [], override: []} initial_parts diff --git a/lib/Html2Docx/document.rb b/lib/Html2Docx/document.rb index 30a1740..55aa2c6 100644 --- a/lib/Html2Docx/document.rb +++ b/lib/Html2Docx/document.rb @@ -1,7 +1,7 @@ module Html2Docx class Document def initialize(options = {}) - @document_file = File.join(TEMP_PATH, 'word', 'document2.xml') + @document_file = File.join(options.fetch(:temp), 'word', 'document2.xml') @document = File.open(@document_file) { |f| Nokogiri::XML(f) } @body = @document.at_xpath('//w:body') @contents = [] diff --git a/lib/Html2Docx/helpers/zip_file_generator.rb b/lib/Html2Docx/helpers/zip_file_generator.rb new file mode 100644 index 0000000..233c409 --- /dev/null +++ b/lib/Html2Docx/helpers/zip_file_generator.rb @@ -0,0 +1,46 @@ +module Html2Docx + class ZipFileGenerator + # Initialize with the directory to zip and the location of the output archive. + def initialize(input_dir, output_file) + @input_dir = input_dir + @output_file = output_file + end + + # Zip the input directory. + def write + entries = Dir.entries(@input_dir) - %w(. ..) + + ::Zip::File.open(@output_file, ::Zip::File::CREATE) do |io| + write_entries entries, '', io + end + end + + private + + # A helper method to make the recursion work. + def write_entries(entries, path, io) + entries.each do |e| + zip_file_path = path == '' ? e : File.join(path, e) + disk_file_path = File.join(@input_dir, zip_file_path) + + if File.directory? disk_file_path + recursively_deflate_directory(disk_file_path, io, zip_file_path) + else + put_into_archive(disk_file_path, io, zip_file_path) + end + end + end + + def recursively_deflate_directory(disk_file_path, io, zip_file_path) + io.mkdir zip_file_path + subdir = Dir.entries(disk_file_path) - %w(. ..) + write_entries subdir, zip_file_path, io + end + + def put_into_archive(disk_file_path, io, zip_file_path) + io.get_output_stream(zip_file_path) do |f| + f.write(File.open(disk_file_path, 'rb').read) + end + end + end +end \ No newline at end of file diff --git a/lib/Html2Docx/initialization.rb b/lib/Html2Docx/initialization.rb index 510ef8d..558505c 100644 --- a/lib/Html2Docx/initialization.rb +++ b/lib/Html2Docx/initialization.rb @@ -3,25 +3,60 @@ class Initialization def initialize(options = {}) @skell_directory = File.join(ROOT_PATH, 'skell') + check_output_file(options[:output]) + check_html_input(options[:html]) + create_temp_directory check_temp_directory copy_skell_directory end + def create_temp_directory + @temp_path = Dir.mktmpdir + end + + def get_temp_directory + @temp_path + end + def check_temp_directory - unless Dir.exist?(TEMP_PATH) and File.writable?(TEMP_PATH) - raise "Initialization failed. Temp directory is not created success. Temp Directory: #{TEMP_PATH}" + unless Dir.exist?(@temp_path) and File.writable?(@temp_path) + raise "Initialization failed. Temp directory is not created success. Temp Directory: #{@temp_path}" + end + end + + def check_output_file(output) + output_directory = File.dirname(output) + + unless File.writable?(output_directory) + raise "Initialization failed. Output directory is not writable. Output Directory: #{output_directory}" + end + + if File.exist?(output) + raise "Initialization failed. Output file is already exist. Output File: #{output}" + end + end + + def check_html_input(html) + if html.empty? + raise 'Initialization failed. HTML must be not empty.' + end + + begin + Nokogiri::HTML(html) + rescue + raise "Initialization failed. HTML validation failed. HTML Data: #{html}" end end def copy_skell_directory - FileUtils.copy_entry @skell_directory, TEMP_PATH + FileUtils.copy_entry @skell_directory, @temp_path check_sync_skell_to_temp end def check_sync_skell_to_temp - unless Dir.entries(TEMP_PATH).length == Dir.entries(@skell_directory).length - raise "Initialization failed. Temp directory is not syncronize to skell directory. Temp Directory: #{TEMP_PATH}" + unless Dir.entries(@temp_path).length == Dir.entries(@skell_directory).length + raise "Initialization failed. Temp directory is not syncronize to skell directory. Temp Directory: #{@temp_path}" end end end diff --git a/lib/Html2Docx/relation.rb b/lib/Html2Docx/relation.rb index aa0781a..8a33759 100644 --- a/lib/Html2Docx/relation.rb +++ b/lib/Html2Docx/relation.rb @@ -7,11 +7,11 @@ def initialize(options = {}) @last_relation_id = 1 if options[:main_relation] - @relation_file = File.join(TEMP_PATH, 'word', '_rels', 'document2.xml.rels') + @relation_file = File.join(options.fetch(:temp), 'word', '_rels', 'document2.xml.rels') @relation = File.open(@relation_file) { |f| Nokogiri::XML(f) } @last_relation_id = @relation.css('Relationship').last.attr('Id').to_i else - @relation_file = File.join(TEMP_PATH, 'word', '_rels', options.fetch(:file_name)) + @relation_file = File.join(options.fetch(:temp), 'word', '_rels', options.fetch(:file_name)) @relation = create_relation_file end diff --git a/samples/EmptyPage.docx_FILES/word/styles.xml b/samples/EmptyPage.docx_FILES/word/styles.xml index 20b5aea..12e2e54 100644 --- a/samples/EmptyPage.docx_FILES/word/styles.xml +++ b/samples/EmptyPage.docx_FILES/word/styles.xml @@ -1,429 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/samples/EmptyPage.docx_FILES/word/theme/theme1.xml b/samples/EmptyPage.docx_FILES/word/theme/theme1.xml index 6e0c033..9c5cd2b 100644 --- a/samples/EmptyPage.docx_FILES/word/theme/theme1.xml +++ b/samples/EmptyPage.docx_FILES/word/theme/theme1.xml @@ -1,260 +1,2 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/skell/word/styles.xml b/skell/word/styles.xml index 20b5aea..12e2e54 100644 --- a/skell/word/styles.xml +++ b/skell/word/styles.xml @@ -1,429 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/skell/word/theme/theme1.xml b/skell/word/theme/theme1.xml index 6e0c033..9c5cd2b 100644 --- a/skell/word/theme/theme1.xml +++ b/skell/word/theme/theme1.xml @@ -1,260 +1,2 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file From 7f534815aca3e395664044ad4db2af897eddcc7f Mon Sep 17 00:00:00 2001 From: MuhammetDilmac Date: Thu, 22 Jun 2017 13:48:32 +0300 Subject: [PATCH 9/9] =?UTF-8?q?Readme=20dosyas=C4=B1=20d=C3=BCzenlendi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CODE_OF_CONDUCT.md | 74 ---------------------------------------------- NOTICE.md | 14 --------- README.md | 16 +++------- 3 files changed, 4 insertions(+), 100 deletions(-) delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 NOTICE.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index 9e8fc35..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at iletisim@muhammetdilmac.com.tr. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/NOTICE.md b/NOTICE.md deleted file mode 100644 index 43983da..0000000 --- a/NOTICE.md +++ /dev/null @@ -1,14 +0,0 @@ -# Document -## Paragraph -### Style Attribute -* text-align (justify, center, left, right). (`

`) -* text-indent (px). (`

`) -* background-color (Hex Color). (`

`) -* line-height (Number). (`

`) - -### Tags -* `` -* `` -* `` -* `` -* `` \ No newline at end of file diff --git a/README.md b/README.md index ebdc036..62245eb 100644 --- a/README.md +++ b/README.md @@ -22,22 +22,14 @@ Or install it yourself as: ## Usage -TODO: Write usage instructions here +Html2Docx has very easy usage. -## Development - -After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. - -To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). +This time only supporting paragraph output. [Wiki - Paragraph Usage](https://github.com/MuhammetDilmac/Html2Docx/wiki/Paragraph-Usage) ## Contributing -Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/Html2Docx. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. +Bug reports and pull requests are welcome on GitHub at https://github.com/MuhammetDilmac/Html2Docx. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. ## License -The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). - -## Code of Conduct - -Everyone interacting in the Html2Docx project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/Html2Docx/blob/master/CODE_OF_CONDUCT.md). +The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). \ No newline at end of file