Hi, Is there a cool webgen way to do anchor tags? I''ve just been doing this: <span id="anchor_name"/> ...but is there a better way? Thanks, Chad
On Wed, 2 Jan 2008 01:01:22 -0700 "Chad Woolley" <thewoolleyman at gmail.com> wrote:> Is there a cool webgen way to do anchor tags? I''ve just been doing > this: > > <span id="anchor_name"/> > > ...but is there a better way?What exactly should such a tag do? Return the relative link to an anchor? Or create anchors in HTML? If you just want a span with an id, I don''t think it would be easier to write a webgen plugin to do just that. Sorry, but more info is needed here - or I''m still a little bit to sleepy from new year''s eve ;) -- Thomas
Here''s an example of what I mean: http://geminstaller.rubyforge.org/code/index.html#rubygems_compatibility I implemented this by hardcoding this in my .page file: <span id="rubygems_compatibility"/> I''m just wondering if there''s a more concise way... Thanks, Chad On Jan 2, 2008 8:04 AM, Thomas Leitner <t_leitner at gmx.at> wrote:> > On Wed, 2 Jan 2008 01:01:22 -0700 > "Chad Woolley" <thewoolleyman at gmail.com> wrote: > > Is there a cool webgen way to do anchor tags? I''ve just been doing > > this: > > > > <span id="anchor_name"/> > > > > ...but is there a better way? > > What exactly should such a tag do? Return the relative link to an > anchor? Or create anchors in HTML? If you just want a span with an id, > I don''t think it would be easier to write a webgen plugin to do just > that. > > Sorry, but more info is needed here - or I''m still a little bit to > sleepy from new year''s eve ;) > > -- Thomas > _______________________________________________ > webgen-users mailing list > webgen-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/webgen-users >
On Wed, 2 Jan 2008 10:46:52 -0700 "Chad Woolley" <thewoolleyman at gmail.com> wrote:> Here''s an example of what I mean: > > http://geminstaller.rubyforge.org/code/index.html#rubygems_compatibility > > I implemented this by hardcoding this in my .page file: > > <span id="rubygems_compatibility"/> > > I''m just wondering if there''s a more concise way...So you basically want to add an id to a header element sothat you can use anchors to link to them? If you use maruku, you can easily assign ids to a heading: ## This is a level 2 heading :) Maruku automatically creates an id based on the text, something like this_is_a_level_2_heading But you can also specify your on id: ## This is a level 2 heading {#myid} It is this what you mean? Btw. Tag/Relocatable has an option for checking the anchor part of a link. However, this only works for headings h1, h2, ... with an id already set after converting the page file to HTML via a content converter. So if you use maruku as page format, it basically works out of the box. I recommend maruku over textile and maruku will also be the default format used in webgen 0.5.0. As a sidenote: you can also assign ids to a header in textile: h1(#myid). This is a level 1 heading -- Thomas
On Jan 3, 2008 4:10 AM, Thomas Leitner <t_leitner at gmx.at> wrote:> So if you use maruku as page > format, it basically works out of the box. I recommend maruku over > textile and maruku will also be the default format used in webgen 0.5.0.Cool, I''ll look at maruku.> As a sidenote: you can also assign ids to a header in textile: > > h1(#myid). This is a level 1 headingRight, but in this case the element I want to anchor to isn''t a header. Thanks, Chad
On Thu, 3 Jan 2008 08:53:18 -0700 "Chad Woolley" <thewoolleyman at gmail.com> wrote:> On Jan 3, 2008 4:10 AM, Thomas Leitner <t_leitner at gmx.at> wrote: > > So if you use maruku as page > > format, it basically works out of the box. I recommend maruku over > > textile and maruku will also be the default format used in webgen > > 0.5.0. > > Cool, I''ll look at maruku. > > > As a sidenote: you can also assign ids to a header in textile: > > > > h1(#myid). This is a level 1 heading > > Right, but in this case the element I want to anchor to isn''t a > header.No problem there since the (#name-of-id) syntax works for all textile markup: p(#testid). this is a para with a %(#id)span% or *(#other)strong* tag. -- Thomas