Details and summary
tags: special-block details summary disclosure
Description/Summary
Details disclosure elements<details>
and <summary>
.
Content
These can be conveniently created using the Org Special Block
#+begin_details
.. #+end_details
.
The summaries in these “details” Org Special blocks should be wrapped
in a “summary” Org Special block #+begin_summary
.. #+end_summary
.
Closed details disclosure (default) #
Summary + Details #
Here is the summary.
Summary can also contain markup (like bold, italics, etc.).
Here are some details.
- list element 1
- list element 2
Here’s a paragraph.
And another paragraph.
(message "a code block")
No summary, only details #
In the situation where the summary divider is absent i.e. when user hasn’t provided a summary, the browser will use a default summary string (usually “Details”).
Here are some details.
- list element 1
- list element 2
Here’s a paragraph.
And another paragraph.
(message "a code block")
Only summary, no details #
In this case where only the “summary” exists, the browser will still render the collapsing triangle. But nothing will show up when you uncollapse it.. as there are no details.
Here is the summary.
Summary can also contain markup (like bold, italics, etc.).
Details containing only code block #
This is Summary.
(message "This is in details")
Open by default disclosure widget #
The details disclosures are closed by default, add #+attr_html: :open t
right below the details special block to have the disclosures open
by default.
Summary + Details (Open) #
Here is the summary.
Summary can also contain markup (like bold, italics, etc.).
Here are some details.
- list element 1
- list element 2
Here’s a paragraph.
And another paragraph.
(message "a code block")
No summary, only details (Open) #
Here are some details.
- list element 1
- list element 2
Here’s a paragraph.
And another paragraph.
(message "a code block")
Only summary, no details (Open) #
Here is the summary.
Summary can also contain markup (like bold, italics, etc.).
Other attributes along with open
attribute set to t
#
Test that other attributes, if present along with :open t
, are also retained.
This is Summary.
Here are the details.
Value of open
attribute other than t
#
If the open
attribute is set to any other value than t
, it won’t
be inserted in the details
element.
This is Summary.
Here are the details.
Page (Debug)
Page Variable | Value | |
---|---|---|
Name | "Details and summary" | |
Title | "Details and summary" | |
ResourceType | "page" | |
Kind | "page" | |
Section | "posts" | |
Draft | false | |
Type | "posts" | |
Layout | "" | |
Permalink | "https://ox-hugo.scripter.co/test/posts/details-and-summary/" | |
RelPermalink | "/posts/details-and-summary/" | |
Data |
| |
NextPage | Default level offset | |
PrevPage | Disable exporting author | |
NextInSection | Default level offset | |
PrevInSection | Disable exporting author |
Page Params (Debug)
Key | Type | Value |
---|---|---|
description | string | "Details disclosure elements [`<details>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) and `<summary>`." |
draft | bool | false |
iscjklanguage | bool | false |
lastmod | time.Time | 2022-01-17 15:43:17 -0500 -0500 |
tags | []string | "special-block" "details" "summary" "disclosure" |
title | string | "Details and summary" |
File Object (Debug)
FileInfo Variable | Value |
---|---|
UniqueID | "ab9400b06751c3b46e463fa6ae905780" |
BaseFileName | "details-and-summary" |
TranslationBaseName | "details-and-summary" |
Lang | "en" |
Section | "posts" |
LogicalName | "details-and-summary.md" |
Dir | "posts/" |
Ext | "md" |
Path | "posts/details-and-summary.md" |