Add SVG Graphics in CHM (HTML Help Workshop) - svg

I'm trying to use SVG-Graphics in a CHM-File. The CHM is created by HTML Help Workshop. Unfortunately the svg files don't show in my compiled chm. (Everything works fine in HTML)
I already added this <meta> to display my SVG Graphics
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
I need to copy my SVG-Graphics in my project (*.hhp file).
How I can do this?

Related

Include mathjax equations in CHM file

I'm looking to create a chm file with a topic with some mathjax equations. The html file corresponding to the topic is very simple:
<html>
<head>
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
</head>
<body>
<p>
When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
</p>
</body>
</html>
When I compile in HTML Help Workshop, it's all good. But when I open the resulting chm file and navigate to that topic, I get this issue:
and then the equations don't render - I just get whatever is written in plain text mode. Is there any way at all to get mathjax equations render properly in a chm file?
The CHM help file format is very old and hasn't been updated by Microsoft in a long time: internally it still uses a very old version of Internet Explorer to display the content of the topics.
Recent versions of MathJax are not compatible with older web browsers and that is probably why you are seeing this error.
To avoid this problem, you can either:
Use an older version of MathJax which is compatible with older web browsers such as Internet Explorer 6
Create a hyperlinks in your CHM help file to a webpage which shows the problematic content: it will be opened by the system's default web browser which is (almost) guaranteed to be much newer
Some help authoring tools also include a way to change the Internet Explorer compatibility settings which could be used to force Microsoft Edge to be used to display content: it should allow MathJax to run properly
MathJax used to be able to work in CHM files, but it was a bit fiddly to get it to work. As I recall, you had to use an explicit configuration rather than the ?config=... approach for one thing. There are some very old discussion about it in the MathJax user's forum; see here. it was always a bit difficult to get it to work, and these discussions were about very early versions of MathJax (v1.1, v2.0, v2.1), so you might need to explicitly select older versions of MathJax. Also note that the cdn.mathjax.org address was retired in 2017 (it still exists, but redirects to another CDN, and that might also be a problem for CHM files), so you may want to use one of the other CDNs that serve MathJax, e.g., cdn.jsdelivr.net/npm/mathjax#2/MathJax.js, instead.
As a first simple step you'd try to add following line into your HTML topic files:
<meta http-equiv="X-UA-Compatible" content="IE=11">
Tested and compiled by using FAR HTML with HTML file shown below and some css stuff. I did a reverse test by deleting the line mentioned above only and the script error window appears again.
For further information using X-UA-Compatible see also: https://stackoverflow.com/a/6771584/1981088
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=11">
<title>MathJax Test</title>
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<link rel="stylesheet" href="../design.css">
</head>
<body>
<h1>MathJax Test</h1>
<p>
When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
</p>
</body>
</html>
is resulting in a CHM topic like this:
Of course you need a internet connection.

Adding Font Awesome icons in the ejs file in Nodejs (with express js) project

Hey guys i am trying to build a comment system project with Nodejs . At a certain place i want to use Font Awesome icons in my project so i tries 2 ways but failed to render thoses icons
First
inclucing
<link href="https://stackpath.bootstrapcdn.com/.../font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN"
crossorigin="anonymous">
inside my head tag in ejs file
and then
Second
Download this zip file https://fontawesome.com/how-to-use/on-the-web/setup/hosting-font-awesome-yourself
and open the CSS folder inside and drag the all.min.css file into your public directory in your project.
and then Use a link tag to reference it in your templates/HTML, e.g:
and
Both the ways failed, am i missing something ?
Since you are using the font-awesome solid styles with the fas class, you'll have to include the solid.css styles.
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/solid.min.css">

HTML in MODX Manager GUI is not reflecting that on static file

I'm messing around with static files for the first time. I want to make all my templates and chunks static .html and .php files.
However, there is one issue: the changes I make to my files do not seem to appear within the MODX GUI, and vice versa.
For example, on my file components/templates/hometpl.html I have:
<!doctype html>
<html lang="en">
[[$scripts]]
<body>
[[$main-header]]
<h1>Static File</h1>
[[*content]]
</body>
</html>
But when I click this Template in the MODX Manager I see:
This does not seem to be a problem with the Chunks, just the Template static files.
I've tried clearing cache to no avail. Would anyone know if theres a way I could sync both what appears in the MODX GUI and what I've actually got on my file?

IE9 svg onload accessing parent/top

in IE9, when a SVG is embedded using (object) tags, any ECMAScript embedded inside the SVG cannot access the parent / top HTML document. this works for any other browser, though.
developing using linux only i never realized that until today. the problem is, all our SVGs contain a onload method to signal to the parent HTML document that the SVG DOM is ready. unfortunately, there is no other way to determine whether the SVG's DOM is ready except for polling which i consider highly inelegant.
so ... is there any known workaround for this? that is, access the parent HTML document from within a SVG in IE9?
or any other cross-browser / cross plattform method to determine whether a SVG is completely loaded which does NOT involve polling and timeouts but callbacks?
i'd rather not use a fully blown framework for this like the jQuery SVG plugin.
ok. after a sleepless night i finally figured it out. without any instructions IE9 seems to render pages in Quirks mode. when in Quirks mode SVGs are obviously sandboxed and any ECMAScript inside the SVG cannot access the parent document.
whenever IE9 is forced to actually render a page using IE9 standards everything works like a charm.
use
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
to force IE9 standard mode

Meta keywords before doctype declaration?

I recently was browsing a local web design firm's portfolio and found all their sites' code begins as such:
<meta name="keywords" content="a whole bunch of keywords for their site">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
...
I was able to determine that the pages were generated by dreamweaver (at least in part).
Did dreamweaver do this, or did their "developer" just paste the code at the top of the document.
It is my impulse that this is bad practice and it might work incorrectly on some platforms but it got me wondering as to whether or not their may be a reason for this?
That is a terrible practice and invalid HTML. I bet that this would throw IE directly into quirks mode.
But as for your question, either the developer is a script kiddie and shoved the <meta> tag in there with little knowledge of the outcomes, or Dreamweaver did it. I hope it was Dreamweaver...
FYI - just had this issue and Dreamweaver does not put the meta tags in the correct position automatically. Cursor must be placed beforehand into an editable region.

Resources