Changes between Version 2 and Version 3 of HowToAddAttachmentToTicket


Ignore:
Timestamp:
Nov 21, 2016, 1:09:32 PM (8 years ago)
Author:
Alexander Kunin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HowToAddAttachmentToTicket

    v2 v3  
    11You can attach the file to a ticket or wiki page. Reference the file like so:
    22
    3 == Adding images ==
     3= Adding images =
     4
     5Urls ending with `.png`, `.gif` or `.jpg` are no longer automatically interpreted as image links, and converted to `<img>` tags.
     6
     7You now have to use the ![[Image]] macro. The simplest way to include an image is to upload it as attachment to the current page, and put the filename in a macro call like `[[Image(picture.gif)]]`.
     8
     9In addition to the current page, it is possible to refer to other resources:
     10 * `[[Image(wiki:WikiFormatting:picture.gif)]]` (referring to attachment on another page)
     11 * `[[Image(ticket:1:picture.gif)]]` (file attached to a ticket)
     12 * `[[Image(htdocs:picture.gif)]]` (referring to a file inside the [TracEnvironment environment] `htdocs` directory)
     13 * `[[Image(source:/trunk/trac/htdocs/trac_logo_mini.png)]]` (a file in repository)
     14
     15||= Wiki Markup =||= Display =||
     16{{{#!td
     17  {{{
     18  [[Image(htdocs:../common/trac_logo_mini.png)]]
     19  }}}
     20}}}
     21{{{#!td
     22[[Image(htdocs:../common/trac_logo_mini.png)]]
     23}}}
     24
     25Embed an image in wiki-formatted text.
     26
     27The first argument is the file specification. The file specification may reference attachments in three ways:
     28
     29* {{{module:id:file}}}, where module can be either wiki or ticket, to refer to the attachment named file of the specified wiki page or ticket.
     30* {{{id:file}}}: same as above, but id is either a ticket shorthand or a Wiki page name.
     31* {{{file}}} to refer to a local attachment named 'file'. This only works from within that wiki page or a ticket.
     32Also, the file specification may refer to repository files, using the {{{source:file}}} syntax (source:file@rev works also).
     33
     34Files can also be accessed with a direct URLs; {{{/file}}} for a project-relative, {{{//file}}} for a server-relative, or {{{http://server/file}}} for absolute location of the file. The ​rfc2397 data URL scheme is also supported if the URL is enclosed in quotes.
     35
     36The remaining arguments are optional and allow configuring the attributes and style of the rendered {{{<img>}}} element:
     37
     38* digits and unit are interpreted as the size (ex. 120px, 25%) for the image
     39{{{right}}}, {{{left}}}, {{{center}}}, {{{top}}}, {{{bottom}}} and {{{middle}}} are interpreted as the alignment for the image (alternatively, the first three can be specified using {{{align=...}}} and the last three using {{{valign=...}}})
     40* {{{link=some TracLinks...}}} replaces the link to the image source by the one specified using a TracLinks. If no value is specified, the link is simply removed.
     41* {{{inline}}} specifies that the content generated be an inline XHTML element. By default, inline content is not generated, therefore images won't be rendered in section headings and other one-line content.
     42* {{{nolink}}} means without link to image source (deprecated, use {{{link=}}})
     43* {{{key=value}}} style are interpreted as HTML attributes or CSS style indications for the image. Valid keys are:
     44 * align, valign, border, width, height, alt, title, longdesc, class, margin, margin-(left,right,top,bottom), id and usemap
     45 * {{{border}}}, {{{margin}}}, and {{{margin-}}}* can only be a single number (units are pixels).
     46 * {{{margin}}} is superseded by {{{center}}} which uses auto margins
     47
     48Examples:
     49{{{
     50[[Image(photo.jpg)]]               # simplest
     51[[Image(photo.jpg, 120px)]]        # with image width size
     52[[Image(photo.jpg, right)]]        # aligned by keyword
     53[[Image(photo.jpg, nolink)]]       # without link to source
     54[[Image(photo.jpg, align=right)]]  # aligned by attribute
     55}}}
     56You can use an image from a wiki page, ticket or other module.
     57{{{
     58[[Image(OtherPage:foo.bmp)]]    # from a wiki page
     59[[Image(base/sub:bar.bmp)]]     # from hierarchical wiki page
     60[[Image(#3:baz.bmp)]]           # from another ticket
     61[[Image(ticket:36:boo.jpg)]]    # from another ticket (long form)
     62[[Image(source:/img/bee.jpg)]]  # from the repository
     63[[Image(htdocs:foo/bar.png)]]   # from project htdocs dir
     64[[Image(shared:foo/bar.png)]]   # from shared htdocs dir (since 1.0.2)
     65}}}
    466
    567
    6 == Adding movie files ==
     68= Adding movie files =
    769
    8 === Simple form if an attachment is in the ticket/wiki===
     70== Simple form if an attachment is in the ticket/wiki==
    971{{{
    1072[[Movie(sample.webm)]]
     
    1880}}}
    1981
    20 === Embed youtube video ===
     82== Embed youtube video ==
    2183{{{
    2284[[Moviehttps://www.youtube.com/watch?v=qRsLg6ZOd58&start=44&rel=0,style=width:320px;%20height:240px;)]]
     
    2486The player's parameter can be passed as a query string. See also: ​https://developers.google.com/youtube/player_parameters
    2587
    26 === Embed metacafe video ===
     88== Embed metacafe video ==
    2789{{{
    2890[[Movie(http://www.metacafe.com/watch/1768855/the_size_of_all_planets_are_relative/)]]
    2991}}}
    3092
    31 === Embed vimeo video ===
     93== Embed vimeo video ==
    3294{{{
    3395[[Movie(http://vimeo.com/106808835)]]