mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
Add clib example to sphinx-gallery
This commit is contained in:
parent
732e7e89fa
commit
6eb4f08907
@ -146,6 +146,13 @@ if localenv['sphinx_docs']:
|
||||
localenv.Command(f"#build/doc/samples/fortran/{fort_file.name}",
|
||||
fort_file, Copy("$TARGET", "$SOURCE")))
|
||||
|
||||
# Gather clib sample files
|
||||
clib_files = Glob("#samples/clib/*.c") + [File("#samples/clib/README.rst")]
|
||||
for clib_file in clib_files:
|
||||
env.Depends(sphinxdocs,
|
||||
localenv.Command(f"#build/doc/samples/clib/{clib_file.name}",
|
||||
clib_file, Copy("$TARGET", "$SOURCE")))
|
||||
|
||||
# Create a list of MATLAB classes to document. This uses the NamedTuple
|
||||
# structure defined at the top of the file. The @Data and @Utilities
|
||||
# classes are fake classes for the purposes of documentation only. Each
|
||||
|
@ -49,17 +49,19 @@ extensions = [
|
||||
|
||||
sphinx_gallery_conf = {
|
||||
'filename_pattern': '\.py',
|
||||
'example_extensions': {'.py', '.cpp', '.h', '.f', '.f90'},
|
||||
'example_extensions': {'.py', '.cpp', '.h', '.c', '.f', '.f90'},
|
||||
"filetype_parsers": {'.h': 'C++'},
|
||||
'image_srcset': ["2x"],
|
||||
'examples_dirs': [
|
||||
'../samples/python/',
|
||||
'../samples/cxx/',
|
||||
'../samples/clib/',
|
||||
'../samples/fortran/',
|
||||
],
|
||||
'gallery_dirs': [
|
||||
'examples/python',
|
||||
'examples/cxx',
|
||||
'examples/clib',
|
||||
'examples/fortran',
|
||||
],
|
||||
'reference_url': {
|
||||
@ -122,6 +124,7 @@ tags_page_header = "Examples with this tag:"
|
||||
tags_badge_colors = {
|
||||
"Python": "secondary",
|
||||
"C++": "secondary",
|
||||
"C": "secondary",
|
||||
"Fortran 77": "secondary",
|
||||
"Fortran 90": "secondary",
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ format.
|
||||
|
||||
examples/python/index
|
||||
examples/cxx/index
|
||||
examples/clib/index
|
||||
examples/fortran/index
|
||||
|
||||
_tags/tagsindex
|
||||
|
6
samples/clib/README.rst
Normal file
6
samples/clib/README.rst
Normal file
@ -0,0 +1,6 @@
|
||||
C Examples
|
||||
==========
|
||||
|
||||
These examples demonstrate the usage of Cantera's C interface library, ``clib``,
|
||||
which can also be used to call Cantera from other languages that are able to
|
||||
call C functions.
|
@ -1,11 +1,13 @@
|
||||
/**
|
||||
/*
|
||||
* CLib Demo
|
||||
* =========
|
||||
*
|
||||
* This program illustrates using Cantera's C-library interface to compute
|
||||
* thermodynamic, kinetic, and transport properties of a gas mixture. In addition,
|
||||
* a simple reactor network simulation is illustrated.
|
||||
*
|
||||
* Keywords: tutorial, equilibrium, thermodynamics, kinetics, transport, reactor network
|
||||
* .. tags:: C, tutorial, equilibrium, thermodynamics, kinetics, transport,
|
||||
* reactor network
|
||||
*/
|
||||
|
||||
// This file is part of Cantera. See License.txt in the top-level directory or
|
||||
@ -16,6 +18,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
// sphinx_gallery_start_ignore
|
||||
// The following header files are not used by this example, but are nevertheless added
|
||||
// here to ensure C-compatibility of Cantera's clib includes in continuous testing.
|
||||
#include "cantera/clib/ctfunc.h"
|
||||
@ -23,6 +26,7 @@
|
||||
#include "cantera/clib/ctonedim.h"
|
||||
#include "cantera/clib/ctrpath.h"
|
||||
#include "cantera/clib/ctsurf.h"
|
||||
// sphinx_gallery_end_ignore
|
||||
|
||||
void exit_with_error()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user