Let's take some markdown
This `<goodtag>` is OK
This <badtag> is not.
In Typora, a mac markdown editor, this renders as:
In Macdown:
In both editors, the problem is localized, the rest of the contents after badtag appears normally.
However, in Vuepress, things don't work at all and the page is all blank except for its title.
Module Error (from ./node_modules/vue-loader/lib/loaders/templateLoader.js):
(Emitted value instead of an instance of Error)
Errors compiling template:
tag <badtag> has no matching end tag.
1 |
2 | <ContentSlotsDistributor :slot-key="$parent.slotKey"><p>This <code><goodtag></code> is OK</p>
3 | <p>This <badtag> is not.</p>
I understand that <badtag> is going to cause a problem with Vuepress and why. But I am not writing this as an individual page, I am pushing lots of existing markdown contents into a Vuepress directory. The overall Vuepress dev build doesn't complain, this only shows as a problem when I navigate to that particular page, find it all blank and look at the JS console.
I already have a Python batch that performs transformations on the local markdown (for example, pushing local file system images into .vuepress/public with the appropriate URLs. Can I catch these errors, by having the batch call Vuepress itself to pre-validate content?
Is there any way for me to run a "node vuepress compile /foo/mymarkdown.md" at an individual page, check its return code and notify me that something needs fixing on that page?
As I wrote this I think maybe an npm run build to build the actual distribution would do the trick. Maybe. But I need to isolate it on a page by page basis, not bulk-run it on 500+ pages at a time and then pick out all the errors.
I recently set up my blog on abhitopia.com. The issue I am facing is that all the code I write in my blog (in markdown) cannot be copied. For instance, go to
http://abhitopia.com/machine%20learning/2016/05/22/tensor_flow_exploration.html
You will be unable to copy code. I have already tried googling this. It is definitely not a feature that comes pre configured with Jekyll. I don't understand why. :(
This is not related to how Jekyll is building your site. This is a problem with the theme that you are using (Grayscale), which gives you the impression that you cannot select text in your code blocks.
If you look at your grayscale.css file around line 409, you'll see something like this:
These two styles are removing the shadow that one sees when selecting text, which makes you think you cannot copy the text.
Remove these two styles, or modify them, so that the shadow is visible and in a color you like. Alternatively, you can use a different theme, instead of that one.
I am trying to add an image to the README.md in my repository using markdown below:
![ScreenShot](https://github.com/i-saumitra/Voice-controlled-MP3-Player/blob/master/screenshot.jpg)
But the image is not showing when I visit my repository.
Instead the link to the image is showing up. Clicking the link will open the image in new window.
I have also tried using relative path:
![ScreenShot](screenshot.jpg)
But this is giving page not found error.
What is the correct markdown to display image in README.md
Both README.md and image file are in same path/directory.
What is the correct way to display an image in github README.md?
Complete content of README.md file is as below:
Voice-controlled-MP3-Player
===========================
A MP3 player which accept voice command like PLAY, PAUSE, FORWARD, etc. Using C# and Microsoft Speech API.
![ScreenShot](https://github.com/i-saumitra/Voice-controlled-MP3-Player/blob/master/screenshot.jpg)
Updated content
Since January, 30th 2013, GitHub now supports relative links in markup documents.
This means that your code ![ScreenShot](screenshot.jpg) would now work flawlessly.
As pointed by #Brad, this may also ease a scenario where the images are different in two branches, but bear the same. In that case, switching from one branch to another, would dynamically switch the image in the rendered view, thus without requiring any change to the Readme content.
Blog post announcement
Help article
Previous answer when GitHub wasn't supporting relative links
You have to use the raw url format. In your case that would be https://raw.githubusercontent.com/i-saumitra/Voice-controlled-MP3-Player/master/screenshot.jpg
This means that the correct markdown would be the following
![ScreenShot](https://raw.githubusercontent.com/i-saumitra/Voice-controlled-MP3-Player/master/screenshot.jpg)
Using this in a .mdfile on github will display the following picture ;-)
Update following your comment
where is this officialy documented that we have to use raw...i couldn't find it anywhere
This URL format is an undocumented feature of the GitHub site. This means that it could change later. If that ever happens, in order to "rediscover" the new format, click the Raw button when displaying a image. This will "open" the image in your browser. Copy the URL and VoilĂ !
Note: Although the repository is no longer on hosted on GitHub, I've updated the urls to reflect the new GitHub policy regarding user content
You really should use relative urls. That way they'll work better for private repos as well.
![ScreenShot](/screenshots/latest.png)
supposing your repo has latest.png inside the screenshots folder.
~B
For relative URL's to work with images, wrap it inside the paragraph tag.
I was facing the problem, especially when working with the single image.
Example:
<p>
<img src="relativePath/file.png" width="220" height="240" />
</p>
An extension to previous answers...
The image would not show for me when the line:
![ScreenShot](/image.png)
Was directly below a <h2></h2> line and I needed to add an empty line between them.
Hopefully this saves someone some time!
Thought I would update this for 2019 as I had trouble figuring this out for myself. I uploaded my images to a repo on GitHub, and then used the raw url of the image to import it into my markdown file. To get the raw url, click on the specific image link in GitHub so you are on the page for that specific image. To the top right of the photo, there are two buttons, "Download" and "History". If you click "Download", it takes you to that raw url with the picture taking up the full screen. Copy that url, and then paste it like this in your markdown file:
![image description or alt text](https://raw.githubusercontent.com/i-saumitra/Voice-controlled-MP3-Player/master/screenshot.jpg)
The button used to say "Raw" not "Download" so I hope this helps people find it.
This may not be relevant to previous answers. I have the same question as the OP - I was directed here and it didnt help me. I hope I can help add light to this question however - as it covers the possibilities of why images does not render in README.md file.
The issue I encountered is that the file name README.md file is written as readME
Not only its missing .md its also written differently.
Apparently, we should not rename the README.md file. It has to be the original name of that file in order to render the images or gifs you want to upload on github README.md page. Hope this helps someone, in rare of occasions, just like I did.
Check the file extensions because .png is not the same as .PNG.
Also use / instead of \ while specifying the file path.
Side note, when using reStructuredText use:
.. image:: /screenshots/latest.png?raw=true
I've tested with "Copy path" and in some locations this was working and in others it didn't.
In the cases it didn't, I copied the permalink and used it instead.
It doesn;t work when there are any html tags just above the line where image is being imported. You can try removing the html code or add some blank lines for the image to show on Readme.
This is just to help someone who is still having issues with image rendering in README.md:
If your image is named Some Name.png and you are trying to attach it in the README.md like ![Some Name](relative/path//res/Some Name.png), it won't work. The image has to be saved without any spaces in the file name.
So Some_Name.png with ![Some Name](relative/path//res/Some_Name.png) will work.
Make sure you check the case of the file extension. They have to match (either capital or lowercase). If you have my_image.PNG in your root directory and you add ![screenshot](/my_image.png) to your README file, it will not work. For some reason, Windows likes to capitalize file extensions sometimes. Unfortunately, Git does not recognize extension case so if you try to fix it by just changing the file name, you won't be able to commit the changes to the repo since Git will think everything is up to date. So you either have to update README.md or do some workaround like moving the file out of the directory, making a commit, then editing the file name then moving it back and doing another commit.
I had to add a <br> to return a line in order for the image to show on mine. This discovery was inspired by the comment in this thread to leave a blank line after a tag.
i want to change default template in phpbb3. for this where i have to made changes. i am trying to changes file inside style/subsilver2/template...but i didn't made any right .please help me ..in which file i have to made changes.i have also try in admin section in style..but not successes... if any one have clue..please help me.
Thanks
Manish
It depends what part of the page you would like to change, since the template is a set of many HTML files with preprocessing instructions. They are located in:
[PHPBB_Folder]/styles/[Theme_Name]/template
You can find the right html file by searching for a specific part of source code copied from the live page of the forum.
Important note: when you're changing phpBB template files, don't forget to reset the template cache in the forum admin panel (go to Admin / Styles tab - and clear cache for what you changed, Template, Theme, or Imageset.
I hope this helps.
How do I access user preferences in Firefox? I have the following code:
var control = document.getElementById(control_id);
if (control) {
control.setAttribute('color', nsPreferences.copyUnicharPref(prefstr, default_val));
}
But when I run this, I get the following:
Error: nsPreferences is not defined
Source file: chrome://backgroundtoggle/content/options.xul
Line: 9
I'm having trouble wading through the Mozilla documentation. How do I make this do what I want?
It looks like you need to include nsUserSettings.js in your .xul file:
<script type="application/x-javascript" src="chrome://global/content/nsUserSettings.js" />
This is where nsUserPreferences is defined.
See here for an example options.xul file. The script tag should be the first child element of prefwindow to ensure it gets loaded before your own code does.
Additional Information
This looks like a decent tutorial on how to write Firefox extensions. It seems to do a good job of consolidating all the relevant information on mozilla.org in one place, and contains links to mozilla.org when you need more details on a topic being covered. I do wish the navigation was a little better, but what can you do? Use the navigation pane on the left-hand side and click Tutorial to get started. You have to move through each section using the navigation pane, which took me few seconds to figure out, as I was looking for 'Next' and 'Previous' links on the page.