innoconv.ext.copy_static¶
Extension that copies static files.
Content can include figures, images and videos. Static files can be included
in a special folder named _static. The files will be copied to the
output directory automatically.
Translation¶
It’s possible to have language-specific versions of a static file.
For that to work you need to have a _static folder beneath the language
folder. Files in this folder will take precedence over the common
_static folder for that language.
Example: en/_static/example.png takes precedence over
_static/example.png in the English version.
Relative and absolute reference¶
Files can be referenced using relative or absolute paths.
Absolute paths are resolved to the root folder, either the common
(_static) or language-specific (en/_static) folder.
Relative paths are resolved to the root folder but have the chapters path fragment appended.
Example¶
This example shows how a reference to an image is resolved. The references
happen inside the section chapter01 in the English language version.
Type |
Resolution |
|---|---|
Relative |
|
Absolute |
|
-
class
innoconv.ext.copy_static.CopyStatic(*args, **kwargs)[source]¶ Bases:
innoconv.ext.abstract.AbstractExtensionCopy static files to the output folder.
This extension copies checks the AST for references to static files and copies them from the content source directory to the output directory.