Skip to content

Instantly share code, notes, and snippets.

@ballaneypranav
Last active August 28, 2020 17:39
Show Gist options
  • Save ballaneypranav/3c5594cd6b025af060e9c85f77958ec8 to your computer and use it in GitHub Desktop.
Save ballaneypranav/3c5594cd6b025af060e9c85f77958ec8 to your computer and use it in GitHub Desktop.
Files in the iGEM Wiki Starter Pack explained. More documentation at https://igem-wiki-starter.readthedocs.io.
// src/templates/contents.pug
// This is the template that all files in src/pages use.
// includes some common utility functions from templates/mixins.pug
// read more about Pug mixins at https://pugjs.org/language/mixins.html
include mixins
html(lang="en")
// includes variables: title, tagline and requireMathJax
// from the file that uses this template
block headVars
head
meta(charset="UTF-8")
meta(name="viewport" content="width=device-width, initial-scale=1.0")
// this is where the title variable is plugged in
title #{title} | iGEM [[ iGEM_team_name ]]
// MathJax is included only if requireMathJax is true
if requireMathJax
script(src="https://2020.igem.org/common/MathJax-2.5-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML")
body
// include code for navigation menu from templates/nav.pug
include nav.pug
header.d-flex.justify-content-center.align-items-center
.container
h1= title
p.lead.pl-1= tagline
hr.my-4
main
.container
.row
.sidebar.col-lg-3
.nav#contents
h5 Contents
ul
//- Filled automatically from js in js/content.js
.content.col-lg-9
article
// include the actual text of the article
block article
// include citations if any
// citations are added in src/citations/<filename>.yml
// and they're automatically included in the corresponding
// Pug file in the pages directory
// More information about this is available in the Starter Pack docs.
block citations
if citations
article#references
h1 References
ol
- counter = 1
each citation in citations
if citation.type == 'article'
+citation_article(citation, counter)
if citation.type == 'webpage'
+citation_webpage(citation, counter)
if citation.type == 'book'
+citation_book(citation, counter)
- counter = counter + 1
// include code for footer from templates/footer.pug
include footer.pug
// src/pages/Sample.pug
// This is a sample page that shows how elements can be added to
// pages in the Starter Pack, and also how they look once rendered.
// extend the contents template
extends ../templates/contents.pug
// some variables that are used for metadata
// you can add your own here, and use them appropriately in contents.pug
// More information about Pug templates is available at https://pugjs.org/language/inheritance.html.
// Adding a background image is a common use case. For an example of that,
// check out our wiki at https://github.com/igembitsgoa/wiki
block headVars
- var title = "Sample"
- var tagline = "A sample page for the theme."
// this variable specifies whether MathJax is required on the page
// if false, the MathJax script is not loaded, reducing the overall loading time
- var requireMathJax = true
// this section includes the actual content of the page
block article
// the content is processed by a markdown filter
// which converts Markdown to Pug
// (html) specifies that HTML code can be written in here,
// and will be processed as regular HTML
:markdown-it(html)
# Headings
## Level 2 Heading
### Level 3 Heading
#### Level 4 Heading
# Emphasis
This is regular text.
**This is bold text.**
__This is also bold text.__
*This is italic text.*
_This is also italix text.*
***This text is bold and italic both.***
___This text is bold and italic both.___
~~Strikethrough~~
# Lists
1. This is item one.
1. This is item two.
1. It's okay to number every item as 1.
* This is a nested list.
* Use asterisk for an unordered list,
* Further nesting?
+ Plus sign also works.
- And so does minus.
1. ~~Birds aren't real.~~
# Links
[Google](https://google.com)
[Text goes in square brackets](Link-goes-in-parenthesis)
# Blockquote
> This is a blockquote.
> This continues in the same paragraph.
>
> To change the paragraph, you have to leave a line.
> This is another blockquote.
>
> **Pranav Ballaney, 2020**
# Images
This is a regular paragraph.
#### This is a level 4 heading.
[This is a link](google.com)
// Adding images requires you to step out of the Markdown filter
// and use the provided image mixin.
// Arguments:
// figure number
// filename with file stored in the assets/img folder
// a caption and alt text for the image
// width as a percentage of the page width (optional, default: 80)
+image(1, "Description--josh-withers.jpg", "Caption", 100)
:markdown-it(html)
Back to regular text.
# Tables
This is a regular paragraph, which precedes the table.
When you want to insert a table, indent one level back and specify the plugin.
Then indent inside again and start writing the table.
// For adding tables, you need to use this plugin
:markdown-it(html plugins=['markdown-it-multimd-table'])
| This is | the table | header row |
| ------ | --------- | ---------- |
| 1 | 2 | 3 |
| 4 | 5 | 6 |
[Table 1: Caption goes here.]
:markdown-it(html)
And when you're done, go back to the regular markdown filter.
:markdown-it(html)
**Example 2:**
:markdown-it(html plugins=['markdown-it-multimd-table'])
| Left aligned | Center aligned | Right aligned |
| :----------- | :------------: | ------------: |
| 1 | 2 | 3 |
| 4 | 5 | 6 |
:markdown-it(html)
**Example 3:**
:markdown-it(html plugins=['markdown-it-multimd-table'])
| | Grouping ||
|First Header | Second Header | Third Header |
| ------------ | :-----------: | -----------: |
|Content | *Long Cell* ||
|Content | **Cell** | Cell |
|New section | More |[Data](https://google.com) |
|And more | With an escaped '\|' ||
[Table 3: Caption goes here.]
:markdown-it(html)
# Definitions
<dfn>Term ~ Definition</dfn>
This can come <dfn>anywhere in ~ the text</dfn>.
# MathJax
$$\int_{0}^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2}$$
$$-\frac{\hbar^2}{2m}\nabla^2\psi + V\psi = E\psi$$
$$i\hbar\gamma^\mu\partial_\mu\psi = mc\psi$$
$$y_k = \frac{1}{\sqrt{N}}\sum_{n=0}^{N-1}x_n\omega_N^{kn}$$
// in-text citations are added just like links
// but require the link to be prefixed with "#citation"
// and contain the number corresponding to the actual
// citation at the bottom
:markdown-it(html)
# Citations
In text citation for a research article with a DOI. [Rosano et al., 2019](#citation2)
In text citation for another research article with a DOI. [Allen & Sheridan, 2015](#citation1)
In text citation for a book with no DOI. [Ingalls, 2013](#citation3)
In text citation for a website with institutional author. [TNAU Agritech Portal, n.d.](#citation4)
In text citation for a website with an author. [Author, n.d.](#citation5)
// beyond this, citations are included from src/citations/Sample.yml
//- DO NOT MODIFY THIS LINE AND ANYTHING BEYOND.
prepend citations
- var citations = [{"authors": "Allen, M. J., & Sheridan, S. C. (2015). ", "doi": "https://doi.org/10.1007/s00484-015-1117-4", "journal": "International Journal of Biometeorology", "numbers": "62(1), 57-67. ", "title": "Mortality risks during extreme temperature events (ETEs) using a distributed lag non-linear model.", "type": "article"}, {"authors": "Rosano, A., Bella, A., Gesualdo, F., Acampora, A., Pezzotti, P., Marchetti, S., ... & Rizzo, C. (2019). ", "doi": "https://doi.org/10.1016/j.ijid.2019.08.003", "journal": "International Journal of Infectious Diseases", "numbers": "88, 127-134. ", "title": "Investigating the impact of influenza on excess mortality in all ages in Italy during recent seasons (2013/14-2016/17 seasons).", "type": "article"}, {"authors": "Allen, M. J., & Sheridan, S. C. (2015).", "journal": "International Journal of Biometeorology.", "numbers": "62(1), 57-67.", "title": "Mortality risks during extreme temperature events (ETEs) using a distributed lag non-linear model.", "type": "article", "year_published": 2015}, {"details": "(n.d.). Retrieved on June 22, 2020. from ", "title": "Agriculture: Crop production: Sugarcane. TNAU Agritech Portal.", "type": "webpage", "url": "https://google.com"}, {"details": "(March 15, 2019). Retrieved on June 22, 2020. from ", "title": "Agriculture: Crop production: Sugarcane. TNAU Agritech Portal.", "type": "webpage", "url": "https://google.com"}, {"Google_Books_URL": "https://books.google.co.in/books?id=OYr6AQAAQBAJ", "authors": "Ingalls, B. P.", "publisher": "MIT Press.", "title": "Mathematical modeling in systems biology: An introduction.", "type": "book", "year_published": "(2013)."}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment