A method to add images to markdown files in Github is described here. However, I would like to add images to *.org files in Gitlab (both Github and Gitlab support README.org files, so the solution should be equal for both). I've tried:
[[file:./path/to/file.svg]]
[[sometext][file:./path/to/file.svg]]]
[[file:./path/to/file.svg]][sometext]]
Markdown's format doesn't work either:
![alt text](./path/to/file.svg)
A now removed answer suggested using
![][1]
[1]: ./path/tofile
which doesn't work either.
What is the right way to do it?
Insetting html works for both Gitlab and Github.
#+html: <p align="center"><img src="path/to/file" /></p>
#+caption: <img description> (optional)
#+attr_html: :width 50 px
#+attr_html: :height 50 px
[[<path to image>]]
For more check the orgmode manual.
Related
The markdown code below can be rendered in Jupyter notebook locally in my browser, but it doesn't reader on GitHub (instead shown as broken image icons)
<img src="img/plot1_m_over_n=5.svg" width="500"> <img src="img/plot2_m_over_n=10.svg" width="500">
There's a lot of math so I used Jupyter notebook (LaTeX) for the readme (no code cells, just lots of markdown cells), and I know there is a python solution here (In [8]), but I don't want to show the python code. I just want the SVGs to be rendered! Plus it can't resize the svg. How can I adjust the markdown code above so that it can be rendered on GitHub?
I'm trying to enable markdown checkboxes in vscode markdown preview but am not having any luck. I've tried every combination of the following extensions with no luck:
Markdown Preview Enhanced
Markdown All in One
Markdown Preview Github Styling
Markdown Checkbox
Markdown Checkboxes
Does anyone have a configuration of extensions where this is working for you?
I was facing the same issue, and it looks like VSCode markdown does not support checkboxes and you need to install an extension.
Checkboxes work in VSCode using the Markdown All In One extension.
The trick is that the checkboxes also have to be part of a list.
This doesn't work:
[ ] Unchecked
[ ] Checked
This works:
- [ ] Unchecked
- [x] Checked
As of January, 2022 this is working for me in a markdown preview:
<input type="checkbox" checked> some checked text
<input type="checkbox"> some unchecked text
NOTE This works in a published vscode extension markdown file (in the Marketplace):
But I am still investigating getting it to work in github - any ideas? input elements do not appear to be in the prohibited list so it "should" work somehow.
But see https://github.com/gjtorikian/html-pipeline/blob/main/lib/html/pipeline/sanitization_filter.rb input elements are not in the allowed list in the sanitizer file.
Here is the combination I use to replicate Github's styling for my READMEs
Make sure you reload VSCode after installing!
Name: GitHub Markdown Preview
Id: bierner.github-markdown-preview
Description: Changes VS Code's built-in markdown preview to match GitHub
Version: 0.2.0
Publisher: Matt Bierner
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=bierner.github-markdown-preview
I just noticed that for the extension "Markdown Checkbox" by Matt Bierner to work properly in checking boxes in preview, you have to either disable or uninstall "Markdown All in One". All in One seems to be prioritized in the rendering of the checkboxes over the first extension in which they can actually be checked
Could be great to have some kind of fork in between both extensions.
I lost all day and no found the solution. I solved with a simple manera in vb.net ...
two instruction and work...
nCheckBox.Checked = False
nCheckBox.Checked = True
Foudn this here: https://docs.gitlab.com/ee/user/markdown.html#diagrams-and-flowcharts
You can do markdown checkboxes like this in VSCode text boxes (and I'm sure .md files too) in list items:
[ ] Bug 1 Totally Inconceivable!
[X] Bug 2 You keep using that word. I do not think it means what you think it means.
to "set" the check box, replace the space in the square brackets with a X.
I'm editting my GitHub readme and I need to add text in two different alignments. Part of the readme is in English and should be left to right and another part is in a different language (Persian, in my case) which has a right to left alignment. Since GitHub editor does not have any setting to change the text alignment, I wonder if there's any other way to do this?
I've already tried HTML tags like <div dir="rtl">متن فارسی</div> to change the alignment but it doesn't work.
Desired output:
Edit
After getting feedback from #Quentin, I realized that the problem was that when you go to the Preview tab, you cannot see the changes, however, once you Commit, changes will be applied. So, <div dir="rtl">متن فارسی</div> does work, the only thing is that you will see changes after the commit, not in preview tab.
This input which has 2 separate DIV's with one empty line after the last line of the first DIV:
Will be rendered to:
For a quick fix, I've just realized that <p align="right">text</p> works, but a lot of variations with divs and style within the tag did not.
Update Jan. 2022: GitHub editor supports RtL.
Original answer (Q1 2020)
This is followed by dear-github/dear-github issue 275
I think this support is also needed in markdown files, especially in ReadMe files.
Adding such support is very easy: just allow to add a tag "dir='rtl'" at the beginning of a document, and then wrap the entire document inside a "div dir='rtl'".
Also today it is possible to put all text inside a "div dir='rtl'", but then it is not possible to use markdown inside.
So this is not yet supported (at least in the preview, as mentioned by the OP).
It seems to be applied once committed, as tested by Quentin.
There is a discussion on Mardown/Commonmark RTL support.
Because I wanted to be able to re-size images in markdown I've been using the HTML img and specifying the desired width/height.
I'm referencing the image using a relative path, so for example for markdown in the same directory as an images folder I'd write:
<img src="./Images/MyImage.png" width="600">
This has all worked fine using Visual Studio Code but when the markdown is pushed to the VSTS Wiki it isn't rendering the image.
Is this a bug or is the img tag not supported?
You can use the following syntax to resize them (see =WIDTHxHEIGHT at the end):
Notice though that the syntax to support image resizing is only supported in pull requests and the Wiki.
![Image alt text]($/project/folder/_img/markdown-guidance/image.png =WIDTHxHEIGHT)
So for your use case I would use (in your markdown files):
![Image alt text](./Images/MyImage.png =600x)
Please refer to the following documentation for images in markdown.
https://learn.microsoft.com/en-us/vsts/project/wiki/markdown-guidance?view=vsts#images
The Wiki of course support the standard HTML syntax. Please see this blog for details.
Q : This has all worked fine using Visual Studio Code but when the
markdown is pushed to the VSTS Wiki it isn't rendering the image.
The
The root cause is that you used a relative path, <img src="./Images/MyImage.png" width="600">, the image can be found on you local machine. So you can see the image when open the markdown file in Visual Studio Code locally.
However when you pushed to the VSTS, the path is changed. So it cannot find the image for rendering the image in Wiki. You need to capture the link address (URL) for the image, then use the URL in img tag like this:
<img src="https://xxx.visualstudio.com/f081441f-c072-4ed5-9407-85683e9b0888/_apis/git/repositories/e291904f-4668-4fba-8575-3f67898e3058/Items?path=%2Ftest%2F0116-workspace.png" width="600">
I am converting HTML to List using XMLWorker, the indentation (using blockquote tags) not appears in pdf. I have tried creating List with HTMLWorker but the result is same. Is there any way to preserve indentation (when using blockquote tag in HTML for indentation) in pdf?
The blockquote and li do not have indentation to "preserve", its just that almost every browser (if not all) choose to indent them by default. This is an individual choice made by every browser vendor, just as Netscape choose to use grey as the default body background color in the 90's. Any text formatting that you see iText doing is its own "default style" and anything that differs from your expectations you'll need to manually change.
When I try to run a blockquote through the XMLWorker version 5.4.0 I don't see anything and its not on the list of supported HTML tags. Do you have it further wrapped in a SPAN or some other tag? Can you post a sample?
When I run an OL/LI combination through 5.4.0 I see that iText makes them indented. Can you post a sample that doesn't indent? One quick fix would be to apply a simple margin to the UL/OL such <ol style="margin-left:100px;">