* collapsing some headings on html export?
@ 2011-08-25 15:41 Matt Price
2011-08-25 20:19 ` Christian Moe
0 siblings, 1 reply; 6+ messages in thread
From: Matt Price @ 2011-08-25 15:41 UTC (permalink / raw)
To: Org Mode
does anyone have any advice on the following: I'm thinking I would
like to collapse certain segments of a document when exporting to
HTML, so e.g., if it looks like this:
* Outline: Semester 1
** 1.<2011-09-15 Thu> [[file:./syllabus/what-is-history-for][What is
History For?]]
Why we should write history, why everyone should do it, and why that
means we need the Web. Hacker cultures, collaborative learning,
knowledge sharing, non-expert culture.
Background: [[http://www.journalofamericanhistory.org/issues/952/interchange/index.html][JAH
- The Promise of Digital History]]
*** Lab: Introduction to Wordpress & the course site. Blogging &
social media review. Preliminary listing of potential NGO partners.
I'd like to display just this by default:
Outline: Semester 1
1. Sept. 15, 2011 What is History For
but permit viewers to click on the headline or a '+' box to see the
details. Is it possible to do this somehow, e.g. by embedding some
javascript code somewhere or something?
Really just wondering...
Thanks,
Matt
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: collapsing some headings on html export?
2011-08-25 15:41 collapsing some headings on html export? Matt Price
@ 2011-08-25 20:19 ` Christian Moe
2011-08-26 5:08 ` Christian Moe
2011-08-26 8:58 ` Daniel Clemente
0 siblings, 2 replies; 6+ messages in thread
From: Christian Moe @ 2011-08-25 20:19 UTC (permalink / raw)
To: Matt Price; +Cc: Org Mode
Hi,
org-info-js may be your best bet, but for a lightweight solution that
works with your sample text without a single line of javascript, try
this (mouse over headings to display contents):
---------
#+TITLE: Folded headings in html export
#+style: <style>.folded > div {display: none;}
#+style: .folded > *:after {content: " ...";
#+style: background: yellow}
#+style: .folded:hover > div {display: block}
#+style: .folded:hover > *:after {content: ""}</style>
* Outline: Semester 1
** 1.<2011-09-15 Thu> [[file:./syllabus/what-is-history-for][What is
History For?]]
:PROPERTIES:
:HTML_CONTAINER_CLASS: folded
:END:
Why we should write history, why everyone should do it, and why that
means we need the Web.
Hacker cultures, collaborative learning, knowledge sharing, non-expert
culture.
Background:
[[http://www.journalofamericanhistory.org/issues/952/interchange/index.html][JAH
- The Promise of Digital History]]
*** Lab: Introduction to Wordpress & the course site.
:PROPERTIES:
:HTML_CONTAINER_CLASS: folded
:END:
Blogging & social media review. Preliminary listing of potential NGO
partners.
---------
Drawbacks: You need to set a HTML_CONTAINER_CLASS property to "folded"
on any subtree you want hidden from the start. And the unfolded text
folds away again when your reader mouses out of the containing div.
Yours,
Christian
On 8/25/11 5:41 PM, Matt Price wrote:
> does anyone have any advice on the following: I'm thinking I would
> like to collapse certain segments of a document when exporting to
> HTML, so e.g., if it looks like this:
>
> * Outline: Semester 1
> ** 1.<2011-09-15 Thu> [[file:./syllabus/what-is-history-for][What is
> History For?]]
> Why we should write history, why everyone should do it, and why that
> means we need the Web. Hacker cultures, collaborative learning,
> knowledge sharing, non-expert culture.
> Background: [[http://www.journalofamericanhistory.org/issues/952/interchange/index.html][JAH
> - The Promise of Digital History]]
> *** Lab: Introduction to Wordpress& the course site. Blogging&
> social media review. Preliminary listing of potential NGO partners.
>
> I'd like to display just this by default:
>
> Outline: Semester 1
> 1. Sept. 15, 2011 What is History For
>
> but permit viewers to click on the headline or a '+' box to see the
> details. Is it possible to do this somehow, e.g. by embedding some
> javascript code somewhere or something?
>
> Really just wondering...
> Thanks,
> Matt
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: collapsing some headings on html export?
2011-08-25 20:19 ` Christian Moe
@ 2011-08-26 5:08 ` Christian Moe
2011-08-26 8:58 ` Daniel Clemente
1 sibling, 0 replies; 6+ messages in thread
From: Christian Moe @ 2011-08-26 5:08 UTC (permalink / raw)
Cc: Org Mode
OK, the simple css solution I posted last night fails too easily.
Should have known, but it's been a while.
(If you add a second folding subheading beneath a folding heading (as
you mouse down toward the second subhead, the first subhead folds,
leaving you no longer hovered over the parent div, so the parent
heading also folds... with the upshot that you can never unfold the
second subhead.)
CM
On 8/25/11 10:19 PM, Christian Moe wrote:
> Hi,
>
> org-info-js may be your best bet, but for a lightweight solution that
> works with your sample text without a single line of javascript, try
> this (mouse over headings to display contents):
>
> ---------
>
> #+TITLE: Folded headings in html export
> #+style: <style>.folded > div {display: none;}
> #+style: .folded > *:after {content: " ...";
> #+style: background: yellow}
> #+style: .folded:hover > div {display: block}
> #+style: .folded:hover > *:after {content: ""}</style>
>
(...)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: collapsing some headings on html export?
2011-08-25 20:19 ` Christian Moe
2011-08-26 5:08 ` Christian Moe
@ 2011-08-26 8:58 ` Daniel Clemente
[not found] ` <CAN_Dec_Svf_DpsNxr0cUpwq=bvHcWm8uDUq5a6cqVqmm5JCA2Q@mail.gmail.com>
1 sibling, 1 reply; 6+ messages in thread
From: Daniel Clemente @ 2011-08-26 8:58 UTC (permalink / raw)
To: mail; +Cc: Org Mode
If you only want to expand/collapse headers in a web page, you may use jQuery to handle each click.
I did it with this code:
http://www.danielclemente.com/pagina/esquemadorg.js
http://www.danielclemente.com/pagina/esquemadorg.css
Demo: http://www.danielclemente.com/hacer/emacs.html
The code is a bit more difficult than that because you should handle links to collapsed sections in order to expand them as needed.
Daniel
El Thu, 25 Aug 2011 22:19:55 +0200 Christian Moe va escriure:
>
> Hi,
>
> org-info-js may be your best bet, but for a lightweight solution that
> works with your sample text without a single line of javascript, try
> this (mouse over headings to display contents):
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-08-26 16:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-25 15:41 collapsing some headings on html export? Matt Price
2011-08-25 20:19 ` Christian Moe
2011-08-26 5:08 ` Christian Moe
2011-08-26 8:58 ` Daniel Clemente
[not found] ` <CAN_Dec_Svf_DpsNxr0cUpwq=bvHcWm8uDUq5a6cqVqmm5JCA2Q@mail.gmail.com>
2011-08-26 16:04 ` Daniel Clemente
2011-08-26 16:08 ` Matt Price
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).