<commit_before>---
layout: article
title:  "Details html tag template"
author: <NAME>
comments: true
---

Here's a template for inserting an html \<details\> tag into markdown. It allows markdown syntax inside the summary and the body of a \<details\> tag. This works with Jekyll's Kramdown dialect of markdown, served by GitHub Pages.

{% capture summary %}SUMMARY{% endcapture %}  
{% capture details %}  
DETAILS  
{% endcapture %}{% include details.html %} 

## Markdown template

Copy and paste these four lines into your markdown document. 

```
{% raw %}
{% capture summary %}SUMMARY{% endcapture %}  
{% capture details %}  
DETAILS  
{% endcapture %}{% include details.html %} 
{% endraw %}
```

Replace SUMMARY and DETAILS with your content.

## .html include file

The last line of the template references a file: \_includes/details.html. Create a file with this code and put it in your \_includes folder.

```
{% raw %}
<details>
    <summary>{{ summary | markdownify | remove: '<p>' | remove: '</p>' }}</summary>
    {{ details | markdownify }}
</details>
{% endraw %}
```

## Example<commit_msg>Trivial change to trigger a rebuild at github.<commit_after>---
layout: article
title:  "Details html tag template"
author: <NAME>
comments: true
---

Here's a template for inserting an html \<details\> tag into markdown. It allows markdown syntax inside the summary and the body of a \<details\> tag. This works with Jekyll's Kramdown dialect of markdown, served by GitHub Pages.

{% capture summary %}SUMMARY{% endcapture %}  
{% capture details %}  
DETAILS  
{% endcapture %}{% include details.html %} 

## Markdown template

Copy and paste these four lines into your markdown document.  

```
{% raw %}
{% capture summary %}SUMMARY{% endcapture %}  
{% capture details %}  
DETAILS  
{% endcapture %}{% include details.html %} 
{% endraw %}
```

Replace SUMMARY and DETAILS with your content.

## .html include file

The last line of the template references a file: \_includes/details.html. Create a file with this code and put it in your \_includes folder.

```
{% raw %}
<details>
    <summary>{{ summary | markdownify | remove: '<p>' | remove: '</p>' }}</summary>
    {{ details | markdownify }}
</details>
{% endraw %}
```

## Example
{'fraction_non_alphanumeric': 0.1336589698046181, 'fraction_numerical': 0.0, 'mean_word_length': 3.855603448275862, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4291664', 'n_tokens_mistral': 737, 'n_tokens_neox': 631, 'n_words': 268}