Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Documentation: add asciidoctor support
@ 2018-04-12 11:02 Takashi Iwai
  2018-04-12 11:02 ` [PATCH 1/2] Documentation: fix title markers Takashi Iwai
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Takashi Iwai @ 2018-04-12 11:02 UTC (permalink / raw)


Hi,

this is a patchset to add the support for asciidoctor to generate
documents.  asciidoc is based on python2, and its future isn't clear,
so as a plan-B, we can use asciidoctor instead.

The asciidoctor support is opt-in, the default is still kept for
asciidoc for now.


thanks,

Takashi

===

Takashi Iwai (2):
  Documentation: fix title markers
  Documentation: allow to format with asciidoctor

 Documentation/Makefile                   |   13 +++++++++++++
 Documentation/asciidoctor-extensions.rb  |   29 +++++++++++++++++++++++++++++
 Documentation/nvme-discover.txt          |    2 +-
 Documentation/nvme-huawei-id-ctrl.txt    |    2 +-
 Documentation/nvme-wdc-id-ctrl.txt       |    2 +-
 Documentation/nvme-wdc-purge-monitor.txt |    2 +-
 Documentation/nvme-wdc-purge.txt         |    2 +-
 7 files changed, 47 insertions(+), 5 deletions(-)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] Documentation: fix title markers
  2018-04-12 11:02 [PATCH 0/2] Documentation: add asciidoctor support Takashi Iwai
@ 2018-04-12 11:02 ` Takashi Iwai
  2018-04-12 11:02 ` [PATCH 2/2] Documentation: allow to format with asciidoctor Takashi Iwai
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Takashi Iwai @ 2018-04-12 11:02 UTC (permalink / raw)


The length of the title marker has to be aligned with the previous
line.  This was caught when running asciidoctor, which is more strict
than asciidoc.

Signed-off-by: Takashi Iwai <tiwai at suse.de>

---
 Documentation/nvme-discover.txt          |    2 +-
 Documentation/nvme-huawei-id-ctrl.txt    |    2 +-
 Documentation/nvme-wdc-id-ctrl.txt       |    2 +-
 Documentation/nvme-wdc-purge-monitor.txt |    2 +-
 Documentation/nvme-wdc-purge.txt         |    2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

--- a/Documentation/nvme-discover.txt
+++ b/Documentation/nvme-discover.txt
@@ -1,5 +1,5 @@
 nvme-discover(1)
-==============
+================
 
 NAME
 ----
--- a/Documentation/nvme-huawei-id-ctrl.txt
+++ b/Documentation/nvme-huawei-id-ctrl.txt
@@ -1,5 +1,5 @@
 nvme-huawei-id-ctrl(1)
-=====================
+======================
 
 NAME
 ----
--- a/Documentation/nvme-wdc-id-ctrl.txt
+++ b/Documentation/nvme-wdc-id-ctrl.txt
@@ -1,5 +1,5 @@
 nvme-wdc-id-ctrl(1)
-=====================
+===================
 
 NAME
 ----
--- a/Documentation/nvme-wdc-purge-monitor.txt
+++ b/Documentation/nvme-wdc-purge-monitor.txt
@@ -1,5 +1,5 @@
 nvme-wdc-purge-monitor(1)
-==========================
+=========================
 
 NAME
 ----
--- a/Documentation/nvme-wdc-purge.txt
+++ b/Documentation/nvme-wdc-purge.txt
@@ -1,5 +1,5 @@
 nvme-wdc-purge(1)
-==================
+=================
 
 NAME
 ----

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2/2] Documentation: allow to format with asciidoctor
  2018-04-12 11:02 [PATCH 0/2] Documentation: add asciidoctor support Takashi Iwai
  2018-04-12 11:02 ` [PATCH 1/2] Documentation: fix title markers Takashi Iwai
@ 2018-04-12 11:02 ` Takashi Iwai
  2018-04-12 15:54 ` [PATCH 0/2] Documentation: add asciidoctor support Sagi Grimberg
  2018-06-05 14:41 ` Takashi Iwai
  3 siblings, 0 replies; 8+ messages in thread
From: Takashi Iwai @ 2018-04-12 11:02 UTC (permalink / raw)


Add asciidoctor support.  You need to pass USE_ASCIIDOCTOR=yes to make
for enabling the feature.

Most of the rb extension code was shamelessly borrowed from git.

Signed-off-by: Takashi Iwai <tiwai at suse.de>

---
 Documentation/Makefile                  |   13 +++++++++++++
 Documentation/asciidoctor-extensions.rb |   29 +++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)

--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -35,6 +35,19 @@ MAN_REPO = ../../nvme-manpages
 
 ASCIIDOC_HTML = xhtml11
 ASCIIDOC_CONF = -f asciidoc.conf
+
+ifdef USE_ASCIIDOCTOR
+ASCIIDOC = asciidoctor
+ASCIIDOC_CONF =
+ASCIIDOC_HTML = xhtml5
+ASCIIDOC_DOCBOOK = docbook45
+ASCIIDOC_EXTRA += -acompat-mode
+ASCIIDOC_EXTRA += -I. -rasciidoctor-extensions
+ASCIIDOC_EXTRA += -alitdd='&\#x2d;&\#x2d;'
+ASCIIDOC_EXTRA += -amansource='NVMe'
+ASCIIDOC_EXTRA += -amanmanual='NVMe Manual'
+endif
+
 ASCIIDOC_COMMON = $(ASCIIDOC) $(ASCIIDOC_EXTRA) $(ASCIIDOC_CONF)
 TXT_TO_HTML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_HTML)
 
--- /dev/null
+++ b/Documentation/asciidoctor-extensions.rb
@@ -0,0 +1,29 @@
+require 'asciidoctor'
+require 'asciidoctor/extensions'
+
+module Nvme
+  module Documentation
+    class LinkNvmeProcessor < Asciidoctor::Extensions::InlineMacroProcessor
+      use_dsl
+
+      named :chrome
+
+      def process(parent, target, attrs)
+        if parent.document.basebackend? 'html'
+          %(<a href="#{target}.html">#{target}(#{attrs[1]})</a>\n)
+        elsif parent.document.basebackend? 'manpage'
+          "#{target}(#{attrs[1]})"
+        elsif parent.document.basebackend? 'docbook'
+          "<citerefentry>\n" \
+            "<refentrytitle>#{target}</refentrytitle>" \
+            "<manvolnum>#{attrs[1]}</manvolnum>\n" \
+          "</citerefentry>\n"
+        end
+      end
+    end
+  end
+end
+
+Asciidoctor::Extensions.register do
+  inline_macro Nvme::Documentation::LinkNvmeProcessor, :linknvme
+end

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 0/2] Documentation: add asciidoctor support
  2018-04-12 11:02 [PATCH 0/2] Documentation: add asciidoctor support Takashi Iwai
  2018-04-12 11:02 ` [PATCH 1/2] Documentation: fix title markers Takashi Iwai
  2018-04-12 11:02 ` [PATCH 2/2] Documentation: allow to format with asciidoctor Takashi Iwai
@ 2018-04-12 15:54 ` Sagi Grimberg
  2018-06-05 14:41 ` Takashi Iwai
  3 siblings, 0 replies; 8+ messages in thread
From: Sagi Grimberg @ 2018-04-12 15:54 UTC (permalink / raw)


Reviewed-by: Sagi Grimberg <sagi at grimberg.me>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 0/2] Documentation: add asciidoctor support
  2018-04-12 11:02 [PATCH 0/2] Documentation: add asciidoctor support Takashi Iwai
                   ` (2 preceding siblings ...)
  2018-04-12 15:54 ` [PATCH 0/2] Documentation: add asciidoctor support Sagi Grimberg
@ 2018-06-05 14:41 ` Takashi Iwai
  2018-06-05 14:42   ` Johannes Thumshirn
  3 siblings, 1 reply; 8+ messages in thread
From: Takashi Iwai @ 2018-06-05 14:41 UTC (permalink / raw)


On Thu, 12 Apr 2018 13:02:36 +0200,
Takashi Iwai wrote:
> 
> Hi,
> 
> this is a patchset to add the support for asciidoctor to generate
> documents.  asciidoc is based on python2, and its future isn't clear,
> so as a plan-B, we can use asciidoctor instead.
> 
> The asciidoctor support is opt-in, the default is still kept for
> asciidoc for now.

Just a gentle reminder about this patchset.

I've seen reviewed-by from Sagi, but couldn't find any other
reactions, also not on github repo.

Let me know if I need to fix or resend.


thanks,

Takashi


> 
> 
> thanks,
> 
> Takashi
> 
> ===
> 
> Takashi Iwai (2):
>   Documentation: fix title markers
>   Documentation: allow to format with asciidoctor
> 
>  Documentation/Makefile                   |   13 +++++++++++++
>  Documentation/asciidoctor-extensions.rb  |   29 +++++++++++++++++++++++++++++
>  Documentation/nvme-discover.txt          |    2 +-
>  Documentation/nvme-huawei-id-ctrl.txt    |    2 +-
>  Documentation/nvme-wdc-id-ctrl.txt       |    2 +-
>  Documentation/nvme-wdc-purge-monitor.txt |    2 +-
>  Documentation/nvme-wdc-purge.txt         |    2 +-
>  7 files changed, 47 insertions(+), 5 deletions(-)
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 0/2] Documentation: add asciidoctor support
  2018-06-05 14:41 ` Takashi Iwai
@ 2018-06-05 14:42   ` Johannes Thumshirn
  2018-06-05 15:02     ` Keith Busch
  0 siblings, 1 reply; 8+ messages in thread
From: Johannes Thumshirn @ 2018-06-05 14:42 UTC (permalink / raw)


For the series,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>
-- 
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 0/2] Documentation: add asciidoctor support
  2018-06-05 14:42   ` Johannes Thumshirn
@ 2018-06-05 15:02     ` Keith Busch
  2018-06-05 15:12       ` Takashi Iwai
  0 siblings, 1 reply; 8+ messages in thread
From: Keith Busch @ 2018-06-05 15:02 UTC (permalink / raw)


On Tue, Jun 05, 2018@04:42:47PM +0200, Johannes Thumshirn wrote:
> For the series,
> Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>

Applied, thanks (and sorry for the delay).

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 0/2] Documentation: add asciidoctor support
  2018-06-05 15:02     ` Keith Busch
@ 2018-06-05 15:12       ` Takashi Iwai
  0 siblings, 0 replies; 8+ messages in thread
From: Takashi Iwai @ 2018-06-05 15:12 UTC (permalink / raw)


On Tue, 05 Jun 2018 17:02:36 +0200,
Keith Busch wrote:
> 
> On Tue, Jun 05, 2018@04:42:47PM +0200, Johannes Thumshirn wrote:
> > For the series,
> > Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>
> 
> Applied, thanks (and sorry for the delay).

Great, thanks!


Takashi

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-06-05 15:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-12 11:02 [PATCH 0/2] Documentation: add asciidoctor support Takashi Iwai
2018-04-12 11:02 ` [PATCH 1/2] Documentation: fix title markers Takashi Iwai
2018-04-12 11:02 ` [PATCH 2/2] Documentation: allow to format with asciidoctor Takashi Iwai
2018-04-12 15:54 ` [PATCH 0/2] Documentation: add asciidoctor support Sagi Grimberg
2018-06-05 14:41 ` Takashi Iwai
2018-06-05 14:42   ` Johannes Thumshirn
2018-06-05 15:02     ` Keith Busch
2018-06-05 15:12       ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox