Skip to content

Commit

Permalink
Amethyst: Improved DokuWiki formatting and enabled cross-references
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Mar 24, 2017
1 parent 1426383 commit c403e9c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
22 changes: 12 additions & 10 deletions doomsday/tools/amethyst/lib/amedokuwiki.ame
Expand Up @@ -2,7 +2,7 @@ $ Amethyst Dokuwiki Source formatting.

$*** FORMATTING RULES ***$
@format{@=@s(**|<nowiki>**</nowiki>)}
@format{break}{@N}
@format{break next !indent @ prev !indent}{@N}
@format{br}{@n}

$ Styles.
Expand All @@ -12,26 +12,28 @@ $ Styles.
@format{order 1 parent strong}{**@=}
@format{order -1 parent strong}{@=**}
$@format{parent count 1 opt parent !samp}{''@=''}
@format{order 1 parent cmd}{''@=}
@format{order -1 parent cmd}{@=''}
@format{order 1 parent cmd parent !samp}{''@=}
@format{order -1 parent cmd parent !samp}{@=''}
@format{order 1 parent var}{''@=}
@format{order -1 parent var}{@=''}
@format{order 1 parent opt}{''@=}
@format{order -1 parent opt}{@=''}
@format{order 1 parent code}{''@=}
@format{order -1 parent code}{@=''}
@format{order 1 parent opt parent !samp}{''@=}
@format{order -1 parent opt parent !samp}{@=''}
@format{order 1 parent code !indent}{''@=}
@format{order -1 parent code !indent}{@=''}
@format{order 1 parent email}{//@=}
@format{order -1 parent email}{@=//}
@format{pre !control}{@g @< @B<code> @> </code>@b}
@format{order 1 parent caption}{//@=}
@format{order -1 parent caption}{@=//}
@format{br parent caption}{\\}
@format{break next !indent @ parent2 list}{\\@_\\}
@format{pre !control}{indent code}{@g @< @B<code> @> </code>@b}
@format{try opt cmd pass parent indent samp}{@= @< <code> @> </code>}

$ Indented styles.
@format{indent !cite first !pre}{@= @< >@_ @> @N}
$@format{indent !cite first !pre}{@= @< >@_ @> @N}
$style="padding-left:1.5em;@_margin:0.5em;"

$ Remove all section numbers, Mediawiki numbers them on its own.
$ Remove all section numbers.
@format{parent child 1 parent try chapter section subsec sub2sec pass}{}

$ Titles.
Expand Down
17 changes: 13 additions & 4 deletions doomsday/tools/amethyst/lib/amestd.ame
Expand Up @@ -89,16 +89,25 @@ $ Anchor.
@ifdef{HTML}{
@tag{<a name=@nsp{" @arg "></a>}}
}
@ifdef{DOKUWIKI}{
@tag{<html><a name=@nsp{" @arg "></a></html>}}
}
}

$ Reference to an anchor.
@macro{ref}{
@ifdef{HTML}{
@tag{<a href="#@nsp{@arg{1}">}} @glue{@arg{2}} @tag{@nsp{</a>}}
}@else{
@ifdef{MAN}{ @apply{@u}{@arg{2}} }
@else{ @arg{2} }
}
}
@else{@ifdef{DOKUWIKI}{
@tag{<html><a href="#@nsp{@arg{1}">}} @glue{@arg{2}} @tag{@nsp{</a></html>}}
}
@else{@ifdef{MAN}{
@apply{@u}{@arg{2}}
}
@else{
@arg{2}
}}}
}

$ Hyperlink with a title.
Expand Down

0 comments on commit c403e9c

Please sign in to comment.