Skip to content

Commit 5930996

Browse files
authored
Merge pull request #76 from SCIInstitute/pandoc_examples
citation examples
2 parents d0f9a48 + 9e55950 commit 5930996

File tree

7 files changed

+182
-9
lines changed

7 files changed

+182
-9
lines changed

docs/conf.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,18 @@
1414
import sys
1515
sys.path.insert(0, os.path.abspath('../'))
1616

17+
import recommonmark
18+
from recommonmark.transform import AutoStructify
19+
1720

1821
# -- Project information -----------------------------------------------------
1922

2023
project = 'UncertainSCI'
2124
copyright = '2020, The Scientific Computing and Imaging Institute at the University of Utah'
2225
author = 'Jake Bergquist, Dana Brooks, Zexin Liu, Rob MacLeod, Akil Narayan, Sumientra Rampersad, Lindsay Rupp, Jess Tate, Dan White'
2326

27+
github_doc_root = 'https://github.com/SCIInstitute/UncertainSCI/tree/master/docs'
28+
2429
# The full version, including alpha/beta/rc tags
2530
release = '0.01'
2631

@@ -41,6 +46,7 @@
4146
# Path for bibtex files
4247
bibtex_bibfiles = ['references.bib']
4348

49+
4450
# Add any paths that contain templates here, relative to this directory.
4551
templates_path = ['_templates']
4652

@@ -98,3 +104,17 @@
98104
html_theme_options = {
99105
'logo_only': True
100106
}
107+
108+
109+
def setup(app):
110+
app.add_config_value('recommonmark_config', {
111+
#'url_resolver': lambda url: github_doc_root + url,
112+
'auto_toc_tree_section': 'Contents',
113+
'enable_math': False,
114+
'enable_inline_math': False,
115+
'enable_eval_rst': True,
116+
}, True)
117+
app.add_transform(AutoStructify)
118+
119+
120+

docs/dev_docs/HowToTutorial.md

Lines changed: 77 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,50 @@ inline equations use the `\\(\mathbf{p}\\)` sytanx: \\(\mathbf{p}\\)
192192

193193
### Citations
194194

195-
Sphinx has a built in citation manager for bibtex: [sphinxcontrib-bibtex](https://sphinxcontrib-bibtex.readthedocs.io/en/latest/). Works well for RST, but we are still working on it for markdown. Another option may be [Myst](https://myst-parser.readthedocs.io/en/latest/)
195+
Since we are using Sphinx to build the documentation, we can use its citation manager, sphinxcontrib-bibtex. We will provide some exmples here, but for more information, refer to the [sphinxcontrib-bibtex documentation](https://sphinxcontrib-bibtex.readthedocs.io/en/latest/index.html).
196196

197-
TODO.
197+
Citations to include in the UncertainSCI docs can be included in the `UncertainSCI/docs/references.bib` file. For the keys, please use the convention: Initials of the contributor, colon, first three letters of the author (with apropriate capitalization), and the year. For example `JDT:Bur2020`. For multiple citations from the same author in the same year, lowercase letters can be appended to the key: `JDT:Bur2020a`.
198198

199+
After the reference has been added to `UncertainSCI/docs/references.bib`, the final step is to include the command in the appropriate place.
200+
201+
The sphinxcontrib-bibtex is built to run with rst in Sphinx. However, it can be used in markdown using the [AutoStructify](https://recommonmark.readthedocs.io/en/latest/auto_structify.html) package. This will require using using an `eval_rst` block as follows:
202+
203+
````
204+
```eval_rst
205+
The whole paragraph will need to be in the eval_rst block :cite:p:`JDT:Bur2020`. For multiple references: :cite:p:`JDT:Bur2020,gupta1983`
206+
```
207+
````
208+
209+
```eval_rst
210+
The whole paragraph will need to be in the eval_rst block :cite:p:`JDT:Bur2020`. For multiple references: :cite:p:`JDT:Bur2020,gupta1983`
211+
```
212+
213+
add a bibliography section
214+
````
215+
```eval_rst
216+
.. bibliography::
217+
```
218+
````
219+
220+
#### Bibliography
221+
```eval_rst
222+
.. bibliography::
223+
```
199224

200225
### Snippets
201226

227+
Basic markdown ``some snippet``
228+
229+
```
230+
def function():
231+
return True
232+
```
233+
234+
```python
235+
def function():
236+
return True
237+
```
238+
202239
### Links
203240
Including links in Markdown is simple, just use `<>` or `[]()`. For example, an internal link for section [Adding Content](#adding-content) is :
204241
```
@@ -233,22 +270,56 @@ Tables can be used with normal markdown syntax with the [sphinx-markdown-tables]
233270
| Paragraph | Text |
234271

235272

273+
```eval_rst
274+
+------------+------------+-----------+
275+
| Header 1 | Header 2 | Header 3 |
276+
+============+============+===========+
277+
| body row 1 | column 2 | column 3 |
278+
+------------+------------+-----------+
279+
| body row 2 | Cells may span columns.|
280+
+------------+------------+-----------+
281+
```
236282

237-
### Referencing Sphynx
238283

239-
TODO
284+
### Referencing Sphinx
240285

241-
To link the UncertainSCI API generated using Sphynx, Use this syntax: [`[text](../api_docs/pce.html#polynomial-chaos-expansions)`](../api_docs/pce.html#polynomial-chaos-expansions).
286+
287+
To link the UncertainSCI API generated using Sphinx, Use this syntax: [`[text](../api_docs/pce.html#polynomial-chaos-expansions)`](../api_docs/pce.html#polynomial-chaos-expansions).
242288

243289
## Content Guide
244290

245291
TODO
246292

247293
## Supplemental Materials
248294

249-
TODO
295+
Some things to consider including with the tutorial.
250296

251297
### Example Scripts
298+
299+
Example scripts should be located in the `UncertainSCI/demos/` directory. Consider using one of the existing demos as a template and try to follow the coding standards outlined in the [contribution guide](contribute.html).
300+
252301
### Movies
302+
303+
Movies should be stored in a serperate place. We host most of ours on youtube or vimeo.
304+
305+
#### Youtube
306+
307+
Get the imbed link from the youtube video. This can be found by pressing the share button.
308+
309+
#### Vimeo
310+
311+
Get the imbed link from the vimeo video. This can be found by pressing the share button. There are more options if for some users who own the video. More info [here.](https://vimeo.zendesk.com/hc/en-us/articles/224969968-Embedding-videos-overview)
312+
313+
With the embed link, just include the html into the markdown file.
314+
315+
```
316+
<iframe title="vimeo-player" src="https://player.vimeo.com/video/279319572" width="640" height="360" frameborder="0" allowfullscreen></iframe>
317+
```
318+
319+
<iframe title="vimeo-player" src="https://player.vimeo.com/video/279319572" width="640" height="360" frameborder="0" allowfullscreen></iframe>
320+
321+
253322
### Datasets
254323

324+
Datasets should be located serperately, unless the size is small. Please [ask](https://github.com/SCIInstitute/UncertainSCI/discussions) if you have any questions.
325+

docs/dev_docs/contribute.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Contribution Guide
2+
3+
Thank you for you cobributions to UncertainSCI!
4+
5+
If you'd like to make a tutorial, please follow the instructions in the [Tutorial Tutorial](HowToTutorial.html).
6+
7+
We will be filling in more directions about how to to contribute. Try to do the best that you can.
8+
9+

docs/index.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ About UncertainSCI
1616
UncertainSCI is a Python-based toolkit that harnesses modern techniques to estimate model and parametric uncertainty, with a particular emphasis on needs for biomedical simulations and applications. This toolkit enables non-intrusive integration of these techniques with well-established biomedical simulation software.
1717

1818

19+
Currently implemented in UncertainSCI is Polynomial Chaos Expansion (PCE) with a number of input distributions. For more information about these techniques, see: :cite:p:`JDT:Bur2020,narayan_computation_2018,guo_weighted_2018,cohen_optimal_2017`
20+
21+
1922
.. toctree::
2023
:maxdepth: 2
2124
:caption: Contents:
@@ -36,6 +39,12 @@ Acknowledgements
3639

3740
This project was supported by grants from the National Institute of Biomedical Imaging and Bioengineering (U24EB029012) from the National Institutes of Health.
3841

42+
43+
Bibliography
44+
================
45+
.. bibliography::
46+
47+
3948
Indices and Tables
4049
==================
4150

docs/references.bib

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,58 @@ @techreport{gupta1983
66
author = {Gupta, S.K. and Harper, W.V.},
77
year = {1983},
88
}
9+
10+
@article{JDT:Bur2020,
11+
author = {Burk, Kyle M. and Narayan, Akil and Orr, Joseph A.},
12+
title = {Efficient sampling for polynomial chaos-based uncertainty quantification and sensitivity analysis using weighted approximate Fekete points},
13+
journal = {International Journal for Numerical Methods in Biomedical Engineering},
14+
volume = {36},
15+
number = {11},
16+
pages = {e3395},
17+
keywords = {approximate Fekete points, cardiovascular modeling, oxyhemoglobin dissociation, polynomial chaos expansion, sensitivity analysis, uncertainty quantification},
18+
doi = {https://doi.org/10.1002/cnm.3395},
19+
url = {https://onlinelibrary.wiley.com/doi/abs/10.1002/cnm.3395},
20+
year = {2020}
21+
}
22+
23+
@article{narayan_computation_2018,
24+
title = {Computation of induced orthogonal polynomial distributions},
25+
volume = {50},
26+
url = {https://epub.oeaw.ac.at?arp=0x003a184e},
27+
doi = {10.1553/etna_vol50s71},
28+
journal = {Electronic Transactions on Numerical Analysis},
29+
author = {Narayan, Akil},
30+
year = {2018},
31+
note = {arXiv:1704.08465 [math]},
32+
pages = {71--97},
33+
}
34+
35+
36+
@article{guo_weighted_2018,
37+
title = {Weighted {Approximate} {Fekete} {Points}: {Sampling} for {Least}-{Squares} {Polynomial} {Approximation}},
38+
volume = {40},
39+
issn = {1064-8275},
40+
shorttitle = {Weighted {Approximate} {Fekete} {Points}},
41+
url = {http://epubs.siam.org/doi/abs/10.1137/17M1140960},
42+
doi = {10.1137/17M1140960},
43+
number = {1},
44+
journal = {SIAM Journal on Scientific Computing},
45+
author = {Guo, L. and Narayan, A. and Yan, L. and Zhou, T.},
46+
year = {2018},
47+
note = {arXiv:1708.01296 [math.NA]},
48+
pages = {A366--A387},
49+
}
50+
51+
52+
@article{cohen_optimal_2017,
53+
title = {Optimal weighted least-squares methods},
54+
volume = {3},
55+
issn = {2426-8399},
56+
doi = {10.5802/smai-jcm.24},
57+
journal = {SMAI Journal of Computational Mathematics},
58+
author = {Cohen, Albert and Migliorati, Giovanni},
59+
year = {2017},
60+
note = {arxiv:1608.00512 [math.NA]},
61+
pages = {181--203},
62+
}
63+

docs/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ sphinx-notfound-page
88
sphinx_rtd_theme
99
sphinxcontrib-bibtex
1010
sphinx-markdown-tables
11-

docs/tutorials/template.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,19 @@ inline equations use the `\\(\mathbf{p}\\)` sytanx: \\(\mathbf{p}\\)
5555

5656
### Citations
5757

58-
Sphinx has a built in citation manager for bibtex: [sphinxcontrib-bibtex](https://sphinxcontrib-bibtex.readthedocs.io/en/latest/). Works well for RST, but we are still working on it for markdown. Another option may be [Myst](https://myst-parser.readthedocs.io/en/latest/)
58+
Sphinx has a built in citation manager for bibtex: [sphinxcontrib-bibtex](https://sphinxcontrib-bibtex.readthedocs.io/en/latest/). Works well for RST, but we are still working on it for markdown. The sphinxcontrib-bibtex is built to run with rst in Sphinx. However, it can be used in markdown using the [AutoStructify](https://recommonmark.readthedocs.io/en/latest/auto_structify.html) package.
5959

60-
TODO.
60+
```eval_rst
61+
The whole paragraph will need to be in the eval_rst block :cite:p:`JDT:Bur2020`. For multiple references: :cite:p:`JDT:Bur2020,gupta1983`
62+
```
63+
64+
65+
add a bibliography section
66+
````
67+
```eval_rst
68+
.. bibliography::
69+
```
70+
````
6171

6272
### Snippets
6373
Inline snippets `like this`. Muliple lines:

0 commit comments

Comments
 (0)