Skip to content

Commit

Permalink
Build .asciidoc Files for GitHub Pages from c9343fe
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Sep 25, 2023
0 parents commit f3f59ee
Show file tree
Hide file tree
Showing 97 changed files with 11,563 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
build
.idea
CMakeCache.txt
CMakeFiles
Testing
*.exe
*.stackdump
*.so
build-stamp
configure-stamp
*~
#*#
.#*
bin
lib
valgrind.log
gitrevision.h
.cgreen-debug-commands
56 changes: 56 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
FIND_PACKAGE(Asciidoctor)

SET(ASCIIDOC_CONFFILE "${PROJECT_SOURCE_DIR}/doc/cgreen_asciidoc.conf")

OPTION(CGREEN_WITH_HTML_DOCS "with HTML output" FALSE)
OPTION(CGREEN_WITH_PDF_DOCS "with PDF output" FALSE)

IF (CGREEN_WITH_HTML_DOCS AND NOT ASCIIDOCTOR_FOUND)
MESSAGE(FATAL_ERROR "Can't produce HTML without 'asciidoctor'")
ENDIF (CGREEN_WITH_HTML_DOCS AND NOT ASCIIDOCTOR_FOUND)

IF (CGREEN_WITH_PDF_DOCS AND NOT ASCIIDOCTORPDF_FOUND)
MESSAGE(FATAL_ERROR "Can't produce PDF without 'asciidoctor-pdf'")
ENDIF (CGREEN_WITH_PDF_DOCS AND NOT ASCIIDOCTORPDF_FOUND)

IF(CGREEN_WITH_HTML_DOCS OR CGREEN_WITH_PDF_DOCS)
FILE(GLOB _docfiles *.asciidoc)
FOREACH(_file ${_docfiles})
GET_FILENAME_COMPONENT(_file_we ${_file} NAME_WE)
SET(_in "${_file_we}")
IF (CGREEN_WITH_HTML_DOCS)
SET(_out "${_file_we}.html")
ADD_CUSTOM_COMMAND(
OUTPUT "${_out}-html"
COMMAND ${ASCIIDOCTOR_EXECUTABLE}
-a VERSION=${APPLICATION_VERSION}
-o ${_out} ${_file}
DEPENDS ${_file}
COMMENT "asciidoctor ${_in}"
)
ADD_CUSTOM_TARGET(${_in}-html ALL echo
DEPENDS "${_out}-html"
)
ENDIF (CGREEN_WITH_HTML_DOCS)
IF (CGREEN_WITH_PDF_DOCS)
SET(_out "${_file_we}.pdf")
ADD_CUSTOM_COMMAND(
OUTPUT "${_out}-pdf"
COMMAND ${ASCIIDOCTORPDF_EXECUTABLE}
-a toc
-a VERSION=${APPLICATION_VERSION}
-a docinfo -o ${_out} ${_file}
DEPENDS ${_file}
COMMENT "asciidoctor-pdf ${_in}"
)
ADD_CUSTOM_TARGET(${_in}-pdf ALL echo
DEPENDS "${_out}-pdf"
)
ENDIF (CGREEN_WITH_PDF_DOCS)
ENDFOREACH(_file)
ENDIF(CGREEN_WITH_HTML_DOCS OR CGREEN_WITH_PDF_DOCS)

IF(UNIX)
set(MANPAGES man)
INSTALL(DIRECTORY ${MANPAGES} DESTINATION share)
ENDIF(UNIX)
39 changes: 39 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
HOW-TO: Compiling the Cgreen Guide
===================================

The Cgreen Guide Book is written using Asciidoctor. Asciidoctor builds
upon the asciidoc format, is 100 times faster than the Python asciidoc
toolchain and can generate PDF in the same step. Writing in
asciidoc(tor) is a wonderful way to write textual docs. Please visit
http://www.asciidoctor.org for more information.

You also need a source-highlighter as described in
(http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#source-code)

There are a number of source examples in the documentation that are
automatically included from the `tutorial_src` subdirectory. They are
kept separate so that they can be compiled to ensure that they
actually are correct. Then all, or a part of, the file can be
included. To do that, go to the subdirectory, ensure you have the
correct version of cgreen in your path and do `make`.

The one drawback of this strategy is that you cannot read the source
of the examples in a raw asciidoc-conversion, like on github, since it
requires including other files, which is not allowed for security
reasons. So we need to generate the documentation and upload it to
`cgreen-devs.github.io`. Ensure you have *asciidoctor* installed
(`sudo apt install asciidoctor` or similar).

It is preferred to generate multi-page HTML, which currently
asciidoctor does not do natively yet. There is an extension in the
asciidoctor-extension-lab, which I have not
tried. [asciidoctor-chunker](https://github.com/wshito/asciidoctor-chunker)
works well, but requires installing Roswell (a Common Lisp
environment). If you use asciidoctor-chunker, first generate the HTML with asciidoctor

asciidoctor cgreen-guide-en.asciidoc -o html/cgreen-guide-en.html

then chunk it using asciidoctor-chunker (assuming some convenience
links in your path...)

asciidoctor-chunker html/cgreen-guide-en.html
458 changes: 458 additions & 0 deletions README.html

Large diffs are not rendered by default.

Binary file added avtar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions cgreen-guide-en-docinfo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!--
article-docinfo.xml
Example DocBook document information file for article.txt.
-->

<authorgroup>
<author>
<firstname>Thomas</firstname>
<surname>Nilefalk</surname>
<email>thomas@junovagen.se</email>
</author>

<author>
<firstname>Marcus</firstname>
<surname>Baker</surname>
<othername>lastcraft</othername>
<email>marcus@lastcraft.com</email>
</author>

<author>
<firstname>João</firstname>
<surname>Freitas</surname>
<othername>joaohf</othername>
<email>joaohf@gmail.com</email>
</author>

</authorgroup>

<edition>Cgreen Unit Test for C/C++ language</edition>

<copyright>
<year>2009-2012</year>
<holder>Cgreen Team</holder>
</copyright>

<legalnotice>
<para>Permission to use, copy, modify and distribute.</para>
</legalnotice>

<legalnotice>
<para>The copyright holders make no representation about the suitability of
this document for any purpose. It is provided
<quote>as is</quote> without expressed or implied warranty.</para>
</legalnotice>
47 changes: 47 additions & 0 deletions cgreen-guide-en-docinfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!--
article-docinfo.xml
Example DocBook document information file for article.txt.
-->

<authorgroup>
<author>
<firstname>Marcus</firstname>
<surname>Baker</surname>
<othername>lastcraft</othername>
<email>marcus@lastcraft.com</email>
</author>

<author>
<firstname>João</firstname>
<surname>Freitas</surname>
<othername>joaohf</othername>
<email>joaohf@gmail.com</email>
</author>

<author>
<firstname>Thomas</firstname>
<surname>Nilefalk</surname>
<othername>thoni56</othername>
<email>thomas@junovagen.se</email>
</author>

</authorgroup>

<edition>Cgreen Unit Test for C language</edition>

<copyright>
<year>2012</year>
<holder>Cgreen Team</holder>
</copyright>

<legalnotice>
<para>Permission to use, copy, modify and distribute.</para>
</legalnotice>

<legalnotice>
<para>The copyright holders make no representation about the suitability of
this document for any purpose. It is provided
<quote>as is</quote> without expressed or implied warranty.</para>
</legalnotice>


Loading

0 comments on commit f3f59ee

Please sign in to comment.