Book/HelloXenProject/Instructions for Improvement: Difference between revisions
From Xen
Jump to navigationJump to search
Lars.kurth (talk | contribs) No edit summary |
Lars.kurth (talk | contribs) No edit summary |
||
Line 41: | Line 41: | ||
</pre> |
</pre> |
||
* Go to [[Book/HelloXenProject/0-Credits_and_Title#Subsequent_Contributions|Subsequent_Contributions]] and add yourself as a contributor |
* Go to [[Book/HelloXenProject/0-Credits_and_Title#Subsequent_Contributions|Subsequent_Contributions]] and add yourself as a contributor |
||
=== Adding images === |
|||
This is the hardest part: |
|||
* Save the chapter that you want to add as html using File.Send.Create HTML Document : this will save all images in the directory where you save it |
|||
* Then open the chapter from the original and rename the saved images to (X-Y.EXT) with X being the chapter number, Y being the image or figure number and EXT being the file extension (e.g. jpg) |
|||
* Be careful you number the images in the right order |
|||
* Then find all instances of <pre>Image:XXX.png</pre> and replace with the relevant <pre>Image:HelloXenProject-X-Y.EXT.png</pre> and save |
|||
* Now you click on each of the links and upload X-Y.EXT.png |
|||
* Done |
|||
[[Category:Users]] [[Category:HelloXenProjectBook]] |
[[Category:Users]] [[Category:HelloXenProjectBook]] |
Revision as of 17:32, 12 April 2017
Prerequisites
- Install a Linux distribution which contains LibreOffice's MediaWiki export function (e.g. openSUSE, Fedora, some versions of Debian)
- Download the the attachment from [1]
Workflow
Chose the chapter that you want to convert. You can do this in one of two ways
- Convert the entire document and delete the portions of the generated mark-up that are not part of the chapter you want to add
- Use the Working with Master Documents and Subdocuments to split the document into subsections
- Run the generated markup through www.unit-conversion.info/texttools/strip-tag or similar, otherwise the markup will contain unnecessary html
- Fix up the mark-up (see below)
- Add images (see below)
- Repeat and rinse until correct
Preparing the generated markup
Before you create the page, copy the chapter into your favourite editor. I observed that several things tend to go wrong
- Some of the bulleting does not get converted correctly: you may find special characters being created such as "•" and "• " (sometimes in different sizes). You may need to replace "•" with "* ", etc.
- Tables tend to be generated poorly, but ultimately they are OK. If you want them to look pretty, remove any style="..." elements (you can use replace the style strong with "") and make sure table headers start with "!". In addition you may want to add have the table begin with
{| class="prettytable"
- Special characters such as ticks or crosses get to converted wrongly: they will end up as "x". You will have to fix these up manually. Check out [2] for suggestions
- Images tend to get generated as
[[Image:|top]] ==== Figure 2: ... ====
To fix this you can use search and replace to get something like
[[Image:|top|Figure 2: ... ]]
After that, replace "[[Image:|top|" with "[[Image:XXX.png|600px|none|thumb|" - this ensures that images are the same size and you can search for XXX.png
- Headlines do not always come across correctly. You may need to do some editing there.
- At the bottom of the page, add
[[Category:Users]] [[Category:HelloXenProjectBook]]
Creating the page
If you add chapter X, then create a page called
Book/HelloXenProject/X-Chapter
and copy the content in- Go to preview and check how it looks
- Fix up any remaining issues
- Then save
- Go to Book/HelloXenProject/0-Contents and add the chapter. This will look something like
[[Book/HelloXenProject/X-Chapter|Chapter title]]<br>
- Go to Subsequent_Contributions and add yourself as a contributor
Adding images
This is the hardest part:
- Save the chapter that you want to add as html using File.Send.Create HTML Document : this will save all images in the directory where you save it
- Then open the chapter from the original and rename the saved images to (X-Y.EXT) with X being the chapter number, Y being the image or figure number and EXT being the file extension (e.g. jpg)
- Be careful you number the images in the right order
- Then find all instances of
Image:XXX.png
and replace with the relevantImage:HelloXenProject-X-Y.EXT.png
and save - Now you click on each of the links and upload X-Y.EXT.png
- Done