Skip to content

Commit

Permalink
Docs: reproduce single_document.adoc from nav.adoc and sed script (#2468
Browse files Browse the repository at this point in the history
)

Co-authored-by: Hiromasa Ihara <[email protected]>
Co-authored-by: Hiroyuki Ikegami <[email protected]>
  • Loading branch information
3 people authored Jan 1, 2024
1 parent 8687a3e commit 6ad51e4
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
24 changes: 23 additions & 1 deletion doc/tools/create_single_page_html.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,26 @@ cd ${DIR}/../modules/ROOT/pages

echo "Creating ${DIR}/../modules/ROOT/pages/single_document.html"

asciidoctor -b html5 -o single_document.html single_document.adoc
SED_ARG="s/xref:/include::/"
for NUM in $(seq 1 1 5); do
SED_ARG="${SED_ARG} -e s/^*\{$NUM\}.\(inc.*\)\[.*\]$/\1[leveloffset=+$NUM]/"
done

cat << SEC | asciidoctor -b html5 -o single_document.html -
= OpenEMS - Open Energy Management System
ifndef::toc[]
(c) 2023 OpenEMS Association e.V.
:doctype: book
:sectnums:
:sectnumlevels: 4
:toc:
:toclevels: 2
:toc-title: Inhalt
:experimental:
:keywords: AsciiDoc
:source-highlighter: highlight.js
:icons: font
endif::toc[]
$(cat ../nav.adoc | sed -e $(echo ${SED_ARG}) -e 's/^* \(.*\)$/== \1/g' | head -n-1)
SEC
24 changes: 23 additions & 1 deletion doc/tools/create_single_page_pdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,26 @@ cd ${DIR}/../modules/ROOT/${LANG}

echo "Creating ${DIR}/../modules/ROOT/${LANG}/single_document.pdf"

asciidoctor-pdf -o single_document.pdf single_document.adoc
SED_ARG="s/xref:/include::/"
for NUM in $(seq 1 1 5); do
SED_ARG="${SED_ARG} -e s/^*\{$NUM\}.\(inc.*\)\[.*\]$/\1[leveloffset=+$NUM]/"
done

cat << SEC | asciidoctor-pdf -o single_document.pdf -
= OpenEMS - Open Energy Management System
ifndef::toc[]
(c) 2023 OpenEMS Association e.V.
:doctype: book
:sectnums:
:sectnumlevels: 4
:toc:
:toclevels: 2
:toc-title: Inhalt
:experimental:
:keywords: AsciiDoc
:source-highlighter: highlight.js
:icons: font
endif::toc[]
$(cat ../nav.adoc | sed -e $(echo ${SED_ARG}) -e 's/^* \(.*\)$/== \1/g' | head -n-1)
SEC

0 comments on commit 6ad51e4

Please sign in to comment.