emacs-wiki-discuss
[Top][All Lists]
Advanced

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

[emacs-wiki-discuss] [NEW] planner-sectionalize.el (DIV it up!)


From: Peter K . Lee
Subject: [emacs-wiki-discuss] [NEW] planner-sectionalize.el (DIV it up!)
Date: Fri, 08 Jul 2005 13:01:23 -0400
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/22.0.50 (gnu/linux)

Hi, I would like to submit a new module for testing & consideration
for inclusion to the planner tree.

This module is a pre-publishing routine that handles sections in a
special way when publishing HTML.

Basically, instead of the standard <h*>section name</h*>, it now
generates *NESTED* <div class="section"><h*>section name</h*> for each
section and subsections.

What that allows you to do is to use CSS selectors like the following
to achieve pleasing effects such as:

div.section { margin-left: 5px; }
div.section div.section { margin-left: 15px; }
...

In english, you are able to indent subsections inside sections, and
subsubsections inside subsections, etc.

Obviously, there's more you can do with it than simple indentation,
such as changing background colors, font size, borders, etc. to
generate markup that signifies sectional content.

Yeah, it's really coool. :)

For further details, refer to the documentation inside the module.

As of now, I've tested on muse, I have a pretty good idea that it
should work with emacs-wiki, but I haven't tested it.  Please
uncomment the appropriate section to enable it for emacs-wiki, make
changes if necessary, and let me know if it Works for You!

This module is a little rough around the edges, i.e. if you publish to
something other than HTML, it will likely break the markup.

I just need a simple conditional to verify that the publishing is to
HTML before applying the sectionalization code within the
pre-publishing hook, but I was too lazy to dig into the code to figure
out what that would be... ;)  Help, anyone?

This module works by mangling the *, **, ***, ... BEFORE the standard
processing kicks in, so if you have any special treatment of those
particular markup (ehm, Sacha...) then this modules will not play
nice...

Eventually I plan to extend this to allow arbitrary html to be
generated in an extensible manner, but for now, you can still
override the html generating function to have it publish extra html
you want inside each section/sub/subsub/etc.

Ah, one more thing, there's no longer limitation on number of *'s.
You can have subsubsubsubsubsubsubsection, although I'm not sure why
you'd want one.  But you still can. :)

Also, you can have a parent section, some text, subsection, some text,
and THEN have more text be included as part of the parent section!

Yeah it's little hard to visualize, check the module for a better
example.

Eventually, I'll add capability for processing certain section titles
specially, i.e. Tasks, Notes, etc. such that those particular titles
will get id="something" within the DIV tag so that you can even play
around with CSS positioning, and adding scrollbars to the fixed height
Tasks section!  Not quite yet...

Ah, to use it just add (require 'planner-sectionalize) somewhere in
your .emacs or wherever you put these things.

Enjoy.

-Peter

p.s. if you have comments on the code itself, please do let me know!
I'm in the process of learning elisp, and I'd like to know how to
write it most effectively!

-- 
B 01110011 01100001 01101001 01101110 01110100
----------------------------------------------
Managing Member @ CORENOVA,LLC. M:919-641-6314
- let them be, just evolve.     O:919-641-6314
----------------------------------------------
56 69 73 69 74  75 73  61 74: www.corenova.com

CORENOVA> ./freedom. intoxicating. <RET>

Attachment: planner-sectionalize.el
Description: The sectionalization code


reply via email to

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