TWiki Markup for Blockquotes
I'd like to suggest that we develop a TWiki shorthand for entering the <blockquote> tags.
At this point I have no suggestion for what shorthand to use.
--
RandyKramer - 28 Nov 2001
How about:
{beginning-of-line}{space-space-space}{double-quote}
the block of text being quoted
{beginning-of-line}{space-space-space}{double-quote}{end-of-line}
Verbatim:
"a bunch of text long enough to wrap around and create a
paragraphy looking thing oh boy we need to go a little bit
longer since I want at least two lines do you think this is
enough?
"
--
MattWilkie - 28 Nov 2001
The proposed shorthand seems like an acceptable approach, I guess we can leave that point open until somebody gets ready to implement it. But, there is another suggestion to reduce the number of spaces required for the list markup, possibly to two -- we should make this consistent with that. (Of course, if you're already making a change, please proceed however you wish!)
The blockquote should look as follows (I think), and only have quotes if I manually add them. Oops, wait, adding the quotes manually would conflict with the proposed markup, but, fine, I don't think people often use quotes in a block quote (at least not around the entire paragraph, perhaps within the paragraph). Maybe (if quotes seem necessary) the markup could be as proposed to show no quotes, and double up the double quotes to show quotes?
a bunch of text long enough to wrap around and create a
paragraphy looking thing oh boy we need to go a little bit
longer since I want at least two lines do you think this is
enough?
PS: The real reason I came back here so soon was to add to the suggestion -- why don't we develop TWiki shorthand for the <verbatim> tags also.
Are there other tags we should consider adding shorthand for? I also use <nop> quite often, and I find myself typing < quite often to display a <. Some simple shorthand for those would be helpful.
--
RandyKramer - 28 Nov 2001
FrankThommen posted this method of "abusing" the Definition List shorthand to generate indented blocks of text without resorting to html
blockquote (from
GenerateIndent):
&nbsp;: the paragraph to be indented...
-
- A really long line of text must be entered in order to show that when the line wraps it also wraps the rest of the paragraph. So, are we there yet? Better add a couple of more words to make sure... okay. Done now.
I suggest that the TWiki should adapt and modify the shorthand used by
WikkiTikkiTavi for this:
[beginning of line][three spaces][colon]
: one level of indent
:: two level indent
::: three level indent
--
MattWilkie - 22 Oct 2002
There is a need to introduce a markup for indented text. We need to find a syntax that is
consistent with other TWiki markup; has
low interference with existing text; and is
easy to remember.
The
{beginning of line}{three spaces}{[1-n] x colon}{space}text rule is easy to remember but is not consistent with other TWiki markup. How about
{beginning of line}{[1-n] x three spaces}{colon}{space}text markup:
: one level of indent
: two level indent
: three level indent
This would be consistent with TWiki's bullet markup. The chance of interference with existing text is low, for example it is very unlikely that pasted text starts with
{three spaces}{colon}{space}text
--
PeterThoeny - 23 Oct 2002
You're right it should be consistant with other markup like lists. I hadn't thought of that.
Note that there is a difference between
blockquote and
indent , although general usage on the web has obscured this since html does not offer an indent tag.
I just don't like the {three-spaces} construct generally which is cumbersome and prone to error (you can't tell just by looking how many spaces there are). Hopefully in the fullness of time, and an editor applet, we'll be able to use {tab} instead.
--
MattWilkie - 23 Oct 2002
I suggest ==three spaces=="(eol) for one level of blockquote, ==three spaces=="" for the second level etc.
E.G.
"
This is a blockquoted paragraph. "it has quoted text"
""
blockquote again
even include a new paragraph.
""
this is blockquoted at the first level
"
this is not blockqouted.
to get:
This is a blockquoted paragraph. "it has quoted text"
blockquote again
even include a new paragraph.
this is blockquoted at the first level
this is not blockqouted.
As an optimization a single level blockquote can close any number of other blockquotes so:
"
block me
""
block me again
"
not blocked
produces:
block me
block me again
not blocked
I like using the " since the underlying tag is blockquote, it makes
it easy for me to remember. For the non nerd contingent, just remind
them that long quotes need to be quoted.
I would also make the marker stand out on a line by itself and not
start a block of text. Putting the twiki markup together with
the text works if the text is a single line most of the time
(e.g. titles, headings), but I don't think it works well for multiple line data.
I also like the idea of using the (three spaces)' as a verbatim replacement.
--
JohnRouillard - 26 Oct 2002
Moved from UsabilityIdeas by MattWilkie - 09 Jan 2004:
I'd like to be able to structure a text using indentations. Sometimes it is inappropriate to use headings or bulleted lists. Maybe use three spaces as a shorthand for this?
--
StephanMeyer - 18 Oct 2003
Would
<BLOCKQUOTE> &
</BLOCKQUOTE> work for you? I have:
- Blockquotes
- Set BQ = <BLOCKQUOTE>
- Set bq = </BLOCKQUOTE>
on our TWikiPreferences Page, although I don't know if anyone but me uses them.
- Why not just use <blockquote></blockquote>? BQ is hard to remember. No, seriously. -- ArthurClemens - 08 Jan 2004
So is there a way to indent a paragraph that looks normal, like in a word processor? Perhaps a good way for structured indent that behaves like Microsoft Word is to create a wiki markup for " ul {list-style-type: none} ". That would give the same nice tabbing nested paragraphs in (un)ordered lists. Can we do this? Not being able to format text with indentations is frustrating as hell.
--
RyanKnoll - 21 Feb 2006
- This is indented using an empty unordered list, but indentions via empty unordered lists are no blockquotes
- Blockquotes are usually indented from both sides where unordered lists are not (compare the block above).
--
FranzJosefSilli - 21 Feb 2006
Franz - that's exactly what I would like to do, be able to always have available this ul: none style available in the
WYSIWYG. Is there a way to do this without having to type each time? Using Twiki 4.0's
WYSIWYG, the ul {list-style-type: none} style is always removed. Can you think of a way to always have this available in the
WYSIWYG? It makes for really fast and neat nested formatting in the
WYSIWYG editor. Maybe the solution is to somehow add this style to the TWL markup?
--
RyanKnoll - 22 Feb 2006
Yes, you would have an own
CSS class for your kind of 'list'. I must say, I'm no great friend of indentions or blockquotes, IMHO they are not necessary at all. One can always find a better solution. Hm. What about an empty definition list.
-
- This is indented by an empty definition list. But I need some more dummy text to show its effect in context. Lorem ipsum ... At least one can easily indent one block of text.
--
FranzJosefSilli - 22 Feb 2006
I had a request for this feature today, and found it hard to come up with arguments why we shouldn't support a syntax for indention - even though simple blockquoutes in
HTML are easy to use imho.
I like Peters suggestion for implementation, and I find it somewhat aligned with
MediaWikis syntax
which also uses colons for indents.
: one level of indent
: two level indent
: three level indent
Anything else to remember on implementation? Perhaps support for different
CSS class names or so? Consider support for
hanging punctuation
?
Class name support could be implemented rather simple
:poem lorem ipsum ..
simply resulting in
<blockquote class="poem">lorem ipsum ..</blockquote>
Similar for :qoute, :inline, :wrapleft, :knockout or whatever classes one could think of.
Inspiration:
--
SteffenPoulsen - 18 Oct 2006
Yes, I think we should go with the indented colon syntax.
On
CSS class support, I do not find it very obvious what the difference is between
:poem lorem and
: poem lorem. Lets do things one step at a time: Implement blockquote syntax first without class support, and find a
TmlForCssClass syntax that works across the board. Such as
{class:foo} or
%CLASS{foo}%.
--
PeterThoeny - 18 Oct 2006
Quite OK to give this some more thought. The reason for the
:poem lorem would be to keep the regex simple / not to confuse a class name with "first word" of the indention.
A naive patch with
:poem lorem support could look like this:
Index: lib/TWiki.pm
===================================================================
--- lib/TWiki.pm (revision 11752)
+++ lib/TWiki.pm (working copy)
@@ -369,6 +369,9 @@
# '---++!! Header' or '---++ Header %NOTOC% ^top'
$regex{headerPatternNoTOC} = '(\!\!+|%NOTOC%)';
+ # Indent pattern
+ $regex{indentPattern} = qr/^(\t| )+\:(\S*)\s+(.*)/mi;
+
# TWiki concept regexes
$regex{wikiWordRegex} = qr/[$regex{upperAlpha}]+[$regex{lowerAlphaNum}]+[$regex{upperAlpha}]+[$regex{mixedAlphaNum}]*/o;
$regex{webNameBaseRegex} = qr/[$regex{upperAlpha}]+[$regex{mixedAlphaNum}_]*/o;
Index: lib/TWiki/Render.pm
===================================================================
--- lib/TWiki/Render.pm (revision 11752)
+++ lib/TWiki/Render.pm (working copy)
@@ -333,6 +333,20 @@
return CGI::code( $theText );
}
+sub _indentText {
+ my( $this, $theIndent, $className, $theText) = @_;
+
+# How to indent further? - Does nested blockquotes give much sense?
+# $theIndent =~ s/ /\t/g;
+# my $depth = length( $theIndent );
+
+ if ( $className ) {
+ return CGI::blockquote( { class=>$className }, $theText );
+ } else {
+ return CGI::blockquote( $theText );
+ }
+}
+
# Build an HTML <Hn> element with suitable anchor for linking from %<nop>TOC%
sub _makeAnchorHeading {
my( $this, $text, $theLevel ) = @_;
@@ -985,6 +999,9 @@
# standard URI
$text =~ s/(^|[-*\s(|])($TWiki::regex{linkProtocolPattern}:([^\s<>"]+[^\s*.,!?;:)<|]))/$1.$this->_externalLink($2)/geo;
+ # Indented section
+ $text =~ s/$TWiki::regex{indentPattern}/$this->_indentText($1,$2,$3)/geo;
+
# other entities
$text =~ s/&(\w+);/$TWiki::TranslationToken$1;/g; # "&abc;"
$text =~ s/&(#[0-9]+);/$TWiki::TranslationToken$1;/g; # "{"
Issues remaining:
- I actually don't know how to handle more than one indention gracefully, should really be done through CSS I think? Simply using multiple nested blockquotes looks kind of odd.
- Probably most intuitive to collate several indention lines following each other into the same blockquote (not done in above patch).
--
SteffenPoulsen - 18 Oct 2006
Some thougts. Some may be rubbish
- I think many have used blockquotes to make more than just indentation. We should watch out that they have a way out so they do not loose their topics.
- Blockquote is not really a feature for indentation. It is a quotation html tag made for quotes to be shown in a different way.
- I like the " : Blabla " syntax which is very much in line with the existing TML. Is it possible to use so that it only adds div class tags that are then indented via pure CSS? At least nesting should be possible also this way. But natually the code for this will be more complexe and then we have to consider performance which may lead us straight back to the blockquote method.
Just some thoughts for inspiration. Not strong oppinions.
--
KennethLavrsen - 18 Oct 2006
Yes, you are right. Actually,
W3C already lists blockquote as deprecated
so we should consider something else.
To keep it simple, we could consider going for dl/dd tags, like this:
<dl><dd>Indented once
<dl><dd>Indented twice
<dl><dd>Indented 3 times
</dd></dl>
</dd></dl>
</dd></dl>
Resulting in:
- Indented once
- Indented twice
- Indented 3 times
Works also OK for three times indention stand-alone, like this:
-
-
- Indented 3 times
-
-
- Compared to a bullet (9 spaces)
This would need kind of the same logic as is currently used for building un-numbered lists.
(Means I will have to forget about the fancy "knockouts", though :-))
--
SteffenPoulsen - 18 Oct 2006
The dl/dd tags look OK to me.
I stronly suggest to look at the css class naming feature separately because it needs to be done consistently for any markup, such as blockquotes, bullets, tables, paragraphs, and may be even
TWikiVariables such as TOC. So, a one off, quick solution just for the blockquote might be in the way of a consistent design later on.
--
PeterThoeny - 18 Oct 2006