Shortcodes

Joshua Yu November 24, 2024 Updated: February 07, 2025

Highlights

Not a shortcode but still useful. You have several colours to choose from:

See below for Markdown syntax used for the custom shortcodes used in this website.

Re: nesting shortcodes

The below code does not work:

{% warning(header = "warning header") %}

{{ warning_box_only(body="# nested warning!") }}

{% end %}

It will instead throw this error:

Error: Reason: Failed to render 'shortcodes/warning.html'
Error: Reason: Filter call 'markdown' failed
Error: Reason: Failed to render markdown filter: Failed to render warning_box_only shortcode

Caused by:
    0: Failed to render 'shortcodes/warning_box_only.html'
    1: Filter 'markdown' not found

Calling {{ warning_box_only(body="nested warning!") }} is essentially asking to inject html in place of the shortcode. However, if you look at warning_box_only.html:

<blockquote class="warning_box_only">
  <div class="content">
    {{ body | markdown | safe }}
  </div>
</blockquote>

it is expecting the body to be MARKDOWN, not HTML. If you remove the markdown filter from warning_box_only.html, then it will work -- but the markdown within the warning_box_only will not be rendered properly.

Custom boxes

important

{% important(header = "important header") %}
test
Press <kbd>CTRL+ALT+Delete</kbd> to end the

So it turns out you CAN put shortcodes inside other shortcodes, but it cannot be the % % with a body type.
{{ contributors(authors=["Alice Smith", "Bob Johnson"], editors=["Charlie Brown"], staff_reviewers=["David Lee"]) }}
{% end %}
important header

test Press CTRL+ALT+Delete to end the

So it turns out you CAN put shortcodes inside other shortcodes, but it cannot be the % % with a body type.

Authors:
<span class="contributor">Alice Smith</span>, 

<span class="contributor">Bob Johnson</span>
Editor:
<span class="contributor">Charlie Brown</span>
Staff Reviewer:
<span class="contributor">David Lee</span>

warning

{% warning(header = "warning header") %}
This is a warning section.

Here is an attempt at the % % nested shortcode.
{% important_box_only() %}
important bx only!!!
{% end %}
{% end %}
warning header

This is a warning section.

Here is an attempt at the % % nested shortcode.

important bx only!!!

question

{% question(question= "this is the question. now lets make it very long to the point where it probably needs to wrap around because its so large and fat and i hope this doesn't look bad.<br><br>1) this or that<br>2)this") %}

This is the question answer

{% end %}
QUESTION

this is the question. now lets make it very long to the point where it probably needs to wrap around because its so large and fat and i hope this doesn't look bad.

1) this or that
2)this

important_box_only

{% important_box_only() %}

important bx only!!!

{% end %}

important bx only!!!

warning_box_only

{% warning_box_only() %}

warning box only content

{% end %}

warning box only content

admonition

Credit to tabi for the styling. It's more pleasant colour scheme wise and it changes with the light/dark mode. Options for type/icon: note, tip, info, warning, danger, pearl, question (only the icon)

These can be mixed and matched.

{% admonition(type="danger", icon="danger", title="Warning DANGER") %}
This is a danger admonition with a danger icon.

**Markdown can be used here :)**
{% end %}
DANGER

This is a danger admonition with a danger icon.

Markdown can be used here :)

DANGER

There's also a FLAG icon you can add as well!

WARNING

Blah blah here is a wall of text wall of text Blah blah here is a wall of text wall of text Blah blah here is a wall of text wall of text Blah blah here is a wall of text wall of text

INFO

BLah blah

TIP

Blah blah

NOTE

blah blah

question icon

blah blah

We also have the elusive pearl mode:

{% admonition(type="pearl", icon="pearl", title="PEARL") %}

Insert sage clinical pearl

{% end %}
PEARL

Insert sage clinical pearl

text_image

Of note; you cannot nest a shortcode easily within a shortcode. Ie. I could not use {{ shortcode }} within the text image to right text.

{% text_image(src="/images/example.png", alt="An image description", caption = "test caption") %}

_Here is some text_ on the left.</br><kbd>CTRL+ALT+Delete</kbd>

{% end %}

Here is some text on the left.
CTRL+ALT+Delete

An image description

test caption

{% text_image(text_position = "right", src="/images/example.png", alt="An image description", caption = "test caption") %}

_Here is some text_ on the right.</br><kbd>CTRL+ALT+Delete</kbd>

{% end %}

Here is some text on the right.
CTRL+ALT+Delete

An image description

test caption

two_columns

{% two_columns() %}
Left column text goes here.

### Markdown should be supported

<!-- split -->

Right column text goes here.
{% end %}

Left column text goes here.

Right column text goes here.

two_columns_fancy

{% two_columns_fancy() %}
Left column text goes here.

<!-- split -->

Right column text goes here.
{% end %}

Left column text goes here.

Right column text goes here.

spoiler

this is a spoiler that you can click: {{ spoiler(body="text to hide", fixed_blur=false) }}

this is a spoiler that you can click:

You can also use it like so (fixed_blur = true means you can't see it ever):

{% spoiler(fixed_blur = true) %}

testing this

{% end %}
{% dropdown(header="this is what the user will click on to get more info") %}

This text will appear in the dropdown

And it will **LOOK GOOD** with markdown!
<a href="allergyguide.ca">link</a>

{% admonition(type="danger", icon="danger", title="DANGER") %}
This is a danger admonition with a danger icon.

**Markdown can be used here :)**

{% end %}

{% end %}

contributors

{{ contributors(authors=["Alice Smith", "Bob Johnson"], editors=["Charlie Brown"], staff_reviewers=["David Lee"]) }}
Authors: Alice Smith, Bob Johnson
Editor: Charlie Brown
Staff Reviewer: David Lee

timeline

Adapted from the excellent pico theme.

{% timeline() %}

[{
"title":"Lorem Ipsum Event",
"body":"Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
"date":"Jul-2023"
},
{
"title":"Lorem Ipsum event 2",
"body":"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.",
"date":"Jun-2022"
}]

{% end %}
  • Lorem Ipsum Event

    Lorem Ipsum is simply dummy text of the printing and typesetting industry.

  • Lorem Ipsum event 2

    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.

mermaid

{% mermaid() %}
sequenceDiagram
Alice ->> Bob: Hello Bob, how are you?
Bob-->>John: How about you John?
Bob--x Alice: I am good thanks!
Bob-x John: I am good thanks!
Note right of John: Bob thinks a long<br/>long time, so long<br/>that the text does<br/>not fit on a row.

    Bob-->Alice: Checking with John...
    Alice->John: Yes... John, how are you?

{% end %}
sequenceDiagram Alice ->> Bob: Hello Bob, how are you? Bob-->>John: How about you John? Bob--x Alice: I am good thanks! Bob-x John: I am good thanks! Note right of John: Bob thinks a long<br/>long time, so long<br/>that the text does<br/>not fit on a row. Bob-->Alice: Checking with John... Alice->John: Yes... John, how are you?

Other examples of mermaid charts (taken from their docs):

gantt dateFormat YYYY-MM-DD title Adding GANTT diagram functionality to mermaid excludes weekends %% (`excludes` accepts specific dates in YYYY-MM-DD format, days of the week ("sunday") or "weekends", but not the word "weekdays".) section A section Completed task :done, des1, 2014-01-06,2014-01-08 Active task :active, des2, 2014-01-09, 3d Future task : des3, after des2, 5d Future task2 : des4, after des3, 5d section Critical tasks Completed task in the critical line :crit, done, 2014-01-06,24h Implement parser and jison :crit, done, after des1, 2d Create tests for parser :crit, active, 3d Future task in critical line :crit, 5d Create tests for renderer :2d Add to mermaid :until isadded Functionality added :milestone, isadded, 2014-01-25, 0d section Documentation Describe gantt syntax :active, a1, after des1, 3d Add gantt diagram to demo page :after a1 , 20h Add another diagram to demo page :doc1, after a1 , 48h section Last section Describe gantt syntax :after doc1, 3d Add gantt diagram to demo page :20h Add another diagram to demo page :48h

widget_penfast

{{ widget_penfast() }}

PEN-FAST

F - Five years or less since reaction
A - Anaphylaxis or angioedema
S - Severe cutaneous adverse reaction
T - Treatment recieved for reaction (or unsure)

CALCULATED RISK:

wide_contact_card

{{ wide_contact_card(title="example title", text = "test text", src="/images/example.png", url="/research/") }}

custom_macro

{% custom_macro() %}

Here is a custom macro copy paste section

{% end %}
Here is a custom macro copy paste section

load_macro

{{ load_macro(topic_name = "chronic_rhinosinusitis") }}
onset duration Cardinal symptoms: [nasal congestion/fullness | facial pain/pressure/fullness | anterior or posterior nasal drainage (?purulent) | hypo/anosmia] Other symptoms: [change in voice | cough | headache | fatigue/disruption of sleep | halitosis/dental pain | ear pain/fullness] CT/ENT before? Known nasal polyps? ? asthma/COPD, AR, CF, NERD/ASA sensitivity, recurrent infect, EtOH induced worsening of upper airway disease, impaired cilia(CF, PCD), smoking, pollution, occupational exposure, nasal anatomic variations, vasculitis Treatment trials SNOT-22 Score # Chronic rhinosinusitis (CRS) wNP sNP AFRS Their clinical picture is suggestive of CRS, an inflammatory syndrome defined by objective structural evidence of sinus inflammation and ≥2 cardinal symptoms (nasal congestion, facial pain/pressure, anterior/posterior nasal drainage, absent/reduced smell) ≥12 weeks. While chronic, regular pharmacotherapy can usually control symptoms well. Recommendations: * CT sinuses (non-contrast) vs ENT referral * SPT for common aeroallergens * Ad-hoc testing: ie. B-cell immunodeficiency workup in setting of suspicious symptoms / acute recurrent sinusitis > High volume nasal saline rinses, avoidance of triggers > INCS + treatment of any underlying causes > Consider short course prednisone for symptom management (most evidence for CRSwNP or AFRS) > Consider oral antibiotics for acute exacerbations (controversial) > Consider biologics for CRSwNP if severe/failed first-line therapy Follow-up: ~3-4 months

medications_toml_load

param: meds (list of str) if not provided default will show all medications from the toml

{{ medications_toml_load(meds=["bilastine"]) }}
Rx

Bilastine

Brand Names: Blexten

Routes: 10 or 20mg tab, 2.5mg/ml liq (uncommon)

MoA: 2nd gen H1 receptor antagonist

Half-life: ~15 hours

Time to peak action: ~1h, rapid absorption

Doses:

  • CSU, AR:
    • 20mg PO OD to QID (ages ≥12)
    • 10mg PO OD to QID (ages 4-11)

Cost: ~$1.1 CAD / 20mg tab (ON)

Coverage: ON (ODB)

Age Group: ages ≥4

Pregnancy: Avoid (not enough data)

Contraindications: Hypersensitivity, QT prolongation or history of torsades

Common SEs: QT prolongation (at 100mg ODx4, max mean increase 6ms); drowsiness/headache ~4%[D], ~3%[P]; abdo pain 3%[D], 3%[P]

Severe SEs: Torsades (extremely rare; only 1 case reported in monograph post-market reactions)

Monograph Links:

Abbr.
CSU-chronic spontaneous urticaria; AR-allergic rhinitis

Primary: Joshua Yu

Editors: TBD

Staff: TBD

Pearls

  • Theoretically does not cross BBB; less sedating than other AHs

  • No renal adjustments needed; minimal data with hepatic impairment but not expected to cause issues

  • Going beyond OD is technically off-label

  • Take without food or juice otherwise absorption impaired

ExRx: Blexten 10mg OD to QID {% popup(icon="rx") %}

{{ medications_toml_load(meds=["bilastine"])}}

{% end %}

Accepts parameter icon which is similar to the admonition icons, but a couple of added options (default: 'rx'). These include:

capsule
capsule-pill
rx
note
tip
info
warning
danger
pearl
question
flag
popup

To be interactive/work, this shortcode requires one script tag to be placed at the bottom of the page:

<script src="/js/popup.js"></script>

ExRx: Blexten 10mg OD to QID

wip

{{ wip() }}

This page is a work in progress. If you want to help contribute, see below :)

Contribute
Z Z

remote_text

{{ remote_text(src="https://raw.githubusercontent.com/jay-joshy/allergyguide/refs/heads/main/TODO.md") }}
## Content

- guideline compilation section (not sure if there's a way to automate this unfortunately but will attempt)
- Allergic rhinitis seasonal calendar for allergens
- creation of video resources if time permits
- Billing tips (would have to be province specific -- VERY fellow/new staff focused)
- Running a practice tips potentially?

## Shortcodes

- Refactor references so that it accepts a .bibtex file instead
- port original pen-fast questions over with extra options; need to see if .PDF js packages are possible.

## Misc

- main staff TBD - to reach out
- other editors/contributors -- TBD but WIP
- team structure to be more well defined

references

Requires a .bib Bibtex file (easily generated with a citation software such as Zotero), example shown below:

@article{yu_trends_2024,
	title = {Trends of {Peanut}-{Induced} {Anaphylaxis} {Rates} {Before} and {After} the 2017 {Early} {Peanut} {Introduction} {Guidelines} in {Montreal}, {Canada}},
	volume = {12},
	issn = {2213-2201},
	doi = {10.1016/j.jaip.2024.06.004},
	abstract = {BACKGROUND: Food allergies, particularly peanut...},
	language = {eng},
	number = {9},
	journal = {J Allergy Clin Immunol Pract},
	author = {Yu, Joshua and Lanoue, Derek and Mir, Adhora and Kaouache, Mohammed and Bretholz, Adam and Clarke, Ann and McCusker, Christine and Protudjer, Jennifer L. P. and Jones, Aaron and Ben-Shoshan, Moshe},
	month = sep,
	year = {2024},
	pmid = {38876271},
	keywords = {Adolescent, Allergens, Anaphylaxis, Arachis, Canada, Child, Child, Preschool, COVID-19, Early allergen introduction, Emergency Service, Hospital, Female, Food allergy, Humans, Infant, Infant, Newborn, Male, Peanut Hypersensitivity, Practice Guidelines as Topic, Quebec, Registries},
	pages = {2439--2444.e4},
}

@article{stehlin_guiding_2025,
	title = {Guiding {Drug} {Provocation} {Testing} for {Ibuprofen} {Hypersensitivity} in a {Pediatric} {Population}: {Development} of the {I3A} {Risk}-{Stratification} {Tool}},
	volume = {13},
	issn = {2213-2198, 2213-2201},
	shorttitle = {Guiding {Drug} {Provocation} {Testing} for {Ibuprofen} {Hypersensitivity} in a {Pediatric} {Population}},
	url = {https://www.jaci-inpractice.org/article/S2213-2198(24)01238-8/fulltext},
	doi = {10.1016/j.jaip.2024.11.022},
	language = {English},
	number = {3},
	urldate = {2025-09-23},
	journal = {The Journal of Allergy and Clinical Immunology: In Practice},
	author = {Stehlin, Florian and Prosty, Connor and Mulé, Angela and Al-Otaibi, Ibtihal and Colli, Luca Delli and Gaffar, Judy and Yu, Joshua and Lanoue, Derek and Copaescu, Ana-Maria and Ben-Shoshan, Moshe},
	month = mar,
	year = {2025},
	pmid = {39637941},
	note = {Publisher: Elsevier},
	keywords = {(s)NIUAA, (Selective) NSAID-induced urticaria, ...},
	pages = {583--593.e3},
	file = {Full Text PDF:/Users/joshuayu/Zotero/storage/MTTZ56PS/Stehlin et al. - 2025 - Guiding Drug Provocation Testing for Ibuprofen Hypersensitivity in a Pediatric Population Developme.pdf:application/pdf},
}
This sentence needs two references <span class="references">yu_trends_2024, stehlin_guiding_2025</span> and some of this

... rest of the document content

{{/* references(showBib = true, path="content/example.bib) */}}

This sentence needs two references yu_trends_2024, stehlin_guiding_2025 and some of this

... rest of the document content

×
1. Yu J, Lanoue D, Mir A, et al.Trends of Peanut-Induced Anaphylaxis Rates Before and After the 2017 Early Peanut Introduction Guidelines in Montreal, Canada. J Allergy Clin Immunol Pract, vol. 12, 9, pp. 2439-2444.e4, September 2024
2. Stehlin F, Prosty C, Mulé A, et al. Guiding Drug Provocation Testing for Ibuprofen Hypersensitivity in a Pediatric Population: Development of the I3A Risk-Stratification Tool. The Journal of Allergy and Clinical Immunology: In Practice, vol. 13, 3, pp. 583-593.e3, March 2025

mobile_warning

This will display a warning admonition if viewed from Mobile.

{{ mobile_warning() }}

json_to_table

For simple flat tables

{% json_to_table() %}

[
{ "name": "Bob", "age": 21, "isCool": false },
{ "name": "Sarah", "age": 22, "isCool": true },
{ "name": "Lee", "age": 23, "isCool": true }
]

{% end %}

For more complex nested tables

{% json_to_table() %}

{
  "C1Inh-HAE": {
    "HAE Type I": {
      "C1Inh function": "< 50%",
      "C1Inh": "< 50%",
      "C4": "Low",
      "C1q": "Normal",
      "Anti-C1Inh Ab": "",
      "Mutation": "_SERPING1_"
    },
    "HAE Type II": {
      "C1Inh function": "< 50%",
      "C1Inh": "Normal",
      "C4": "Low",
      "C1q": "Normal",
      "Anti-C1Inh Ab": "",
      "Mutation": "_SERPING1_"
    }
  },
  "C1Inh-AAE": {
    "": {
      "C1Inh function": "< 50%",
      "C1Inh": "< 50%",
      "C4": "Low",
      "C1q": "Low (70% of cases)",
      "Anti-C1Inh Ab": "Present (50% of cases)",
      "Mutation": "No"
    }
  },
  "ACEi-AAE and nC1Inh-AAE": {
    "": {
      "C1Inh function": "Normal",
      "C1Inh": "Normal",
      "C4": "Normal",
      "C1q": "Normal",
      "Anti-C1Inh Ab": "",
      "Mutation": "_FXII, PLG, ANGPT1, KNG1_"
    }
  }
}

{% end %}

research_card

{{ research_card(paper="sygma2") }}
The quick facts - SYGMA2
Clinical Question Is PRN budesonide–formoterol noninferior to daily maintenance budesonide therapy in reducing severe asthma exacerbations for mild asthma?
Study Type 52 week double-blind, randomized, multi-center, phase 3, non-inferiority trial
Population 4176 patients with mild persistent asthma (≥12 years) were analyzed, including those with previously controlled and uncontrolled symptoms on minimal therapy.
Intervention Twice-daily placebo + PRN budesonide–formoterol (200μg/6μg).
Comparison Regular BID budesonide (200μg) + as-needed terbutaline (0.5mg).
Outcomes At 52 weeks, the PRN budesonide–formoterol group had an annualized rate of severe exacerbations of 0.11 events/patient-year compared to 0.12 events/patient-year in the budesonide group (RR 0.97; upper one-sided 95% CI, 1.16). ACQ-5 score improved by 0.35 in the as-needed group versus 0.46 in the maintenance group (Δ0.11 units; 95% CI, 0.07 to 0.15; p<0.001). Median daily inhaled glucocorticoid exposure in the as-needed group was 66μg vs 267μg in the maintenance group.
Bottom Line For mild asthma, PRN budesonide–formoterol was noninferior to daily budesonide in preventing severe exacerbations, with a relatively smaller improvement in ACQ-5 and much less overall steroid exposure.
D1 D2 D3 D4 D5 Overall RoB
Severe ex. rate
+
+
+
+
+
+
{{ research_card(paper="sygma2", show_title=false) }}
Clinical Question Is PRN budesonide–formoterol noninferior to daily maintenance budesonide therapy in reducing severe asthma exacerbations for mild asthma?
Study Type 52 week double-blind, randomized, multi-center, phase 3, non-inferiority trial
Population 4176 patients with mild persistent asthma (≥12 years) were analyzed, including those with previously controlled and uncontrolled symptoms on minimal therapy.
Intervention Twice-daily placebo + PRN budesonide–formoterol (200μg/6μg).
Comparison Regular BID budesonide (200μg) + as-needed terbutaline (0.5mg).
Outcomes At 52 weeks, the PRN budesonide–formoterol group had an annualized rate of severe exacerbations of 0.11 events/patient-year compared to 0.12 events/patient-year in the budesonide group (RR 0.97; upper one-sided 95% CI, 1.16). ACQ-5 score improved by 0.35 in the as-needed group versus 0.46 in the maintenance group (Δ0.11 units; 95% CI, 0.07 to 0.15; p<0.001). Median daily inhaled glucocorticoid exposure in the as-needed group was 66μg vs 267μg in the maintenance group.
Bottom Line For mild asthma, PRN budesonide–formoterol was noninferior to daily budesonide in preventing severe exacerbations, with a relatively smaller improvement in ACQ-5 and much less overall steroid exposure.
D1 D2 D3 D4 D5 Overall RoB
Severe ex. rate
+
+
+
+
+
+

tabs

{% tabs() %}

<!-- TAB -->Overview
<!-- CONTENT -->
<p>This is an <strong>overview</strong> of the feature.</p>

<!-- TAB -->Details
<!-- CONTENT -->
<ul>
  <li>Fast</li>
  <li>Secure</li>
  <li>Reliable</li>
</ul>
{% admonition(type="danger", icon="danger", title="DANGER") %}
This is a danger admonition with a danger icon.

**Markdown can be used here :)**
{% end %}

<!-- TAB -->Pricing
<!-- CONTENT -->
<p>Starting at <em>$9.99/month</em>.</p>

{% end %}

Requires a script to be placed in the bottom of the page:

<script src="/js/tabs.js"></script>

This is an overview of the feature.

  • Fast
  • Secure
  • Reliable
DANGER

This is a danger admonition with a danger icon.

Markdown can be used here :)

Starting at $9.99/month.

test_net_functions

This is testing the ability for Netlify to securely hydrate a div with content based on credentials.

Enter API Key

protected

This allows for secure username/password protected content. The actual content is hidden in a private repository and is securely fetched dynamically to populate the content when the user signs in. Once the user signs in, until ~24h that password will be remembered on their machine. No log-out has been implemented yet but I see little utility at this time for that feature.

To use, the shortcode requires the relative path to the HTML file needed to hydrate the page.

{{ protected(path="content/private/test.html") }}
Loading protected content...