How to use the extensions.wikidPadParser.WikidPadParser._WikiLinkPath function in extensions

To help you get started, we’ve selected a few extensions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WikidPad / WikidPad / extensions / wikidPadParser / WikidPadParser.py View on Github external
def clone(self):
        result = _WikiLinkPath()
        result.upwardCount = self.upwardCount
        result.components = self.components[:]
        
        return result
github ckolumbus / WikidPad.svn / extensions / wikidPadParser / WikidPadParser.py View on Github external
instead and uses the result as suggestion for autocompletion.
        
        If prefix is None autocompletion is not possible.
        """
        linkPath = _WikiLinkPath(link=link)
        if linkPath.isAbsolute():
            return linkPath.resolvePrefixSilenceAndWikiWordLink(None)

        if basePage is None:
            return u"", 0, link  # TODO:  Better reaction?
        
        basePageName = basePage.getWikiWord()
        if basePageName is None:
            return u"", 0, link  # TODO:  Better reaction?
        
        return linkPath.resolvePrefixSilenceAndWikiWordLink(_WikiLinkPath(
                pageName=basePageName))

github WikidPad / WikidPad / extensions / wikidPadParser / WikidPadParser.py View on Github external
    @staticmethod
    def resolvePrefixSilenceAndWikiWordLink(link, basePage):
        """
        If using subpages this is used to resolve a link to the right wiki word
        for autocompletion. It returns a tuple (prefix, silence, pageName).
        Autocompletion now searches for all wiki words starting with pageName. For
        all found items it removes the first  silence  characters, prepends the  prefix
        instead and uses the result as suggestion for autocompletion.
        
        If prefix is None autocompletion is not possible.
        """
        linkPath = _WikiLinkPath(link=link)
        if linkPath.isAbsolute():
            return linkPath.resolvePrefixSilenceAndWikiWordLink(None)

        if basePage is None:
            return u"", 0, link  # TODO:  Better reaction?
        
        basePageName = basePage.getWikiWord()
        if basePageName is None:
            return u"", 0, link  # TODO:  Better reaction?
        
        return linkPath.resolvePrefixSilenceAndWikiWordLink(_WikiLinkPath(
                pageName=basePageName))
github WikidPad / WikidPad / extensions / wikidPadParser / WikidPadParser.py View on Github external
    @staticmethod
    def createWikiLinkPathObject(*args, **kwargs):
        return _WikiLinkPath(*args, **kwargs)
github ckolumbus / WikidPad.svn / extensions / wikidPadParser / WikidPadParser.py View on Github external
    @staticmethod
    def createRelativeLinkFromWikiWord(word, baseWord, downwardOnly=True):
        """
        Create a link to wikiword word relative to baseWord.
        If downwardOnly is False, the link may contain parts to go to parents
            or siblings
        in path (in this wiki language, ".." are used for this).
        If downwardOnly is True, the function may return None if a relative
        link can't be constructed.
        """
        
        relPath = _WikiLinkPath.getRelativePathByAbsPaths(_WikiLinkPath(
                pageName=word), _WikiLinkPath(pageName=baseWord),
                downwardOnly=downwardOnly)
        
        if relPath is None:
            return None
        
        return relPath.getLinkCore()
github ckolumbus / WikidPad.svn / extensions / wikidPadParser / WikidPadParser.py View on Github external
    @staticmethod
    def createLinkFromWikiWord(word, wikiPage, forceAbsolute=False):
        """
        Create a link from word which should be put on wikiPage.
        """
        wikiDocument = wikiPage.getWikiDocument()
        
        targetPath = _WikiLinkPath(pageName=word)

        if forceAbsolute:
            return BracketStart + targetPath.getLinkCore() + BracketEnd

        linkCore = _TheHelper.createRelativeLinkFromWikiWord(
                word, wikiPage.getWikiWord(), downwardOnly=False)
                
        if _TheHelper.isCcWikiWord(word) and _TheHelper.isCcWikiWord(linkCore):
            wikiFormatDetails = wikiPage.getFormatDetails()
            if wikiFormatDetails.withCamelCase:
                
                ccBlacklist = wikiDocument.getCcWordBlacklist()
                if not word in ccBlacklist:
                    return linkCore
        
        return BracketStart + linkCore + BracketEnd
github ckolumbus / WikidPad.svn / extensions / wikidPadParser / WikidPadParser.py View on Github external
    @staticmethod
    def isAbsoluteLinkCore(linkCore):
        return _WikiLinkPath.isAbsoluteLinkCore(linkCore)
github ckolumbus / WikidPad.svn / extensions / wikidPadParser / WikidPadParser.py View on Github external
def clone(self):
        result = _WikiLinkPath()
        result.upwardCount = self.upwardCount
        result.components = self.components[:]
        
        return result
github ckolumbus / WikidPad.svn / extensions / wikidPadParser / WikidPadParser.py View on Github external
    @staticmethod
    def resolvePrefixSilenceAndWikiWordLink(link, basePage):
        """
        If using subpages this is used to resolve a link to the right wiki word
        for autocompletion. It returns a tuple (prefix, silence, pageName).
        Autocompletion now searches for all wiki words starting with pageName. For
        all found items it removes the first  silence  characters, prepends the  prefix
        instead and uses the result as suggestion for autocompletion.
        
        If prefix is None autocompletion is not possible.
        """
        linkPath = _WikiLinkPath(link=link)
        if linkPath.isAbsolute():
            return linkPath.resolvePrefixSilenceAndWikiWordLink(None)

        if basePage is None:
            return u"", 0, link  # TODO:  Better reaction?
        
        basePageName = basePage.getWikiWord()
        if basePageName is None:
            return u"", 0, link  # TODO:  Better reaction?
        
        return linkPath.resolvePrefixSilenceAndWikiWordLink(_WikiLinkPath(
                pageName=basePageName))
github WikidPad / WikidPad / extensions / wikidPadParser / WikidPadParser.py View on Github external
    @staticmethod
    def createRelativeLinkFromWikiWord(word, baseWord, downwardOnly=True):
        """
        Create a link to wikiword word relative to baseWord.
        If downwardOnly is False, the link may contain parts to go to parents
            or siblings
        in path (in this wiki language, ".." are used for this).
        If downwardOnly is True, the function may return None if a relative
        link can't be constructed.
        """
        
        relPath = _WikiLinkPath.getRelativePathByAbsPaths(_WikiLinkPath(
                pageName=word), _WikiLinkPath(pageName=baseWord),
                downwardOnly=downwardOnly)
        
        if relPath is None:
            return None
        
        return relPath.getLinkCore()