Roadkill wiki engine, Creole markup - creole

I'm using the Roadkill wiki engine and trying to paste xml into the pages like this: {{{this is a test}}}
but the "" text is not displaying, it only shows "this is a test"
Is there another way to escape it so that the page shows "this is a test"?

I found a solution to this. Roadkill has a tokens file (App_Data\tokens.xml) in there you can set a text token to look for, and a replacement value. So to fix the "" and "" elements, I added the following to the tokens file:
<TextToken>
<Name>Begin Body Element</Name>
<Description><![CDATA[
fixes the body element problem
]]>
</Description>
<SearchRegex><Body></SearchRegex>
<HtmlReplacement><![CDATA[<body>]]>
</HtmlReplacement>
</TextToken>
<TextToken>
<Name>End Body Element</Name>
<Description><![CDATA[
fixes the body element problem
]]>
</Description>
<SearchRegex></Body></SearchRegex>
<HtmlReplacement><![CDATA[</body>]]>
</HtmlReplacement>
</TextToken>

In version 1.7 onwards you can use the inbuilt syntax highlighting:
[[[code lang=XML|
your XML here
]]]
This gives you client-side syntax highlighting from SyntaxHighlighter. The Roadkill documentation is generally a few months behind but it does eventually contain the information you need!

Related

TYPO3 / Fluid: Inline Viewhelper notation in Templates of FluidEmail

I’m using the new TYPO3\CMS\Core\Mail\FluidEmail feature of TYPO3 v10.3 to send HTML system e-mails. Unfortunately, I’m experiencing a weird behavior with Viewhelpers in the e-mail Templates. Calling the regular Viewhelper notation like e.g. <f:uri.resource extensionName="backend" path="Images/typo3_orange.svg"/> works as expected. But inline notations of the same Viewhelper (like {f:uri.resource(extensionName: 'backend', path: 'Images/typo3_orange.svg')}) don’t get processed at all.
Surprisingly, when I call the regular notation first and the inline notation afterwards in the same template, both notations get resolved.
I also experienced that no fluid variables are accessible in the template, e.g. {normalizedParams}, which should be available when you set the request like $message->setRequest($GLOBALS['TYPO3_REQUEST']);
Did anyone experience a similar behavior and has a hint for me?
Here's my implementation in my Controller Action:
$message = GeneralUtility::makeInstance(FluidEmail::class);
$message
->to($email)
->format(FluidEmail::FORMAT_HTML)
->setTemplate('MyTemplate')
->assign('pages', $pages);
if ($GLOBALS['TYPO3_REQUEST'] instanceof ServerRequestInterface) {
$message->setRequest($GLOBALS['TYPO3_REQUEST']);
}
GeneralUtility::makeInstance(Mailer::class)->send($message);
Reference: https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/10.3/Feature-90266-Fluid-basedTemplatedEmails.html
Sounds like a fluid parsing problem. Do you have any { or } flying around in your template that could mess up fluids parsing?
Just run into the same problem with one of my in-house plugins after switching from php7.2 to php7.4 (when switching back to php7.2 the resource path was resolved again correctly).
It turned out that some inline javascript using curly brackets further down the page was to blame (thank you Daniel). Putting it in a separate file solved the issue. It would appear that the use of inline JS is tolerated to different degrees depending on the php version being used.

Create a link to the header of another page in Github

Does anyone know how to create a link to the header of a different wiki page?
I know if I have a header ##Header name that I can link to it on that page by using (#header-name) as my link, but I want to link to that header from a different page. Is this possible?
ie. I want to have a table of contents that can link to the sub-sections of each wiki page as well as to the page itself.
Edit: I mean a way besides just using the url link
http://github.com/project/wiki/Wiki-Page#header-name
EDIT 1: So totally wrong about before, I just read up a bit more. So we have this new support as well inside of GitHub Wikis! (Relatively new.)
You can also do something like this:
[[ Link text | page_title#header_title ]]
This might work a lot better for you! TIL because of this answer here. You can see me do this with the Prerequisite link and you can see my other links work the other way. Time for me to do some updates!
EDIT 1: Still useful but definitely NOT THE ONLY WAY.
So I answered a question about this before, you should avoid absolute links on GitHub (i.e. https://github.com/user/repo_name/...)
However, a good way (and kind of the only way inside of Wikis EDIT 1: TOTALLY NOT TRUE TO BEING THE ONLY WAY) of doing what you need can be seen like this:
[Header link](/user/repository_name/wiki/page_name#title).
This is kind of the linking unfortunately that the Wiki would support. This will change your directory page based off of GitHub. You can see that it would be
https://github.com/(the linkage you want to hit)
I have actually began doing something like this in a Wiki I work on here. Inside of my Sidebar, you can see I have a Getting Started Page, and then a subsection into it is a Prerequisite heading and it will properly lead people to where they need to go. You would be able to perform this same thing on any page. It is a tad verbose, but worth it as you can easily change things around if need be. This is also case-sensitive since it will change their location so be sure that in your linkage, the page is the proper case and your heading is all lowercase.
Hope this helps!
You can link to the header by simply assigning an id to header. e.g you've "Extension" header in a page called Abc.
# <a id="extension"></a> Extensions
You have another page "Call center" and you want to go to extension in abc , you can use reference linking of markdown i.e "The [extensions][1] are handled by agents"
[1]: url-of-abc/#extension
I tested Maxwell's "good way" to link to the header of another page in Github in Edit 1 on and it works perfectly.
#[crux-ports Installation](/user/crux-ports/blob/master/README.md#installation)
markdown generate slug for the heading and convert it to id, example
# [ topic ][ color ]
will be converted to
<h1 id="topic--color" data-line="643" class="code-line">[ topic ][ color ]</h1>
Thus, to link it you can write it as [color](#topic--color).
If the destination anchor is on another page (assume filename css.md) with path relative to current markdown page, then you can write it as [color](css.md#topic--color)
Attach the slugify function from vscode
// excerpt from https://github.com/yzhang-gh/vscode-markdown/blob/908d7ba5465a203e4299f346c179211d992ef468/src/util/slugify.ts
const str = '# [ topic ][ color ]';
const slug = encodeURI(
str.trim()
.replace(/\s+/g, "-") // Replace whitespace with -
.replace(/[\]\[\!\'\#\$\%\&\'\(\)\*\+\,\.\/\:\;\<\=\>\?\#\\\^\_\{\|\}\~\`。,、;:?!…—·ˉ¨‘’“”々~‖∶"'`|〃〔〕〈〉《》「」『』.〖〗【】()[]{}]/g, "") // Remove known punctuators
.replace(/^\-+/, "") // Remove leading -
.replace(/\-+$/, "") // Remove trailing -
);
console.log(slug) // "topic--color"

Adding href link to a bug entry?

I'm attempting to include links to bug reporting tools in the bug list. The following doesn't work and doesn't even generate a bug list entry. Thinking I'm missing something basic.
In the config:
ALIASES += JIRA{1}="\bug \1 <a href=\"https://jira/browse/\"\1>\1</a>"
In the code:
/// #JIRA XX-12345
The result is just plain comments, no links and no bug list.
After some experimentation, the proper form I was looking for is:
In the config:
ALIASES = JIRA{1}="\bug \1"
In the code:
\\\ #JIRA{ XX-1234 }

Capybara, Cucumber, GWT problem asserting the text with inline styles

I was to check to see if a text with inline styles exist.
For example page.should have_content(text) works for raw text such as
"Time out",
however it does not work for the text
"Time out. Please Click here to retry".
Also I have been having trouble trying to locate an anchor with inline style as well ex:
<a>click <strong>here</strong>to retry</a>.
Thanks.
You are correct that have_content tests for text, not markup. You can do this though:
page.body.should include('... <a>...</a> ...')
Regarding your second question, I don't think it's possible to do page.has_link? with markup. You would have to construct your own XPath expression and then use page.should have_selector(:xpath, '...'). Or test for the raw HTML using page.body of course.

encode url not encoding

I am working in a template in Moveable Type and would like to do the following:
Twitter
It all works but I'm worried that the current link or at some point even if I use a title mt tag that it might not be right for the browser address bar. I thought you could use encode_url="1" but it doesn't appear to encode my titles or links. For example: I have a title with spaces in it and the resulting code still has the spaces in it. Also for the example above shouldn't the http:// be encoded in a special way? Because it doesn't do it.
Am I doing something wrong here?
I just checked this code and it is outputting properly for me. I am using MT 4.34. I used the following template code in an index templated:
<mt:Var name="url" value="http://google.com/hello I have spaces">
<mt:Entries lastn="1">
Permalink: <mt:EntryPermalink encode_url="1"><br />
Fake URL: <mt:Var name="url" encode_url="1">
</mt:Entries>
And I got the following output:
Permalink: http%3A%2F%2Fwww.capndesign.com%2Farchives%2F2010%2F09%2Fthe_big_picture_scenes_from_china.php
Fake URL: http%3A%2F%2Fgoogle.com%2Fhello%20I%20have%20spaces
So I would confirm that you're using a current version of MT (4.34 or 5.x) that supports this modifier, because the spaces and special characters should definitely be getting replaced with HTML entities. I'd also try the code I provided above to see if you get the same output (except your permalink will obviously be different).