29
37

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AsciidoctorをdockerとAtomエディタでいい感じに使えた

Last updated at Posted at 2015-11-19

diagramは文字化けした。
@hnakamurさんの以下記事を参考にすれば解決するかも。

参考

書き方

a.adoc
= Hello, AsciiDoc!
Doc Writer <doc@example.com>

An introduction to http://asciidoc.org[AsciiDoc].

== First Section

* item 1
* 日本語

[source,ruby]
puts "Hello, World!"

image::http://asciidoctor.org/images/octocat.jpg[GitHub mascot]

[source,ruby]
.a.rb
----
puts "Hello, World!"
----
  • // : コメントアウト
  • <<< : 改ページ
  • = : 見出し1
  • == : 見出し2

出力例

  • htmlは以下。pdfは本みたいでかっこいい。

変換

html化
asciidoctor a.adoc
pdf化
asciidoctor-pdf a.adoc

diagramsが含まれている場合の変換

html化
asciidoctor -r asciidoctor-diagram a.adoc
pdf化
asciidoctor-pdf -r asciidoctor-diagram a.adoc

dockerで使う

adoc.sh
docker run --rm -it \
  -u 1000:1000 \
  -v /home/User1/Downloads/:/documents/ \
  asciidoctor/docker-asciidoctor \
  asciidoctor-pdf $1
  #asciidoctor $1
  • 出力されるファイルを uid:1000, gid:1000 とする。
実行方法
sh adoc.sh a.adoc
  • a.pdf が出力されていることを確認。

1.png

2.png

Atomでプレビュー

atom-ascii.png

  • ctrl-shift-aでプレビューが見れる。

preview.png

Webブラウザ

29
37
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
29
37

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?