-
Notifications
You must be signed in to change notification settings - Fork 215
Add AsciiDoc build infrastructure #862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -181,3 +181,4 @@ cdtOptions text | |
*.py text | ||
*.xhtml text | ||
*.entitlements text | ||
*.adoc text |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// support image rendering within the Asciidoctor Editor (#873) | ||
:imagesdir: {asciidoctorconfigdir}/images | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/html/ | ||
/workspace/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?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 | ||
are made available under the terms of the Eclipse Public License 2.0 | ||
|
@@ -40,6 +40,32 @@ | |
</execution> | ||
</executions> | ||
</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> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
<linkcss /> | ||
<reproducible /> | ||
<source-highlighter>coderay</source-highlighter> | ||
<stylesheet>../help.css</stylesheet> | ||
<toc>macro</toc> | ||
</attributes> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a github-specific directive to locate images in the specified location for the purpose of rendering documents in github itself. Note that new images added by a PR won't yet exist at the required location. Example of github rendering: https://github.com/jld01/cdt/blob/adoc-example/doc/org.eclipse.cdt.doc.user/src/asciidoc/example.adoc |
||
:toc: | ||
:toc-placement!: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need these github-specific directives to support presentation of a table of contents in github. |
||
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; | ||
|
||
} | ||
---- |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We instruct the Asciidoctor Editor to look for images in the
images
folder of the project. Example: