emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] collapsing some headings on html export?


From: Christian Moe
Subject: Re: [O] collapsing some headings on html export?
Date: Thu, 25 Aug 2011 22:19:55 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20110624 Thunderbird/5.0

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]