~ubuntu-branches/ubuntu/natty/moin/natty-updates

« back to all changes in this revision

Viewing changes to wiki/underlay/pages/HelpOnMacros(2f)EmbedObject/revisions/00000001

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-22 21:17:13 UTC
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20080622211713-inlv5k4eifxckelr
ImportĀ upstreamĀ versionĀ 1.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
## Please edit system and help pages ONLY in the master wiki!
 
2
## For more information, please see MoinMoin:MoinDev/Translation.
 
3
##master-page:Unknown-Page
 
4
##master-date:Unknown-Date
 
5
#acl -All:write Default
 
6
#format wiki
 
7
#language en
 
8
 
 
9
<<Navigation(siblings)>>
 
10
<<BR>><<BR>>
 
11
<<TableOfContents>>
 
12
 
 
13
= EmbedObject =
 
14
This macro is used to Embed an Object into a wiki page-- objects being things usually handled by plug-ins, such as Flash, PDF, or movies. Optional size of the object could be adjusted. Further keywords are dependent on the kind of application.
 
15
 
 
16
If the attachment file isn't uploaded yet the attachment line will be shown.
 
17
 
 
18
(!) New in 1.6: MoinMoin has new (for some target types rather experimental) transclusion syntax like this: `{{target|desc|params}}`.
 
19
 
 
20
== Enabling EmbedObject ==
 
21
 
 
22
!EmbedObject is an included standard moin macro. However, for security reasons, mimetypes have to be specifically enabled in your wikiconfig.py to enable !EmbedObject.
 
23
 
 
24
 1. In your wikiconfig.py file, under the "Content options" section, add the following lines: {{{
 
25
    mimetypes_xss_protect = ['text/html', 'application/x-shockwave-flash', 'application/xhtml+xml',] 
 
26
 
 
27
    mimetypes_embed = ['application/x-dvi', 'application/postscript', 'application/pdf', 'application/ogg', 'application/vnd.visio', 'image/x-ms-bmp', 'image/svg+xml', 'image/tiff', 'image/x-photoshop', 'audio/mpeg', 'audio/midi', 'audio/x-wav', 'video/fli', 'video/mpeg', 'video/quicktime', 'video/x-msvideo', 'chemical/x-pdb', 'x-world/x-vrml',] 
 
28
}}}
 
29
 1. You should specifically add and/or remove content types from the {{{mimetypes_embed}}} to only those you need to use on your site. For example, if you need Flash, move the {{{'application/x-shockwave-flash'}}} from the {{{mimetypes_xss_protect}}} to the {{{mimetypes_embed}}} line.
 
30
 
 
31
''see related: HelpOnConfiguration ''
 
32
 
 
33
'''supported mimetypes:'''
 
34
 . application/x-shockwave-flash
 
35
 . application/x-dvi
 
36
 . application/postscript
 
37
 . application/pdf
 
38
 . application/ogg
 
39
 . application/vnd.visio 
 
40
 
 
41
 . image/x-ms-bmp
 
42
 . image/svg+xml
 
43
 . image/tiff
 
44
 . image/x-photoshop
 
45
 
 
46
 . audio/mpeg
 
47
 . audio/midi
 
48
 . audio/x-wav
 
49
                
 
50
 . video/fli
 
51
 . video/mpeg
 
52
 . video/quicktime
 
53
 . video/x-msvideo
 
54
                
 
55
 . chemical/x-pdb
 
56
 
 
57
 . x-world/x-vrml  
 
58
 
 
59
== Syntax & Usage ==
 
60
 
 
61
{{{
 
62
<<EmbedObject(attachment[,option][,option])>>
 
63
}}}
 
64
 
 
65
 
 
66
'''Keyword Parameters:'''
 
67
 
 
68
Dependent on the mimetype class a different set of keywords is used from the defaults:
 
69
 
 
70
{{{
 
71
  width = None, float
 
72
  height = None, float
 
73
  pagename = None, unicode
 
74
  align = middle
 
75
  alt = ''
 
76
  play = False
 
77
  loop = False
 
78
  quality = high
 
79
  op = True
 
80
  repeat = False
 
81
  autostart = False
 
82
  menu = True
 
83
  hidden = False
 
84
}}}
 
85
 
 
86
All mimetypes support width & height parameters.
 
87
 
 
88
(!) Since 1.7 MoinMoin supports parsing of units. Known units for the parameter width and height are px, em, pt, in, mm and %.
 
89
 
 
90
If you don't give a unit the default of px will be used.
 
91
 
 
92
Additionally:
 
93
 . {{{'video'}}} supports  {{{ repeat, autostart, menu, op }}}
 
94
 . {{{'audio'}}} supports  {{{ play, repeat, autostart, op, hidden }}}
 
95
  .        the default width is 60 and default height is 20
 
96
 . {{{'application'}}} supports {{{play, menu, autostart }}}
 
97
 
 
98
 
 
99
 
 
100
== Examples ==
 
101
 
 
102
Basic examples:
 
103
{{{
 
104
<<EmbedObject(example.swf)>>
 
105
<<EmbedObject(example.pdf)>>
 
106
<<EmbedObject(example.svg)>>
 
107
}}}
 
108
 
 
109
Realistic examples:
 
110
{{{
 
111
<<EmbedObject(testpdf.pdf,width=100%,height=600px)>>
 
112
<<EmbedObject(example.swf,width=637px,height=392px,play=true,loop=true)>>
 
113
}}}