Lesscss data-uri output - svg

According to http://lesscss.org/functions/ data-uri('image/svg+xml;charset=UTF-8', 'image.svg'); should output url("data:image/svg+xml;charset=UTF-8,%3Csvg%3E%3Ccircle%20r%3D%229%22%2F%3E%3C%2Fsvg%3E");
Tested here https://codepen.io/ZeGregg/pen/RwoOqLG?editors=1100 and compiled css output background-image: url("https://getuikit.com/assets/uikit/src/images/icons/cloud-download.svg");
What am I doing wrong?
Thanks to the community

Related

Image not rendering in md format file in Gitlab

I have a directory called "features" in the root and inside this directory has image "state_transitation.JPG" and document "myMdc_features.md"
I am trying to add an image "state_transitation.JPG" to the md extension document "myMdc_features.md" in my repository by using markdown below:
![alt text](./state_transitation.JPG)
![alt text](/state_transitation.JPG)
![alt text](state_transitation.JPG)
<p>
<img src="state_transitation.JPG" />
</p>
I tried all above options but this is giving page could not be found error. 404
Both myMdc_features.md and image file are in same path/directory.
What is the correct way to display an image in gitlab myMdc_features.md?
I think that the first option should work, assuming they are in the same folder. I made an example repostiory here that works.
Source of the file:
Hello World
![](./i-have-no-idea-what-im-doing.jpg)
Output in GitLab:

parsing SVG in webpack

I have created a project on Symfony 5. I am receiving an error in webpack when I run 'yarn build'. I am trying to fix it from few days but without success, so I decided to ask for some help :)
This is the error I am getting:
I have enabled postCssLoader in my webpack.config and created postss.config.js in my root directory
.enablePostCssLoader()
postss.config.js File
module.exports = {
plugins: [
require('autoprefixer'),
require('postcss-svgo'),
require('postcss-inline-svg'),
require('postcss-write-svg'),
]
}
And here is a sample of svg I am trying to write in my css
.custom-checkbox .custom-control-input:checked~.custom-control-label::after {
background-image: url('data:image/svg+xml,%3csvg xmlns=\'http://www.w3.org/2000/svg\' width=\'8\'
height=\'8\' viewBox=\'0 0 8 8\'%3e%3cpath fill=\'%23fff\' d=\'M6.564.75l-3.59 3.612-1.538-
1.55L0 4.26l2.974 2.99L8 2.193z\'/%3e%3c/svg%3e')
}
If the error transfers code verbatim, then there are two line breaks (and indentation) that makes the property invalid (see "CRLF": ..width=\'8\'CRLF height.. - this one you can backslash-escape in CSS, and ..1.538-CRLF 1.55L.. - this one with indentation separates numeral making path data invalid - you have to remove all whitespace between minus and digit). If this is it, simply removing line breaks (and suprefluous whitespace) should fix it:
background-image: url('data:image/svg+xml,%3csvg xmlns=\'http://www.w3.org/2000/svg\' width=\'8\' height=\'8\' viewBox=\'0 0 8 8\'%3e%3cpath fill=\'%23fff\' d=\'M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z\'/%3e%3c/svg%3e')
If code snippet you provided is not directly from your source code, then you have probably some formarrter breaking it in the process (?)
N.B. you don't usually have to escape SVG datauris so much, you could go with url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8' fill='%23fff'><path d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/></svg>") (i.e. the only escaped sequence is #->%23) and most interpreters should pick it up just fine. I'm not sure about your build stack, but I'd guess that "safe over-escaped format for obsolete IEs" could be produced as the build result; and if you use preprocessor you can embed 'dataurized' external resources, what could prevent such formatting accidents. (Ah, that's probably what the postcss-inline-svg is doing for you.)

Can't display multiple .md files in .rst toctree Sphinx

I can render my Readme.md files in Sphinx using recommonmark. But when I try to put in multiple Readme files in a .rst file toctree only the first one can be accessed from the documentation link.
Kick! KVM
=========
Source Code: https://bitbucket-eng-rtp1.cisco.com/bitbucket/projects/KICK/repos/kickdb/browse/kick/kvm
ReadMe
------
.. toctree::
:maxdepth: 2
./README.md
Tests ReadMe
------------
.. toctree::
:maxdepth: 2
./tests/README.md
KVM Module Code
---------------
.. automodule:: kick.kvm.actions
:members:
:undoc-members:
I can see the both the Readme files in the folder structure, but the links don't work when trying to access them from the rendered html page.
Here is an image for the folder structure.
Any help appreciated, Thanks!
Here is the error that pops up in the Sphinx build -
/workspace/kick_device2/kick/kvm/kvm.rst:16: WARNING: toctree contains
reference to document 'kick/kvm/tests/README' that doesn't have a
title: no link will be generated
The warning indicates you need to add a title to the file tests/README.md. Sphinx considers the h1 level to be the title of a page. From the markdown syntax documentation:
# My Title
or
My Title
========

Bootstrap 3.3.0 and Visual Studio 2012

like here I tried to update "Microsoft ASP.NET Web Optimization Framework" but It doesn't solve my problem: I get a index out of range in
#Styles.Render("~/Content/css")
for bootstrap.css. If I delete the following rules:
_:-ms-fullscreen,
:root input[type="date"],
_:-ms-fullscreen,
:root input[type="time"],
_:-ms-fullscreen,
:root input[type="datetime-local"],
_:-ms-fullscreen,
:root input[type="month"] {
line-height: 1.42857143;
}
_:-ms-fullscreen.input-sm,
:root input[type="date"].input-sm,
_:-ms-fullscreen.input-sm,
:root input[type="time"].input-sm,
_:-ms-fullscreen.input-sm,
:root input[type="datetime-local"].input-sm,
_:-ms-fullscreen.input-sm,
:root input[type="month"].input-sm {
line-height: 1.5;
}
_:-ms-fullscreen.input-lg,
:root input[type="date"].input-lg,
_:-ms-fullscreen.input-lg,
:root input[type="time"].input-lg,
_:-ms-fullscreen.input-lg,
:root input[type="datetime-local"].input-lg,
_:-ms-fullscreen.input-lg,
:root input[type="month"].input-lg {
line-height: 1.33;
}
it works. It's a "Microsoft ASP.NET Web Optimization Framework" bug or what?
You need to update to WebGrease 1.6.
Same issue with VS2013 and removing the code section as stated by Ymir works. I am not sure what are the issues will come up because of removing this code though. I would wait till Bootstrap fixes this issue.
Yes there is CSS breaks !!!
Augustine Cost reported this issue on Microsoft site as well
https://connect.microsoft.com/VisualStudio/feedback/details/1015447/css-parser-breaks-on-ie-hacks-in-bootstrap-3-3-0
But still there is no ideal resolution besides removing this section.
Update the WebGrease to version 1.6

pdf2swf couldn't create a font for 'SimSun'

I was trying to convert a pdf into a swf and i was using swftools. To support Chinese, i downloaded xpdf-chinese-simplified.tar and modified the add-to-xpdfrc file like this
#----- begin Chinese Simplified support package (2011-sep-02)
cidToUnicode Adobe-GB1 /usr/local/share/xpdf-chinese-simplified/Adobe-GB1.cidToUnicode
unicodeMap ISO-2022-CN /usr/local/share/xpdf-chinese-simplified/ISO-2022-CN.unicodeMap
unicodeMap EUC-CN /usr/local/share/xpdf-chinese-simplified/EUC-CN.unicodeMap
unicodeMap GBK /usr/local/share/xpdf-chinese-simplified/GBK.unicodeMap
cMapDir Adobe-GB1 /usr/local/share/xpdf-chinese-simplified/CMap
toUnicodeDir /usr/local/share/xpdf-chinese-simplified/CMap
#fontFileCC Adobe-GB1 /usr/..../gkai00mp.ttf
displayCIDFontTT Adobe-GB1 /usr/local/share/xpdf-chinese-simplified/gkai00mp.ttf
#----- end Chinese Simplified support package
When i tried to convert the pdf,
/usr/local/bin/pdf2swf 10434_102_demo_1414995035745.pdf -o test.swf -s
languagedir=/usr/local/share/xpdf-chinese-simplified
an error occured:
Error: Couldn't create a font for 'SimSun'
PS. I have two environments, one is MAC and the other is Redhat, everything is ok in MAC and this error only occurs in Redhat.
As this question is missing an answer, I can add an optional solution (as a workaround) here.
For Flexpaper, if you use the "HTML5" render mode, it will render Chinese, and other unicode text, correctly.

Resources