With no options set mdc creates HTML files for each of the files from the command line:
Notice that the output files contain the markup source at the end of the file as HTML comment but .html are not accepted as arguments. With no filename mdc compiles the input from stdin.
-m mode option to select another operation mode.
|compile||Translate the given markup files.|
|edit||Edit and compile the file's markup source.|
|source||Print the HTML file's markup source.|
source work only on a single file.
Here are some hints how to use other shell commands with mdc.
lynx is a well-known HTTP/HTML-browser for the UNIX console.
Calling an editor to edit local files is supported; simply press E
inside lynx. However, the editor needs to be configured. For
mdc-generated HTML files you would set the options
edit'. When you invoke the editor mdc
When editing markup from within an HTML file mdc creates a
backup file of it.
You can create a wrapper shell script like
#!/bin/sh # # mde - Run lynx to read and edit .md files # if [ -f ~/.config/lynx/markdown.lss ]; then OPT="$OPT -lss=~/.config/lynx/markdown.lss" fi exec lynx -scrollbar -use_mouse \ $OPT \ -editor='mdc -m edit' "$@"
that sets the editor plus you preferred options.
w3m is another console browser and it allows to editing local files too. For integration with mdc you would put
editor mdc -m edit %s
into ~/.w3m/config or set that with the
-o option on the command
line. Think about a wrapper script like the one above. Furthermore,
in w3m you must use SHIFT+E to edit the file.
vim can automatically reformat text to make if fit on lines. This works if you have set the line width first:
tw is an alias for
textwidth). For manual reformatting you must
select the lines (SHIFT+V) and give the command
gw. You can set the
and vim breaks the lines automatically as you type the text. To activate these settings automatically put
setlocal textwidth=72 setlocal formatoptions+=a
into your ~/.vim/ftplugin/markdown.vim.