Difference between revisions of "API:bin/generate static"

From EPrints Documentation
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
<!-- Pod2Wiki=_preamble_  
 
<!-- Pod2Wiki=_preamble_  
 
This page has been automatically generated from the EPrints 3.2 source. Any wiki changes made between the 'Pod2Wiki=*' and 'Edit below this comment' comments will be lost.
 
This page has been automatically generated from the EPrints 3.2 source. Any wiki changes made between the 'Pod2Wiki=*' and 'Edit below this comment' comments will be lost.
  -->{{API}}{{Pod2Wiki}}{{API:Source|file=bin/generate_static.pm|package_name=bin/generate_static}}[[Category:API|BIN/GENERATE_STATIC]][[Category:API:bin/generate_static|BIN/GENERATE_STATIC]][[Category:API:bin/generate_static|BIN/GENERATE_STATIC]]<div><!-- Edit below this comment -->
+
  -->{{API}}{{Pod2Wiki}}{{API:Source|file=bin/generate_static|package_name=bin/generate_static}}[[Category:API|BIN/GENERATE_STATIC]][[Category:API:bin/generate_static|BIN/GENERATE_STATIC]][[Category:API:bin/generate_static|BIN/GENERATE_STATIC]]<div><!-- Edit below this comment -->
  
  
Line 8: Line 8:
 
'''generate_static''' - Generate static pages of an EPrint repository using the template.
 
'''generate_static''' - Generate static pages of an EPrint repository using the template.
  
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<span style='display:none'>User Comments</span>
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
 
 
<!-- Pod2Wiki=head_synopsis -->
 
<!-- Pod2Wiki=head_synopsis -->
 
==SYNOPSIS==
 
==SYNOPSIS==
 
'''generate_static''' <em>repository_id</em> ['''options''']  
 
'''generate_static''' <em>repository_id</em> ['''options''']  
  
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<span style='display:none'>User Comments</span>
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
 
 
<!-- Pod2Wiki=head_description -->
 
<!-- Pod2Wiki=head_description -->
 
==DESCRIPTION==
 
==DESCRIPTION==
Line 36: Line 30:
 
Files with a .xpage or .xhtml suffix are processed as they are copied.
 
Files with a .xpage or .xhtml suffix are processed as they are copied.
  
 +
<pre></pre>
  
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
* '''.xpage'''  
<span style='display:none'>User Comments</span>
+
: This is an XML file with the following structure:
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki= -->
 
</div>
 
<!-- Pod2Wiki=item_b_xpage -->
 
==='''.xpage''' ===
 
 
 
This is an XML file with the following structure:
 
  
&lt;?xml version="1.0" standalone="no" ?&gt;
+
<pre> &lt;?xml version="1.0" standalone="no" ?&gt;
 
  &lt;!DOCTYPE page SYSTEM "entities.dtd" &gt;
 
  &lt;!DOCTYPE page SYSTEM "entities.dtd" &gt;
 
  &lt;page&gt;
 
  &lt;page&gt;
Line 56: Line 42:
 
     &lt;p&gt;Some XHTML body&lt;/p&gt;&lt;p&gt;Which is &lt;b&gt;neat&lt;/b&gt;&lt;/p&gt;
 
     &lt;p&gt;Some XHTML body&lt;/p&gt;&lt;p&gt;Which is &lt;b&gt;neat&lt;/b&gt;&lt;/p&gt;
 
   &lt;/body&gt;
 
   &lt;/body&gt;
  &lt;/page&gt;
+
  &lt;/page&gt;</pre>
 
 
The resulting file will be a .html file (foo.xpage becomes foo.html). It will take the template for this repository and insert the title and body from the appropriate places.  It will also cause the the special EPrints entities to be converted as it is copied. See the main documentation.
 
  
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '>
+
: The resulting file will be a .html file (foo.xpage becomes foo.html). It will take the template for this repository and insert the title and body from the appropriate placesIt will also cause the the special EPrints entities to be converted as it is copied. See the main documentation.
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
  
 +
* '''.xhtml'''
 +
: This is a normal XHTML file but with the following XML header:
  
<!-- Pod2Wiki= -->
+
<pre> &lt;?xml version="1.0" standalone="no" ?&gt;
</div>
+
&lt;!DOCTYPE html SYSTEM "entities.dtd" &gt;</pre>
<!-- Pod2Wiki=item_b_xhtml -->
 
==='''.xhtml''' ===
 
  
This is a normal XHTML file but with the following XML header:
+
: This will cause the the HTML entities to be properly decoded. It will also be renamed to .html for example, foo.xhtml will become foo.html
  
&lt;?xml version="1.0" standalone="no" ?&gt;
+
<pre></pre>
&lt;!DOCTYPE html SYSTEM "entities.dtd" &gt;
 
 
 
This will cause the the HTML entities to be properly decoded. It will also be renamed to .html for example, foo.xhtml will become foo.html
 
  
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<span style='display:none'>User Comments</span>
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
 
 
<!-- Pod2Wiki=head_note_for_the_non_english_majority -->
 
<!-- Pod2Wiki=head_note_for_the_non_english_majority -->
 
==NOTE FOR THE NON-ENGLISH MAJORITY==
 
==NOTE FOR THE NON-ENGLISH MAJORITY==
 
If you are running EPrints in a language other than English then place the static files in a directory of your ISO language ID instead of '''en''', for example French is '''fr'''. The generic directory is for language neutral stuff. Which is extra handy if you want to run the site in more than one language. Also the entities file should be renamed from -en to -whatever eg. '''entities-fr.xml'''.
 
If you are running EPrints in a language other than English then place the static files in a directory of your ISO language ID instead of '''en''', for example French is '''fr'''. The generic directory is for language neutral stuff. Which is extra handy if you want to run the site in more than one language. Also the entities file should be renamed from -en to -whatever eg. '''entities-fr.xml'''.
  
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<span style='display:none'>User Comments</span>
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
 
 
<!-- Pod2Wiki=head_arguments -->
 
<!-- Pod2Wiki=head_arguments -->
 
==ARGUMENTS==
 
==ARGUMENTS==
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
* '''repository_id'''  
<span style='display:none'>User Comments</span>
+
: The ID of the eprint repository to use.
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki= -->
 
</div>
 
<!-- Pod2Wiki=item_b_repository_id -->
 
==='''repository_id''' ===
 
  
The ID of the eprint repository to use.
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<span style='display:none'>User Comments</span>
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
 
 
<!-- Pod2Wiki=head_options -->
 
<!-- Pod2Wiki=head_options -->
 
==OPTIONS==
 
==OPTIONS==
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
* '''--prune'''
<span style='display:none'>User Comments</span>
+
: Remove stray files from the website (eg. if something was removed from the static pages).
<!-- Edit below this comment -->
 
  
 +
* '''--help'''
 +
: Print a brief help message and exit.
  
<!-- Pod2Wiki= -->
+
* '''--man'''
</div>
+
: Print the full manual page and then exit.
<!-- Pod2Wiki=item_b_prune -->
 
==='''--prune'''===
 
 
 
Remove stray files from the website (eg. if something was removed from the static pages).
 
  
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
* '''--quiet'''
<span style='display:none'>User Comments</span>
+
: Be vewwy vewwy quiet. This option will supress all output unless an error occurs.
<!-- Edit below this comment -->
 
  
 +
* '''--verbose'''
 +
: Explain in detail what is going on. May be repeated for greater effect.
  
<!-- Pod2Wiki= -->
+
* '''--version'''
</div>
+
: Output version information and exit.
<!-- Pod2Wiki=item_b_help -->
 
==='''--help'''===
 
  
Print a brief help message and exit.
+
<pre></pre>
  
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<span style='display:none'>User Comments</span>
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_copyright -->
<!-- Pod2Wiki=item_b_man -->
+
==COPYRIGHT==
==='''--man'''===
+
Copyright 2000-2011 University of Southampton.
  
Print the full manual page and then exit.
+
This file is part of EPrints http://www.eprints.org/.
  
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
EPrints is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
  
 +
EPrints is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  
<!-- Pod2Wiki= -->
+
You should have received a copy of the GNU General Public License along with EPrints.  If not, see http://www.gnu.org/licenses/.
</div>
 
<!-- Pod2Wiki=item_b_quiet -->
 
==='''--quiet'''===
 
 
 
Be vewwy vewwy quiet. This option will supress all output unless an error occurs.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki= -->
 
</div>
 
<!-- Pod2Wiki=item_b_verbose -->
 
==='''--verbose'''===
 
  
Explain in detail what is going on. May be repeated for greater effect.
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<span style='display:none'>User Comments</span>
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=_postamble_ -->
<!-- Pod2Wiki=item_b_version -->
 
==='''--version'''===
 
 
 
Output version information and exit.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<span style='display:none'>User Comments</span>
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
 
 
<!-- Pod2Wiki= -->
 
</div>
 
<!-- Pod2Wiki=head_copyright -->
 
==COPYRIGHT==
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
 
 
<!-- Pod2Wiki= -->
 
</div>
 
<!-- Pod2Wiki=_postamble_ --><!-- Edit below this comment -->
 

Latest revision as of 09:57, 22 January 2013

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects


API: Core API

Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki


NAME

generate_static - Generate static pages of an EPrint repository using the template.


SYNOPSIS

generate_static repository_id [options]


DESCRIPTION

This script creates the static web site for EPrints (or, if you are running in multiple lanugages it generates the websites).

It processes every file in EPRINTS/archives/ARCHIVE/cfg/static/LANGID/. For each language processes all the files in /LANGID/ and /generic/ into EPRINTS/archives/ARCHIVE/html/LANGID. If that sounds confusing, don't worry, it's not that bad, just put your webpage outlines in static/en/ and your image files and the like in static/generic/ and run this script and see what happens.

Most files are copied into the target directory as is and directory structure is preserved.

Files with a .xpage or .xhtml suffix are processed as they are copied.


  • .xpage
This is an XML file with the following structure:
 <?xml version="1.0" standalone="no" ?>
 <!DOCTYPE page SYSTEM "entities.dtd" >
 <page>
   <title>This is the page title</title>
   <body>
     <p>Some XHTML body</p><p>Which is <b>neat</b></p>
   </body>
 </page>
The resulting file will be a .html file (foo.xpage becomes foo.html). It will take the template for this repository and insert the title and body from the appropriate places. It will also cause the the special EPrints entities to be converted as it is copied. See the main documentation.
  • .xhtml
This is a normal XHTML file but with the following XML header:
 <?xml version="1.0" standalone="no" ?>
 <!DOCTYPE html SYSTEM "entities.dtd" >
This will cause the the HTML entities to be properly decoded. It will also be renamed to .html for example, foo.xhtml will become foo.html


NOTE FOR THE NON-ENGLISH MAJORITY

If you are running EPrints in a language other than English then place the static files in a directory of your ISO language ID instead of en, for example French is fr. The generic directory is for language neutral stuff. Which is extra handy if you want to run the site in more than one language. Also the entities file should be renamed from -en to -whatever eg. entities-fr.xml.


ARGUMENTS

  • repository_id
The ID of the eprint repository to use.


OPTIONS

  • --prune
Remove stray files from the website (eg. if something was removed from the static pages).
  • --help
Print a brief help message and exit.
  • --man
Print the full manual page and then exit.
  • --quiet
Be vewwy vewwy quiet. This option will supress all output unless an error occurs.
  • --verbose
Explain in detail what is going on. May be repeated for greater effect.
  • --version
Output version information and exit.


COPYRIGHT

Copyright 2000-2011 University of Southampton.

This file is part of EPrints http://www.eprints.org/.

EPrints is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

EPrints is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with EPrints. If not, see http://www.gnu.org/licenses/.