Last modified: 2011-03-13 18:04:38 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T18336, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 16336 - Feature Request: Support CSS Annotations in HTML
Feature Request: Support CSS Annotations in HTML
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Lowest enhancement with 1 vote (vote)
: ---
Assigned To: Markus Krötzsch
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-13 21:49 UTC by Jonathan Greene
Modified: 2011-03-13 18:04 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Jonathan Greene 2008-11-13 21:49:20 UTC
This is a request to include CSS markup in the HTML output of property-tagged text.

The are many implementation possibilities. I propose the following.

Let's keep it simple and assume a 1:1 relationship between each property and its resulting CSS class.

Introduce a flag on property pages to enable this functionality on a property-by-property basis.

The following, for example, would appear on a property page called "SomeProperty".
    CSS="p" [*]

SMW would process the following...
    [[SomeProperty::This text is tagged with the "SomeProperty" property.]]

And would output...
    <p class="SomeProperty">This text is tagged with the "SomeProperty" property.</p>


----------- Another Example for Clarification -----------

On a property page titled "AnotherProperty"
    CSS="h1"

SMW would process the following...
    [[AnotherProperty::Important Heading Information]]

And would output...
    <h1 class="AnotherProperty">Important Heading Information</h1>

A user could then update the CSS appropriately and invoke style information as desired on all SMW content.

[*] I realize some HTM/CSS purists may cringe at the nomenclature, but it is succinct and the resulting HTML is clean.

Thanks!
Comment 1 Markus Krötzsch 2008-11-17 15:28:44 UTC
Aha, so you refer to CSS tags on wiki pages (as opposed to having them on Special:Browse or the like). It seems that this feature could already be realized using templates rather easily, e.g. one could have a template containing

<p class="{{{1}}}">[[{{{1}}}::{{{2}}}]]</p>

which is used like {{p-smw|SomeProperty|This text is tagged with the "SomeProperty" property.}}

This would give you full control over the markup without any extension to SMW. Making this a built-in feature of SMW would be much more complicated. You would need a dedicated way for determining when to use p, h1 or whatever, and you would need to have a way of escaping symbols that are allowed in property names but not in CSS classes. I am much in favor of the manual solution unless there are strong arguments against it.

Comment 2 Jonathan Greene 2008-11-17 15:43:50 UTC
Markus, that looks like a fine solution. Thank you!
Comment 3 Markus Krötzsch 2008-11-17 16:29:37 UTC
Great, then I will just close this bug.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links