CSS and Moin
Moin currently uses id= parameters in <div>s when generating HTML (XML?)
It also uses class= parameters.
Moin's behaviour (as of 1.2) is below.
(umm, some of this should go into HelpOnConfiguration/CascadingStyleSheets)
Discussion
Q: Why is id used sometime and class used other times?
A: id is used to identfy 'instances' in a document. You should have precisley 1 DOM element with a given id. A typical example is the pagetrail.
class on the other hand is used where multiple instances are expected. Each instance should be of the same class. A typical example is an <li> in the menu.
(I'm new to this so I'm probably wrong - consider this a 'strawman' and edit it -- DavidGreaves)
I propose that within the <body>:
- Moin MUST emit a set of ids for every page (? including errors?) (always_ids)
- Moin CAN emit additional ids (sometimes_ids)
- All output MUST lie within the set of (always_ids + sometimes_ids)
- Moin CAN emit additional ids (extra_ids)
- extra_ids are not 'special' and must exist inside (always_ids + sometimes_ids)
Why?
- It's a specification (useful for developers!). It describes current behaviour (nearly). I think this will give Theme and CSS designers consistency across multiple Themes.
always_ids:
- header
- content
- footer
There should only be one of each of the above in the document -- EricDavis 2004-06-02 20:16:00
sometimes_ids:
- message
- preview
all other ids should be placed inside one of those above (?) extra_ids:
- logo
- title
- username
- navibar
- iconbar
- pagetrail
- credits
- trail
- timings
- pageinfo
- Include_
- Action_
Behaviour (as at 1.2)
'''div id''' Generating file Use content_id Page.py: ?? message PageEditor.py ?? preview PageEditor.py ?? timings request.py ?? pageinfo wikiaction.py ?? not hardcoded formatter/text_html.py ?? "Include_%s" % wikiutil.quoteWikiname(inc_page.page_name) macro/Include.py ?? "RandomQuote_%s" % wikiutil.quoteWikiname(page.page_name) macro/RandomQuote.py ?? "head-"+sha.new(title_text).hexdigest()+unique_id) parser/wiki.py ?? logo theme/classic.py ?? title theme/classic.py ?? username theme/classic.py ?? navibar theme/classic.py ?? iconbar theme/classic.py ?? message theme/classic.py ?? pagetrail theme/classic.py ?? footer theme/classic.py ?? credits theme/classic.py ?? trail theme/viewonly.py ?? footer theme/viewonly.py ?? credits theme/viewonly.py ??
I have a patch to add the following to moin--main--1.2 and --1.3. I just need to know how to submit it.
'''div id''' Generating file Use Action_fullsearch wikiaction.py ?? Action_titlesearch wikiaction.py ?? Action_diff wikiaction.py ?? Action_info_general wikiaction.py ?? Action_info_history wikiaction.py ?? Action_info wikiaction.py ??
Chat
I suggest you find those texts (in the code) that are not and prepare a patch for each -- NirSoffer 2004-05-19 17:16:51
yup - done that. posted to mailing list 05/18/04 15:34. Eventually found out about tla
Got tla, got branches. Edited /TlaGuide for others. Still don't know where I'm supposed to post patches? Nb also discovered that moin--main--1.2 uses id="content" rather than id="Action_fullsearch" as my solution does. I'm now in a position to post patches against moin--main--1.2 and --1.3 changing id="content" to id="Action_%s".action or adding the latter format for extra css goodness. Either way since this is new to 1.2.2 I think it needs deciding now
nb Where should we have this discussion?
- why shouldnt we simply use id="content"?
When I first saw this (1.2) 'content' wasn't used. I thought about it and thought 'content' probably identified Wiki content. I thought CSS designers would have more flexibility (although maybe more complexity) if they were named 'Action_xxx'. I thought some more in ../SkinPlugins/ThemeCssSpecification (here) where I propose both (I think in a world of jpgs a few extra div tags is worth the cost
)
- why shouldnt we simply use id="content"?
EpimetreusTheSage's Question (and my answer
) moved to MoinMoinQuestions --DavidGreaves
Bug in classic.css: Opera browser does not understand CSS <hr> specification. You probably don't see rules in Opera 7.5 if you don't change /classic/css/screen.css: Look for hr { .. border-style:none and change to border-style:solid -- rp 2004-07-23