emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Christian Moe <mail@christianmoe.com>
To: Matt Price <moptop99@gmail.com>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: collapsing some headings on html export?
Date: Thu, 25 Aug 2011 22:19:55 +0200	[thread overview]
Message-ID: <4E56AE6B.1030903@christianmoe.com> (raw)
In-Reply-To: <CAN_Dec-B3sqcJOp5W_fOQO745hYFV+nb+m_KhaoL_C0bzW0FPQ@mail.gmail.com>

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	other threads:[~2011-08-25 20:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-25 15:41 collapsing some headings on html export? Matt Price
2011-08-25 20:19 ` Christian Moe [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E56AE6B.1030903@christianmoe.com \
    --to=mail@christianmoe.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=moptop99@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).