Skip to content

Commit

Permalink
Fix the documentation generation. Add a "presentations" page.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpc-lip6 committed Jan 26, 2025
1 parent 5110135 commit e89898d
Show file tree
Hide file tree
Showing 10 changed files with 251 additions and 66 deletions.
3 changes: 3 additions & 0 deletions documentation/content/pages/documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ Coriolis Documentation
:width: 5
:offset: 1

`Presentations <{filename}/pages/presentations/Presentations_HTML.rst>`_ |br|
Various presentations made around Coriolis

`Coriolis User's Guide <{filename}/pages/users-guide/UsersGuide_HTML.rst>`_ |br|
Using the software

Expand Down
27 changes: 27 additions & 0 deletions documentation/content/pages/presentations/Presentations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.. -*- mode: rst; explicit-buffer-name: "RDS.rst<pelican>" -*-
.. include:: ../../../etc/definitions.rst


:Date: 25, january 2025
:Authors: Jean-Paul Chaput
:Contact: <[email protected]>
:Version: 0.1


|medskip|


=============
Presentations
=============

|pagestylefancy|


.. contents::

|newpage|


.. include:: PresentationsPage.rst
17 changes: 17 additions & 0 deletions documentation/content/pages/presentations/PresentationsPage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.. -*- Mode: rst -*-
|newpage|


SAL Bootcamp, 2022
==================

Presentation made at SAL Bootcamp (Graz). It still reflects the state of
the analog and mixed signal design flow in Coriolis to this day
(January 25, 2025). The mixed flow is at a demonstrator stage.

`SAL.Bootcamp.pdf <{static}/pdfs/SAL.Bootcamp.pdf>`_


25 changes: 25 additions & 0 deletions documentation/content/pages/presentations/Presentations_HTML.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.. -*- mode: rst; explicit-buffer-name: "Presentations_HTML.rst<pelican>" -*-
=============
Presentations
=============


:slug: presentations
:date: 2025-01-25 16:00
:Authors: Jean-Paul Chaput
:Contact: <[email protected]>
:Version: 0.1
:status: hidden


.. include:: ../../../etc/definitions.rst


.. contents::
:depth: 2


.. include:: PresentationsPage.rst

118 changes: 101 additions & 17 deletions documentation/etc/doPdf.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,106 @@
#!/bin/bash

document=`basename -s .rst $1`
current_source_dir=$2
stylesheet=$3
rst2latex=$4
pdflatex=$5
echo "Generating: ${document}.pdf from $current_source_dir with stylesheet $stylesheet"

$rst2latex --use-latex-toc --stylesheet=$stylesheet ${document}.rst ${document}-raw.tex
sed "s%\(include.*\){\(\..*\)}%\1{$current_source_dir/\2}%" \
's, \\& \\\\multicolumn{2}{l|}{, \\& \\\\multicolumn{2}{p{0.6\\\\DUtablewidth}|}{,' \
${document}-raw.tex > ${document}.tex
$pdflatex ${document}

rm -f ${document}.rst \
${document}-raw.tex \
${document}.tex \
printHelp () {
echo ""
echo " Usage: doPdf.sh [--buildDir=<buildDir>]"
echo " [--sourceDir=<sourceDir>]"
echo " [--stylesheet=<stylesheet>]"
echo " [--rst2latex=<rst2latex_bin>]"
echo " [--pdflatex=<pdflatex_bin>]"
echo " <document>"
echo ""
echo " Mandatory argument:"
echo " <document> : There must be one, and exactly one reStructuredText document to"
echo " be processed. With the \".rst\" extension."
echo ""
echo " Options:"
echo " [--buildDir=] : The directory where the pdfs will be created."
echo " Default: the current working directory."
echo " [--sourceDir=] : The top directory where the documentation source is located."
echo " Default: the current working directory."
echo " [--stylesheet=] : The LaTeX style to be used."
echo " Default: no style at all."
echo " [--rst2latex=] : The absolute path to the rst2latex binary."
echo " Default: rst2latex (let the OS find out)."
echo " [--pdflatex=] : The absolute path to the pdflatex binary."
echo " Default: pdflatex (let the OS find out)."
echo ""

}

if [ $# -eq 0 ]; then printHelp; exit 0; fi


getString ()
{
string=`echo $1 | cut -d '=' -f 2-`
echo $string
}


document=""
buildDir="`pwd`"
sourceDir="`pwd`"
stylesheet="None"
rst2latex="rst2latex"
pdflatex="pdflatex"
badAgument=""
while [ $# -gt 0 ]; do
case $1 in
--buildDir=*) buildDir=`getString $1`;;
--sourceDir=*) sourceDir=`getString $1`;;
--stylesheet=*) stylesheet=`getString $1`;;
--rst2latex=*) rst2latex=`getString $1`;;
--pdflatex=*) pdflatex=`getString $1`;;
-*) badArgument="$1";;
*) if [ ! -z "${document}" ]; then
printHelp
echo "[ERROR] doPdf.sh: You must supply only one document."
echo " (\"${document}\" and \"$1\")."
exit 1
fi
sourceDocumentDir=`dirname $1`
document=`basename -s .rst $1`;;
esac
if [ ! -z "${badArgument}" ]; then
echo "[ERROR] doPdf.sh: Unknown argument \"${badArgument}\"."
printHelp
exit 1
fi
shift
done
if [ -z "${document}" ]; then
printHelp
exit 0
fi

echo "doPdf.sh:"
echo " sourceDir: ${sourceDir}"
echo " sourceDocumentDir: ${sourceDocumentDir}"
echo " document: ${document}"
echo " stylesheet: ${stylesheet}"
echo " buildDir: ${buildDir}"
echo " rst2latex: ${rst2latex}"
echo " pdflatex: ${pdflatex}"

export TEXINPUTS="${sourceDir}/${sourceDocumentDir}:${sourceDir}//:${TEXINPUTS}"
echo "TEXINPUTS=${TEXINPUTS}"
cd ${sourceDir}/${sourceDocumentDir}
${rst2latex} --use-latex-toc \
--stylesheet=${stylesheet} \
${document}.rst \
${buildDir}/${document}.tex
cd ${buildDir}
sed -i 's,\(include.*\){\(\.\./\)*\(.*\)},\1{\3},' ${document}.tex
sed -i 's,\(include.*\){\(\./images\)\+\(.*\)},\1{images\3},' ${document}.tex
sed -i 's, \\& \\\\multicolumn{2}{l|}{, \\& \\\\multicolumn{2}{p{0.6\\\\DUtablewidth}|}{,' \
${document}.tex
${pdflatex} ${document}
${pdflatex} ${document}

rm -f ${document}.tex \
${document}.log \
${document}.out \
${document}.aux \
${document}.toc
${document}.toc \
texput.log
113 changes: 64 additions & 49 deletions documentation/meson.build
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
pdfcontent = files(
pdfcontent = [
'content/pages/users-guide/UsersGuide.rst',
'content/pages/python-tutorial/PythonTutorial.rst',
'content/pages/python-cpp/PythonCpp.rst',
'content/pages/design-flow/DesignFlow.rst',
'content/pages/stratus/Stratus.rst',
'content/pages/check-toolkit/CheckToolkit.rst',
'content/pages/rds/RDS.rst',
)
]


rstcontent = files(
Expand Down Expand Up @@ -35,6 +35,8 @@ rstcontent = files(
'content/pages/python-tutorial/RealDesigns.rst',
'content/pages/python-tutorial/ToolEngines.rst',
'content/pages/rds/RDS_HTML.rst',
'content/pages/presentations/PresentationsPage.rst',
'content/pages/presentations/Presentations_HTML.rst',
'content/pages/rds/RDSpage.rst',
'content/pages/stratus/Developper.rst',
'content/pages/stratus/DpGen.rst',
Expand Down Expand Up @@ -91,57 +93,70 @@ plugins = files(

dopdf = find_program('etc/doPdf.sh')

pdf_gen = generator(
dopdf,
output: '@[email protected]',
arguments: ['@INPUT@', '@CURRENT_SOURCE_DIR@', rst2latex.full_path(), pdflatex.full_path()],
)

pdfs_list = pdf_gen.process(pdfcontent)
pdfs_dep = declare_dependency(sources: pdfs_list)
pdf_documents = []
foreach document : pdfcontent
basename = document.split( '/' )[ -1 ].replace( '.rst', '' )
pdf_documents += custom_target( basename + '_pdf'
, command: [ dopdf
, '--buildDir=@0@'.format( meson.current_build_dir() )
, '--sourceDir=@0@'.format( meson.current_source_dir() )
, '--stylesheet=etc/SoC-ReST.tex'
, '--rst2latex=@0@'.format( rst2latex.full_path() )
, '--pdflatex=@0@'.format( pdflatex.full_path() )
, document ]
, input: document
, output: basename + '.pdf'
, install: true
, install_dir: pdfdir
)
endforeach

pdfs = build_target('pelican-pdfs', target_type: 'library', dependencies: pdfs_dep)

cdata = configuration_data()
cdata.set('SOURCEDIR', meson.current_source_dir())
cdata.set('SOURCEDIR' , meson.current_source_dir())
cdata.set('OUTPUT_PATH', meson.current_build_dir())
cdata.set('SITEURL', docsiteurl )
pelicanconf = configure_file(
input: 'pelicanconf.py.in',
output: 'pelicanconf.py',
configuration: cdata,
install: false
)
cdata.set('SITEURL' , docsiteurl )
pelicanconf = configure_file( input: 'pelicanconf.py.in'
, output: 'pelicanconf.py'
, configuration: cdata
, install: false
)

htmldoc = custom_target( 'htmldoc'
, output: [ 'archives.html'
, 'authors.html'
, 'categories.html'
, 'images'
, 'index.html'
, 'pages'
, 'pdfs'
, 'tags.html'
, 'theme'
]
, depend_files: [ rstcontent, css, plugins, pelicanconf ]
, depends: [ pdf_documents ]
, command: [ pelican
, '-vD'
, '--ignore-cache'
, '-s'
, pelicanconf
, meson.current_source_dir()/'content'
]
, install: true
, install_dir: htmldir
)

htmldoc = custom_target(
'htmldoc',
output: [
'archives.html',
'authors.html',
'categories.html',
'images',
'index.html',
'pages',
'pdfs',
'tags.html',
'theme',
],
depend_files: [rstcontent, css, plugins, pelicanconf],
depends: pdfs,
command: [
pelican,
'-vD',
'--ignore-cache',
'-s',
pelicanconf,
meson.current_source_dir()/'content'],
install: true,
install_dir: htmldir,
)
docs = run_target( 'docs'
, command: 'true'
, depends: [ htmldoc
, crlcore_docs
, analog_docs
, hurricane_docs
, viewer_docs
, oroshi_docs
, unicorn_docs
]
)

docs = run_target(
'docs',
command: 'true',
depends: [htmldoc, crlcore_docs, analog_docs, hurricane_docs, viewer_docs, oroshi_docs, unicorn_docs],
)
install_data( install_dir: pdfdir
, sources: files('content/pdfs/SAL.Bootcamp.pdf') )
4 changes: 4 additions & 0 deletions documentation/pelicanconf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ STATIC_PATHS = [ 'pages/users-guide',
'pages/check-toolkit',
'pages/design-flow',
'pages/rds',
'pages/presentations',
'pages/packaging',
'pages/technical-log',
'images',
Expand Down Expand Up @@ -116,6 +117,9 @@ IGNORE_FILES = [ 'UsersGuide.rst' # For User's Guide.
, 'RDSpage.rst'

, 'Installation.rst' # For Alliance.

, 'Presentations.rst' # For Presentations.
, 'PresentationsPage.rst'
]

# Uncomment following line if you want document-relative URLs when developing
Expand Down
8 changes: 8 additions & 0 deletions lefdef/doc/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

if get_option('docs')
docdir = join_paths(htmldir, 'doc', 'lefdef' )
install_subdir( 'lefdefref', install_dir: docdir )
install_subdir( 'lefapi' , install_dir: docdir )
install_subdir( 'defapi' , install_dir: docdir )
install_subdir( 'support' , install_dir: docdir )
endif
1 change: 1 addition & 0 deletions lefdef/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ lefdef_includes = include_directories('src/lef/lef', 'src/def/def')

subdir('src/lef')
subdir('src/def')
subdir('doc')

lef_generated = custom_target('lef.tab.cpp',
output: [ 'lef.tab.cpp', 'lef.tab.hpp' ],
Expand Down
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ qt = import('qt5', disabler: true)
sed = find_program('sed', disabler: true)
docdir = join_paths(get_option('datadir'), 'doc', 'coriolis')
htmldir = join_paths(docdir, 'html')
pdfdir = join_paths(htmldir, 'pdfs')
docsiteurl = get_option('docs-siteurl')

if not get_option('only-docs')
Expand Down

0 comments on commit e89898d

Please sign in to comment.