txt[ Lightweight markups let you create internal and external links in a very easy way, and you can still do so in Glyph. However, if you do so: * you can't check if they are valid * you can't infer the link title automatically If you care about link validation and you want to save some keystrokes, then you should use: * the %>[link] (aliased to @=>@) -- to create internal and external links. * the %>[anchor] (aliased to @#@) -- to create named anchors (bookmarks) within your document. ] box[Example| p[&[gcode]] highlight[=plain| This is a link to link[#test]. ... This is link[#wrong]. This is a #[test\\\|test anchor]. =] p[&[htmlcode]] highlight[=html|
This is a link to test anchor.
...
This is #wrong.
This is a test anchor.
=] p[Additionally, the following warning message is displayed when =>[#compile|compiling]:] highlight[=plain| warning: Bookmark 'wrong' does not exist -> source: @: authoring.textile -> path: document/body/bodymatter/chapter/@/textile/section/section/box/link =] ] txt[ Basically, if you use the %>[link] and the %>[anchor], Glyph makes sure that: * all links point to valid anchors within the document (regardless if the anchors are before or after the link, in snippets or included files). * there are no duplicate anchors within the documents. * if no title is specified as second parameter for the %>[link], the anchor's name is used as such. Besides using the %>[anchor], you can also create an anchor for a header by passing an code[@id] attribute the the %>[section], like this: ] highlight[=plain| section[ @title[My Section] @id[my_section] ... ] =] p[By default, validation is only enabled for internal links (i.e. the check occurs if the first parameter of the %>[link] starts with a code[#]). You can enable it for external links as well by setting the $>[options.url_validation] to code[true]. If URL validation is enabled, an error is returned if a link returns an HTTP status greater than 302.] important[Enabling URL validation may significantly slow down compilation if a lot of external links are present.]