<div dir="ltr"><div>This isn't exactly what you asked for, but it might help. I wrote an article about typesetting the literate sources for MetaPost as a PDF (similar to how TeX: The Program can be produced from the TeX sources).</div><div><br></div><div>Some of the info is probably out of date as I wrote this a few years ago, but maybe it can help you navigate the MetaPost sources? Here is the original markdown text. Enjoy!</div><div><br></div><div>---- begin here ---</div><div><br></div><div>Donald Knuth invented the WEB language for literate programming. A<br>literate program reads like a book (or very long article) and can be<br>compiled into executable code. Literate programming does NOT mean<br>fancy documentation; it means the programmer can present source code<br>in the order most suitable for exposition. WEB allows the programmer<br>to express how to extract a TeX document from the source code and<br>how to extract a set of source files from the same code that<br>can be compiled. </div><div><br></div><div>In any case, METAPOST is written in WEB, meaning both a TeX document<br>and an executable can be created from the same source. This article<br>describes how to get a TeX document from the METAPOST sources.</div><div><br></div><div>A WEB program is turned into a TeX document using the WEAVE program;<br>similarly, the TANGLE program will produce source code that can be<br>compiled. There isn't a single WEB language for all types of source<br>code; rather, specific WEBs exist for each source language. METAPOST<br>is written in CWEB, the WEB for the C language. Therefore, the WEAVE<br>and TANGLE programs for CWEB are CWEAVE and CTANGLE.</div><div><br></div><div>The METAPOST project is hosted at<br><a href="http://foundry.supelec.fr/gf/project/metapost">http://foundry.supelec.fr/gf/project/metapost</a>. The sources are in SVN<br>and can be downloaded from that page. The METAPOST source itself is<br>located a ways down the directory tree:<br>/trunk/metapost/source/texk/web2c/mplibdir. In mplibdir you will find<br>9 ".w" files, each representing a portion of METAPOST: mp.w, mpmath.w,<br>mpmathdouble.w, mpost.w, mpstrings.w, mpxout.w, psout.w, svgout.w, and<br>tfmin.w.</div><div><br></div><div>To create TeX documents from these files, simply execute CWEAVE on<br>them. If you have a modern TeX distribution installed (such as TeXLive<br>2011), then CWEAVE should already exist on your system:</div><div><br></div><div>  cweave mp.w<br>  cweave mpmath.w<br>  etc.</div><div><br></div><div>Each invocation will produce a corresponding .tex file (e.g., "mp.tex", "mpmath.tex", etc.). Producing a PDF is easy as:</div><div><br></div><div>  pdftex mp<br>  pdftex mpmath</div><div><br></div><div>Some TeX errors seem to have crept into the source (when was the last time<br>someone tried this, I wonder?), but even so you still get a book size document<br>describing the implementation of METAPOST.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 28, 2018 at 4:55 PM, Estevão Vinícius Candia <span dir="ltr"><<a href="mailto:estevao.candia@ifms.edu.br" target="_blank">estevao.candia@ifms.edu.br</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">My name is Estevão Vinícius, I teach mathematics at Federal Institute of Mato Grosso do Sul, Brazil. I'm also getting my Master's Degree in Mathematics. My research is about how math is inside MetaPost and we hope to persuade teachers and professors to use it to their latex papers, tests, ect.</span> </div><div><br></div><div>

<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">My mentor and I are happy to produce metapost material in portuguese. We couldn't find any researches about it in our language. I talked to John Hobby these days about it and he's allowed me to publish a portuguese version of  "MetaPost - a user’s manual" and sent me the files he has from it. But he only has the older version.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">I asked him about this version of February 19th, 2018 and he wasn't aware of it. He said he gave Taco Hoekwater and all <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">the MetaPost development team the freedom to do whatever you guys want. So I hope I can get an answer from you guys.</span></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Is it possible to you send me the files (.tex, .mp, ....) so I can translate it to brazilian portuguese? 

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">This would be a helping hand for me to create a top quality translation material.</span>

</span></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">I'd like to add another question: do you know anything about a mathematics research group studying MetaPost? I can't find anything.</span></span></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Thank you in advance and I hope to talk to you soon again!</span></span></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Att.,</div><span class="HOEnZb"><font color="#888888"><div>-- <br><div class="m_7219140006482075267gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><b>Estevão Vinícius Candia</b></div><div>Professor EBTT de Matemática</div><div>Instituto Federal de Mato Grosso do Sul - Campus Corumbá</div></div></div></div></div>
</div></font></span></div></div>
<br>--<br>
<a href="http://tug.org/metapost/" target="_blank" rel="noreferrer">http://tug.org/metapost/</a><br></blockquote></div><br></div>