Difference between revisions of "Manual Generation 3.0 Prince"

From Gramps
Jump to: navigation, search
(Added link to manual)
m (Sample)
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
==Sample==
 
==Sample==
[[Media:GRAMPS_3_3_Prince.pdf‎|Complete manual for GRAMPS 3.3]]
+
Download: [[Media:GRAMPS_3_3_Prince.pdf‎|complete offline manual for GRAMPS 3.3]] (8 MiB)
  
 
Converted with [http://www.princexml.com/ Prince] 8.0 beta 1, according to the workflow below. Line numbers start anew for each chapter.
 
Converted with [http://www.princexml.com/ Prince] 8.0 beta 1, according to the workflow below. Line numbers start anew for each chapter.
Line 19: Line 19:
 
##* To: <code><nowiki>\1</nowiki></code>
 
##* To: <code><nowiki>\1</nowiki></code>
 
## Regexp-replace:
 
## Regexp-replace:
##* From <code><nowiki>\(class="thumbinner"\) style="width:252px;"</nowiki></code>
+
##* From: <code><nowiki>\(class="thumbinner"\) style="width:252px;"</nowiki></code>
 
##* To: <code><nowiki>\1</nowiki></code>
 
##* To: <code><nowiki>\1</nowiki></code>
 
# Load the edited HTML in a browser, and then download it together with all images, for local browsing.
 
# Load the edited HTML in a browser, and then download it together with all images, for local browsing.
Line 175: Line 175:
 
     border-bottom: thin solid gray;
 
     border-bottom: thin solid gray;
 
     margin-bottom: 1em;
 
     margin-bottom: 1em;
 +
}
 +
 +
div.magnify, div.LanguageLinks, div.printfooter, #catlinks, #column-one {
 +
    display: none;
 
  }
 
  }
 
   
 
   

Revision as of 06:28, 4 November 2011

Sample

Download: complete offline manual for GRAMPS 3.3 (8 MiB)

Converted with Prince 8.0 beta 1, according to the workflow below. Line numbers start anew for each chapter.

Workflow

Proceed as follows for converting one chapter in the manual to PDF, two columns, A4, landscape, with full resolution images.

  1. Download the raw HTML of the chapter's wiki page.
  2. Edit the HTML:
    1. Replace:
      • From: src="/
      • To: src="http://www.gramps-project.org/
    2. Regexp-replace (EMACS syntax):
      • From: \(http://www.gramps-project.org/wiki/images/\)thumb/\([^/]*/[^/]*/[^/]*\)/[^"]*
      • To: \1\2
    3. Regexp-replace:
      • From: width="[0-9]*" height="[0-9]*" \(class="thumbimage"\)
      • To: \1
    4. Regexp-replace:
      • From: \(class="thumbinner"\) style="width:252px;"
      • To: \1
  3. Load the edited HTML in a browser, and then download it together with all images, for local browsing.
  4. Convert the modified web-page with images to PDF, using Prince XML and the CSS below.

CSS

/*

  CSS style sheet for Wikipedia articles.

  Written by Hakon Wium Lie March 2008.

  Modified by Felix E. Klee <felix.klee@inka.de> in 2011.

  This style sheet may be reused by anyone for any purpose.

  Here's an example of how to use the style sheet:

  prince --no-author-style -s http://www.princexml.com/howcome/2008/wikipedia/wiki2.css http://en.wikipedia.org/wiki/Winter_war -o foo.pdf

*/

@import url(http://www.princexml.com/fonts/gentium/index.css);

/* set headers and footers */

@page {
  size: a4 landscape;
  margin: 2cm;
  font: 11pt/1.3 "Gentium", serif;

  @top-right { 
    content: string(title);
    font-style: italic;
  }
  @top-left { 
    content: string(source);
    font-style: italic;
  }
  @bottom-center {
    content: counter(page);
    vertical-align: top;
    padding-top: 1em;
  }
}

#siteSub { string-set: source content() }

/* basic style settings*/

body {
  font: 10pt/1.3 "Gentium", serif;
  prince-linebreak-magic: auto; 
  prince-image-resolution: 500dpi;
  hyphens: auto;
  text-align: justify;
  columns: 2;
  column-gap: 1.5em;
/*
  columns: 3;
  column-gap: 1em;
*/
}

ul, ol, dl { text-align: left; hyphens: manual; }

h1, h2, h3, h4, h5, h6 { 
  line-height: 1.2;
  padding: 0;
  margin: 0.7em 0 0.2em; 
  font-weight: normal;
  text-align: left;
  page-break-after: avoid;
  clear: both;
}

a { text-decoration: none; color: inherit; }

p { padding: 0; margin: 0 }

blockquote p {
  font-size: 1em;
  font-style: italic;
}


/* text indentation */

p + p { text-indent: 1.5em }
div.thumb + p { text-indent: 1.5em }
h2 + div.thumb + p { text-indent: 0 }
h3 + div.thumb + p { text-indent: 0 }
h2 + div.thumb + div.thumb + p { text-indent: 0 }
h3 + div.thumb + div.thumb + p { text-indent: 0 }
h2 + dl + div.thumb + p { text-indent: 0 }
h3 + dl + div.thumb + p { text-indent: 0 }


div + div.thumb + p { text-indent: 0 }


#toc { display: none }


ul { 
  list-style-type: disc;
  margin-left: 1.3em;
}

/* put article heading on top of the page, spanning all columns */

h1.firstHeading { 
  float: top; 
  string-set: title content();
  padding-bottom: 0.2em;
  border-bottom: thin solid black;
  margin-bottom: 1em;
}


#footer { padding-top: 1em }
#footer ul { 
  list-style-type: none;
  margin-left: 0;
}

#footer li { display: inline }
#footer br { display: none ! important }
#privacy, #about, #disclaimer { display: none }

/* images */

.thumb, .thumbinner, img, .thumbcaption { 
  border: none; margin: 0; padding: 0;
  page-break-inside: avoid;
}

.thumb { 
  margin: 0.2em 0;
  float: prince-column-top-if-necessary; 
}

.thumb img {
  width: 100%;
  height: auto;
}

.thumbcaption { 
   background: #fff; 
   text-align: left; 
   font-style: italic;
   font-size: 1em;
   line-height: 1.2em;
   padding-bottom: 0.3em;
   border-bottom: thin solid gray;
   margin-bottom: 1em;
}

div.magnify, div.LanguageLinks, div.printfooter, #catlinks, #column-one {
    display: none;
}

div, img { max-width: 100% }

body {
  prince-image-resolution: 1000dpi;
}