Formatting#

aaa

Welcome Page#

Q: I want to design a welcome page with text boxes side by side and a central search. How can I arrange this without using tables? That seems a little bit difficult for me. Thanks for an answer.

A: Try working with columns, see JSPWikiStyles#Columns


Coloured Text?#

Q: How can I change the colour of text on the screen - do I need a plug in or is there an inbuilt function I can use?

A: Use CSSInWikipages, see also: HowToColorText


Q: Can you set a link to jump to a section within a wiki page? Where a section is denoted by a '!!' header title.

A: Yes. For example, this link goes to the Implicit Line Breaks. Click on "Edit this page" to see how it works.


Anchors?#

Q: How do I create anchors and link to them in a Wiki page I want to present a Table of Contents section in my page so that the viewer can simply click on the appropriate entry and be brought automatically to that section of the page. I know I could have each TOC entry as a link to a different page but I don't want that!

A: On 2.2 every heading also generates a named anchor. You can also use the TableOfContentsPlugin.

Print-friendly format?#

Q: Does jspwiki support a print-friendly mode? If it can, how do I use it?

A: Yes, there is a print stylesheet available, which all modern browsers should honor. See also Hide Menu.

Can we have text alignment?#

Q: Can align text in JSPWiki? I mean for example can titles be centered at their line?

A: In 2.0, you have to enable raw HTML, but this is a security risk. However, in 2.1 it is already possible to apply any CSS style to any block of text. For example

%%(text-align:center)
!This text is centered.
%%
Would produce centered headline "This text is centered". See also: HowToCenterText

How do I configure my JSPWiki to handle JPG and GIF inline images?#

Testing JSPWiki for the first time, and mapping it against the feature set in UseMod (a popular engine I must now give up), I noticed immediately that GIF and JPG image formats are not supported in inline image linking.

Would it take much to include those formats? If you go to http://www.google.com/imghp you'll see that the majority of images that Google finds on the net are either GIF or JPG. Third popular seems to be PNG. -- MatthewSimpson

Check out the jspwiki.translatorReader.inlinePattern -property in jspwiki.properties. To support inlining of GIF images, you just add

jspwiki.translatorReader.inlinePattern.gif = *.gif

to your jspwiki.properties. By default, GIF inlining is disabled as an ongoing attempt to discourage people from using it :-).

-- JanneJalkanen (This should really be a JSPWikiFAQ)... (and now it is! :-) -- MatthewSimpson)

How to change the leftUpper icon to mine own?#

Q: I want to put the mine own logo on the leftUpper corner. But, there is always a JSPWiki there. How to deal with this? Or, it must be there?

A: Create your own WikiTemplate. You can modify it at will and change it look like anything you'd ever want.

Comments?#

Q: Is it possible to add a comment to a version when you change something (for pages as well as for attachments) as seen on wikipedia?

-- ChristianEy

A: Not currently, but it would be a nice feature. If added, it would also be nice to see the comments shown in the recent changes/etc. --MichaelGentry

Is there any way to escape the interpretation of a numerical link as a footnote, in order to have Wiki pages with all numerical names? In other words, I created a page named 200403, but can't link to it because the Wiki thinks [200403] is an attempt to create a footnote.#

JohnV
Hmm, not that I've come across, we had some pages like that that were relly dates and used a shortened english month name in them like [2004 Mar 04]. You could put a dash in or after the number, that would force a page link rather than a footnote. Like 2004-03 or 200403- but that's a little wierd.
EdwinGustafson
So I guess that's a kind of a bug—a string of digits is a valid WikiName for which the markup cannot generate a link.

Frames?#

Q: Is there a way to put the left menu into a frame, to get a permanently visible menu?

A: I imagine it's possible; you'd have to tweak .../templates/default/ViewTemplate.jsp and base it on frames instead of a table. I found it simpler to modify my personal template to use just DIV tags and CSS (position: fixed) to render a fixed menu. --ebu

Is there a way I can dump all the pages to HTML#

I would like to set up a Wiki internally but would like to periodically publish its contents on to the Web as plain old HTML pages. Any thoughts on the best approach ?

Two possible solutions come to mind:

  • Have a spider crawl it all and publish it (for example wget might work well)
  • Use Hula by MahlenMorris to fetch the contents of all pages using XML-RPC, then apply them in your own templates.

-- JanneJalkanen

Implicit line breaks#

Q: JSPWiki is pretty much perfect for my uses, but one thing I find annoying is having to specify a line break \ \. I prefer the classic Wiki way of inserting breaks on a newline. Id there any way I can change this?

--KieronWilkinson

A: No.

For all intents and purposes it's far better to just leave a blank line between the paragraphs. The line break character should be used very sparingly. The resulting WikiMarkup looks far more readable anyway if you use blank lines instead of line breaks.

The other problem is that line breaks are not visible on screen while the user is editing. This may cause a lot of confusion to newbies, if the lines break at seemingly random places.

If you really, really want it, you can just easily modify TranslatorReader to emit a <br> when it meets a newline.

-- JanneJalkanen

Line breaks are not used that sparingly for our purposes, since our wiki is rather technical in nature. But thanks for the advice, I will make that change. If I make it a switch in the config file, would you like it submitted back to the main project? Thanks!

Update: Okay, I implemented this and works great. Thanks for getting me started. It actually now works with both explicit and implicit line breaks, so our current pages are not effected. If any body wants the changes, feel free to let me know.

-- KieronWilkinson

Q: How do you insert breaks on newlines? Could you provide easy steps? (JSPWiki version 2.8.4)

You could allow HTML and use pre-tag.

Raw HTML?#

Q: How do you allow raw html in wbepages? I've been reading through the help files and the text formatting files and can't find it. I've found references to the fact that it has been added on these pages: WikiMarkupDevelopment and AllowingRawHTML but there is no link to any page telling you how to actually start using raw html...

A: Please see Allowing Raw HTML now for the instructions.

Tables?#

Q: What's the easiest way to be able to color cells in a table?

Q: Is there any way to do rowspan/colspan in a table?

-- KyleAdams

Q: How can I use a pipe sign in a table?

-- ThorstenHirsch

A: Simply put a tilde character before the pipe ( ~| ).

-- FlorianHoleczek

Q: Is there any way to align text inside a table? I've been using the inline style sheet method of

|%%(color:red; text-align: right)12345.67%%
in order to right-justfiy a column of numbers. The color change works (so I know the inline style is being applied) but the text-align does not. Any ideas? -- PaulPigott

A: Seems you need to put display:block in there too:

Just a long line to make differences more visible
|%%(color:red; text-align:right)12345.67%%12345.67
|%%(color:red; text-align:right; display:block)12345.67%%12345.67
-- StruanKerrLiddell

Q: How do I make bullets work inside a table cell. I am having multiple rows in each cell through \\ ?

Images?#

Q: I want to tweak my wiki page for it to work more the way i want it to. I have password restricted the edit page but i want to be able to remove the upload a file link from the view page and add it to the edit page. Also is there any way of removing the paper clip from next to an attachment?

--JC

A: Yes, replace the images/attachment_small.png with a transparent 1x1 png :-). You can modify the templates at will, I just recommend that you make your own copy of the "default" template and modify that.

-- JanneJalkanen

Text formatting#

Q: Is there a general way to escape the formatting-significant characters? I see that doubled left-square-brackets gives you a literal left square bracket, but what about the others? (Immediate source of the question is this: I'm trying to build a page with an "ls -l" directory listing, where some of the files have 600 permissions, hence runs of four or more dashes, hence I'm seeing (unwanted) HRs in the output). Just getting into JSPWiki, and I apologize in advance if the answer's staring me in the face. Thanks, MarkFrancillon - Sept. 20, 2003.

Three braces (like this: { { {, but no spaces)

    Like this ----  Can do [anything]
allows you to put anything there in between without it being parsed.

-- JanneJalkanen

Thanks. Actually I should have said that I have HTML-interpretation on, and that my text is in the middle of a bunch of HTML markup. But I see that if I get inside that markup, what you say about wrapping in triple-curly-braces still works. Hmm, time to look at TranslatorReader, I think, and see how you're doing all this... - Mark.

The problem with the three braces is that it puts the contents inside a pre tag, which puts it in its own block. I can't see a way to refer to, say, a Windows UNC path (starts with two backslashes) inside a paragraph.

-- LachlanODea

I worked around this and specify paths using <a href=""> and the backslash special character & # 92 ; (no spaces).

Ah, okay. In 2.1 you can do this, just don't put the three braces as the first ones on the line, since it emits a <span> instead of a <pre>-tag.

-- JanneJalkanen

I don't like the way it works because I always seem to get a linebreak after the }}}. Is there a way to prevent this?

-- ChristophGrimmer

That this is because the </pre> HTML tag generates spacing, and then you get the <br> linebreak for the normal paragraphing. You would have to make TranslatorReader more intelligent by making sure it only emitted line breaks if it is not after certain tags. Of course, you could just nest up your Wiki page such as:

   A paragraph

   { { {
   Code
   } } }Start of next paragraph

But I guess not very nice...

-- KieronWilkinson

Two CSS separators (i.e. four '%'s) between special characters can be used to stop them being wikified, e.g. '', __, {{ and rw----r--

'%%%%', _%%%%_, {%%%%{ and rw--%%%%--r--

-- KevanGelling

Special characters#

Q: What is your recommendation for changing the translation scheme of special charactes in references, as in [?????????

--rsc 3.9.03

A: You are talking about scripting, yes? I would imagine that there is some way that the scripts can be written to escape the percent signs, but I don't know enough about Windows to say how to do it. Perhaps someone else would be able to help here? One possibility would be to install a better scripting environment such as cygwin or Python.

A hackish solution would be to simply change the '%'-sign to something else in the FileSystemProvider. You would need to do your own encoding at that point, though.

-- JanneJalkanen

Thanks Janne. Done it that way:

  1. In WikiEngine.java I introduced a new property jspwiki.percentsign which defaults to the percent sign.

  2. In AbstractFileProvider.java I changed the methods mangleName and unmangleName to replace the percent sign by the value of the property jspwiki.percentsign, in mangleName after the pagename gets encoded, in unmagleName prior to decoding the filename.
  3. Tested, seems to work.

I placed the following comment in jspwiki.properties:

#  When it comes to special charaters that should be used inside a filename
#  JSPWiki encodes this charaters to their hex representation within the
#  chosen character set preceded by a percent sign. 
#  Unfortunately some operating system - especially the MS-Windows family -
#  do not handle percent signs properly in all circumstances.
#  For this situation you can choose a different character string in favor of

#  the percent sign. 
#  You have to choose this string with care as it should not be part 
#  of any JSPWiki pagename for other purposes than replacing the
#  percent sign. Otherwise the pagename gets garbled when decoded back
#  to the original representation.
#  So if you choose the double underscore for instance, make sure you'll
#  never use double underscore in any JSPWiki pagename.
#  And never use an underscore followed by a special character.

#  jspwiki.percentsign = 

The restrictions are somewhat objectionable. They could be lowered if I would use regexp instead of String.replace and check wether a hex code follows the percent sign.

--rsc 8.9.03

How does one create a nested list structure?#

Is there a way, using the current list markup tags, to create nested (and mixed) list structures? For example:

1. This is the first item
   * Task
   * Another Task
2. This is the second item
   * Yet Another Task
This type of nesting is possible with WikkiTikkiTavi. See FormalFormattingRules/Lists to see how they handle it. It might also be nice to specify bullet/numbering styles, too, but the nesting support would be really nice to have before specifying styles.

--MichaelGentry

There is nesting support:

# This is a first item.
** Task
** Another task
# This is the second item
** Yet Another Task
becomes:
  1. This is a first item.
    • Task
    • Another task
  2. This is the second item
    • Yet Another Task

-- JanneJalkanen

Strike-through text?#

Is there anyway to strike-through text? Other Wikis use --text-- markup. If not, is there any plans to add it in the future?

--NelsonSegura

Something like this?
%%(text-decoration:line-through)
Something like this? 
%%

--DF

Q: Hello, how can I use iframes? As used on http://www.picapica.de/

A: You need to write a plugin for that; or enable HTML (put jspwiki.translatorReader.allowHTML=true in your jspwiki.properties), but that is dangerous.


Q: Is it possible to use images as hyperlinks instead of text? Thanx, Lutz

A: Yes, if the link portion of the link points to an image which should be inlined, then the text portion becomes a link. See Pic for examples.

Redirects#

I anticipate that we may occasionally want to change the primary name of a page. Is there something similar to MediaWiki redirection, so that we can make old links to a renamed page continue to work?

--ACW

A: Yes. You can use the [{SET alias='NewPageName'}] anywhere on a page to cause a redirect. However, note that the rename functionality of a page also has the ability to track all the links and rename them on-the-fly - just check the box right below the new name. You may also use the [{SET redirect='http://any.web.addres'}] variable to redirect to an external page, as well.


Escaping Double Backslash eg for Windows networking paths#

Q: How can I escape the double backslash sequence of characters when referencing a Windows network drive? The double backslash sequence is used for a new line.

A: I answered my own question. Put a tilde (~) character before the double backslash!

--Chris 27-Aug-2008

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-67) was last changed on 10-Jun-2012 10:43 by Janne Jalkanen