Skip to content

Commit 67d25ec

Browse files
committed
Add AsciiDoc build infrastructure
1 parent abe036e commit 67d25ec

File tree

7 files changed

+121
-3
lines changed

7 files changed

+121
-3
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,4 @@ cdtOptions text
181181
*.py text
182182
*.xhtml text
183183
*.entitlements text
184+
*.adoc text
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// support image rendering within the Asciidoctor Editor (#873)
2+
:imagesdir: {asciidoctorconfigdir}/images
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
/html/
12
/workspace/

doc/org.eclipse.cdt.doc.user/build.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
###############################################################################
2-
# Copyright (c) 2000, 2011 IBM Corporation and others.
2+
# Copyright (c) 2000, 2024 IBM Corporation and others.
33
#
44
# This program and the accompanying materials
55
# are made available under the terms of the Eclipse Public License 2.0
@@ -38,7 +38,8 @@ bin.includes = about.html,\
3838
intro/,\
3939
notices.html,\
4040
book.css,\
41-
index*/
41+
index*/,\
42+
html/
4243

4344
bin.excludes = build.properties,\
4445
customBuildCallbacks.xml

doc/org.eclipse.cdt.doc.user/help.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,25 @@ div.linux {display:none;}
6060
.bold {font-weight:600;}
6161
.linethrough {text-decoration: line-through;}
6262
.underline {text-decoration: underline;}
63+
64+
/* AsciiDoc support based on Asciidoctor default stylesheet | MIT License | http://asciidoctor.org (#873) */
65+
p.tableblock { margin: 0 }
66+
table.tableblock tr th, table.tableblock tr td { padding: 0.3em }
67+
table.tableblock, th.tableblock, td.tableblock { border: 0 solid #dedede }
68+
table.grid-all>thead>tr>.tableblock, table.grid-all>tbody>tr>.tableblock { border-width: 0 1px 1px 0 }
69+
table.grid-all>tfoot>tr>.tableblock { border-width: 1px 1px 0 0 }
70+
table.grid-cols>*>tr>.tableblock { border-width: 0 1px 0 0 }
71+
table.grid-rows>thead>tr>.tableblock, table.grid-rows>tbody>tr>.tableblock { border-width: 0 0 1px 0 }
72+
table.grid-rows>tfoot>tr>.tableblock { border-width: 1px 0 0 0 }
73+
table.grid-all>*>tr>.tableblock:last-child, table.grid-cols>*>tr>.tableblock:last-child { border-right-width: 0 }
74+
table.grid-all>tbody>tr:last-child>.tableblock, table.grid-all>thead:last-child>tr>.tableblock, table.grid-rows>tbody>tr:last-child>.tableblock, table.grid-rows>thead:last-child>tr>.tableblock { border-bottom-width: 0 }
75+
table.frame-all { border-width: 1px }
76+
table.frame-sides { border-width: 0 1px }
77+
table.frame-topbot { border-width: 1px 0 }
78+
th.halign-left, td.halign-left { text-align: left }
79+
th.halign-right, td.halign-right { text-align: right }
80+
th.halign-center, td.halign-center { text-align: center }
81+
th.valign-top, td.valign-top { vertical-align: top }
82+
th.valign-bottom, td.valign-bottom { vertical-align: bottom }
83+
th.valign-middle, td.valign-middle { vertical-align: middle }
84+
div.listingblock pre { padding: 0.7em }

doc/org.eclipse.cdt.doc.user/pom.xml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
Copyright (c) 2011, 2021 Contributors to the Eclipse Foundation
3+
Copyright (c) 2011, 2024 Contributors to the Eclipse Foundation
44
55
This program and the accompanying materials
66
are made available under the terms of the Eclipse Public License 2.0
@@ -40,6 +40,32 @@
4040
</execution>
4141
</executions>
4242
</plugin>
43+
<plugin>
44+
<groupId>org.asciidoctor</groupId>
45+
<artifactId>asciidoctor-maven-plugin</artifactId>
46+
<version>3.0.0</version>
47+
<executions>
48+
<execution>
49+
<id>adoc-to-html</id>
50+
<phase>generate-resources</phase>
51+
<goals>
52+
<goal>process-asciidoc</goal>
53+
</goals>
54+
<configuration>
55+
<outputDirectory>${project.basedir}/html</outputDirectory>
56+
<attributes>
57+
<icons>font</icons>
58+
<imagesdir>../images</imagesdir>
59+
<linkcss />
60+
<reproducible />
61+
<source-highlighter>coderay</source-highlighter>
62+
<stylesheet>../help.css</stylesheet>
63+
<toc>macro</toc>
64+
</attributes>
65+
</configuration>
66+
</execution>
67+
</executions>
68+
</plugin>
4369
</plugins>
4470
</build>
4571

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
////
2+
Copyright (c) 2024 John Dallaway and others
3+
This program and the accompanying materials
4+
are made available under the terms of the Eclipse Public License 2.0
5+
which accompanies this distribution, and is available at
6+
https://www.eclipse.org/legal/epl-2.0/
7+
8+
SPDX-License-Identifier: EPL-2.0
9+
10+
Contributors:
11+
John Dallaway - initial example AsciiDoc content (#873)
12+
////
13+
14+
// support image rendering and table of contents within GitHub
15+
ifdef::env-github[]
16+
:imagesdir: https://raw.githubusercontent.com/eclipse-cdt/cdt/main/doc/org.eclipse.cdt.doc.user/images
17+
:toc:
18+
:toc-placement!:
19+
endif::[]
20+
21+
= Example document
22+
23+
toc::[]
24+
25+
== Images
26+
27+
Example image:
28+
29+
image:search.png[Search dialog]
30+
31+
== Tables
32+
33+
Example table:
34+
35+
[options="header"]
36+
|===
37+
|Column A |Column B
38+
|Cell 1A |Cell 1B
39+
|Cell 2A |Cell 2B
40+
|Cell 3A |Cell 3B
41+
|===
42+
43+
== Lists
44+
45+
Example list:
46+
47+
. Item A
48+
. Item B
49+
. Item C
50+
51+
== Code blocks
52+
53+
Example code block:
54+
55+
[source,c]
56+
----
57+
#include <stdio.h>
58+
59+
int main (int argc, char* argv[]) {
60+
61+
printf("Hello World!\n");
62+
return 0;
63+
64+
}
65+
----

0 commit comments

Comments
 (0)