docx2gfm 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: d9a2da3b4b09ea75ecb7523a3a01e0b275237239acea98dbc20c1371afa8a3ea
4
- data.tar.gz: 35624ce545980e73a9f931be6f94d5fb7e2c642a8854d2c75d1041cc9d3cb9d4
2
+ SHA1:
3
+ metadata.gz: 48b802854f6a5c4bb63e5f5ddfd7ef4842b29c4b
4
+ data.tar.gz: 39f9a4b1b9bc5a97cf4907c0d187fb5bbfa9be74
5
5
  SHA512:
6
- metadata.gz: '0861e90f7edda3bb08c31f7e5963e3ed7db5866f9bb2e61787aa40a0ee2b48c3ca2d00dab1e44411df635004d2796f1025456979fb7ad46e291d0aec72ad88af'
7
- data.tar.gz: e7a5df12dc792018f6c4ff469289e8d5d16cfc4feccfc62a2b507af11163778616ff0c3632f4a9cd398486abb26673abbb78df571c8851d76bd87e7b1d4684e7
6
+ metadata.gz: e13b9887d88360f5d134669a906ddd11a0bc5f37199b6064078e1fad18068764def38a1369b2951b3eabd0d07efb2a09102f36a8ae3104746104030302b3813e
7
+ data.tar.gz: 0b2657892ce806f007532c3a67691c99a4a7699c1198dee0275807dc67fa9499f89bd6b97f522ba7b736eac95a1dec3c244a171567773dbb64cb85278a04cbe2
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Sebastian Spier
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,14 +1,16 @@
1
1
  # docx2gfm - docx to github-flavored-markdown converter
2
2
 
3
- If you need to convert `.docx` documents to markdown, then `docx2gfm` is for you, as it makes the process faster.
3
+ If you need to convert `.docx` documents to markdown, then `docx2gfm` helps you to make the process faster.
4
4
 
5
- "Don't tell me, show. me"! Ok ok! `docx2gfm` turns [this docx file](./examples/sample.docx) into [this markdown](./examples/sample.md). Also see the original [google Doc][gDoc].
5
+ "Don't tell me, show me"! Ok ok! `docx2gfm` turns [this docx file](./examples/sample.docx) into [this markdown](./examples/sample.md). Also see the original [google Doc][gDoc].
6
6
 
7
- Some post-processing of the markdown is still required but `docx2gfm` already makes the conversion process much faster.
7
+ For another example of `docx2gfm` in action, take a look at this blog post [docx2gfm - Your friendly docx to markdown converter][blog-post].
8
+
9
+ While some post-processing of the markdown is still required, `docx2gfm` already makes the conversion process much faster.
8
10
 
9
11
  ## The Long Story
10
12
 
11
- I am maintaining an engineering blog, that uses [jekyll][jekyll] to generate static pages.
13
+ I am [maintaining an engineering blog][uth-tech-stack], that uses [jekyll][jekyll] to generate static pages.
12
14
 
13
15
  In our blogging process, the authors write blog post as a Google Doc to collect feedback. Once the post is ready for publishing, they convert the Google Doc to [github-flavored-markdown][gfm], as that is what [jekyll][jekyll] needs as input to render the HTML for the blog.
14
16
 
@@ -50,10 +52,10 @@ Usage: docx2gfm [options]
50
52
  The markdown produced by `docx2gfm` is good but not perfect. You still have to do some manual steps:
51
53
 
52
54
  * Adapt the YAML Frontmatter (if you used the `--jekyll` option)
53
- * Add the correct image links
54
- * Add code blocks
55
- * Add quotes
56
- * Add tables
55
+ * Add the correct image paths
56
+ * Double check code blocks
57
+ * Double check quotes
58
+ * Double check tables
57
59
 
58
60
  ## Alternatives to docx2gfm
59
61
 
@@ -80,3 +82,5 @@ The gem is available as open source under the terms of the [MIT License](https:/
80
82
  [gDoc]: https://docs.google.com/document/d/16Kww2ic-YgFKskfDxYJu6o_ooSF3IORJh8Ho7XbgngI/edit
81
83
  [pandoc]: https://pandoc.org/installing.html
82
84
  [jekyll]: https://jekyllrb.com
85
+ [blog-post]: https://spier.hu/2018/12/docx2gfm-your-friendly-docx-to-markdown-converter
86
+ [uth-tech-stack]: https://spier.hu/2019/11/a-simple-tech-stack-for-your-engineering-blog
@@ -6,12 +6,12 @@ class DocxGfmConverter
6
6
  end
7
7
 
8
8
  # perform all conversation and cleanup steps
9
- def process_gfm()
10
- docx_2_gfm(@options[:file])
11
- cleanup_content_gfm()
12
- create_ref_style_links() if @options[:ref_style_links]
13
- add_frontmatter() if @options[:jekyll]
14
- end
9
+ # def process_gfm()
10
+ # docx_2_gfm(@options[:file])
11
+ # cleanup_content_gfm()
12
+ # create_ref_style_links() if @options[:ref_style_links]
13
+ # add_frontmatter() if @options[:jekyll]
14
+ # end
15
15
 
16
16
  def process_markdown()
17
17
  docx_2_markdown(@options[:file])
@@ -26,16 +26,16 @@ class DocxGfmConverter
26
26
  end
27
27
 
28
28
  # convert docx to initial markdown
29
- def docx_2_gfm(file)
30
- # TODO before reading the file, I could check if the file exists
31
- # TODO check out pandoc options that might be useful e.g. --extract-media='/images/own/'
32
- @content = `pandoc #{file} -f docx -t gfm --wrap=none`
33
- end
29
+ # def docx_2_gfm(file)
30
+ # # TODO before reading the file, I could check if the file exists
31
+ # # TODO check out pandoc options that might be useful e.g. --extract-media='/images/own/'
32
+ # @content = `pandoc #{file} -f docx -t gfm --wrap=none`
33
+ # end
34
34
 
35
35
  def docx_2_markdown(file)
36
36
  # TODO before reading the file, I could check if the file exists
37
37
  # TODO check out pandoc options that might be useful e.g. --extract-media='/images/own/'
38
- @content = `pandoc #{file} --wrap=none --atx-headers -f docx -t markdown-bracketed_spans-link_attributes-smart-simple_tables -s`
38
+ @content = `pandoc '#{file}' --wrap=none --atx-headers -f docx -t markdown-bracketed_spans-link_attributes-smart-simple_tables -s`
39
39
  end
40
40
 
41
41
  # this removes all sorts of strange stuff that pandoc generates when
@@ -1,3 +1,3 @@
1
1
  module Docx2gfm
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/docx2gfm.rb CHANGED
@@ -32,6 +32,10 @@ module Docx2gfm
32
32
  puts opts
33
33
  exit
34
34
  end
35
+ opts.on('-v', '--version', 'Show version of docx2gfm') do
36
+ puts Docx2gfm::VERSION
37
+ exit
38
+ end
35
39
  end
36
40
 
37
41
  # most useful way of creating a required parameter with OptionParser
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docx2gfm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Spier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-17 00:00:00.000000000 Z
11
+ date: 2021-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -49,6 +49,7 @@ extra_rdoc_files: []
49
49
  files:
50
50
  - ".gitignore"
51
51
  - Gemfile
52
+ - LICENSE
52
53
  - LICENSE.txt
53
54
  - MOTIVATION.md
54
55
  - README.md
@@ -84,7 +85,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
85
  - !ruby/object:Gem::Version
85
86
  version: '0'
86
87
  requirements: []
87
- rubygems_version: 3.0.3
88
+ rubyforge_project:
89
+ rubygems_version: 2.6.14
88
90
  signing_key:
89
91
  specification_version: 4
90
92
  summary: Convert a docx file, to github-flavored-markdown