tooltip in dot (graphviz) - graphviz

I have the following graphviz file:
digraph ServerDependency {
Server02 -> Server01 [tooltip="Database"];
Server02 -> Server06 [tooltip="Images"];
}
dot -Timap -oserverdependency.map -Tgif -oserverdependency.gif serverdependency.gv
Then I have a html file that looks like this:
<html>
<head>
</head>
<body>
<IMG SRC="serverdependency.gif" ismap="ismap"/>
</body>
</html>
Based on the name tooltip I would expect to hover over the node and see the text, but I don't.
How can I change the command or html to actually be able to hover over the node to see the tooltip.
I am following the example at this URL about 1/3 down the page:
https://www.graphviz.org/doc/info/output.html

It looks like you are trying to output to a .map and .gif format. I am unsure about .map but .gif doesn't support tooltop as the image doesn't support a hover over type.
Try outputting to .svg as well and opening this in a browser.
dot -Timap -oserverdependency.map -Tgif -oserverdependency.gif -Tsvg -oserverdependency.svg serverdependency.gv

Related

How to right-align text in markdown code block?

I have the following markdown code
<pre>
┣━━ 📦 t_databases - this is text
┃ ┗━━ MongoDB-Go.md - this is text
┗━━ t_webdev
┣━━ editor-Swagger.md
┗━━ packages-Go.md
┗━━ MongoDB-Go.md
</pre>
This looks like this:
How can I make this is text perfectly in line? Is there a programmatic way? Doens't seem to work if I just use tab key.

Hugo Image Resize

My repo: nataliepjlin/up (github.com)
I want to use the percentage of width to make the image responsive just like the screenshot did.(this was changed in the inspect window)
While using the code on my repository, the rendered image looks like this:
screenshot
So I change the layout/shortcodes/image.html file line 6,7 to {{ $width:= replace (replace (.Get "width") "x" "%") "px" "%" }} , but it came out as error message of execute of template failed: template: shortcodes/image.html:96:31: executing "shortcodes/image.html" at <$image.Resize>: error calling Resize: strconv.Atoi: parsing "50%": invalid syntax
screenshot
Also, I tried codes from Responsive Images in Hugo | Adam Wills using {{< img src="images/blog/shop" type="jpeg" alt="" caption="" >}} in my post, but the image didn't show up.
Is there any modification I can do to fix this? Thanks a lot 🙏🙏

Pandoc highlighting theme

I'm trying to generate a highlighting theme for my site created with pandoc framework.
I followed this guide : guide
I create my theme this way:
pandoc --print-highlight-style breezedark > my_style.theme
and then I add it to my command like this:
pandoc ..\articles\$_
-f markdown
-t html --template=..\template\article.html
--defaults=..\defaults\params_$($_.BaseName).yaml
--highlight-style my_style.theme <-------------------
--output ..\articles\$($_.BaseName).html
The problem is that when I go to fill it out, I get this error back, and the code doesn't get colored:
Could not read highlighting theme my_style.theme
What's the problem?
EDIT:
i try adding this:
--highlight-style=breezedark
but my code doesn't get colored in html view..
i try this:
```bash
java -version
```
~~~bash
java -version
~~~
This is the source code of html:
<div class="sourceCode" id="cb2">
<pre class="sourceCode bash">
<code class="sourceCode bash">
<span id="cb2-1">
<span class="ex">java</span> -version</span>
</code>
</pre>
</div>
<div class="sourceCode" id="cb3">
<pre class="sourceCode python">
<code class="sourceCode python">
<span id="cb3-1">
<span class="bu">print</span>(<span class="st">"Hello, world!"</span>)
</span>
</code>
</pre>
</div>
The reason is the encoding of file. By default, the theme file output by pandoc is UTF-16 LE (seen from vscode). Saving the file with encoding UTF-8 will help.
I encountered the same problem. I wrote color names in the theme file such as chartreuse and crimson. This was the reason of the failure: one has to enter the hex codes of the colors.

Custom browser protocol to open IE with params

I need to implement something similar to this answer
https://stackoverflow.com/a/41749105/1004374
but I have several issues.
I changed it slightly so be able to pass arguments into the url:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>openie</title>
</head>
<body>
<h1>Hello world!</h1>
Google1
Google2
</body>
</html>
and changed reg script:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\openie]
"URL Protocol"="\"\""
#="\"URL:OPENIE Protocol\""
[HKEY_CURRENT_USER\Software\Classes\openie\DefaultIcon]
#="\"explorer.exe,1\""
[HKEY_CURRENT_USER\Software\Classes\openie\shell]
[HKEY_CURRENT_USER\Software\Classes\openie\shell\open]
[HKEY_CURRENT_USER\Software\Classes\openie\shell\open\command]
#="cmd /k set myvar= & call set myvar=\"%1\" & call set myvar=%%myvar:openie:=%% & call \"C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe\" %%myvar%% & exit /B"
The only update is shielding of %1 argument:
myvar=\"%1\
This is needed to pass arguments with &. Otherwise will be copied url until first ampersand:
openie:https://www.google.com/?word=abc&word2=abc2
All is fine when you click the link first time. When IE is already opened url is copied incorrectly with encoded quotes inside it and automatically added http in the begining:
http://%22https//www.google.com/?word=abc&word2=abc2"
I realize that issue with cmd script inside but cannot guess what should be changed to be able to pass arguments and click links many times.
Not found a good way to modify the script to accept the '&'. but as a workaround, I suggest you could encode the url, and change the '&' to '%26', the link as below:
Google2
Then, in the destination page, you could decode the url and change '%26' to '&', then, split the string and get the parameters.
More details, please refer to the HTML URL Encoding.

How to set margin top for header?

The --margin-top option is for the contents margin, but I would like to set the margin from the top of the page to the header. The project I'm working on allows users to create header and footer themselves, so the height of the header or footer is dynamic.
I don't know how to do it so can anyone help?
The built-in options for top margin are
--margin-top (as you mentioned above) and
--header-spacing Spacing between header and content in mm (refer: http://wkhtmltopdf.org/usage/wkhtmltopdf.txt).
None of them will probably help you as there is no option (at least to my knowledge) that can explicitly set some margin from the top of the page to the header. However, in your case, you could explore --header-html <url> and add a html header. This can take an HTML where you could probably set the custom header and add space/margin accordingly and then the HTML gets displayed in on the header.
Use -T -B -L and -R for margins.
wkhtmltopdf -B 13 -L 13 -R 13 -T 53 /tmp/e0cb9c4597860b5abfbf2bafc1000d5a.html /tmp/e0cb9c4597860b5abfbf2bafc1000d5a.pdf
-T 10 is working by adding an empty HTML.
wkhtmltopdf.exe -T 10 --header-html header.html content.html generatedpdf.pdf
the empty html:
<!DOCTYPE html>
<html lang="en">
<head>
<META http-equiv="Content-Type" content="text/html; charset=utf-16">
</head>
<body >
</body>
</html>

Resources