[xwiki-users] Importing from another wiki
I am struggling to import content from another wiki. My previous wiki used markdown syntax, I converted the markdown syntax to XHTML via pandoc. The output validates as XHTML 1.0 Transitional, but when I try to convert it to xwiki syntax the conversion fails. 1. Does anyone have any ideas why this is failing? 2. Are there better ways to import wiki content? Thanks, Jesse
On Fri, Nov 18, 2011 at 6:12 PM, Jesse Hathaway <[email protected]> wrote:
I am struggling to import content from another wiki.
My previous wiki used markdown syntax, I converted the markdown syntax to XHTML via pandoc. The output validates as XHTML 1.0 Transitional, but when I try to convert it to xwiki syntax the conversion fails.
1. Does anyone have any ideas why this is failing?
What do you mean by failing and what result to you get exactly ?
2. Are there better ways to import wiki content?
Thanks, Jesse
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
Thomas Mortagne <thomas.mortagne@...> writes:
1. Does anyone have any ideas why this is failing?
What do you mean by failing and what result to you get exactly ?
These are the steps I made: 1. Paste the html into the edit window 2. Choose XWiki 2.0 from the Document Syntax Window 3. Choose OK to convert document. 4. Then I receive the following error: Failed to convert to the selected syntax. If you want to use this syntax anyway, you can select it again and choose not to perform the conversion. This is the document I pasted <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="pandoc" /> <title></title> </head> <body> <h3 id="fonts-in-java">Fonts in Java</h3> <p>Opentype fonts are not supported on Oracle JDK 1.6.0. You have to convert the font to a truetype font using fontforge. Java appears to use fontconfig to locate fonts. However it uses its own private copy, which often has bugs or features missing from your distro supplied version.</p> <p>Mac OS X and Linux process the fonts differently. Mac seems more forgiving of bad font metadata. As an example, for one particular font I had to tweak the meta data until the individual fonts, italic bold etc, appeared as one font in Linux, i.e. as a single family. They need to appear as a single family for Java to properly use differnt faces of a font, e.g. italic.</p> <h3 id="adding-fonts">Adding fonts</h3> <p>You can store the fonts in any of the font config search paths, including a per user directory:</p> <pre><code> cat > ~/.fonts.conf <<EOF <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <!-- Private font directory --> <dir>~/fonts</dir> </fontconfig> EOF </code></pre> <p><em>NOTE:</em> For the per user directory to work the <code>$HOME</code> environment variable must be set.</p> <h3 id="listing-available-fonts">Listing available fonts</h3> <p>Use the below java code to verify that a font has been made available in java:</p> <pre><code> cat > ListFonts.java <<EOF import java.awt.GraphicsEnvironment; public class ListFonts { public static void main(String args[]){ GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment(); for(String font:e.getAvailableFontFamilyNames()){ System.out.println(font); } } } EOF javac ListFonts.java java ListFonts </code></pre> </body> </html>
If you are pasting HTML you should use the paste button in the Wysiwyg Ludovic 2011/11/18 Jesse Hathaway <[email protected]>
Thomas Mortagne <thomas.mortagne@...> writes:
1. Does anyone have any ideas why this is failing?
What do you mean by failing and what result to you get exactly ?
These are the steps I made:
1. Paste the html into the edit window 2. Choose XWiki 2.0 from the Document Syntax Window 3. Choose OK to convert document. 4. Then I receive the following error:
Failed to convert to the selected syntax. If you want to use this syntax anyway, you can select it again and choose not to perform the conversion.
This is the document I pasted
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="pandoc" /> <title></title> </head> <body> <h3 id="fonts-in-java">Fonts in Java</h3> <p>Opentype fonts are not supported on Oracle JDK 1.6.0. You have to convert the font to a truetype font using fontforge. Java appears to use fontconfig to locate fonts. However it uses its own private copy, which often has bugs or features missing from your distro supplied version.</p> <p>Mac OS X and Linux process the fonts differently. Mac seems more forgiving of bad font metadata. As an example, for one particular font I had to tweak the meta data until the individual fonts, italic bold etc, appeared as one font in Linux, i.e. as a single family. They need to appear as a single family for Java to properly use differnt faces of a font, e.g. italic.</p> <h3 id="adding-fonts">Adding fonts</h3> <p>You can store the fonts in any of the font config search paths, including a per user directory:</p> <pre><code> cat > ~/.fonts.conf <<EOF <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <!-- Private font directory --> <dir>~/fonts</dir> </fontconfig> EOF </code></pre> <p><em>NOTE:</em> For the per user directory to work the <code>$HOME</code> environment variable must be set.</p> <h3 id="listing-available-fonts">Listing available fonts</h3> <p>Use the below java code to verify that a font has been made available in java:</p> <pre><code> cat > ListFonts.java <<EOF import java.awt.GraphicsEnvironment;
public class ListFonts { public static void main(String args[]){ GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment(); for(String font:e.getAvailableFontFamilyNames()){ System.out.println(font); } } } EOF javac ListFonts.java java ListFonts </code></pre> </body> </html>
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
Ludovic Dubost <ludovic@...> writes:
If you are pasting HTML you should use the paste button in the Wysiwyg
That does seem to work somewhat better, but it still formats incorrectly, for instance for the document below the numbering is incorrect. Thanks, Jesse <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="pandoc" /> <title></title> </head> <body> <h3 id="debian-kernel-compile">Debian Kernel Compile</h3> <ol style="list-style-type: decimal"> <li><p>Get build tools</p> <pre><code>sudo apt-get install kernel-package libncurses-dev fakeroot wget bzip2 </code></pre></li> <li><p>Build sarge kernel</p> <pre><code>apt-get -t sarge-backports install kernel-package ncurses-dev \ fakeroot wget bzip2 </code></pre></li> <li><p>Get source</p> <pre><code>cd /usr/src </code></pre></li> <li><p>If neeeded grab prepatch and/or snapshot</p> <pre><code>pre_patch_ver=2.6.27-rc7 wget http://www.kernel.org/pub/linux/kernel/v2.6/testing/patch-${pre_patch_ver}.bz2 snapshot_ver=2.6.27-rc7-git5 wget http://www.kernel.org/pub/linux/kernel/v2.6/snapshots/patch-${snapshot_ver}.bz2 </code></pre></li> <li><p>If using prepatch get base kernel for the previouse version of the kernel e.g. 2.6.20 not 2.6.20.4</p> <pre><code>cd /usr/src kernel_ver=2.6.38 wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-${kernel_ver}.tar.bz2 tar -xf /usr/src/linux-${kernel_ver}.tar.bz2 </code></pre></li> <li><p>Apply prepatch and/or snapshot</p></li> <li><p>dry run</p> <pre><code>cd linux-${kernel_ver} bzcat ../patch-${pre_patch_ver}.bz2|patch -p1 --dry-run bzcat ../patch-${snapshot_ver}.bz2|patch -p1 --dry-run </code></pre></li> <li><p>apply</p> <pre><code>cd linux-${kernel_ver} bzcat ../patch-${pre_patch_ver}.bz2|patch -p1 bzcat ../patch-${snapshot_ver}.bz2|patch -p1 </code></pre></li> <li><p>Configure kernel source based on previous kernel</p> <pre><code>cd /usr/src rm linux ln -s linux-${kernel_ver} linux cd linux cp /boot/config-$(uname -r) .config make oldconfig </code></pre></li> <li><p>Compile</p> <pre><code>cd /usr/src/linux make-kpkg clean make-kpkg --revision 1 --append_to_version "-$(date +%G%m%d)" \ --initrd kernel_image kernel_headers </code></pre></li> <li><p>Install</p> <pre><code>dpkg -i ../linux-image-${kernel_ver}-$(date +%G%m%d)_1_i386.deb </code></pre></li> <li><p>modules compilation e.g.: madwifi</p> <pre><code>make-kpkg modules_clean make-kpkg --revision 1 --append_to_version "-$(date +%G%m%d)" --initrd --added-modules madwifi modules_image </code></pre></li> <li><p>alsa compilation</p> <pre><code>make-kpkg --revision 1 --append_to_version '-20040117 --initrd modules_image export ALSA_CARDS=emu10k1x make-kpkg --revision 1 --append_to_version '-20040117 --initrd modules_image MKIMAGE='genromfs -f /dev/fd/1 -d %s | gzip -9 > %s' MKIMAGE="genromfs -d %s -f %s" MKIMAGE='genromfs -d %s -f /boot/initrd.tmp.$$ > /dev/null; gzip -c -9 /boot/initrd.tmp.$$ > %s' MKIMAGE='genromfs -d %s -f /tmp/initrd.tmp.$$ > /dev/null; gzip -c -9 /tmp/initrd.tmp.$$ > %s; rm /tmp/initrd.tmp.$$' CONFIG_BLK_DEV_RAM=y (section "Block Devices") CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_RAM_SIZE=32768 (huge ram disk) CONFIG_ROMFS_FS=y (section "Filesystems") RAMDISK: incomplete write (-28 != 32768) 8388608 CONFIG_DEVFS NO </code></pre></li> </ol> </body> </html>
I believe this is because this specific html is not properly converted. The text between each numbered item is getting out of the list item, breaking the ordered list and therefore the numbering. This is coming from another wiki ? Which wiki is that and which syntax was it using ? Ludovic 2011/11/19 Jesse Hathaway <[email protected]>
Ludovic Dubost <ludovic@...> writes:
If you are pasting HTML you should use the paste button in the Wysiwyg
That does seem to work somewhat better, but it still formats incorrectly, for instance for the document below the numbering is incorrect.
Thanks, Jesse
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="pandoc" /> <title></title> </head> <body> <h3 id="debian-kernel-compile">Debian Kernel Compile</h3> <ol style="list-style-type: decimal"> <li><p>Get build tools</p> <pre><code>sudo apt-get install kernel-package libncurses-dev fakeroot wget bzip2 </code></pre></li> <li><p>Build sarge kernel</p> <pre><code>apt-get -t sarge-backports install kernel-package ncurses-dev \ fakeroot wget bzip2 </code></pre></li> <li><p>Get source</p> <pre><code>cd /usr/src </code></pre></li> <li><p>If neeeded grab prepatch and/or snapshot</p> <pre><code>pre_patch_ver=2.6.27-rc7 wget http://www.kernel.org/pub/linux/kernel/v2.6/testing/patch-${pre_patch_ver}.bz2
snapshot_ver=2.6.27-rc7-git5 wget http://www.kernel.org/pub/linux/kernel/v2.6/snapshots/patch-${snapshot_ver}.bz2 </code></pre></li> <li><p>If using prepatch get base kernel for the previouse version of the kernel e.g. 2.6.20 not 2.6.20.4</p> <pre><code>cd /usr/src kernel_ver=2.6.38 wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-${kernel_ver}.tar.bz2 tar -xf /usr/src/linux-${kernel_ver}.tar.bz2 </code></pre></li> <li><p>Apply prepatch and/or snapshot</p></li> <li><p>dry run</p> <pre><code>cd linux-${kernel_ver} bzcat ../patch-${pre_patch_ver}.bz2|patch -p1 --dry-run bzcat ../patch-${snapshot_ver}.bz2|patch -p1 --dry-run </code></pre></li> <li><p>apply</p> <pre><code>cd linux-${kernel_ver} bzcat ../patch-${pre_patch_ver}.bz2|patch -p1 bzcat ../patch-${snapshot_ver}.bz2|patch -p1 </code></pre></li> <li><p>Configure kernel source based on previous kernel</p> <pre><code>cd /usr/src rm linux ln -s linux-${kernel_ver} linux cd linux cp /boot/config-$(uname -r) .config make oldconfig </code></pre></li> <li><p>Compile</p> <pre><code>cd /usr/src/linux make-kpkg clean make-kpkg --revision 1 --append_to_version "-$(date +%G%m%d)" \ --initrd kernel_image kernel_headers </code></pre></li> <li><p>Install</p> <pre><code>dpkg -i ../linux-image-${kernel_ver}-$(date +%G%m%d)_1_i386.deb </code></pre></li> <li><p>modules compilation e.g.: madwifi</p> <pre><code>make-kpkg modules_clean make-kpkg --revision 1 --append_to_version "-$(date +%G%m%d)" --initrd --added-modules madwifi modules_image </code></pre></li> <li><p>alsa compilation</p> <pre><code>make-kpkg --revision 1 --append_to_version '-20040117 --initrd modules_image
export ALSA_CARDS=emu10k1x make-kpkg --revision 1 --append_to_version '-20040117 --initrd modules_image
MKIMAGE='genromfs -f /dev/fd/1 -d %s | gzip -9 > %s' MKIMAGE="genromfs -d %s -f %s" MKIMAGE='genromfs -d %s -f /boot/initrd.tmp.$$ > /dev/null; gzip -c -9 /boot/initrd.tmp.$$ > %s' MKIMAGE='genromfs -d %s -f /tmp/initrd.tmp.$$ > /dev/null; gzip -c -9 /tmp/initrd.tmp.$$ > %s; rm /tmp/initrd.tmp.$$'
CONFIG_BLK_DEV_RAM=y (section "Block Devices") CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_RAM_SIZE=32768 (huge ram disk)
CONFIG_ROMFS_FS=y (section "Filesystems")
RAMDISK: incomplete write (-28 != 32768) 8388608
CONFIG_DEVFS NO </code></pre></li> </ol> </body> </html>
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
There is however an XWiki syntax which gives slightly the same result as your html by using the ((( ))) around the sub-text of each list item 1. Get build tools ((( {{{sudo apt-get install kernel-package libncurses-dev fakeroot wget bzip2 }}} ))) 1. Build sarge kernel ((({{{apt-get -t sarge-backports install kernel-package ncurses-dev \ fakeroot wget bzip2 }}} ))) 1. Get source ((({{{cd /usr/src }}} ))) But it's clear the converter does not convert this specific html to that wiki syntax This could be reported as a bug in jira.xwiki.org Ludovic 2011/11/19 Ludovic Dubost <[email protected]>
I believe this is because this specific html is not properly converted. The text between each numbered item is getting out of the list item, breaking the ordered list and therefore the numbering.
This is coming from another wiki ? Which wiki is that and which syntax was it using ?
Ludovic
2011/11/19 Jesse Hathaway <[email protected]>
Ludovic Dubost <ludovic@...> writes:
If you are pasting HTML you should use the paste button in the Wysiwyg
That does seem to work somewhat better, but it still formats incorrectly, for instance for the document below the numbering is incorrect.
Thanks, Jesse
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="pandoc" /> <title></title> </head> <body> <h3 id="debian-kernel-compile">Debian Kernel Compile</h3> <ol style="list-style-type: decimal"> <li><p>Get build tools</p> <pre><code>sudo apt-get install kernel-package libncurses-dev fakeroot wget bzip2 </code></pre></li> <li><p>Build sarge kernel</p> <pre><code>apt-get -t sarge-backports install kernel-package ncurses-dev \ fakeroot wget bzip2 </code></pre></li> <li><p>Get source</p> <pre><code>cd /usr/src </code></pre></li> <li><p>If neeeded grab prepatch and/or snapshot</p> <pre><code>pre_patch_ver=2.6.27-rc7 wget http://www.kernel.org/pub/linux/kernel/v2.6/testing/patch-${pre_patch_ver}.bz2
snapshot_ver=2.6.27-rc7-git5 wget http://www.kernel.org/pub/linux/kernel/v2.6/snapshots/patch-${snapshot_ver}.bz2 </code></pre></li> <li><p>If using prepatch get base kernel for the previouse version of the kernel e.g. 2.6.20 not 2.6.20.4</p> <pre><code>cd /usr/src kernel_ver=2.6.38 wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-${kernel_ver}.tar.bz2 tar -xf /usr/src/linux-${kernel_ver}.tar.bz2 </code></pre></li> <li><p>Apply prepatch and/or snapshot</p></li> <li><p>dry run</p> <pre><code>cd linux-${kernel_ver} bzcat ../patch-${pre_patch_ver}.bz2|patch -p1 --dry-run bzcat ../patch-${snapshot_ver}.bz2|patch -p1 --dry-run </code></pre></li> <li><p>apply</p> <pre><code>cd linux-${kernel_ver} bzcat ../patch-${pre_patch_ver}.bz2|patch -p1 bzcat ../patch-${snapshot_ver}.bz2|patch -p1 </code></pre></li> <li><p>Configure kernel source based on previous kernel</p> <pre><code>cd /usr/src rm linux ln -s linux-${kernel_ver} linux cd linux cp /boot/config-$(uname -r) .config make oldconfig </code></pre></li> <li><p>Compile</p> <pre><code>cd /usr/src/linux make-kpkg clean make-kpkg --revision 1 --append_to_version "-$(date +%G%m%d)" \ --initrd kernel_image kernel_headers </code></pre></li> <li><p>Install</p> <pre><code>dpkg -i ../linux-image-${kernel_ver}-$(date +%G%m%d)_1_i386.deb </code></pre></li> <li><p>modules compilation e.g.: madwifi</p> <pre><code>make-kpkg modules_clean make-kpkg --revision 1 --append_to_version "-$(date +%G%m%d)" --initrd --added-modules madwifi modules_image </code></pre></li> <li><p>alsa compilation</p> <pre><code>make-kpkg --revision 1 --append_to_version '-20040117 --initrd modules_image
export ALSA_CARDS=emu10k1x make-kpkg --revision 1 --append_to_version '-20040117 --initrd modules_image
MKIMAGE='genromfs -f /dev/fd/1 -d %s | gzip -9 > %s' MKIMAGE="genromfs -d %s -f %s" MKIMAGE='genromfs -d %s -f /boot/initrd.tmp.$$ > /dev/null; gzip -c -9 /boot/initrd.tmp.$$ > %s' MKIMAGE='genromfs -d %s -f /tmp/initrd.tmp.$$ > /dev/null; gzip -c -9 /tmp/initrd.tmp.$$ > %s; rm /tmp/initrd.tmp.$$'
CONFIG_BLK_DEV_RAM=y (section "Block Devices") CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_RAM_SIZE=32768 (huge ram disk)
CONFIG_ROMFS_FS=y (section "Filesystems")
RAMDISK: incomplete write (-28 != 32768) 8388608
CONFIG_DEVFS NO </code></pre></li> </ol> </body> </html>
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
-- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
Hi Jesse, Here's what I did: * Edited WEB-INF/xwiki.cfg to add xhtml/1.0 to the list of syntaxes * Restarted my wiki * Edited a page in wiki mode, set the page syntax to be XHTML/1.0 * Pasted your content and saved it (See http://platform.xwiki.org/xwiki/bin/view/Features/PageEditing#HChoosingaSynt... ) It gave me https://skitch.com/e-vmassol/gjh3s/sandbox-sandbox.webhome-xwiki which looks good. Note that even though your HTML is valid, the headings should be H1 instead of H3 since there's no H1 nor H2 in your doc. This is why they appear smaller than they should in the rendered result. Thanks -Vincent On Nov 18, 2011, at 9:02 PM, Jesse Hathaway wrote:
Thomas Mortagne <thomas.mortagne@...> writes:
1. Does anyone have any ideas why this is failing?
What do you mean by failing and what result to you get exactly ?
These are the steps I made:
1. Paste the html into the edit window 2. Choose XWiki 2.0 from the Document Syntax Window 3. Choose OK to convert document. 4. Then I receive the following error:
Failed to convert to the selected syntax. If you want to use this syntax anyway, you can select it again and choose not to perform the conversion.
This is the document I pasted
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="pandoc" /> <title></title> </head> <body> <h3 id="fonts-in-java">Fonts in Java</h3> <p>Opentype fonts are not supported on Oracle JDK 1.6.0. You have to convert the font to a truetype font using fontforge. Java appears to use fontconfig to locate fonts. However it uses its own private copy, which often has bugs or features missing from your distro supplied version.</p> <p>Mac OS X and Linux process the fonts differently. Mac seems more forgiving of bad font metadata. As an example, for one particular font I had to tweak the meta data until the individual fonts, italic bold etc, appeared as one font in Linux, i.e. as a single family. They need to appear as a single family for Java to properly use differnt faces of a font, e.g. italic.</p> <h3 id="adding-fonts">Adding fonts</h3> <p>You can store the fonts in any of the font config search paths, including a per user directory:</p> <pre><code> cat > ~/.fonts.conf <<EOF <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <!-- Private font directory --> <dir>~/fonts</dir> </fontconfig> EOF </code></pre> <p><em>NOTE:</em> For the per user directory to work the <code>$HOME</code> environment variable must be set.</p> <h3 id="listing-available-fonts">Listing available fonts</h3> <p>Use the below java code to verify that a font has been made available in java:</p> <pre><code> cat > ListFonts.java <<EOF import java.awt.GraphicsEnvironment;
public class ListFonts { public static void main(String args[]){ GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment(); for(String font:e.getAvailableFontFamilyNames()){ System.out.println(font); } } } EOF javac ListFonts.java java ListFonts </code></pre> </body> </html>
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
On Nov 19, 2011, at 8:59 AM, Vincent Massol wrote:
Hi Jesse,
Here's what I did:
* Edited WEB-INF/xwiki.cfg to add xhtml/1.0 to the list of syntaxes * Restarted my wiki * Edited a page in wiki mode, set the page syntax to be XHTML/1.0 * Pasted your content and saved it
(See http://platform.xwiki.org/xwiki/bin/view/Features/PageEditing#HChoosingaSynt... )
It gave me https://skitch.com/e-vmassol/gjh3s/sandbox-sandbox.webhome-xwiki
Hmm however you're right there's a bug. When I tried to convert the page to XWiki Syntax 2.0 I got an error. Please report it in http://jira.xwiki.org Thanks -Vincent
which looks good.
Note that even though your HTML is valid, the headings should be H1 instead of H3 since there's no H1 nor H2 in your doc. This is why they appear smaller than they should in the rendered result.
Thanks -Vincent
On Nov 18, 2011, at 9:02 PM, Jesse Hathaway wrote:
Thomas Mortagne <thomas.mortagne@...> writes:
1. Does anyone have any ideas why this is failing?
What do you mean by failing and what result to you get exactly ?
These are the steps I made:
1. Paste the html into the edit window 2. Choose XWiki 2.0 from the Document Syntax Window 3. Choose OK to convert document. 4. Then I receive the following error:
Failed to convert to the selected syntax. If you want to use this syntax anyway, you can select it again and choose not to perform the conversion.
This is the document I pasted
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="pandoc" /> <title></title> </head> <body> <h3 id="fonts-in-java">Fonts in Java</h3> <p>Opentype fonts are not supported on Oracle JDK 1.6.0. You have to convert the font to a truetype font using fontforge. Java appears to use fontconfig to locate fonts. However it uses its own private copy, which often has bugs or features missing from your distro supplied version.</p> <p>Mac OS X and Linux process the fonts differently. Mac seems more forgiving of bad font metadata. As an example, for one particular font I had to tweak the meta data until the individual fonts, italic bold etc, appeared as one font in Linux, i.e. as a single family. They need to appear as a single family for Java to properly use differnt faces of a font, e.g. italic.</p> <h3 id="adding-fonts">Adding fonts</h3> <p>You can store the fonts in any of the font config search paths, including a per user directory:</p> <pre><code> cat > ~/.fonts.conf <<EOF <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <!-- Private font directory --> <dir>~/fonts</dir> </fontconfig> EOF </code></pre> <p><em>NOTE:</em> For the per user directory to work the <code>$HOME</code> environment variable must be set.</p> <h3 id="listing-available-fonts">Listing available fonts</h3> <p>Use the below java code to verify that a font has been made available in java:</p> <pre><code> cat > ListFonts.java <<EOF import java.awt.GraphicsEnvironment;
public class ListFonts { public static void main(String args[]){ GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment(); for(String font:e.getAvailableFontFamilyNames()){ System.out.println(font); } } } EOF javac ListFonts.java java ListFonts </code></pre> </body> </html>
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Ludovic Dubost <ludovic@...> writes:
But it's clear the converter does not convert this specific html to that wiki syntax This could be reported as a bug in jira.xwiki.org
done, http://jira.xwiki.org/browse/XRENDERING-160 Thanks, Jesse
Ludovic Dubost <ludovic@...> writes:
I believe this is because this specific html is not properly converted. The text between each numbered item is getting out of the list item, breaking the ordered list and therefore the numbering.
This is coming from another wiki ? Which wiki is that and which syntax was it using ?
I am moving from ikiwiki, these pages where in Markdown syntax which I converted to xhtml using pandoc, http://johnmacfarlane.net/pandoc/ -Jesse
I see, it seems markdown has a interesting way of expressing the syntax for numbered lists:
From the sample they have (http://daringfireball.net/projects/markdown/) This for example
1. Copy the "Markdown.pl" file into your Movable Type "plugins" directory. The "plugins" directory should be in the same directory as "mt.cgi"; if the "plugins" directory doesn't already exist, use your FTP program to create it. Your installation should look like this: (mt home)/plugins/Markdown.pl 2. Once installed, Markdown will appear as an option in Movable Type's Text Formatting pop-up menu. This is selectable on a per-post basis: ![Screenshot of Movable Type 'Text Formatting' Menu][tfmenu] Markdown translates your posts to HTML when you publish; the posts themselves are stored in your MT database in Markdown format. In XWiki's case we would have to embed the content of the list into ((( ))) to make sure the ordered lists continues Our XHTML converter would have to support this Ludovic 2011/11/21 Jesse Hathaway <[email protected]>
Ludovic Dubost <ludovic@...> writes:
I believe this is because this specific html is not properly converted. The text between each numbered item is getting out of the list item, breaking the ordered list and therefore the numbering.
This is coming from another wiki ? Which wiki is that and which syntax
was
it using ?
I am moving from ikiwiki, these pages where in Markdown syntax which I converted to xhtml using pandoc, http://johnmacfarlane.net/pandoc/
-Jesse
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
2011/11/21 Ludovic Dubost <[email protected]>
I see, it seems markdown has a interesting way of expressing the syntax for numbered lists:
From the sample they have (http://daringfireball.net/projects/markdown/) This for example
1. Copy the "Markdown.pl" file into your Movable Type "plugins" directory. The "plugins" directory should be in the same directory as "mt.cgi"; if the "plugins" directory doesn't already exist, use your FTP program to create it. Your installation should look like this:
(mt home)/plugins/Markdown.pl
2. Once installed, Markdown will appear as an option in Movable Type's Text Formatting pop-up menu. This is selectable on a per-post basis:
![Screenshot of Movable Type 'Text Formatting' Menu][tfmenu]
Markdown translates your posts to HTML when you publish; the posts themselves are stored in your MT database in Markdown format.
I forgot to say that the syntax here is converted into an ordered list will all the content being inside the list item.
In XWiki's case we would have to embed the content of the list into ((( ))) to make sure the ordered lists continues Our XHTML converter would have to support this
Ludovic
2011/11/21 Jesse Hathaway <[email protected]>
Ludovic Dubost <ludovic@...> writes:
I believe this is because this specific html is not properly converted. The text between each numbered item is getting out of the list item, breaking the ordered list and therefore the numbering.
This is coming from another wiki ? Which wiki is that and which syntax
was
it using ?
I am moving from ikiwiki, these pages where in Markdown syntax which I converted to xhtml using pandoc, http://johnmacfarlane.net/pandoc/
-Jesse
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
-- Ludovic Dubost Founder and CEO Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
participants (4)
-
Jesse Hathaway -
Ludovic Dubost -
Thomas Mortagne -
Vincent Massol