用戶友好的Python模塊和命令行前端,將標記轉換為HTML。它默認使用githubs在線在線markdown-to-html-api(這需要互聯網連接),但帶有離線轉換的選項(密切模仿githubs行為),並且也可以將任何其他python或命令線工具插入其中。無論您使用什麼使用,都將自動擴展使用大量功能,例如更多的內和輸出選項,GitHub味的CSS,公式支持,高級圖像緩存和優化,主機就緒的文件和圖像置換,PDF-Conversion,Emoji短代碼支持,TOC支持等。
儘管其主要目的是從Markdown文件創建靜態頁面,例如,如果您在GitHub上託管,則與靜態網站構建器或GitHub Actions一起創建靜態頁面,但出於任何其他目的,它都可以很好地使用。
這是其優勢和功能的(不一定是廣泛的)列表:
$ -formula- $使用它們),GitHub通常不會。 GH-MD-to-HTML如果它們都安裝了(優勢:快速,不需要Internet),則使用乳膠和DVISVGM,否則Codecogs eqneditor(優勢:不需要您安裝3 GB的乳膠庫)來實現這一目標。[[_TOC_]] , {:toc}和[toc]的可選支持,以創建文檔的內容表,例如gitlab-fraired markdown等。如果您正在尋找將pandoc轉換為pdf的替代方案,這是您可以使用GH-MD-TO-HTML而不是Pandoc的原因列表:
雖然使用Pandoc從Markdown到PDF轉換通常會產生更漂亮的結果(Pandoc使用LATEX,畢竟),而GH-MD-TO-HTML在快速轉換複雜文件以進行家庭作業或其他目的的可靠性比Beauty更重要的情況下具有其自己的優勢:
$ signs $ signs及其公式可能啟動的字符的量。不過,這些規則不適用於MarkText(例如MarkText),這會導致在編輯器中使用的公式在與Pandoc轉換時不再起作用時會感到沮喪(MarkText的Export to Toport to pdf功能有時會在不錯的文件中失敗而沒有錯誤消息,這會使它變得更加可靠)。最糟糕的部分是,每當pandoc失敗將.md轉換為.pdf時,它顯示了基於中間.Tex-File而不是輸入.md .md-file的錯誤行數,這使得很難找到問題的根。您可能已經猜到了,GH-MD-to-HTML並不關心您開始使用公式的空格數量,而是將此決定留給您。綜上所述,潘多克的MD-to-pdf轉換在圖像,嵌套列表,多行子點點條目或公式以及GH-MD-to-html方面的行為非常不尋常。
如果您在Windows上,請使用pip3 install gh-md-to-html直接從Python軟件包索引或python3 -m pip install gh-md-to-html 。
兩者都可能在Linux上需要sudo ,您可以選擇
python3 -m pip install gh-md-to-html[pdf_export]
並安裝WKHTMLTOPDF(V0.12.6或更高)以獲取可選的PDF轉換功能,並將Markdown文件轉換為PDF和/或
python3 -m pip install gh-md-to-html[offline_conversion]
為了使可選的離線轉換功能啟動和運行。
如果您在Windows上,則可能必須在當前工作目錄中的路徑中添加wkhtmltopdf ,以使PDF轉換工作,例如PATH=%PATH%;c:/program files/wkhtmltopdf/bin或類似的內容,取決於您的安裝位置。
如果要使用命令行訪問接口,則只需在幫助文本中記錄的參數提供gh-md-to-html (可與gh-md-to-html -h訪問,並如下所示)。在Windows上,您必須向相應的參數提供python3 -m gh_md_to_html 。
如果要通過Python訪問界面,則可以使用
import gh_md_to_html然後,將gh_md_to_html.main()帶有相同的參數(和默認值),您將提供給命令行接口。
如果您只想模仿GitHub的REST API離線的轉換結果,但不需要圖像緩存,公式支持和精美的CSS樣式,請使用
html_as_a_string = gh_md_to_html.core_converter.markdown(your_markdown_as_a_string)
在Python。
用法: gh-md-to-html <input_name> <optional_arguments>
默認行為:
默認情況下,GH-MD-to-HTML將Markdown文件名作為參數以同一名稱的文件,以.html而不是.md的形式保存在同一名稱的文件中。
一些怪癖:
github-markdown-css/github-css.css中(add -c以使其內聯)。./images中緩存,存儲和引用(添加-i以禁用此)。-w (如果您想將其直接在瀏覽器中直接查看)。id s和文件內部鏈接均以user-content-限制,因此您可以將生成的HTML嵌入較大的網站中,而不會冒著ID衝突的危險。一些常見用例:
通過過去的問題,我意識到大多數人似乎有一些非常常見的用例。這是最常見的,以及要用於它們的選項和論點:
-i -w --math false --box-width 25cm ,儘管握把可能更有效地為此目的。--toc支持Gitlab的TOC語法。--math true --emoji-support 0 --dont-make-images-links true 。-i -c將所有文件都放在一個文件中。使用--origin-type從Web轉換Markdown文件:
您可能不僅需要轉換本地的標記文件,還要轉換GitHub存儲庫,Web託管的文件或字符串的內容。只需下載這些或將它們存儲在文件中通常是不夠的,因為它們在網絡上的位置還會影響必須解決其引用的圖像的鏈接。幸運的是,GH-MD-TO-HTML使您退縮了!
您可以使用許多不同的參數來描述您給出的輸入的哪種文件:
--origin-type file :默認值;採用(相對或絕對)文件路徑--origin-type repo :以github存儲庫中的pth為單位,以格式<user_name>/<repo_name>/<branch-name>/<path_to_markdown>.md <branch-name>/<path_to_markdown> .md。--origin-type web :獲取網絡託管的Markdown文件的URL。--origin-type string :取一個包含Markdown的字符串。您使用的其中一些選項中的某些會影響降價文件中的圖像鏈接如何解決;此讀數的後面部分詳細概述了這一點。微調發生什麼:
GH-MD-TO-HTML的書面目的是為您生成一個宿主就緒的靜態網站,而當前的工作目錄是其詞根。除了使用-w來禁用此功能並允許您直接在瀏覽器中查看生成的文件外,還有許多選項可以使您可以微調何處,並且最普遍地更改網站的根源。除非您出於某種原因,否則無需這樣做,因此如果您不需要,請不要打擾閱讀!
--website-root (或-w ):如上所述,將此選項為空,使您可以直接在瀏覽器中預覽生成的HTML文件(在大多數係統上,通過雙擊它)不想託管生成的HTML文件,但也可以託管生成的HTML文件,但還可以提供任何要作為網站的目錄,以作為該網站作為該網站的根源。它默認為您當前的工作目錄。--destination (或-d ):相對於--website-root ,存儲生成的HTML文件的路徑。默認情況下,網站root用於此。--image-paths (或-i ):如上所述,您可以將其空白以禁用映像緩存(儘管如果您修改了--origin-type ,則可以使用此路徑,或提供相對於網站根的路徑以修改圖像存儲的位置。它默認為images 。image-paths - 目錄,以確保在批量轉換多個文件時可以跨文件使用此優化。--css-paths (或-c ):您可以將其空白以禁用將CSS存儲在外部CSS文件中(例如,如上所述僅轉換一個文件),或者如上所述,或提供相對於網站root的路徑以修改CSS文件(稱為github-css.css )。默認值為github-markdown-css 。--output-name (或-n ):將生成的HTML文件存儲在目標目錄中的文件名。您可以在此字符串中的任何地方使用<name> ,並將其自動替換為Markdown文件的名稱,例如, gh-md-to-html inp.md -n "<name>-conv.html"將將結果存儲在ino-conv.html中(這與--origin-type string )。-n print來簡單地將輸出寫入stdout(在控制台上打印),而不是將其保存在任何地方。默認值是<name>.html ,因此它適用於您的輸入文件名。--output-pdf (或-p ):存儲生成的PDF的文件。您也可以在此處使用<name> -Syntax。如果未使用-p -option,則不會生成PDF(並且您需要遵循上面的PDFKIT&WKHTMLTOPDF安裝指令以進行此選項工作),但是您可以使用-p而無需任何參數,以使其使用<name>.pdf作為敏感文件名稱default default。作為PDF出口:
如上所述,您可以使用--output-pdf -option將生成的HTML文件作為PDF導出。這樣做需要您安裝wkhtmltopdf (QT-Patch-patch版本),以將其添加到路徑(如果您在Windows上),並安裝了pdfkit (例如,通過pip3 install gh-md-to-html[offline_conversion] ),但所有這些要求都已經在安裝部分中列出了所有這些要求。
不過,這裡有一些值得注意的事情。首先,如果您在稱為{yourpdfexportdestination}.html的文件中有有價值的信息,請不要使用此選項,其中{yourpdfexportdestination}是您提供給-p的內容,因為此文件將在此過程中暫時覆蓋;此外,如果您向-x -option提供不信任的輸入,請勿使用-p 。
還有一些專門針對-p使用的選項;這些目前是:
--style-pdf (或-s ):將其設置為false以使用GitHub的CSS禁用生成的PDF文件。您可能要這樣做,因為Github的CSS在頁面上繪製的邊框在PDF中看起來違反直覺,儘管這樣做也可能會對其他部位的外觀產生負面影響,因此請與一粒鹽一起使用。更改要使用的核心降標轉換器:
GH-MD-TO-HTML實際上在解析降級並將其轉換為PDF時並沒有做很多繁重的舉重;取而代之的是,它圍繞著所謂的“核心轉換器”,該“核心轉換器”根據Markdown Spec進行基本轉換,並在此基礎上構建自己的選項,功能,自定義和样式。默認情況下,GitHub Markdown REST API用於此使用,因為它與GitHub對其讀書事物的作用最接近,但是您還可以給GH-MD-TO-HTML使用任何其他基本的Markdown轉換器來使用。
GH-MD-TO-HTML還配備了兩個建築替代核心轉換器,它們將盡可能近地模仿GitHub的REST API,同時添加自己的個人觸感。
決定核心轉換器的選項:
--core-converter (或-o ):您可以使用此選項從許多預定義的核心轉換器(見下文)中進行選擇,以防您想與默認情況下不同。
您還可以向此提供BASH命令(在UNIX/Linux系統上),也可以在Windows上提供cmd.exe命令,其中{md}作為佔位符,以供GH-MD-TO-HTML插入外殼輸入輸入標記。例如,
gh-md-to-html inp.md -o "pandoc -f markdown -t html <<< {md}"
將使用Pandoc作為其核心轉換器。
您也可以使用多個命令這樣做gh-md-to-html -o "printf {md} >> temp.md; pandoc -f markdown -t html temp.md; rm temp.md" ,
只要將結果打印到Stdout。
如果將python接口到GH-MD-TO-HTML,也可以提供將Markdown String轉換為HTML字符串的任何功能。
預定義的核心轉換器,您可以輕鬆地將其提供給--core-converter作為字符串:
OFFLINE :模仿GitHub的Markdown Rest API,但使用Mistune離線。這需要使用pip3 install gh-md-to-html[offline_conversion]或pip3 install mistune>=2.0.0rc1 ,這需要滿足“ Offline_conversion”的可選依賴項。OFFLINE+ :行為與離線相同,但是它並沒有像GitHub Rest API這樣的JavaScript和CSS(例如JavaScript和CSS)刪除潛在的有害內容。除非您需要一種方法來轉換安全手動檢查的Markdown文件,否則請勿使用此功能,而無需刪除所有內聯JS/樣式!支持內聯形式:
默認情況下, gh-md-to-html支持內聯公式(無論哪種核心轉換器,請參見上文,您都使用)。這意味著您可以在同一行上的兩個美元標誌之間編寫乳膠公式,並將其替換為顯示上述公式的SVG圖像。例如,
$e = m cdot c^2$
將在您的文檔中添加愛因斯坦著名的公式作為SVG圖像,與周圍的其余文本相結合。
gh-md-to-html總是試圖使用您本地的乳膠安裝來進行此轉換(優勢:快速並且不需要互聯網)。但是,如果未安裝乳膠或DVISVGM或找不到它們,它使用在線轉換器(優勢:不需要您安裝3 GB的乳膠庫)來實現此目的。
您可以使用以下選項來修改此行為:
--math (或-m ):將其設置為false到禁用公式渲染。--suppress-online-fallbacks :將其設置為true以禁用在線後備公式渲染,如果由於某種原因未在本地安裝或找不到其要求,就會引起錯誤。圖像緩存和圖像壓縮:
如上所述,GH-MD-to-HTML保存圖像,以便它們都可以從同一文件夾中加載。這帶來了
除這些優點外,GH-MD-TO-HTML還允許您設置一個圖像壓縮級別以用於這些圖像。如果您決定這樣做,則每個圖像都將轉換為JPEG(使用您喜歡的背景顏色和質量設置),並且如果生成的HTML指出,圖像將被縮小尺寸(無論如何您都可以在整個尺寸上都需要它們(您可以通過此EG使用<img>> - 在您的文檔中使用<img> - tag,並在您的文檔中直接使用它們,並與explicit width或expeact withth或height值為explacity witth或高度值)。
GH-MD-TO-HTML也是唯一能夠使用HTML srcset -ATTRIBUTE的降壓轉換器,它允許生成的文檔參考同一圖像的幾個不同規模的版本,然後瀏覽器將在其上加載最小的大型屏幕尺寸,從而使較小的屏幕尺寸大大減少,從而使移動移動eg大大減少。啟用此功能可以導致進一步的加載時間減少,而無需犧牲任何可見的圖像質量,如果您想從圖像較重的標記文件中生成快速加載網站,這使GH-MD-TO-HTML成為最佳選擇。
所有這些使用的選項是
--compress-images 。
它接受具有以下屬性的JSON數據:
bg-color :將RGBA圖像轉換為JPEG(RGB格式)時用作背景顏色的顏色。默認為“ white ”,幾乎接受任何HTML5顏色值(“ #FFFFFF ”,“ #ffffff ”,“ white ”和“ rgb(255, 255, 255) ”都是有效的值。progressive :將圖像保存為漸進式JPEG。默認值為false。srcset :保存圖像的不同規模版本,並將其提供給其SRCSET屬性中的圖像。默認為false。採用一系列不同的寬度或True數組,可作為“ [500, 800, 1200, 1500, 1800, 2000]的快捷方式”。quality :從0到100的值描述應保存圖像的質量。默認為90。如果為HTML中的特定圖像指定了特定大小,則在降低質量之前,圖像始終將其轉換為正確的大小。如果該參數空為空,則根本不使用壓縮。如果此參數設置為true,則使用所有默認值。如果將其設置為JSON數據並省略了某些值,則將其用於這些數據。
如果您在Python Frontend中使用此選項,則也可以通過DICT而不是包含JSON數據的字符串。
如果您使用-i禁用圖像緩存,則圖像壓縮將無法正常工作。
我的個人選擇:
Github味道的降價和降價一般做出了一些不受歡迎的選擇,而GH-MD-TO-HTML模仿它也使很多選擇。如果您的目標不盡可能接近(GitHub味道)降價,並且您想利用GH-MD-TO-HTML提供的全部功能,我建議以下(非常有用的)設置和選項列表。請注意,轉換用戶生成的內容時,其中一些並不安全。
--math true :默認情況下已經啟用了這一點,因此不是真正的建議,但是您很可能希望在文件中獲得乳膠數學支持。--core-converter OFFLINE+ :這將降價文件脫機而不是使用github的REST API,並允許使用不安全的內容,例如內聯代碼和您希望在Markdown文件中想要的每個HTML。--compress-images :有很多方法可以通過此選項進行填補,但是它允許在緩存的圖像上進行一些很好的優化,包括使用HTML srcset -ATTRIBUTE,目前沒有其他Markdown Converter支持AFAIK。--box-width 25cm :您很可能希望限制出於可讀性的原因顯示生成網站內容的框的寬度,除非您計劃將生成的HTML嵌入到更大的HTML文件中。--toc true :這使您可以將[[_TOC_]]用作生成文件中目錄的快捷方式。--dont-make-images-links true :默認情況下,Github將每個圖像都包裝到指向圖像源的鏈接中,除非圖像已經包裝到其他鏈接中。此選項禁用此行為,以更多地控製圖像鏈接。--emoji-support 2 :GH-MD-TO-HTML使用表情符號快捷代碼,例如:joy:然後將其替換為生成的HTML文件中的表情符號。 --emoji-support 2通過允許您使用自己的自定義表情符號來進一步將一個級別的級別,so :path/to/funny_image.png:將funny_image.png作為表情符號大小的表情符號添加到文本中。--soft-wrap-in-code-boxes true :默認情況下,Github如果有溢出的風險,則用水平滾動欄顯示其多行代碼框。使用此選項將代碼框中的軟件包裝(更合理)。請注意,這些選項是按相關性列出的,並且所有選項都有明智的默認值,因此不要對其中的數量感到不知所措。您只能仔細閱讀它們,直到找到所需的東西,然後安全地忽略其餘的。
大多數選項旨在自定義默認行為,因此對於大多數用例,它們都不是必不可少的。
usage: __main__.py [-h] [-t {file,repo,web,string}]
[-w WEBSITE_ROOT [WEBSITE_ROOT ...]]
[-d DESTINATION [DESTINATION ...]]
[-i [IMAGE_PATHS [IMAGE_PATHS ...]]]
[-c CSS_PATHS [CSS_PATHS ...]]
[-n OUTPUT_NAME [OUTPUT_NAME ...]]
[-p OUTPUT_PDF [OUTPUT_PDF ...]] [-s STYLE_PDF]
[-f FOOTER [FOOTER ...]] [-m MATH]
[-x EXTRA_CSS [EXTRA_CSS ...]]
[-o CORE_CONVERTER [CORE_CONVERTER ...]]
[-e COMPRESS_IMAGES [COMPRESS_IMAGES ...]]
[-b BOX_WIDTH [BOX_WIDTH ...]] [-a TOC]
MD-origin [MD-origin ...]
Convert markdown to HTML using the GitHub API and some additional tweaks with
python.
positional arguments:
MD-origin Where to find the markdown file that should be
converted to html
optional arguments:
-h, --help show this help message and exit
-t {file,repo,web,string}, --origin-type {file,repo,web,string}
In what way the MD-origin-argument describes the origin
of the markdown file to use. Defaults to file. The
options mean:
* file: takes a relative or absolute path to a file
* repo: takes a path to a markdown-file in a github
repository, such as <user_name>/<repo_name>/<branch-
name>/<path_to_markdown>.md
* web: takes an url to a markdown file
* string: takes a string containing the files content
-w WEBSITE_ROOT [WEBSITE_ROOT ...], --website-root WEBSITE_ROOT [WEBSITE_ROOT ...]
Only relevant if you are creating the html for a static
website which you manage using git or something similar.
--website-root is the directory from which you serve
your website (which is needed to correctly generate the
links within the generated html, such as the link
pointing to the css, since they are all root- relative),
and can be a relative as well as an absolute path.
Defaults to the directory you called this script from.
If you intent to view the html file on your laptop
instead of hosting it on a static site, website-root
should be a dot and destination not set. The reason the
generated html files use root-relative links to embed
images is that on many static websites,
https://foo/bar/index.html can be accessed via
https://foo/bar, in which case relative (non-root-
relative) links in index.html will be interpreted as
relative to foo instead of bar, which can cause images
not to load.
-d DESTINATION [DESTINATION ...], --destination DESTINATION [DESTINATION ...]
Where to store the generated html. This path is relative
to --website-root. Defaults to "".
-i [IMAGE_PATHS [IMAGE_PATHS ...]], --image-paths [IMAGE_PATHS [IMAGE_PATHS ...]]
Where to store the images needed or generated for the
html. This path is relative to website-root. Defaults to
the "images"-folder within the destination folder. Leave
this option empty to completely disable image
caching/downloading and leave all image links
unmodified.
-c CSS_PATHS [CSS_PATHS ...], --css-paths CSS_PATHS [CSS_PATHS ...]
Where to store the css needed for the html (as a path
relative to the website root). Defaults to the
"<WEBSITE_ROOT>/github-markdown-css"-folder.
-n OUTPUT_NAME [OUTPUT_NAME ...], --output-name OUTPUT_NAME [OUTPUT_NAME ...]
What the generated html file should be called like. Use
<name> within the value to refer to the name of the
markdown file that is being converted (if you don't use
"-t string"). You can use '-n print' to print the file
(if using the command line interface) or return it (if
using the python module), both without saving it.
Default is '<name>.html'.
-p OUTPUT_PDF [OUTPUT_PDF ...], --output-pdf OUTPUT_PDF [OUTPUT_PDF ...]
If set, the file will also be saved as a pdf file in the
same directory as the html file, using pdfkit, a python
library which will also need to be installed for this to
work. You may use the <name> variable in this value like
you did in --output-name. Do not use this with the -c
option if the input of the -c option is not trusted;
execution of malicious code might be the consequence
otherwise!!
-s STYLE_PDF, --style-pdf STYLE_PDF
If set to false, the generated pdf (only relevant if you
use --output-pdf) will not be styled using github's css.
-f FOOTER [FOOTER ...], --footer FOOTER [FOOTER ...]
An optional piece of html which will be included as a
footer where the 'hosted with <3 by github'-footer in a
gist usually is. Defaults to None, meaning that the
section usually containing said footer will be omitted
altogether.
-m MATH, --math MATH If set to True, which is the default, LaTeX-formulas
using $formula$-notation will be rendered.
-x EXTRA_CSS [EXTRA_CSS ...], --extra-css EXTRA_CSS [EXTRA_CSS ...]
A path to a file containing additional css to embed into
the final html, as an absolute path or relative to the
working directory. This file should contain css between
two <style>-tags, so it is actually a html file, and can
contain javascript as well. It's worth mentioning and
might be useful for your css/js that every element of
the generated html is a child element of an element with
id xxx, where xxx is "article-" plus the filename
(without extension) of:
* output- name, if output-name is not "print" and not
the default value.
* the input markdown file, if output- name is "print",
and the input type is not string. * the file with the
extra-css otherwise. If none of these cases applies, no
id is given.
-o CORE_CONVERTER [CORE_CONVERTER ...], --core-converter CORE_CONVERTER [CORE_CONVERTER ...]
The converter to use to convert the given markdown to
html, before additional modifications such as formula
support and image downloading are applied; this defaults
to using GitHub's REST API and can be
* on Unix/ any system with a cmd: a command containing
the string "{md}", where "{md}" will be replaced with an
escaped version of the markdown file's content, and
which returns the finished html. Please note that
commands for Unix-system won't work on Windows systems,
and vice versa etc.
* when using gh-md-to- html in python: A callable which
converts markdown to html, or a string as described
above.
* OFFLINE as a value to indicate that gh-md-to-html
should imitate the output of their builtin
md-to-html-converter using mistune. This requires the
optional dependencies for "offline_conversion" to be
satisfied, by using `pip3 install
gh-md-to-html[offline_conversion]` or `pip3 install
mistune>=2.0.0rc1`.
* OFFLINE+ behaves identical to OFFLINE, but it doesn't
remove potentially harmful content like javascript and
css like the GitHub REST API usually does. DO NOT USE
THIS FEATURE unless you need a way to convert secure
manually-checked markdown files without having all your
inline js stripped away!
-e COMPRESS_IMAGES [COMPRESS_IMAGES ...], --compress-images COMPRESS_IMAGES [COMPRESS_IMAGES ...]
Reduces load time of the generated html by saving all
images referenced by the given markdown file as jpeg.
This argument takes a piece of json data containing the
following information; if it is not used, no compression
is done:
* bg-color: the color to use as a background color when
converting RGBA-images to jpeg (an RGB-format). Defaults
to "white" and accepts almost any HTML5 color-value
("#FFFFFF", "#ffffff", "white" and "rgb(255, 255, 255)"
would've all been valid values).
* progressive: Save images as progressive jpegs. Default
is False.
* srcset: Save differently scaled versions of the image
and provide them to the image in its srcset attribute.
Defaults to False. Takes an array of different widths or
True, which serves as a shortcut for "[500, 800, 1200,
1500, 1800, 2000]".
* quality: a value from 0 to 100 describing at which
quality the images should be saved (this is done after
they are scaled down, if they are scaled down at all).
Defaults to 90. If a specific size is specified for a
specific image in the html, the image is always
converted to the right size. If this argument is left
empty, no compression is down at all. If this argument
is set to True, all default values are used. If it is
set to json data and values are omitted, the defaults
are also used. If a dict is passed instead of json data
(when using the tool as a python module), the dict is
used as the result of the json data.
-b BOX_WIDTH [BOX_WIDTH ...], --box-width BOX_WIDTH [BOX_WIDTH ...]
The text of the rendered file is always displayed in a
box, like GitHub READMEs and issues are. By default,
this box fills the entire screen (max-width: 100%), but
you can use this option to reduce its max width to be
more readable when hosted stand-alone; the resulting box
is always centered. --box-width accepts the same
arguments the css max-width attribute accepts, e.g. 25cm
or 800px.
-a TOC, --toc TOC Enables the use of `[[_TOC_]]`, `{:toc}` and `[toc]`
at the beginning of an otherwise empty line to create a
table of content for the document. These syntax are
supported by different markdown flavors, the most
prominent probably being GitLab-flavored markdown
(supports `[[_TOC_]]`), and since GitLab displays its
READMEs quite similar to how GitHub does it, this option
was added to improve support for GitLab- flavored
markdown.
如上所述,Markdown文件中引用的任何圖像均可在本地存儲,並使用生成的HTML中的根相關超鏈接引用。轉換器如何猜測圖像的位置在下表中顯示,在頂部顯示了ImageLink的類型,並且在左側註明了輸入標記的類型:
https://或http:// | 腹肌。 filepath | rel。 filepath | 從/ (例如/imagedir/image.png )開始 | 不以/ (例如imagedir/image.png )開頭 | |
|---|---|---|---|---|---|
-t file | 從地址 | 腹肌。 filepath | rel。 filepath(從.md -file躺在哪裡) | - | - |
-t string | 從地址 | ABS.Filepath,但出於安全原因需要確認 | rel。 filepath(從撥打該工具的位置),但出於安全原因需要確認 | - | - |
username/repo/dir/file.md -t repo | 從地址 | - | - | username/repo/imagedir/image.png | username/repo/dir/imagedir/image.png |
https://foo.com/bar/baz.md -t web | 從地址 | - | - | https://foo.com/image.png | https://foo.com/bar/image.png |
與我的所有項目一樣,反饋(即使只是很小的東西,例如告訴我您的項目用例,或者告訴我您不喜歡Realme的結構,或者告訴我您特別喜歡一個特定的功能)也非常感謝,並幫助我使該項目變得更好,即使它很小!您可以通過反饋,簡短和非正式的反饋問題放棄問題,或者如果您不想出於某種原因提出問題,則可以給我發送電子郵件。我目前不打算在將來添加功能,但是我總是願意修復和調整現有功能,文檔等,並且我顯然很想听聽您的功能建議,即使我不打算在不久的將來添加它們。
在GitHub問題方面,我通常非常響應,並且我將它們非常認真,並嘗試盡快解決它們。如果您遇到錯誤,怪異的行為,安裝錯誤等,而在使用我的工具時,請隨時在問題中告訴我,因此我可以解決問題!
如果您發現此工具很有用,請考慮將其主演在Github上,向我表示感謝!如果您告訴我有關您遇到的問題,即使您設法在自己的代碼副本中修復了它們,我也會很感激,這樣我也可以在此存儲庫中修復它們。
gh-md-to-html進行MD-to-pdf轉換(在有關MD-to-pdf轉換的要點下):鏈接gh-md-to-html :鏈接圖標是由
。
。
Arrow-Icon:戴夫·甘迪(Dave Gandy)的字體很棒
github-icon:IconScout上的github圖標
免責聲明:該模塊既不由GitHub編寫,也不是由GitHub認可的,該模塊由Github支持,由Github提供支持,也不受Github的附屬功能。它僅使用GitHub提供的公共API以及GitHub根據MIT許可證的.CSS文件。