Login  Register

Re: localization of toc-title, figure-caption, ... in asciidoctor-fopub

Posted by hnakamur on Nov 05, 2014; 3:21pm
URL: https://discuss.asciidoctor.org/localization-of-toc-title-figure-caption-in-asciidoctor-fopub-tp2417p2429.html

Hi Dan,

Thanks for your info!
Before seeing you reply, I wrote a ruby code to modify the `xml:lang` attribute, which becomes unnecessary now.

My rule in Rakefile now becomes:

----
rule '.pdf' => '.adoc' do |t|
  dirname = File.dirname t.source
  basename = File.basename t.source, '.adoc'
  xml_file = "#{dirname}/#{basename}.xml"
  unless File.directory? "./asciidoctor-fopub"
    sh "git clone https://github.com/asciidoctor/asciidoctor-fopub"
  end
  sh %Q{
    bundle exec asciidoctor -a lang=ja -b docbook -d book \
      -r asciidoctor-diagram -r asciidoctor-diagram-cacoo #{t.source} && \
    ./asciidoctor-fopub/fopub -t docbook-xsl-ja #{xml_file} \
      -param alignment left \
      -param body.font.family VL-PGothic-Regular \
      -param dingbat.font.family VL-PGothic-Regular \
      -param monospace.font.family VL-PGothic-Regular \
      -param sans.font.family VL-PGothic-Regular \
      -param title.font.family VL-PGothic-Regular && \
    open #{t.name}
  }
end
----

Thanks again for your help!

Hiroaki