{"id":1,"date":"2012-08-09T21:06:40","date_gmt":"2012-08-09T21:06:40","guid":{"rendered":"http:\/\/tregner.com\/flare-blog\/?p=1"},"modified":"2012-08-10T22:52:50","modified_gmt":"2012-08-10T22:52:50","slug":"flare-topics-part-1","status":"publish","type":"post","link":"https:\/\/tregner.com\/flare-blog\/flare-topics-part-1\/","title":{"rendered":"Flare Topics (part 1)"},"content":{"rendered":"<p>Topics in a Flare project are XML files. Here is the markup for a basic topic file in a Flare project:<\/p>\n<div class=\"CodeIndent\">\n<pre>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;html xmlns:MadCap=\"http:\/\/www.madcapsoftware.com\/Schemas\/MadCap.xsd\"&gt;\r\n    &lt;head&gt;\r\n        &lt;link href=\"Resources\/Stylesheets\/FlareAutomationBookStyles.css\" rel=\"stylesheet\" type=\"text\/css\" \/&gt;\r\n    &lt;\/head&gt;\r\n    &lt;body&gt;\r\n        &lt;h1&gt;Topic Title&lt;\/h1&gt;\r\n        &lt;p&gt;Delete this text and replace it with your own content.&lt;\/p&gt;\r\n    &lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<\/div>\n<p>The first line is called the XML declaration.<\/p>\n<div class=\"CodeIndent\">\n<pre>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;<\/pre>\n<\/div>\n<p>If you edit a Flare topic with the XML Editor in Flare, you can not change that declaration. But you can alter the declaration outside of the XML\u00a0Editor. For example, you can open the topic file with the Text Editor in Flare, delete the declaration, and save it. If you open the file with the XML\u00a0Editor again, Flare will recognize the file is no longer an XML document and offer to convert the document to XML\u00a0with a wizard.<\/p>\n<p>Following the declaration are XML elements.<\/p>\n<div class=\"CodeIndent\">\n<pre xml:space=\"preserve\">&lt;html xmlns:MadCap=\"http:\/\/www.madcapsoftware.com\/Schemas\/MadCap.xsd\"&gt;\r\n    &lt;head&gt;<\/pre>\n<\/div>\n<p>The root element in this document is named html. It contains two other elements (head and body) and a namespace (xmlns:MadCap=&#8221;http:\/\/www.madcapsoftware.com\/Schemas\/MadCap.xsd&#8221;).\u00a0These XML elements correspond to elements used in HTML and XHTML. But a Flare topic file in a project is an XML document. Therefore, the html, head, and body elements in the XML\u00a0document are XML\u00a0elements. The correspondence is purposeful. Topics in a Flare project are not HTML. But is possible to generate HTML output based on the topics in a Flare project.<\/p>\n<p>If you look at the structure information in the XML\u00a0Editor, you will notice head element is not included. There is a block for html which contains body. You can right-click the html block for a menu of actions you can take on the html element. These actions focus on adjusting the attributes for the html element. For example, you can add a class attribute. Flare determines which values are allowed for the class attribute through a stylesheet, CSS file. This is the case for all of the elements in the Flare topic. The class attribute of an element in a Flare topic should correspond to a style in a CSS. But if you change the value of the class attribute outside of the XML Editor to a value not defined in the CSS and open the file again in the XML Editor, Flare will respect the change. But you will not be able to set that particular value for another element in the file using the XML Editor unless you add a style to the CSS.<\/p>\n<p>The namespace in the html element refers to a MadCap Software schema document. The html element in a Flare topic file in a project should conform to that schema. The schema is an XSD file.<\/p>\n<p>If you want to make changes to the head element in a Flare topic from the Flare user interface, you can right-click a topic file in the Content Explorer and select Properties. Some of the actions you can take on this Properties screen involve the head element attributes and others involve the html element attributes. For example, you can also change the class for the html element from the Properties screen (Topic Properties &gt;\u00a0Topic Style Class). For the head element, you can add a title element from the Properties screen (Topic Properties &gt;\u00a0Topic Title).<\/p>\n<p>Flare provides an XML Editor, a Text Editor, and right-click behavior to open files with other programs. So you can easily find out what the effect of an action in Flare is by observing the changes in the XML\u00a0Editor and comparing those changes to the markup in the Text Editor.\u00a0Sometimes the interface gives hints. For example, you can insert a text box into a topic with the Insert &gt;\u00a0Text Box&#8230; menu item in the Classic view or the Insert &gt;\u00a0Text &gt;\u00a0Text Box button on the Ribbon view. The screen that appears makes it clear that text boxes in Flare are div elements. You can also see this in the structure blocks in the XML\u00a0Editor. On the Text Box screen, you can set items such as width. From the XML\u00a0Editor, you can also adjust the width through a floating drop-down or the right-click menu for the div block. But it may not be apparent that the width is stored in a style attribute for the div element until you view the markup in the Text Editor. Not every div is a text box.<\/p>\n<p>With a better understanding of topics in a Flare project, we can recognize how topics change when they are generated into an output. But firstly, let&#8217;s review the workflow to generate output such as a PDF or a help file. This is a broad overview.<\/p>\n<p>Source files are maintained in Flare projects. Source topics are XML\u00a0files. TOCs are XML files which organize topics. Targets define how to build a output such as a PDF. There is a TOC associated with every target. When you build a target, Flare creates an output structured according to the target&#8217;s associated TOC. Sometimes an output includes a file structure and files which correspond to the source project structure. HTML5 output is an example of this. HTML5 output can have a Content folder and a Project folder just like a Flare project. But the files inside those folders are different. For example, topic files in Flare projects are XML files but topic files in HTML5 output are HTML5 files.<\/p>\n<p>If you produce HTML5 output which includes this topic,the generated HTML5 topic may look like this:<\/p>\n<div class=\"CodeIndent\">\n<pre>&lt;!DOCTYPE html&gt;\r\n&lt;html xmlns:MadCap=\"http:\/\/www.madcapsoftware.com\/Schemas\/MadCap.xsd\" lang=\"en-us\" xml:lang=\"en-us\" class=\"no-feedback\" data-mc-search-type=\"Stem\" data-mc-help-system-file-name=\"Test_HTML5.xml\" data-mc-path-to-help-system=\"..\/\" data-mc-target-type=\"WebHelp2\" data-mc-runtime-file-type=\"Topic\" data-mc-preload-images=\"false\" data-mc-in-preview-mode=\"false\" data-mc-toc-path=\"\"&gt;\r\n    &lt;head&gt;\r\n        &lt;meta charset=\"utf-8\" \/&gt;\r\n        &lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=utf-8\" \/&gt;\r\n        &lt;link href=\"..\/Skins\/Default\/Stylesheets\/TextEffects.css\" rel=\"stylesheet\" type=\"text\/css\" \/&gt;\r\n        &lt;link href=\"..\/Skins\/Default\/Stylesheets\/Topic.css\" rel=\"stylesheet\" type=\"text\/css\" \/&gt;&lt;title&gt;Topic Title&lt;\/title&gt;\r\n        &lt;link href=\"Resources\/Stylesheets\/FlareAutomationBookStyles.css\" rel=\"stylesheet\" type=\"text\/css\" \/&gt;\r\n        &lt;script src=\"..\/Resources\/Scripts\/jquery.min.js\" type=\"text\/javascript\"&gt;\r\n        &lt;\/script&gt;\r\n        &lt;script src=\"..\/Resources\/Scripts\/plugins.min.js\" type=\"text\/javascript\"&gt;\r\n        &lt;\/script&gt;\r\n        &lt;script src=\"..\/Resources\/Scripts\/MadCapAll.js\" type=\"text\/javascript\"&gt;\r\n        &lt;\/script&gt;\r\n    &lt;\/head&gt;\r\n    &lt;body&gt;\r\n        &lt;h1&gt;Topic Title&lt;\/h1&gt;\r\n        &lt;p&gt;Delete this text and replace it with your own content.&lt;\/p&gt;\r\n    &lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<\/div>\n<p>The declaration at the top of a generated topic in HTML5 output is the declaration defined by the HTML5 standards in progress. For WebHelp output, the declarations at the top of the generated topics are one of the three options in the XHTML standard. If you produce WebHelp output which includes this topic, the generated XHTML 1.0 topic may look like this:<\/p>\n<div class=\"CodeIndent\">\n<pre>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Strict\/\/EN\" \"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-strict.dtd\"&gt;\r\n&lt;html xmlns:MadCap=\"http:\/\/www.madcapsoftware.com\/Schemas\/MadCap.xsd\" MadCap:tocPath=\"\" MadCap:InPreviewMode=\"false\" MadCap:PreloadImages=\"false\" MadCap:RuntimeFileType=\"Topic\" MadCap:TargetType=\"WebHelp\" lang=\"en-us\" xml:lang=\"en-us\" MadCap:PathToHelpSystem=\"..\/\" MadCap:HelpSystemFileName=\"Test_WebHelp.xml\" MadCap:SearchType=\"Stem\"&gt;\r\n    &lt;head&gt;\r\n        &lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=utf-8\" \/&gt;&lt;title&gt;Topic Title&lt;\/title&gt;\r\n        &lt;link href=\"Resources\/Stylesheets\/FlareAutomationBookStyles.css\" rel=\"stylesheet\" type=\"text\/css\" \/&gt;\r\n        &lt;script src=\"SkinSupport\/MadCapAll.js\" type=\"text\/javascript\"&gt;\r\n        &lt;\/script&gt;\r\n    &lt;\/head&gt;\r\n    &lt;body&gt;\r\n        &lt;h1&gt;Topic Title&lt;\/h1&gt;\r\n        &lt;p&gt;Delete this text and replace it with your own content.&lt;\/p&gt;\r\n        &lt;script type=\"text\/javascript\" src=\"SkinSupport\/MadCapBodyEnd.js\"&gt;\r\n        &lt;\/script&gt;\r\n    &lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<\/div>\n<p>If you produce WebHelp Mobile output which includes this topic, the generated XHTML\u00a0Mobile Profile 1.2 topic may look like this:<\/p>\n<div class=\"CodeIndent\">\n<pre>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;!DOCTYPE html PUBLIC \"-\/\/WAPFORUM\/\/DTD XHTML Mobile 1.2\/\/EN\" \"http:\/\/www.openmobilealliance.org\/tech\/DTD\/xhtml-mobile12.dtd\"&gt;\r\n&lt;html xmlns:MadCap=\"http:\/\/www.madcapsoftware.com\/Schemas\/MadCap.xsd\" MadCap:tocPath=\"\" MadCap:InPreviewMode=\"false\" MadCap:PreloadImages=\"false\" MadCap:RuntimeFileType=\"Topic\" MadCap:TargetType=\"WebHelpMobile\" lang=\"en-us\" xml:lang=\"en-us\" MadCap:PathToHelpSystem=\"..\/\" MadCap:HelpSystemFileName=\"Test_WebHelpMobile.xml\" MadCap:SearchType=\"Stem\"&gt;\r\n    &lt;head&gt;\r\n        &lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=utf-8\" \/&gt;\r\n        &lt;link href=\"..\/Resources\/Topic.css\" rel=\"stylesheet\" type=\"text\/css\" \/&gt;\r\n        &lt;link href=\"..\/Skins\/Default\/Stylesheets\/StackLayout.css\" rel=\"stylesheet\" type=\"text\/css\" \/&gt;\r\n        &lt;link href=\"..\/Skins\/Default\/Stylesheets\/Header.css\" rel=\"stylesheet\" type=\"text\/css\" \/&gt;&lt;title&gt;Topic Title&lt;\/title&gt;\r\n        &lt;link href=\"Resources\/Stylesheets\/FlareAutomationBookStyles.css\" rel=\"stylesheet\" type=\"text\/css\" \/&gt;\r\n        &lt;meta name=\"viewport\" content=\"width=device-width, minimum-scale=1.0, maximum-scale=1.6\" \/&gt;\r\n        &lt;script src=\"..\/Resources\/Scripts\/MadCapAll.js\" type=\"text\/javascript\"&gt;\r\n        &lt;\/script&gt;\r\n    &lt;\/head&gt;\r\n    &lt;body&gt;\r\n        &lt;div id=\"header\"&gt;\r\n            &lt;div id=\"navigationContainer\"&gt;&lt;a class=\"button\" href=\"..\/Test_WebHelpMobile.htm\"&gt;&lt;span class=\"buttonLeft\"&gt;&lt;\/span&gt;&lt;span class=\"buttonCenter\"&gt;Home&lt;\/span&gt;&lt;span class=\"buttonRight\"&gt;&lt;\/span&gt;&lt;\/a&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n        &lt;div class=\"MCTopicBody\"&gt;\r\n            &lt;h1&gt;Topic Title&lt;\/h1&gt;\r\n            &lt;p&gt;Delete this text and replace it with your own content.&lt;\/p&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<\/div>\n<p>In each of these outputs, the declarations at the top of the document are different from the XML\u00a0source document. The attributes for the html element also vary. For each output, there are different children in the head and body elements. In the head element, the meta, link, and script elements are tailored to the needs of the output. <![CDATA[ ]]><\/p>\n<p>Before we look closer, let&#8217;s review some other Flare artifacts which influence the output. In addition to an association with TOCs, targets for online outputs have an association with a skin and a topic stylesheet. Skins establish the appearance and user interaction wrapping a generated topic displayed in a web browser. Skins support interactions such as TOC\u00a0navigation and search. Stylesheets have already been mentioned in context of topics. But there are also stylesheets associated with skins. With topic stylesheets, you can edit the styles through Flare&#8217;s topic stylesheet editor or you can go outside of Flare to edit the stylesheet. Most of your outside edits will be still supported by the Flare editor. You can adjust some of the styles for skins from the skin editor in Flare.It is also possible to adjust the stylesheets used by the skins. But these stylesheets are not maintained in your project. Rather, skin stylesheets live in the installation folder for Flare. If you make changes to these stylesheets, the changes are global to any output created on the machine. For outputs such as HTML5 where both the topic and skin stylesheets are exposed in the file structure of the output, you can potentially perform post-build processing to change the behavior of the output.<\/p>\n<p>There are links to different stylesheets and each output may use different JavaScript to control the skin behavior. A quick inspection of the values of the href attributes of the stylesheet links indicates how the stylesheet is used. Skin stylesheets have a path such as:<\/p>\n<div class=\"CodeIndent\">\n<pre xml:space=\"preserve\">..\/Skins\/Default\/Stylesheets\/TextEffects.css<\/pre>\n<\/div>\n<p>Topic stylesheets have a path such as:<\/p>\n<div class=\"CodeIndent\">\n<pre xml:space=\"preserve\">Resources\/Stylesheets\/FlareAutomationBookStyles.css<\/pre>\n<\/div>\n<p>From the perspective of the generated topic, the TextEffects.css is located a folder back and three folders down another path. For example, if the generated topic is in this folder:<\/p>\n<div class=\"CodeIndent\">\n<pre xml:space=\"preserve\">C:\\FlareOutput\\FlareAutomationBook\\Output\\FlareAutomationBook_HTML5\\Content<\/pre>\n<\/div>\n<p>Then the TextEffects.css file is in this folder:<\/p>\n<div class=\"CodeIndent\">\n<pre xml:space=\"preserve\">C:\\FlareOutput\\FlareAutomationBook\\Output\\FlareAutomationBook_HTML5\\Skins\\Default\\Stylesheets<\/pre>\n<\/div>\n<p>The ..\/ part of the file path means parent directory. For the topic stylesheet above, the CSS file is in a subdirectory of the topic file. So there is no notation for parent directory at the beginning of the file path. But both path in the link element href attributes are relative paths. This way you can copy the output files anywhere and the output still works.<\/p>\n<p>In summary, topics in Flare projects are XML files. You can edit the text of a topic file directly in the XML\u00a0Editor and you can change attributes and elements through features in the Flare user interface. Topics in a Flare project are source files which are transformed when\u00a0Flare builds a target to generate an output such as a PDF or HTML5 help. The generated topics may appear as another document type sucha s HTML5 or XHTML in the file structure for the output.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Topics in a Flare project are XML files. Here is the markup for a basic topic file in a Flare project: &lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt; &lt;html xmlns:MadCap=&#8221;http:\/\/www.madcapsoftware.com\/Schemas\/MadCap.xsd&#8221;&gt; &lt;head&gt; &lt;link href=&#8221;Resources\/Stylesheets\/FlareAutomationBookStyles.css&#8221; rel=&#8221;stylesheet&#8221; type=&#8221;text\/css&#8221; \/&gt; &lt;\/head&gt; &lt;body&gt; &lt;h1&gt;Topic Title&lt;\/h1&gt; &lt;p&gt;Delete this text and replace it with your own content.&lt;\/p&gt; &lt;\/body&gt; &lt;\/html&gt; The first line is called the XML&hellip; <a class=\"more-link\" href=\"https:\/\/tregner.com\/flare-blog\/flare-topics-part-1\/\">Continue reading <span class=\"screen-reader-text\">Flare Topics (part 1)<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[5,17,18],"_links":{"self":[{"href":"https:\/\/tregner.com\/flare-blog\/wp-json\/wp\/v2\/posts\/1"}],"collection":[{"href":"https:\/\/tregner.com\/flare-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tregner.com\/flare-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tregner.com\/flare-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tregner.com\/flare-blog\/wp-json\/wp\/v2\/comments?post=1"}],"version-history":[{"count":13,"href":"https:\/\/tregner.com\/flare-blog\/wp-json\/wp\/v2\/posts\/1\/revisions"}],"predecessor-version":[{"id":12,"href":"https:\/\/tregner.com\/flare-blog\/wp-json\/wp\/v2\/posts\/1\/revisions\/12"}],"wp:attachment":[{"href":"https:\/\/tregner.com\/flare-blog\/wp-json\/wp\/v2\/media?parent=1"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tregner.com\/flare-blog\/wp-json\/wp\/v2\/categories?post=1"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tregner.com\/flare-blog\/wp-json\/wp\/v2\/tags?post=1"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}