Sha256: aa42264b9c7fd94db61d2d65b7427cf222317aaed7c0d1cf0b94898acf483fe4

Contents?: true

Size: 727 Bytes

Versions: 3

Compression:

Stored size: 727 Bytes

Contents

	txt[
The =>[&[yardoc]/Macro|@Glyph::Macro@] class also includes a few methods to check and store bookmarks and headers. Consider for example the following source code for the %>[anchor]:
	]

	highlight[=ruby|
macro :anchor do 
  ident, title = @params
  macro_error "Bookmark '#{ident}' already exists" if bookmark? ident
  bookmark :id => ident, :title => title
  %{<a id="#{ident}">#{title}</a>}
end
	=] 

	txt[
The @bookmark?@ method can be used to check the existance of a particular ID within the whole document, while the @bookmark@ method is used to store bookmark IDs and titles. In a similar way, you can use @header?@ and @header@ methods to check the existance of headers within the documents or store new ones.
	]

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
glyph-0.4.2 book/text/extending/bookmarks_headers.glyph
glyph-0.4.1 book/text/extending/bookmarks_headers.glyph
glyph-0.4.0 book/text/extending/bookmarks_headers.glyph