github.com/jgarto/itcv@v0.0.0-20180826224514-4eea09c1aa0d/_vendor/src/golang.org/x/tools/present/doc.go (about) 1 // Copyright 2011 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 /* 6 The present file format 7 8 Present files have the following format. The first non-blank non-comment 9 line is the title, so the header looks like 10 11 Title of document 12 Subtitle of document 13 15:04 2 Jan 2006 14 Tags: foo, bar, baz 15 <blank line> 16 Author Name 17 Job title, Company 18 joe@example.com 19 http://url/ 20 @twitter_name 21 22 The subtitle, date, and tags lines are optional. 23 24 The date line may be written without a time: 25 2 Jan 2006 26 In this case, the time will be interpreted as 10am UTC on that date. 27 28 The tags line is a comma-separated list of tags that may be used to categorize 29 the document. 30 31 The author section may contain a mixture of text, twitter names, and links. 32 For slide presentations, only the plain text lines will be displayed on the 33 first slide. 34 35 Multiple presenters may be specified, separated by a blank line. 36 37 After that come slides/sections, each after a blank line: 38 39 * Title of slide or section (must have asterisk) 40 41 Some Text 42 43 ** Subsection 44 45 - bullets 46 - more bullets 47 - a bullet with 48 49 *** Sub-subsection 50 51 Some More text 52 53 Preformatted text 54 is indented (however you like) 55 56 Further Text, including invocations like: 57 58 .code x.go /^func main/,/^}/ 59 .play y.go 60 .image image.jpg 61 .background image.jpg 62 .iframe http://foo 63 .link http://foo label 64 .html file.html 65 .caption _Gopher_ by [[https://www.instagram.com/reneefrench/][Renée French]] 66 67 Again, more text 68 69 Blank lines are OK (not mandatory) after the title and after the 70 text. Text, bullets, and .code etc. are all optional; title is 71 not. 72 73 Lines starting with # in column 1 are commentary. 74 75 Fonts: 76 77 Within the input for plain text or lists, text bracketed by font 78 markers will be presented in italic, bold, or program font. 79 Marker characters are _ (italic), * (bold) and ` (program font). 80 An opening marker must be preceded by a space or punctuation 81 character or else be at start of a line; similarly, a closing 82 marker must be followed by a space or punctuation character or 83 else be at the end of a line. Unmatched markers appear as plain text. 84 There must be no spaces between markers. Within marked text, 85 a single marker character becomes a space and a doubled single 86 marker quotes the marker character. 87 88 _italic_ 89 *bold* 90 `program` 91 Markup—_especially_italic_text_—can easily be overused. 92 _Why_use_scoped__ptr_? Use plain ***ptr* instead. 93 94 Inline links: 95 96 Links can be included in any text with the form [[url][label]], or 97 [[url]] to use the URL itself as the label. 98 99 Functions: 100 101 A number of template functions are available through invocations 102 in the input text. Each such invocation contains a period as the 103 first character on the line, followed immediately by the name of 104 the function, followed by any arguments. A typical invocation might 105 be 106 .play demo.go /^func show/,/^}/ 107 (except that the ".play" must be at the beginning of the line and 108 not be indented like this.) 109 110 Here follows a description of the functions: 111 112 code: 113 114 Injects program source into the output by extracting code from files 115 and injecting them as HTML-escaped <pre> blocks. The argument is 116 a file name followed by an optional address that specifies what 117 section of the file to display. The address syntax is similar in 118 its simplest form to that of ed, but comes from sam and is more 119 general. See 120 https://plan9.io/sys/doc/sam/sam.html Table II 121 for full details. The displayed block is always rounded out to a 122 full line at both ends. 123 124 If no pattern is present, the entire file is displayed. 125 126 Any line in the program that ends with the four characters 127 OMIT 128 is deleted from the source before inclusion, making it easy 129 to write things like 130 .code test.go /START OMIT/,/END OMIT/ 131 to find snippets like this 132 tedious_code = boring_function() 133 // START OMIT 134 interesting_code = fascinating_function() 135 // END OMIT 136 and see only this: 137 interesting_code = fascinating_function() 138 139 Also, inside the displayed text a line that ends 140 // HL 141 will be highlighted in the display; the 'h' key in the browser will 142 toggle extra emphasis of any highlighted lines. A highlighting mark 143 may have a suffix word, such as 144 // HLxxx 145 Such highlights are enabled only if the code invocation ends with 146 "HL" followed by the word: 147 .code test.go /^type Foo/,/^}/ HLxxx 148 149 The .code function may take one or more flags immediately preceding 150 the filename. This command shows test.go in an editable text area: 151 .code -edit test.go 152 This command shows test.go with line numbers: 153 .code -numbers test.go 154 155 play: 156 157 The function "play" is the same as "code" but puts a button 158 on the displayed source so the program can be run from the browser. 159 Although only the selected text is shown, all the source is included 160 in the HTML output so it can be presented to the compiler. 161 162 link: 163 164 Create a hyperlink. The syntax is 1 or 2 space-separated arguments. 165 The first argument is always the HTTP URL. If there is a second 166 argument, it is the text label to display for this link. 167 168 .link http://golang.org golang.org 169 170 image: 171 172 The template uses the function "image" to inject picture files. 173 174 The syntax is simple: 1 or 3 space-separated arguments. 175 The first argument is always the file name. 176 If there are more arguments, they are the height and width; 177 both must be present, or substituted with an underscore. 178 Replacing a dimension argument with the underscore parameter 179 preserves the aspect ratio of the image when scaling. 180 181 .image images/betsy.jpg 100 200 182 183 .image images/janet.jpg _ 300 184 185 video: 186 187 The template uses the function "video" to inject video files. 188 189 The syntax is simple: 2 or 4 space-separated arguments. 190 The first argument is always the file name. 191 The second argument is always the file content-type. 192 If there are more arguments, they are the height and width; 193 both must be present, or substituted with an underscore. 194 Replacing a dimension argument with the underscore parameter 195 preserves the aspect ratio of the video when scaling. 196 197 .video videos/evangeline.mp4 video/mp4 400 600 198 199 .video videos/mabel.ogg video/ogg 500 _ 200 201 background: 202 203 The template uses the function "background" to set the background image for 204 a slide. The only argument is the file name of the image. 205 206 .background images/susan.jpg 207 208 caption: 209 210 The template uses the function "caption" to inject figure captions. 211 212 The text after ".caption" is embedded in a figcaption element after 213 processing styling and links as in standard text lines. 214 215 .caption _Gopher_ by [[http://www.reneefrench.com][Renée French]] 216 217 iframe: 218 219 The function "iframe" injects iframes (pages inside pages). 220 Its syntax is the same as that of image. 221 222 html: 223 224 The function html includes the contents of the specified file as 225 unescaped HTML. This is useful for including custom HTML elements 226 that cannot be created using only the slide format. 227 It is your responsibilty to make sure the included HTML is valid and safe. 228 229 .html file.html 230 231 Presenter notes: 232 233 Presenter notes may be enabled by appending the "-notes" flag when you run 234 your "present" binary. 235 236 This will allow you to open a second window by pressing 'N' from your browser 237 displaying your slides. The second window is completely synced with your main 238 window, except that presenter notes are only visible on the second window. 239 240 Lines that begin with ": " are treated as presenter notes. 241 242 * Title of slide 243 244 Some Text 245 246 : Presenter notes (first paragraph) 247 : Presenter notes (subsequent paragraph(s)) 248 249 Notes may appear anywhere within the slide text. For example: 250 251 * Title of slide 252 253 : Presenter notes (first paragraph) 254 255 Some Text 256 257 : Presenter notes (subsequent paragraph(s)) 258 259 This has the same result as the example above. 260 261 */ 262 package present // import "golang.org/x/tools/present"