public class TracWikiLanguage extends AbstractMarkupLanguage
AbstractMarkupLanguage.PatternBasedSyntax
blocks, configuration, internalLinkPattern, paragraphBreakingBlocks, phraseModifierSyntax, tokenSyntax
Constructor and Description |
---|
TracWikiLanguage() |
Modifier and Type | Method and Description |
---|---|
protected void |
addStandardBlocks(java.util.List<Block> blocks,
java.util.List<Block> paragraphBreakingBlocks) |
protected void |
addStandardPhraseModifiers(AbstractMarkupLanguage.PatternBasedSyntax phraseModifierSyntax) |
protected void |
addStandardTokens(AbstractMarkupLanguage.PatternBasedSyntax tokenSyntax) |
boolean |
computeInternalLinkExists(java.lang.String link)
for the purpose of converting wiki words into links, determine if the wiki word exists.
|
protected Block |
createParagraphBlock() |
java.lang.String |
getServerUrl()
the server URL, for example
http://trac.edgewall.org/ from which links may be derrived, such as
http://trac.edgewall.org/wiki/WikiPage or http://trac.edgewall.org/tickets/1 |
boolean |
isAutoLinking()
Indicate if the markup should match WikiWords as hyperlinks.
|
void |
setAutoLinking(boolean autoLinking)
Indicate if the markup should match WikiWords as hyperlinks.
|
void |
setServerUrl(java.lang.String url)
set the server URL, for example
http://trac.edgewall.org/ from which links may be derrived, such as
http://trac.edgewall.org/wiki/WikiPage or http://trac.edgewall.org/tickets/1 |
java.lang.String |
toChangesetHref(java.lang.String changesetId,
java.lang.String restriction)
convert a changeset id to a hyperlink based on the
server url |
java.lang.String |
toInternalHref(java.lang.String pageName)
Convert a page name to an href to the page.
|
java.lang.String |
toMilestoneHref(java.lang.String milestoneId)
convert a milestone id to a hyperlink based on the
server url |
java.lang.String |
toReportHref(java.lang.String reportId)
convert a report id to a hyperlink based on the
server url |
java.lang.String |
toRevisionLogHref(java.lang.String revision1,
java.lang.String revision2,
java.lang.String restriction)
convert a revisions to a revision log hyperlink based on the
server url |
java.lang.String |
toSourceBrowserHref(java.lang.String source,
java.lang.String revision,
java.lang.String line)
create an URL to the source browser
|
java.lang.String |
toTicketAttachmentHref(java.lang.String ticketId,
java.lang.String attachment)
create an URL to an attachment ticket based on the
server url |
java.lang.String |
toTicketHref(java.lang.String ticketId,
java.lang.String commentNumber)
convert a ticket id to a hyperlink based on the
server url |
addBlockExtensions, addPhraseModifierExtensions, addTokenExtensions, clearLanguageSyntax, clone, configure, createState, emitMarkupLine, emitMarkupLine, emitMarkupText, getBlocks, getInternalLinkPattern, getParagraphBreakingBlocks, getPhraseModifierSyntax, getReplacementTokenSyntax, initializeBlocks, initializePhraseModifiers, initializeTokens, isBlocksOnly, isDetectingRawHyperlinks, isEmptyLine, isEnableMacros, isFilterGenerativeContents, processContent, setBlocksOnly, setEnableMacros, setFilterGenerativeContents, setInternalLinkPattern, startBlock
createDocumentBuilder, createDocumentBuilder, getExtendsLanguage, getFileExtensions, getIdGenerationStrategy, getName, setExtendsLanguage, setFileExtensions, setName
public java.lang.String toInternalHref(java.lang.String pageName)
pageName
- the name of the page to targetMarkupLanguage#getInternalLinkPattern()
public java.lang.String toTicketHref(java.lang.String ticketId, java.lang.String commentNumber)
server url
ticketId
- the id of the ticketcommentNumber
- the comment number or null if the url should not reference a specific commentpublic java.lang.String toChangesetHref(java.lang.String changesetId, java.lang.String restriction)
server url
changesetId
- the changeset idrestriction
- the restriction, or null if there is no restriction. eg: "trunk"public java.lang.String toRevisionLogHref(java.lang.String revision1, java.lang.String revision2, java.lang.String restriction)
server url
revision1
- the first revisionrevision2
- the second revisionrestriction
- the restriction, or null if there is no restriction. eg: "trunk"public java.lang.String toReportHref(java.lang.String reportId)
server url
reportId
- the id of the reportpublic java.lang.String toMilestoneHref(java.lang.String milestoneId)
server url
milestoneId
- the id of the milesontepublic java.lang.String toTicketAttachmentHref(java.lang.String ticketId, java.lang.String attachment)
server url
ticketId
- the id of the ticketattachment
- the name of the attachmentpublic java.lang.String toSourceBrowserHref(java.lang.String source, java.lang.String revision, java.lang.String line)
source
- the source to be viewedrevision
- the revision, or null if there is no revisionline
- the line, or null if there is no linepublic boolean computeInternalLinkExists(java.lang.String link)
WikiWordReplacementToken
public boolean isAutoLinking()
public void setAutoLinking(boolean autoLinking)
public void setServerUrl(java.lang.String url)
http://trac.edgewall.org/
from which links may be derrived, such as
http://trac.edgewall.org/wiki/WikiPage
or http://trac.edgewall.org/tickets/1
url
- the url, or null if it is unknown.public java.lang.String getServerUrl()
http://trac.edgewall.org/
from which links may be derrived, such as
http://trac.edgewall.org/wiki/WikiPage
or http://trac.edgewall.org/tickets/1
setServerUrl(String)
protected void addStandardBlocks(java.util.List<Block> blocks, java.util.List<Block> paragraphBreakingBlocks)
addStandardBlocks
in class AbstractMarkupLanguage
protected void addStandardPhraseModifiers(AbstractMarkupLanguage.PatternBasedSyntax phraseModifierSyntax)
addStandardPhraseModifiers
in class AbstractMarkupLanguage
protected void addStandardTokens(AbstractMarkupLanguage.PatternBasedSyntax tokenSyntax)
addStandardTokens
in class AbstractMarkupLanguage
protected Block createParagraphBlock()
createParagraphBlock
in class AbstractMarkupLanguage
Copyright © 2007, 2013 David Green and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html