CreateMW - Maple Help

# Online Help

###### All Products    Maple    MapleSim

eBookTools

 CreateMW
 convert Maple worksheets to MW book

 Calling Sequence CreateMW(book, settings)

Parameters

 book - book object created using NewBook settings - (optional) settings table; see Settings

Description

 • The CreateMW command performs transformation of Maple worksheets, where the output worksheets are formatted similar to the HTML output from DocBook.
 • The output worksheets are stored in a default location (see eBookTools[GetDefaultOutputDir]) or in a location that you can specify (see eBookTools[SetOutputDir).

Examples

 > $\mathrm{with}\left(\mathrm{eBookTools}\right):$
 > $\mathrm{book_name}≔"eBookSample":$
 > $\mathrm{book}≔\mathrm{NewBook}\left(\mathrm{book_name},"eBook Sample Book","Maplesoft, a division of Waterloo Maple Inc.","2012"\right):$
 > $\mathrm{AddChapter}\left(\mathrm{book},"preface",\mathrm{cat}\left(\mathrm{kernelopts}\left('\mathrm{datadir}'\right),"/eBookTools/Preface.mw"\right)\right):$
 > $\mathrm{AddChapter}\left(\mathrm{book},1,\mathrm{cat}\left(\mathrm{kernelopts}\left('\mathrm{datadir}'\right),"/eBookTools/GettingStartedWithMaple.mw"\right)\right):$
 > $\mathrm{CreateMW}\left(\mathrm{book}\right)$

Store generated worksheets in a help database:

 > $\mathrm{settings}≔\mathrm{table}\left(\left["mpl.mw.hyperlink"="help"\right]\right):$
 > $\mathrm{CreateMW}\left(\mathrm{book},\mathrm{settings}\right)$
 > $\mathrm{mw_dir}≔\mathrm{FileTools}:-\mathrm{JoinPath}\left(\left[\mathrm{GetDefaultOutputDir}\left(\right),"mw",\mathrm{book_name}\right]\right):$
 > $\mathrm{hdb}≔\mathrm{FileTools}:-\mathrm{JoinPath}\left(\left["maple","toolbox","18","eBookTools","lib","maple.help"\right],\mathrm{base}=\mathrm{homedir}\right):$
 > $\mathbf{if}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{not}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{FileTools}:-\mathrm{Exists}\left(\mathrm{hdb}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{then}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{hdb}≔\mathrm{HelpTools}:-\mathrm{Database}:-\mathrm{Create}\left(\mathrm{hdb}\right)\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{if}:$
 > $\mathrm{files}≔\mathrm{HelpTools}:-\mathrm{Worksheet}:-\mathrm{Find}\left(\mathrm{mw_dir},\mathrm{language}="en",\mathrm{product}="User Help",\mathrm{category}="eBook"\right):$
 > $\mathrm{HelpTools}:-\mathrm{Worksheet}:-\mathrm{Store}\left(\mathrm{files},\mathrm{hdb}\right):$
 > $\mathbf{for}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{mw}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{in}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{indices}\left(\mathrm{files},'\mathrm{nolist}'\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{toc}≔\mathrm{Record}\left('\mathrm{entry}'=\mathrm{book_name},'\mathrm{topic}'=\mathrm{NULL},'\mathrm{priority}'=\mathrm{files}\left[\mathrm{mw}\right]\left["priority"\right],'\mathrm{language}'=\mathrm{files}\left[\mathrm{mw}\right]\left["language"\right],'\mathrm{product}'=\mathrm{files}\left[\mathrm{mw}\right]\left["product"\right],'\mathrm{category}'=\mathrm{files}\left[\mathrm{mw}\right]\left["category"\right],'\mathrm{children}'=\left[\mathrm{Record}\left('\mathrm{entry}'=\mathrm{StringTools}:-\mathrm{Split}\left(\mathrm{files}\left[\mathrm{mw}\right]\left["topic"\right],","\right)\left[2\right],'\mathrm{topic}'=\mathrm{files}\left[\mathrm{mw}\right]\left["topic"\right],'\mathrm{priority}'=\mathrm{files}\left[\mathrm{mw}\right]\left["priority"\right],'\mathrm{language}'=\mathrm{files}\left[\mathrm{mw}\right]\left["language"\right],'\mathrm{product}'=\mathrm{files}\left[\mathrm{mw}\right]\left["product"\right],'\mathrm{category}'=\mathrm{files}\left[\mathrm{mw}\right]\left["category"\right],'\mathrm{children}'=\mathrm{NULL}\right)\right]\right);\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{HelpTools}:-\mathrm{TableOfContents}:-\mathrm{Load}\left(\mathrm{toc},\mathrm{hdb}\right)\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}:$

Compatibility

 • The eBookTools[CreateMW] command was introduced in Maple 16.
 • For more information on Maple 16 changes, see Updates in Maple 16.

 See Also