Windows에서 asciidoctor를 사용하여 일본어가 포함 된 asciidoc에서 pdf를 만드는 방법 (2015 년 5 월)
                                            
                                                
                                                
                                                
                                                
                                                
                                                 4335 단어  WindowsPDFasciidocasciidoctor
                    
요약
현재 (2015 년 5 월) 아마도 가장 간단한 Windows에서 asciidoctor를 사용하여 일본어가 포함 된 asciidoc에서 pdf를 만드는 단계입니다.
 환경
절차
ActiveScriptRuby의 최신 버전을
C:\Ruby22에 설치 gem install asciidoctor gem install --pre asciidoctor-pdf C:\Ruby22\lib\ruby\gems\2.2.0\gems\asciidoctor-pdf-1.5.0.alpha.6\data\themes에서 default-theme.yml 편집 (아래) C:\Ruby22\lib\ruby\gems\2.2.0\gems\prawn-1.2.1\lib\prawn\text\formatted에서 line_wrap.rb를 편집하십시오 (아래). 자세한 내용은 Add a CJK theme #82 참조 example.adoc 정보 asciidoctor-pdf example.adoc example.adoc
= こんにちは、AsciiDoc!
Doc Writer <[email protected]>
http://asciidoc.org[AsciiDoc] 入門。
AsciiDoc は、意味的には DocBook XML のに相当するが、プレーン·テキスト·マークアップの規則を使用して、人間が読めるドキュメントフォーマット、である。 AsciiDoc は文書は、任意のテキストエディタを使用して作成され、「そのまま"または、HTML や DocBook のツールチェーンでサポートされている他のフォーマット、すなわち PDF、TeX の、Unix の man ページ、電子書籍、スライドプレゼンテーションなどにレンダリングすることができます。
== 第一節
* アイテム 1
* アイテム 2
[source,ruby]
puts "Hello, World!"
결과
 
4 단계를 수행 하지 않으면 다음과 같아야 합니다.
 
 default-theme.yml 편집
default-theme.yml--- default-theme.yml.old
+++ default-theme.yml
@@ -16,8 +16,11 @@
       bold: mplus1mn-bold-ascii.ttf
       italic: mplus1mn-italic-ascii.ttf
       bold_italic: mplus1mn-bolditalic-ascii.ttf
-    #Mplus1pMultilingual:
-    #  normal: mplus1p-regular-multilingual.ttf
+    Mplus1pMultilingual:
+      normal: mplus1p-regular-multilingual.ttf
+      bold: mplus1p-regular-multilingual.ttf
+      italic: mplus1p-regular-multilingual.ttf
+      bold_italic: mplus1p-regular-multilingual.ttf
     #FontAwesome:
     #  normal: fontawesome-regular.ttf
   # FIXME using fallbacks breaks use of custom font styles (fixed in Prawn 1.2.1!)
@@ -33,7 +36,7 @@
   size: Letter
 base:
   font_color: 333333
-  font_family: NotoSerif
+  font_family: Mplus1pMultilingual
   # choose one of these font_size/line_height_length combinations
   #font_size: 14
   #line_height_length: 20
당연히 기울임 꼴 등은 무시됩니다.
 prawn line_wrap.rb 편집
line_wrap.rb$ diff -u line_wrap.rb.old  line_wrap.rb
@@ -118,7 +118,8 @@
         # The pattern used to determine chunks of text to place on a given line
         #
         def scan_pattern
-          pattern = "[^#{break_chars}]+#{soft_hyphen}|" +
+          pattern = "\\p{Han}|\\p{Hiragana}|\\p{Katakana}|\\p{Common}|" + # <-break all CJ chars
+            "[^#{break_chars}]+#{soft_hyphen}|" +
             "[^#{break_chars}]+#{hyphen}+|" +
             "[^#{break_chars}]+|" +
             "[#{whitespace}]+|" +
 문제점
--- default-theme.yml.old
+++ default-theme.yml
@@ -16,8 +16,11 @@
       bold: mplus1mn-bold-ascii.ttf
       italic: mplus1mn-italic-ascii.ttf
       bold_italic: mplus1mn-bolditalic-ascii.ttf
-    #Mplus1pMultilingual:
-    #  normal: mplus1p-regular-multilingual.ttf
+    Mplus1pMultilingual:
+      normal: mplus1p-regular-multilingual.ttf
+      bold: mplus1p-regular-multilingual.ttf
+      italic: mplus1p-regular-multilingual.ttf
+      bold_italic: mplus1p-regular-multilingual.ttf
     #FontAwesome:
     #  normal: fontawesome-regular.ttf
   # FIXME using fallbacks breaks use of custom font styles (fixed in Prawn 1.2.1!)
@@ -33,7 +36,7 @@
   size: Letter
 base:
   font_color: 333333
-  font_family: NotoSerif
+  font_family: Mplus1pMultilingual
   # choose one of these font_size/line_height_length combinations
   #font_size: 14
   #line_height_length: 20
$ diff -u line_wrap.rb.old  line_wrap.rb
@@ -118,7 +118,8 @@
         # The pattern used to determine chunks of text to place on a given line
         #
         def scan_pattern
-          pattern = "[^#{break_chars}]+#{soft_hyphen}|" +
+          pattern = "\\p{Han}|\\p{Hiragana}|\\p{Katakana}|\\p{Common}|" + # <-break all CJ chars
+            "[^#{break_chars}]+#{soft_hyphen}|" +
             "[^#{break_chars}]+#{hyphen}+|" +
             "[^#{break_chars}]+|" +
             "[#{whitespace}]+|" +
Doc Writer <[email protected]>가 잘 처리되지 않음 stdout
C:/Ruby22/lib/ruby/gems/2.2.0/gems/pdf-core-0.2.5/lib/pdf/core/pdf_object.rb:55:
 warning: regexp match /.../n against to UTF-8 string
C:/Ruby22/lib/ruby/gems/2.2.0/gems/pdf-core-0.2.5/lib/pdf/core/pdf_object.rb:55:
 warning: regexp match /.../n against to UTF-8 string
                Reference
이 문제에 관하여(Windows에서 asciidoctor를 사용하여 일본어가 포함 된 asciidoc에서 pdf를 만드는 방법 (2015 년 5 월)), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/heartfield/items/cc037d0ddb31ee314db9텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)