Add AsciiDoc build infrastructure

This commit is contained in:
John Dallaway 2024-07-11 14:03:27 +01:00
parent c4c11ad964
commit e8605fdc14
7 changed files with 121 additions and 3 deletions

1
.gitattributes vendored
View file

@ -181,3 +181,4 @@ cdtOptions text
*.py text *.py text
*.xhtml text *.xhtml text
*.entitlements text *.entitlements text
*.adoc text

View file

@ -0,0 +1,2 @@
// support image rendering within the Asciidoctor Editor (#873)
:imagesdir: {asciidoctorconfigdir}/images

View file

@ -1 +1,2 @@
/html/
/workspace/ /workspace/

View file

@ -1,5 +1,5 @@
############################################################################### ###############################################################################
# Copyright (c) 2000, 2011 IBM Corporation and others. # Copyright (c) 2000, 2024 IBM Corporation and others.
# #
# This program and the accompanying materials # This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0 # are made available under the terms of the Eclipse Public License 2.0
@ -38,7 +38,8 @@ bin.includes = about.html,\
intro/,\ intro/,\
notices.html,\ notices.html,\
book.css,\ book.css,\
index*/ index*/,\
html/
bin.excludes = build.properties,\ bin.excludes = build.properties,\
customBuildCallbacks.xml customBuildCallbacks.xml

View file

@ -60,3 +60,25 @@ div.linux {display:none;}
.bold {font-weight:600;} .bold {font-weight:600;}
.linethrough {text-decoration: line-through;} .linethrough {text-decoration: line-through;}
.underline {text-decoration: underline;} .underline {text-decoration: underline;}
/* AsciiDoc support based on Asciidoctor default stylesheet | MIT License | http://asciidoctor.org (#873) */
p.tableblock { margin: 0 }
table.tableblock tr th, table.tableblock tr td { padding: 0.3em }
table.tableblock, th.tableblock, td.tableblock { border: 0 solid #dedede }
table.grid-all>thead>tr>.tableblock, table.grid-all>tbody>tr>.tableblock { border-width: 0 1px 1px 0 }
table.grid-all>tfoot>tr>.tableblock { border-width: 1px 1px 0 0 }
table.grid-cols>*>tr>.tableblock { border-width: 0 1px 0 0 }
table.grid-rows>thead>tr>.tableblock, table.grid-rows>tbody>tr>.tableblock { border-width: 0 0 1px 0 }
table.grid-rows>tfoot>tr>.tableblock { border-width: 1px 0 0 0 }
table.grid-all>*>tr>.tableblock:last-child, table.grid-cols>*>tr>.tableblock:last-child { border-right-width: 0 }
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 }
table.frame-all { border-width: 1px }
table.frame-sides { border-width: 0 1px }
table.frame-topbot { border-width: 1px 0 }
th.halign-left, td.halign-left { text-align: left }
th.halign-right, td.halign-right { text-align: right }
th.halign-center, td.halign-center { text-align: center }
th.valign-top, td.valign-top { vertical-align: top }
th.valign-bottom, td.valign-bottom { vertical-align: bottom }
th.valign-middle, td.valign-middle { vertical-align: middle }
div.listingblock pre { padding: 0.7em }

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
Copyright (c) 2011, 2021 Contributors to the Eclipse Foundation Copyright (c) 2011, 2024 Contributors to the Eclipse Foundation
This program and the accompanying materials This program and the accompanying materials
are made available under the terms of the Eclipse Public License 2.0 are made available under the terms of the Eclipse Public License 2.0
@ -40,6 +40,32 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>adoc-to-html</id>
<phase>generate-resources</phase>
<goals>
<goal>process-asciidoc</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/html</outputDirectory>
<attributes>
<icons>font</icons>
<imagesdir>../images</imagesdir>
<linkcss />
<reproducible />
<source-highlighter>coderay</source-highlighter>
<stylesheet>../help.css</stylesheet>
<toc>macro</toc>
</attributes>
</configuration>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</build> </build>

View file

@ -0,0 +1,65 @@
////
Copyright (c) 2024 John Dallaway and others
This program and the accompanying materials
are made available under the terms of the Eclipse Public License 2.0
which accompanies this distribution, and is available at
https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
John Dallaway - initial example AsciiDoc content (#873)
////
// support image rendering and table of contents within GitHub
ifdef::env-github[]
:imagesdir: https://raw.githubusercontent.com/eclipse-cdt/cdt/main/doc/org.eclipse.cdt.doc.user/images
:toc:
:toc-placement!:
endif::[]
= Example document
toc::[]
== Images
Example image:
image:search.png[Search dialog]
== Tables
Example table:
[options="header"]
|===
|Column A |Column B
|Cell 1A |Cell 1B
|Cell 2A |Cell 2B
|Cell 3A |Cell 3B
|===
== Lists
Example list:
. Item A
. Item B
. Item C
== Code blocks
Example code block:
[source,c]
----
#include <stdio.h>
int main (int argc, char* argv[]) {
printf("Hello World!\n");
return 0;
}
----