Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for collapsible sections #1279

Closed
jrodewig opened this issue Oct 10, 2019 · 9 comments · Fixed by #1687
Closed

Add support for collapsible sections #1279

jrodewig opened this issue Oct 10, 2019 · 9 comments · Fixed by #1687
Labels
enhancement Something we'd like to improve

Comments

@jrodewig
Copy link
Contributor

jrodewig commented Oct 10, 2019

To improve our breaking changes documentation, the Elasticsearch writers would like to use collapsible sections in our HTML output.

As of writing, it doesn't appear this is supported. I've documented my attempts to implement collapsible sections below.

Option 1: Use the Asciidoctor[%collapsible] block

I first tried to use the [%collapsible] block added in Asciidoctor 2.0:

[%collapsible]
.Details
====
Content to collapse.
====

However, our docs build uses Asciidoctor 1.5 which doesn't support this block type.

Option 2: Use an html passthrough

I then tried to use passthrough blocks to use HTML details and summary tags.

++++
<details><summary>
Details
</summary><div>
++++

Content to collapse.

++++
</div></details> 
++++

However, docbook doesn't allow us to pass these HTML elements on directly. After looking at the docbook DTD, I don't believe any collapsible elements are supported.

@jrodewig jrodewig added enhancement Something we'd like to improve team-discuss labels Oct 10, 2019
@jrodewig
Copy link
Contributor Author

Adding the #team-discuss label as I want to gauge interest in this feature and see if anyone has other workarounds.

@gchaps
Copy link
Contributor

gchaps commented Oct 10, 2019

@jrodewig +1 for collapsible sections. In Kibana, we can use them for breaking changes, and also for examples.

@bmorelli25
Copy link
Member

APM doesn't have a specific use case, but it's a welcome enhancement.

@alaudazzi
Copy link
Contributor

alaudazzi commented Oct 17, 2019

@jrodewig I have been using collapsible sections (also called "Zippies") in my previous job. It's a great solution to enhance navigation and discoverability in general. It would be nice to see it implemented in our doc. Happy to contribute!

@jrodewig
Copy link
Contributor Author

Since @nik9000 migrated our docbooks to direct HTML (thanks again Nik!), we can now use the html passthrough method (option 2).

Here's a proof of concept I worked up using a section of the Elasticsearch 8.0 breaking changes:

@nik9000
Copy link
Member

nik9000 commented Dec 28, 2019

I think collapsible would be nicer though! I can probably make that work.

@nik9000 nik9000 reopened this Dec 28, 2019
@nik9000 nik9000 pinned this issue Dec 28, 2019
@benskelker
Copy link
Contributor

Thanks @jrodewig - I tried playing with. The details tag is not supported in MS IE/Edge.

@jrodewig
Copy link
Contributor Author

jrodewig commented Jan 2, 2020

@benskelker Good to know. It looks like there are several polyfills for IE/Edge, but none of those are easily implemented via HTML itself. It seems like implementing this through Asciidoctor is preferable.

@nik9000
Copy link
Member

nik9000 commented Jan 2, 2020

It turns out that Asciidoctor just uses <details> and <summary> anyway. But I'll open a PR in a few minutes to add support for it via the native asciidoctor syntax. And docs. And a polyfill to (hopefully) get it working in IE.

nik9000 added a commit to nik9000/docs that referenced this issue Jan 2, 2020
This adds support for collapsible examples to our docs. It turns out
that asciidoctor just uses `<details>` and `<summary>` which isn't
supported by all browsers, but we've got a polyfill.

Closes elastic#1279
nik9000 added a commit that referenced this issue Jan 2, 2020
This adds support for collapsible examples to our docs. It turns out
that asciidoctor just uses `<details>` and `<summary>` which isn't
supported by all browsers, but we've got a polyfill.

Closes #1279
@mark54g mark54g unpinned this issue Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something we'd like to improve
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants