FandocViewerUser Guide

Overview

FandocViewer automatically extends the capabilities of flux to show Fandoc documentation. It adds a fandoc uri scheme allowing you to navigate and view all the Fantom pod documentation and source code in your current Fantom installation. Fantom docs offline!

Try these command lines:

> flux fandoc://docLang
> flux fandoc://sys
> flux fandoc://afFandocViewer/
> flux fandoc://fandoc/HtmlDocWriter

Wow! It looks just like the Fantom website! And all your pods are there too! The scheme follows the format:

fandoc://${podName}/${typeName}

It works by adding a web browser view to flux. That means you can also do this:

> flux http://www.alienfactory.co.uk/

See Browser for instructions on binding F5 to the refresh command.

View .fandoc Files

You can also view standard files as rendered Fandoc documents. Not only is this great for previewing SideWalk comments and Fantom documentation, but you can also save and view notes locally as plain text .fandoc files!

Use the fan:// scheme to even view .fandoc files in Pods. This makes it easy for flux applications to link, load, and view, Help pages and other documentation! Consider:

try {
  ...
} catch (Err r) {
  flux::Frame.load(`fan://myPod/doc/help.fandoc`)
}

To enable this feature, edit %FAN_HOME%/etc/sys/ext2mime.props and change the line:

fandoc=text/text; charset=utf-8

to

fandoc=text/fandoc; charset=utf-8

The ViewFandoc tool command allows you flip between editing and browsing with a single key press!

Syntax Highlighting

To enable fandoc syntax highlighting in your flux editor, edit %FAN_HOME%/etc/syntax/ext.props and add the following line:

fandoc=fandoc

Then create a new file %FAN_HOME%/etc/syntax/syntax-fandoc.fog with the following contents:

using syntax

SyntaxRules {
  brackets = "[]"
  comments = ["  ", "##", "**", "==", "--"]
  blockCommentStart = "pre>"
  blockCommentEnd   = "<pre"
  blockCommentsNest = false
  strs = [
    SyntaxStr { delimiter = "`"; multiLine = true },
  ]
  keywords = null
}

In your OS associate flux with the .fandoc extension for easy editing!

Directives

Extend your rendering capabilities by defining Directive commands to be invoked during Fandoc rendering.

Release Notes

v1.0.6

  • Bugifx: Type name was displayed twice in the Breadcrumb when viewing a source file.

v1.0.4

v1.0.2

  • Initial release

Happy Fandoc editing!