Skip to content

Commit 4770c90

Browse files
committed
add tag
1 parent 54aefc2 commit 4770c90

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

docs/modules/ROOT/pages/index.adoc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,29 @@ In an Antora adoc page, include a remote file
3535
include::https://raw.githubusercontent.com/feelpp/asciidoctor-remote-include-processor/master/test/helloworld.cpp[]
3636
----
3737
```
38+
3839
which gives:
3940

4041
[source,cpp]
4142
----
4243
include::https://raw.githubusercontent.com/feelpp/asciidoctor-remote-include-processor/master/test/helloworld.cpp[]
44+
----
45+
46+
=== Include a remote file partially using tags
47+
48+
In Asciidoctor we can include a source file partially using tags, see https://asciidoctor.org/docs/user-manual/#by-tagged-regions[here].
49+
The extension enable this very feature.
50+
51+
```adoc
52+
[source,cpp]
53+
----
54+
include::https://raw.githubusercontent.com/feelpp/asciidoctor-remote-include-processor/master/test/helloworld.cpp[tag=hello]
55+
----
56+
```
57+
58+
which gives:
59+
60+
[source,cpp]
61+
----
62+
include::https://raw.githubusercontent.com/feelpp/asciidoctor-remote-include-processor/master/test/helloworld.cpp[tag=hello]
4363
----

test/helloworld.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22

33
int main(int argc, char** argv )
44
{
5+
// tag::hello[]
56
std::cout << "Hello World!" << std::endl;
7+
// end::hello[]
68
}

0 commit comments

Comments
 (0)