Sorry for asking again. Maybe the answer is very simple, but I could not
find it.
*(a) What is the right way to apply a css class to a markmin text?*

I have found
``
text
``:css_class

but this construct seems to stop the oembed protocol (see the 2nd example
below).

*(b) I want to call the function vimeo (see below) in a markmin text - how?*

I have tried all proposals. This is my code:

*In the models:*

def vimeo(code, width=400, height=250):
    """
    ## Embeds a vimeo video (by code)
    - ``code`` is the code of the video
    - ``width`` is the width you want the video to have
    - ``height`` is the height you want the video to have
    """
    return XML("""<iframe src="http://player.vimeo.com/video/%(code)s"
width="%(width)s" height="%(height)s" frameborder="0" webkitAllowFullScreen
mozallowfullscreen allowFullScreen></iframe>""" % dict(code=code,
width=width, height=height))


*A css class:*

.myclass {width:200px; }

*In the controller "default":*

def vimeo2():
    vimeo(8952354)


*The content of the wiki page:*

1st: website
http://vimeo.com/8952354

2nd ` :
``
http://vimeo.com/8952354
``:myclass

3rd -:
----
http://vimeo.com/8952354
----:myclass

4th :
{{=vimeo(8952354)}}

5th: Vimeo
<iframe src="http://player.vimeo.com/video/8952354"; width="400"
height="300" frameborder="0" ></iframe>

6th: @{:
@{component:///vimeo2}

7th: @:
@///vimeo2

*The results (the page view):* *My comments in green letters*

1st: website

*Here is the video, but it is to big. I want to have for example width=400*

2nd ` :
 http://vimeo.com/8952354  *Only this text, no video*

3rd -:

<iframe src="http://player.vimeo.com/video/8952354"; width="1280"
height="960" frameborder="0" webkitAllowFullScreen mozallowfullscreen
allowFullScreen></iframe>  *Only this text, no video*

4th : {{=vimeo(8952354)}}  *Only this text, no video*

5th: @: http://127.0.0.1:8000/test2/default/wikiT/vimeo2*    A link, but no
video*

*No output from 6th, 7th*

auth.wiki is nice tool, but I think we need a little bit more information
how to handle special cases, e.g. how to substitute the plugin_wiki widgets.


Regards Martin




2012/9/21 Leonel Câmara <leonelcam...@gmail.com>

> To use css you just define styles normally in the css files you include in
> your view (probably layout or other parent view) or even, if you prefer, in
> a style tag, they may need to override the default ones and for this you
> have to consider the css precedence rules but a good rule of thumb is that
> the more specific you are with your css selectors the more it's likely that
> you'll get what you want.
>
> To be able to use the function I provided just put it somewhere in the
> model and you'll be able to call it from anywhere, although the css
> approach is certainly something you could/should try depending on what you
> want.
>
> Quinta-feira, 20 de Setembro de 2012 19:26:10 UTC+1, mweissen escreveu:
>>
>> > *Massimo*:
>> auth.wiki is great! I have copied http://vimeo.com/8952354 to a page.
>> Ok, it works fine, but the picture is bigger than the page and I have to
>> scroll. Therefore I want to adjust the width.
>>
>> Using CSS: sorry, I did not understand how to use CSS together with a
>> wiki page. Are there special classes?
>>
>> > *Leonel*:
>> Thank you this idea. But how can I call a function from a wiki page?
>>
>>  2012/9/20 Massimo Di Pierro <massimo....@gmail.com>
>>
>> You can still define your own extension but the the suggested behavior is
>>> designed to be more intuitive and leave the width and height size to the
>>> CSS.
>>>
>>>
>>> On Thursday, 20 September 2012 09:35:06 UTC-5, Leonel Câmara wrote:
>>>>
>>>> Well but it should be possible. Here's how it could be done
>>>>
>>>> def vimeo(code, width=400, height=250):
>>>>     """
>>>>     ## Embeds a vimeo video (by code)
>>>>      - ``code`` is the code of the video
>>>>     - ``width`` is the width you want the video to have
>>>>     - ``height`` is the height you want the video to have
>>>>     """
>>>>     return XML("""<iframe src="http://player.vimeo.com/**v**
>>>> ideo/%(code)s" width="%(width)s" height="%(height)s" frameborder="0"
>>>> webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>""" %
>>>> dict(code=code, width=width, height=height))
>>>>
>>>> Quinta-feira, 20 de Setembro de 2012 14:31:31 UTC+1, Massimo Di Pierro
>>>> escreveu:
>>>>>
>>>>> You simply cut and paste a link to the video in the text as below:
>>>>>
>>>>> http://vimeo.com/8952354
>>>>>
>>>>> You cannot choose width and height. Vimeo choses that for you.
>>>>>
>>>>> On Thursday, 20 September 2012 07:46:43 UTC-5, mweissen wrote:
>>>>>>
>>>>>> I want to embedd a vimeo video in a auth.wiki page.
>>>>>>
>>>>>> In the plugin_wiki I had to write for example
>>>>>>
>>>>>> *``*
>>>>>> *name: vimeo*
>>>>>> *code: 8952354 *
>>>>>> *width: 533*
>>>>>> *height: 400*
>>>>>> *``:widget*
>>>>>>
>>>>>> How can I do the same in auth.wiki?
>>>>>>
>>>>>> Regards, Martin
>>>>>>
>>>>>>
>>>   --
>
>
>

-- 



Reply via email to