From e89898d77f55cdd10d29fcdb411fe5c966c9db5e Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sun, 26 Jan 2025 19:07:59 +0100 Subject: [PATCH] Fix the documentation generation. Add a "presentations" page. --- documentation/content/pages/documentation.rst | 3 + .../pages/presentations/Presentations.rst | 27 ++++ .../pages/presentations/PresentationsPage.rst | 17 +++ .../presentations/Presentations_HTML.rst | 25 ++++ documentation/etc/doPdf.sh | 118 +++++++++++++++--- documentation/meson.build | 113 +++++++++-------- documentation/pelicanconf.py.in | 4 + lefdef/doc/meson.build | 8 ++ lefdef/meson.build | 1 + meson.build | 1 + 10 files changed, 251 insertions(+), 66 deletions(-) create mode 100644 documentation/content/pages/presentations/Presentations.rst create mode 100644 documentation/content/pages/presentations/PresentationsPage.rst create mode 100644 documentation/content/pages/presentations/Presentations_HTML.rst create mode 100644 lefdef/doc/meson.build diff --git a/documentation/content/pages/documentation.rst b/documentation/content/pages/documentation.rst index a220d911c..04b43399f 100644 --- a/documentation/content/pages/documentation.rst +++ b/documentation/content/pages/documentation.rst @@ -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 diff --git a/documentation/content/pages/presentations/Presentations.rst b/documentation/content/pages/presentations/Presentations.rst new file mode 100644 index 000000000..6f9e7e348 --- /dev/null +++ b/documentation/content/pages/presentations/Presentations.rst @@ -0,0 +1,27 @@ +.. -*- mode: rst; explicit-buffer-name: "RDS.rst" -*- + +.. include:: ../../../etc/definitions.rst + + +:Date: 25, january 2025 +:Authors: Jean-Paul Chaput +:Contact: +:Version: 0.1 + + +|medskip| + + +============= +Presentations +============= + +|pagestylefancy| + + +.. contents:: + +|newpage| + + +.. include:: PresentationsPage.rst diff --git a/documentation/content/pages/presentations/PresentationsPage.rst b/documentation/content/pages/presentations/PresentationsPage.rst new file mode 100644 index 000000000..e2d97f138 --- /dev/null +++ b/documentation/content/pages/presentations/PresentationsPage.rst @@ -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>`_ + + diff --git a/documentation/content/pages/presentations/Presentations_HTML.rst b/documentation/content/pages/presentations/Presentations_HTML.rst new file mode 100644 index 000000000..14216db21 --- /dev/null +++ b/documentation/content/pages/presentations/Presentations_HTML.rst @@ -0,0 +1,25 @@ +.. -*- mode: rst; explicit-buffer-name: "Presentations_HTML.rst" -*- + + +============= +Presentations +============= + + +:slug: presentations +:date: 2025-01-25 16:00 +:Authors: Jean-Paul Chaput +:Contact: +:Version: 0.1 +:status: hidden + + +.. include:: ../../../etc/definitions.rst + + +.. contents:: + :depth: 2 + + +.. include:: PresentationsPage.rst + diff --git a/documentation/etc/doPdf.sh b/documentation/etc/doPdf.sh index c770bcbe0..fa49e668b 100755 --- a/documentation/etc/doPdf.sh +++ b/documentation/etc/doPdf.sh @@ -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=]" + echo " [--sourceDir=]" + echo " [--stylesheet=]" + echo " [--rst2latex=]" + echo " [--pdflatex=]" + echo " " + echo "" + echo " Mandatory argument:" + echo " : 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 diff --git a/documentation/meson.build b/documentation/meson.build index 77db77605..d661f8b80 100644 --- a/documentation/meson.build +++ b/documentation/meson.build @@ -1,4 +1,4 @@ -pdfcontent = files( +pdfcontent = [ 'content/pages/users-guide/UsersGuide.rst', 'content/pages/python-tutorial/PythonTutorial.rst', 'content/pages/python-cpp/PythonCpp.rst', @@ -6,7 +6,7 @@ pdfcontent = files( 'content/pages/stratus/Stratus.rst', 'content/pages/check-toolkit/CheckToolkit.rst', 'content/pages/rds/RDS.rst', -) +] rstcontent = files( @@ -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', @@ -91,57 +93,70 @@ plugins = files( dopdf = find_program('etc/doPdf.sh') -pdf_gen = generator( - dopdf, - output: '@BASENAME@.pdf', - 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') ) diff --git a/documentation/pelicanconf.py.in b/documentation/pelicanconf.py.in index ec43e1367..7dfe2da94 100644 --- a/documentation/pelicanconf.py.in +++ b/documentation/pelicanconf.py.in @@ -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', @@ -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 diff --git a/lefdef/doc/meson.build b/lefdef/doc/meson.build new file mode 100644 index 000000000..adb727dce --- /dev/null +++ b/lefdef/doc/meson.build @@ -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 diff --git a/lefdef/meson.build b/lefdef/meson.build index 8a2d4a6b0..5050c9ba8 100644 --- a/lefdef/meson.build +++ b/lefdef/meson.build @@ -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' ], diff --git a/meson.build b/meson.build index 46a2b58d5..5919d88ae 100644 --- a/meson.build +++ b/meson.build @@ -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')