Command Line Operations
In addition to opening files and folders from the command line you can also perform a few operational tasks using Markdown Monster's Command Line Interface.
There are three sets of commands:
- Editor UI commands using
- Operational CLI Commands using
mmcliare all available on the Windows Path by default, as they have been added to the User path during installation or 1st startup.
You can also launch Markdown Monster from Windows Subsystem for Linux (WSL) by using the full executable names:
mmcli.exe. For example, to open
README.mdfrom a local WSL folder use:
mm.exe README.md. Note that unlike on Windows the
.exeextension is required.
The following commands are command line switches that affect the behavior and startup of Markdown Monster's UI. They are fired using either
markdownmonster.exe which can be used interchangeably.
|-line||Line number when opening a document
|-presentation||Flag that starts Markdown Monster in Presentation Mode
|-newwindow||Flag that forces a new Window to be opened regardless of the
|-nosplash||When specified won't show the splash screen.
|-delay||When specified loads Markdown Monster with a delay. Used for updates.
|Closes a file that is open in the editor if found
|When set forces the document(s) opened from the command line to auto-save after any typing operation.
|-stdin||Read content from StdIn using pipe command. Opens a new 'untitled' document.
|Opens a new 'untitled' document with the base 64 decoded text inside of it.
|-startwebserver||Starts the MM internal Web Server for various remote operations
|-stopwebserver||Stops the MM internal Web Server
If you want to start Markdown Monster in presentation mode that shows the preview as a maximized view, use the
-presentation switch. This view doesn't show the editor initially although you switch into regular editing mode. You can use this switch in addition to optional files you want to open.
mm .\README.md -presentationmode or
This flag forces a new Markdown Monster window to be opened with the selected file(s) or folder to be opened, rather than opening the document in the current instance. This setting forces a new window even if the
SingleInstance configuration setting is set to
true. This is used internally for Open in New Window, but useful anytime when you want to open side by side windows. You can use this switch
mm .\README.md -newwindow or
When specified causes the startup splash screen to not be displayed. Same as the
DisableSplashScreen configuration switch, except it's a one time operation that applies only to the current launch operation.
mm .\README.md -nosplash or
Delays loading Markdown Monster during startup. Used internally when Markdown Monster is restarted for theme updates and other settings that require a restart. Delay is approximately 1.5 seconds.
mm .\README.md -delay
If this switch is specified when passing in one or more filenames for opening, the files are opened in auto-save mode, which means any changes are written to disk whenever the user stops typing for a brief moment. This can be useful for external applications that want to use Markdown Monster for editing and detect changes in the editor immediately.
mm .\README.md -autosave
This option allows you to close an already open file in the editor. If you have multiple tabs open the tab is closed and if the last tab is closed Markdown Monster is shut down. This can be useful for external applications that might want to open Markdown Monster for external Markdown editing, capture output saved to disk perhaps with the
-autosave switch, and then close the opened editor window.
mm .\README.md -close
This option allows you to capture StdIn input from another application and open the captured text in Markdown Monster as a new document. For this to work you can pipe the content of another console application into Markdown Monster using the Windows Pipe Command.
DIR | markdownmonster stdin
This option creates a new, 'Untitled' document and sets the initial text to -base64text.
mm -base64text IyBIZWxsbyBXb3JsZAoKSXQncyBhICoqY3J1ZWwsIGNydWVsKiogd29ybGQu
These commands allow you to start and stop the MM internal Web server which can be used to remotely open and access documents.
mm -startwebserver mm -stopwebserver
The following commands use a separate
mmcli.exe to perform a number of useful automated operations using Markdown Monster's functionality.
|version||Displays Markdown Monster Version.
|reset||Resets Markdown Monster to its default settings.
|uninstall||Removes all Markdown Monster machine settings. Run after you've shut down all Markdown Monster
|setportable||Sets portable mode where settings are stored in the install folder
|unsetportable||Sets back to desktop mode with config settings to
|register||Registers Markdown Monster installation.
|markdowntohtml||Converts Markdown documents to HTML.
|htmltomarkdown||Converts an HTML document to Markdown.
|markdowntopdf||Converts a Markdown document to a PDF file.
Displays the Markdown Monster version in the console window.
The reset operation resets all of Markdown Monster's settings back to its defaults by creating a new
MarkdownMonster.json file. The reset command also creates a backup file in the same folder that you can compare against.
The uninstall option removes all the machine specific settings from the registry so you end up with a clean machine. This command is primarily intended for portable installs, which although it runs portably in a self-contained folder (if permissions allow), will write a few things like file associations and pathing into the registry. The
uninstall command removes only those settings.
Uninstall does not remove any files or folders. If you are running a machine wide installation settings are stored in
%appdata%\Markdown Monster and if you are sure you want to completely remove Markdown Monster you can delete this folder manually - the uninstall will not touch this folder.
If you installed the full version of Markdown Monster using the Installer it's recommended you run the full Uninstall through Programs and Features or by running the
Uninstall.exein the install folder.
The full uninstall removes the same settings as the
uninstallswitch but also removes files, folders and the shortcuts it created.
These two settings toggle between portable and full desktop install. The primary differences between a portable install and a full install is the location of the settings folder. The portable install tries to create a
.\PortableSettings folder in the install directory and keep all settings local to that install. A portable install can be installed simply by copying files from a zip file.
However, in order for a portable install to work you have to make sure you use a folder that has write permissions to allow configuration settings to be updated in this folder.
setportable allows you to switch a full install into portable mode by creating a
_IsPortable file and creating the local
.\PortableSettings folder if permissions allow. If permissions fail, MM will use the standard
%appdata%\Markdown Monster location the full install uses.
unsetportable simply removes the
_IsPortable file which makes Markdown Monster use the default
%appdata%\Markdown Monster folder for all settings and addins.
This option lets you register Markdown Monster via the command line. Provide the register command plus the registration key to register the product without having to launch Markdown Monster and register through the interactive registration dialog.
mmcli register <regKey>
This allows you convert a markdown document to HTML using the following syntax:
mmcli markdowntohtml -i "<markdownFile>" -o "<htmlFile>" --rendermode [html|fragment|packagedhtml|zip] --theme [<anyAvailableTheme>] -open
You pass the input markdown and output HTML file to generate. If you skip either of these you'll be prompted. The
--open parameter opens the document in Markdown Monster via
mm "<htmlfile>" .
renderMode is one of the following:
- html - Html document with Preview Theme wrapper document (default)
- fragment - Just the raw Html fragment without a wrapping PreviewTheme document
- packagedhtml - single, large HTML document with all dependencies embedded as inline resources
- htmlfiles - Html document with dependencies in the output file folder
- zip - Html document and dependencies packaged into a Zip file
Note that all options except
fragment render a complete HTML document using the current PreviewTheme configured, unless you override the
--theme parameter where you can specify any of the installed themes.
-open flag if present opens the document in the browser after completion.
This allows you to convert HTML documents to Markdown using the same mechanism as Paste Html in the Markdown Monster editor view. The command line for this looks like this:
mmcli htmltomarkdown -i "<inputHtmlFile>" -o "<outputMarkdownFile>" -open
You pass an HTML file as input and a Markdown document as output. If files aren't provided MM prompts for file names. The
-open flag opens the Markdown document in Markdown Monster after generation.
This option allows you to print a Markdown document into a PDF file.
mmcli markdowntopdf -i "<inputMarkdownFile>" -o "outputPdfFile" -open --theme [<anyAvailableTheme>] --orientation [Portrait|Landscape] --page-size [Letter|Legal|A4|B4]
See alsoOpen Files from the Command Line
Comment or report problem with topic