# Define Our Project
# ==================
-set (My_Project_Title "MultiMarkdown 6")
+set (My_Project_Title "MultiMarkdown")
set (My_Project_Description "Lightweight markup processor to produce HTML, LaTeX, and more.")
set (My_Project_Author "Fletcher T. Penney")
set (My_Project_Revised_Date "2017-02-14")
src/writer.h
)
+set (scripts
+ scripts/mmd
+ scripts/mmd2all
+ scripts/mmd2opml
+ scripts/mmd2odf
+ scripts/mmd2pdf
+ scripts/mmd2tex
+ scripts/markdown
+)
+
+set (latex
+ texmf/tex/latex/mmd6/mmd6-article-begin.tex
+ texmf/tex/latex/mmd6/mmd6-article-footer.tex
+ texmf/tex/latex/mmd6/mmd6-article-leader.tex
+ texmf/tex/latex/mmd6/mmd6-criticmarkup.tex
+ texmf/tex/latex/mmd6/mmd6-default-metadata.tex
+ texmf/tex/latex/mmd6/mmd6-memoir-footer.tex
+ texmf/tex/latex/mmd6/mmd6-memoir-layout-8.5x11.tex
+ texmf/tex/latex/mmd6/mmd6-memoir-packages.tex
+ texmf/tex/latex/mmd6/mmd6-memoir-setup.tex
+ texmf/tex/latex/mmd6/mmd6-tufte-book-begin.tex
+ texmf/tex/latex/mmd6/mmd6-tufte-book-footer.tex
+ texmf/tex/latex/mmd6/mmd6-tufte-book-leader.tex
+ texmf/tex/latex/mmd6/mmd6-tufte-footer.tex
+ texmf/tex/latex/mmd6/mmd6-tufte-handout-begin.tex
+ texmf/tex/latex/mmd6/mmd6-tufte-handout-footer.tex
+ texmf/tex/latex/mmd6/mmd6-tufte-handout-leader.tex
+)
+
# Public headers, will be installed in 'include'
# Do not manually add files here, use the ADD_PUBLIC_HEADER() macro
set(public_header_files
# install (FILES ${public_header_files} DESTINATION local/include/libFoo)
+# Install MMD binary
+install (TARGETS multimarkdown
+ DESTINATION bin
+ COMPONENT application
+)
+set (CPACK_COMPONENT_APPLICATION_DISPLAY_NAME "MultiMarkdown")
+set (CPACK_COMPONENT_APPLICATION_DESCRIPTION "Install the actual `multimarkdown` program.")
+
+
+# Install utility scripts
+install (FILES ${scripts}
+ DESTINATION bin
+ COMPONENT scripts
+ PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+)
+set (CPACK_COMPONENT_SCRIPTS_DISPLAY_NAME "Convenience scripts")
+set (CPACK_COMPONENT_SCRIPTS_DESCRIPTION "Install convenience scripts for common MultiMarkdown shortcuts, e.g. `mmd`, `mmd2tex`, etc.")
+
+
+# Install LaTeX support files
+install (FILES ${latex}
+ DESTINATION share/texmf/mmd6
+ COMPONENT latex
+ PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ
+)
+set (CPACK_COMPONENT_LATEX_DISPLAY_NAME "LaTeX support files")
+set (CPACK_COMPONENT_LATEX_DESCRIPTION "Install configuration files for MultiMarkdown-based LaTex configurations.")
+
+
+# Which groups should be installed?
+set (CPACK_COMPONENTS_ALL application scripts latex)
+
+set (CPACK_PACKAGE_NAME "MultiMarkdown6")
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "${My_Project_Description}")
-set (CPACK_PACKAGE_VENDOR "${My_Project_Author}")
+#set (CPACK_PACKAGE_VENDOR "${My_Project_Author}")
+set (CPACK_PACKAGE_VENDOR "fletcherpenney.net")
set (CPACK_PACKAGE_VERSION "${My_Project_Version_Major}.${My_Project_Version_Minor}.${My_Project_Version_Patch}")
set (CPACK_PACKAGE_VERSION_MAJOR "${My_Project_Version_Major}")
set (CPACK_PACKAGE_VERSION_MINOR "${My_Project_Version_Minor}")
set (CPACK_PACKAGE_INSTALL_DIRECTORY ${PROJECT})
+set (CPACK_PACKAGE_CONTACT "fletcher@fletcherpenney.net")
+
include (CPack)
| | |
| ---------- | ------------------------- |
-| Title: | MultiMarkdown 6 |
+| Title: | MultiMarkdown |
| Author: | Fletcher T. Penney |
| Date: | 2017-02-14 |
| Copyright: | Copyright © 2016 - 2017 Fletcher T. Penney. |
--- /dev/null
+#!/bin/sh
+#
+# markdown --- MultiMarkdown convenience script
+# <http://fletcherpenney.net/multimarkdown/>
+# Fletcher T. Penney
+#
+# Pass arguments on to the binary to convert text to XHTML
+#
+
+# Be sure to include multimarkdown in our PATH
+export PATH="$PWD:/usr/local/bin:$PATH"
+
+which multimarkdown > /dev/null
+if [ $? = 1 ]
+then
+ echo multimarkdown executable not found! >&2
+ exit 1
+fi
+
+if [ $# = 0 ]
+then
+ multimarkdown -c
+else
+until [ "$*" = "" ]
+do
+ multimarkdown -c -b "$1"
+ shift
+done
+fi
--- /dev/null
+@ECHO OFF\r
+:Loop\r
+IF "%1"=="" GOTO Continue\r
+ "%~dp0\multimarkdown" -c -b "%1"\r
+SHIFT\r
+GOTO Loop\r
+:Continue\r
+\r
--- /dev/null
+#!/bin/sh
+#
+# mmd --- MultiMarkdown convenience script
+# <http://fletcherpenney.net/multimarkdown/>
+# Fletcher T. Penney
+#
+# Pass arguments on to the binary to convert text to XHTML
+#
+
+# Be sure to include multimarkdown in our PATH
+export PATH="$PWD:/usr/local/bin:$PATH"
+
+which multimarkdown > /dev/null
+if [ $? = 1 ]
+then
+ echo multimarkdown executable not found! >&2
+ exit 1
+fi
+
+if [ $# = 0 ]
+then
+ multimarkdown
+else
+until [ "$*" = "" ]
+do
+ multimarkdown -b "$1"
+ shift
+done
+fi
--- /dev/null
+@ECHO OFF\r
+:Loop\r
+IF "%1"=="" GOTO Continue\r
+ "%~dp0\multimarkdown" -b "%1"\r
+SHIFT\r
+GOTO Loop\r
+:Continue\r
+\r
--- /dev/null
+#!/bin/sh
+#
+# mmd2all --- MultiMarkdown convenience script
+# <http://fletcherpenney.net/multimarkdown/>
+# Fletcher T. Penney
+#
+# Pass arguments on to the binary to convert text to multiple
+# formats and open them
+#
+
+# Be sure to include multimarkdown in our PATH
+export PATH="$PWD:/usr/local/bin:$PATH"
+
+which multimarkdown > /dev/null
+if [ $? = 1 ]
+then
+ echo multimarkdown executable not found! >&2
+ exit 1
+fi
+
+if [ $# = 0 ]
+then
+ echo "Can't work on stdin"
+else
+until [ "$*" = "" ]
+do
+ file_name=`echo $1| sed 's/\.[^.]*$//'`
+
+ multimarkdown -b "$1"
+# open "$file_name.html"
+
+ multimarkdown -b -t latex "$1"
+# mate "$file_name.tex"
+
+ multimarkdown -b -t odf "$1"
+# open "$file_name.fodt"
+
+ multimarkdown -b -t opml "$1"
+# open "$file_name.opml"
+
+ shift
+done
+fi
--- /dev/null
+#!/bin/sh
+#
+# mmd2odf --- MultiMarkdown convenience script
+# <http://fletcherpenney.net/multimarkdown/>
+# Fletcher T. Penney
+#
+# Pass arguments on to the binary to convert text to OpenDocument
+#
+
+# Be sure to include multimarkdown in our PATH
+export PATH="$PWD:/usr/local/bin:$PATH"
+
+which multimarkdown > /dev/null
+if [ $? = 1 ]
+then
+ echo multimarkdown executable not found! >&2
+ exit 1
+fi
+
+if [ $# = 0 ]
+then
+ multimarkdown -t odf
+else
+until [ "$*" = "" ]
+do
+ multimarkdown -b -t odf "$1"
+ shift
+done
+fi
--- /dev/null
+@ECHO OFF\r
+:Loop\r
+IF "%1"=="" GOTO Continue\r
+ "%~dp0\multimarkdown" -b -t odf "%1"\r
+SHIFT\r
+GOTO Loop\r
+:Continue\r
+\r
--- /dev/null
+#!/bin/sh
+#
+# mmd2opml --- MultiMarkdown convenience script
+# <http://fletcherpenney.net/multimarkdown/>
+# Fletcher T. Penney
+#
+# Pass arguments on to the binary to convert text to OPML
+#
+
+# Be sure to include multimarkdown in our PATH
+export PATH="$PWD:/usr/local/bin:$PATH"
+
+which multimarkdown > /dev/null
+if [ $? = 1 ]
+then
+ echo multimarkdown executable not found! >&2
+ exit 1
+fi
+
+if [ $# = 0 ]
+then
+ multimarkdown -t opml
+else
+until [ "$*" = "" ]
+do
+ multimarkdown -b -t opml "$1"
+ shift
+done
+fi
--- /dev/null
+@ECHO OFF\r
+:Loop\r
+IF "%1"=="" GOTO Continue\r
+ "%~dp0\multimarkdown" -b -t opml "%1"\r
+SHIFT\r
+GOTO Loop\r
+:Continue\r
+\r
--- /dev/null
+#!/bin/sh
+#
+# mmd2pdf --- MultiMarkdown convenience script
+# <http://fletcherpenney.net/multimarkdown/>
+# Fletcher T. Penney
+#
+# Pass arguments on to the binary to convert text to LaTeX
+# Then use latexmk to process into PDF.
+# Requires a few extra passes of pdflatex to be sure all autorefs
+# are managed.
+# Then call latexmk with -c option to try and clean up some extra files.
+#
+# NOTE: This file is included as a convenience for users - it's not
+# likely to fail gracefully if there are any issues in your
+# LaTeX file.
+
+# Be sure to include multimarkdown and latex in our PATH
+export PATH="$PWD:/usr/local/bin:/usr/texbin:/Library/TeX/texbin:$PATH"
+
+which multimarkdown > /dev/null
+if [ $? = 1 ]
+then
+ echo multimarkdown executable not found! >&2
+ exit 1
+fi
+
+if [ $# = 0 ]
+then
+ multimarkdown -t latex
+else
+until [ "$*" = "" ]
+do
+ multimarkdown -b -t latex "$1"
+
+ file_name=`echo $1| sed 's/\.[^.]*$//'`
+
+ # Check for XeLaTeX mode
+
+ xelatex=`multimarkdown -e usexelatex "$1"`
+
+ if [ "$xelatex" != "" ]
+ then
+ # Use XeLaTeX
+
+ xelatex "$file_name.tex"
+
+ if [ "$?" = "127" ]
+ then
+ echo "It doesn't appear that xelatex is installed properly." 1>&2
+ echo "Be sure you have a working LaTeX installation." 1>&2
+ exit 1
+ fi
+
+ xelatex "$file_name.tex"
+ xelatex "$file_name.tex"
+ xelatex "$file_name.tex"
+ latexmk -c "$file_name.tex"
+
+ else
+ # Use LaTeX
+ latexmk "$file_name.tex"
+
+ if [ "$?" = "127" ]
+ then
+ echo "It doesn't appear that latexmk is installed properly." 1>&2
+ echo "Be sure you have a working LaTeX installation." 1>&2
+ exit 1
+ fi
+
+ makeglossaries "$file_name"
+ pdflatex "$file_name.tex"
+ pdflatex "$file_name.tex"
+ latexmk -c "$file_name.tex"
+
+ fi
+
+ shift
+done
+fi
--- /dev/null
+#!/bin/sh
+#
+# mmd2rtf --- MultiMarkdown convenience script
+# <http://fletcherpenney.net/multimarkdown/>
+# Fletcher T. Penney
+#
+# Pass arguments on to the binary to convert text to OpenDocument
+#
+
+# NOTE: MultiMarkdown's RTF support is limited at best. If you find
+# something that isn't working properly, submit code for a proposed
+# fix via github or email. But don't just send a message letting me
+# know it isn't working. ;)
+#
+# Be sure to include multimarkdown in our PATH
+export PATH="$PWD:/usr/local/bin:$PATH"
+
+which multimarkdown > /dev/null
+if [ $? = 1 ]
+then
+ echo multimarkdown executable not found! >&2
+ exit 1
+fi
+
+if [ $# = 0 ]
+then
+ multimarkdown -t rtf
+else
+until [ "$*" = "" ]
+do
+ multimarkdown -b -t rtf "$1"
+ shift
+done
+fi
--- /dev/null
+@ECHO OFF\r
+:Loop\r
+IF "%1"=="" GOTO Continue\r
+ "%~dp0\multimarkdown" -b -t rtf "%1"\r
+SHIFT\r
+GOTO Loop\r
+:Continue\r
+\r
--- /dev/null
+#!/bin/sh
+#
+# mmd2tex --- MultiMarkdown convenience script
+# <http://fletcherpenney.net/multimarkdown/>
+# Fletcher T. Penney
+#
+# Pass arguments on to the binary to convert text to LaTeX
+#
+
+# Be sure to include multimarkdown in our PATH
+export PATH="$PWD:/usr/local/bin:$PATH"
+
+which multimarkdown > /dev/null
+if [ $? = 1 ]
+then
+ echo multimarkdown executable not found! >&2
+ exit 1
+fi
+
+if [ $# = 0 ]
+then
+ multimarkdown -t latex
+else
+until [ "$*" = "" ]
+do
+ multimarkdown -b -t latex "$1"
+ shift
+done
+fi
--- /dev/null
+@ECHO OFF\r
+:Loop\r
+IF "%1"=="" GOTO Continue\r
+ "%~dp0\multimarkdown" -b -t latex "%1"\r
+SHIFT\r
+GOTO Loop\r
+:Continue\r
+\r
// '--help' takes precedence
if (a_help->count > 0) {
- printf("\n%s v%s\n\n", MULTIMARKDOWN_6_NAME, MULTIMARKDOWN_6_VERSION);
+ printf("\n%s v%s\n\n", MULTIMARKDOWN_NAME, MULTIMARKDOWN_VERSION);
printf("\tUsage: %s", binname);
arg_print_syntax(stdout, argtable, "\n\n");
printf("Options:\n");
if (nerrors > 0) {
// Report errors
- arg_print_errors(stdout, a_end, MULTIMARKDOWN_6_NAME);
+ arg_print_errors(stdout, a_end, MULTIMARKDOWN_NAME);
printf("Try '%s --help' for more information.\n", binname);
exitcode = 1;
goto exit;
// '--version' also takes precedence
if (a_version->count > 0) {
- printf("\nMultiMarkdown 6 v%s\n", MULTIMARKDOWN_6_VERSION);
- printf("%s\n\n", MULTIMARKDOWN_6_COPYRIGHT);
- printf("%s\n", MULTIMARKDOWN_6_LICENSE);
+ printf("\nMultiMarkdown 6 v%s\n", MULTIMARKDOWN_VERSION);
+ printf("%s\n\n", MULTIMARKDOWN_COPYRIGHT);
+ printf("%s\n", MULTIMARKDOWN_LICENSE);
printf("\n");
goto exit;
}
--- /dev/null
+%
+% For setup that must follow metadata included in the document
+%
+
+\usepackage[
+ plainpages=false,
+ pdfpagelabels,
+ pdftitle={\mytitle},
+ pagebackref,
+ pdfauthor={\myauthor},
+ pdfkeywords={\mykeywords}
+ ]{hyperref}
+\usepackage{memhfixc}
+
+
+\input{mmd6-title}
+
+
+\begin{document}
+
+\VerbatimFootnotes
+
+\title{\mytitle}
+\author{\myauthor}
+
+\ifx\mydate\undefined
+\else
+ \date{\mydate}
+\fi
+
+\mainmatter
+\maketitle
+
+
+% Copyright
+\setlength{\parindent}{0pt}
+
+\ifx\mycopyright\undefined
+\else
+ \textcopyright{} \mycopyright
+\fi
+
+\setlength{\parindent}{1em}
+
--- /dev/null
+%
+% Configure LaTeX to produce an article using the memoir class
+%
+
+\input{mmd6-memoir-footer}
--- /dev/null
+%
+% Configure LaTeX to produce an article using the memoir class
+%
+
+\documentclass[oneside,article]{memoir}
+
+\input{mmd6-memoir-setup}
--- /dev/null
+% CriticMarkup Support
+\usepackage{soul}
+\usepackage{xargs}
+\usepackage{todonotes}
+\newcommandx{\cmnote}[2][1=]{\todo[linecolor=red,backgroundcolor=red!25,bordercolor=red,#1]{#2}}
+
--- /dev/null
+%
+% Configure default metadata in case it's missing to avoid errors
+%
+
+\def\myauthor{Author}
+\def\defaultemail{}
+\def\defaultposition{}
+\def\defaultdepartment{}
+\def\defaultaddress{}
+\def\defaultphone{}
+\def\defaultfax{}
+\def\defaultweb{}
+\def\defaultaffiliation{}
+
+\def\mytitle{Title}
+\def\subtitle{}
+\def\mykeywords{}
+
+
+\def\bibliostyle{plain}
+% \def\bibliocommand{}
+
+\def\myrecipient{}
+
+% Overwrite with your own if desired
+%\input{ftp-metadata}
+
--- /dev/null
+%
+% MultiMarkdown default footer file
+%
+
+
+% Back Matter
+\if@mainmatter
+ we're in main
+ \backmatter
+\fi
+
+
+% Bibliography
+
+\ifx\bibliocommand\undefined
+\else
+ \bibliographystyle{\bibliostyle}
+ \bibliocommand
+\fi
+
+
+
+% Glossary
+\printglossaries
+
+
+% Index
+\printindex
+
--- /dev/null
+%
+% 8.5 x 11 layout for memoir-based documents
+%
+
+
+%%% need more space for ToC page numbers
+\setpnumwidth{2.55em}
+\setrmarg{3.55em}
+
+%%% need more space for ToC section numbers
+\cftsetindents{part}{0em}{3em}
+\cftsetindents{chapter}{0em}{3em}
+\cftsetindents{section}{3em}{3em}
+\cftsetindents{subsection}{4.5em}{3.9em}
+\cftsetindents{subsubsection}{8.4em}{4.8em}
+\cftsetindents{paragraph}{10.7em}{5.7em}
+\cftsetindents{subparagraph}{12.7em}{6.7em}
+
+%%% need more space for LoF numbers
+\cftsetindents{figure}{0em}{3.0em}
+
+%%% and do the same for the LoT
+\cftsetindents{table}{0em}{3.0em}
+
+%%% set up the page layout
+\settrimmedsize{\stockheight}{\stockwidth}{*} % Use entire page
+\settrims{0pt}{0pt}
+
+\setlrmarginsandblock{1.5in}{1.5in}{*}
+\setulmarginsandblock{1.5in}{1.5in}{*}
+
+\setmarginnotes{17pt}{51pt}{\onelineskip}
+\setheadfoot{\onelineskip}{2\onelineskip}
+\setheaderspaces{*}{2\onelineskip}{*}
+\checkandfixthelayout
\ No newline at end of file
--- /dev/null
+%
+% Default packages for memoir documents created by MultiMarkdown
+%
+
+\usepackage{fancyvrb} % Allow \verbatim et al. in footnotes
+\usepackage{graphicx} % To enable including graphics in pdf's
+\usepackage{booktabs} % Better tables
+\usepackage{tabulary} % Support longer table cells
+\usepackage[T1]{fontenc} % Use T1 font encoding for accented characters
+\usepackage[utf8]{inputenc} % For UTF-8 support
+\usepackage{xcolor} % Allow for color (annotations)
+\usepackage{listings} % Allow for source code highlighting
+\usepackage[sort&compress]{natbib} % Better bibliography support
+\usepackage{acronym} % Support acronyms
+\usepackage[normalem]{ulem} % Support strikethrough
+
+\input{mmd6-criticmarkup}
--- /dev/null
+%
+% Generic Configuration for memoir-based documents
+%
+
+\usepackage{layouts}[2001/04/29]
+
+
+% In case we need a glossary, or index
+\usepackage{glossaries}
+\glstoctrue
+\makeglossaries
+\makeindex
+
+
+% Basic page layout configuration
+\def\mychapterstyle{default}
+\def\mypagestyle{headings}
+
+
+% Use 8.5 x 11 inch page layout
+\input{mmd6-memoir-layout-8.5x11}
+
+
+% Use default packages for memoir setup
+\input{mmd6-memoir-packages}
+
+
+% Configure default metadata to avoid errors
+\input{mmd6-default-metadata}
+
+
--- /dev/null
+
+
+\title{\mytitle}
+\author{\myauthor}
+
+\ifx\mydate\undefined
+\else
+ \date{\mydate}
+\fi
+
+\begin{document}
+\maketitle
+
+\tableofcontents
+%\listoffigures
+%\listoftables
--- /dev/null
+\input{mmd6-tufte-footer}
--- /dev/null
+%
+% tufte-latex book for MultiMarkdown
+% http://code.google.com/p/tufte-latex/
+%
+% Creates a basic handout emulating part of Edward Tufte's style
+% from some of his books
+%
+% * Only h1 and h2 are valid
+% * \citep may be better than \cite
+% * \autoref doesn't work properly, may get better results with \ref
+% * footnotes don't work inside of tables
+%
+
+
+\documentclass{tufte-book}
+%\documentclass[justified]{tufte-handout}
+
+
+% Use default packages for memoir setup
+
+\usepackage{fancyvrb} % Allow \verbatim et al. in footnotes
+\usepackage{graphicx} % To enable including graphics in pdf's
+\usepackage{booktabs} % Better tables
+\usepackage{tabulary} % Support longer table cells
+\usepackage[utf8]{inputenc} % For UTF-8 support
+\usepackage[T1]{fontenc} % Use T1 font encoding for accented characters
+\usepackage{xcolor} % Allow for color (annotations)
+\usepackage{listings} % Allow for source code highlighting
+\usepackage{subscript}
+\usepackage{acronym} % Support acronyms
+
+
+\usepackage{glossaries}
+\glstoctrue
+\makeglossaries
+\makeindex
+
+
+% Configure default metadata to avoid errors
+\input{mmd6-default-metadata}
+
--- /dev/null
+
+
+% Bibliography
+
+\ifx\bibliocommand\undefined
+\else
+ \bibliographystyle{\bibliostyle}
+ \bibliocommand
+\fi
+
--- /dev/null
+
+
+\title{\mytitle}
+\author{\myauthor}
+
+\ifx\mydate\undefined
+\else
+ \date{\mydate}
+\fi
+
+\begin{document}
+\maketitle
+
--- /dev/null
+\input{mmd6-tufte-footer}
--- /dev/null
+%
+% tufte-latex handout for MultiMarkdown
+% http://code.google.com/p/tufte-latex/
+%
+% Creates a basic handout emulating part of Edward Tufte's style
+% from some of his books
+%
+% * Only h1 and h2 are valid
+% * \citep may be better than \cite
+% * \autoref doesn't work properly, may get better results with \ref
+% * footnotes don't work inside of tables
+%
+
+
+\documentclass{tufte-handout}
+%\documentclass[justified]{tufte-handout}
+
+
+% Use default packages for memoir setup
+
+\usepackage{fancyvrb} % Allow \verbatim et al. in footnotes
+\usepackage{graphicx} % To enable including graphics in pdf's
+\usepackage{booktabs} % Better tables
+\usepackage{tabulary} % Support longer table cells
+\usepackage[utf8]{inputenc} % For UTF-8 support
+\usepackage[T1]{fontenc} % Use T1 font encoding for accented characters
+\usepackage{xcolor} % Allow for color (annotations)
+\usepackage{listings} % Allow for source code highlighting
+\usepackage{subscript}
+\usepackage{acronym} % Support acronyms
+
+
+\usepackage{glossaries}
+\glstoctrue
+\makeglossaries
+\makeindex
+
+
+% Configure default metadata to avoid errors
+\input{mmd6-default-metadata}
+