How can I use the Graphviz macro in XWiki 2.0 syntax? - graphviz

The XWiki FAQ gives an example for XWiki 1.0 syntax:
{graphviz:type=dot}digraph G {Hello->world}{graphviz}
My XWiki is properly set up to display this.
But I'm not able to translate this into XWiki 2.0 syntax. I tried this
{{graphviz type=dot}} ... {{/graphviz}}
and other variations, but the best I got was about "graphviz" not being a valid macro.
As soon as I switch back the document format to the old syntax, it works, so I assume this is not some kind of misconfiguration problem.
What's the correct syntax?

I am having the same issue.
Doesn't look like it is yet supported. Check out their Jira log:
http://jira.xwiki.org/jira/browse/XWIKI-3984

The PlantUML extension is based on Graphviz and it may be used to build dot diagrams
For more information see PlantUML DOT
Using XWiki 2.0 syntax, just insert this snippet:
{{plantuml}}
#startdot
digraph G {
Hello -> world
}
#enddot
{{/plantuml}}

Related

How to force rstudio/knitr/rmarkdown to use alternative pandoc binary (scholdoc)

scholdoc (see scholarlymarkdown.com) is a fork of pandoc that has !FINALLY! easy referencing of figures/code blocks etc. build in - a central missing piece in pandoc.
Is there any straight forward way to force usage of scholdoc instead of the shipped pandoc binary when using knitr/rmarkdown in rstudio?
When I set in .Rprofile
options(
rstudio.markdownToHTML = function(inputFile, outputFile) {
system(
paste(
"~/.cabal/bin/scholdoc",
shQuote(inputFile),
"-o", shQuote(outputFile)))
})
as indicated here, this seems to work, but, as it is missing all manner of command line options used by the internal pandoc, produces HTML out of the box and will lead me down a painful way of getting all the CLI options right.
After studying some rmarkdown code, I have also tried to set the environment variable RSTUDIO_PANDOC to contain the path of scholdoc - to no avail.
Can anyone point out an easy way to do this with up-to-date rstudio/scholdoc installations?
I asked this long ago an thought that for completeness sake, I'd point out, that bookdown has stepped into the arena to provide cross referencing of figures etc. within rmarkdown documents.
after issuing install.packages('bookdown'), RStudio may be coerced to use it by adding the following to the YAML header of a document:
output:
bookdown::pdf_document2:

How do you add custom syntax highlighting for an additional language to Light Table?

Do you need to write a plugin for this or can you do it e.g. with the user.behaviors file?
Where can I find a tutorial and comprehensive documentation on this?
LightTable uses CodeMirror for syntax highlighting.
If the language you want is one of CodeMirrors existing modes (and it's in the version of the node module that your version of LightTable is using) then you should be able to use the set-syntax command (ctrl+space then type "syntax" to find it) to apply it to the current editor. You can add the following to your user.behaviors file to associate the syntax with a given file extension:
[:files :lt.objs.files/file-types [{:exts [:eg],
:mime "text/x-example",
:name "Example",
:tags [:editor.example]}]]
If a CodeMirror mode is not available, you'll first need to write one. Here are some docs on Writing CodeMirror Modes.
#RobinGower's answer works for me, eg for Jade syntax highlighting add [:files :lt.objs.files/file-types [{:name "jade" :exts [:jade] :mime "text/x-jade" :tags [:editor.jade]}] ] to the user.behaviors file
#mydoghasworms - have you already seen these pages?
LightTable FAQ page
getting started
I found a few helpful things on both.

using "graphviz" package in "phabricator" wiki

How can one install and use graphviz in phabricator?
I would like to write code directly in the wiki and have the image be generated on the fly.
There seems to be a ticket open on this:
https://secure.phabricator.com/D7332
https://secure.phabricator.com/T3964
but I couldn't find any documentation beyond that.
You can do the following:
dot {{{
digraph foo {
...
}
}}}
You can no longer do this, as the dot interpreter has been removed. (Interpreters such as dot that allow users to pass arbitrary code to external programs are generally not very secure, and someone had actually developed an attack that could take advantage of this with dot.)

GitHub Atom: How to apply a particular syntax highlighting to some files based on name

How can I configure GitHub's Atom to make it automatically set a particular syntax highlighting to filenames based on name and/or extensions?
Specifically I want it to automatically set Ruby syntax highlightning to Cocoapods' Podfiles.
As of Atom 1.0.8 this is now possible without the file-types package, using a core feature. To achieve this, open the config.cson file, and add a section like the following:
"*":
# Other config
core:
customFileTypes:
"source.ruby": [
"Podfile"
]
There is guidance on finding the language scope name here: https://flight-manual.atom.io/using-atom/sections/basic-customization/#finding-a-languages-scope-name
This is now possible with the file-types third-party package. I used the following syntax:
"*":
# Other config
"file-types":
"^Podfile$": "source.ruby"
This should be placed in the config.cson file.
Here's an excerpt from the readme:
file-types package
Specify additional file types for languages.
Extension Matchers
Drop the dot before the extension to use extension matchers.
For example, you can associate .ex_em_el with text.xml in your config.cson
as follows:
'file-types':
'ex_em_el': 'text.xml'
RegExp Matchers
You can match with regular expressions, too. Most JavaScript regular
expressions should work; but, the system looks for a dot (.), a caret (^) at
the start, or a dollar ($) to identify RegExp matchers.
For example, you can associate /.*_steps\.rb$/ with source.cucumber.steps in
your config.cson as follows:
'file-types':
'_steps\\.rb$': 'source.cucumber.steps'
NOTE: Extension Matchers take priority over RegExp Matchers.
As of this writing, there is no way to do this short of submitting a PR to the language-ruby package or creating your own fork of the language-ruby package.
There is a bug tracking this issue here: https://github.com/atom/atom/issues/1718
Anyone arriving here looking to add support for template files in php e.g. .tpl, the folloing works in atom 1.10.2. I do not have previous versions so I can't say about earlier versions.
Add this in your config (config.cson) after core:. I added it after audioBeep: false line.
customFileTypes:
"text.html.php": [
"tpl"
]
Documentation made me go around in circles. Several articles wrongly mention source.php where as it should be text.html.php
Just getting started with atom coming from npp++ basically as I have struggled with snippet support there and hope atom can do a good job.
To add to Maurice Kelly's answer (my reputation is too low to comment)
This is now documented at:
https://github.com/atom/flight-manual.atom.io/blob/681c7fe6e69f1f64396ecadfde1323a01e7f5b96/book/02-using-atom/sections/06-customizing.asc

What's the difference between XSL Pattern and XPath in syntax?

I'm updating codes to use MSXML6.0 from MSXML3.0.
However, I noticed that, for MSXML3.0, the default "SelectionLanguage" is "XSL Pattern", while MSXML6.0 only support XPath.
I have concerns that this change would introduce differences in the query syntax.
Can somebody list the difference of syntax between these two syntax?
The one thing that has tripped me up is selecting the first node in a node set. For example, we'd been using MSXML 3.0 (which uses XSLPattern) and has queries like this:
/root/book[0]
This query was supposed to select the first book. This works with XSLPattern. But with XPath, this is correct:
/root/book[1]
So when I switched us to using MSXML 6.0, which uses correct XPath, all those queries with "[0]" stopped working.
Update:
I just found this link that talks some more about XSLPattern and XPath:
MSDN Magazine: MSXML 3.0 Supports XPath 1.0, XSLT 1.0, XDR, and SAX2
http://msdn.microsoft.com/en-us/magazine/cc302348.aspx
Update #2:
Here's the W3C Spec on XSLT which includes XSL Patterns:
http://www.w3.org/TR/1998/WD-xsl-19981216.html#AEN376
Update #3
Here's another post that describes the same thing I mentioned above:
http://www.eggheadcafe.com/software/aspnet/29579789/xml-parsing.aspx
XSL Pattern, if I remember correctly, was a selection language like XPath but was implemented by Microsoft before XPath was standardised (possibly even created). I don't think anyone even has anything that documents XSL Pattern any more. You can basically forget about it and concentrate on XPath. It has the same purpose but is supported and standardised.
XSL Patterns appear to be part of WD-XSL, "working draft XSL", which means versions predating the XSL recommendation (1999), which differ significantly from the final 1.0 version.
Microsoft has the relevant info on "XSL Patterns". Here's a quote from the section XPath 1.0 APIs:
MSXML 2.0 provides support for XSL Patterns, the precursor to XPath 1.0. The notion of an XML addressing language was introduced into the original W3C XSL Working Drafts (http://www.w3.org/TR/1998/WD-xsl-19981216.html) and called XSL Patterns. MSXML 2.0 implements the XSL Patterns language as described in the original XSL specification with a few minor exceptions.
MSXML 3.0 provides support for the legacy XSL Patterns syntax as well as XPath 1.0.
XPath, in my experience, is much easier to get your head around. I avoid XSL like the plague if I can. But you are right, the syntax is very different, so if you want to switch from XSL to XPath you have some work ahead of you. I cannot explain the differences easily, but this tutorial should give you some idea of what XPath is about:
http://www.w3schools.com/XPath/xpath_examples.asp

Resources