2017-08-01 89 views
1

我正在研究一個現有的項目,該項目已經有一個描述功能和任何相關信息的降價文件。
我想創建一個單一的幫助文件,可以在不同的平臺Windows/OS/Linux上查看。
對於這段時間我已經把markdown文件轉換成了html文件,然後將帶有圖片文件夾的index.html壓縮到一個zip文件中。
但是,如果可能的話,我希望有一個幫助文件可以直接查看而不需要解壓。從現有的降價文件創建單個跨平臺幫助文件

到目前爲止,我已經拒絕了具體原因如下解決方案:

  1. MHTML和可能遇到的與不同平臺不同瀏覽器的問題,還有對插件的需要
  2. CHM通常是基於窗口格式。
  3. 無論我從markdown轉換到pdf(phantomjs,pandoc)的轉換結果都不令人滿意,那麼選擇的pdf文件應該從零開始創建,我希望避免。

所以我想問一下,是否有辦法實現跨平臺單一幫助文件的生成,還是應該堅持使用zip解決方案?

回答

1

我有和你一樣的問題,最後我用一個解決方案在輸出中給我一個HTML文件。

我寫我的Markdown內容與Sublime Text,我使用這個擴展構建降價到HTML文件:

Sublime Text Markdown Preview

它允許我生成一個HTML文件,以嵌入的CSS(它給我一個GitHub像markdown渲染)和嵌入圖像(使用base64編碼)。

如果你想添加你的特定的CSS樣式表,並且有很多可用的自定義。

這是我如何配置插件:

{ 
    "browser": "default", 
    "parser": "markdown", 
    "build_action": "build", 
    "enable_mathjax": true, 
    "enable_uml": true, 
    "enable_highlight": true, 
    "enable_pygments": true, 
    "guess_language": true, 
    "enabled_extensions": "default", 
    "enabled_parsers": ["github", "markdown" ], 
    "markdown_binary_map": { 
     "multimarkdown": ["/usr/local/bin/multimarkdown"] 
    }, 
    "github_mode": "markdown", 
    "github_inject_header_ids": false, 
    "css": ["default"], 
    "allow_css_overrides": true, 
    "enable_autoreload": true, 
    "markdown_filetypes": [".md", ".markdown", ".mdown"], 
    "html_simple": false, 
    "image_path_conversion": "base64", 
    "file_path_conversions": "absolute", 
    "strip_critic_marks": "none", 
    "strip_yaml_front_matter": false, 
    "show_panel_on_build": true, 
    "embed_css_for_sublime_output": true 
} 

我知道這是非常具體的文本編輯器的答案,但我希望它可以幫助。