Availability:Docs Title: Crumbs: Description: Keywords: Metadata is added at the top of the document with semi-colon's Title: Epic's Use of Markdown and Extensions to Syntax Crumbs:DocumentationGuidelines Description:How to create new documentation source files using Epic's custom Markdown extensions. DoIndex:false [TOC (start:2 end:3)] [REGION:note] **Note:** This document is itself written using Epic's Markdown; you can [see the source here](DocumentationGuidelines\SyntaxSource). [/REGION] ##Overview Epic's version of Markdown is based on [MarkdownSharp](http://code.google.com/p/markdownsharp/). MarkdownSharp was based on [Markdown](http://daringfireball.net/projects/markdown/) with some of the functionality from [PHP Markdown Extra](http://michelf.com/projects/php-markdown/). This document is intended to be a guide to the extensions made to support Epic's functionality and what specifically from Markdown Extra is being supported. This syntax guide is supplemental to the original [Markdown Syntax](http://daringfireball.net/projects/markdown/syntax). ## Epic's Functionality ### Auto generation of Table of Contents and Headings The header generation is altered to include a bookmark which will be the heading with spaces removed. To support multiple headers of same name subsequent headers will be appended with an index starting at 2. Generate a header list with correct indentation at the top of the document replacing the tag \[TOC\] By specifying \[TOC (start:HeadingStartLevel end:HeadingEndLevel)\] you can set the heading levels which will be included in the table of contents start and end are optional variables if missing then start is given a value of 1, end is given a value of 6. The end variable must follow start if both are set. If the first characters of a header are !! the header will not be included in the table of contents. #### Markdown Syntax #Heading [TOC(start:2)] #### HTML Output
Here is an example link to a heading within the file Auto generation of Table of Contents. The header text is linked to by removing spaces in the text. In addition if more than one header has the same name subsequent headers can be referenced by appending 2, 3 etc onto the name without spaces Markdown Syntax 1 Markdown Syntax 2 Markdown Syntax 3
Here is an example link to a user defined bookmark within the document Bookmark 1.
The bookmark text must be the first text on a line.
#### Results Here is an example link to a heading within the file [Auto generation of Table of Contents](#AutogenerationofTableofContents). The header text is linked to by removing spaces in the text. In addition if more than one header has the same name subsequent headers can be referenced by appending 2, 3 etc onto the name without spaces [Markdown Syntax 1](#MarkdownSyntax) [Markdown Syntax 2](#MarkdownSyntax2) [Markdown Syntax 3](#MarkdownSyntax3) Here is an example link to a user defined bookmark within the document [Bookmark 1](#Bookmark1). (#Bookmark1) The bookmark text must be the first text on a line. ### Linking to other pages in our documentation We link to other pages via relative links, if the document is in the root of the markdown folders we use \%ROOT\% to reference it. Languages are not specified in links, the assumption is that you will link to the file of the language you are currently viewing. #### Markdown Syntax [UE4 Home](\%ROOT\%) [Unreal Editor User Guide](Engine/UI) #### HTML Output UE4 Home Unreal Editor User Guide #### Results [UE4 Home](\%ROOT\%) [Unreal Editor User Guide](Engine/UI) ### Linking to local images We do not need to reference the image folder. We only need to reference other paths if the image belongs to another page in the documentation, languages are not specified in the links, we try to locate the image in the language folders image directory first then default to the INT image folder. #### Markdown Syntax   #### HTML Output
#### Results


### Image Alignment
It was desirable to have an ability to provide some formatting instructions for images and also how they would be converted.
* (w: h: a: convert: type: quality: fill: ) is used after image information to indicate:
* **w:** width
* **h:** height
* **a:** indicates the float style applied to the image with settings of left, right, and none
* **convert:** is either false or true, indicating whether an image should be compressed and/or converted to a differnt type
* **type:** can be one of jpg, png, gif
* **quality:** is the jpeg compression quality
* **fill:** is a #number indicating the background colour of an image if the format being convert to is jpg.
* The order of options is important, but each is optional and can be omitted, or the entire bracket style after the image information can be omitted.
* If the conversion parameters are missing then the default values in the app.config file will be used.
* Existing Markdown image inclusion methods Inline and Reference have both been extended to support the formatting.
* Floating an image to the left or right can have an undesired result that unrelated content can surround the image, for example when moving to a new section we would not want the headers to be positioned to the side of an unrelated image. This text is in a paragraph alongside the image. The style sheet elements are used to control when to clear float styles by specifying `clear: both;` currently headings of levels 1, 2 and hr elements will stop floating.
#### Markdown Syntax
This is the inline image with right (a:right) float specified, height and width have been left blank
This is the reference image ![Epic Logo][RefEpicLogo] with width, height, and left float.
[RefEpicLogo]: Logo_Epic-New.jpg "Here's a title"(w:50 h:50 a:left convert:true quality:75 fill:#000000)
This text is in a paragraph alongside the image. A special div element follows ending floating.
[REGION:clear]
[/REGION]
#### HTML Output
This is the inline image with right
float specified, height and width have been left blank.
This is the reference image
with width, height, and left float.
This text is in a paragraph alongside the image. A special div element follows ending floating.
[REGION:clear] [/REGION] #### Results This is the inline image with right (a:right) float specified, height and width have been left blank. This is the reference image ![Epic Logo][RefEpicLogo] with width, height, and left float. [RefEpicLogo]: Logo_Epic-New.jpg "Here's a title"(w:50 h:50 a:left convert:true quality:75 fill:#000000) This text is in a paragraph alongside the image. A special div element follows ending floating. [REGION:clear] [/REGION] ### Tables Tables are supported the formatting available in the syntax for MultiMarkdown was very flexible and chosen to provide the basis for Epic. * Colon's are used to indicate alignment of the tables data in a header row. * There can be pipes at the head and tail of lines, or they can be omitted. * Captions can be added. * Span columns are available. * Span rows are supported by using the ^ symbol in a cell #### Markdown Syntax [Table 1 - Headers to top] | | Grouping || First Header | Second Header | Third Header | ------------ | :------------: | ------------: | Content | *Long Cell* || Content | **Cell** | Cell | New section | More | Data | ^ | And more || ------------ | :------------: | ------------: | Content | *Long Cell* || Content | **Cell** | Cell | New section | More | Data | ^ | And more || [Table 2 - Headers to the right] | ------------ | :------------: | ------------: | | Content | *Long Cell* || | Content | **Cell** | Cell | | New section | More | Data | | ^ | And more || #### HTML Output| Grouping | ||
|---|---|---|
| First Header | Second Header | Third Header |
| Content | Long Cell | |
| Content | Cell | Cell |
| New section | More | Data |
| And more | ||
| Content | Long Cell | |
|---|---|---|
| Content | Cell | Cell |
| New section | More | Data |
| And more | ||
Code fenced by 3 or more ~ characters
#### Results
~~~
Code fenced by 3 or more ~ characters
~~~
### Regions
Regions are are basically areas that can have a style applied, i.e. a div in HTML. You can specify a region using this syntax:
[REGION:stylename]
...
[/REGION]
In HTML generation, this will be converted to: